3 <!-- SECTION: Programming -->
5 <title>CUPS API
</title>
6 <meta name=
"keywords" content=
"Programming">
7 <meta http-equiv=
"Content-Type" content=
"text/html;charset=utf-8">
8 <meta name=
"creator" content=
"Mini-XML v2.11">
9 <meta name=
"author" content=
"Unknown">
10 <meta name=
"copyright" content=
"Unknown">
11 <style type=
"text/css"><!--
13 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
16 H1, H2, H3, H4, H5, H6, P, TD, TH {
17 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
21 font-family: monaco, courier, monospace;
26 font-family: monaco, courier, monospace;
30 border: dotted thin #7f7f7f;
58 border: dotted thin #999999;
63 PRE.command EM, PRE.example EM {
64 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
68 font-family: monaco, courier, monospace;
79 border: solid thin #999999;
90 -moz-border-radius: 10px;
95 text-decoration: none;
98 A:link:hover, A:visited:hover, A:active {
99 text-decoration: underline;
106 TR.data, TD.data, TR.data TD {
109 border-bottom: solid 1pt #999999;
113 border-bottom: solid 1pt #999999;
120 border: solid thin #999999;
121 border-collapse: collapse;
137 border: solid thin #cccccc;
144 border-bottom: solid thin #999999;
153 caption-side: bottom;
177 border: thin solid black;
185 H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
194 border-bottom: solid 2pt #000000;
197 DIV.indent, TABLE.indent {
205 border-collapse: collapse;
208 TABLE.indent TD, TABLE.indent TH {
213 border-collapse: collapse;
221 border-bottom: solid thin #cccccc;
226 vertical-align: bottom;
235 border-bottom: solid thin #eeeeee;
240 TABLE.list TR:nth-child(even) {
244 TABLE.list TR:nth-child(odd) {
263 font-family: monaco, courier, monospace;
267 border: solid thin #999999;
268 border-collapse: collapse;
273 DIV.summary TABLE TD, DIV.summary TABLE TH {
274 border: solid thin #999999;
280 DIV.summary TABLE THEAD TH {
284 /* API documentation styles... */
291 div.body h3, div.body h4, div.body h5 {
292 margin-bottom: 0.5em;
295 .class, .enumeration, .function, .struct, .typedef, .union {
296 border-bottom: solid thin #999999;
303 code, p.code, pre, ul.code li {
304 font-family: monaco, courier, monospace;
307 ul.code, ul.contents, ul.subcontents {
308 list-style-type: none;
318 ul.contents li ul.code, ul.contents li ul.subcontents {
331 margin-bottom: 0.5em;
334 /* This is just for the HTML files generated with the framedhelp target */
337 border: solid thin black;
346 div.contents ul.contents {
349 div.contents ul.subcontents li {
357 CUPS API header for CUPS.
359 Copyright 2008-2011 by Apple Inc.
361 These coded instructions, statements, and computer programs are the
362 property of Apple Inc. and are protected by Federal copyright
363 law. Distribution and use rights are outlined in the file "LICENSE.txt"
364 which should have been included with this file. If this file is
365 file is missing or damaged, see the license at "http://www.cups.org/".
368 <h1 class='title'
>CUPS API
</h1>
370 <div class='summary'
><table summary='General Information'
>
384 <td>Programming:
<a href='api-overview.html' target='_top'
>Introduction to CUPS Programming
</a><br>
385 Programming:
<a href='api-array.html' target='_top'
>Array API
</a><br>
386 Programming:
<a href='api-filedir.html' target='_top'
>File and Directory APIs
</a><br>
387 Programming:
<a href='api-filter.html' target='_top'
>Filter and Backend Programming
</a><br>
388 Programming:
<a href='api-httpipp.html' target='_top'
>HTTP and IPP APIs
</a><br>
389 Programming:
<a href='api-ppd.html' target='_top'
>PPD API
</a><br>
390 Programming:
<a href='api-raster.html' target='_top'
>Raster API
</a></td>
394 <div class=
"contents">
395 <h2 class=
"title">Contents
</h2>
396 <ul class=
"contents">
397 <li><a href=
"#OVERVIEW">Overview
</a><ul class=
"subcontents">
398 <li><a href=
"#CLIENTS_AND_SERVERS">Clients and Servers
</a></li>
399 <li><a href=
"#PRINTERS_AND_CLASSES">Printers and Classes
</a></li>
400 <li><a href=
"#OPTIONS">Options
</a></li>
401 <li><a href=
"#PRINT_JOBS">Print Jobs
</a></li>
402 <li><a href=
"#ERROR_HANDLING">Error Handling
</a></li>
403 <li><a href=
"#PASSWORDS_AND_AUTHENTICATION">Passwords and Authentication
</a></li>
405 <li><a href=
"#FUNCTIONS">Functions
</a><ul class=
"subcontents">
406 <li><a href=
"#cupsAddDest">cupsAddDest
</a></li>
407 <li><a href=
"#cupsAddOption">cupsAddOption
</a></li>
408 <li><a href=
"#cupsAdminCreateWindowsPPD">cupsAdminCreateWindowsPPD
</a></li>
409 <li><a href=
"#cupsAdminExportSamba">cupsAdminExportSamba
</a></li>
410 <li><a href=
"#cupsAdminGetServerSettings">cupsAdminGetServerSettings
</a></li>
411 <li><a href=
"#cupsAdminSetServerSettings">cupsAdminSetServerSettings
</a></li>
412 <li><a href=
"#cupsCancelDestJob">cupsCancelDestJob
</a></li>
413 <li><a href=
"#cupsCancelJob">cupsCancelJob
</a></li>
414 <li><a href=
"#cupsCancelJob2">cupsCancelJob2
</a></li>
415 <li><a href=
"#cupsCheckDestSupported">cupsCheckDestSupported
</a></li>
416 <li><a href=
"#cupsCloseDestJob">cupsCloseDestJob
</a></li>
417 <li><a href=
"#cupsConnectDest">cupsConnectDest
</a></li>
418 <li><a href=
"#cupsConnectDestBlock">cupsConnectDestBlock
</a></li>
419 <li><a href=
"#cupsCopyDest">cupsCopyDest
</a></li>
420 <li><a href=
"#cupsCopyDestConflicts">cupsCopyDestConflicts
</a></li>
421 <li><a href=
"#cupsCopyDestInfo">cupsCopyDestInfo
</a></li>
422 <li><a href=
"#cupsCreateDestJob">cupsCreateDestJob
</a></li>
423 <li><a href=
"#cupsCreateJob">cupsCreateJob
</a></li>
424 <li><a href=
"#cupsEncryption">cupsEncryption
</a></li>
425 <li><a href=
"#cupsEnumDests">cupsEnumDests
</a></li>
426 <li><a href=
"#cupsEnumDestsBlock">cupsEnumDestsBlock
</a></li>
427 <li><a href=
"#cupsFindDestDefault">cupsFindDestDefault
</a></li>
428 <li><a href=
"#cupsFindDestReady">cupsFindDestReady
</a></li>
429 <li><a href=
"#cupsFindDestSupported">cupsFindDestSupported
</a></li>
430 <li><a href=
"#cupsFinishDestDocument">cupsFinishDestDocument
</a></li>
431 <li><a href=
"#cupsFinishDocument">cupsFinishDocument
</a></li>
432 <li><a href=
"#cupsFreeDestInfo">cupsFreeDestInfo
</a></li>
433 <li><a href=
"#cupsFreeDests">cupsFreeDests
</a></li>
434 <li><a href=
"#cupsFreeJobs">cupsFreeJobs
</a></li>
435 <li><a href=
"#cupsFreeOptions">cupsFreeOptions
</a></li>
436 <li><a href=
"#cupsGetClasses">cupsGetClasses
</a></li>
437 <li><a href=
"#cupsGetDefault">cupsGetDefault
</a></li>
438 <li><a href=
"#cupsGetDefault2">cupsGetDefault2
</a></li>
439 <li><a href=
"#cupsGetDest">cupsGetDest
</a></li>
440 <li><a href=
"#cupsGetDestMediaByIndex">cupsGetDestMediaByIndex
</a></li>
441 <li><a href=
"#cupsGetDestMediaByName">cupsGetDestMediaByName
</a></li>
442 <li><a href=
"#cupsGetDestMediaBySize">cupsGetDestMediaBySize
</a></li>
443 <li><a href=
"#cupsGetDestMediaCount">cupsGetDestMediaCount
</a></li>
444 <li><a href=
"#cupsGetDestMediaDefault">cupsGetDestMediaDefault
</a></li>
445 <li><a href=
"#cupsGetDestWithURI">cupsGetDestWithURI
</a></li>
446 <li><a href=
"#cupsGetDests">cupsGetDests
</a></li>
447 <li><a href=
"#cupsGetDests2">cupsGetDests2
</a></li>
448 <li><a href=
"#cupsGetJobs">cupsGetJobs
</a></li>
449 <li><a href=
"#cupsGetJobs2">cupsGetJobs2
</a></li>
450 <li><a href=
"#cupsGetNamedDest">cupsGetNamedDest
</a></li>
451 <li><a href=
"#cupsGetOption">cupsGetOption
</a></li>
452 <li><a href=
"#cupsGetPassword">cupsGetPassword
</a></li>
453 <li><a href=
"#cupsGetPassword2">cupsGetPassword2
</a></li>
454 <li><a href=
"#cupsGetPrinters">cupsGetPrinters
</a></li>
455 <li><a href=
"#cupsLangDefault">cupsLangDefault
</a></li>
456 <li><a href=
"#cupsLangEncoding">cupsLangEncoding
</a></li>
457 <li><a href=
"#cupsLangFlush">cupsLangFlush
</a></li>
458 <li><a href=
"#cupsLangFree">cupsLangFree
</a></li>
459 <li><a href=
"#cupsLangGet">cupsLangGet
</a></li>
460 <li><a href=
"#cupsLocalizeDestMedia">cupsLocalizeDestMedia
</a></li>
461 <li><a href=
"#cupsLocalizeDestOption">cupsLocalizeDestOption
</a></li>
462 <li><a href=
"#cupsLocalizeDestValue">cupsLocalizeDestValue
</a></li>
463 <li><a href=
"#cupsNotifySubject">cupsNotifySubject
</a></li>
464 <li><a href=
"#cupsNotifyText">cupsNotifyText
</a></li>
465 <li><a href=
"#cupsParseOptions">cupsParseOptions
</a></li>
466 <li><a href=
"#cupsPrintFile">cupsPrintFile
</a></li>
467 <li><a href=
"#cupsPrintFile2">cupsPrintFile2
</a></li>
468 <li><a href=
"#cupsPrintFiles">cupsPrintFiles
</a></li>
469 <li><a href=
"#cupsPrintFiles2">cupsPrintFiles2
</a></li>
470 <li><a href=
"#cupsRemoveDest">cupsRemoveDest
</a></li>
471 <li><a href=
"#cupsRemoveOption">cupsRemoveOption
</a></li>
472 <li><a href=
"#cupsServer">cupsServer
</a></li>
473 <li><a href=
"#cupsSetClientCertCB">cupsSetClientCertCB
</a></li>
474 <li><a href=
"#cupsSetCredentials">cupsSetCredentials
</a></li>
475 <li><a href=
"#cupsSetDefaultDest">cupsSetDefaultDest
</a></li>
476 <li><a href=
"#cupsSetDests">cupsSetDests
</a></li>
477 <li><a href=
"#cupsSetDests2">cupsSetDests2
</a></li>
478 <li><a href=
"#cupsSetEncryption">cupsSetEncryption
</a></li>
479 <li><a href=
"#cupsSetPasswordCB">cupsSetPasswordCB
</a></li>
480 <li><a href=
"#cupsSetPasswordCB2">cupsSetPasswordCB2
</a></li>
481 <li><a href=
"#cupsSetServer">cupsSetServer
</a></li>
482 <li><a href=
"#cupsSetServerCertCB">cupsSetServerCertCB
</a></li>
483 <li><a href=
"#cupsSetUser">cupsSetUser
</a></li>
484 <li><a href=
"#cupsSetUserAgent">cupsSetUserAgent
</a></li>
485 <li><a href=
"#cupsStartDestDocument">cupsStartDestDocument
</a></li>
486 <li><a href=
"#cupsStartDocument">cupsStartDocument
</a></li>
487 <li><a href=
"#cupsTempFd">cupsTempFd
</a></li>
488 <li><a href=
"#cupsTempFile">cupsTempFile
</a></li>
489 <li><a href=
"#cupsTempFile2">cupsTempFile2
</a></li>
490 <li><a href=
"#cupsUser">cupsUser
</a></li>
491 <li><a href=
"#cupsUserAgent">cupsUserAgent
</a></li>
492 <li><a href=
"#pwgFormatSizeName">pwgFormatSizeName
</a></li>
493 <li><a href=
"#pwgInitSize">pwgInitSize
</a></li>
494 <li><a href=
"#pwgMediaForLegacy">pwgMediaForLegacy
</a></li>
495 <li><a href=
"#pwgMediaForPPD">pwgMediaForPPD
</a></li>
496 <li><a href=
"#pwgMediaForPWG">pwgMediaForPWG
</a></li>
497 <li><a href=
"#pwgMediaForSize">pwgMediaForSize
</a></li>
499 <li><a href=
"#TYPES">Data Types
</a><ul class=
"subcontents">
500 <li><a href=
"#cups_client_cert_cb_t">cups_client_cert_cb_t
</a></li>
501 <li><a href=
"#cups_dest_block_t">cups_dest_block_t
</a></li>
502 <li><a href=
"#cups_dest_cb_t">cups_dest_cb_t
</a></li>
503 <li><a href=
"#cups_dest_t">cups_dest_t
</a></li>
504 <li><a href=
"#cups_dinfo_t">cups_dinfo_t
</a></li>
505 <li><a href=
"#cups_job_t">cups_job_t
</a></li>
506 <li><a href=
"#cups_option_t">cups_option_t
</a></li>
507 <li><a href=
"#cups_password_cb2_t">cups_password_cb2_t
</a></li>
508 <li><a href=
"#cups_password_cb_t">cups_password_cb_t
</a></li>
509 <li><a href=
"#cups_ptype_t">cups_ptype_t
</a></li>
510 <li><a href=
"#cups_server_cert_cb_t">cups_server_cert_cb_t
</a></li>
511 <li><a href=
"#cups_size_t">cups_size_t
</a></li>
512 <li><a href=
"#pwg_map_t">pwg_map_t
</a></li>
513 <li><a href=
"#pwg_media_t">pwg_media_t
</a></li>
514 <li><a href=
"#pwg_size_t">pwg_size_t
</a></li>
516 <li><a href=
"#STRUCTURES">Structures
</a><ul class=
"subcontents">
517 <li><a href=
"#cups_dest_s">cups_dest_s
</a></li>
518 <li><a href=
"#cups_job_s">cups_job_s
</a></li>
519 <li><a href=
"#cups_option_s">cups_option_s
</a></li>
520 <li><a href=
"#cups_size_s">cups_size_s
</a></li>
521 <li><a href=
"#pollfd">pollfd
</a></li>
522 <li><a href=
"#pwg_map_s">pwg_map_s
</a></li>
523 <li><a href=
"#pwg_media_s">pwg_media_s
</a></li>
524 <li><a href=
"#pwg_size_s">pwg_size_s
</a></li>
526 <li><a href=
"#VARIABLES">Variables
</a><ul class=
"subcontents">
527 <li><a href=
"#CF_RETURNS_RETAINED">CF_RETURNS_RETAINED
</a></li>
529 <li><a href=
"#ENUMERATIONS">Enumerations
</a><ul class=
"subcontents">
530 <li><a href=
"#cups_ptype_e">cups_ptype_e
</a></li>
536 API introduction for CUPS.
538 Copyright 2007-2013 by Apple Inc.
539 Copyright 1997-2006 by Easy Software Products, all rights reserved.
541 These coded instructions, statements, and computer programs are the
542 property of Apple Inc. and are protected by Federal copyright
543 law. Distribution and use rights are outlined in the file "LICENSE.txt"
544 which should have been included with this file. If this file is
545 file is missing or damaged, see the license at "http://www.cups.org/".
548 <h2 class='title'
><a name='OVERVIEW'
>Overview
</a></h2>
550 <p>The CUPS API provides the convenience functions needed to support
551 applications, filters, printer drivers, and backends that need to interface
552 with the CUPS scheduler.
</p>
554 <h3><a name='CLIENTS_AND_SERVERS'
>Clients and Servers
</a></h3>
556 <p>CUPS is based on the Internet Printing Protocol (
"IPP"), which allows
557 clients (applications) to communicate with a server (the scheduler) to get a
558 list of printers, send print jobs, and so forth. You identify which server
559 you want to communicate with using a pointer to the opaque structure
560 <code>http_t
</code>. All of the examples in this document use the
561 <code>CUPS_HTTP_DEFAULT
</code> constant, referring to the default connection
562 to the scheduler. The
<a href='api-httpipp.html' target='_top'
>HTTP and IPP
563 APIs
</a> document provides more information on server connections.
</p>
565 <h3><a name='PRINTERS_AND_CLASSES'
>Printers and Classes
</a></h3>
567 <p>Printers and classes (collections of printers) are accessed through
568 the
<a href=
"#cups_dest_t"><code>cups_dest_t
</code></a> structure which
569 includes the name (
<code>name
</code>), instance (
<code>instance
</code> -
570 a way of selecting certain saved options/settings), and the options and
571 attributes associated with that destination (
<code>num_options
</code> and
572 <code>options
</code>). Destinations are created using the
573 <a href=
"#cupsGetDests"><code>cupsGetDests
</code></a> function and freed
574 using the
<a href='#cupsFreeDests'
><code>cupsFreeDests
</code></a> function.
575 The
<a href='#cupsGetDest'
><code>cupsGetDest
</code></a> function finds a
576 specific destination for printing:
</p>
578 <pre class='example'
>
579 #include
<cups/cups.h
>
581 <a href='#cups_dest_t'
>cups_dest_t
</a> *dests;
582 int num_dests =
<a href='#cupsGetDests'
>cupsGetDests
</a>(
&dests);
583 <a href='#cups_dest_t'
>cups_dest_t
</a> *dest =
<a href='#cupsGetDest'
>cupsGetDest
</a>(
"name", NULL, num_dests, dests);
585 /* do something with dest */
587 <a href='#cupsFreeDests'
>cupsFreeDests
</a>(num_dests, dests);
590 <p>Passing
<code>NULL
</code> to
591 <a href='#cupsGetDest'
><code>cupsGetDest
</code></a> for the destination name
592 will return the default destination. Similarly, passing a
<code>NULL
</code>
593 instance will return the default instance for that destination.
</p>
595 <div class='table'
><table summary='Table
1: Printer Attributes' width='
80%'
>
596 <caption>Table
1:
<a name='TABLE1'
>Printer Attributes
</a></caption>
599 <th>Attribute Name
</th>
605 <td>"auth-info-required"</td>
606 <td>The type of authentication required for printing to this
607 destination:
"none",
"username,password",
"domain,username,password",
608 or
"negotiate" (Kerberos)
</td>
611 <td>"printer-info"</td>
612 <td>The human-readable description of the destination such as
"My
616 <td>"printer-is-accepting-jobs"</td>
617 <td>"true" if the destination is accepting new jobs,
"false" if
621 <td>"printer-is-shared"</td>
622 <td>"true" if the destination is being shared with other computers,
626 <td>"printer-location"</td>
627 <td>The human-readable location of the destination such as
"Lab 4".
</td>
630 <td>"printer-make-and-model"</td>
631 <td>The human-readable make and model of the destination such as
"HP
632 LaserJet 4000 Series".
</td>
635 <td>"printer-state"</td>
636 <td>"3" if the destination is idle,
"4" if the destination is printing
637 a job, and
"5" if the destination is stopped.
</td>
640 <td>"printer-state-change-time"</td>
641 <td>The UNIX time when the destination entered the current state.
</td>
644 <td>"printer-state-reasons"</td>
645 <td>Additional comma-delimited state keywords for the destination
646 such as
"media-tray-empty-error" and
"toner-low-warning".
</td>
649 <td>"printer-type"</td>
650 <td>The
<a href='#cups_printer_t'
><code>cups_printer_t
</code></a>
651 value associated with the destination.
</td>
656 <h3><a name='OPTIONS'
>Options
</a></h3>
658 <p>Options are stored in arrays of
659 <a href='#cups_option_t'
><code>cups_option_t
</code></a> structures. Each
660 option has a name (
<code>name
</code>) and value (
<code>value
</code>)
661 associated with it. The
<a href='#cups_dest_t'
><code>cups_dest_t
</code></a>
662 <code>num_options
</code> and
<code>options
</code> members contain the
663 default options for a particular destination, along with several informational
664 attributes about the destination as shown in
<a href='#TABLE1'
>Table
1</a>.
665 The
<a href='#cupsGetOption'
><code>cupsGetOption
</code></a> function gets
666 the value for the named option. For example, the following code lists the
667 available destinations and their human-readable descriptions:
</p>
669 <pre class='example'
>
670 #include
<cups/cups.h
>
672 <a href='#cups_dest_t'
>cups_dest_t
</a> *dests;
673 int num_dests =
<a href='#cupsGetDests'
>cupsGetDests
</a>(
&dests);
674 <a href='#cups_dest_t'
>cups_dest_t
</a> *dest;
678 for (i = num_dests, dest = dests; i
> 0; i --, dest ++)
679 if (dest-
>instance == NULL)
681 value =
<a href='#cupsGetOption'
>cupsGetOption
</a>(
"printer-info", dest-
>num_options, dest-
>options);
682 printf(
"%s (%s)\n", dest-
>name, value ? value :
"no description");
685 <a href='#cupsFreeDests'
>cupsFreeDests
</a>(num_dests, dests);
688 <p>You can create your own option arrays using the
689 <a href='#cupsAddOption'
><code>cupsAddOption
</code></a> function, which
690 adds a single named option to an array:
</p>
692 <pre class='example'
>
693 #include
<cups/cups.h
>
696 <a href='#cups_option_t'
>cups_option_t
</a> *options = NULL;
698 /* The returned num_options value is updated as needed */
699 num_options =
<a href='#cupsAddOption'
>cupsAddOption
</a>(
"first",
"value", num_options,
&options);
701 /* This adds a second option value */
702 num_options =
<a href='#cupsAddOption'
>cupsAddOption
</a>(
"second",
"value", num_options,
&options);
704 /* This replaces the first option we added */
705 num_options =
<a href='#cupsAddOption'
>cupsAddOption
</a>(
"first",
"new value", num_options,
&options);
708 <p>Use a
<code>for
</code> loop to copy the options from a destination:
</p>
710 <pre class='example'
>
711 #include
<cups/cups.h
>
715 <a href='#cups_option_t'
>cups_option_t
</a> *options = NULL;
716 <a href='#cups_dest_t'
>cups_dest_t
</a> *dest;
718 for (i =
0; i
< dest-
>num_options; i ++)
719 num_options =
<a href='#cupsAddOption'
>cupsAddOption
</a>(dest-
>options[i].name, dest-
>options[i].value,
720 num_options,
&options);
723 <p>Use the
<a href='#cupsFreeOptions'
><code>cupsFreeOptions
</code></a>
724 function to free the options array when you are done using it:
</p>
726 <pre class='example'
>
727 <a href='#cupsFreeOptions'
>cupsFreeOptions
</a>(num_options, options);
730 <h3><a name='PRINT_JOBS'
>Print Jobs
</a></h3>
732 <p>Print jobs are identified by a locally-unique job ID number from
1 to
733 2<sup>31</sup>-
1 and have options and one or more files for printing to a
734 single destination. The
<a href='#cupsPrintFile'
><code>cupsPrintFile
</code></a>
735 function creates a new job with one file. The following code prints the CUPS
738 <pre class='example'
>
739 #include
<cups/cups.h
>
741 <a href='#cups_dest_t'
>cups_dest_t
</a> *dest;
743 <a href='#cups_option_t'
>cups_option_t
</a> *options;
746 /* Print a single file */
747 job_id =
<a href='#cupsPrintFile'
>cupsPrintFile
</a>(dest-
>name,
"/usr/share/cups/data/testprint.ps",
748 "Test Print", num_options, options);
751 <p>The
<a href='#cupsPrintFiles'
><code>cupsPrintFiles
</code></a> function
752 creates a job with multiple files. The files are provided in a
753 <code>char *
</code> array:
</p>
755 <pre class='example'
>
756 #include
<cups/cups.h
>
758 <a href='#cups_dest_t'
>cups_dest_t
</a> *dest;
760 <a href='#cups_option_t'
>cups_option_t
</a> *options;
762 char *files[
3] = {
"file1.pdf",
"file2.pdf",
"file3.pdf" };
764 /* Print three files */
765 job_id =
<a href='#cupsPrintFiles'
>cupsPrintFiles
</a>(dest-
>name,
3, files,
"Test Print", num_options, options);
768 <p>Finally, the
<a href='#cupsCreateJob'
><code>cupsCreateJob
</code></a>
769 function creates a new job with no files in it. Files are added using the
770 <a href='#cupsStartDocument'
><code>cupsStartDocument
</code></a>,
771 <a href='api-httpipp.html#cupsWriteRequestData'
><code>cupsWriteRequestData
</code></a>,
772 and
<a href='#cupsFinishDocument'
><code>cupsFinishDocument
</code></a> functions.
773 The following example creates a job with
10 text files for printing:
</p>
775 <pre class='example'
>
776 #include
<cups/cups.h
>
778 <a href='#cups_dest_t'
>cups_dest_t
</a> *dest;
780 <a href='#cups_option_t'
>cups_option_t
</a> *options;
786 job_id =
<a href='#cupsCreateJob'
>cupsCreateJob
</a>(CUPS_HTTP_DEFAULT, dest-
>name,
"10 Text Files",
787 num_options, options);
789 /* If the job is created, add
10 files */
792 for (i =
1; i
<=
10; i ++)
794 snprintf(buffer, sizeof(buffer),
"file%d.txt", i);
796 <a href='#cupsStartDocument'
>cupsStartDocument
</a>(CUPS_HTTP_DEFAULT, dest-
>name, job_id, buffer,
797 CUPS_FORMAT_TEXT, i ==
10);
799 snprintf(buffer, sizeof(buffer),
807 /* cupsWriteRequestData can be called as many times as needed */
808 <a href='#cupsWriteRequestData'
>cupsWriteRequestData
</a>(CUPS_HTTP_DEFAULT, buffer, strlen(buffer));
810 <a href='#cupsFinishDocument'
>cupsFinishDocument
</a>(CUPS_HTTP_DEFAULT, dest-
>name);
815 <p>Once you have created a job, you can monitor its status using the
816 <a href='#cupsGetJobs'
><code>cupsGetJobs
</code></a> function, which returns
817 an array of
<a href='#cups_job_t'
><code>cups_job_t
</code></a> structures.
818 Each contains the job ID (
<code>id
</code>), destination name
819 (
<code>dest
</code>), title (
<code>title
</code>), and other information
820 associated with the job. The job array is freed using the
821 <a href='#cupsFreeJobs'
><code>cupsFreeJobs
</code></a> function. The following
822 example monitors a specific job ID, showing the current job state once every
823 5 seconds until the job is completed:
</p>
825 <pre class='example'
>
826 #include
<cups/cups.h
>
828 <a href='#cups_dest_t'
>cups_dest_t
</a> *dest;
831 <a href='#cups_job_t'
>cups_job_t
</a> *jobs;
833 ipp_jstate_t job_state = IPP_JOB_PENDING;
835 while (job_state
< IPP_JOB_STOPPED)
837 /* Get my jobs (
1) with any state (-
1) */
838 num_jobs =
<a href='#cupsGetJobs'
>cupsGetJobs
</a>(
&jobs, dest-
>name,
1, -
1);
840 /* Loop to find my job */
841 job_state = IPP_JOB_COMPLETED;
843 for (i =
0; i
< num_jobs; i ++)
844 if (jobs[i].id == job_id)
846 job_state = jobs[i].state;
850 /* Free the job array */
851 <a href='#cupsFreeJobs'
>cupsFreeJobs
</a>(num_jobs, jobs);
853 /* Show the current state */
856 case IPP_JOB_PENDING :
857 printf(
"Job %d is pending.\n", job_id);
860 printf(
"Job %d is held.\n", job_id);
862 case IPP_JOB_PROCESSING :
863 printf(
"Job %d is processing.\n", job_id);
865 case IPP_JOB_STOPPED :
866 printf(
"Job %d is stopped.\n", job_id);
868 case IPP_JOB_CANCELED :
869 printf(
"Job %d is canceled.\n", job_id);
871 case IPP_JOB_ABORTED :
872 printf(
"Job %d is aborted.\n", job_id);
874 case IPP_JOB_COMPLETED :
875 printf(
"Job %d is completed.\n", job_id);
879 /* Sleep if the job is not finished */
880 if (job_state
< IPP_JOB_STOPPED)
885 <p>To cancel a job, use the
886 <a href='#cupsCancelJob'
><code>cupsCancelJob
</code></a> function with the
889 <pre class='example'
>
890 #include
<cups/cups.h
>
892 <a href='#cups_dest_t'
>cups_dest_t
</a> *dest;
895 <a href='#cupsCancelJob'
>cupsCancelJob
</a>(dest-
>name, job_id);
898 <h3><a name='ERROR_HANDLING'
>Error Handling
</a></h3>
900 <p>If any of the CUPS API printing functions returns an error, the reason for
901 that error can be found by calling the
902 <a href='#cupsLastError'
><code>cupsLastError
</code></a> and
903 <a href='#cupsLastErrorString'
><code>cupsLastErrorString
</code></a> functions.
904 <a href='#cupsLastError'
><code>cupsLastError
</code></a> returns the last IPP
906 (
<a href='api-httpipp.html#ipp_status_t'
><code>ipp_status_t
</code></a>)
907 that was encountered, while
908 <a href='#cupsLastErrorString'
><code>cupsLastErrorString
</code></a> returns
909 a (localized) human-readable string that can be shown to the user. For example,
910 if any of the job creation functions returns a job ID of
0, you can use
911 <a href='#cupsLastErrorString'
><code>cupsLastErrorString
</code></a> to show
912 the reason why the job could not be created:
</p>
914 <pre class='example'
>
915 #include
<cups/cups.h
>
920 puts(cupsLastErrorString());
923 <h3><a name='PASSWORDS_AND_AUTHENTICATION'
>Passwords and Authentication
</a></h3>
925 <p>CUPS supports authentication of any request, including submission of print
926 jobs. The default mechanism for getting the username and password is to use the
927 login user and a password from the console.
</p>
929 <p>To support other types of applications, in particular Graphical User
930 Interfaces (
"GUIs"), the CUPS API provides functions to set the default
931 username and to register a callback function that returns a password string.
</p>
933 <p>The
<a href=
"#cupsSetPasswordCB"><code>cupsSetPasswordCB
</code></a>
934 function is used to set a password callback in your program. Only one
935 function can be used at any time.
</p>
937 <p>The
<a href=
"#cupsSetUser"><code>cupsSetUser
</code></a> function sets the
938 current username for authentication. This function can be called by your
939 password callback function to change the current username as needed.
</p>
941 <p>The following example shows a simple password callback that gets a
942 username and password from the user:
</p>
944 <pre class='example'
>
945 #include
<cups/cups.h
>
948 my_password_cb(const char *prompt)
955 /* Get a username from the user */
956 printf(
"Username: ");
957 if (fgets(user, sizeof(user), stdin) == NULL)
960 /* Strip the newline from the string and set the user */
961 user[strlen(user) -
1] = '\
0';
963 <a href='#cupsSetUser'
>cupsSetUser
</a>(user);
965 /* Use getpass() to ask for the password... */
966 return (getpass(
"Password: "));
969 <a href='#cupsSetPasswordCB'
>cupsSetPasswordCB
</a>(my_password_cb);
972 <p>Similarly, a GUI could display the prompt string in a window with input
973 fields for the username and password. The username should default to the
974 string returned by the
<a href=
"#cupsUser"><code>cupsUser
</code></a>
976 <h2 class=
"title"><a id=
"FUNCTIONS">Functions
</a></h2>
977 <h3 class=
"function"><a id=
"cupsAddDest">cupsAddDest
</a></h3>
978 <p class=
"description">Add a destination to the list of destinations.
</p>
980 int cupsAddDest (
<br />
981     const char *name,
<br />
982     const char *instance,
<br />
983     int num_dests,
<br />
984     <a href=
"#cups_dest_t">cups_dest_t
</a> **dests
<br />
986 <h4 class=
"parameters">Parameters
</h4>
989 <dd class=
"description">Destination name
</dd>
991 <dd class=
"description">Instance name or
<code>NULL
</code> for none/primary
</dd>
993 <dd class=
"description">Number of destinations
</dd>
995 <dd class=
"description">Destinations
</dd>
997 <h4 class=
"returnvalue">Return Value
</h4>
998 <p class=
"description">New number of destinations
</p>
999 <h4 class=
"discussion">Discussion
</h4>
1000 <p class=
"discussion">This function cannot be used to add a new class or printer queue,
1001 it only adds a new container of saved options for the named
1002 destination or instance.
<br>
1004 If the named destination already exists, the destination list is
1005 returned unchanged. Adding a new instance of a destination creates
1006 a copy of that destination's options.
<br>
1008 Use the
<a href=
"#cupsSaveDests"><code>cupsSaveDests
</code></a> function to save the updated list of
1009 destinations to the user's lpoptions file.
</p>
1010 <h3 class=
"function"><a id=
"cupsAddOption">cupsAddOption
</a></h3>
1011 <p class=
"description">Add an option to an option array.
</p>
1013 int cupsAddOption (
<br />
1014     const char *name,
<br />
1015     const char *value,
<br />
1016     int num_options,
<br />
1017     <a href=
"#cups_option_t">cups_option_t
</a> **options
<br />
1019 <h4 class=
"parameters">Parameters
</h4>
1022 <dd class=
"description">Name of option
</dd>
1024 <dd class=
"description">Value of option
</dd>
1025 <dt>num_options
</dt>
1026 <dd class=
"description">Number of options
</dd>
1028 <dd class=
"description">Pointer to options
</dd>
1030 <h4 class=
"returnvalue">Return Value
</h4>
1031 <p class=
"description">Number of options
</p>
1032 <h4 class=
"discussion">Discussion
</h4>
1033 <p class=
"discussion">New option arrays can be initialized simply by passing
0 for the
1034 "num_options
" parameter.
</p>
1035 <h3 class=
"function"><span class=
"info"> DEPRECATED
 </span><a id=
"cupsAdminCreateWindowsPPD">cupsAdminCreateWindowsPPD
</a></h3>
1036 <p class=
"description">Create the Windows PPD file for a printer.
</p>
1038 char *cupsAdminCreateWindowsPPD (
<br />
1039     http_t *http,
<br />
1040     const char *dest,
<br />
1041     char *buffer,
<br />
1042     int bufsize
<br />
1044 <h4 class=
"parameters">Parameters
</h4>
1047 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
1049 <dd class=
"description">Printer or class
</dd>
1051 <dd class=
"description">Filename buffer
</dd>
1053 <dd class=
"description">Size of filename buffer
</dd>
1055 <h4 class=
"returnvalue">Return Value
</h4>
1056 <p class=
"description">PPD file or NULL
</p>
1057 <h3 class=
"function"><span class=
"info"> DEPRECATED
 </span><a id=
"cupsAdminExportSamba">cupsAdminExportSamba
</a></h3>
1058 <p class=
"description">Export a printer to Samba.
</p>
1060 int cupsAdminExportSamba (
<br />
1061     const char *dest,
<br />
1062     const char *ppd,
<br />
1063     const char *samba_server,
<br />
1064     const char *samba_user,
<br />
1065     const char *samba_password,
<br />
1066     FILE *logfile
<br />
1068 <h4 class=
"parameters">Parameters
</h4>
1071 <dd class=
"description">Destination to export
</dd>
1073 <dd class=
"description">PPD file
</dd>
1074 <dt>samba_server
</dt>
1075 <dd class=
"description">Samba server
</dd>
1077 <dd class=
"description">Samba username
</dd>
1078 <dt>samba_password
</dt>
1079 <dd class=
"description">Samba password
</dd>
1081 <dd class=
"description">Log file, if any
</dd>
1083 <h4 class=
"returnvalue">Return Value
</h4>
1084 <p class=
"description">1 on success,
0 on failure
</p>
1085 <h3 class=
"function"><span class=
"info"> CUPS
1.3/macOS
10.5 </span><a id=
"cupsAdminGetServerSettings">cupsAdminGetServerSettings
</a></h3>
1086 <p class=
"description">Get settings from the server.
</p>
1088 int cupsAdminGetServerSettings (
<br />
1089     http_t *http,
<br />
1090     int *num_settings,
<br />
1091     <a href=
"#cups_option_t">cups_option_t
</a> **settings
<br />
1093 <h4 class=
"parameters">Parameters
</h4>
1096 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
1097 <dt>num_settings
</dt>
1098 <dd class=
"description">Number of settings
</dd>
1100 <dd class=
"description">Settings
</dd>
1102 <h4 class=
"returnvalue">Return Value
</h4>
1103 <p class=
"description">1 on success,
0 on failure
</p>
1104 <h4 class=
"discussion">Discussion
</h4>
1105 <p class=
"discussion">The returned settings should be freed with cupsFreeOptions() when
1106 you are done with them.
1109 <h3 class=
"function"><span class=
"info"> CUPS
1.3/macOS
10.5 </span><a id=
"cupsAdminSetServerSettings">cupsAdminSetServerSettings
</a></h3>
1110 <p class=
"description">Set settings on the server.
</p>
1112 int cupsAdminSetServerSettings (
<br />
1113     http_t *http,
<br />
1114     int num_settings,
<br />
1115     <a href=
"#cups_option_t">cups_option_t
</a> *settings
<br />
1117 <h4 class=
"parameters">Parameters
</h4>
1120 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
1121 <dt>num_settings
</dt>
1122 <dd class=
"description">Number of settings
</dd>
1124 <dd class=
"description">Settings
</dd>
1126 <h4 class=
"returnvalue">Return Value
</h4>
1127 <p class=
"description">1 on success,
0 on failure
</p>
1128 <h3 class=
"function"><a id=
"cupsCancelDestJob">cupsCancelDestJob
</a></h3>
1129 <p class=
"description">Include necessary headers...
</p>
1131 ipp_status_t cupsCancelDestJob (
<br />
1132     http_t *http,
<br />
1133     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
1134     int job_id
<br />
1136 <h4 class=
"parameters">Parameters
</h4>
1139 <dd class=
"description">Connection to destination
</dd>
1141 <dd class=
"description">Destination
</dd>
1143 <dd class=
"description">Job ID
</dd>
1145 <h4 class=
"returnvalue">Return Value
</h4>
1146 <p class=
"description">Cancel a job on a destination.
</p>
1147 <p class=
"discussion">The
"job_id
" is the number returned by cupsCreateDestJob.
<br>
1149 Returns
<code>IPP_STATUS_OK
</code> on success and
1150 <code>IPP_STATUS_ERRPR_NOT_AUTHORIZED
</code> or
1151 <code>IPP_STATUS_ERROR_FORBIDDEN
</code> on failure.
1154 <h3 class=
"function"><a id=
"cupsCancelJob">cupsCancelJob
</a></h3>
1155 <p class=
"description">Cancel a print job on the default server.
</p>
1157 int cupsCancelJob (
<br />
1158     const char *name,
<br />
1159     int job_id
<br />
1161 <h4 class=
"parameters">Parameters
</h4>
1164 <dd class=
"description">Name of printer or class
</dd>
1166 <dd class=
"description">Job ID,
<code>CUPS_JOBID_CURRENT
</code> for the current job, or
<code>CUPS_JOBID_ALL
</code> for all jobs
</dd>
1168 <h4 class=
"returnvalue">Return Value
</h4>
1169 <p class=
"description">1 on success,
0 on failure
</p>
1170 <h4 class=
"discussion">Discussion
</h4>
1171 <p class=
"discussion">Pass
<code>CUPS_JOBID_ALL
</code> to cancel all jobs or
<code>CUPS_JOBID_CURRENT
</code>
1172 to cancel the current job on the named destination.
<br>
1174 Use the
<a href=
"#cupsLastError"><code>cupsLastError
</code></a> and
<a href=
"#cupsLastErrorString"><code>cupsLastErrorString
</code></a> functions to get
1175 the cause of any failure.
</p>
1176 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"cupsCancelJob2">cupsCancelJob2
</a></h3>
1177 <p class=
"description">Cancel or purge a print job.
</p>
1179 ipp_status_t cupsCancelJob2 (
<br />
1180     http_t *http,
<br />
1181     const char *name,
<br />
1182     int job_id,
<br />
1183     int purge
<br />
1185 <h4 class=
"parameters">Parameters
</h4>
1188 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
1190 <dd class=
"description">Name of printer or class
</dd>
1192 <dd class=
"description">Job ID,
<code>CUPS_JOBID_CURRENT
</code> for the current job, or
<code>CUPS_JOBID_ALL
</code> for all jobs
</dd>
1194 <dd class=
"description">1 to purge,
0 to cancel
</dd>
1196 <h4 class=
"returnvalue">Return Value
</h4>
1197 <p class=
"description">IPP status
</p>
1198 <h4 class=
"discussion">Discussion
</h4>
1199 <p class=
"discussion">Canceled jobs remain in the job history while purged jobs are removed
1200 from the job history.
<br>
1202 Pass
<code>CUPS_JOBID_ALL
</code> to cancel all jobs or
<code>CUPS_JOBID_CURRENT
</code>
1203 to cancel the current job on the named destination.
<br>
1205 Use the
<a href=
"#cupsLastError"><code>cupsLastError
</code></a> and
<a href=
"#cupsLastErrorString"><code>cupsLastErrorString
</code></a> functions to get
1206 the cause of any failure.
1209 <h3 class=
"function"><span class=
"info"> CUPS
1.6/macOS
10.8 </span><a id=
"cupsCheckDestSupported">cupsCheckDestSupported
</a></h3>
1210 <p class=
"description">Check that the option and value are supported
1211 by the destination.
</p>
1213 int cupsCheckDestSupported (
<br />
1214     http_t *http,
<br />
1215     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
1216     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *dinfo,
<br />
1217     const char *option,
<br />
1218     const char *value
<br />
1220 <h4 class=
"parameters">Parameters
</h4>
1223 <dd class=
"description">Connection to destination
</dd>
1225 <dd class=
"description">Destination
</dd>
1227 <dd class=
"description">Destination information
</dd>
1229 <dd class=
"description">Option
</dd>
1231 <dd class=
"description">Value
</dd>
1233 <h4 class=
"returnvalue">Return Value
</h4>
1234 <p class=
"description">1 if supported,
0 otherwise
</p>
1235 <h4 class=
"discussion">Discussion
</h4>
1236 <p class=
"discussion">Returns
1 if supported,
0 otherwise.
1239 <h3 class=
"function"><span class=
"info"> CUPS
1.6/macOS
10.8 </span><a id=
"cupsCloseDestJob">cupsCloseDestJob
</a></h3>
1240 <p class=
"description">Close a job and start printing.
</p>
1242 ipp_status_t cupsCloseDestJob (
<br />
1243     http_t *http,
<br />
1244     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
1245     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *info,
<br />
1246     int job_id
<br />
1248 <h4 class=
"parameters">Parameters
</h4>
1251 <dd class=
"description">Connection to destination
</dd>
1253 <dd class=
"description">Destination
</dd>
1255 <dd class=
"description">Destination information
</dd>
1257 <dd class=
"description">Job ID
</dd>
1259 <h4 class=
"returnvalue">Return Value
</h4>
1260 <p class=
"description">IPP status code
</p>
1261 <h4 class=
"discussion">Discussion
</h4>
1262 <p class=
"discussion">Use when the last call to cupsStartDocument passed
0 for
"last_document
".
1263 "job_id
" is the job ID returned by cupsCreateDestJob. Returns
<code>IPP_STATUS_OK
</code>
1267 <h3 class=
"function"><span class=
"info"> CUPS
1.6/macOS
10.8 </span><a id=
"cupsConnectDest">cupsConnectDest
</a></h3>
1268 <p class=
"description">Connect to the server for a destination.
</p>
1270 http_t *cupsConnectDest (
<br />
1271     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
1272     unsigned flags,
<br />
1273     int msec,
<br />
1274     int *cancel,
<br />
1275     char *resource,
<br />
1276     size_t resourcesize,
<br />
1277     <a href=
"#cups_dest_cb_t">cups_dest_cb_t
</a> cb,
<br />
1278     void *user_data
<br />
1280 <h4 class=
"parameters">Parameters
</h4>
1283 <dd class=
"description">Destination
</dd>
1285 <dd class=
"description">Connection flags
</dd>
1287 <dd class=
"description">Timeout in milliseconds
</dd>
1289 <dd class=
"description">Pointer to
"cancel
" variable
</dd>
1291 <dd class=
"description">Resource buffer
</dd>
1292 <dt>resourcesize
</dt>
1293 <dd class=
"description">Size of resource buffer
</dd>
1295 <dd class=
"description">Callback function
</dd>
1297 <dd class=
"description">User data pointer
</dd>
1299 <h4 class=
"returnvalue">Return Value
</h4>
1300 <p class=
"description">Connection to server or
<code>NULL
</code></p>
1301 <h4 class=
"discussion">Discussion
</h4>
1302 <p class=
"discussion">Connect to the destination, returning a new http_t connection object and
1303 optionally the resource path to use for the destination. These calls will
1304 block until a connection is made, the timeout expires, the integer pointed
1305 to by
"cancel
" is non-zero, or the callback function (or block) returns
0,
1306 The caller is responsible for calling httpClose() on the returned object.
1309 <h3 class=
"function"><span class=
"info"> CUPS
1.6/macOS
10.8 </span><a id=
"cupsConnectDestBlock">cupsConnectDestBlock
</a></h3>
1310 <p class=
"description">Connect to the server for a destination.
</p>
1312 http_t *cupsConnectDestBlock (
<br />
1313     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
1314     unsigned flags,
<br />
1315     int msec,
<br />
1316     int *cancel,
<br />
1317     char *resource,
<br />
1318     size_t resourcesize,
<br />
1319     <a href=
"#cups_dest_block_t">cups_dest_block_t
</a> block
<br />
1321 <h4 class=
"parameters">Parameters
</h4>
1324 <dd class=
"description">Destination
</dd>
1326 <dd class=
"description">Connection flags
</dd>
1328 <dd class=
"description">Timeout in milliseconds
</dd>
1330 <dd class=
"description">Pointer to
"cancel
" variable
</dd>
1332 <dd class=
"description">Resource buffer
</dd>
1333 <dt>resourcesize
</dt>
1334 <dd class=
"description">Size of resource buffer
</dd>
1336 <dd class=
"description">Callback block
</dd>
1338 <h4 class=
"returnvalue">Return Value
</h4>
1339 <p class=
"description">Connection to server or
<code>NULL
</code></p>
1340 <h4 class=
"discussion">Discussion
</h4>
1341 <p class=
"discussion">Connect to the destination, returning a new http_t connection object and
1342 optionally the resource path to use for the destination. These calls will
1343 block until a connection is made, the timeout expires, the integer pointed
1344 to by
"cancel
" is non-zero, or the callback function (or block) returns
0,
1345 The caller is responsible for calling httpClose() on the returned object.
1348 <h3 class=
"function"><a id=
"cupsCopyDest">cupsCopyDest
</a></h3>
1349 <p class=
"description">Callback block
</p>
1351 int cupsCopyDest (
<br />
1352     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
1353     int num_dests,
<br />
1354     <a href=
"#cups_dest_t">cups_dest_t
</a> **dests
<br />
1356 <h4 class=
"parameters">Parameters
</h4>
1362 <h4 class=
"returnvalue">Return Value
</h4>
1363 <p class=
"description">Copy a destination.
</p>
1364 <p class=
"discussion">Make a copy of the destination to an array of destinations (or just a single
1365 copy) - for use with the cupsEnumDests* functions. The caller is responsible
1366 for calling cupsFreeDests() on the returned object(s).
1369 <h3 class=
"function"><span class=
"info"> CUPS
1.6/macOS
10.8 </span><a id=
"cupsCopyDestConflicts">cupsCopyDestConflicts
</a></h3>
1370 <p class=
"description">Get conflicts and resolutions for a new
1371 option/value pair.
</p>
1373 int cupsCopyDestConflicts (
<br />
1374     http_t *http,
<br />
1375     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
1376     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *dinfo,
<br />
1377     int num_options,
<br />
1378     <a href=
"#cups_option_t">cups_option_t
</a> *options,
<br />
1379     const char *new_option,
<br />
1380     const char *new_value,
<br />
1381     int *num_conflicts,
<br />
1382     <a href=
"#cups_option_t">cups_option_t
</a> **conflicts,
<br />
1383     int *num_resolved,
<br />
1384     <a href=
"#cups_option_t">cups_option_t
</a> **resolved
<br />
1386 <h4 class=
"parameters">Parameters
</h4>
1389 <dd class=
"description">Connection to destination
</dd>
1391 <dd class=
"description">Destination
</dd>
1393 <dd class=
"description">Destination information
</dd>
1394 <dt>num_options
</dt>
1395 <dd class=
"description">Number of current options
</dd>
1397 <dd class=
"description">Current options
</dd>
1399 <dd class=
"description">New option
</dd>
1401 <dd class=
"description">New value
</dd>
1402 <dt>num_conflicts
</dt>
1403 <dd class=
"description">Number of conflicting options
</dd>
1405 <dd class=
"description">Conflicting options
</dd>
1406 <dt>num_resolved
</dt>
1407 <dd class=
"description">Number of options to resolve
</dd>
1409 <dd class=
"description">Resolved options
</dd>
1411 <h4 class=
"returnvalue">Return Value
</h4>
1412 <p class=
"description">1 if there is a conflict,
0 if none, -
1 on error
</p>
1413 <h4 class=
"discussion">Discussion
</h4>
1414 <p class=
"discussion">"num_options
" and
"options
" represent the currently selected options by the
1415 user.
"new_option
" and
"new_value
" are the setting the user has just
1418 Returns
1 if there is a conflict,
0 if there are no conflicts, and -
1 if
1419 there was an unrecoverable error such as a resolver loop.
<br>
1421 If
"num_conflicts
" and
"conflicts
" are not
<code>NULL
</code>, they are set to
1422 contain the list of conflicting option/value pairs. Similarly, if
1423 "num_resolved
" and
"resolved
" are not
<code>NULL
</code> they will be set to the
1424 list of changes needed to resolve the conflict.
<br>
1426 If cupsCopyDestConflicts returns
1 but
"num_resolved
" and
"resolved
" are set
1427 to
0 and
<code>NULL
</code>, respectively, then the conflict cannot be resolved.
1430 <h3 class=
"function"><span class=
"info"> CUPS
1.6/macOS
10.8 </span><a id=
"cupsCopyDestInfo">cupsCopyDestInfo
</a></h3>
1431 <p class=
"description">Get the supported values/capabilities for the
1434 <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *cupsCopyDestInfo (
<br />
1435     http_t *http,
<br />
1436     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest
<br />
1438 <h4 class=
"parameters">Parameters
</h4>
1441 <dd class=
"description">Connection to destination
</dd>
1443 <dd class=
"description">Destination
</dd>
1445 <h4 class=
"returnvalue">Return Value
</h4>
1446 <p class=
"description">Destination information
</p>
1447 <h4 class=
"discussion">Discussion
</h4>
1448 <p class=
"discussion">The caller is responsible for calling
<a href=
"#cupsFreeDestInfo"><code>cupsFreeDestInfo
</code></a> on the return
1449 value.
<code>NULL
</code> is returned on error.
1452 <h3 class=
"function"><span class=
"info"> CUPS
1.6/macOS
10.8 </span><a id=
"cupsCreateDestJob">cupsCreateDestJob
</a></h3>
1453 <p class=
"description">Create a job on a destination.
</p>
1455 ipp_status_t cupsCreateDestJob (
<br />
1456     http_t *http,
<br />
1457     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
1458     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *info,
<br />
1459     int *job_id,
<br />
1460     const char *title,
<br />
1461     int num_options,
<br />
1462     <a href=
"#cups_option_t">cups_option_t
</a> *options
<br />
1464 <h4 class=
"parameters">Parameters
</h4>
1467 <dd class=
"description">Connection to destination
</dd>
1469 <dd class=
"description">Destination
</dd>
1471 <dd class=
"description">Destination information
</dd>
1473 <dd class=
"description">Job ID or
0 on error
</dd>
1475 <dd class=
"description">Job name
</dd>
1476 <dt>num_options
</dt>
1477 <dd class=
"description">Number of job options
</dd>
1479 <dd class=
"description">Job options
</dd>
1481 <h4 class=
"returnvalue">Return Value
</h4>
1482 <p class=
"description">IPP status code
</p>
1483 <h4 class=
"discussion">Discussion
</h4>
1484 <p class=
"discussion">Returns
<code>IPP_STATUS_OK
</code> or
<code>IPP_STATUS_OK_SUBST
</code> on success, saving the job ID
1485 in the variable pointed to by
"job_id
".
1488 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"cupsCreateJob">cupsCreateJob
</a></h3>
1489 <p class=
"description">Create an empty job for streaming.
</p>
1491 int cupsCreateJob (
<br />
1492     http_t *http,
<br />
1493     const char *name,
<br />
1494     const char *title,
<br />
1495     int num_options,
<br />
1496     <a href=
"#cups_option_t">cups_option_t
</a> *options
<br />
1498 <h4 class=
"parameters">Parameters
</h4>
1501 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
1503 <dd class=
"description">Destination name
</dd>
1505 <dd class=
"description">Title of job
</dd>
1506 <dt>num_options
</dt>
1507 <dd class=
"description">Number of options
</dd>
1509 <dd class=
"description">Options
</dd>
1511 <h4 class=
"returnvalue">Return Value
</h4>
1512 <p class=
"description">Job ID or
0 on error
</p>
1513 <h4 class=
"discussion">Discussion
</h4>
1514 <p class=
"discussion">Use this function when you want to stream print data using the
1515 <a href=
"#cupsStartDocument"><code>cupsStartDocument
</code></a>,
<a href=
"#cupsWriteRequestData"><code>cupsWriteRequestData
</code></a>, and
1516 <a href=
"#cupsFinishDocument"><code>cupsFinishDocument
</code></a> functions. If you have one or more files to
1517 print, use the
<a href=
"#cupsPrintFile2"><code>cupsPrintFile2
</code></a> or
<a href=
"#cupsPrintFiles2"><code>cupsPrintFiles2
</code></a> function
1521 <h3 class=
"function"><a id=
"cupsEncryption">cupsEncryption
</a></h3>
1522 <p class=
"description">Get the current encryption settings.
</p>
1524 http_encryption_t cupsEncryption (void);
</p>
1525 <h4 class=
"returnvalue">Return Value
</h4>
1526 <p class=
"description">Encryption settings
</p>
1527 <h4 class=
"discussion">Discussion
</h4>
1528 <p class=
"discussion">The default encryption setting comes from the CUPS_ENCRYPTION
1529 environment variable, then the ~/.cups/client.conf file, and finally the
1530 /etc/cups/client.conf file. If not set, the default is
1531 <code>HTTP_ENCRYPTION_IF_REQUESTED
</code>.
<br>
1533 Note: The current encryption setting is tracked separately for each thread
1534 in a program. Multi-threaded programs that override the setting via the
1535 <a href=
"#cupsSetEncryption"><code>cupsSetEncryption
</code></a> function need to do so in each thread for the same
1536 setting to be used.
</p>
1537 <h3 class=
"function"><span class=
"info"> CUPS
1.6/macOS
10.8 </span><a id=
"cupsEnumDests">cupsEnumDests
</a></h3>
1538 <p class=
"description">Enumerate available destinations with a callback function.
</p>
1540 int cupsEnumDests (
<br />
1541     unsigned flags,
<br />
1542     int msec,
<br />
1543     int *cancel,
<br />
1544     <a href=
"#cups_ptype_t">cups_ptype_t
</a> type,
<br />
1545     <a href=
"#cups_ptype_t">cups_ptype_t
</a> mask,
<br />
1546     <a href=
"#cups_dest_cb_t">cups_dest_cb_t
</a> cb,
<br />
1547     void *user_data
<br />
1549 <h4 class=
"parameters">Parameters
</h4>
1552 <dd class=
"description">Enumeration flags
</dd>
1554 <dd class=
"description">Timeout in milliseconds,
1555 -
1 for indefinite
</dd>
1557 <dd class=
"description">Pointer to
"cancel
" variable
</dd>
1559 <dd class=
"description">Printer type bits
</dd>
1561 <dd class=
"description">Mask for printer type bits
</dd>
1563 <dd class=
"description">Callback function
</dd>
1565 <dd class=
"description">User data
</dd>
1567 <h4 class=
"returnvalue">Return Value
</h4>
1568 <p class=
"description">1 on success,
0 on failure
</p>
1569 <h4 class=
"discussion">Discussion
</h4>
1570 <p class=
"discussion">Destinations are enumerated from one or more sources. The callback function
1571 receives the
<code>user_data
</code> pointer, destination name, instance, number of
1572 options, and options which can be used as input to the
<a href=
"#cupsAddDest"><code>cupsAddDest
</code></a>
1573 function. The function must return
1 to continue enumeration or
0 to stop.
<br>
1575 Enumeration happens on the current thread and does not return until all
1576 destinations have been enumerated or the callback function returns
0.
1579 <h3 class=
"function"><span class=
"info"> CUPS
1.6/macOS
10.8 </span><a id=
"cupsEnumDestsBlock">cupsEnumDestsBlock
</a></h3>
1580 <p class=
"description">Enumerate available destinations with a block.
</p>
1582 int cupsEnumDestsBlock (
<br />
1583     unsigned flags,
<br />
1584     int timeout,
<br />
1585     int *cancel,
<br />
1586     <a href=
"#cups_ptype_t">cups_ptype_t
</a> type,
<br />
1587     <a href=
"#cups_ptype_t">cups_ptype_t
</a> mask,
<br />
1588     <a href=
"#cups_dest_block_t">cups_dest_block_t
</a> block
<br />
1590 <h4 class=
"parameters">Parameters
</h4>
1593 <dd class=
"description">Enumeration flags
</dd>
1595 <dd class=
"description">Timeout in milliseconds,
0 for indefinite
</dd>
1597 <dd class=
"description">Pointer to
"cancel
" variable
</dd>
1599 <dd class=
"description">Printer type bits
</dd>
1601 <dd class=
"description">Mask for printer type bits
</dd>
1603 <dd class=
"description">Block
</dd>
1605 <h4 class=
"returnvalue">Return Value
</h4>
1606 <p class=
"description">1 on success,
0 on failure
</p>
1607 <h4 class=
"discussion">Discussion
</h4>
1608 <p class=
"discussion">Destinations are enumerated from one or more sources. The block receives the
1609 destination name, instance, number of options, and options which can be used
1610 as input to the
<a href=
"#cupsAddDest"><code>cupsAddDest
</code></a> function. The block must return
1 to
1611 continue enumeration or
0 to stop.
<br>
1613 Enumeration happens on the current thread and does not return until all
1614 destinations have been enumerated or the block returns
0.
1617 <h3 class=
"function"><span class=
"info"> CUPS
1.7/macOS
10.9 </span><a id=
"cupsFindDestDefault">cupsFindDestDefault
</a></h3>
1618 <p class=
"description">Find the default value(s) for the given option.
</p>
1620 ipp_attribute_t *cupsFindDestDefault (
<br />
1621     http_t *http,
<br />
1622     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
1623     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *dinfo,
<br />
1624     const char *option
<br />
1626 <h4 class=
"parameters">Parameters
</h4>
1629 <dd class=
"description">Connection to destination
</dd>
1631 <dd class=
"description">Destination
</dd>
1633 <dd class=
"description">Destination information
</dd>
1635 <dd class=
"description">Option/attribute name
</dd>
1637 <h4 class=
"returnvalue">Return Value
</h4>
1638 <p class=
"description">Default attribute or
<code>NULL
</code> for none
</p>
1639 <h4 class=
"discussion">Discussion
</h4>
1640 <p class=
"discussion">The returned value is an IPP attribute. Use the
<code>ippGetBoolean
</code>,
1641 <code>ippGetCollection
</code>,
<code>ippGetCount
</code>,
<code>ippGetDate
</code>,
1642 <code>ippGetInteger
</code>,
<code>ippGetOctetString
</code>,
<code>ippGetRange
</code>,
1643 <code>ippGetResolution
</code>,
<code>ippGetString
</code>, and
<code>ippGetValueTag
</code>
1644 functions to inspect the default value(s) as needed.
1647 <h3 class=
"function"><span class=
"info"> CUPS
1.7/macOS
10.9 </span><a id=
"cupsFindDestReady">cupsFindDestReady
</a></h3>
1648 <p class=
"description">Find the default value(s) for the given option.
</p>
1650 ipp_attribute_t *cupsFindDestReady (
<br />
1651     http_t *http,
<br />
1652     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
1653     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *dinfo,
<br />
1654     const char *option
<br />
1656 <h4 class=
"parameters">Parameters
</h4>
1659 <dd class=
"description">Connection to destination
</dd>
1661 <dd class=
"description">Destination
</dd>
1663 <dd class=
"description">Destination information
</dd>
1665 <dd class=
"description">Option/attribute name
</dd>
1667 <h4 class=
"returnvalue">Return Value
</h4>
1668 <p class=
"description">Default attribute or
<code>NULL
</code> for none
</p>
1669 <h4 class=
"discussion">Discussion
</h4>
1670 <p class=
"discussion">The returned value is an IPP attribute. Use the
<code>ippGetBoolean
</code>,
1671 <code>ippGetCollection
</code>,
<code>ippGetCount
</code>,
<code>ippGetDate
</code>,
1672 <code>ippGetInteger
</code>,
<code>ippGetOctetString
</code>,
<code>ippGetRange
</code>,
1673 <code>ippGetResolution
</code>,
<code>ippGetString
</code>, and
<code>ippGetValueTag
</code>
1674 functions to inspect the default value(s) as needed.
1677 <h3 class=
"function"><span class=
"info"> CUPS
1.7/macOS
10.9 </span><a id=
"cupsFindDestSupported">cupsFindDestSupported
</a></h3>
1678 <p class=
"description">Find the default value(s) for the given option.
</p>
1680 ipp_attribute_t *cupsFindDestSupported (
<br />
1681     http_t *http,
<br />
1682     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
1683     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *dinfo,
<br />
1684     const char *option
<br />
1686 <h4 class=
"parameters">Parameters
</h4>
1689 <dd class=
"description">Connection to destination
</dd>
1691 <dd class=
"description">Destination
</dd>
1693 <dd class=
"description">Destination information
</dd>
1695 <dd class=
"description">Option/attribute name
</dd>
1697 <h4 class=
"returnvalue">Return Value
</h4>
1698 <p class=
"description">Default attribute or
<code>NULL
</code> for none
</p>
1699 <h4 class=
"discussion">Discussion
</h4>
1700 <p class=
"discussion">The returned value is an IPP attribute. Use the
<code>ippGetBoolean
</code>,
1701 <code>ippGetCollection
</code>,
<code>ippGetCount
</code>,
<code>ippGetDate
</code>,
1702 <code>ippGetInteger
</code>,
<code>ippGetOctetString
</code>,
<code>ippGetRange
</code>,
1703 <code>ippGetResolution
</code>,
<code>ippGetString
</code>, and
<code>ippGetValueTag
</code>
1704 functions to inspect the default value(s) as needed.
1707 <h3 class=
"function"><span class=
"info"> CUPS
1.6/macOS
10.8 </span><a id=
"cupsFinishDestDocument">cupsFinishDestDocument
</a></h3>
1708 <p class=
"description">Finish the current document.
</p>
1710 ipp_status_t cupsFinishDestDocument (
<br />
1711     http_t *http,
<br />
1712     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
1713     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *info
<br />
1715 <h4 class=
"parameters">Parameters
</h4>
1718 <dd class=
"description">Connection to destination
</dd>
1720 <dd class=
"description">Destination
</dd>
1722 <dd class=
"description">Destination information
</dd>
1724 <h4 class=
"returnvalue">Return Value
</h4>
1725 <p class=
"description">Status of document submission
</p>
1726 <h4 class=
"discussion">Discussion
</h4>
1727 <p class=
"discussion">Returns
<code>IPP_STATUS_OK
</code> or
<code>IPP_STATUS_OK_SUBST
</code> on success.
1730 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"cupsFinishDocument">cupsFinishDocument
</a></h3>
1731 <p class=
"description">Finish sending a document.
</p>
1733 ipp_status_t cupsFinishDocument (
<br />
1734     http_t *http,
<br />
1735     const char *name
<br />
1737 <h4 class=
"parameters">Parameters
</h4>
1740 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
1742 <dd class=
"description">Destination name
</dd>
1744 <h4 class=
"returnvalue">Return Value
</h4>
1745 <p class=
"description">Status of document submission
</p>
1746 <h4 class=
"discussion">Discussion
</h4>
1747 <p class=
"discussion">The document must have been started using
<a href=
"#cupsStartDocument"><code>cupsStartDocument
</code></a>.
1750 <h3 class=
"function"><a id=
"cupsFreeDestInfo">cupsFreeDestInfo
</a></h3>
1751 <p class=
"description">Free destination information obtained using
1752 <a href=
"#cupsCopyDestInfo"><code>cupsCopyDestInfo
</code></a>.
</p>
1754 void cupsFreeDestInfo (
<br />
1755     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *dinfo
<br />
1757 <h4 class=
"parameters">Parameters
</h4>
1760 <dd class=
"description">Destination information
</dd>
1762 <h3 class=
"function"><a id=
"cupsFreeDests">cupsFreeDests
</a></h3>
1763 <p class=
"description">Free the memory used by the list of destinations.
</p>
1765 void cupsFreeDests (
<br />
1766     int num_dests,
<br />
1767     <a href=
"#cups_dest_t">cups_dest_t
</a> *dests
<br />
1769 <h4 class=
"parameters">Parameters
</h4>
1772 <dd class=
"description">Number of destinations
</dd>
1774 <dd class=
"description">Destinations
</dd>
1776 <h3 class=
"function"><a id=
"cupsFreeJobs">cupsFreeJobs
</a></h3>
1777 <p class=
"description">Free memory used by job data.
</p>
1779 void cupsFreeJobs (
<br />
1780     int num_jobs,
<br />
1781     <a href=
"#cups_job_t">cups_job_t
</a> *jobs
<br />
1783 <h4 class=
"parameters">Parameters
</h4>
1786 <dd class=
"description">Number of jobs
</dd>
1788 <dd class=
"description">Jobs
</dd>
1790 <h3 class=
"function"><a id=
"cupsFreeOptions">cupsFreeOptions
</a></h3>
1791 <p class=
"description">Free all memory used by options.
</p>
1793 void cupsFreeOptions (
<br />
1794     int num_options,
<br />
1795     <a href=
"#cups_option_t">cups_option_t
</a> *options
<br />
1797 <h4 class=
"parameters">Parameters
</h4>
1799 <dt>num_options
</dt>
1800 <dd class=
"description">Number of options
</dd>
1802 <dd class=
"description">Pointer to options
</dd>
1804 <h3 class=
"function"><span class=
"info"> DEPRECATED
 </span><a id=
"cupsGetClasses">cupsGetClasses
</a></h3>
1805 <p class=
"description">Get a list of printer classes from the default server.
</p>
1807 int cupsGetClasses (
<br />
1808     char ***classes
<br />
1810 <h4 class=
"parameters">Parameters
</h4>
1813 <dd class=
"description">Classes
</dd>
1815 <h4 class=
"returnvalue">Return Value
</h4>
1816 <p class=
"description">Number of classes
</p>
1817 <h4 class=
"discussion">Discussion
</h4>
1818 <p class=
"discussion">This function is deprecated and no longer returns a list of printer
1819 classes - use
<a href=
"#cupsGetDests"><code>cupsGetDests
</code></a> instead.
1822 <h3 class=
"function"><a id=
"cupsGetDefault">cupsGetDefault
</a></h3>
1823 <p class=
"description">Get the default printer or class for the default server.
</p>
1825 const char *cupsGetDefault (void);
</p>
1826 <h4 class=
"returnvalue">Return Value
</h4>
1827 <p class=
"description">Default printer or
<code>NULL
</code></p>
1828 <h4 class=
"discussion">Discussion
</h4>
1829 <p class=
"discussion">This function returns the default printer or class as defined by
1830 the LPDEST or PRINTER environment variables. If these environment
1831 variables are not set, the server default destination is returned.
1832 Applications should use the
<a href=
"#cupsGetDests"><code>cupsGetDests
</code></a> and
<a href=
"#cupsGetDest"><code>cupsGetDest
</code></a>
1833 functions to get the user-defined default printer, as this function does
1834 not support the lpoptions-defined default printer.
</p>
1835 <h3 class=
"function"><span class=
"info"> CUPS
1.1.21/macOS
10.4 </span><a id=
"cupsGetDefault2">cupsGetDefault2
</a></h3>
1836 <p class=
"description">Get the default printer or class for the specified server.
</p>
1838 const char *cupsGetDefault2 (
<br />
1839     http_t *http
<br />
1841 <h4 class=
"parameters">Parameters
</h4>
1844 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
1846 <h4 class=
"returnvalue">Return Value
</h4>
1847 <p class=
"description">Default printer or
<code>NULL
</code></p>
1848 <h4 class=
"discussion">Discussion
</h4>
1849 <p class=
"discussion">This function returns the default printer or class as defined by
1850 the LPDEST or PRINTER environment variables. If these environment
1851 variables are not set, the server default destination is returned.
1852 Applications should use the
<a href=
"#cupsGetDests"><code>cupsGetDests
</code></a> and
<a href=
"#cupsGetDest"><code>cupsGetDest
</code></a>
1853 functions to get the user-defined default printer, as this function does
1854 not support the lpoptions-defined default printer.
1857 <h3 class=
"function"><a id=
"cupsGetDest">cupsGetDest
</a></h3>
1858 <p class=
"description">Get the named destination from the list.
</p>
1860 <a href=
"#cups_dest_t">cups_dest_t
</a> *cupsGetDest (
<br />
1861     const char *name,
<br />
1862     const char *instance,
<br />
1863     int num_dests,
<br />
1864     <a href=
"#cups_dest_t">cups_dest_t
</a> *dests
<br />
1866 <h4 class=
"parameters">Parameters
</h4>
1869 <dd class=
"description">Destination name or
<code>NULL
</code> for the default destination
</dd>
1871 <dd class=
"description">Instance name or
<code>NULL
</code></dd>
1873 <dd class=
"description">Number of destinations
</dd>
1875 <dd class=
"description">Destinations
</dd>
1877 <h4 class=
"returnvalue">Return Value
</h4>
1878 <p class=
"description">Destination pointer or
<code>NULL
</code></p>
1879 <h4 class=
"discussion">Discussion
</h4>
1880 <p class=
"discussion">Use the
<a href=
"#cupsGetDests"><code>cupsGetDests
</code></a> or
<a href=
"#cupsGetDests2"><code>cupsGetDests2
</code></a> functions to get a
1881 list of supported destinations for the current user.
</p>
1882 <h3 class=
"function"><span class=
"info"> CUPS
1.7/macOS
10.9 </span><a id=
"cupsGetDestMediaByIndex">cupsGetDestMediaByIndex
</a></h3>
1883 <p class=
"description">Get a media name, dimension, and margins for a
1886 int cupsGetDestMediaByIndex (
<br />
1887     http_t *http,
<br />
1888     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
1889     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *dinfo,
<br />
1890     int n,
<br />
1891     unsigned flags,
<br />
1892     <a href=
"#cups_size_t">cups_size_t
</a> *size
<br />
1894 <h4 class=
"parameters">Parameters
</h4>
1897 <dd class=
"description">Connection to destination
</dd>
1899 <dd class=
"description">Destination
</dd>
1901 <dd class=
"description">Destination information
</dd>
1903 <dd class=
"description">Media size number (
0-based)
</dd>
1905 <dd class=
"description">Media flags
</dd>
1907 <dd class=
"description">Media size information
</dd>
1909 <h4 class=
"returnvalue">Return Value
</h4>
1910 <p class=
"description">1 on success,
0 on failure
</p>
1911 <h4 class=
"discussion">Discussion
</h4>
1912 <p class=
"discussion">The
<code>flags
</code> parameter determines which set of media are indexed. For
1913 example, passing
<code>CUPS_MEDIA_FLAGS_BORDERLESS
</code> will get the Nth
1914 borderless size supported by the printer.
1917 <h3 class=
"function"><span class=
"info"> CUPS
1.6/macOS
10.8 </span><a id=
"cupsGetDestMediaByName">cupsGetDestMediaByName
</a></h3>
1918 <p class=
"description">Get media names, dimensions, and margins.
</p>
1920 int cupsGetDestMediaByName (
<br />
1921     http_t *http,
<br />
1922     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
1923     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *dinfo,
<br />
1924     const char *media,
<br />
1925     unsigned flags,
<br />
1926     <a href=
"#cups_size_t">cups_size_t
</a> *size
<br />
1928 <h4 class=
"parameters">Parameters
</h4>
1931 <dd class=
"description">Connection to destination
</dd>
1933 <dd class=
"description">Destination
</dd>
1935 <dd class=
"description">Destination information
</dd>
1937 <dd class=
"description">Media name
</dd>
1939 <dd class=
"description">Media matching flags
</dd>
1941 <dd class=
"description">Media size information
</dd>
1943 <h4 class=
"returnvalue">Return Value
</h4>
1944 <p class=
"description">1 on match,
0 on failure
</p>
1945 <h4 class=
"discussion">Discussion
</h4>
1946 <p class=
"discussion">The
"media
" string is a PWG media name.
"Flags
" provides some matching
1947 guidance (multiple flags can be combined):
<br>
1949 CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
1950 CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
1951 CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with
2-sided printing,
1952 CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
1953 CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
1954 size amongst the
"ready
" media.
<br>
1956 The matching result (if any) is returned in the
"cups_size_t
" structure.
<br>
1958 Returns
1 when there is a match and
0 if there is not a match.
1961 <h3 class=
"function"><span class=
"info"> CUPS
1.6/macOS
10.8 </span><a id=
"cupsGetDestMediaBySize">cupsGetDestMediaBySize
</a></h3>
1962 <p class=
"description">Get media names, dimensions, and margins.
</p>
1964 int cupsGetDestMediaBySize (
<br />
1965     http_t *http,
<br />
1966     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
1967     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *dinfo,
<br />
1968     int width,
<br />
1969     int length,
<br />
1970     unsigned flags,
<br />
1971     <a href=
"#cups_size_t">cups_size_t
</a> *size
<br />
1973 <h4 class=
"parameters">Parameters
</h4>
1976 <dd class=
"description">Connection to destination
</dd>
1978 <dd class=
"description">Destination
</dd>
1980 <dd class=
"description">Destination information
</dd>
1982 <dd class=
"description">Media width in hundredths of
1985 <dd class=
"description">Media length in hundredths of
1988 <dd class=
"description">Media matching flags
</dd>
1990 <dd class=
"description">Media size information
</dd>
1992 <h4 class=
"returnvalue">Return Value
</h4>
1993 <p class=
"description">1 on match,
0 on failure
</p>
1994 <h4 class=
"discussion">Discussion
</h4>
1995 <p class=
"discussion">"Width
" and
"length
" are the dimensions in hundredths of millimeters.
1996 "Flags
" provides some matching guidance (multiple flags can be combined):
<br>
1998 CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
1999 CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
2000 CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with
2-sided printing,
2001 CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
2002 CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
2003 size amongst the
"ready
" media.
<br>
2005 The matching result (if any) is returned in the
"cups_size_t
" structure.
<br>
2007 Returns
1 when there is a match and
0 if there is not a match.
2010 <h3 class=
"function"><span class=
"info"> CUPS
1.7/macOS
10.9 </span><a id=
"cupsGetDestMediaCount">cupsGetDestMediaCount
</a></h3>
2011 <p class=
"description">Get the number of sizes supported by a
2014 int cupsGetDestMediaCount (
<br />
2015     http_t *http,
<br />
2016     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
2017     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *dinfo,
<br />
2018     unsigned flags
<br />
2020 <h4 class=
"parameters">Parameters
</h4>
2023 <dd class=
"description">Connection to destination
</dd>
2025 <dd class=
"description">Destination
</dd>
2027 <dd class=
"description">Destination information
</dd>
2029 <dd class=
"description">Media flags
</dd>
2031 <h4 class=
"returnvalue">Return Value
</h4>
2032 <p class=
"description">Number of sizes
</p>
2033 <h4 class=
"discussion">Discussion
</h4>
2034 <p class=
"discussion">The
<code>flags
</code> parameter determines the set of media sizes that are
2035 counted. For example, passing
<code>CUPS_MEDIA_FLAGS_BORDERLESS
</code> will return
2036 the number of borderless sizes.
2039 <h3 class=
"function"><span class=
"info"> CUPS
1.7/macOS
10.9 </span><a id=
"cupsGetDestMediaDefault">cupsGetDestMediaDefault
</a></h3>
2040 <p class=
"description">Get the default size for a destination.
</p>
2042 int cupsGetDestMediaDefault (
<br />
2043     http_t *http,
<br />
2044     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
2045     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *dinfo,
<br />
2046     unsigned flags,
<br />
2047     <a href=
"#cups_size_t">cups_size_t
</a> *size
<br />
2049 <h4 class=
"parameters">Parameters
</h4>
2052 <dd class=
"description">Connection to destination
</dd>
2054 <dd class=
"description">Destination
</dd>
2056 <dd class=
"description">Destination information
</dd>
2058 <dd class=
"description">Media flags
</dd>
2060 <dd class=
"description">Media size information
</dd>
2062 <h4 class=
"returnvalue">Return Value
</h4>
2063 <p class=
"description">1 on success,
0 on failure
</p>
2064 <h4 class=
"discussion">Discussion
</h4>
2065 <p class=
"discussion">The
<code>flags
</code> parameter determines which default size is returned. For
2066 example, passing
<code>CUPS_MEDIA_FLAGS_BORDERLESS
</code> will return the default
2067 borderless size, typically US Letter or A4, but sometimes
4x6 photo media.
2070 <h3 class=
"function"><span class=
"info"> CUPS
2.0/macOS
10.10 </span><a id=
"cupsGetDestWithURI">cupsGetDestWithURI
</a></h3>
2071 <p class=
"description">Get a destination associated with a URI.
</p>
2073 <a href=
"#cups_dest_t">cups_dest_t
</a> *cupsGetDestWithURI (
<br />
2074     const char *name,
<br />
2075     const char *uri
<br />
2077 <h4 class=
"parameters">Parameters
</h4>
2080 <dd class=
"description">Desired printer name or
<code>NULL
</code></dd>
2082 <dd class=
"description">URI for the printer
</dd>
2084 <h4 class=
"returnvalue">Return Value
</h4>
2085 <p class=
"description">Destination or
<code>NULL
</code></p>
2086 <h4 class=
"discussion">Discussion
</h4>
2087 <p class=
"discussion">"name
" is the desired name for the printer. If
<code>NULL
</code>, a name will be
2088 created using the URI.
<br>
2090 "uri
" is the
"ipp
" or
"ipps
" URI for the printer.
2093 <h3 class=
"function"><a id=
"cupsGetDests">cupsGetDests
</a></h3>
2094 <p class=
"description">Get the list of destinations from the default server.
</p>
2096 int cupsGetDests (
<br />
2097     <a href=
"#cups_dest_t">cups_dest_t
</a> **dests
<br />
2099 <h4 class=
"parameters">Parameters
</h4>
2102 <dd class=
"description">Destinations
</dd>
2104 <h4 class=
"returnvalue">Return Value
</h4>
2105 <p class=
"description">Number of destinations
</p>
2106 <h4 class=
"discussion">Discussion
</h4>
2107 <p class=
"discussion">Starting with CUPS
1.2, the returned list of destinations include the
2108 printer-info, printer-is-accepting-jobs, printer-is-shared,
2109 printer-make-and-model, printer-state, printer-state-change-time,
2110 printer-state-reasons, and printer-type attributes as options. CUPS
1.4
2111 adds the marker-change-time, marker-colors, marker-high-levels,
2112 marker-levels, marker-low-levels, marker-message, marker-names,
2113 marker-types, and printer-commands attributes as well.
<br>
2115 Use the
<a href=
"#cupsFreeDests"><code>cupsFreeDests
</code></a> function to free the destination list and
2116 the
<a href=
"#cupsGetDest"><code>cupsGetDest
</code></a> function to find a particular destination.
</p>
2117 <h3 class=
"function"><span class=
"info"> CUPS
1.1.21/macOS
10.4 </span><a id=
"cupsGetDests2">cupsGetDests2
</a></h3>
2118 <p class=
"description">Get the list of destinations from the specified server.
</p>
2120 int cupsGetDests2 (
<br />
2121     http_t *http,
<br />
2122     <a href=
"#cups_dest_t">cups_dest_t
</a> **dests
<br />
2124 <h4 class=
"parameters">Parameters
</h4>
2127 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
2129 <dd class=
"description">Destinations
</dd>
2131 <h4 class=
"returnvalue">Return Value
</h4>
2132 <p class=
"description">Number of destinations
</p>
2133 <h4 class=
"discussion">Discussion
</h4>
2134 <p class=
"discussion">Starting with CUPS
1.2, the returned list of destinations include the
2135 printer-info, printer-is-accepting-jobs, printer-is-shared,
2136 printer-make-and-model, printer-state, printer-state-change-time,
2137 printer-state-reasons, and printer-type attributes as options. CUPS
1.4
2138 adds the marker-change-time, marker-colors, marker-high-levels,
2139 marker-levels, marker-low-levels, marker-message, marker-names,
2140 marker-types, and printer-commands attributes as well.
<br>
2142 Use the
<a href=
"#cupsFreeDests"><code>cupsFreeDests
</code></a> function to free the destination list and
2143 the
<a href=
"#cupsGetDest"><code>cupsGetDest
</code></a> function to find a particular destination.
2146 <h3 class=
"function"><a id=
"cupsGetJobs">cupsGetJobs
</a></h3>
2147 <p class=
"description">Get the jobs from the default server.
</p>
2149 int cupsGetJobs (
<br />
2150     <a href=
"#cups_job_t">cups_job_t
</a> **jobs,
<br />
2151     const char *name,
<br />
2152     int myjobs,
<br />
2153     int whichjobs
<br />
2155 <h4 class=
"parameters">Parameters
</h4>
2158 <dd class=
"description">Job data
</dd>
2160 <dd class=
"description"><code>NULL
</code> = all destinations, otherwise show jobs for named destination
</dd>
2162 <dd class=
"description">0 = all users,
1 = mine
</dd>
2164 <dd class=
"description"><code>CUPS_WHICHJOBS_ALL
</code>,
<code>CUPS_WHICHJOBS_ACTIVE
</code>, or
<code>CUPS_WHICHJOBS_COMPLETED
</code></dd>
2166 <h4 class=
"returnvalue">Return Value
</h4>
2167 <p class=
"description">Number of jobs
</p>
2168 <h4 class=
"discussion">Discussion
</h4>
2169 <p class=
"discussion">A
"whichjobs
" value of
<code>CUPS_WHICHJOBS_ALL
</code> returns all jobs regardless
2170 of state, while
<code>CUPS_WHICHJOBS_ACTIVE
</code> returns jobs that are
2171 pending, processing, or held and
<code>CUPS_WHICHJOBS_COMPLETED
</code> returns
2172 jobs that are stopped, canceled, aborted, or completed.
</p>
2173 <h3 class=
"function"><span class=
"info"> CUPS
1.1.21/macOS
10.4 </span><a id=
"cupsGetJobs2">cupsGetJobs2
</a></h3>
2174 <p class=
"description">Get the jobs from the specified server.
</p>
2176 int cupsGetJobs2 (
<br />
2177     http_t *http,
<br />
2178     <a href=
"#cups_job_t">cups_job_t
</a> **jobs,
<br />
2179     const char *name,
<br />
2180     int myjobs,
<br />
2181     int whichjobs
<br />
2183 <h4 class=
"parameters">Parameters
</h4>
2186 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
2188 <dd class=
"description">Job data
</dd>
2190 <dd class=
"description"><code>NULL
</code> = all destinations, otherwise show jobs for named destination
</dd>
2192 <dd class=
"description">0 = all users,
1 = mine
</dd>
2194 <dd class=
"description"><code>CUPS_WHICHJOBS_ALL
</code>,
<code>CUPS_WHICHJOBS_ACTIVE
</code>, or
<code>CUPS_WHICHJOBS_COMPLETED
</code></dd>
2196 <h4 class=
"returnvalue">Return Value
</h4>
2197 <p class=
"description">Number of jobs
</p>
2198 <h4 class=
"discussion">Discussion
</h4>
2199 <p class=
"discussion">A
"whichjobs
" value of
<code>CUPS_WHICHJOBS_ALL
</code> returns all jobs regardless
2200 of state, while
<code>CUPS_WHICHJOBS_ACTIVE
</code> returns jobs that are
2201 pending, processing, or held and
<code>CUPS_WHICHJOBS_COMPLETED
</code> returns
2202 jobs that are stopped, canceled, aborted, or completed.
2205 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"cupsGetNamedDest">cupsGetNamedDest
</a></h3>
2206 <p class=
"description">Get options for the named destination.
</p>
2208 <a href=
"#cups_dest_t">cups_dest_t
</a> *cupsGetNamedDest (
<br />
2209     http_t *http,
<br />
2210     const char *name,
<br />
2211     const char *instance
<br />
2213 <h4 class=
"parameters">Parameters
</h4>
2216 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
2218 <dd class=
"description">Destination name or
<code>NULL
</code> for the default destination
</dd>
2220 <dd class=
"description">Instance name or
<code>NULL
</code></dd>
2222 <h4 class=
"returnvalue">Return Value
</h4>
2223 <p class=
"description">Destination or
<code>NULL
</code></p>
2224 <h4 class=
"discussion">Discussion
</h4>
2225 <p class=
"discussion">This function is optimized for retrieving a single destination and should
2226 be used instead of
<a href=
"#cupsGetDests"><code>cupsGetDests
</code></a> and
<a href=
"#cupsGetDest"><code>cupsGetDest
</code></a> when you either
2227 know the name of the destination or want to print to the default destination.
2228 If
<code>NULL
</code> is returned, the destination does not exist or there is no
2229 default destination.
<br>
2231 If
"http
" is
<code>CUPS_HTTP_DEFAULT
</code>, the connection to the default print
2232 server will be used.
<br>
2234 If
"name
" is
<code>NULL
</code>, the default printer for the current user will be
2237 The returned destination must be freed using
<a href=
"#cupsFreeDests"><code>cupsFreeDests
</code></a> with a
2238 "num_dests
" value of
1.
2241 <h3 class=
"function"><a id=
"cupsGetOption">cupsGetOption
</a></h3>
2242 <p class=
"description">Get an option value.
</p>
2244 const char *cupsGetOption (
<br />
2245     const char *name,
<br />
2246     int num_options,
<br />
2247     <a href=
"#cups_option_t">cups_option_t
</a> *options
<br />
2249 <h4 class=
"parameters">Parameters
</h4>
2252 <dd class=
"description">Name of option
</dd>
2253 <dt>num_options
</dt>
2254 <dd class=
"description">Number of options
</dd>
2256 <dd class=
"description">Options
</dd>
2258 <h4 class=
"returnvalue">Return Value
</h4>
2259 <p class=
"description">Option value or
<code>NULL
</code></p>
2260 <h3 class=
"function"><a id=
"cupsGetPassword">cupsGetPassword
</a></h3>
2261 <p class=
"description">Get a password from the user.
</p>
2263 const char *cupsGetPassword (
<br />
2264     const char *prompt
<br />
2266 <h4 class=
"parameters">Parameters
</h4>
2269 <dd class=
"description">Prompt string
</dd>
2271 <h4 class=
"returnvalue">Return Value
</h4>
2272 <p class=
"description">Password
</p>
2273 <h4 class=
"discussion">Discussion
</h4>
2274 <p class=
"discussion">Uses the current password callback function. Returns
<code>NULL
</code> if the
2275 user does not provide a password.
<br>
2277 Note: The current password callback function is tracked separately for each
2278 thread in a program. Multi-threaded programs that override the setting via
2279 the
<a href=
"#cupsSetPasswordCB"><code>cupsSetPasswordCB
</code></a> or
<a href=
"#cupsSetPasswordCB2"><code>cupsSetPasswordCB2
</code></a> functions need to
2280 do so in each thread for the same function to be used.
</p>
2281 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"cupsGetPassword2">cupsGetPassword2
</a></h3>
2282 <p class=
"description">Get a password from the user using the advanced
2283 password callback.
</p>
2285 const char *cupsGetPassword2 (
<br />
2286     const char *prompt,
<br />
2287     http_t *http,
<br />
2288     const char *method,
<br />
2289     const char *resource
<br />
2291 <h4 class=
"parameters">Parameters
</h4>
2294 <dd class=
"description">Prompt string
</dd>
2296 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
2298 <dd class=
"description">Request method (
"GET
",
"POST
",
"PUT
")
</dd>
2300 <dd class=
"description">Resource path
</dd>
2302 <h4 class=
"returnvalue">Return Value
</h4>
2303 <p class=
"description">Password
</p>
2304 <h4 class=
"discussion">Discussion
</h4>
2305 <p class=
"discussion">Uses the current password callback function. Returns
<code>NULL
</code> if the
2306 user does not provide a password.
<br>
2308 Note: The current password callback function is tracked separately for each
2309 thread in a program. Multi-threaded programs that override the setting via
2310 the
<a href=
"#cupsSetPasswordCB"><code>cupsSetPasswordCB
</code></a> or
<a href=
"#cupsSetPasswordCB2"><code>cupsSetPasswordCB2
</code></a> functions need to
2311 do so in each thread for the same function to be used.
2314 <h3 class=
"function"><span class=
"info"> DEPRECATED
 </span><a id=
"cupsGetPrinters">cupsGetPrinters
</a></h3>
2315 <p class=
"description">Get a list of printers from the default server.
</p>
2317 int cupsGetPrinters (
<br />
2318     char ***printers
<br />
2320 <h4 class=
"parameters">Parameters
</h4>
2323 <dd class=
"description">Printers
</dd>
2325 <h4 class=
"returnvalue">Return Value
</h4>
2326 <p class=
"description">Number of printers
</p>
2327 <h4 class=
"discussion">Discussion
</h4>
2328 <p class=
"discussion">This function is deprecated and no longer returns a list of printers - use
2329 <a href=
"#cupsGetDests"><code>cupsGetDests
</code></a> instead.
2332 <h3 class=
"function"><a id=
"cupsLangDefault">cupsLangDefault
</a></h3>
2333 <p class=
"description">Return the default language.
</p>
2335 cups_lang_t *cupsLangDefault (void);
</p>
2336 <h4 class=
"returnvalue">Return Value
</h4>
2337 <p class=
"description">Language data
</p>
2338 <h3 class=
"function"><a id=
"cupsLangEncoding">cupsLangEncoding
</a></h3>
2339 <p class=
"description">Return the character encoding (us-ascii, etc.)
2340 for the given language.
</p>
2342 const char *cupsLangEncoding (
<br />
2343     cups_lang_t *lang
<br />
2345 <h4 class=
"parameters">Parameters
</h4>
2348 <dd class=
"description">Language data
</dd>
2350 <h4 class=
"returnvalue">Return Value
</h4>
2351 <p class=
"description">Character encoding
</p>
2352 <h3 class=
"function"><a id=
"cupsLangFlush">cupsLangFlush
</a></h3>
2353 <p class=
"description">Flush all language data out of the cache.
</p>
2355 void cupsLangFlush (void);
</p>
2356 <h3 class=
"function"><a id=
"cupsLangFree">cupsLangFree
</a></h3>
2357 <p class=
"description">Free language data.
</p>
2359 void cupsLangFree (
<br />
2360     cups_lang_t *lang
<br />
2362 <h4 class=
"parameters">Parameters
</h4>
2365 <dd class=
"description">Language to free
</dd>
2367 <h4 class=
"discussion">Discussion
</h4>
2368 <p class=
"discussion">This does not actually free anything; use
<a href=
"#cupsLangFlush"><code>cupsLangFlush
</code></a> for that.
</p>
2369 <h3 class=
"function"><a id=
"cupsLangGet">cupsLangGet
</a></h3>
2370 <p class=
"description">Get a language.
</p>
2372 cups_lang_t *cupsLangGet (
<br />
2373     const char *language
<br />
2375 <h4 class=
"parameters">Parameters
</h4>
2378 <dd class=
"description">Language or locale
</dd>
2380 <h4 class=
"returnvalue">Return Value
</h4>
2381 <p class=
"description">Language data
</p>
2382 <h3 class=
"function"><span class=
"info"> CUPS
2.0/macOS
10.10 </span><a id=
"cupsLocalizeDestMedia">cupsLocalizeDestMedia
</a></h3>
2383 <p class=
"description">Get the localized string for a destination media
2386 const char *cupsLocalizeDestMedia (
<br />
2387     http_t *http,
<br />
2388     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
2389     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *dinfo,
<br />
2390     unsigned flags,
<br />
2391     <a href=
"#cups_size_t">cups_size_t
</a> *size
<br />
2393 <h4 class=
"parameters">Parameters
</h4>
2396 <dd class=
"description">Connection to destination
</dd>
2398 <dd class=
"description">Destination
</dd>
2400 <dd class=
"description">Destination information
</dd>
2402 <dd class=
"description">Media flags
</dd>
2404 <dd class=
"description">Media size
</dd>
2406 <h4 class=
"returnvalue">Return Value
</h4>
2407 <p class=
"description">Localized string
</p>
2408 <h4 class=
"discussion">Discussion
</h4>
2409 <p class=
"discussion">The returned string is stored in the destination information and will become
2410 invalid if the destination information is deleted.
2413 <h3 class=
"function"><span class=
"info"> CUPS
1.6/macOS
10.8 </span><a id=
"cupsLocalizeDestOption">cupsLocalizeDestOption
</a></h3>
2414 <p class=
"description">Get the localized string for a destination
2417 const char *cupsLocalizeDestOption (
<br />
2418     http_t *http,
<br />
2419     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
2420     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *dinfo,
<br />
2421     const char *option
<br />
2423 <h4 class=
"parameters">Parameters
</h4>
2426 <dd class=
"description">Connection to destination
</dd>
2428 <dd class=
"description">Destination
</dd>
2430 <dd class=
"description">Destination information
</dd>
2432 <dd class=
"description">Option to localize
</dd>
2434 <h4 class=
"returnvalue">Return Value
</h4>
2435 <p class=
"description">Localized string
</p>
2436 <h4 class=
"discussion">Discussion
</h4>
2437 <p class=
"discussion">The returned string is stored in the destination information and will become
2438 invalid if the destination information is deleted.
2441 <h3 class=
"function"><span class=
"info"> CUPS
1.6/macOS
10.8 </span><a id=
"cupsLocalizeDestValue">cupsLocalizeDestValue
</a></h3>
2442 <p class=
"description">Get the localized string for a destination
2443 option+value pair.
</p>
2445 const char *cupsLocalizeDestValue (
<br />
2446     http_t *http,
<br />
2447     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
2448     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *dinfo,
<br />
2449     const char *option,
<br />
2450     const char *value
<br />
2452 <h4 class=
"parameters">Parameters
</h4>
2455 <dd class=
"description">Connection to destination
</dd>
2457 <dd class=
"description">Destination
</dd>
2459 <dd class=
"description">Destination information
</dd>
2461 <dd class=
"description">Option to localize
</dd>
2463 <dd class=
"description">Value to localize
</dd>
2465 <h4 class=
"returnvalue">Return Value
</h4>
2466 <p class=
"description">Localized string
</p>
2467 <h4 class=
"discussion">Discussion
</h4>
2468 <p class=
"discussion">The returned string is stored in the destination information and will become
2469 invalid if the destination information is deleted.
2472 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"cupsNotifySubject">cupsNotifySubject
</a></h3>
2473 <p class=
"description">Return the subject for the given notification message.
</p>
2475 char *cupsNotifySubject (
<br />
2476     cups_lang_t *lang,
<br />
2477     ipp_t *event
<br />
2479 <h4 class=
"parameters">Parameters
</h4>
2482 <dd class=
"description">Language data
</dd>
2484 <dd class=
"description">Event data
</dd>
2486 <h4 class=
"returnvalue">Return Value
</h4>
2487 <p class=
"description">Subject string or
<code>NULL
</code></p>
2488 <h4 class=
"discussion">Discussion
</h4>
2489 <p class=
"discussion">The returned string must be freed by the caller using
<code>free
</code>.
2492 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"cupsNotifyText">cupsNotifyText
</a></h3>
2493 <p class=
"description">Return the text for the given notification message.
</p>
2495 char *cupsNotifyText (
<br />
2496     cups_lang_t *lang,
<br />
2497     ipp_t *event
<br />
2499 <h4 class=
"parameters">Parameters
</h4>
2502 <dd class=
"description">Language data
</dd>
2504 <dd class=
"description">Event data
</dd>
2506 <h4 class=
"returnvalue">Return Value
</h4>
2507 <p class=
"description">Message text or
<code>NULL
</code></p>
2508 <h4 class=
"discussion">Discussion
</h4>
2509 <p class=
"discussion">The returned string must be freed by the caller using
<code>free
</code>.
2512 <h3 class=
"function"><a id=
"cupsParseOptions">cupsParseOptions
</a></h3>
2513 <p class=
"description">Parse options from a command-line argument.
</p>
2515 int cupsParseOptions (
<br />
2516     const char *arg,
<br />
2517     int num_options,
<br />
2518     <a href=
"#cups_option_t">cups_option_t
</a> **options
<br />
2520 <h4 class=
"parameters">Parameters
</h4>
2523 <dd class=
"description">Argument to parse
</dd>
2524 <dt>num_options
</dt>
2525 <dd class=
"description">Number of options
</dd>
2527 <dd class=
"description">Options found
</dd>
2529 <h4 class=
"returnvalue">Return Value
</h4>
2530 <p class=
"description">Number of options found
</p>
2531 <h4 class=
"discussion">Discussion
</h4>
2532 <p class=
"discussion">This function converts space-delimited name/value pairs according
2533 to the PAPI text option ABNF specification. Collection values
2534 (
"name={a=... b=... c=...}
") are stored with the curley brackets
2535 intact - use
<code>cupsParseOptions
</code> on the value to extract the
2536 collection attributes.
</p>
2537 <h3 class=
"function"><a id=
"cupsPrintFile">cupsPrintFile
</a></h3>
2538 <p class=
"description">Print a file to a printer or class on the default server.
</p>
2540 int cupsPrintFile (
<br />
2541     const char *name,
<br />
2542     const char *filename,
<br />
2543     const char *title,
<br />
2544     int num_options,
<br />
2545     <a href=
"#cups_option_t">cups_option_t
</a> *options
<br />
2547 <h4 class=
"parameters">Parameters
</h4>
2550 <dd class=
"description">Destination name
</dd>
2552 <dd class=
"description">File to print
</dd>
2554 <dd class=
"description">Title of job
</dd>
2555 <dt>num_options
</dt>
2556 <dd class=
"description">Number of options
</dd>
2558 <dd class=
"description">Options
</dd>
2560 <h4 class=
"returnvalue">Return Value
</h4>
2561 <p class=
"description">Job ID or
0 on error
</p>
2562 <h3 class=
"function"><span class=
"info"> CUPS
1.1.21/macOS
10.4 </span><a id=
"cupsPrintFile2">cupsPrintFile2
</a></h3>
2563 <p class=
"description">Print a file to a printer or class on the specified
2566 int cupsPrintFile2 (
<br />
2567     http_t *http,
<br />
2568     const char *name,
<br />
2569     const char *filename,
<br />
2570     const char *title,
<br />
2571     int num_options,
<br />
2572     <a href=
"#cups_option_t">cups_option_t
</a> *options
<br />
2574 <h4 class=
"parameters">Parameters
</h4>
2577 <dd class=
"description">Connection to server
</dd>
2579 <dd class=
"description">Destination name
</dd>
2581 <dd class=
"description">File to print
</dd>
2583 <dd class=
"description">Title of job
</dd>
2584 <dt>num_options
</dt>
2585 <dd class=
"description">Number of options
</dd>
2587 <dd class=
"description">Options
</dd>
2589 <h4 class=
"returnvalue">Return Value
</h4>
2590 <p class=
"description">Job ID or
0 on error
</p>
2591 <h3 class=
"function"><a id=
"cupsPrintFiles">cupsPrintFiles
</a></h3>
2592 <p class=
"description">Print one or more files to a printer or class on the
2595 int cupsPrintFiles (
<br />
2596     const char *name,
<br />
2597     int num_files,
<br />
2598     const char **files,
<br />
2599     const char *title,
<br />
2600     int num_options,
<br />
2601     <a href=
"#cups_option_t">cups_option_t
</a> *options
<br />
2603 <h4 class=
"parameters">Parameters
</h4>
2606 <dd class=
"description">Destination name
</dd>
2608 <dd class=
"description">Number of files
</dd>
2610 <dd class=
"description">File(s) to print
</dd>
2612 <dd class=
"description">Title of job
</dd>
2613 <dt>num_options
</dt>
2614 <dd class=
"description">Number of options
</dd>
2616 <dd class=
"description">Options
</dd>
2618 <h4 class=
"returnvalue">Return Value
</h4>
2619 <p class=
"description">Job ID or
0 on error
</p>
2620 <h3 class=
"function"><span class=
"info"> CUPS
1.1.21/macOS
10.4 </span><a id=
"cupsPrintFiles2">cupsPrintFiles2
</a></h3>
2621 <p class=
"description">Print one or more files to a printer or class on the
2622 specified server.
</p>
2624 int cupsPrintFiles2 (
<br />
2625     http_t *http,
<br />
2626     const char *name,
<br />
2627     int num_files,
<br />
2628     const char **files,
<br />
2629     const char *title,
<br />
2630     int num_options,
<br />
2631     <a href=
"#cups_option_t">cups_option_t
</a> *options
<br />
2633 <h4 class=
"parameters">Parameters
</h4>
2636 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
2638 <dd class=
"description">Destination name
</dd>
2640 <dd class=
"description">Number of files
</dd>
2642 <dd class=
"description">File(s) to print
</dd>
2644 <dd class=
"description">Title of job
</dd>
2645 <dt>num_options
</dt>
2646 <dd class=
"description">Number of options
</dd>
2648 <dd class=
"description">Options
</dd>
2650 <h4 class=
"returnvalue">Return Value
</h4>
2651 <p class=
"description">Job ID or
0 on error
</p>
2652 <h3 class=
"function"><span class=
"info"> CUPS
1.3/macOS
10.5 </span><a id=
"cupsRemoveDest">cupsRemoveDest
</a></h3>
2653 <p class=
"description">Remove a destination from the destination list.
</p>
2655 int cupsRemoveDest (
<br />
2656     const char *name,
<br />
2657     const char *instance,
<br />
2658     int num_dests,
<br />
2659     <a href=
"#cups_dest_t">cups_dest_t
</a> **dests
<br />
2661 <h4 class=
"parameters">Parameters
</h4>
2664 <dd class=
"description">Destination name
</dd>
2666 <dd class=
"description">Instance name or
<code>NULL
</code></dd>
2668 <dd class=
"description">Number of destinations
</dd>
2670 <dd class=
"description">Destinations
</dd>
2672 <h4 class=
"returnvalue">Return Value
</h4>
2673 <p class=
"description">New number of destinations
</p>
2674 <h4 class=
"discussion">Discussion
</h4>
2675 <p class=
"discussion">Removing a destination/instance does not delete the class or printer
2676 queue, merely the lpoptions for that destination/instance. Use the
2677 <a href=
"#cupsSetDests"><code>cupsSetDests
</code></a> or
<a href=
"#cupsSetDests2"><code>cupsSetDests2
</code></a> functions to save the new
2678 options for the user.
2681 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"cupsRemoveOption">cupsRemoveOption
</a></h3>
2682 <p class=
"description">Remove an option from an option array.
</p>
2684 int cupsRemoveOption (
<br />
2685     const char *name,
<br />
2686     int num_options,
<br />
2687     <a href=
"#cups_option_t">cups_option_t
</a> **options
<br />
2689 <h4 class=
"parameters">Parameters
</h4>
2692 <dd class=
"description">Option name
</dd>
2693 <dt>num_options
</dt>
2694 <dd class=
"description">Current number of options
</dd>
2696 <dd class=
"description">Options
</dd>
2698 <h4 class=
"returnvalue">Return Value
</h4>
2699 <p class=
"description">New number of options
</p>
2700 <h3 class=
"function"><a id=
"cupsServer">cupsServer
</a></h3>
2701 <p class=
"description">Return the hostname/address of the current server.
</p>
2703 const char *cupsServer (void);
</p>
2704 <h4 class=
"returnvalue">Return Value
</h4>
2705 <p class=
"description">Server name
</p>
2706 <h4 class=
"discussion">Discussion
</h4>
2707 <p class=
"discussion">The default server comes from the CUPS_SERVER environment variable, then the
2708 ~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not
2709 set, the default is the local system - either
"localhost
" or a domain socket
2712 The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6
2713 address, or a domain socket pathname.
<br>
2715 Note: The current server is tracked separately for each thread in a program.
2716 Multi-threaded programs that override the server via the
2717 <a href=
"#cupsSetServer"><code>cupsSetServer
</code></a> function need to do so in each thread for the same
2718 server to be used.
</p>
2719 <h3 class=
"function"><span class=
"info"> CUPS
1.5/macOS
10.7 </span><a id=
"cupsSetClientCertCB">cupsSetClientCertCB
</a></h3>
2720 <p class=
"description">Set the client certificate callback.
</p>
2722 void cupsSetClientCertCB (
<br />
2723     <a href=
"#cups_client_cert_cb_t">cups_client_cert_cb_t
</a> cb,
<br />
2724     void *user_data
<br />
2726 <h4 class=
"parameters">Parameters
</h4>
2729 <dd class=
"description">Callback function
</dd>
2731 <dd class=
"description">User data pointer
</dd>
2733 <h4 class=
"discussion">Discussion
</h4>
2734 <p class=
"discussion">Pass
<code>NULL
</code> to restore the default callback.
<br>
2736 Note: The current certificate callback is tracked separately for each thread
2737 in a program. Multi-threaded programs that override the callback need to do
2738 so in each thread for the same callback to be used.
2741 <h3 class=
"function"><span class=
"info"> CUPS
1.5/macOS
10.7 </span><a id=
"cupsSetCredentials">cupsSetCredentials
</a></h3>
2742 <p class=
"description">Set the default credentials to be used for SSL/TLS
2745 int cupsSetCredentials (
<br />
2746     cups_array_t *credentials
<br />
2748 <h4 class=
"parameters">Parameters
</h4>
2750 <dt>credentials
</dt>
2751 <dd class=
"description">Array of credentials
</dd>
2753 <h4 class=
"returnvalue">Return Value
</h4>
2754 <p class=
"description">Status of call (
0 = success)
</p>
2755 <h4 class=
"discussion">Discussion
</h4>
2756 <p class=
"discussion">Note: The default credentials are tracked separately for each thread in a
2757 program. Multi-threaded programs that override the setting need to do so in
2758 each thread for the same setting to be used.
2761 <h3 class=
"function"><span class=
"info"> CUPS
1.3/macOS
10.5 </span><a id=
"cupsSetDefaultDest">cupsSetDefaultDest
</a></h3>
2762 <p class=
"description">Set the default destination.
</p>
2764 void cupsSetDefaultDest (
<br />
2765     const char *name,
<br />
2766     const char *instance,
<br />
2767     int num_dests,
<br />
2768     <a href=
"#cups_dest_t">cups_dest_t
</a> *dests
<br />
2770 <h4 class=
"parameters">Parameters
</h4>
2773 <dd class=
"description">Destination name
</dd>
2775 <dd class=
"description">Instance name or
<code>NULL
</code></dd>
2777 <dd class=
"description">Number of destinations
</dd>
2779 <dd class=
"description">Destinations
</dd>
2781 <h3 class=
"function"><a id=
"cupsSetDests">cupsSetDests
</a></h3>
2782 <p class=
"description">Save the list of destinations for the default server.
</p>
2784 void cupsSetDests (
<br />
2785     int num_dests,
<br />
2786     <a href=
"#cups_dest_t">cups_dest_t
</a> *dests
<br />
2788 <h4 class=
"parameters">Parameters
</h4>
2791 <dd class=
"description">Number of destinations
</dd>
2793 <dd class=
"description">Destinations
</dd>
2795 <h4 class=
"discussion">Discussion
</h4>
2796 <p class=
"discussion">This function saves the destinations to /etc/cups/lpoptions when run
2797 as root and ~/.cups/lpoptions when run as a normal user.
</p>
2798 <h3 class=
"function"><span class=
"info"> CUPS
1.1.21/macOS
10.4 </span><a id=
"cupsSetDests2">cupsSetDests2
</a></h3>
2799 <p class=
"description">Save the list of destinations for the specified server.
</p>
2801 int cupsSetDests2 (
<br />
2802     http_t *http,
<br />
2803     int num_dests,
<br />
2804     <a href=
"#cups_dest_t">cups_dest_t
</a> *dests
<br />
2806 <h4 class=
"parameters">Parameters
</h4>
2809 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
2811 <dd class=
"description">Number of destinations
</dd>
2813 <dd class=
"description">Destinations
</dd>
2815 <h4 class=
"returnvalue">Return Value
</h4>
2816 <p class=
"description">0 on success, -
1 on error
</p>
2817 <h4 class=
"discussion">Discussion
</h4>
2818 <p class=
"discussion">This function saves the destinations to /etc/cups/lpoptions when run
2819 as root and ~/.cups/lpoptions when run as a normal user.
2822 <h3 class=
"function"><a id=
"cupsSetEncryption">cupsSetEncryption
</a></h3>
2823 <p class=
"description">Set the encryption preference.
</p>
2825 void cupsSetEncryption (
<br />
2826     http_encryption_t e
<br />
2828 <h4 class=
"parameters">Parameters
</h4>
2831 <dd class=
"description">New encryption preference
</dd>
2833 <h4 class=
"discussion">Discussion
</h4>
2834 <p class=
"discussion">The default encryption setting comes from the CUPS_ENCRYPTION
2835 environment variable, then the ~/.cups/client.conf file, and finally the
2836 /etc/cups/client.conf file. If not set, the default is
2837 <code>HTTP_ENCRYPTION_IF_REQUESTED
</code>.
<br>
2839 Note: The current encryption setting is tracked separately for each thread
2840 in a program. Multi-threaded programs that override the setting need to do
2841 so in each thread for the same setting to be used.
</p>
2842 <h3 class=
"function"><a id=
"cupsSetPasswordCB">cupsSetPasswordCB
</a></h3>
2843 <p class=
"description">Set the password callback for CUPS.
</p>
2845 void cupsSetPasswordCB (
<br />
2846     <a href=
"#cups_password_cb_t">cups_password_cb_t
</a> cb
<br />
2848 <h4 class=
"parameters">Parameters
</h4>
2851 <dd class=
"description">Callback function
</dd>
2853 <h4 class=
"discussion">Discussion
</h4>
2854 <p class=
"discussion">Pass
<code>NULL
</code> to restore the default (console) password callback, which
2855 reads the password from the console. Programs should call either this
2856 function or
<a href=
"#cupsSetPasswordCB2"><code>cupsSetPasswordCB2
</code></a>, as only one callback can be registered
2857 by a program per thread.
<br>
2859 Note: The current password callback is tracked separately for each thread
2860 in a program. Multi-threaded programs that override the callback need to do
2861 so in each thread for the same callback to be used.
</p>
2862 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"cupsSetPasswordCB2">cupsSetPasswordCB2
</a></h3>
2863 <p class=
"description">Set the advanced password callback for CUPS.
</p>
2865 void cupsSetPasswordCB2 (
<br />
2866     <a href=
"#cups_password_cb2_t">cups_password_cb2_t
</a> cb,
<br />
2867     void *user_data
<br />
2869 <h4 class=
"parameters">Parameters
</h4>
2872 <dd class=
"description">Callback function
</dd>
2874 <dd class=
"description">User data pointer
</dd>
2876 <h4 class=
"discussion">Discussion
</h4>
2877 <p class=
"discussion">Pass
<code>NULL
</code> to restore the default (console) password callback, which
2878 reads the password from the console. Programs should call either this
2879 function or
<a href=
"#cupsSetPasswordCB2"><code>cupsSetPasswordCB2
</code></a>, as only one callback can be registered
2880 by a program per thread.
<br>
2882 Note: The current password callback is tracked separately for each thread
2883 in a program. Multi-threaded programs that override the callback need to do
2884 so in each thread for the same callback to be used.
2887 <h3 class=
"function"><a id=
"cupsSetServer">cupsSetServer
</a></h3>
2888 <p class=
"description">Set the default server name and port.
</p>
2890 void cupsSetServer (
<br />
2891     const char *server
<br />
2893 <h4 class=
"parameters">Parameters
</h4>
2896 <dd class=
"description">Server name
</dd>
2898 <h4 class=
"discussion">Discussion
</h4>
2899 <p class=
"discussion">The
"server
" string can be a fully-qualified hostname, a numeric
2900 IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP
2901 addresses can be optionally followed by a colon and port number to override
2902 the default port
631, e.g.
"hostname:
8631". Pass
<code>NULL
</code> to restore the
2903 default server name and port.
<br>
2905 Note: The current server is tracked separately for each thread in a program.
2906 Multi-threaded programs that override the server need to do so in each
2907 thread for the same server to be used.
</p>
2908 <h3 class=
"function"><span class=
"info"> CUPS
1.5/macOS
10.7 </span><a id=
"cupsSetServerCertCB">cupsSetServerCertCB
</a></h3>
2909 <p class=
"description">Set the server certificate callback.
</p>
2911 void cupsSetServerCertCB (
<br />
2912     <a href=
"#cups_server_cert_cb_t">cups_server_cert_cb_t
</a> cb,
<br />
2913     void *user_data
<br />
2915 <h4 class=
"parameters">Parameters
</h4>
2918 <dd class=
"description">Callback function
</dd>
2920 <dd class=
"description">User data pointer
</dd>
2922 <h4 class=
"discussion">Discussion
</h4>
2923 <p class=
"discussion">Pass
<code>NULL
</code> to restore the default callback.
<br>
2925 Note: The current credentials callback is tracked separately for each thread
2926 in a program. Multi-threaded programs that override the callback need to do
2927 so in each thread for the same callback to be used.
2930 <h3 class=
"function"><a id=
"cupsSetUser">cupsSetUser
</a></h3>
2931 <p class=
"description">Set the default user name.
</p>
2933 void cupsSetUser (
<br />
2934     const char *user
<br />
2936 <h4 class=
"parameters">Parameters
</h4>
2939 <dd class=
"description">User name
</dd>
2941 <h4 class=
"discussion">Discussion
</h4>
2942 <p class=
"discussion">Pass
<code>NULL
</code> to restore the default user name.
<br>
2944 Note: The current user name is tracked separately for each thread in a
2945 program. Multi-threaded programs that override the user name need to do so
2946 in each thread for the same user name to be used.
</p>
2947 <h3 class=
"function"><span class=
"info"> CUPS
1.7/macOS
10.9 </span><a id=
"cupsSetUserAgent">cupsSetUserAgent
</a></h3>
2948 <p class=
"description">Set the default HTTP User-Agent string.
</p>
2950 void cupsSetUserAgent (
<br />
2951     const char *user_agent
<br />
2953 <h4 class=
"parameters">Parameters
</h4>
2956 <dd class=
"description">User-Agent string or
<code>NULL
</code></dd>
2958 <h4 class=
"discussion">Discussion
</h4>
2959 <p class=
"discussion">Setting the string to NULL forces the default value containing the CUPS
2960 version, IPP version, and operating system version and architecture.
2963 <h3 class=
"function"><span class=
"info"> CUPS
1.6/macOS
10.8 </span><a id=
"cupsStartDestDocument">cupsStartDestDocument
</a></h3>
2964 <p class=
"description">Start a new document.
</p>
2966 http_status_t cupsStartDestDocument (
<br />
2967     http_t *http,
<br />
2968     <a href=
"#cups_dest_t">cups_dest_t
</a> *dest,
<br />
2969     <a href=
"#cups_dinfo_t">cups_dinfo_t
</a> *info,
<br />
2970     int job_id,
<br />
2971     const char *docname,
<br />
2972     const char *format,
<br />
2973     int num_options,
<br />
2974     <a href=
"#cups_option_t">cups_option_t
</a> *options,
<br />
2975     int last_document
<br />
2977 <h4 class=
"parameters">Parameters
</h4>
2980 <dd class=
"description">Connection to destination
</dd>
2982 <dd class=
"description">Destination
</dd>
2984 <dd class=
"description">Destination information
</dd>
2986 <dd class=
"description">Job ID
</dd>
2988 <dd class=
"description">Document name
</dd>
2990 <dd class=
"description">Document format
</dd>
2991 <dt>num_options
</dt>
2992 <dd class=
"description">Number of document options
</dd>
2994 <dd class=
"description">Document options
</dd>
2995 <dt>last_document
</dt>
2996 <dd class=
"description">1 if this is the last document
</dd>
2998 <h4 class=
"returnvalue">Return Value
</h4>
2999 <p class=
"description">Status of document creation
</p>
3000 <h4 class=
"discussion">Discussion
</h4>
3001 <p class=
"discussion">"job_id
" is the job ID returned by cupsCreateDestJob.
"docname
" is the name
3002 of the document/file being printed,
"format
" is the MIME media type for the
3003 document (see CUPS_FORMAT_xxx constants), and
"num_options
" and
"options
"
3004 are the options do be applied to the document.
"last_document
" should be
1
3005 if this is the last document to be submitted in the job. Returns
3006 <code>HTTP_CONTINUE
</code> on success.
3009 <h3 class=
"function"><span class=
"info"> CUPS
1.4/macOS
10.6 </span><a id=
"cupsStartDocument">cupsStartDocument
</a></h3>
3010 <p class=
"description">Add a document to a job created with cupsCreateJob().
</p>
3012 http_status_t cupsStartDocument (
<br />
3013     http_t *http,
<br />
3014     const char *name,
<br />
3015     int job_id,
<br />
3016     const char *docname,
<br />
3017     const char *format,
<br />
3018     int last_document
<br />
3020 <h4 class=
"parameters">Parameters
</h4>
3023 <dd class=
"description">Connection to server or
<code>CUPS_HTTP_DEFAULT
</code></dd>
3025 <dd class=
"description">Destination name
</dd>
3027 <dd class=
"description">Job ID from
<a href=
"#cupsCreateJob"><code>cupsCreateJob
</code></a></dd>
3029 <dd class=
"description">Name of document
</dd>
3031 <dd class=
"description">MIME type or
<code>CUPS_FORMAT_foo
</code></dd>
3032 <dt>last_document
</dt>
3033 <dd class=
"description">1 for last document in job,
0 otherwise
</dd>
3035 <h4 class=
"returnvalue">Return Value
</h4>
3036 <p class=
"description">HTTP status of request
</p>
3037 <h4 class=
"discussion">Discussion
</h4>
3038 <p class=
"discussion">Use
<a href=
"#cupsWriteRequestData"><code>cupsWriteRequestData
</code></a> to write data for the document and
3039 <a href=
"#cupsFinishDocument"><code>cupsFinishDocument
</code></a> to finish the document and get the submission status.
<br>
3041 The MIME type constants
<code>CUPS_FORMAT_AUTO
</code>,
<code>CUPS_FORMAT_PDF
</code>,
3042 <code>CUPS_FORMAT_POSTSCRIPT
</code>,
<code>CUPS_FORMAT_RAW
</code>, and
3043 <code>CUPS_FORMAT_TEXT
</code> are provided for the
"format
" argument, although
3044 any supported MIME type string can be supplied.
3047 <h3 class=
"function"><a id=
"cupsTempFd">cupsTempFd
</a></h3>
3048 <p class=
"description">Creates a temporary file.
</p>
3050 int cupsTempFd (
<br />
3051     char *filename,
<br />
3052     int len
<br />
3054 <h4 class=
"parameters">Parameters
</h4>
3057 <dd class=
"description">Pointer to buffer
</dd>
3059 <dd class=
"description">Size of buffer
</dd>
3061 <h4 class=
"returnvalue">Return Value
</h4>
3062 <p class=
"description">New file descriptor or -
1 on error
</p>
3063 <h4 class=
"discussion">Discussion
</h4>
3064 <p class=
"discussion">The temporary filename is returned in the filename buffer.
3065 The temporary file is opened for reading and writing.
</p>
3066 <h3 class=
"function"><span class=
"info"> DEPRECATED
 </span><a id=
"cupsTempFile">cupsTempFile
</a></h3>
3067 <p class=
"description">Generates a temporary filename.
</p>
3069 char *cupsTempFile (
<br />
3070     char *filename,
<br />
3071     int len
<br />
3073 <h4 class=
"parameters">Parameters
</h4>
3076 <dd class=
"description">Pointer to buffer
</dd>
3078 <dd class=
"description">Size of buffer
</dd>
3080 <h4 class=
"returnvalue">Return Value
</h4>
3081 <p class=
"description">Filename or
<code>NULL
</code> on error
</p>
3082 <h4 class=
"discussion">Discussion
</h4>
3083 <p class=
"discussion">The temporary filename is returned in the filename buffer.
3084 This function is deprecated and will no longer generate a temporary
3085 filename - use
<a href=
"#cupsTempFd"><code>cupsTempFd
</code></a> or
<a href=
"#cupsTempFile2"><code>cupsTempFile2
</code></a> instead.
3088 <h3 class=
"function"><span class=
"info"> CUPS
1.2/macOS
10.5 </span><a id=
"cupsTempFile2">cupsTempFile2
</a></h3>
3089 <p class=
"description">Creates a temporary CUPS file.
</p>
3091 cups_file_t *cupsTempFile2 (
<br />
3092     char *filename,
<br />
3093     int len
<br />
3095 <h4 class=
"parameters">Parameters
</h4>
3098 <dd class=
"description">Pointer to buffer
</dd>
3100 <dd class=
"description">Size of buffer
</dd>
3102 <h4 class=
"returnvalue">Return Value
</h4>
3103 <p class=
"description">CUPS file or
<code>NULL
</code> on error
</p>
3104 <h4 class=
"discussion">Discussion
</h4>
3105 <p class=
"discussion">The temporary filename is returned in the filename buffer.
3106 The temporary file is opened for writing.
3109 <h3 class=
"function"><a id=
"cupsUser">cupsUser
</a></h3>
3110 <p class=
"description">Return the current user's name.
</p>
3112 const char *cupsUser (void);
</p>
3113 <h4 class=
"returnvalue">Return Value
</h4>
3114 <p class=
"description">User name
</p>
3115 <h4 class=
"discussion">Discussion
</h4>
3116 <p class=
"discussion">Note: The current user name is tracked separately for each thread in a
3117 program. Multi-threaded programs that override the user name with the
3118 <a href=
"#cupsSetUser"><code>cupsSetUser
</code></a> function need to do so in each thread for the same user
3119 name to be used.
</p>
3120 <h3 class=
"function"><span class=
"info"> CUPS
1.7/macOS
10.9 </span><a id=
"cupsUserAgent">cupsUserAgent
</a></h3>
3121 <p class=
"description">Return the default HTTP User-Agent string.
</p>
3123 const char *cupsUserAgent (void);
</p>
3124 <h4 class=
"returnvalue">Return Value
</h4>
3125 <p class=
"description">User-Agent string
</p>
3126 <h3 class=
"function"><span class=
"info"> CUPS
1.7/macOS
10.9 </span><a id=
"pwgFormatSizeName">pwgFormatSizeName
</a></h3>
3127 <p class=
"description">Generate a PWG self-describing media size name.
</p>
3129 int pwgFormatSizeName (
<br />
3130     char *keyword,
<br />
3131     size_t keysize,
<br />
3132     const char *prefix,
<br />
3133     const char *name,
<br />
3134     int width,
<br />
3135     int length,
<br />
3136     const char *units
<br />
3138 <h4 class=
"parameters">Parameters
</h4>
3141 <dd class=
"description">Keyword buffer
</dd>
3143 <dd class=
"description">Size of keyword buffer
</dd>
3145 <dd class=
"description">Prefix for PWG size or
<code>NULL
</code> for automatic
</dd>
3147 <dd class=
"description">Size name or
<code>NULL
</code></dd>
3149 <dd class=
"description">Width of page in
2540ths
</dd>
3151 <dd class=
"description">Length of page in
2540ths
</dd>
3153 <dd class=
"description">Units -
"in
",
"mm
", or
<code>NULL
</code> for automatic
</dd>
3155 <h4 class=
"returnvalue">Return Value
</h4>
3156 <p class=
"description">1 on success,
0 on failure
</p>
3157 <h4 class=
"discussion">Discussion
</h4>
3158 <p class=
"discussion">This function generates a PWG self-describing media size name of the form
3159 "prefix_name_WIDTHxLENGTHunits
". The prefix is typically
"custom
" or
"roll
"
3160 for user-supplied sizes but can also be
"disc
",
"iso
",
"jis
",
"jpn
",
"na
",
3161 "oe
",
"om
",
"prc
", or
"roc
". A value of
<code>NULL
</code> automatically chooses
3162 "oe
" or
"om
" depending on the units.
<br>
3164 The size name may only contain lowercase letters, numbers,
"-
", and
".
". If
3165 <code>NULL
</code> is passed, the size name will contain the formatted dimensions.
<br>
3167 The width and length are specified in hundredths of millimeters, equivalent
3168 to
1/
100000th of a meter or
1/
2540th of an inch. The width, length, and
3169 units used for the generated size name are calculated automatically if the
3170 units string is
<code>NULL
</code>, otherwise inches (
"in
") or millimeters (
"mm
")
3174 <h3 class=
"function"><span class=
"info"> CUPS
1.7/macOS
10.9 </span><a id=
"pwgInitSize">pwgInitSize
</a></h3>
3175 <p class=
"description">Initialize a pwg_size_t structure using IPP Job Template
3178 int pwgInitSize (
<br />
3179     <a href=
"#pwg_size_t">pwg_size_t
</a> *size,
<br />
3180     ipp_t *job,
<br />
3181     int *margins_set
<br />
3183 <h4 class=
"parameters">Parameters
</h4>
3186 <dd class=
"description">Size to initialize
</dd>
3188 <dd class=
"description">Job template attributes
</dd>
3189 <dt>margins_set
</dt>
3190 <dd class=
"description">1 if margins were set,
0 otherwise
</dd>
3192 <h4 class=
"returnvalue">Return Value
</h4>
3193 <p class=
"description">1 if size was initialized,
0 otherwise
</p>
3194 <h4 class=
"discussion">Discussion
</h4>
3195 <p class=
"discussion">This function initializes a pwg_size_t structure from an IPP
"media
" or
3196 "media-col
" attribute in the specified IPP message.
0 is returned if neither
3197 attribute is found in the message or the values are not valid.
<br>
3199 The
"margins_set
" variable is initialized to
1 if any
"media-xxx-margin
"
3200 member attribute was specified in the
"media-col
" Job Template attribute,
3201 otherwise it is initialized to
0.
3204 <h3 class=
"function"><span class=
"info"> CUPS
1.7/macOS
10.9 </span><a id=
"pwgMediaForLegacy">pwgMediaForLegacy
</a></h3>
3205 <p class=
"description">Find a PWG media size by ISO/IPP legacy name.
</p>
3207 <a href=
"#pwg_media_t">pwg_media_t
</a> *pwgMediaForLegacy (
<br />
3208     const char *legacy
<br />
3210 <h4 class=
"parameters">Parameters
</h4>
3213 <dd class=
"description">Legacy size name
</dd>
3215 <h4 class=
"returnvalue">Return Value
</h4>
3216 <p class=
"description">Matching size or NULL
</p>
3217 <h4 class=
"discussion">Discussion
</h4>
3218 <p class=
"discussion">The
"name
" argument specifies the legacy ISO media size name, for example
3219 "iso-a4
" or
"na-letter
".
3222 <h3 class=
"function"><span class=
"info"> CUPS
1.7/macOS
10.9 </span><a id=
"pwgMediaForPPD">pwgMediaForPPD
</a></h3>
3223 <p class=
"description">Find a PWG media size by Adobe PPD name.
</p>
3225 <a href=
"#pwg_media_t">pwg_media_t
</a> *pwgMediaForPPD (
<br />
3226     const char *ppd
<br />
3228 <h4 class=
"parameters">Parameters
</h4>
3231 <dd class=
"description">PPD size name
</dd>
3233 <h4 class=
"returnvalue">Return Value
</h4>
3234 <p class=
"description">Matching size or NULL
</p>
3235 <h4 class=
"discussion">Discussion
</h4>
3236 <p class=
"discussion">The
"ppd
" argument specifies an Adobe page size name as defined in Table B
.1
3237 of the Adobe PostScript Printer Description File Format Specification Version
3240 If the name is non-standard, the returned PWG media size is stored in
3241 thread-local storage and is overwritten by each call to the function in the
3242 thread. Custom names can be of the form
"Custom.WIDTHxLENGTH[units]
" or
3243 "WIDTHxLENGTH[units]
".
3246 <h3 class=
"function"><span class=
"info"> CUPS
1.7/macOS
10.9 </span><a id=
"pwgMediaForPWG">pwgMediaForPWG
</a></h3>
3247 <p class=
"description">Find a PWG media size by
5101.1 self-describing name.
</p>
3249 <a href=
"#pwg_media_t">pwg_media_t
</a> *pwgMediaForPWG (
<br />
3250     const char *pwg
<br />
3252 <h4 class=
"parameters">Parameters
</h4>
3255 <dd class=
"description">PWG size name
</dd>
3257 <h4 class=
"returnvalue">Return Value
</h4>
3258 <p class=
"description">Matching size or NULL
</p>
3259 <h4 class=
"discussion">Discussion
</h4>
3260 <p class=
"discussion">The
"pwg
" argument specifies a self-describing media size name of the form
3261 "prefix_name_WIDTHxLENGTHunits
" as defined in PWG
5101.1.
<br>
3263 If the name is non-standard, the returned PWG media size is stored in
3264 thread-local storage and is overwritten by each call to the function in the
3268 <h3 class=
"function"><span class=
"info"> CUPS
1.7/macOS
10.9 </span><a id=
"pwgMediaForSize">pwgMediaForSize
</a></h3>
3269 <p class=
"description">Get the PWG media size for the given dimensions.
</p>
3271 <a href=
"#pwg_media_t">pwg_media_t
</a> *pwgMediaForSize (
<br />
3272     int width,
<br />
3273     int length
<br />
3275 <h4 class=
"parameters">Parameters
</h4>
3278 <dd class=
"description">Width in hundredths of millimeters
</dd>
3280 <dd class=
"description">Length in hundredths of millimeters
</dd>
3282 <h4 class=
"returnvalue">Return Value
</h4>
3283 <p class=
"description">PWG media name
</p>
3284 <h4 class=
"discussion">Discussion
</h4>
3285 <p class=
"discussion">The
"width
" and
"length
" are in hundredths of millimeters, equivalent to
3286 1/
100000th of a meter or
1/
2540th of an inch.
<br>
3288 If the dimensions are non-standard, the returned PWG media size is stored in
3289 thread-local storage and is overwritten by each call to the function in the
3293 <h2 class=
"title"><a id=
"TYPES">Data Types
</a></h2>
3294 <h3 class=
"typedef"><a id=
"cups_client_cert_cb_t"><span class=
"info"> CUPS
1.5/macOS
10.7 </span>cups_client_cert_cb_t
</a></h3>
3295 <p class=
"description">Client credentials callback
3298 typedef int (*cups_client_cert_cb_t)(http_t *http, void *tls, cups_array_t *distinguished_names, void *user_data);
3300 <h3 class=
"typedef"><a id=
"cups_dest_block_t"><span class=
"info"> CUPS
1.6/macOS
10.8 </span>cups_dest_block_t
</a></h3>
3301 <p class=
"description">Destination enumeration block
3304 typedef int (*cups_dest_block_t(unsigned flags,
<a href=
"#cups_dest_t">cups_dest_t
</a> *dest);
3306 <h3 class=
"typedef"><a id=
"cups_dest_cb_t"><span class=
"info"> CUPS
1.6/macOS
10.8 </span>cups_dest_cb_t
</a></h3>
3307 <p class=
"description">Destination enumeration callback
3310 typedef int (*cups_dest_cb_t)(void *user_data, unsigned flags,
<a href=
"#cups_dest_t">cups_dest_t
</a> *dest);
3312 <h3 class=
"typedef"><a id=
"cups_dest_t">cups_dest_t
</a></h3>
3313 <p class=
"description">Destination
</p>
3315 typedef struct
<a href=
"#cups_dest_s">cups_dest_s
</a> cups_dest_t;
3317 <h3 class=
"typedef"><a id=
"cups_dinfo_t"><span class=
"info"> CUPS
1.6/macOS
10.8 </span>cups_dinfo_t
</a></h3>
3318 <p class=
"description">Destination capability and status
3321 typedef struct _cups_dinfo_s cups_dinfo_t;
3323 <h3 class=
"typedef"><a id=
"cups_job_t">cups_job_t
</a></h3>
3324 <p class=
"description">Job
</p>
3326 typedef struct
<a href=
"#cups_job_s">cups_job_s
</a> cups_job_t;
3328 <h3 class=
"typedef"><a id=
"cups_option_t">cups_option_t
</a></h3>
3329 <p class=
"description">Printer Options
</p>
3331 typedef struct
<a href=
"#cups_option_s">cups_option_s
</a> cups_option_t;
3333 <h3 class=
"typedef"><a id=
"cups_password_cb2_t"><span class=
"info"> CUPS
1.4/macOS
10.6 </span>cups_password_cb2_t
</a></h3>
3334 <p class=
"description">New password callback
3337 typedef const char *(*cups_password_cb2_t)(const char *prompt, http_t *http, const char *method, const char *resource, void *user_data);
3339 <h3 class=
"typedef"><a id=
"cups_password_cb_t">cups_password_cb_t
</a></h3>
3340 <p class=
"description">Password callback
</p>
3342 typedef const char *(*cups_password_cb_t)(const char *prompt);
3344 <h3 class=
"typedef"><a id=
"cups_ptype_t">cups_ptype_t
</a></h3>
3345 <p class=
"description">Printer type/capability bits
</p>
3347 typedef unsigned cups_ptype_t;
3349 <h3 class=
"typedef"><a id=
"cups_server_cert_cb_t"><span class=
"info"> CUPS
1.5/macOS
10.7 </span>cups_server_cert_cb_t
</a></h3>
3350 <p class=
"description">Server credentials callback
3353 typedef int (*cups_server_cert_cb_t)(http_t *http, void *tls, cups_array_t *certs, void *user_data);
3355 <h3 class=
"typedef"><a id=
"cups_size_t"><span class=
"info"> CUPS
1.6/macOS
10.8 </span>cups_size_t
</a></h3>
3356 <p class=
"description">Media Size
</p>
3358 typedef struct
<a href=
"#cups_size_s">cups_size_s
</a> cups_size_t;
3360 <h3 class=
"typedef"><a id=
"pwg_map_t">pwg_map_t
</a></h3>
3361 <p class=
"description">Map element - PPD to/from PWG
</p>
3363 typedef struct
<a href=
"#pwg_map_s">pwg_map_s
</a> pwg_map_t;
3365 <h3 class=
"typedef"><a id=
"pwg_media_t">pwg_media_t
</a></h3>
3366 <p class=
"description">Common media size data
</p>
3368 typedef struct
<a href=
"#pwg_media_s">pwg_media_s
</a> pwg_media_t;
3370 <h3 class=
"typedef"><a id=
"pwg_size_t">pwg_size_t
</a></h3>
3371 <p class=
"description">Size element - PPD to/from PWG
</p>
3373 typedef struct
<a href=
"#pwg_size_s">pwg_size_s
</a> pwg_size_t;
3375 <h2 class=
"title"><a id=
"STRUCTURES">Structures
</a></h2>
3376 <h3 class=
"struct"><a id=
"cups_dest_s">cups_dest_s
</a></h3>
3377 <p class=
"description">Destination
</p>
3378 <p class=
"code">struct cups_dest_s {
<br />
3379     char *name, *instance;
<br />
3380     int is_default;
<br />
3381     int num_options;
<br />
3382     <a href=
"#cups_option_t">cups_option_t
</a> *options;
<br />
3384 <h4 class=
"members">Members
</h4>
3387 <dd class=
"description">Local instance name or NULL
</dd>
3388 <dt>is_default
</dt>
3389 <dd class=
"description">Is this printer the default?
</dd>
3390 <dt>num_options
</dt>
3391 <dd class=
"description">Number of options
</dd>
3393 <dd class=
"description">Options
</dd>
3395 <h3 class=
"struct"><a id=
"cups_job_s">cups_job_s
</a></h3>
3396 <p class=
"description">Job
</p>
3397 <p class=
"code">struct cups_job_s {
<br />
3398     time_t completed_time;
<br />
3399     time_t creation_time;
<br />
3400     char *dest;
<br />
3401     char *format;
<br />
3402     int id;
<br />
3403     int priority;
<br />
3404     time_t processing_time;
<br />
3405     int size;
<br />
3406     ipp_jstate_t state;
<br />
3407     char *title;
<br />
3408     char *user;
<br />
3410 <h4 class=
"members">Members
</h4>
3412 <dt>completed_time
</dt>
3413 <dd class=
"description">Time the job was completed
</dd>
3414 <dt>creation_time
</dt>
3415 <dd class=
"description">Time the job was created
</dd>
3417 <dd class=
"description">Printer or class name
</dd>
3419 <dd class=
"description">Document format
</dd>
3421 <dd class=
"description">The job ID
</dd>
3423 <dd class=
"description">Priority (
1-
100)
</dd>
3424 <dt>processing_time
</dt>
3425 <dd class=
"description">Time the job was processed
</dd>
3427 <dd class=
"description">Size in kilobytes
</dd>
3429 <dd class=
"description">Job state
</dd>
3431 <dd class=
"description">Title/job name
</dd>
3433 <dd class=
"description">User the submitted the job
</dd>
3435 <h3 class=
"struct"><a id=
"cups_option_s">cups_option_s
</a></h3>
3436 <p class=
"description">Printer Options
</p>
3437 <p class=
"code">struct cups_option_s {
<br />
3438     char *name;
<br />
3439     char *value;
<br />
3441 <h4 class=
"members">Members
</h4>
3444 <dd class=
"description">Name of option
</dd>
3446 <dd class=
"description">Value of option
</dd>
3448 <h3 class=
"struct"><span class=
"info"> CUPS
1.6/macOS
10.8 </span><a id=
"cups_size_s">cups_size_s
</a></h3>
3449 <p class=
"description">Media Size
</p>
3450 <p class=
"code">struct cups_size_s {
<br />
3451     char media[
128];
<br />
3452     int width, length, bottom, left, right, top;
<br />
3454 <h4 class=
"members">Members
</h4>
3456 <dt>media[
128]
</dt>
3457 <dd class=
"description">Media name to use
</dd>
3459 <dd class=
"description">Top margin in hundredths of
3462 <h3 class=
"struct"><a id=
"pollfd">pollfd
</a></h3>
3463 <p class=
"description">User data (unused)
</p>
3464 <p class=
"code">struct pollfd *pollfds, unsigned int num_pollfds, int timeout, void *context) {
<br />
3465     _cups_dnssd_data_t *data;
<br />
3466     else if(val
0) data - got_data;
<br />
3467     void) timeout;
<br />
3468     int val;
<br />
3470 <h4 class=
"members">Members
</h4>
3473 <dd class=
"description">Enumeration data
</dd>
3477 <dd class=
"description">Return value
</dd>
3479 <h3 class=
"struct"><a id=
"pwg_map_s">pwg_map_s
</a></h3>
3480 <p class=
"description">Map element - PPD to/from PWG
</p>
3481 <p class=
"code">struct pwg_map_s {
<br />
3482     char *pwg, *ppd;
<br />
3484 <h4 class=
"members">Members
</h4>
3487 <dd class=
"description">PPD option keyword
</dd>
3489 <h3 class=
"struct"><a id=
"pwg_media_s">pwg_media_s
</a></h3>
3490 <p class=
"description">Common media size data
</p>
3491 <p class=
"code">struct pwg_media_s {
<br />
3492     int width, length;
<br />
3493     const char *pwg, *legacy, *ppd;
<br />
3495 <h4 class=
"members">Members
</h4>
3498 <dd class=
"description">Length in
2540ths
</dd>
3500 <dd class=
"description">Standard Adobe PPD name
</dd>
3502 <h3 class=
"struct"><a id=
"pwg_size_s">pwg_size_s
</a></h3>
3503 <p class=
"description">Size element - PPD to/from PWG
</p>
3504 <p class=
"code">struct pwg_size_s {
<br />
3505     <a href=
"#pwg_map_t">pwg_map_t
</a> map;
<br />
3506     int width, length, left, bottom, right, top;
<br />
3508 <h4 class=
"members">Members
</h4>
3511 <dd class=
"description">Map element
</dd>
3513 <dd class=
"description">Top margin in
2540ths
</dd>
3515 <h2 class=
"title"><a id=
"VARIABLES">Variables
</a></h2>
3516 <h3 class=
"variable"><a id=
"CF_RETURNS_RETAINED">CF_RETURNS_RETAINED
</a></h3>
3517 <p class=
"description">Get the Apple language identifier associated with a
3519 <p class=
"code">const char *locale) CF_RETURNS_RETAINED;
</p>
3520 <h2 class=
"title"><a id=
"ENUMERATIONS">Constants
</a></h2>
3521 <h3 class=
"enumeration"><a id=
"cups_ptype_e">cups_ptype_e
</a></h3>
3522 <p class=
"description">Printer type/capability bit
3524 <h4 class=
"constants">Constants
</h4>
3526 <dt>CUPS_PRINTER_AUTHENTICATED
<span class=
"info"> CUPS
1.2/macOS
10.5 </span></dt>
3527 <dd class=
"description">Printer requires authentication
3529 <dt>CUPS_PRINTER_BIND
</dt>
3530 <dd class=
"description">Can bind output
</dd>
3531 <dt>CUPS_PRINTER_BW
</dt>
3532 <dd class=
"description">Can do B
&W printing
</dd>
3533 <dt>CUPS_PRINTER_CLASS
</dt>
3534 <dd class=
"description">Printer class
</dd>
3535 <dt>CUPS_PRINTER_COLLATE
</dt>
3536 <dd class=
"description">Can collage copies
</dd>
3537 <dt>CUPS_PRINTER_COLOR
</dt>
3538 <dd class=
"description">Can do color printing
</dd>
3539 <dt>CUPS_PRINTER_COMMANDS
<span class=
"info"> CUPS
1.2/macOS
10.5 </span></dt>
3540 <dd class=
"description">Printer supports maintenance commands
3542 <dt>CUPS_PRINTER_COPIES
</dt>
3543 <dd class=
"description">Can do copies
</dd>
3544 <dt>CUPS_PRINTER_COVER
</dt>
3545 <dd class=
"description">Can cover output
</dd>
3546 <dt>CUPS_PRINTER_DEFAULT
</dt>
3547 <dd class=
"description">Default printer on network
</dd>
3548 <dt>CUPS_PRINTER_DELETE
<span class=
"info"> CUPS
1.2/macOS
10.5 </span></dt>
3549 <dd class=
"description">Delete printer
3551 <dt>CUPS_PRINTER_DUPLEX
</dt>
3552 <dd class=
"description">Can do duplexing
</dd>
3553 <dt>CUPS_PRINTER_FAX
</dt>
3554 <dd class=
"description">Fax queue
</dd>
3555 <dt>CUPS_PRINTER_LARGE
</dt>
3556 <dd class=
"description">Can do D/E/A1/A0
</dd>
3557 <dt>CUPS_PRINTER_LOCAL
</dt>
3558 <dd class=
"description">Local printer or class
</dd>
3559 <dt>CUPS_PRINTER_MEDIUM
</dt>
3560 <dd class=
"description">Can do Tabloid/B/C/A3/A2
</dd>
3561 <dt>CUPS_PRINTER_MFP
<span class=
"info"> CUPS
1.4/macOS
10.6 </span></dt>
3562 <dd class=
"description">Printer with scanning capabilities
3564 <dt>CUPS_PRINTER_NOT_SHARED
<span class=
"info"> CUPS
1.2/macOS
10.5 </span></dt>
3565 <dd class=
"description">Printer is not shared
3567 <dt>CUPS_PRINTER_PUNCH
</dt>
3568 <dd class=
"description">Can punch output
</dd>
3569 <dt>CUPS_PRINTER_REJECTING
</dt>
3570 <dd class=
"description">Printer is rejecting jobs
</dd>
3571 <dt>CUPS_PRINTER_REMOTE
</dt>
3572 <dd class=
"description">Remote printer or class
</dd>
3573 <dt>CUPS_PRINTER_SCANNER
<span class=
"info"> CUPS
1.4/macOS
10.6 </span></dt>
3574 <dd class=
"description">Scanner-only device
3576 <dt>CUPS_PRINTER_SMALL
</dt>
3577 <dd class=
"description">Can do Letter/Legal/A4
</dd>
3578 <dt>CUPS_PRINTER_SORT
</dt>
3579 <dd class=
"description">Can sort output
</dd>
3580 <dt>CUPS_PRINTER_STAPLE
</dt>
3581 <dd class=
"description">Can staple output
</dd>
3582 <dt>CUPS_PRINTER_VARIABLE
</dt>
3583 <dd class=
"description">Can do variable sizes
</dd>