]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/api-cups.html
Changelog.
[thirdparty/cups.git] / doc / help / api-cups.html
CommitLineData
abacc52b 1<!doctype html>
ef416fc2 2<html>
3<!-- SECTION: Programming -->
abacc52b
MS
4 <head>
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"><!--
5a738aea
MS
12BODY {
13 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
14}
15
16H1, H2, H3, H4, H5, H6, P, TD, TH {
17 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
18}
19
20KBD {
21 font-family: monaco, courier, monospace;
22 font-weight: bold;
23}
24
25PRE {
26 font-family: monaco, courier, monospace;
27}
28
29PRE.command {
10d09e33 30 border: dotted thin #7f7f7f;
5a738aea 31 margin-left: 36pt;
10d09e33 32 padding: 10px;
5a738aea
MS
33}
34
f11a948a
MS
35P.compact {
36 margin: 0;
37}
38
e4572d57
MS
39P.example {
40 font-style: italic;
41 margin-left: 36pt;
42}
ca6b43fc 43
240214ef
MS
44DL.man DD {
45 margin-left: 5em;
46}
47
48DL.man DT {
49 margin-left: 0;
50}
51
52PRE.man {
53 margin: 0;
54}
55
5a738aea
MS
56PRE.example {
57 background: #eeeeee;
58 border: dotted thin #999999;
59 margin-left: 36pt;
178cb736 60 padding: 10pt;
5a738aea
MS
61}
62
63PRE.command EM, PRE.example EM {
64 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
65}
66
67P.command {
68 font-family: monaco, courier, monospace;
69 margin-left: 36pt;
70}
71
72P.formula {
73 font-style: italic;
74 margin-left: 36pt;
75}
76
77BLOCKQUOTE {
178cb736 78 background: #eeeeee;
5a738aea
MS
79 border: solid thin #999999;
80 padding: 10pt;
81}
82
e4572d57
MS
83A IMG {
84 border: none;
85}
86
87A:link:hover IMG {
88 background: #f0f0f0;
89 border-radius: 10px;
90 -moz-border-radius: 10px;
91}
92
5a738aea 93A:link, A:visited {
ca6b43fc 94 font-weight: inherit;
5a738aea 95 text-decoration: none;
5a738aea
MS
96}
97
98A:link:hover, A:visited:hover, A:active {
99 text-decoration: underline;
5a738aea
MS
100}
101
102SUB, SUP {
103 font-size: 50%;
104}
105
e4572d57
MS
106TR.data, TD.data, TR.data TD {
107 margin-top: 10pt;
108 padding: 5pt;
109 border-bottom: solid 1pt #999999;
110}
111
112TR.data TH {
113 border-bottom: solid 1pt #999999;
114 padding-top: 10pt;
115 padding-left: 5pt;
116 text-align: left;
117}
118
5a738aea
MS
119DIV.table TABLE {
120 border: solid thin #999999;
121 border-collapse: collapse;
122 border-spacing: 0;
123 margin-left: auto;
124 margin-right: auto;
125}
126
127DIV.table CAPTION {
128 caption-side: top;
129 font-size: 120%;
130 font-style: italic;
131 font-weight: bold;
132 margin-left: auto;
133 margin-right: auto;
134}
135
136DIV.table TABLE TD {
137 border: solid thin #cccccc;
138 padding-top: 5pt;
139}
140
141DIV.table TABLE TH {
142 background: #cccccc;
143 border: none;
144 border-bottom: solid thin #999999;
145}
146
147DIV.figure TABLE {
148 margin-left: auto;
149 margin-right: auto;
150}
151
152DIV.figure CAPTION {
153 caption-side: bottom;
154 font-size: 120%;
155 font-style: italic;
156 font-weight: bold;
157 margin-left: auto;
158 margin-right: auto;
159}
160
161TH.label {
5a738aea
MS
162 text-align: right;
163 vertical-align: top;
164}
165
e4572d57
MS
166TH.sublabel {
167 text-align: right;
168 font-weight: normal;
169}
170
5a738aea
MS
171HR {
172 border: solid thin;
173}
174
175SPAN.info {
e4572d57
MS
176 background: black;
177 border: thin solid black;
178 color: white;
5a738aea
MS
179 font-size: 80%;
180 font-style: italic;
181 font-weight: bold;
182 white-space: nowrap;
183}
184
185H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
186 float: right;
187 font-size: 100%;
188}
189
178cb736
MS
190H1.title {
191}
192
5a738aea
MS
193H2.title, H3.title {
194 border-bottom: solid 2pt #000000;
195}
196
e4572d57
MS
197DIV.indent, TABLE.indent {
198 margin-top: 2em;
199 margin-left: auto;
200 margin-right: auto;
201 width: 90%;
202}
203
204TABLE.indent {
205 border-collapse: collapse;
206}
207
208TABLE.indent TD, TABLE.indent TH {
209 padding: 0;
210}
211
212TABLE.list {
213 border-collapse: collapse;
214 margin-left: auto;
215 margin-right: auto;
216 width: 90%;
217}
218
219TABLE.list TH {
220 background: white;
221 border-bottom: solid thin #cccccc;
222 color: #444444;
223 padding-top: 10pt;
224 padding-left: 5pt;
225 text-align: left;
226 vertical-align: bottom;
227 white-space: nowrap;
228}
229
230TABLE.list TH A {
231 color: #4444cc;
232}
233
234TABLE.list TD {
235 border-bottom: solid thin #eeeeee;
236 padding-top: 5pt;
237 padding-left: 5pt;
238}
239
240TABLE.list TR:nth-child(even) {
241 background: #f8f8f8;
242}
243
244TABLE.list TR:nth-child(odd) {
245 background: #f4f4f4;
246}
247
5a738aea
MS
248DT {
249 margin-left: 36pt;
250 margin-top: 12pt;
251}
252
253DD {
254 margin-left: 54pt;
255}
256
257DL.category DT {
258 font-weight: bold;
259}
260
261P.summary {
262 margin-left: 36pt;
263 font-family: monaco, courier, monospace;
264}
265
5a738aea
MS
266DIV.summary TABLE {
267 border: solid thin #999999;
268 border-collapse: collapse;
269 border-spacing: 0;
270 margin: 10px;
271}
272
273DIV.summary TABLE TD, DIV.summary TABLE TH {
274 border: solid thin #999999;
275 padding: 5px;
276 text-align: left;
277 vertical-align: top;
278}
279
280DIV.summary TABLE THEAD TH {
281 background: #eeeeee;
282}
283
284/* API documentation styles... */
285div.body h1 {
286 margin: 0;
287}
288div.body h2 {
289 margin-top: 1.5em;
290}
291div.body h3, div.body h4, div.body h5 {
292 margin-bottom: 0.5em;
293 margin-top: 1.5em;
294}
295.class, .enumeration, .function, .struct, .typedef, .union {
296 border-bottom: solid thin #999999;
297 margin-bottom: 0;
298 margin-top: 2em;
299}
300.description {
301 margin-top: 0.5em;
302}
303code, p.code, pre, ul.code li {
304 font-family: monaco, courier, monospace;
305 font-size: 90%;
306}
307ul.code, ul.contents, ul.subcontents {
308 list-style-type: none;
309 margin: 0;
310 padding-left: 0;
311}
312ul.code li {
313 margin: 0;
314}
315ul.contents > li {
316 margin-top: 1em;
317}
318ul.contents li ul.code, ul.contents li ul.subcontents {
319 padding-left: 2em;
320}
321div.body dl {
322 margin-left: 0;
323 margin-top: 0;
324}
325div.body dt {
326 font-style: italic;
327 margin-left: 0;
328 margin-top: 0;
329}
330div.body dd {
331 margin-bottom: 0.5em;
332}
333
334/* This is just for the HTML files generated with the framedhelp target */
335div.contents {
336 background: #e8e8e8;
337 border: solid thin black;
338 padding: 10px;
339}
340div.contents h1 {
341 font-size: 110%;
342}
343div.contents h2 {
344 font-size: 100%;
345}
346div.contents ul.contents {
347 font-size: 80%;
348}
ac884b6a
MS
349div.contents ul.subcontents li {
350 margin-left: 1em;
351 text-indent: -1em;
352}
5a738aea 353--></style>
abacc52b
MS
354 </head>
355 <body>
5a738aea 356<!--
321d8d57 357 CUPS API header for CUPS.
5a738aea 358
321d8d57 359 Copyright 2008-2011 by Apple Inc.
5a738aea
MS
360
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/".
366-->
367
178cb736
MS
368<h1 class='title'>CUPS API</h1>
369
5a738aea
MS
370<div class='summary'><table summary='General Information'>
371<thead>
372<tr>
373 <th>Header</th>
374 <th>cups/cups.h</th>
375</tr>
376</thead>
377<tbody>
378<tr>
379 <th>Library</th>
380 <td>-lcups</td>
381</tr>
382<tr>
383 <th>See Also</th>
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>
391</tr>
392</tbody>
393</table></div>
abacc52b
MS
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>
404 </ul></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>
498 </ul></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>
515 </ul></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>
525 </ul></li>
526 <li><a href="#VARIABLES">Variables</a><ul class="subcontents">
527 <li><a href="#CF_RETURNS_RETAINED">CF_RETURNS_RETAINED</a></li>
528 </ul></li>
529 <li><a href="#ENUMERATIONS">Enumerations</a><ul class="subcontents">
530 <li><a href="#cups_ptype_e">cups_ptype_e</a></li>
531 </ul></li>
532 </ul>
533 </div>
534 <div class="body">
ef416fc2 535<!--
eac3a0a0 536 API introduction for CUPS.
ef416fc2 537
7374e9e5 538 Copyright 2007-2013 by Apple Inc.
bc44d920 539 Copyright 1997-2006 by Easy Software Products, all rights reserved.
ef416fc2 540
541 These coded instructions, statements, and computer programs are the
bc44d920 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/".
ef416fc2 546-->
547
5a738aea
MS
548<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
549
550<p>The CUPS API provides the convenience functions needed to support
551applications, filters, printer drivers, and backends that need to interface
552with the CUPS scheduler.</p>
ef416fc2 553
568fa3fa
MS
554<h3><a name='CLIENTS_AND_SERVERS'>Clients and Servers</a></h3>
555
556<p>CUPS is based on the Internet Printing Protocol ("IPP"), which allows
557clients (applications) to communicate with a server (the scheduler) to get a
558list of printers, send print jobs, and so forth. You identify which server
559you 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
562to the scheduler. The <a href='api-httpipp.html' target='_top'>HTTP and IPP
563APIs</a> document provides more information on server connections.</p>
564
5a738aea 565<h3><a name='PRINTERS_AND_CLASSES'>Printers and Classes</a></h3>
ecdc0628 566
5a738aea
MS
567<p>Printers and classes (collections of printers) are accessed through
568the <a href="#cups_dest_t"><code>cups_dest_t</code></a> structure which
569includes the name (<code>name</code>), instance (<code>instance</code> -
568fa3fa
MS
570a way of selecting certain saved options/settings), and the options and
571attributes associated with that destination (<code>num_options</code> and
5a738aea
MS
572<code>options</code>). Destinations are created using the
573<a href="#cupsGetDests"><code>cupsGetDests</code></a> function and freed
574using the <a href='#cupsFreeDests'><code>cupsFreeDests</code></a> function.
575The <a href='#cupsGetDest'><code>cupsGetDest</code></a> function finds a
576specific destination for printing:</p>
ef416fc2 577
5a738aea
MS
578<pre class='example'>
579#include &lt;cups/cups.h&gt;
ef416fc2 580
5a738aea
MS
581<a href='#cups_dest_t'>cups_dest_t</a> *dests;
582int num_dests = <a href='#cupsGetDests'>cupsGetDests</a>(&amp;dests);
583<a href='#cups_dest_t'>cups_dest_t</a> *dest = <a href='#cupsGetDest'>cupsGetDest</a>("name", NULL, num_dests, dests);
ef416fc2 584
eac3a0a0 585/* do something with dest */
ef416fc2 586
5a738aea 587<a href='#cupsFreeDests'>cupsFreeDests</a>(num_dests, dests);
ef416fc2 588</pre>
589
5a738aea
MS
590<p>Passing <code>NULL</code> to
591<a href='#cupsGetDest'><code>cupsGetDest</code></a> for the destination name
592will return the default destination. Similarly, passing a <code>NULL</code>
593instance will return the default instance for that destination.</p>
ef416fc2 594
5a738aea
MS
595<div class='table'><table summary='Table 1: Printer Attributes' width='80%'>
596<caption>Table 1: <a name='TABLE1'>Printer Attributes</a></caption>
597<thead>
598<tr>
599 <th>Attribute Name</th>
600 <th>Description</th>
601</tr>
602</thead>
ef416fc2 603<tbody>
5a738aea
MS
604<tr>
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>
609</tr>
610<tr>
611 <td>"printer-info"</td>
612 <td>The human-readable description of the destination such as "My
613 Laser Printer".</td>
614</tr>
615<tr>
616 <td>"printer-is-accepting-jobs"</td>
aaf19ab0
MS
617 <td>"true" if the destination is accepting new jobs, "false" if
618 not.</td>
5a738aea
MS
619</tr>
620<tr>
621 <td>"printer-is-shared"</td>
aaf19ab0
MS
622 <td>"true" if the destination is being shared with other computers,
623 "false" if not.</td>
5a738aea
MS
624</tr>
625<tr>
626 <td>"printer-location"</td>
627 <td>The human-readable location of the destination such as "Lab 4".</td>
628</tr>
629<tr>
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>
633</tr>
634<tr>
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>
638</tr>
639<tr>
640 <td>"printer-state-change-time"</td>
641 <td>The UNIX time when the destination entered the current state.</td>
642</tr>
643<tr>
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>
647</tr>
648<tr>
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>
652</tr>
653</tbody>
654</table></div>
655
656<h3><a name='OPTIONS'>Options</a></h3>
657
658<p>Options are stored in arrays of
659<a href='#cups_option_t'><code>cups_option_t</code></a> structures. Each
660option has a name (<code>name</code>) and value (<code>value</code>)
661associated 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
663default options for a particular destination, along with several informational
664attributes about the destination as shown in <a href='#TABLE1'>Table 1</a>.
665The <a href='#cupsGetOption'><code>cupsGetOption</code></a> function gets
666the value for the named option. For example, the following code lists the
667available destinations and their human-readable descriptions:</p>
668
669<pre class='example'>
670#include &lt;cups/cups.h&gt;
671
672<a href='#cups_dest_t'>cups_dest_t</a> *dests;
673int num_dests = <a href='#cupsGetDests'>cupsGetDests</a>(&amp;dests);
674<a href='#cups_dest_t'>cups_dest_t</a> *dest;
675int i;
676const char *value;
677
678for (i = num_dests, dest = dests; i > 0; i --, dest ++)
679 if (dest->instance == NULL)
680 {
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");
683 }
684
685<a href='#cupsFreeDests'>cupsFreeDests</a>(num_dests, dests);
686</pre>
687
688<p>You can create your own option arrays using the
689<a href='#cupsAddOption'><code>cupsAddOption</code></a> function, which
690adds a single named option to an array:</p>
691
692<pre class='example'>
693#include &lt;cups/cups.h&gt;
694
695int num_options = 0;
696<a href='#cups_option_t'>cups_option_t</a> *options = NULL;
697
698/* The returned num_options value is updated as needed */
699num_options = <a href='#cupsAddOption'>cupsAddOption</a>("first", "value", num_options, &amp;options);
700
701/* This adds a second option value */
702num_options = <a href='#cupsAddOption'>cupsAddOption</a>("second", "value", num_options, &amp;options);
703
704/* This replaces the first option we added */
705num_options = <a href='#cupsAddOption'>cupsAddOption</a>("first", "new value", num_options, &amp;options);
706</pre>
707
708<p>Use a <code>for</code> loop to copy the options from a destination:</p>
709
710<pre class='example'>
711#include &lt;cups/cups.h&gt;
712
713int i;
714int num_options = 0;
715<a href='#cups_option_t'>cups_option_t</a> *options = NULL;
716<a href='#cups_dest_t'>cups_dest_t</a> *dest;
717
7374e9e5 718for (i = 0; i &lt; dest->num_options; i ++)
568fa3fa
MS
719 num_options = <a href='#cupsAddOption'>cupsAddOption</a>(dest->options[i].name, dest->options[i].value,
720 num_options, &amp;options);
5a738aea
MS
721</pre>
722
723<p>Use the <a href='#cupsFreeOptions'><code>cupsFreeOptions</code></a>
724function to free the options array when you are done using it:</p>
725
726<pre class='example'>
727<a href='#cupsFreeOptions'>cupsFreeOptions</a>(num_options, options);
728</pre>
729
730<h3><a name='PRINT_JOBS'>Print Jobs</a></h3>
731
732<p>Print jobs are identified by a locally-unique job ID number from 1 to
7332<sup>31</sup>-1 and have options and one or more files for printing to a
734single destination. The <a href='#cupsPrintFile'><code>cupsPrintFile</code></a>
735function creates a new job with one file. The following code prints the CUPS
736test page file:</p>
737
738<pre class='example'>
739#include &lt;cups/cups.h&gt;
740
741<a href='#cups_dest_t'>cups_dest_t</a> *dest;
742int num_options;
743<a href='#cups_option_t'>cups_option_t</a> *options;
744int job_id;
745
746/* Print a single file */
568fa3fa
MS
747job_id = <a href='#cupsPrintFile'>cupsPrintFile</a>(dest->name, "/usr/share/cups/data/testprint.ps",
748 "Test Print", num_options, options);
5a738aea
MS
749</pre>
750
751<p>The <a href='#cupsPrintFiles'><code>cupsPrintFiles</code></a> function
752creates a job with multiple files. The files are provided in a
753<code>char *</code> array:</p>
754
755<pre class='example'>
756#include &lt;cups/cups.h&gt;
757
758<a href='#cups_dest_t'>cups_dest_t</a> *dest;
759int num_options;
760<a href='#cups_option_t'>cups_option_t</a> *options;
761int job_id;
762char *files[3] = { "file1.pdf", "file2.pdf", "file3.pdf" };
763
764/* Print three files */
765job_id = <a href='#cupsPrintFiles'>cupsPrintFiles</a>(dest->name, 3, files, "Test Print", num_options, options);
766</pre>
767
768<p>Finally, the <a href='#cupsCreateJob'><code>cupsCreateJob</code></a>
769function creates a new job with no files in it. Files are added using the
7374e9e5 770<a href='#cupsStartDocument'><code>cupsStartDocument</code></a>,
5a738aea
MS
771<a href='api-httpipp.html#cupsWriteRequestData'><code>cupsWriteRequestData</code></a>,
772and <a href='#cupsFinishDocument'><code>cupsFinishDocument</code></a> functions.
773The following example creates a job with 10 text files for printing:</p>
774
775<pre class='example'>
776#include &lt;cups/cups.h&gt;
777
778<a href='#cups_dest_t'>cups_dest_t</a> *dest;
779int num_options;
780<a href='#cups_option_t'>cups_option_t</a> *options;
781int job_id;
782int i;
783char buffer[1024];
784
785/* Create the job */
568fa3fa
MS
786job_id = <a href='#cupsCreateJob'>cupsCreateJob</a>(CUPS_HTTP_DEFAULT, dest->name, "10 Text Files",
787 num_options, options);
5a738aea
MS
788
789/* If the job is created, add 10 files */
790if (job_id > 0)
791{
792 for (i = 1; i &lt;= 10; i ++)
793 {
794 snprintf(buffer, sizeof(buffer), "file%d.txt", i);
795
568fa3fa
MS
796 <a href='#cupsStartDocument'>cupsStartDocument</a>(CUPS_HTTP_DEFAULT, dest->name, job_id, buffer,
797 CUPS_FORMAT_TEXT, i == 10);
5a738aea
MS
798
799 snprintf(buffer, sizeof(buffer),
800 "File %d\n"
801 "\n"
802 "One fish,\n"
803 "Two fish,\n
804 "Red fish,\n
805 "Blue fish\n", i);
806
807 /* cupsWriteRequestData can be called as many times as needed */
808 <a href='#cupsWriteRequestData'>cupsWriteRequestData</a>(CUPS_HTTP_DEFAULT, buffer, strlen(buffer));
809
810 <a href='#cupsFinishDocument'>cupsFinishDocument</a>(CUPS_HTTP_DEFAULT, dest->name);
811 }
812}
813</pre>
814
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
817an array of <a href='#cups_job_t'><code>cups_job_t</code></a> structures.
818Each contains the job ID (<code>id</code>), destination name
819(<code>dest</code>), title (<code>title</code>), and other information
820associated with the job. The job array is freed using the
821<a href='#cupsFreeJobs'><code>cupsFreeJobs</code></a> function. The following
822example monitors a specific job ID, showing the current job state once every
8235 seconds until the job is completed:</p>
824
825<pre class='example'>
826#include &lt;cups/cups.h&gt;
827
828<a href='#cups_dest_t'>cups_dest_t</a> *dest;
829int job_id;
830int num_jobs;
831<a href='#cups_job_t'>cups_job_t</a> *jobs;
832int i;
833ipp_jstate_t job_state = IPP_JOB_PENDING;
7374e9e5 834
5a738aea
MS
835while (job_state &lt; IPP_JOB_STOPPED)
836{
837 /* Get my jobs (1) with any state (-1) */
838 num_jobs = <a href='#cupsGetJobs'>cupsGetJobs</a>(&amp;jobs, dest->name, 1, -1);
839
840 /* Loop to find my job */
841 job_state = IPP_JOB_COMPLETED;
842
843 for (i = 0; i &lt; num_jobs; i ++)
844 if (jobs[i].id == job_id)
845 {
846 job_state = jobs[i].state;
847 break;
848 }
849
850 /* Free the job array */
851 <a href='#cupsFreeJobs'>cupsFreeJobs</a>(num_jobs, jobs);
852
853 /* Show the current state */
854 switch (job_state)
855 {
856 case IPP_JOB_PENDING :
857 printf("Job %d is pending.\n", job_id);
858 break;
859 case IPP_JOB_HELD :
860 printf("Job %d is held.\n", job_id);
861 break;
862 case IPP_JOB_PROCESSING :
863 printf("Job %d is processing.\n", job_id);
864 break;
865 case IPP_JOB_STOPPED :
866 printf("Job %d is stopped.\n", job_id);
867 break;
868 case IPP_JOB_CANCELED :
869 printf("Job %d is canceled.\n", job_id);
870 break;
871 case IPP_JOB_ABORTED :
872 printf("Job %d is aborted.\n", job_id);
873 break;
874 case IPP_JOB_COMPLETED :
875 printf("Job %d is completed.\n", job_id);
876 break;
877 }
878
879 /* Sleep if the job is not finished */
880 if (job_state &lt; IPP_JOB_STOPPED)
881 sleep(5);
882}
883</pre>
884
885<p>To cancel a job, use the
886<a href='#cupsCancelJob'><code>cupsCancelJob</code></a> function with the
887job ID:</p>
888
568fa3fa 889<pre class='example'>
5a738aea
MS
890#include &lt;cups/cups.h&gt;
891
892<a href='#cups_dest_t'>cups_dest_t</a> *dest;
893int job_id;
894
895<a href='#cupsCancelJob'>cupsCancelJob</a>(dest->name, job_id);
896</pre>
897
898<h3><a name='ERROR_HANDLING'>Error Handling</a></h3>
899
900<p>If any of the CUPS API printing functions returns an error, the reason for
901that 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
905error code
906(<a href='api-httpipp.html#ipp_status_t'><code>ipp_status_t</code></a>)
907that was encountered, while
908<a href='#cupsLastErrorString'><code>cupsLastErrorString</code></a> returns
909a (localized) human-readable string that can be shown to the user. For example,
910if 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
912the reason why the job could not be created:</p>
913
914<pre class='example'>
915#include &lt;cups/cups.h&gt;
916
917int job_id;
918
919if (job_id == 0)
920 puts(cupsLastErrorString());
921</pre>
922
923<h3><a name='PASSWORDS_AND_AUTHENTICATION'>Passwords and Authentication</a></h3>
924
925<p>CUPS supports authentication of any request, including submission of print
926jobs. The default mechanism for getting the username and password is to use the
927login user and a password from the console.</p>
928
929<p>To support other types of applications, in particular Graphical User
930Interfaces ("GUIs"), the CUPS API provides functions to set the default
931username and to register a callback function that returns a password string.</p>
932
933<p>The <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a>
934function is used to set a password callback in your program. Only one
935function can be used at any time.</p>
936
937<p>The <a href="#cupsSetUser"><code>cupsSetUser</code></a> function sets the
938current username for authentication. This function can be called by your
939password callback function to change the current username as needed.</p>
940
941<p>The following example shows a simple password callback that gets a
942username and password from the user:</p>
943
944<pre class='example'>
945#include &lt;cups/cups.h&gt;
946
947const char *
948my_password_cb(const char *prompt)
949{
950 char user[65];
951
952
953 puts(prompt);
954
955 /* Get a username from the user */
956 printf("Username: ");
957 if (fgets(user, sizeof(user), stdin) == NULL)
958 return (NULL);
959
960 /* Strip the newline from the string and set the user */
961 user[strlen(user) - 1] = '\0';
962
963 <a href='#cupsSetUser'>cupsSetUser</a>(user);
964
965 /* Use getpass() to ask for the password... */
966 return (getpass("Password: "));
967}
968
969<a href='#cupsSetPasswordCB'>cupsSetPasswordCB</a>(my_password_cb);
970</pre>
971
972<p>Similarly, a GUI could display the prompt string in a window with input
973fields for the username and password. The username should default to the
974string returned by the <a href="#cupsUser"><code>cupsUser</code></a>
975function.</p>
abacc52b
MS
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>
5a738aea 979<p class="code">
abacc52b
MS
980int cupsAddDest (<br />
981&#160;&#160;&#160;&#160;const char *name,<br />
982&#160;&#160;&#160;&#160;const char *instance,<br />
983&#160;&#160;&#160;&#160;int num_dests,<br />
984&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> **dests<br />
5a738aea
MS
985);</p>
986<h4 class="parameters">Parameters</h4>
987<dl>
988<dt>name</dt>
abacc52b 989 <dd class="description">Destination name</dd>
5a738aea 990<dt>instance</dt>
abacc52b 991 <dd class="description">Instance name or <code>NULL</code> for none/primary</dd>
5a738aea 992<dt>num_dests</dt>
abacc52b 993 <dd class="description">Number of destinations</dd>
5a738aea 994<dt>dests</dt>
abacc52b 995 <dd class="description">Destinations</dd>
5a738aea
MS
996</dl>
997<h4 class="returnvalue">Return Value</h4>
abacc52b 998 <p class="description">New number of destinations</p>
5a738aea 999<h4 class="discussion">Discussion</h4>
abacc52b 1000 <p class="discussion">This function cannot be used to add a new class or printer queue,
2abf387c 1001it only adds a new container of saved options for the named
5a738aea
MS
1002destination or instance.<br>
1003<br>
1004If the named destination already exists, the destination list is
2abf387c 1005returned unchanged. Adding a new instance of a destination creates
5a738aea
MS
1006a copy of that destination's options.<br>
1007<br>
1008Use the <a href="#cupsSaveDests"><code>cupsSaveDests</code></a> function to save the updated list of
1009destinations to the user's lpoptions file.</p>
abacc52b
MS
1010<h3 class="function"><a id="cupsAddOption">cupsAddOption</a></h3>
1011 <p class="description">Add an option to an option array.</p>
5a738aea 1012<p class="code">
abacc52b
MS
1013int cupsAddOption (<br />
1014&#160;&#160;&#160;&#160;const char *name,<br />
1015&#160;&#160;&#160;&#160;const char *value,<br />
1016&#160;&#160;&#160;&#160;int num_options,<br />
1017&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **options<br />
5a738aea
MS
1018);</p>
1019<h4 class="parameters">Parameters</h4>
1020<dl>
1021<dt>name</dt>
abacc52b 1022 <dd class="description">Name of option</dd>
5a738aea 1023<dt>value</dt>
abacc52b 1024 <dd class="description">Value of option</dd>
5a738aea 1025<dt>num_options</dt>
abacc52b 1026 <dd class="description">Number of options</dd>
5a738aea 1027<dt>options</dt>
abacc52b 1028 <dd class="description">Pointer to options</dd>
5a738aea
MS
1029</dl>
1030<h4 class="returnvalue">Return Value</h4>
abacc52b 1031 <p class="description">Number of options</p>
5a738aea 1032<h4 class="discussion">Discussion</h4>
abacc52b 1033 <p class="discussion">New option arrays can be initialized simply by passing 0 for the
5a738aea 1034&quot;num_options&quot; parameter.</p>
abacc52b
MS
1035<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="cupsAdminCreateWindowsPPD">cupsAdminCreateWindowsPPD</a></h3>
1036 <p class="description">Create the Windows PPD file for a printer.</p>
426c6a59 1037<p class="code">
abacc52b
MS
1038char *cupsAdminCreateWindowsPPD (<br />
1039&#160;&#160;&#160;&#160;http_t *http,<br />
1040&#160;&#160;&#160;&#160;const char *dest,<br />
1041&#160;&#160;&#160;&#160;char *buffer,<br />
1042&#160;&#160;&#160;&#160;int bufsize<br />
426c6a59
MS
1043);</p>
1044<h4 class="parameters">Parameters</h4>
1045<dl>
1046<dt>http</dt>
abacc52b 1047 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
426c6a59 1048<dt>dest</dt>
abacc52b 1049 <dd class="description">Printer or class</dd>
426c6a59 1050<dt>buffer</dt>
abacc52b 1051 <dd class="description">Filename buffer</dd>
426c6a59 1052<dt>bufsize</dt>
abacc52b 1053 <dd class="description">Size of filename buffer</dd>
426c6a59
MS
1054</dl>
1055<h4 class="returnvalue">Return Value</h4>
abacc52b
MS
1056 <p class="description">PPD file or NULL</p>
1057<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="cupsAdminExportSamba">cupsAdminExportSamba</a></h3>
1058 <p class="description">Export a printer to Samba.</p>
426c6a59 1059<p class="code">
abacc52b
MS
1060int cupsAdminExportSamba (<br />
1061&#160;&#160;&#160;&#160;const char *dest,<br />
1062&#160;&#160;&#160;&#160;const char *ppd,<br />
1063&#160;&#160;&#160;&#160;const char *samba_server,<br />
1064&#160;&#160;&#160;&#160;const char *samba_user,<br />
1065&#160;&#160;&#160;&#160;const char *samba_password,<br />
1066&#160;&#160;&#160;&#160;FILE *logfile<br />
426c6a59
MS
1067);</p>
1068<h4 class="parameters">Parameters</h4>
1069<dl>
1070<dt>dest</dt>
abacc52b 1071 <dd class="description">Destination to export</dd>
426c6a59 1072<dt>ppd</dt>
abacc52b 1073 <dd class="description">PPD file</dd>
426c6a59 1074<dt>samba_server</dt>
abacc52b 1075 <dd class="description">Samba server</dd>
426c6a59 1076<dt>samba_user</dt>
abacc52b 1077 <dd class="description">Samba username</dd>
426c6a59 1078<dt>samba_password</dt>
abacc52b 1079 <dd class="description">Samba password</dd>
426c6a59 1080<dt>logfile</dt>
abacc52b 1081 <dd class="description">Log file, if any</dd>
426c6a59
MS
1082</dl>
1083<h4 class="returnvalue">Return Value</h4>
abacc52b
MS
1084 <p class="description">1 on success, 0 on failure</p>
1085<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsAdminGetServerSettings">cupsAdminGetServerSettings</a></h3>
1086 <p class="description">Get settings from the server.</p>
426c6a59 1087<p class="code">
abacc52b
MS
1088int cupsAdminGetServerSettings (<br />
1089&#160;&#160;&#160;&#160;http_t *http,<br />
1090&#160;&#160;&#160;&#160;int *num_settings,<br />
1091&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **settings<br />
426c6a59
MS
1092);</p>
1093<h4 class="parameters">Parameters</h4>
1094<dl>
1095<dt>http</dt>
abacc52b 1096 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
426c6a59 1097<dt>num_settings</dt>
abacc52b 1098 <dd class="description">Number of settings</dd>
426c6a59 1099<dt>settings</dt>
abacc52b 1100 <dd class="description">Settings</dd>
426c6a59
MS
1101</dl>
1102<h4 class="returnvalue">Return Value</h4>
abacc52b 1103 <p class="description">1 on success, 0 on failure</p>
426c6a59 1104<h4 class="discussion">Discussion</h4>
abacc52b 1105 <p class="discussion">The returned settings should be freed with cupsFreeOptions() when
426c6a59
MS
1106you are done with them.
1107
1108</p>
abacc52b
MS
1109<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsAdminSetServerSettings">cupsAdminSetServerSettings</a></h3>
1110 <p class="description">Set settings on the server.</p>
426c6a59 1111<p class="code">
abacc52b
MS
1112int cupsAdminSetServerSettings (<br />
1113&#160;&#160;&#160;&#160;http_t *http,<br />
1114&#160;&#160;&#160;&#160;int num_settings,<br />
1115&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *settings<br />
426c6a59
MS
1116);</p>
1117<h4 class="parameters">Parameters</h4>
1118<dl>
1119<dt>http</dt>
abacc52b 1120 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
426c6a59 1121<dt>num_settings</dt>
abacc52b 1122 <dd class="description">Number of settings</dd>
426c6a59 1123<dt>settings</dt>
abacc52b 1124 <dd class="description">Settings</dd>
426c6a59
MS
1125</dl>
1126<h4 class="returnvalue">Return Value</h4>
abacc52b
MS
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>
5a9febac 1130<p class="code">
abacc52b
MS
1131ipp_status_t cupsCancelDestJob (<br />
1132&#160;&#160;&#160;&#160;http_t *http,<br />
1133&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
1134&#160;&#160;&#160;&#160;int job_id<br />
5a9febac
MS
1135);</p>
1136<h4 class="parameters">Parameters</h4>
1137<dl>
1138<dt>http</dt>
abacc52b 1139 <dd class="description">Connection to destination</dd>
5a9febac 1140<dt>dest</dt>
abacc52b 1141 <dd class="description">Destination</dd>
5a9febac 1142<dt>job_id</dt>
abacc52b 1143 <dd class="description">Job ID</dd>
5a9febac
MS
1144</dl>
1145<h4 class="returnvalue">Return Value</h4>
abacc52b
MS
1146 <p class="description">Cancel a job on a destination.</p>
1147 <p class="discussion">The &quot;job_id&quot; is the number returned by cupsCreateDestJob.<br>
5a9febac 1148<br>
503b54c9
MS
1149Returns <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.
5a9febac
MS
1152
1153</p>
abacc52b
MS
1154<h3 class="function"><a id="cupsCancelJob">cupsCancelJob</a></h3>
1155 <p class="description">Cancel a print job on the default server.</p>
5a738aea 1156<p class="code">
abacc52b
MS
1157int cupsCancelJob (<br />
1158&#160;&#160;&#160;&#160;const char *name,<br />
1159&#160;&#160;&#160;&#160;int job_id<br />
5a738aea
MS
1160);</p>
1161<h4 class="parameters">Parameters</h4>
1162<dl>
1163<dt>name</dt>
abacc52b 1164 <dd class="description">Name of printer or class</dd>
5a738aea 1165<dt>job_id</dt>
abacc52b 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>
5a738aea
MS
1167</dl>
1168<h4 class="returnvalue">Return Value</h4>
abacc52b 1169 <p class="description">1 on success, 0 on failure</p>
5a738aea 1170<h4 class="discussion">Discussion</h4>
abacc52b 1171 <p class="discussion">Pass <code>CUPS_JOBID_ALL</code> to cancel all jobs or <code>CUPS_JOBID_CURRENT</code>
5a738aea
MS
1172to cancel the current job on the named destination.<br>
1173<br>
1174Use the <a href="#cupsLastError"><code>cupsLastError</code></a> and <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> functions to get
1175the cause of any failure.</p>
abacc52b
MS
1176<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsCancelJob2">cupsCancelJob2</a></h3>
1177 <p class="description">Cancel or purge a print job.</p>
5a738aea 1178<p class="code">
abacc52b
MS
1179ipp_status_t cupsCancelJob2 (<br />
1180&#160;&#160;&#160;&#160;http_t *http,<br />
1181&#160;&#160;&#160;&#160;const char *name,<br />
1182&#160;&#160;&#160;&#160;int job_id,<br />
1183&#160;&#160;&#160;&#160;int purge<br />
5a738aea
MS
1184);</p>
1185<h4 class="parameters">Parameters</h4>
1186<dl>
1187<dt>http</dt>
abacc52b 1188 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea 1189<dt>name</dt>
abacc52b 1190 <dd class="description">Name of printer or class</dd>
5a738aea 1191<dt>job_id</dt>
abacc52b 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>
5a738aea 1193<dt>purge</dt>
abacc52b 1194 <dd class="description">1 to purge, 0 to cancel</dd>
5a738aea
MS
1195</dl>
1196<h4 class="returnvalue">Return Value</h4>
abacc52b 1197 <p class="description">IPP status</p>
5a738aea 1198<h4 class="discussion">Discussion</h4>
abacc52b 1199 <p class="discussion">Canceled jobs remain in the job history while purged jobs are removed
5a738aea
MS
1200from the job history.<br>
1201<br>
1202Pass <code>CUPS_JOBID_ALL</code> to cancel all jobs or <code>CUPS_JOBID_CURRENT</code>
1203to cancel the current job on the named destination.<br>
1204<br>
1205Use the <a href="#cupsLastError"><code>cupsLastError</code></a> and <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> functions to get
bc44d920 1206the cause of any failure.
5a738aea 1207
5a9febac 1208</p>
abacc52b
MS
1209<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCheckDestSupported">cupsCheckDestSupported</a></h3>
1210 <p class="description">Check that the option and value are supported
5a9febac
MS
1211by the destination.</p>
1212<p class="code">
abacc52b
MS
1213int cupsCheckDestSupported (<br />
1214&#160;&#160;&#160;&#160;http_t *http,<br />
1215&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
1216&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br />
1217&#160;&#160;&#160;&#160;const char *option,<br />
1218&#160;&#160;&#160;&#160;const char *value<br />
5a9febac
MS
1219);</p>
1220<h4 class="parameters">Parameters</h4>
1221<dl>
1222<dt>http</dt>
abacc52b 1223 <dd class="description">Connection to destination</dd>
5a9febac 1224<dt>dest</dt>
abacc52b 1225 <dd class="description">Destination</dd>
5a9febac 1226<dt>dinfo</dt>
abacc52b 1227 <dd class="description">Destination information</dd>
5a9febac 1228<dt>option</dt>
abacc52b 1229 <dd class="description">Option</dd>
5a9febac 1230<dt>value</dt>
abacc52b 1231 <dd class="description">Value</dd>
5a9febac
MS
1232</dl>
1233<h4 class="returnvalue">Return Value</h4>
abacc52b 1234 <p class="description">1 if supported, 0 otherwise</p>
5a9febac 1235<h4 class="discussion">Discussion</h4>
abacc52b 1236 <p class="discussion">Returns 1 if supported, 0 otherwise.
5a9febac
MS
1237
1238</p>
abacc52b
MS
1239<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCloseDestJob">cupsCloseDestJob</a></h3>
1240 <p class="description">Close a job and start printing.</p>
5a9febac 1241<p class="code">
abacc52b
MS
1242ipp_status_t cupsCloseDestJob (<br />
1243&#160;&#160;&#160;&#160;http_t *http,<br />
1244&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
1245&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *info,<br />
1246&#160;&#160;&#160;&#160;int job_id<br />
5a9febac
MS
1247);</p>
1248<h4 class="parameters">Parameters</h4>
1249<dl>
1250<dt>http</dt>
abacc52b 1251 <dd class="description">Connection to destination</dd>
5a9febac 1252<dt>dest</dt>
abacc52b 1253 <dd class="description">Destination</dd>
5a9febac 1254<dt>info</dt>
abacc52b 1255 <dd class="description">Destination information</dd>
5a9febac 1256<dt>job_id</dt>
abacc52b 1257 <dd class="description">Job ID</dd>
5a9febac
MS
1258</dl>
1259<h4 class="returnvalue">Return Value</h4>
abacc52b 1260 <p class="description">IPP status code</p>
5a9febac 1261<h4 class="discussion">Discussion</h4>
abacc52b 1262 <p class="discussion">Use when the last call to cupsStartDocument passed 0 for &quot;last_document&quot;.
6961465f 1263&quot;job_id&quot; is the job ID returned by cupsCreateDestJob. Returns <code>IPP_STATUS_OK</code>
5a9febac
MS
1264on success.
1265
3e7fe0ca 1266</p>
abacc52b
MS
1267<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsConnectDest">cupsConnectDest</a></h3>
1268 <p class="description">Connect to the server for a destination.</p>
3e7fe0ca 1269<p class="code">
abacc52b
MS
1270http_t *cupsConnectDest (<br />
1271&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
1272&#160;&#160;&#160;&#160;unsigned flags,<br />
1273&#160;&#160;&#160;&#160;int msec,<br />
1274&#160;&#160;&#160;&#160;int *cancel,<br />
1275&#160;&#160;&#160;&#160;char *resource,<br />
1276&#160;&#160;&#160;&#160;size_t resourcesize,<br />
1277&#160;&#160;&#160;&#160;<a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb,<br />
1278&#160;&#160;&#160;&#160;void *user_data<br />
3e7fe0ca
MS
1279);</p>
1280<h4 class="parameters">Parameters</h4>
1281<dl>
1282<dt>dest</dt>
abacc52b 1283 <dd class="description">Destination</dd>
3e7fe0ca 1284<dt>flags</dt>
abacc52b 1285 <dd class="description">Connection flags</dd>
3e7fe0ca 1286<dt>msec</dt>
abacc52b 1287 <dd class="description">Timeout in milliseconds</dd>
3e7fe0ca 1288<dt>cancel</dt>
abacc52b 1289 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
3e7fe0ca 1290<dt>resource</dt>
abacc52b 1291 <dd class="description">Resource buffer</dd>
3e7fe0ca 1292<dt>resourcesize</dt>
abacc52b 1293 <dd class="description">Size of resource buffer</dd>
3e7fe0ca 1294<dt>cb</dt>
abacc52b 1295 <dd class="description">Callback function</dd>
3e7fe0ca 1296<dt>user_data</dt>
abacc52b 1297 <dd class="description">User data pointer</dd>
3e7fe0ca
MS
1298</dl>
1299<h4 class="returnvalue">Return Value</h4>
abacc52b 1300 <p class="description">Connection to server or <code>NULL</code></p>
3e7fe0ca 1301<h4 class="discussion">Discussion</h4>
abacc52b 1302 <p class="discussion">Connect to the destination, returning a new http_t connection object and
3e7fe0ca
MS
1303optionally the resource path to use for the destination. These calls will
1304block until a connection is made, the timeout expires, the integer pointed
1305to by &quot;cancel&quot; is non-zero, or the callback function (or block) returns 0,
1306The caller is responsible for calling httpClose() on the returned object.
1307
1308</p>
abacc52b
MS
1309<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsConnectDestBlock">cupsConnectDestBlock</a></h3>
1310 <p class="description">Connect to the server for a destination.</p>
3e7fe0ca 1311<p class="code">
abacc52b
MS
1312http_t *cupsConnectDestBlock (<br />
1313&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
1314&#160;&#160;&#160;&#160;unsigned flags,<br />
1315&#160;&#160;&#160;&#160;int msec,<br />
1316&#160;&#160;&#160;&#160;int *cancel,<br />
1317&#160;&#160;&#160;&#160;char *resource,<br />
1318&#160;&#160;&#160;&#160;size_t resourcesize,<br />
1319&#160;&#160;&#160;&#160;<a href="#cups_dest_block_t">cups_dest_block_t</a> block<br />
3e7fe0ca
MS
1320);</p>
1321<h4 class="parameters">Parameters</h4>
1322<dl>
1323<dt>dest</dt>
abacc52b 1324 <dd class="description">Destination</dd>
3e7fe0ca 1325<dt>flags</dt>
abacc52b 1326 <dd class="description">Connection flags</dd>
3e7fe0ca 1327<dt>msec</dt>
abacc52b 1328 <dd class="description">Timeout in milliseconds</dd>
3e7fe0ca 1329<dt>cancel</dt>
abacc52b 1330 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
3e7fe0ca 1331<dt>resource</dt>
abacc52b 1332 <dd class="description">Resource buffer</dd>
3e7fe0ca 1333<dt>resourcesize</dt>
abacc52b 1334 <dd class="description">Size of resource buffer</dd>
3e7fe0ca 1335<dt>block</dt>
abacc52b 1336 <dd class="description">Callback block</dd>
3e7fe0ca
MS
1337</dl>
1338<h4 class="returnvalue">Return Value</h4>
abacc52b 1339 <p class="description">Connection to server or <code>NULL</code></p>
3e7fe0ca 1340<h4 class="discussion">Discussion</h4>
abacc52b 1341 <p class="discussion">Connect to the destination, returning a new http_t connection object and
3e7fe0ca
MS
1342optionally the resource path to use for the destination. These calls will
1343block until a connection is made, the timeout expires, the integer pointed
1344to by &quot;cancel&quot; is non-zero, or the callback function (or block) returns 0,
1345The caller is responsible for calling httpClose() on the returned object.
1346
1347</p>
abacc52b
MS
1348<h3 class="function"><a id="cupsCopyDest">cupsCopyDest</a></h3>
1349 <p class="description">Callback block</p>
3e7fe0ca 1350<p class="code">
abacc52b
MS
1351int cupsCopyDest (<br />
1352&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
1353&#160;&#160;&#160;&#160;int num_dests,<br />
1354&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> **dests<br />
3e7fe0ca
MS
1355);</p>
1356<h4 class="parameters">Parameters</h4>
1357<dl>
1358<dt>dest</dt>
1359<dt>num_dests</dt>
1360<dt>dests</dt>
1361</dl>
1362<h4 class="returnvalue">Return Value</h4>
abacc52b
MS
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
3e7fe0ca
MS
1365copy) - for use with the cupsEnumDests* functions. The caller is responsible
1366for calling cupsFreeDests() on the returned object(s).
1367
5a9febac 1368</p>
abacc52b
MS
1369<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDestConflicts">cupsCopyDestConflicts</a></h3>
1370 <p class="description">Get conflicts and resolutions for a new
5a9febac
MS
1371option/value pair.</p>
1372<p class="code">
abacc52b
MS
1373int cupsCopyDestConflicts (<br />
1374&#160;&#160;&#160;&#160;http_t *http,<br />
1375&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
1376&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br />
1377&#160;&#160;&#160;&#160;int num_options,<br />
1378&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options,<br />
1379&#160;&#160;&#160;&#160;const char *new_option,<br />
1380&#160;&#160;&#160;&#160;const char *new_value,<br />
1381&#160;&#160;&#160;&#160;int *num_conflicts,<br />
1382&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **conflicts,<br />
1383&#160;&#160;&#160;&#160;int *num_resolved,<br />
1384&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **resolved<br />
5a9febac
MS
1385);</p>
1386<h4 class="parameters">Parameters</h4>
1387<dl>
1388<dt>http</dt>
abacc52b 1389 <dd class="description">Connection to destination</dd>
5a9febac 1390<dt>dest</dt>
abacc52b 1391 <dd class="description">Destination</dd>
5a9febac 1392<dt>dinfo</dt>
abacc52b 1393 <dd class="description">Destination information</dd>
5a9febac 1394<dt>num_options</dt>
abacc52b 1395 <dd class="description">Number of current options</dd>
5a9febac 1396<dt>options</dt>
abacc52b 1397 <dd class="description">Current options</dd>
5a9febac 1398<dt>new_option</dt>
abacc52b 1399 <dd class="description">New option</dd>
5a9febac 1400<dt>new_value</dt>
abacc52b 1401 <dd class="description">New value</dd>
5a9febac 1402<dt>num_conflicts</dt>
abacc52b 1403 <dd class="description">Number of conflicting options</dd>
5a9febac 1404<dt>conflicts</dt>
abacc52b 1405 <dd class="description">Conflicting options</dd>
5a9febac 1406<dt>num_resolved</dt>
abacc52b 1407 <dd class="description">Number of options to resolve</dd>
5a9febac 1408<dt>resolved</dt>
abacc52b 1409 <dd class="description">Resolved options</dd>
5a9febac
MS
1410</dl>
1411<h4 class="returnvalue">Return Value</h4>
abacc52b 1412 <p class="description">1 if there is a conflict, 0 if none, -1 on error</p>
5a9febac 1413<h4 class="discussion">Discussion</h4>
abacc52b 1414 <p class="discussion">&quot;num_options&quot; and &quot;options&quot; represent the currently selected options by the
5a9febac
MS
1415user. &quot;new_option&quot; and &quot;new_value&quot; are the setting the user has just
1416changed.<br>
1417<br>
1418Returns 1 if there is a conflict, 0 if there are no conflicts, and -1 if
1419there was an unrecoverable error such as a resolver loop.<br>
1420<br>
1421If &quot;num_conflicts&quot; and &quot;conflicts&quot; are not <code>NULL</code>, they are set to
1422contain the list of conflicting option/value pairs. Similarly, if
1423&quot;num_resolved&quot; and &quot;resolved&quot; are not <code>NULL</code> they will be set to the
1424list of changes needed to resolve the conflict.<br>
1425<br>
1426If cupsCopyDestConflicts returns 1 but &quot;num_resolved&quot; and &quot;resolved&quot; are set
1427to 0 and <code>NULL</code>, respectively, then the conflict cannot be resolved.
1428
1429</p>
abacc52b
MS
1430<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDestInfo">cupsCopyDestInfo</a></h3>
1431 <p class="description">Get the supported values/capabilities for the
5a9febac
MS
1432destination.</p>
1433<p class="code">
abacc52b
MS
1434<a href="#cups_dinfo_t">cups_dinfo_t</a> *cupsCopyDestInfo (<br />
1435&#160;&#160;&#160;&#160;http_t *http,<br />
1436&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest<br />
5a9febac
MS
1437);</p>
1438<h4 class="parameters">Parameters</h4>
1439<dl>
1440<dt>http</dt>
abacc52b 1441 <dd class="description">Connection to destination</dd>
5a9febac 1442<dt>dest</dt>
abacc52b 1443 <dd class="description">Destination</dd>
5a9febac
MS
1444</dl>
1445<h4 class="returnvalue">Return Value</h4>
abacc52b 1446 <p class="description">Destination information</p>
5a9febac 1447<h4 class="discussion">Discussion</h4>
abacc52b 1448 <p class="discussion">The caller is responsible for calling <a href="#cupsFreeDestInfo"><code>cupsFreeDestInfo</code></a> on the return
5a9febac
MS
1449value. <code>NULL</code> is returned on error.
1450
1451</p>
abacc52b
MS
1452<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCreateDestJob">cupsCreateDestJob</a></h3>
1453 <p class="description">Create a job on a destination.</p>
5a9febac 1454<p class="code">
abacc52b
MS
1455ipp_status_t cupsCreateDestJob (<br />
1456&#160;&#160;&#160;&#160;http_t *http,<br />
1457&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
1458&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *info,<br />
1459&#160;&#160;&#160;&#160;int *job_id,<br />
1460&#160;&#160;&#160;&#160;const char *title,<br />
1461&#160;&#160;&#160;&#160;int num_options,<br />
1462&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br />
5a9febac
MS
1463);</p>
1464<h4 class="parameters">Parameters</h4>
1465<dl>
1466<dt>http</dt>
abacc52b 1467 <dd class="description">Connection to destination</dd>
5a9febac 1468<dt>dest</dt>
abacc52b 1469 <dd class="description">Destination</dd>
5a9febac 1470<dt>info</dt>
abacc52b 1471 <dd class="description">Destination information</dd>
5a9febac 1472<dt>job_id</dt>
abacc52b 1473 <dd class="description">Job ID or 0 on error</dd>
5a9febac 1474<dt>title</dt>
abacc52b 1475 <dd class="description">Job name</dd>
5a9febac 1476<dt>num_options</dt>
abacc52b 1477 <dd class="description">Number of job options</dd>
5a9febac 1478<dt>options</dt>
abacc52b 1479 <dd class="description">Job options</dd>
5a9febac
MS
1480</dl>
1481<h4 class="returnvalue">Return Value</h4>
abacc52b 1482 <p class="description">IPP status code</p>
5a9febac 1483<h4 class="discussion">Discussion</h4>
abacc52b 1484 <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success, saving the job ID
5a9febac
MS
1485in the variable pointed to by &quot;job_id&quot;.
1486
5a738aea 1487</p>
abacc52b
MS
1488<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsCreateJob">cupsCreateJob</a></h3>
1489 <p class="description">Create an empty job for streaming.</p>
5a738aea 1490<p class="code">
abacc52b
MS
1491int cupsCreateJob (<br />
1492&#160;&#160;&#160;&#160;http_t *http,<br />
1493&#160;&#160;&#160;&#160;const char *name,<br />
1494&#160;&#160;&#160;&#160;const char *title,<br />
1495&#160;&#160;&#160;&#160;int num_options,<br />
1496&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br />
5a738aea
MS
1497);</p>
1498<h4 class="parameters">Parameters</h4>
1499<dl>
1500<dt>http</dt>
abacc52b 1501 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea 1502<dt>name</dt>
abacc52b 1503 <dd class="description">Destination name</dd>
5a738aea 1504<dt>title</dt>
abacc52b 1505 <dd class="description">Title of job</dd>
5a738aea 1506<dt>num_options</dt>
abacc52b 1507 <dd class="description">Number of options</dd>
5a738aea 1508<dt>options</dt>
abacc52b 1509 <dd class="description">Options</dd>
5a738aea
MS
1510</dl>
1511<h4 class="returnvalue">Return Value</h4>
abacc52b 1512 <p class="description">Job ID or 0 on error</p>
5a738aea 1513<h4 class="discussion">Discussion</h4>
abacc52b 1514 <p class="discussion">Use this function when you want to stream print data using the
568fa3fa
MS
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
1517print, use the <a href="#cupsPrintFile2"><code>cupsPrintFile2</code></a> or <a href="#cupsPrintFiles2"><code>cupsPrintFiles2</code></a> function
1518instead.
5a738aea
MS
1519
1520</p>
abacc52b
MS
1521<h3 class="function"><a id="cupsEncryption">cupsEncryption</a></h3>
1522 <p class="description">Get the current encryption settings.</p>
5a738aea
MS
1523<p class="code">
1524http_encryption_t cupsEncryption (void);</p>
1525<h4 class="returnvalue">Return Value</h4>
abacc52b 1526 <p class="description">Encryption settings</p>
5a738aea 1527<h4 class="discussion">Discussion</h4>
abacc52b 1528 <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
568fa3fa 1529environment variable, then the ~/.cups/client.conf file, and finally the
ef416fc2 1530/etc/cups/client.conf file. If not set, the default is
6961465f 1531<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
aaf19ab0
MS
1532<br>
1533Note: The current encryption setting is tracked separately for each thread
1534in 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
1536setting to be used.</p>
abacc52b
MS
1537<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsEnumDests">cupsEnumDests</a></h3>
1538 <p class="description">Enumerate available destinations with a callback function.</p>
3e7fe0ca 1539<p class="code">
abacc52b
MS
1540int cupsEnumDests (<br />
1541&#160;&#160;&#160;&#160;unsigned flags,<br />
1542&#160;&#160;&#160;&#160;int msec,<br />
1543&#160;&#160;&#160;&#160;int *cancel,<br />
1544&#160;&#160;&#160;&#160;<a href="#cups_ptype_t">cups_ptype_t</a> type,<br />
1545&#160;&#160;&#160;&#160;<a href="#cups_ptype_t">cups_ptype_t</a> mask,<br />
1546&#160;&#160;&#160;&#160;<a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb,<br />
1547&#160;&#160;&#160;&#160;void *user_data<br />
3e7fe0ca
MS
1548);</p>
1549<h4 class="parameters">Parameters</h4>
1550<dl>
1551<dt>flags</dt>
abacc52b 1552 <dd class="description">Enumeration flags</dd>
3e7fe0ca 1553<dt>msec</dt>
abacc52b 1554 <dd class="description">Timeout in milliseconds,
3e7fe0ca
MS
1555-1 for indefinite</dd>
1556<dt>cancel</dt>
abacc52b 1557 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
3e7fe0ca 1558<dt>type</dt>
abacc52b 1559 <dd class="description">Printer type bits</dd>
3e7fe0ca 1560<dt>mask</dt>
abacc52b 1561 <dd class="description">Mask for printer type bits</dd>
3e7fe0ca 1562<dt>cb</dt>
abacc52b 1563 <dd class="description">Callback function</dd>
3e7fe0ca 1564<dt>user_data</dt>
abacc52b 1565 <dd class="description">User data</dd>
3e7fe0ca
MS
1566</dl>
1567<h4 class="returnvalue">Return Value</h4>
abacc52b 1568 <p class="description">1 on success, 0 on failure</p>
3e7fe0ca 1569<h4 class="discussion">Discussion</h4>
abacc52b 1570 <p class="discussion">Destinations are enumerated from one or more sources. The callback function
3e7fe0ca
MS
1571receives the <code>user_data</code> pointer, destination name, instance, number of
1572options, and options which can be used as input to the <a href="#cupsAddDest"><code>cupsAddDest</code></a>
1573function. The function must return 1 to continue enumeration or 0 to stop.<br>
1574<br>
1575Enumeration happens on the current thread and does not return until all
1576destinations have been enumerated or the callback function returns 0.
1577
1578</p>
abacc52b
MS
1579<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsEnumDestsBlock">cupsEnumDestsBlock</a></h3>
1580 <p class="description">Enumerate available destinations with a block.</p>
3e7fe0ca 1581<p class="code">
abacc52b
MS
1582int cupsEnumDestsBlock (<br />
1583&#160;&#160;&#160;&#160;unsigned flags,<br />
1584&#160;&#160;&#160;&#160;int timeout,<br />
1585&#160;&#160;&#160;&#160;int *cancel,<br />
1586&#160;&#160;&#160;&#160;<a href="#cups_ptype_t">cups_ptype_t</a> type,<br />
1587&#160;&#160;&#160;&#160;<a href="#cups_ptype_t">cups_ptype_t</a> mask,<br />
1588&#160;&#160;&#160;&#160;<a href="#cups_dest_block_t">cups_dest_block_t</a> block<br />
3e7fe0ca
MS
1589);</p>
1590<h4 class="parameters">Parameters</h4>
1591<dl>
1592<dt>flags</dt>
abacc52b 1593 <dd class="description">Enumeration flags</dd>
3e7fe0ca 1594<dt>timeout</dt>
abacc52b 1595 <dd class="description">Timeout in milliseconds, 0 for indefinite</dd>
3e7fe0ca 1596<dt>cancel</dt>
abacc52b 1597 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
3e7fe0ca 1598<dt>type</dt>
abacc52b 1599 <dd class="description">Printer type bits</dd>
3e7fe0ca 1600<dt>mask</dt>
abacc52b 1601 <dd class="description">Mask for printer type bits</dd>
3e7fe0ca 1602<dt>block</dt>
abacc52b 1603 <dd class="description">Block</dd>
3e7fe0ca
MS
1604</dl>
1605<h4 class="returnvalue">Return Value</h4>
abacc52b 1606 <p class="description">1 on success, 0 on failure</p>
3e7fe0ca 1607<h4 class="discussion">Discussion</h4>
abacc52b 1608 <p class="discussion">Destinations are enumerated from one or more sources. The block receives the
3e7fe0ca
MS
1609destination name, instance, number of options, and options which can be used
1610as input to the <a href="#cupsAddDest"><code>cupsAddDest</code></a> function. The block must return 1 to
1611continue enumeration or 0 to stop.<br>
1612<br>
1613Enumeration happens on the current thread and does not return until all
1614destinations have been enumerated or the block returns 0.
1615
6961465f 1616</p>
abacc52b
MS
1617<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestDefault">cupsFindDestDefault</a></h3>
1618 <p class="description">Find the default value(s) for the given option.</p>
6961465f 1619<p class="code">
abacc52b
MS
1620ipp_attribute_t *cupsFindDestDefault (<br />
1621&#160;&#160;&#160;&#160;http_t *http,<br />
1622&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
1623&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br />
1624&#160;&#160;&#160;&#160;const char *option<br />
6961465f
MS
1625);</p>
1626<h4 class="parameters">Parameters</h4>
1627<dl>
1628<dt>http</dt>
abacc52b 1629 <dd class="description">Connection to destination</dd>
6961465f 1630<dt>dest</dt>
abacc52b 1631 <dd class="description">Destination</dd>
6961465f 1632<dt>dinfo</dt>
abacc52b 1633 <dd class="description">Destination information</dd>
6961465f 1634<dt>option</dt>
abacc52b 1635 <dd class="description">Option/attribute name</dd>
6961465f
MS
1636</dl>
1637<h4 class="returnvalue">Return Value</h4>
abacc52b 1638 <p class="description">Default attribute or <code>NULL</code> for none</p>
6961465f 1639<h4 class="discussion">Discussion</h4>
abacc52b 1640 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
6961465f
MS
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>
1644functions to inspect the default value(s) as needed.
1645
1646</p>
abacc52b
MS
1647<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestReady">cupsFindDestReady</a></h3>
1648 <p class="description">Find the default value(s) for the given option.</p>
6961465f 1649<p class="code">
abacc52b
MS
1650ipp_attribute_t *cupsFindDestReady (<br />
1651&#160;&#160;&#160;&#160;http_t *http,<br />
1652&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
1653&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br />
1654&#160;&#160;&#160;&#160;const char *option<br />
6961465f
MS
1655);</p>
1656<h4 class="parameters">Parameters</h4>
1657<dl>
1658<dt>http</dt>
abacc52b 1659 <dd class="description">Connection to destination</dd>
6961465f 1660<dt>dest</dt>
abacc52b 1661 <dd class="description">Destination</dd>
6961465f 1662<dt>dinfo</dt>
abacc52b 1663 <dd class="description">Destination information</dd>
6961465f 1664<dt>option</dt>
abacc52b 1665 <dd class="description">Option/attribute name</dd>
6961465f
MS
1666</dl>
1667<h4 class="returnvalue">Return Value</h4>
abacc52b 1668 <p class="description">Default attribute or <code>NULL</code> for none</p>
6961465f 1669<h4 class="discussion">Discussion</h4>
abacc52b 1670 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
6961465f
MS
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>
1674functions to inspect the default value(s) as needed.
1675
1676</p>
abacc52b
MS
1677<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestSupported">cupsFindDestSupported</a></h3>
1678 <p class="description">Find the default value(s) for the given option.</p>
6961465f 1679<p class="code">
abacc52b
MS
1680ipp_attribute_t *cupsFindDestSupported (<br />
1681&#160;&#160;&#160;&#160;http_t *http,<br />
1682&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
1683&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br />
1684&#160;&#160;&#160;&#160;const char *option<br />
6961465f
MS
1685);</p>
1686<h4 class="parameters">Parameters</h4>
1687<dl>
1688<dt>http</dt>
abacc52b 1689 <dd class="description">Connection to destination</dd>
6961465f 1690<dt>dest</dt>
abacc52b 1691 <dd class="description">Destination</dd>
6961465f 1692<dt>dinfo</dt>
abacc52b 1693 <dd class="description">Destination information</dd>
6961465f 1694<dt>option</dt>
abacc52b 1695 <dd class="description">Option/attribute name</dd>
6961465f
MS
1696</dl>
1697<h4 class="returnvalue">Return Value</h4>
abacc52b 1698 <p class="description">Default attribute or <code>NULL</code> for none</p>
6961465f 1699<h4 class="discussion">Discussion</h4>
abacc52b 1700 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
6961465f
MS
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>
1704functions to inspect the default value(s) as needed.
1705
5a9febac 1706</p>
abacc52b
MS
1707<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsFinishDestDocument">cupsFinishDestDocument</a></h3>
1708 <p class="description">Finish the current document.</p>
5a9febac 1709<p class="code">
abacc52b
MS
1710ipp_status_t cupsFinishDestDocument (<br />
1711&#160;&#160;&#160;&#160;http_t *http,<br />
1712&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
1713&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *info<br />
5a9febac
MS
1714);</p>
1715<h4 class="parameters">Parameters</h4>
1716<dl>
1717<dt>http</dt>
abacc52b 1718 <dd class="description">Connection to destination</dd>
5a9febac 1719<dt>dest</dt>
abacc52b 1720 <dd class="description">Destination</dd>
5a9febac 1721<dt>info</dt>
abacc52b 1722 <dd class="description">Destination information</dd>
5a9febac
MS
1723</dl>
1724<h4 class="returnvalue">Return Value</h4>
abacc52b 1725 <p class="description">Status of document submission</p>
5a9febac 1726<h4 class="discussion">Discussion</h4>
abacc52b 1727 <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success.
5a9febac 1728
3e7fe0ca 1729</p>
abacc52b
MS
1730<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsFinishDocument">cupsFinishDocument</a></h3>
1731 <p class="description">Finish sending a document.</p>
5a738aea 1732<p class="code">
abacc52b
MS
1733ipp_status_t cupsFinishDocument (<br />
1734&#160;&#160;&#160;&#160;http_t *http,<br />
1735&#160;&#160;&#160;&#160;const char *name<br />
5a738aea
MS
1736);</p>
1737<h4 class="parameters">Parameters</h4>
1738<dl>
1739<dt>http</dt>
abacc52b 1740 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea 1741<dt>name</dt>
abacc52b 1742 <dd class="description">Destination name</dd>
5a738aea
MS
1743</dl>
1744<h4 class="returnvalue">Return Value</h4>
abacc52b 1745 <p class="description">Status of document submission</p>
5a738aea 1746<h4 class="discussion">Discussion</h4>
abacc52b 1747 <p class="discussion">The document must have been started using <a href="#cupsStartDocument"><code>cupsStartDocument</code></a>.
5a738aea
MS
1748
1749</p>
abacc52b
MS
1750<h3 class="function"><a id="cupsFreeDestInfo">cupsFreeDestInfo</a></h3>
1751 <p class="description">Free destination information obtained using
5a9febac
MS
1752<a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a>.</p>
1753<p class="code">
abacc52b
MS
1754void cupsFreeDestInfo (<br />
1755&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo<br />
5a9febac
MS
1756);</p>
1757<h4 class="parameters">Parameters</h4>
1758<dl>
1759<dt>dinfo</dt>
abacc52b 1760 <dd class="description">Destination information</dd>
5a9febac 1761</dl>
abacc52b
MS
1762<h3 class="function"><a id="cupsFreeDests">cupsFreeDests</a></h3>
1763 <p class="description">Free the memory used by the list of destinations.</p>
5a738aea 1764<p class="code">
abacc52b
MS
1765void cupsFreeDests (<br />
1766&#160;&#160;&#160;&#160;int num_dests,<br />
1767&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dests<br />
5a738aea
MS
1768);</p>
1769<h4 class="parameters">Parameters</h4>
1770<dl>
1771<dt>num_dests</dt>
abacc52b 1772 <dd class="description">Number of destinations</dd>
5a738aea 1773<dt>dests</dt>
abacc52b 1774 <dd class="description">Destinations</dd>
5a738aea 1775</dl>
abacc52b
MS
1776<h3 class="function"><a id="cupsFreeJobs">cupsFreeJobs</a></h3>
1777 <p class="description">Free memory used by job data.</p>
5a738aea 1778<p class="code">
abacc52b
MS
1779void cupsFreeJobs (<br />
1780&#160;&#160;&#160;&#160;int num_jobs,<br />
1781&#160;&#160;&#160;&#160;<a href="#cups_job_t">cups_job_t</a> *jobs<br />
5a738aea
MS
1782);</p>
1783<h4 class="parameters">Parameters</h4>
1784<dl>
1785<dt>num_jobs</dt>
abacc52b 1786 <dd class="description">Number of jobs</dd>
5a738aea 1787<dt>jobs</dt>
abacc52b 1788 <dd class="description">Jobs</dd>
5a738aea 1789</dl>
abacc52b
MS
1790<h3 class="function"><a id="cupsFreeOptions">cupsFreeOptions</a></h3>
1791 <p class="description">Free all memory used by options.</p>
5a738aea 1792<p class="code">
abacc52b
MS
1793void cupsFreeOptions (<br />
1794&#160;&#160;&#160;&#160;int num_options,<br />
1795&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br />
5a738aea
MS
1796);</p>
1797<h4 class="parameters">Parameters</h4>
1798<dl>
1799<dt>num_options</dt>
abacc52b 1800 <dd class="description">Number of options</dd>
5a738aea 1801<dt>options</dt>
abacc52b 1802 <dd class="description">Pointer to options</dd>
5a738aea 1803</dl>
abacc52b
MS
1804<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="cupsGetClasses">cupsGetClasses</a></h3>
1805 <p class="description">Get a list of printer classes from the default server.</p>
5a738aea 1806<p class="code">
abacc52b
MS
1807int cupsGetClasses (<br />
1808&#160;&#160;&#160;&#160;char ***classes<br />
5a738aea
MS
1809);</p>
1810<h4 class="parameters">Parameters</h4>
1811<dl>
1812<dt>classes</dt>
abacc52b 1813 <dd class="description">Classes</dd>
5a738aea
MS
1814</dl>
1815<h4 class="returnvalue">Return Value</h4>
abacc52b 1816 <p class="description">Number of classes</p>
5a738aea 1817<h4 class="discussion">Discussion</h4>
abacc52b 1818 <p class="discussion">This function is deprecated and no longer returns a list of printer
240214ef 1819classes - use <a href="#cupsGetDests"><code>cupsGetDests</code></a> instead.
5a738aea
MS
1820
1821</p>
abacc52b
MS
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>
5a738aea
MS
1824<p class="code">
1825const char *cupsGetDefault (void);</p>
1826<h4 class="returnvalue">Return Value</h4>
abacc52b 1827 <p class="description">Default printer or <code>NULL</code></p>
5a738aea 1828<h4 class="discussion">Discussion</h4>
abacc52b 1829 <p class="discussion">This function returns the default printer or class as defined by
ef416fc2 1830the LPDEST or PRINTER environment variables. If these environment
1831variables are not set, the server default destination is returned.
5a738aea
MS
1832Applications should use the <a href="#cupsGetDests"><code>cupsGetDests</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a>
1833functions to get the user-defined default printer, as this function does
1834not support the lpoptions-defined default printer.</p>
abacc52b
MS
1835<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetDefault2">cupsGetDefault2</a></h3>
1836 <p class="description">Get the default printer or class for the specified server.</p>
5a738aea 1837<p class="code">
abacc52b
MS
1838const char *cupsGetDefault2 (<br />
1839&#160;&#160;&#160;&#160;http_t *http<br />
5a738aea
MS
1840);</p>
1841<h4 class="parameters">Parameters</h4>
1842<dl>
1843<dt>http</dt>
abacc52b 1844 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
1845</dl>
1846<h4 class="returnvalue">Return Value</h4>
abacc52b 1847 <p class="description">Default printer or <code>NULL</code></p>
5a738aea 1848<h4 class="discussion">Discussion</h4>
abacc52b 1849 <p class="discussion">This function returns the default printer or class as defined by
ef416fc2 1850the LPDEST or PRINTER environment variables. If these environment
1851variables are not set, the server default destination is returned.
5a738aea
MS
1852Applications should use the <a href="#cupsGetDests"><code>cupsGetDests</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a>
1853functions to get the user-defined default printer, as this function does
1854not support the lpoptions-defined default printer.
1855
1856</p>
abacc52b
MS
1857<h3 class="function"><a id="cupsGetDest">cupsGetDest</a></h3>
1858 <p class="description">Get the named destination from the list.</p>
5a738aea 1859<p class="code">
abacc52b
MS
1860<a href="#cups_dest_t">cups_dest_t</a> *cupsGetDest (<br />
1861&#160;&#160;&#160;&#160;const char *name,<br />
1862&#160;&#160;&#160;&#160;const char *instance,<br />
1863&#160;&#160;&#160;&#160;int num_dests,<br />
1864&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dests<br />
5a738aea
MS
1865);</p>
1866<h4 class="parameters">Parameters</h4>
1867<dl>
1868<dt>name</dt>
abacc52b 1869 <dd class="description">Destination name or <code>NULL</code> for the default destination</dd>
5a738aea 1870<dt>instance</dt>
abacc52b 1871 <dd class="description">Instance name or <code>NULL</code></dd>
5a738aea 1872<dt>num_dests</dt>
abacc52b 1873 <dd class="description">Number of destinations</dd>
5a738aea 1874<dt>dests</dt>
abacc52b 1875 <dd class="description">Destinations</dd>
5a738aea
MS
1876</dl>
1877<h4 class="returnvalue">Return Value</h4>
abacc52b 1878 <p class="description">Destination pointer or <code>NULL</code></p>
5a738aea 1879<h4 class="discussion">Discussion</h4>
abacc52b 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
5a738aea 1881list of supported destinations for the current user.</p>
abacc52b
MS
1882<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></h3>
1883 <p class="description">Get a media name, dimension, and margins for a
6961465f
MS
1884specific size.</p>
1885<p class="code">
abacc52b
MS
1886int cupsGetDestMediaByIndex (<br />
1887&#160;&#160;&#160;&#160;http_t *http,<br />
1888&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
1889&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br />
1890&#160;&#160;&#160;&#160;int n,<br />
1891&#160;&#160;&#160;&#160;unsigned flags,<br />
1892&#160;&#160;&#160;&#160;<a href="#cups_size_t">cups_size_t</a> *size<br />
6961465f
MS
1893);</p>
1894<h4 class="parameters">Parameters</h4>
1895<dl>
1896<dt>http</dt>
abacc52b 1897 <dd class="description">Connection to destination</dd>
6961465f 1898<dt>dest</dt>
abacc52b 1899 <dd class="description">Destination</dd>
6961465f 1900<dt>dinfo</dt>
abacc52b 1901 <dd class="description">Destination information</dd>
6961465f 1902<dt>n</dt>
abacc52b 1903 <dd class="description">Media size number (0-based)</dd>
6961465f 1904<dt>flags</dt>
abacc52b 1905 <dd class="description">Media flags</dd>
6961465f 1906<dt>size</dt>
abacc52b 1907 <dd class="description">Media size information</dd>
6961465f
MS
1908</dl>
1909<h4 class="returnvalue">Return Value</h4>
abacc52b 1910 <p class="description">1 on success, 0 on failure</p>
6961465f 1911<h4 class="discussion">Discussion</h4>
abacc52b 1912 <p class="discussion">The <code>flags</code> parameter determines which set of media are indexed. For
6961465f
MS
1913example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will get the Nth
1914borderless size supported by the printer.
1915
1916</p>
abacc52b
MS
1917<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsGetDestMediaByName">cupsGetDestMediaByName</a></h3>
1918 <p class="description">Get media names, dimensions, and margins.</p>
5a9febac 1919<p class="code">
abacc52b
MS
1920int cupsGetDestMediaByName (<br />
1921&#160;&#160;&#160;&#160;http_t *http,<br />
1922&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
1923&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br />
1924&#160;&#160;&#160;&#160;const char *media,<br />
1925&#160;&#160;&#160;&#160;unsigned flags,<br />
1926&#160;&#160;&#160;&#160;<a href="#cups_size_t">cups_size_t</a> *size<br />
5a9febac
MS
1927);</p>
1928<h4 class="parameters">Parameters</h4>
1929<dl>
1930<dt>http</dt>
abacc52b 1931 <dd class="description">Connection to destination</dd>
5a9febac 1932<dt>dest</dt>
abacc52b 1933 <dd class="description">Destination</dd>
5a9febac 1934<dt>dinfo</dt>
abacc52b 1935 <dd class="description">Destination information</dd>
5a9febac 1936<dt>media</dt>
abacc52b 1937 <dd class="description">Media name</dd>
5a9febac 1938<dt>flags</dt>
abacc52b 1939 <dd class="description">Media matching flags</dd>
5a9febac 1940<dt>size</dt>
abacc52b 1941 <dd class="description">Media size information</dd>
5a9febac
MS
1942</dl>
1943<h4 class="returnvalue">Return Value</h4>
abacc52b 1944 <p class="description">1 on match, 0 on failure</p>
5a9febac 1945<h4 class="discussion">Discussion</h4>
abacc52b 1946 <p class="discussion">The &quot;media&quot; string is a PWG media name. &quot;Flags&quot; provides some matching
5a9febac
MS
1947guidance (multiple flags can be combined):<br>
1948<br>
1949CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
1950CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
1951CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
1952CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
1953CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
1954size amongst the &quot;ready&quot; media.<br>
1955<br>
1956The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
1957<br>
1958Returns 1 when there is a match and 0 if there is not a match.
1959
1960</p>
abacc52b
MS
1961<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></h3>
1962 <p class="description">Get media names, dimensions, and margins.</p>
5a9febac 1963<p class="code">
abacc52b
MS
1964int cupsGetDestMediaBySize (<br />
1965&#160;&#160;&#160;&#160;http_t *http,<br />
1966&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
1967&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br />
1968&#160;&#160;&#160;&#160;int width,<br />
1969&#160;&#160;&#160;&#160;int length,<br />
1970&#160;&#160;&#160;&#160;unsigned flags,<br />
1971&#160;&#160;&#160;&#160;<a href="#cups_size_t">cups_size_t</a> *size<br />
5a9febac
MS
1972);</p>
1973<h4 class="parameters">Parameters</h4>
1974<dl>
1975<dt>http</dt>
abacc52b 1976 <dd class="description">Connection to destination</dd>
5a9febac 1977<dt>dest</dt>
abacc52b 1978 <dd class="description">Destination</dd>
5a9febac 1979<dt>dinfo</dt>
abacc52b 1980 <dd class="description">Destination information</dd>
5a9febac 1981<dt>width</dt>
abacc52b 1982 <dd class="description">Media width in hundredths of
5a9febac
MS
1983of millimeters</dd>
1984<dt>length</dt>
abacc52b 1985 <dd class="description">Media length in hundredths of
5a9febac
MS
1986of millimeters</dd>
1987<dt>flags</dt>
abacc52b 1988 <dd class="description">Media matching flags</dd>
5a9febac 1989<dt>size</dt>
abacc52b 1990 <dd class="description">Media size information</dd>
5a9febac
MS
1991</dl>
1992<h4 class="returnvalue">Return Value</h4>
abacc52b 1993 <p class="description">1 on match, 0 on failure</p>
5a9febac 1994<h4 class="discussion">Discussion</h4>
abacc52b 1995 <p class="discussion">&quot;Width&quot; and &quot;length&quot; are the dimensions in hundredths of millimeters.
5a9febac
MS
1996&quot;Flags&quot; provides some matching guidance (multiple flags can be combined):<br>
1997<br>
1998CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
1999CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
2000CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
2001CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
2002CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
2003size amongst the &quot;ready&quot; media.<br>
2004<br>
2005The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
2006<br>
2007Returns 1 when there is a match and 0 if there is not a match.
2008
6961465f 2009</p>
abacc52b
MS
2010<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaCount">cupsGetDestMediaCount</a></h3>
2011 <p class="description">Get the number of sizes supported by a
6961465f
MS
2012destination.</p>
2013<p class="code">
abacc52b
MS
2014int cupsGetDestMediaCount (<br />
2015&#160;&#160;&#160;&#160;http_t *http,<br />
2016&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
2017&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br />
2018&#160;&#160;&#160;&#160;unsigned flags<br />
6961465f
MS
2019);</p>
2020<h4 class="parameters">Parameters</h4>
2021<dl>
2022<dt>http</dt>
abacc52b 2023 <dd class="description">Connection to destination</dd>
6961465f 2024<dt>dest</dt>
abacc52b 2025 <dd class="description">Destination</dd>
6961465f 2026<dt>dinfo</dt>
abacc52b 2027 <dd class="description">Destination information</dd>
6961465f 2028<dt>flags</dt>
abacc52b 2029 <dd class="description">Media flags</dd>
6961465f
MS
2030</dl>
2031<h4 class="returnvalue">Return Value</h4>
abacc52b 2032 <p class="description">Number of sizes</p>
6961465f 2033<h4 class="discussion">Discussion</h4>
abacc52b 2034 <p class="discussion">The <code>flags</code> parameter determines the set of media sizes that are
6961465f
MS
2035counted. For example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return
2036the number of borderless sizes.
2037
2038</p>
abacc52b
MS
2039<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></h3>
2040 <p class="description">Get the default size for a destination.</p>
6961465f 2041<p class="code">
abacc52b
MS
2042int cupsGetDestMediaDefault (<br />
2043&#160;&#160;&#160;&#160;http_t *http,<br />
2044&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
2045&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br />
2046&#160;&#160;&#160;&#160;unsigned flags,<br />
2047&#160;&#160;&#160;&#160;<a href="#cups_size_t">cups_size_t</a> *size<br />
6961465f
MS
2048);</p>
2049<h4 class="parameters">Parameters</h4>
2050<dl>
2051<dt>http</dt>
abacc52b 2052 <dd class="description">Connection to destination</dd>
6961465f 2053<dt>dest</dt>
abacc52b 2054 <dd class="description">Destination</dd>
6961465f 2055<dt>dinfo</dt>
abacc52b 2056 <dd class="description">Destination information</dd>
6961465f 2057<dt>flags</dt>
abacc52b 2058 <dd class="description">Media flags</dd>
6961465f 2059<dt>size</dt>
abacc52b 2060 <dd class="description">Media size information</dd>
6961465f
MS
2061</dl>
2062<h4 class="returnvalue">Return Value</h4>
abacc52b 2063 <p class="description">1 on success, 0 on failure</p>
6961465f 2064<h4 class="discussion">Discussion</h4>
abacc52b 2065 <p class="discussion">The <code>flags</code> parameter determines which default size is returned. For
6961465f
MS
2066example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the default
2067borderless size, typically US Letter or A4, but sometimes 4x6 photo media.
2068
240214ef 2069</p>
abacc52b
MS
2070<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsGetDestWithURI">cupsGetDestWithURI</a></h3>
2071 <p class="description">Get a destination associated with a URI.</p>
240214ef 2072<p class="code">
abacc52b
MS
2073<a href="#cups_dest_t">cups_dest_t</a> *cupsGetDestWithURI (<br />
2074&#160;&#160;&#160;&#160;const char *name,<br />
2075&#160;&#160;&#160;&#160;const char *uri<br />
240214ef
MS
2076);</p>
2077<h4 class="parameters">Parameters</h4>
2078<dl>
2079<dt>name</dt>
abacc52b 2080 <dd class="description">Desired printer name or <code>NULL</code></dd>
240214ef 2081<dt>uri</dt>
abacc52b 2082 <dd class="description">URI for the printer</dd>
240214ef
MS
2083</dl>
2084<h4 class="returnvalue">Return Value</h4>
abacc52b 2085 <p class="description">Destination or <code>NULL</code></p>
240214ef 2086<h4 class="discussion">Discussion</h4>
abacc52b 2087 <p class="discussion">&quot;name&quot; is the desired name for the printer. If <code>NULL</code>, a name will be
240214ef
MS
2088created using the URI.<br>
2089<br>
2090&quot;uri&quot; is the &quot;ipp&quot; or &quot;ipps&quot; URI for the printer.
2091
5a9febac 2092</p>
abacc52b
MS
2093<h3 class="function"><a id="cupsGetDests">cupsGetDests</a></h3>
2094 <p class="description">Get the list of destinations from the default server.</p>
5a738aea 2095<p class="code">
abacc52b
MS
2096int cupsGetDests (<br />
2097&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> **dests<br />
5a738aea
MS
2098);</p>
2099<h4 class="parameters">Parameters</h4>
2100<dl>
2101<dt>dests</dt>
abacc52b 2102 <dd class="description">Destinations</dd>
5a738aea
MS
2103</dl>
2104<h4 class="returnvalue">Return Value</h4>
abacc52b 2105 <p class="description">Number of destinations</p>
5a738aea 2106<h4 class="discussion">Discussion</h4>
abacc52b 2107 <p class="discussion">Starting with CUPS 1.2, the returned list of destinations include the
ecdc0628 2108printer-info, printer-is-accepting-jobs, printer-is-shared,
2109printer-make-and-model, printer-state, printer-state-change-time,
426c6a59
MS
2110printer-state-reasons, and printer-type attributes as options. CUPS 1.4
2111adds the marker-change-time, marker-colors, marker-high-levels,
2112marker-levels, marker-low-levels, marker-message, marker-names,
2113marker-types, and printer-commands attributes as well.<br>
5a738aea
MS
2114<br>
2115Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and
2116the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination.</p>
abacc52b
MS
2117<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetDests2">cupsGetDests2</a></h3>
2118 <p class="description">Get the list of destinations from the specified server.</p>
5a738aea 2119<p class="code">
abacc52b
MS
2120int cupsGetDests2 (<br />
2121&#160;&#160;&#160;&#160;http_t *http,<br />
2122&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> **dests<br />
5a738aea
MS
2123);</p>
2124<h4 class="parameters">Parameters</h4>
2125<dl>
2126<dt>http</dt>
abacc52b 2127 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea 2128<dt>dests</dt>
abacc52b 2129 <dd class="description">Destinations</dd>
5a738aea
MS
2130</dl>
2131<h4 class="returnvalue">Return Value</h4>
abacc52b 2132 <p class="description">Number of destinations</p>
5a738aea 2133<h4 class="discussion">Discussion</h4>
abacc52b 2134 <p class="discussion">Starting with CUPS 1.2, the returned list of destinations include the
ecdc0628 2135printer-info, printer-is-accepting-jobs, printer-is-shared,
2136printer-make-and-model, printer-state, printer-state-change-time,
426c6a59
MS
2137printer-state-reasons, and printer-type attributes as options. CUPS 1.4
2138adds the marker-change-time, marker-colors, marker-high-levels,
2139marker-levels, marker-low-levels, marker-message, marker-names,
2140marker-types, and printer-commands attributes as well.<br>
5a738aea
MS
2141<br>
2142Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and
2143the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination.
ef416fc2 2144
5a738aea 2145</p>
abacc52b
MS
2146<h3 class="function"><a id="cupsGetJobs">cupsGetJobs</a></h3>
2147 <p class="description">Get the jobs from the default server.</p>
5a738aea 2148<p class="code">
abacc52b
MS
2149int cupsGetJobs (<br />
2150&#160;&#160;&#160;&#160;<a href="#cups_job_t">cups_job_t</a> **jobs,<br />
2151&#160;&#160;&#160;&#160;const char *name,<br />
2152&#160;&#160;&#160;&#160;int myjobs,<br />
2153&#160;&#160;&#160;&#160;int whichjobs<br />
5a738aea
MS
2154);</p>
2155<h4 class="parameters">Parameters</h4>
2156<dl>
2157<dt>jobs</dt>
abacc52b 2158 <dd class="description">Job data</dd>
5a738aea 2159<dt>name</dt>
abacc52b 2160 <dd class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</dd>
5a738aea 2161<dt>myjobs</dt>
abacc52b 2162 <dd class="description">0 = all users, 1 = mine</dd>
5a738aea 2163<dt>whichjobs</dt>
abacc52b 2164 <dd class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></dd>
5a738aea
MS
2165</dl>
2166<h4 class="returnvalue">Return Value</h4>
abacc52b 2167 <p class="description">Number of jobs</p>
5a738aea 2168<h4 class="discussion">Discussion</h4>
abacc52b 2169 <p class="discussion">A &quot;whichjobs&quot; value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless
5a738aea
MS
2170of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are
2171pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns
2172jobs that are stopped, canceled, aborted, or completed.</p>
abacc52b
MS
2173<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetJobs2">cupsGetJobs2</a></h3>
2174 <p class="description">Get the jobs from the specified server.</p>
5a738aea 2175<p class="code">
abacc52b
MS
2176int cupsGetJobs2 (<br />
2177&#160;&#160;&#160;&#160;http_t *http,<br />
2178&#160;&#160;&#160;&#160;<a href="#cups_job_t">cups_job_t</a> **jobs,<br />
2179&#160;&#160;&#160;&#160;const char *name,<br />
2180&#160;&#160;&#160;&#160;int myjobs,<br />
2181&#160;&#160;&#160;&#160;int whichjobs<br />
5a738aea
MS
2182);</p>
2183<h4 class="parameters">Parameters</h4>
2184<dl>
2185<dt>http</dt>
abacc52b 2186 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea 2187<dt>jobs</dt>
abacc52b 2188 <dd class="description">Job data</dd>
5a738aea 2189<dt>name</dt>
abacc52b 2190 <dd class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</dd>
5a738aea 2191<dt>myjobs</dt>
abacc52b 2192 <dd class="description">0 = all users, 1 = mine</dd>
5a738aea 2193<dt>whichjobs</dt>
abacc52b 2194 <dd class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></dd>
5a738aea
MS
2195</dl>
2196<h4 class="returnvalue">Return Value</h4>
abacc52b 2197 <p class="description">Number of jobs</p>
5a738aea 2198<h4 class="discussion">Discussion</h4>
abacc52b 2199 <p class="discussion">A &quot;whichjobs&quot; value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless
5a738aea
MS
2200of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are
2201pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns
2202jobs that are stopped, canceled, aborted, or completed.
2203
2204</p>
abacc52b
MS
2205<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsGetNamedDest">cupsGetNamedDest</a></h3>
2206 <p class="description">Get options for the named destination.</p>
5a738aea 2207<p class="code">
abacc52b
MS
2208<a href="#cups_dest_t">cups_dest_t</a> *cupsGetNamedDest (<br />
2209&#160;&#160;&#160;&#160;http_t *http,<br />
2210&#160;&#160;&#160;&#160;const char *name,<br />
2211&#160;&#160;&#160;&#160;const char *instance<br />
5a738aea
MS
2212);</p>
2213<h4 class="parameters">Parameters</h4>
2214<dl>
2215<dt>http</dt>
abacc52b 2216 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea 2217<dt>name</dt>
abacc52b 2218 <dd class="description">Destination name or <code>NULL</code> for the default destination</dd>
5a738aea 2219<dt>instance</dt>
abacc52b 2220 <dd class="description">Instance name or <code>NULL</code></dd>
5a738aea
MS
2221</dl>
2222<h4 class="returnvalue">Return Value</h4>
abacc52b 2223 <p class="description">Destination or <code>NULL</code></p>
5a738aea 2224<h4 class="discussion">Discussion</h4>
abacc52b 2225 <p class="discussion">This function is optimized for retrieving a single destination and should
5a738aea
MS
2226be used instead of <a href="#cupsGetDests"><code>cupsGetDests</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> when you either
2227know the name of the destination or want to print to the default destination.
2228If <code>NULL</code> is returned, the destination does not exist or there is no
2229default destination.<br>
2230<br>
2231If &quot;http&quot; is <code>CUPS_HTTP_DEFAULT</code>, the connection to the default print
2232server will be used.<br>
2233<br>
2234If &quot;name&quot; is <code>NULL</code>, the default printer for the current user will be
2235returned.<br>
2236<br>
2237The returned destination must be freed using <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> with a
2238&quot;num_dests&quot; value of 1.
2239
2240</p>
abacc52b
MS
2241<h3 class="function"><a id="cupsGetOption">cupsGetOption</a></h3>
2242 <p class="description">Get an option value.</p>
5a738aea 2243<p class="code">
abacc52b
MS
2244const char *cupsGetOption (<br />
2245&#160;&#160;&#160;&#160;const char *name,<br />
2246&#160;&#160;&#160;&#160;int num_options,<br />
2247&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br />
5a738aea
MS
2248);</p>
2249<h4 class="parameters">Parameters</h4>
2250<dl>
2251<dt>name</dt>
abacc52b 2252 <dd class="description">Name of option</dd>
5a738aea 2253<dt>num_options</dt>
abacc52b 2254 <dd class="description">Number of options</dd>
5a738aea 2255<dt>options</dt>
abacc52b 2256 <dd class="description">Options</dd>
5a738aea
MS
2257</dl>
2258<h4 class="returnvalue">Return Value</h4>
abacc52b
MS
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>
5a738aea 2262<p class="code">
abacc52b
MS
2263const char *cupsGetPassword (<br />
2264&#160;&#160;&#160;&#160;const char *prompt<br />
5a738aea
MS
2265);</p>
2266<h4 class="parameters">Parameters</h4>
2267<dl>
2268<dt>prompt</dt>
abacc52b 2269 <dd class="description">Prompt string</dd>
5a738aea
MS
2270</dl>
2271<h4 class="returnvalue">Return Value</h4>
abacc52b 2272 <p class="description">Password</p>
5a738aea 2273<h4 class="discussion">Discussion</h4>
abacc52b 2274 <p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the
aaf19ab0
MS
2275user does not provide a password.<br>
2276<br>
2277Note: The current password callback function is tracked separately for each
2278thread in a program. Multi-threaded programs that override the setting via
2279the <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a> or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> functions need to
2280do so in each thread for the same function to be used.</p>
abacc52b
MS
2281<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsGetPassword2">cupsGetPassword2</a></h3>
2282 <p class="description">Get a password from the user using the advanced
aaf19ab0 2283password callback.</p>
f11a948a 2284<p class="code">
abacc52b
MS
2285const char *cupsGetPassword2 (<br />
2286&#160;&#160;&#160;&#160;const char *prompt,<br />
2287&#160;&#160;&#160;&#160;http_t *http,<br />
2288&#160;&#160;&#160;&#160;const char *method,<br />
2289&#160;&#160;&#160;&#160;const char *resource<br />
f11a948a
MS
2290);</p>
2291<h4 class="parameters">Parameters</h4>
2292<dl>
2293<dt>prompt</dt>
abacc52b 2294 <dd class="description">Prompt string</dd>
f11a948a 2295<dt>http</dt>
abacc52b 2296 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
f11a948a 2297<dt>method</dt>
abacc52b 2298 <dd class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</dd>
f11a948a 2299<dt>resource</dt>
abacc52b 2300 <dd class="description">Resource path</dd>
f11a948a
MS
2301</dl>
2302<h4 class="returnvalue">Return Value</h4>
abacc52b 2303 <p class="description">Password</p>
f11a948a 2304<h4 class="discussion">Discussion</h4>
abacc52b 2305 <p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the
aaf19ab0
MS
2306user does not provide a password.<br>
2307<br>
2308Note: The current password callback function is tracked separately for each
2309thread in a program. Multi-threaded programs that override the setting via
2310the <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a> or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> functions need to
2311do so in each thread for the same function to be used.
f11a948a
MS
2312
2313</p>
abacc52b
MS
2314<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="cupsGetPrinters">cupsGetPrinters</a></h3>
2315 <p class="description">Get a list of printers from the default server.</p>
5a738aea 2316<p class="code">
abacc52b
MS
2317int cupsGetPrinters (<br />
2318&#160;&#160;&#160;&#160;char ***printers<br />
5a738aea
MS
2319);</p>
2320<h4 class="parameters">Parameters</h4>
2321<dl>
2322<dt>printers</dt>
abacc52b 2323 <dd class="description">Printers</dd>
5a738aea
MS
2324</dl>
2325<h4 class="returnvalue">Return Value</h4>
abacc52b 2326 <p class="description">Number of printers</p>
5a738aea 2327<h4 class="discussion">Discussion</h4>
abacc52b 2328 <p class="discussion">This function is deprecated and no longer returns a list of printers - use
240214ef 2329<a href="#cupsGetDests"><code>cupsGetDests</code></a> instead.
5a738aea 2330
5a738aea 2331</p>
abacc52b
MS
2332<h3 class="function"><a id="cupsLangDefault">cupsLangDefault</a></h3>
2333 <p class="description">Return the default language.</p>
5a738aea
MS
2334<p class="code">
2335cups_lang_t *cupsLangDefault (void);</p>
2336<h4 class="returnvalue">Return Value</h4>
abacc52b
MS
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.)
5a738aea
MS
2340for the given language.</p>
2341<p class="code">
abacc52b
MS
2342const char *cupsLangEncoding (<br />
2343&#160;&#160;&#160;&#160;cups_lang_t *lang<br />
5a738aea
MS
2344);</p>
2345<h4 class="parameters">Parameters</h4>
2346<dl>
2347<dt>lang</dt>
abacc52b 2348 <dd class="description">Language data</dd>
5a738aea
MS
2349</dl>
2350<h4 class="returnvalue">Return Value</h4>
abacc52b
MS
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>
5a738aea
MS
2354<p class="code">
2355void cupsLangFlush (void);</p>
abacc52b
MS
2356<h3 class="function"><a id="cupsLangFree">cupsLangFree</a></h3>
2357 <p class="description">Free language data.</p>
5a738aea 2358<p class="code">
abacc52b
MS
2359void cupsLangFree (<br />
2360&#160;&#160;&#160;&#160;cups_lang_t *lang<br />
5a738aea
MS
2361);</p>
2362<h4 class="parameters">Parameters</h4>
2363<dl>
2364<dt>lang</dt>
abacc52b 2365 <dd class="description">Language to free</dd>
5a738aea
MS
2366</dl>
2367<h4 class="discussion">Discussion</h4>
abacc52b
MS
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>
5a738aea 2371<p class="code">
abacc52b
MS
2372cups_lang_t *cupsLangGet (<br />
2373&#160;&#160;&#160;&#160;const char *language<br />
5a738aea
MS
2374);</p>
2375<h4 class="parameters">Parameters</h4>
2376<dl>
2377<dt>language</dt>
abacc52b 2378 <dd class="description">Language or locale</dd>
5a738aea
MS
2379</dl>
2380<h4 class="returnvalue">Return Value</h4>
abacc52b
MS
2381 <p class="description">Language data</p>
2382<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></h3>
2383 <p class="description">Get the localized string for a destination media
240214ef
MS
2384size.</p>
2385<p class="code">
abacc52b
MS
2386const char *cupsLocalizeDestMedia (<br />
2387&#160;&#160;&#160;&#160;http_t *http,<br />
2388&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
2389&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br />
2390&#160;&#160;&#160;&#160;unsigned flags,<br />
2391&#160;&#160;&#160;&#160;<a href="#cups_size_t">cups_size_t</a> *size<br />
240214ef
MS
2392);</p>
2393<h4 class="parameters">Parameters</h4>
2394<dl>
2395<dt>http</dt>
abacc52b 2396 <dd class="description">Connection to destination</dd>
240214ef 2397<dt>dest</dt>
abacc52b 2398 <dd class="description">Destination</dd>
240214ef 2399<dt>dinfo</dt>
abacc52b 2400 <dd class="description">Destination information</dd>
240214ef 2401<dt>flags</dt>
abacc52b 2402 <dd class="description">Media flags</dd>
240214ef 2403<dt>size</dt>
abacc52b 2404 <dd class="description">Media size</dd>
240214ef
MS
2405</dl>
2406<h4 class="returnvalue">Return Value</h4>
abacc52b 2407 <p class="description">Localized string</p>
240214ef 2408<h4 class="discussion">Discussion</h4>
abacc52b 2409 <p class="discussion">The returned string is stored in the destination information and will become
240214ef
MS
2410invalid if the destination information is deleted.
2411
2412</p>
abacc52b
MS
2413<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsLocalizeDestOption">cupsLocalizeDestOption</a></h3>
2414 <p class="description">Get the localized string for a destination
5a9febac
MS
2415option.</p>
2416<p class="code">
abacc52b
MS
2417const char *cupsLocalizeDestOption (<br />
2418&#160;&#160;&#160;&#160;http_t *http,<br />
2419&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
2420&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br />
2421&#160;&#160;&#160;&#160;const char *option<br />
5a9febac
MS
2422);</p>
2423<h4 class="parameters">Parameters</h4>
2424<dl>
2425<dt>http</dt>
abacc52b 2426 <dd class="description">Connection to destination</dd>
5a9febac 2427<dt>dest</dt>
abacc52b 2428 <dd class="description">Destination</dd>
5a9febac 2429<dt>dinfo</dt>
abacc52b 2430 <dd class="description">Destination information</dd>
5a9febac 2431<dt>option</dt>
abacc52b 2432 <dd class="description">Option to localize</dd>
5a9febac
MS
2433</dl>
2434<h4 class="returnvalue">Return Value</h4>
abacc52b 2435 <p class="description">Localized string</p>
5a9febac 2436<h4 class="discussion">Discussion</h4>
abacc52b 2437 <p class="discussion">The returned string is stored in the destination information and will become
5a9febac
MS
2438invalid if the destination information is deleted.
2439
2440</p>
abacc52b
MS
2441<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsLocalizeDestValue">cupsLocalizeDestValue</a></h3>
2442 <p class="description">Get the localized string for a destination
5a9febac
MS
2443option+value pair.</p>
2444<p class="code">
abacc52b
MS
2445const char *cupsLocalizeDestValue (<br />
2446&#160;&#160;&#160;&#160;http_t *http,<br />
2447&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
2448&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br />
2449&#160;&#160;&#160;&#160;const char *option,<br />
2450&#160;&#160;&#160;&#160;const char *value<br />
5a9febac
MS
2451);</p>
2452<h4 class="parameters">Parameters</h4>
2453<dl>
2454<dt>http</dt>
abacc52b 2455 <dd class="description">Connection to destination</dd>
5a9febac 2456<dt>dest</dt>
abacc52b 2457 <dd class="description">Destination</dd>
5a9febac 2458<dt>dinfo</dt>
abacc52b 2459 <dd class="description">Destination information</dd>
5a9febac 2460<dt>option</dt>
abacc52b 2461 <dd class="description">Option to localize</dd>
5a9febac 2462<dt>value</dt>
abacc52b 2463 <dd class="description">Value to localize</dd>
5a9febac
MS
2464</dl>
2465<h4 class="returnvalue">Return Value</h4>
abacc52b 2466 <p class="description">Localized string</p>
5a9febac 2467<h4 class="discussion">Discussion</h4>
abacc52b 2468 <p class="discussion">The returned string is stored in the destination information and will become
5a9febac
MS
2469invalid if the destination information is deleted.
2470
2471</p>
abacc52b
MS
2472<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsNotifySubject">cupsNotifySubject</a></h3>
2473 <p class="description">Return the subject for the given notification message.</p>
5a738aea 2474<p class="code">
abacc52b
MS
2475char *cupsNotifySubject (<br />
2476&#160;&#160;&#160;&#160;cups_lang_t *lang,<br />
2477&#160;&#160;&#160;&#160;ipp_t *event<br />
5a738aea
MS
2478);</p>
2479<h4 class="parameters">Parameters</h4>
2480<dl>
2481<dt>lang</dt>
abacc52b 2482 <dd class="description">Language data</dd>
5a738aea 2483<dt>event</dt>
abacc52b 2484 <dd class="description">Event data</dd>
5a738aea
MS
2485</dl>
2486<h4 class="returnvalue">Return Value</h4>
abacc52b 2487 <p class="description">Subject string or <code>NULL</code></p>
5a738aea 2488<h4 class="discussion">Discussion</h4>
abacc52b 2489 <p class="discussion">The returned string must be freed by the caller using <code>free</code>.
5a738aea
MS
2490
2491</p>
abacc52b
MS
2492<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsNotifyText">cupsNotifyText</a></h3>
2493 <p class="description">Return the text for the given notification message.</p>
5a738aea 2494<p class="code">
abacc52b
MS
2495char *cupsNotifyText (<br />
2496&#160;&#160;&#160;&#160;cups_lang_t *lang,<br />
2497&#160;&#160;&#160;&#160;ipp_t *event<br />
5a738aea
MS
2498);</p>
2499<h4 class="parameters">Parameters</h4>
2500<dl>
2501<dt>lang</dt>
abacc52b 2502 <dd class="description">Language data</dd>
5a738aea 2503<dt>event</dt>
abacc52b 2504 <dd class="description">Event data</dd>
5a738aea
MS
2505</dl>
2506<h4 class="returnvalue">Return Value</h4>
abacc52b 2507 <p class="description">Message text or <code>NULL</code></p>
5a738aea 2508<h4 class="discussion">Discussion</h4>
abacc52b 2509 <p class="discussion">The returned string must be freed by the caller using <code>free</code>.
5a738aea
MS
2510
2511</p>
abacc52b
MS
2512<h3 class="function"><a id="cupsParseOptions">cupsParseOptions</a></h3>
2513 <p class="description">Parse options from a command-line argument.</p>
5a738aea 2514<p class="code">
abacc52b
MS
2515int cupsParseOptions (<br />
2516&#160;&#160;&#160;&#160;const char *arg,<br />
2517&#160;&#160;&#160;&#160;int num_options,<br />
2518&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **options<br />
5a738aea
MS
2519);</p>
2520<h4 class="parameters">Parameters</h4>
2521<dl>
2522<dt>arg</dt>
abacc52b 2523 <dd class="description">Argument to parse</dd>
5a738aea 2524<dt>num_options</dt>
abacc52b 2525 <dd class="description">Number of options</dd>
5a738aea 2526<dt>options</dt>
abacc52b 2527 <dd class="description">Options found</dd>
5a738aea
MS
2528</dl>
2529<h4 class="returnvalue">Return Value</h4>
abacc52b 2530 <p class="description">Number of options found</p>
5a738aea 2531<h4 class="discussion">Discussion</h4>
abacc52b 2532 <p class="discussion">This function converts space-delimited name/value pairs according
ef416fc2 2533to the PAPI text option ABNF specification. Collection values
2534(&quot;name={a=... b=... c=...}&quot;) are stored with the curley brackets
5a738aea
MS
2535intact - use <code>cupsParseOptions</code> on the value to extract the
2536collection attributes.</p>
abacc52b
MS
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>
5a738aea 2539<p class="code">
abacc52b
MS
2540int cupsPrintFile (<br />
2541&#160;&#160;&#160;&#160;const char *name,<br />
2542&#160;&#160;&#160;&#160;const char *filename,<br />
2543&#160;&#160;&#160;&#160;const char *title,<br />
2544&#160;&#160;&#160;&#160;int num_options,<br />
2545&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br />
5a738aea
MS
2546);</p>
2547<h4 class="parameters">Parameters</h4>
2548<dl>
2549<dt>name</dt>
abacc52b 2550 <dd class="description">Destination name</dd>
5a738aea 2551<dt>filename</dt>
abacc52b 2552 <dd class="description">File to print</dd>
5a738aea 2553<dt>title</dt>
abacc52b 2554 <dd class="description">Title of job</dd>
5a738aea 2555<dt>num_options</dt>
abacc52b 2556 <dd class="description">Number of options</dd>
5a738aea 2557<dt>options</dt>
abacc52b 2558 <dd class="description">Options</dd>
5a738aea
MS
2559</dl>
2560<h4 class="returnvalue">Return Value</h4>
abacc52b
MS
2561 <p class="description">Job ID or 0 on error</p>
2562<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsPrintFile2">cupsPrintFile2</a></h3>
2563 <p class="description">Print a file to a printer or class on the specified
5a738aea
MS
2564server.</p>
2565<p class="code">
abacc52b
MS
2566int cupsPrintFile2 (<br />
2567&#160;&#160;&#160;&#160;http_t *http,<br />
2568&#160;&#160;&#160;&#160;const char *name,<br />
2569&#160;&#160;&#160;&#160;const char *filename,<br />
2570&#160;&#160;&#160;&#160;const char *title,<br />
2571&#160;&#160;&#160;&#160;int num_options,<br />
2572&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br />
5a738aea
MS
2573);</p>
2574<h4 class="parameters">Parameters</h4>
2575<dl>
2576<dt>http</dt>
abacc52b 2577 <dd class="description">Connection to server</dd>
5a738aea 2578<dt>name</dt>
abacc52b 2579 <dd class="description">Destination name</dd>
5a738aea 2580<dt>filename</dt>
abacc52b 2581 <dd class="description">File to print</dd>
5a738aea 2582<dt>title</dt>
abacc52b 2583 <dd class="description">Title of job</dd>
5a738aea 2584<dt>num_options</dt>
abacc52b 2585 <dd class="description">Number of options</dd>
5a738aea 2586<dt>options</dt>
abacc52b 2587 <dd class="description">Options</dd>
5a738aea
MS
2588</dl>
2589<h4 class="returnvalue">Return Value</h4>
abacc52b
MS
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
5a738aea
MS
2593default server.</p>
2594<p class="code">
abacc52b
MS
2595int cupsPrintFiles (<br />
2596&#160;&#160;&#160;&#160;const char *name,<br />
2597&#160;&#160;&#160;&#160;int num_files,<br />
2598&#160;&#160;&#160;&#160;const char **files,<br />
2599&#160;&#160;&#160;&#160;const char *title,<br />
2600&#160;&#160;&#160;&#160;int num_options,<br />
2601&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br />
5a738aea
MS
2602);</p>
2603<h4 class="parameters">Parameters</h4>
2604<dl>
2605<dt>name</dt>
abacc52b 2606 <dd class="description">Destination name</dd>
5a738aea 2607<dt>num_files</dt>
abacc52b 2608 <dd class="description">Number of files</dd>
5a738aea 2609<dt>files</dt>
abacc52b 2610 <dd class="description">File(s) to print</dd>
5a738aea 2611<dt>title</dt>
abacc52b 2612 <dd class="description">Title of job</dd>
5a738aea 2613<dt>num_options</dt>
abacc52b 2614 <dd class="description">Number of options</dd>
5a738aea 2615<dt>options</dt>
abacc52b 2616 <dd class="description">Options</dd>
5a738aea
MS
2617</dl>
2618<h4 class="returnvalue">Return Value</h4>
abacc52b
MS
2619 <p class="description">Job ID or 0 on error</p>
2620<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsPrintFiles2">cupsPrintFiles2</a></h3>
2621 <p class="description">Print one or more files to a printer or class on the
5a738aea
MS
2622specified server.</p>
2623<p class="code">
abacc52b
MS
2624int cupsPrintFiles2 (<br />
2625&#160;&#160;&#160;&#160;http_t *http,<br />
2626&#160;&#160;&#160;&#160;const char *name,<br />
2627&#160;&#160;&#160;&#160;int num_files,<br />
2628&#160;&#160;&#160;&#160;const char **files,<br />
2629&#160;&#160;&#160;&#160;const char *title,<br />
2630&#160;&#160;&#160;&#160;int num_options,<br />
2631&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br />
5a738aea
MS
2632);</p>
2633<h4 class="parameters">Parameters</h4>
2634<dl>
2635<dt>http</dt>
abacc52b 2636 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea 2637<dt>name</dt>
abacc52b 2638 <dd class="description">Destination name</dd>
5a738aea 2639<dt>num_files</dt>
abacc52b 2640 <dd class="description">Number of files</dd>
5a738aea 2641<dt>files</dt>
abacc52b 2642 <dd class="description">File(s) to print</dd>
5a738aea 2643<dt>title</dt>
abacc52b 2644 <dd class="description">Title of job</dd>
5a738aea 2645<dt>num_options</dt>
abacc52b 2646 <dd class="description">Number of options</dd>
5a738aea 2647<dt>options</dt>
abacc52b 2648 <dd class="description">Options</dd>
5a738aea
MS
2649</dl>
2650<h4 class="returnvalue">Return Value</h4>
abacc52b
MS
2651 <p class="description">Job ID or 0 on error</p>
2652<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsRemoveDest">cupsRemoveDest</a></h3>
2653 <p class="description">Remove a destination from the destination list.</p>
5a738aea 2654<p class="code">
abacc52b
MS
2655int cupsRemoveDest (<br />
2656&#160;&#160;&#160;&#160;const char *name,<br />
2657&#160;&#160;&#160;&#160;const char *instance,<br />
2658&#160;&#160;&#160;&#160;int num_dests,<br />
2659&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> **dests<br />
5a738aea
MS
2660);</p>
2661<h4 class="parameters">Parameters</h4>
2662<dl>
2663<dt>name</dt>
abacc52b 2664 <dd class="description">Destination name</dd>
5a738aea 2665<dt>instance</dt>
abacc52b 2666 <dd class="description">Instance name or <code>NULL</code></dd>
5a738aea 2667<dt>num_dests</dt>
abacc52b 2668 <dd class="description">Number of destinations</dd>
5a738aea 2669<dt>dests</dt>
abacc52b 2670 <dd class="description">Destinations</dd>
5a738aea
MS
2671</dl>
2672<h4 class="returnvalue">Return Value</h4>
abacc52b 2673 <p class="description">New number of destinations</p>
5a738aea 2674<h4 class="discussion">Discussion</h4>
abacc52b 2675 <p class="discussion">Removing a destination/instance does not delete the class or printer
f7deaa1a 2676queue, merely the lpoptions for that destination/instance. Use the
5a738aea
MS
2677<a href="#cupsSetDests"><code>cupsSetDests</code></a> or <a href="#cupsSetDests2"><code>cupsSetDests2</code></a> functions to save the new
2678options for the user.
2679
2680</p>
abacc52b
MS
2681<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsRemoveOption">cupsRemoveOption</a></h3>
2682 <p class="description">Remove an option from an option array.</p>
5a738aea 2683<p class="code">
abacc52b
MS
2684int cupsRemoveOption (<br />
2685&#160;&#160;&#160;&#160;const char *name,<br />
2686&#160;&#160;&#160;&#160;int num_options,<br />
2687&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **options<br />
5a738aea
MS
2688);</p>
2689<h4 class="parameters">Parameters</h4>
2690<dl>
2691<dt>name</dt>
abacc52b 2692 <dd class="description">Option name</dd>
5a738aea 2693<dt>num_options</dt>
abacc52b 2694 <dd class="description">Current number of options</dd>
5a738aea 2695<dt>options</dt>
abacc52b 2696 <dd class="description">Options</dd>
5a738aea
MS
2697</dl>
2698<h4 class="returnvalue">Return Value</h4>
abacc52b
MS
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>
5a738aea
MS
2702<p class="code">
2703const char *cupsServer (void);</p>
2704<h4 class="returnvalue">Return Value</h4>
abacc52b 2705 <p class="description">Server name</p>
5a738aea 2706<h4 class="discussion">Discussion</h4>
abacc52b 2707 <p class="discussion">The default server comes from the CUPS_SERVER environment variable, then the
aaf19ab0
MS
2708~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not
2709set, the default is the local system - either &quot;localhost&quot; or a domain socket
2710path.<br>
2711<br>
2712The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6
2713address, or a domain socket pathname.<br>
2714<br>
2715Note: The current server is tracked separately for each thread in a program.
2716Multi-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
2718server to be used.</p>
abacc52b
MS
2719<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetClientCertCB">cupsSetClientCertCB</a></h3>
2720 <p class="description">Set the client certificate callback.</p>
10d09e33 2721<p class="code">
abacc52b
MS
2722void cupsSetClientCertCB (<br />
2723&#160;&#160;&#160;&#160;<a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a> cb,<br />
2724&#160;&#160;&#160;&#160;void *user_data<br />
10d09e33
MS
2725);</p>
2726<h4 class="parameters">Parameters</h4>
2727<dl>
2728<dt>cb</dt>
abacc52b 2729 <dd class="description">Callback function</dd>
10d09e33 2730<dt>user_data</dt>
abacc52b 2731 <dd class="description">User data pointer</dd>
10d09e33
MS
2732</dl>
2733<h4 class="discussion">Discussion</h4>
abacc52b 2734 <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
10d09e33
MS
2735<br>
2736Note: The current certificate callback is tracked separately for each thread
2737in a program. Multi-threaded programs that override the callback need to do
2738so in each thread for the same callback to be used.
2739
2740</p>
abacc52b
MS
2741<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetCredentials">cupsSetCredentials</a></h3>
2742 <p class="description">Set the default credentials to be used for SSL/TLS
10d09e33
MS
2743connections.</p>
2744<p class="code">
abacc52b
MS
2745int cupsSetCredentials (<br />
2746&#160;&#160;&#160;&#160;cups_array_t *credentials<br />
10d09e33
MS
2747);</p>
2748<h4 class="parameters">Parameters</h4>
2749<dl>
2750<dt>credentials</dt>
abacc52b 2751 <dd class="description">Array of credentials</dd>
10d09e33
MS
2752</dl>
2753<h4 class="returnvalue">Return Value</h4>
abacc52b 2754 <p class="description">Status of call (0 = success)</p>
10d09e33 2755<h4 class="discussion">Discussion</h4>
abacc52b 2756 <p class="discussion">Note: The default credentials are tracked separately for each thread in a
10d09e33
MS
2757program. Multi-threaded programs that override the setting need to do so in
2758each thread for the same setting to be used.
2759
2760</p>
abacc52b
MS
2761<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsSetDefaultDest">cupsSetDefaultDest</a></h3>
2762 <p class="description">Set the default destination.</p>
5a738aea 2763<p class="code">
abacc52b
MS
2764void cupsSetDefaultDest (<br />
2765&#160;&#160;&#160;&#160;const char *name,<br />
2766&#160;&#160;&#160;&#160;const char *instance,<br />
2767&#160;&#160;&#160;&#160;int num_dests,<br />
2768&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dests<br />
5a738aea
MS
2769);</p>
2770<h4 class="parameters">Parameters</h4>
2771<dl>
2772<dt>name</dt>
abacc52b 2773 <dd class="description">Destination name</dd>
5a738aea 2774<dt>instance</dt>
abacc52b 2775 <dd class="description">Instance name or <code>NULL</code></dd>
5a738aea 2776<dt>num_dests</dt>
abacc52b 2777 <dd class="description">Number of destinations</dd>
5a738aea 2778<dt>dests</dt>
abacc52b 2779 <dd class="description">Destinations</dd>
5a738aea 2780</dl>
abacc52b
MS
2781<h3 class="function"><a id="cupsSetDests">cupsSetDests</a></h3>
2782 <p class="description">Save the list of destinations for the default server.</p>
5a738aea 2783<p class="code">
abacc52b
MS
2784void cupsSetDests (<br />
2785&#160;&#160;&#160;&#160;int num_dests,<br />
2786&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dests<br />
5a738aea
MS
2787);</p>
2788<h4 class="parameters">Parameters</h4>
2789<dl>
2790<dt>num_dests</dt>
abacc52b 2791 <dd class="description">Number of destinations</dd>
5a738aea 2792<dt>dests</dt>
abacc52b 2793 <dd class="description">Destinations</dd>
5a738aea
MS
2794</dl>
2795<h4 class="discussion">Discussion</h4>
abacc52b 2796 <p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run
5a738aea 2797as root and ~/.cups/lpoptions when run as a normal user.</p>
abacc52b
MS
2798<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsSetDests2">cupsSetDests2</a></h3>
2799 <p class="description">Save the list of destinations for the specified server.</p>
5a738aea 2800<p class="code">
abacc52b
MS
2801int cupsSetDests2 (<br />
2802&#160;&#160;&#160;&#160;http_t *http,<br />
2803&#160;&#160;&#160;&#160;int num_dests,<br />
2804&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dests<br />
5a738aea
MS
2805);</p>
2806<h4 class="parameters">Parameters</h4>
2807<dl>
2808<dt>http</dt>
abacc52b 2809 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea 2810<dt>num_dests</dt>
abacc52b 2811 <dd class="description">Number of destinations</dd>
5a738aea 2812<dt>dests</dt>
abacc52b 2813 <dd class="description">Destinations</dd>
5a738aea
MS
2814</dl>
2815<h4 class="returnvalue">Return Value</h4>
abacc52b 2816 <p class="description">0 on success, -1 on error</p>
5a738aea 2817<h4 class="discussion">Discussion</h4>
abacc52b 2818 <p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run
80ca4592 2819as root and ~/.cups/lpoptions when run as a normal user.
ef416fc2 2820
5a738aea 2821</p>
abacc52b
MS
2822<h3 class="function"><a id="cupsSetEncryption">cupsSetEncryption</a></h3>
2823 <p class="description">Set the encryption preference.</p>
5a738aea 2824<p class="code">
abacc52b
MS
2825void cupsSetEncryption (<br />
2826&#160;&#160;&#160;&#160;http_encryption_t e<br />
5a738aea
MS
2827);</p>
2828<h4 class="parameters">Parameters</h4>
2829<dl>
2830<dt>e</dt>
abacc52b 2831 <dd class="description">New encryption preference</dd>
5a738aea 2832</dl>
aaf19ab0 2833<h4 class="discussion">Discussion</h4>
abacc52b 2834 <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
aaf19ab0
MS
2835environment variable, then the ~/.cups/client.conf file, and finally the
2836/etc/cups/client.conf file. If not set, the default is
6961465f 2837<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
aaf19ab0
MS
2838<br>
2839Note: The current encryption setting is tracked separately for each thread
2840in a program. Multi-threaded programs that override the setting need to do
2841so in each thread for the same setting to be used.</p>
abacc52b
MS
2842<h3 class="function"><a id="cupsSetPasswordCB">cupsSetPasswordCB</a></h3>
2843 <p class="description">Set the password callback for CUPS.</p>
5a738aea 2844<p class="code">
abacc52b
MS
2845void cupsSetPasswordCB (<br />
2846&#160;&#160;&#160;&#160;<a href="#cups_password_cb_t">cups_password_cb_t</a> cb<br />
5a738aea
MS
2847);</p>
2848<h4 class="parameters">Parameters</h4>
2849<dl>
2850<dt>cb</dt>
abacc52b 2851 <dd class="description">Callback function</dd>
5a738aea
MS
2852</dl>
2853<h4 class="discussion">Discussion</h4>
abacc52b 2854 <p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which
aaf19ab0
MS
2855reads the password from the console. Programs should call either this
2856function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered
2857by a program per thread.<br>
2858<br>
2859Note: The current password callback is tracked separately for each thread
2860in a program. Multi-threaded programs that override the callback need to do
2861so in each thread for the same callback to be used.</p>
abacc52b
MS
2862<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsSetPasswordCB2">cupsSetPasswordCB2</a></h3>
2863 <p class="description">Set the advanced password callback for CUPS.</p>
f11a948a 2864<p class="code">
abacc52b
MS
2865void cupsSetPasswordCB2 (<br />
2866&#160;&#160;&#160;&#160;<a href="#cups_password_cb2_t">cups_password_cb2_t</a> cb,<br />
2867&#160;&#160;&#160;&#160;void *user_data<br />
f11a948a
MS
2868);</p>
2869<h4 class="parameters">Parameters</h4>
2870<dl>
2871<dt>cb</dt>
abacc52b 2872 <dd class="description">Callback function</dd>
f11a948a 2873<dt>user_data</dt>
abacc52b 2874 <dd class="description">User data pointer</dd>
f11a948a
MS
2875</dl>
2876<h4 class="discussion">Discussion</h4>
abacc52b 2877 <p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which
aaf19ab0
MS
2878reads the password from the console. Programs should call either this
2879function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered
2880by a program per thread.<br>
2881<br>
2882Note: The current password callback is tracked separately for each thread
2883in a program. Multi-threaded programs that override the callback need to do
2884so in each thread for the same callback to be used.
f11a948a
MS
2885
2886</p>
abacc52b
MS
2887<h3 class="function"><a id="cupsSetServer">cupsSetServer</a></h3>
2888 <p class="description">Set the default server name and port.</p>
5a738aea 2889<p class="code">
abacc52b
MS
2890void cupsSetServer (<br />
2891&#160;&#160;&#160;&#160;const char *server<br />
5a738aea
MS
2892);</p>
2893<h4 class="parameters">Parameters</h4>
2894<dl>
2895<dt>server</dt>
abacc52b 2896 <dd class="description">Server name</dd>
5a738aea
MS
2897</dl>
2898<h4 class="discussion">Discussion</h4>
abacc52b 2899 <p class="discussion">The &quot;server&quot; string can be a fully-qualified hostname, a numeric
aaf19ab0
MS
2900IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP
2901addresses can be optionally followed by a colon and port number to override
2902the default port 631, e.g. &quot;hostname:8631&quot;. Pass <code>NULL</code> to restore the
2903default server name and port.<br>
2904<br>
2905Note: The current server is tracked separately for each thread in a program.
2906Multi-threaded programs that override the server need to do so in each
2907thread for the same server to be used.</p>
abacc52b
MS
2908<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetServerCertCB">cupsSetServerCertCB</a></h3>
2909 <p class="description">Set the server certificate callback.</p>
10d09e33 2910<p class="code">
abacc52b
MS
2911void cupsSetServerCertCB (<br />
2912&#160;&#160;&#160;&#160;<a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a> cb,<br />
2913&#160;&#160;&#160;&#160;void *user_data<br />
10d09e33
MS
2914);</p>
2915<h4 class="parameters">Parameters</h4>
2916<dl>
2917<dt>cb</dt>
abacc52b 2918 <dd class="description">Callback function</dd>
10d09e33 2919<dt>user_data</dt>
abacc52b 2920 <dd class="description">User data pointer</dd>
10d09e33
MS
2921</dl>
2922<h4 class="discussion">Discussion</h4>
abacc52b 2923 <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
10d09e33
MS
2924<br>
2925Note: The current credentials callback is tracked separately for each thread
2926in a program. Multi-threaded programs that override the callback need to do
2927so in each thread for the same callback to be used.
2928
2929</p>
abacc52b
MS
2930<h3 class="function"><a id="cupsSetUser">cupsSetUser</a></h3>
2931 <p class="description">Set the default user name.</p>
5a738aea 2932<p class="code">
abacc52b
MS
2933void cupsSetUser (<br />
2934&#160;&#160;&#160;&#160;const char *user<br />
5a738aea
MS
2935);</p>
2936<h4 class="parameters">Parameters</h4>
2937<dl>
2938<dt>user</dt>
abacc52b 2939 <dd class="description">User name</dd>
5a738aea
MS
2940</dl>
2941<h4 class="discussion">Discussion</h4>
abacc52b 2942 <p class="discussion">Pass <code>NULL</code> to restore the default user name.<br>
aaf19ab0
MS
2943<br>
2944Note: The current user name is tracked separately for each thread in a
2945program. Multi-threaded programs that override the user name need to do so
2946in each thread for the same user name to be used.</p>
abacc52b
MS
2947<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsSetUserAgent">cupsSetUserAgent</a></h3>
2948 <p class="description">Set the default HTTP User-Agent string.</p>
db8b865d 2949<p class="code">
abacc52b
MS
2950void cupsSetUserAgent (<br />
2951&#160;&#160;&#160;&#160;const char *user_agent<br />
db8b865d
MS
2952);</p>
2953<h4 class="parameters">Parameters</h4>
2954<dl>
2955<dt>user_agent</dt>
abacc52b 2956 <dd class="description">User-Agent string or <code>NULL</code></dd>
db8b865d
MS
2957</dl>
2958<h4 class="discussion">Discussion</h4>
abacc52b 2959 <p class="discussion">Setting the string to NULL forces the default value containing the CUPS
db8b865d
MS
2960version, IPP version, and operating system version and architecture.
2961
2962</p>
abacc52b
MS
2963<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsStartDestDocument">cupsStartDestDocument</a></h3>
2964 <p class="description">Start a new document.</p>
5a9febac 2965<p class="code">
abacc52b
MS
2966http_status_t cupsStartDestDocument (<br />
2967&#160;&#160;&#160;&#160;http_t *http,<br />
2968&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br />
2969&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *info,<br />
2970&#160;&#160;&#160;&#160;int job_id,<br />
2971&#160;&#160;&#160;&#160;const char *docname,<br />
2972&#160;&#160;&#160;&#160;const char *format,<br />
2973&#160;&#160;&#160;&#160;int num_options,<br />
2974&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options,<br />
2975&#160;&#160;&#160;&#160;int last_document<br />
5a9febac
MS
2976);</p>
2977<h4 class="parameters">Parameters</h4>
2978<dl>
2979<dt>http</dt>
abacc52b 2980 <dd class="description">Connection to destination</dd>
5a9febac 2981<dt>dest</dt>
abacc52b 2982 <dd class="description">Destination</dd>
5a9febac 2983<dt>info</dt>
abacc52b 2984 <dd class="description">Destination information</dd>
5a9febac 2985<dt>job_id</dt>
abacc52b 2986 <dd class="description">Job ID</dd>
5a9febac 2987<dt>docname</dt>
abacc52b 2988 <dd class="description">Document name</dd>
5a9febac 2989<dt>format</dt>
abacc52b 2990 <dd class="description">Document format</dd>
5a9febac 2991<dt>num_options</dt>
abacc52b 2992 <dd class="description">Number of document options</dd>
5a9febac 2993<dt>options</dt>
abacc52b 2994 <dd class="description">Document options</dd>
5a9febac 2995<dt>last_document</dt>
abacc52b 2996 <dd class="description">1 if this is the last document</dd>
5a9febac
MS
2997</dl>
2998<h4 class="returnvalue">Return Value</h4>
abacc52b 2999 <p class="description">Status of document creation</p>
5a9febac 3000<h4 class="discussion">Discussion</h4>
abacc52b 3001 <p class="discussion">&quot;job_id&quot; is the job ID returned by cupsCreateDestJob. &quot;docname&quot; is the name
5a9febac
MS
3002of the document/file being printed, &quot;format&quot; is the MIME media type for the
3003document (see CUPS_FORMAT_xxx constants), and &quot;num_options&quot; and &quot;options&quot;
3004are the options do be applied to the document. &quot;last_document&quot; should be 1
3005if this is the last document to be submitted in the job. Returns
3006<code>HTTP_CONTINUE</code> on success.
3007
3008</p>
abacc52b
MS
3009<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsStartDocument">cupsStartDocument</a></h3>
3010 <p class="description">Add a document to a job created with cupsCreateJob().</p>
5a738aea 3011<p class="code">
abacc52b
MS
3012http_status_t cupsStartDocument (<br />
3013&#160;&#160;&#160;&#160;http_t *http,<br />
3014&#160;&#160;&#160;&#160;const char *name,<br />
3015&#160;&#160;&#160;&#160;int job_id,<br />
3016&#160;&#160;&#160;&#160;const char *docname,<br />
3017&#160;&#160;&#160;&#160;const char *format,<br />
3018&#160;&#160;&#160;&#160;int last_document<br />
5a738aea
MS
3019);</p>
3020<h4 class="parameters">Parameters</h4>
3021<dl>
3022<dt>http</dt>
abacc52b 3023 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea 3024<dt>name</dt>
abacc52b 3025 <dd class="description">Destination name</dd>
5a738aea 3026<dt>job_id</dt>
abacc52b 3027 <dd class="description">Job ID from <a href="#cupsCreateJob"><code>cupsCreateJob</code></a></dd>
5a738aea 3028<dt>docname</dt>
abacc52b 3029 <dd class="description">Name of document</dd>
5a738aea 3030<dt>format</dt>
abacc52b 3031 <dd class="description">MIME type or <code>CUPS_FORMAT_foo</code></dd>
5a738aea 3032<dt>last_document</dt>
abacc52b 3033 <dd class="description">1 for last document in job, 0 otherwise</dd>
5a738aea
MS
3034</dl>
3035<h4 class="returnvalue">Return Value</h4>
abacc52b 3036 <p class="description">HTTP status of request</p>
5a738aea 3037<h4 class="discussion">Discussion</h4>
abacc52b 3038 <p class="discussion">Use <a href="#cupsWriteRequestData"><code>cupsWriteRequestData</code></a> to write data for the document and
5a738aea
MS
3039<a href="#cupsFinishDocument"><code>cupsFinishDocument</code></a> to finish the document and get the submission status.<br>
3040<br>
3041The 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 &quot;format&quot; argument, although
3044any supported MIME type string can be supplied.
bc44d920 3045
5a738aea 3046</p>
abacc52b
MS
3047<h3 class="function"><a id="cupsTempFd">cupsTempFd</a></h3>
3048 <p class="description">Creates a temporary file.</p>
5a738aea 3049<p class="code">
abacc52b
MS
3050int cupsTempFd (<br />
3051&#160;&#160;&#160;&#160;char *filename,<br />
3052&#160;&#160;&#160;&#160;int len<br />
5a738aea
MS
3053);</p>
3054<h4 class="parameters">Parameters</h4>
3055<dl>
3056<dt>filename</dt>
abacc52b 3057 <dd class="description">Pointer to buffer</dd>
5a738aea 3058<dt>len</dt>
abacc52b 3059 <dd class="description">Size of buffer</dd>
5a738aea
MS
3060</dl>
3061<h4 class="returnvalue">Return Value</h4>
abacc52b 3062 <p class="description">New file descriptor or -1 on error</p>
5a738aea 3063<h4 class="discussion">Discussion</h4>
abacc52b 3064 <p class="discussion">The temporary filename is returned in the filename buffer.
5a738aea 3065The temporary file is opened for reading and writing.</p>
abacc52b
MS
3066<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="cupsTempFile">cupsTempFile</a></h3>
3067 <p class="description">Generates a temporary filename.</p>
5a738aea 3068<p class="code">
abacc52b
MS
3069char *cupsTempFile (<br />
3070&#160;&#160;&#160;&#160;char *filename,<br />
3071&#160;&#160;&#160;&#160;int len<br />
5a738aea
MS
3072);</p>
3073<h4 class="parameters">Parameters</h4>
3074<dl>
3075<dt>filename</dt>
abacc52b 3076 <dd class="description">Pointer to buffer</dd>
5a738aea 3077<dt>len</dt>
abacc52b 3078 <dd class="description">Size of buffer</dd>
5a738aea
MS
3079</dl>
3080<h4 class="returnvalue">Return Value</h4>
abacc52b 3081 <p class="description">Filename or <code>NULL</code> on error</p>
5a738aea 3082<h4 class="discussion">Discussion</h4>
abacc52b 3083 <p class="discussion">The temporary filename is returned in the filename buffer.
240214ef
MS
3084This function is deprecated and will no longer generate a temporary
3085filename - use <a href="#cupsTempFd"><code>cupsTempFd</code></a> or <a href="#cupsTempFile2"><code>cupsTempFile2</code></a> instead.
ef416fc2 3086
5a738aea 3087</p>
abacc52b
MS
3088<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsTempFile2">cupsTempFile2</a></h3>
3089 <p class="description">Creates a temporary CUPS file.</p>
5a738aea 3090<p class="code">
abacc52b
MS
3091cups_file_t *cupsTempFile2 (<br />
3092&#160;&#160;&#160;&#160;char *filename,<br />
3093&#160;&#160;&#160;&#160;int len<br />
5a738aea
MS
3094);</p>
3095<h4 class="parameters">Parameters</h4>
3096<dl>
3097<dt>filename</dt>
abacc52b 3098 <dd class="description">Pointer to buffer</dd>
5a738aea 3099<dt>len</dt>
abacc52b 3100 <dd class="description">Size of buffer</dd>
5a738aea
MS
3101</dl>
3102<h4 class="returnvalue">Return Value</h4>
abacc52b 3103 <p class="description">CUPS file or <code>NULL</code> on error</p>
5a738aea 3104<h4 class="discussion">Discussion</h4>
abacc52b 3105 <p class="discussion">The temporary filename is returned in the filename buffer.
5a738aea 3106The temporary file is opened for writing.
bc44d920 3107
5a738aea 3108</p>
abacc52b
MS
3109<h3 class="function"><a id="cupsUser">cupsUser</a></h3>
3110 <p class="description">Return the current user's name.</p>
5a738aea
MS
3111<p class="code">
3112const char *cupsUser (void);</p>
3113<h4 class="returnvalue">Return Value</h4>
abacc52b 3114 <p class="description">User name</p>
aaf19ab0 3115<h4 class="discussion">Discussion</h4>
abacc52b 3116 <p class="discussion">Note: The current user name is tracked separately for each thread in a
aaf19ab0
MS
3117program. 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
3119name to be used.</p>
abacc52b
MS
3120<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsUserAgent">cupsUserAgent</a></h3>
3121 <p class="description">Return the default HTTP User-Agent string.</p>
db8b865d
MS
3122<p class="code">
3123const char *cupsUserAgent (void);</p>
3124<h4 class="returnvalue">Return Value</h4>
abacc52b
MS
3125 <p class="description">User-Agent string</p>
3126<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="pwgFormatSizeName">pwgFormatSizeName</a></h3>
3127 <p class="description">Generate a PWG self-describing media size name.</p>
6961465f 3128<p class="code">
abacc52b
MS
3129int pwgFormatSizeName (<br />
3130&#160;&#160;&#160;&#160;char *keyword,<br />
3131&#160;&#160;&#160;&#160;size_t keysize,<br />
3132&#160;&#160;&#160;&#160;const char *prefix,<br />
3133&#160;&#160;&#160;&#160;const char *name,<br />
3134&#160;&#160;&#160;&#160;int width,<br />
3135&#160;&#160;&#160;&#160;int length,<br />
3136&#160;&#160;&#160;&#160;const char *units<br />
6961465f
MS
3137);</p>
3138<h4 class="parameters">Parameters</h4>
3139<dl>
3140<dt>keyword</dt>
abacc52b 3141 <dd class="description">Keyword buffer</dd>
6961465f 3142<dt>keysize</dt>
abacc52b 3143 <dd class="description">Size of keyword buffer</dd>
6961465f 3144<dt>prefix</dt>
abacc52b 3145 <dd class="description">Prefix for PWG size or <code>NULL</code> for automatic</dd>
6961465f 3146<dt>name</dt>
abacc52b 3147 <dd class="description">Size name or <code>NULL</code></dd>
6961465f 3148<dt>width</dt>
abacc52b 3149 <dd class="description">Width of page in 2540ths</dd>
6961465f 3150<dt>length</dt>
abacc52b 3151 <dd class="description">Length of page in 2540ths</dd>
6961465f 3152<dt>units</dt>
abacc52b 3153 <dd class="description">Units - &quot;in&quot;, &quot;mm&quot;, or <code>NULL</code> for automatic</dd>
6961465f
MS
3154</dl>
3155<h4 class="returnvalue">Return Value</h4>
abacc52b 3156 <p class="description">1 on success, 0 on failure</p>
6961465f 3157<h4 class="discussion">Discussion</h4>
abacc52b 3158 <p class="discussion">This function generates a PWG self-describing media size name of the form
6961465f
MS
3159&quot;prefix_name_WIDTHxLENGTHunits&quot;. The prefix is typically &quot;custom&quot; or &quot;roll&quot;
3160for user-supplied sizes but can also be &quot;disc&quot;, &quot;iso&quot;, &quot;jis&quot;, &quot;jpn&quot;, &quot;na&quot;,
3161&quot;oe&quot;, &quot;om&quot;, &quot;prc&quot;, or &quot;roc&quot;. A value of <code>NULL</code> automatically chooses
3162&quot;oe&quot; or &quot;om&quot; depending on the units.<br>
3163<br>
3164The size name may only contain lowercase letters, numbers, &quot;-&quot;, and &quot;.&quot;. If
3165<code>NULL</code> is passed, the size name will contain the formatted dimensions.<br>
3166<br>
3167The width and length are specified in hundredths of millimeters, equivalent
3168to 1/100000th of a meter or 1/2540th of an inch. The width, length, and
3169units used for the generated size name are calculated automatically if the
3170units string is <code>NULL</code>, otherwise inches (&quot;in&quot;) or millimeters (&quot;mm&quot;)
3171are used.
3172
3173</p>
abacc52b
MS
3174<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="pwgInitSize">pwgInitSize</a></h3>
3175 <p class="description">Initialize a pwg_size_t structure using IPP Job Template
6961465f
MS
3176attributes.</p>
3177<p class="code">
abacc52b
MS
3178int pwgInitSize (<br />
3179&#160;&#160;&#160;&#160;<a href="#pwg_size_t">pwg_size_t</a> *size,<br />
3180&#160;&#160;&#160;&#160;ipp_t *job,<br />
3181&#160;&#160;&#160;&#160;int *margins_set<br />
6961465f
MS
3182);</p>
3183<h4 class="parameters">Parameters</h4>
3184<dl>
3185<dt>size</dt>
abacc52b 3186 <dd class="description">Size to initialize</dd>
6961465f 3187<dt>job</dt>
abacc52b 3188 <dd class="description">Job template attributes</dd>
6961465f 3189<dt>margins_set</dt>
abacc52b 3190 <dd class="description">1 if margins were set, 0 otherwise</dd>
6961465f
MS
3191</dl>
3192<h4 class="returnvalue">Return Value</h4>
abacc52b 3193 <p class="description">1 if size was initialized, 0 otherwise</p>
6961465f 3194<h4 class="discussion">Discussion</h4>
abacc52b 3195 <p class="discussion">This function initializes a pwg_size_t structure from an IPP &quot;media&quot; or
6961465f
MS
3196&quot;media-col&quot; attribute in the specified IPP message. 0 is returned if neither
3197attribute is found in the message or the values are not valid.<br>
3198<br>
3199The &quot;margins_set&quot; variable is initialized to 1 if any &quot;media-xxx-margin&quot;
3200member attribute was specified in the &quot;media-col&quot; Job Template attribute,
3201otherwise it is initialized to 0.
3202
3203</p>
abacc52b
MS
3204<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="pwgMediaForLegacy">pwgMediaForLegacy</a></h3>
3205 <p class="description">Find a PWG media size by ISO/IPP legacy name.</p>
6961465f 3206<p class="code">
abacc52b
MS
3207<a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForLegacy (<br />
3208&#160;&#160;&#160;&#160;const char *legacy<br />
6961465f
MS
3209);</p>
3210<h4 class="parameters">Parameters</h4>
3211<dl>
3212<dt>legacy</dt>
abacc52b 3213 <dd class="description">Legacy size name</dd>
6961465f
MS
3214</dl>
3215<h4 class="returnvalue">Return Value</h4>
abacc52b 3216 <p class="description">Matching size or NULL</p>
6961465f 3217<h4 class="discussion">Discussion</h4>
abacc52b 3218 <p class="discussion">The &quot;name&quot; argument specifies the legacy ISO media size name, for example
6961465f
MS
3219&quot;iso-a4&quot; or &quot;na-letter&quot;.
3220
3221</p>
abacc52b
MS
3222<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="pwgMediaForPPD">pwgMediaForPPD</a></h3>
3223 <p class="description">Find a PWG media size by Adobe PPD name.</p>
6961465f 3224<p class="code">
abacc52b
MS
3225<a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForPPD (<br />
3226&#160;&#160;&#160;&#160;const char *ppd<br />
6961465f
MS
3227);</p>
3228<h4 class="parameters">Parameters</h4>
3229<dl>
3230<dt>ppd</dt>
abacc52b 3231 <dd class="description">PPD size name</dd>
6961465f
MS
3232</dl>
3233<h4 class="returnvalue">Return Value</h4>
abacc52b 3234 <p class="description">Matching size or NULL</p>
6961465f 3235<h4 class="discussion">Discussion</h4>
abacc52b 3236 <p class="discussion">The &quot;ppd&quot; argument specifies an Adobe page size name as defined in Table B.1
6961465f
MS
3237of the Adobe PostScript Printer Description File Format Specification Version
32384.3.<br>
3239<br>
3240If the name is non-standard, the returned PWG media size is stored in
3241thread-local storage and is overwritten by each call to the function in the
3242thread. Custom names can be of the form &quot;Custom.WIDTHxLENGTH[units]&quot; or
3243&quot;WIDTHxLENGTH[units]&quot;.
3244
3245</p>
abacc52b
MS
3246<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="pwgMediaForPWG">pwgMediaForPWG</a></h3>
3247 <p class="description">Find a PWG media size by 5101.1 self-describing name.</p>
6961465f 3248<p class="code">
abacc52b
MS
3249<a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForPWG (<br />
3250&#160;&#160;&#160;&#160;const char *pwg<br />
6961465f
MS
3251);</p>
3252<h4 class="parameters">Parameters</h4>
3253<dl>
3254<dt>pwg</dt>
abacc52b 3255 <dd class="description">PWG size name</dd>
6961465f
MS
3256</dl>
3257<h4 class="returnvalue">Return Value</h4>
abacc52b 3258 <p class="description">Matching size or NULL</p>
6961465f 3259<h4 class="discussion">Discussion</h4>
abacc52b 3260 <p class="discussion">The &quot;pwg&quot; argument specifies a self-describing media size name of the form
6961465f
MS
3261&quot;prefix_name_WIDTHxLENGTHunits&quot; as defined in PWG 5101.1.<br>
3262<br>
3263If the name is non-standard, the returned PWG media size is stored in
3264thread-local storage and is overwritten by each call to the function in the
3265thread.
3266
3267</p>
abacc52b
MS
3268<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="pwgMediaForSize">pwgMediaForSize</a></h3>
3269 <p class="description">Get the PWG media size for the given dimensions.</p>
6961465f 3270<p class="code">
abacc52b
MS
3271<a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForSize (<br />
3272&#160;&#160;&#160;&#160;int width,<br />
3273&#160;&#160;&#160;&#160;int length<br />
6961465f
MS
3274);</p>
3275<h4 class="parameters">Parameters</h4>
3276<dl>
3277<dt>width</dt>
abacc52b 3278 <dd class="description">Width in hundredths of millimeters</dd>
6961465f 3279<dt>length</dt>
abacc52b 3280 <dd class="description">Length in hundredths of millimeters</dd>
6961465f
MS
3281</dl>
3282<h4 class="returnvalue">Return Value</h4>
abacc52b 3283 <p class="description">PWG media name</p>
6961465f 3284<h4 class="discussion">Discussion</h4>
abacc52b 3285 <p class="discussion">The &quot;width&quot; and &quot;length&quot; are in hundredths of millimeters, equivalent to
6961465f
MS
32861/100000th of a meter or 1/2540th of an inch.<br>
3287<br>
3288If the dimensions are non-standard, the returned PWG media size is stored in
3289thread-local storage and is overwritten by each call to the function in the
3290thread.
3291
3292</p>
abacc52b
MS
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">&#160;CUPS 1.5/macOS 10.7&#160;</span>cups_client_cert_cb_t</a></h3>
3295 <p class="description">Client credentials callback
3e7fe0ca 3296</p>
abacc52b 3297 <p class="code">
10d09e33
MS
3298typedef int (*cups_client_cert_cb_t)(http_t *http, void *tls, cups_array_t *distinguished_names, void *user_data);
3299</p>
abacc52b
MS
3300 <h3 class="typedef"><a id="cups_dest_block_t"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span>cups_dest_block_t</a></h3>
3301 <p class="description">Destination enumeration block
3e7fe0ca 3302</p>
abacc52b 3303 <p class="code">
3e7fe0ca
MS
3304typedef int (*cups_dest_block_t(unsigned flags, <a href="#cups_dest_t">cups_dest_t</a> *dest);
3305</p>
abacc52b
MS
3306 <h3 class="typedef"><a id="cups_dest_cb_t"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span>cups_dest_cb_t</a></h3>
3307 <p class="description">Destination enumeration callback
3e7fe0ca 3308</p>
abacc52b 3309 <p class="code">
3e7fe0ca
MS
3310typedef int (*cups_dest_cb_t)(void *user_data, unsigned flags, <a href="#cups_dest_t">cups_dest_t</a> *dest);
3311</p>
abacc52b
MS
3312 <h3 class="typedef"><a id="cups_dest_t">cups_dest_t</a></h3>
3313 <p class="description">Destination</p>
3314 <p class="code">
5a738aea
MS
3315typedef struct <a href="#cups_dest_s">cups_dest_s</a> cups_dest_t;
3316</p>
abacc52b
MS
3317 <h3 class="typedef"><a id="cups_dinfo_t"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span>cups_dinfo_t</a></h3>
3318 <p class="description">Destination capability and status
3e7fe0ca 3319information </p>
abacc52b 3320 <p class="code">
3e7fe0ca
MS
3321typedef struct _cups_dinfo_s cups_dinfo_t;
3322</p>
abacc52b
MS
3323 <h3 class="typedef"><a id="cups_job_t">cups_job_t</a></h3>
3324 <p class="description">Job</p>
3325 <p class="code">
5a738aea
MS
3326typedef struct <a href="#cups_job_s">cups_job_s</a> cups_job_t;
3327</p>
abacc52b
MS
3328 <h3 class="typedef"><a id="cups_option_t">cups_option_t</a></h3>
3329 <p class="description">Printer Options</p>
3330 <p class="code">
5a738aea
MS
3331typedef struct <a href="#cups_option_s">cups_option_s</a> cups_option_t;
3332</p>
abacc52b
MS
3333 <h3 class="typedef"><a id="cups_password_cb2_t"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span>cups_password_cb2_t</a></h3>
3334 <p class="description">New password callback
3e7fe0ca 3335</p>
abacc52b 3336 <p class="code">
f11a948a
MS
3337typedef const char *(*cups_password_cb2_t)(const char *prompt, http_t *http, const char *method, const char *resource, void *user_data);
3338</p>
abacc52b
MS
3339 <h3 class="typedef"><a id="cups_password_cb_t">cups_password_cb_t</a></h3>
3340 <p class="description">Password callback</p>
3341 <p class="code">
ae71f5de 3342typedef const char *(*cups_password_cb_t)(const char *prompt);
5a738aea 3343</p>
abacc52b
MS
3344 <h3 class="typedef"><a id="cups_ptype_t">cups_ptype_t</a></h3>
3345 <p class="description">Printer type/capability bits</p>
3346 <p class="code">
ef416fc2 3347typedef unsigned cups_ptype_t;
5a738aea 3348</p>
abacc52b
MS
3349 <h3 class="typedef"><a id="cups_server_cert_cb_t"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span>cups_server_cert_cb_t</a></h3>
3350 <p class="description">Server credentials callback
3e7fe0ca 3351</p>
abacc52b 3352 <p class="code">
10d09e33
MS
3353typedef int (*cups_server_cert_cb_t)(http_t *http, void *tls, cups_array_t *certs, void *user_data);
3354</p>
abacc52b
MS
3355 <h3 class="typedef"><a id="cups_size_t"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span>cups_size_t</a></h3>
3356 <p class="description">Media Size </p>
3357 <p class="code">
3e7fe0ca
MS
3358typedef struct <a href="#cups_size_s">cups_size_s</a> cups_size_t;
3359</p>
abacc52b
MS
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>
3362 <p class="code">
6961465f
MS
3363typedef struct <a href="#pwg_map_s">pwg_map_s</a> pwg_map_t;
3364</p>
abacc52b
MS
3365 <h3 class="typedef"><a id="pwg_media_t">pwg_media_t</a></h3>
3366 <p class="description">Common media size data</p>
3367 <p class="code">
6961465f
MS
3368typedef struct <a href="#pwg_media_s">pwg_media_s</a> pwg_media_t;
3369</p>
abacc52b
MS
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>
3372 <p class="code">
6961465f
MS
3373typedef struct <a href="#pwg_size_s">pwg_size_s</a> pwg_size_t;
3374</p>
abacc52b
MS
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&#160;&#160;&#160;&#160;char *name, *instance;<br />
3380&#160;&#160;&#160;&#160;int is_default;<br />
3381&#160;&#160;&#160;&#160;int num_options;<br />
3382&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options;<br />
5a738aea
MS
3383};</p>
3384<h4 class="members">Members</h4>
3385<dl>
3386<dt>instance </dt>
abacc52b 3387 <dd class="description">Local instance name or NULL</dd>
5a738aea 3388<dt>is_default </dt>
abacc52b 3389 <dd class="description">Is this printer the default?</dd>
5a738aea 3390<dt>num_options </dt>
abacc52b 3391 <dd class="description">Number of options</dd>
5a738aea 3392<dt>options </dt>
abacc52b
MS
3393 <dd class="description">Options</dd>
3394</dl>
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&#160;&#160;&#160;&#160;time_t completed_time;<br />
3399&#160;&#160;&#160;&#160;time_t creation_time;<br />
3400&#160;&#160;&#160;&#160;char *dest;<br />
3401&#160;&#160;&#160;&#160;char *format;<br />
3402&#160;&#160;&#160;&#160;int id;<br />
3403&#160;&#160;&#160;&#160;int priority;<br />
3404&#160;&#160;&#160;&#160;time_t processing_time;<br />
3405&#160;&#160;&#160;&#160;int size;<br />
3406&#160;&#160;&#160;&#160;ipp_jstate_t state;<br />
3407&#160;&#160;&#160;&#160;char *title;<br />
3408&#160;&#160;&#160;&#160;char *user;<br />
5a738aea
MS
3409};</p>
3410<h4 class="members">Members</h4>
3411<dl>
3412<dt>completed_time </dt>
abacc52b 3413 <dd class="description">Time the job was completed</dd>
5a738aea 3414<dt>creation_time </dt>
abacc52b 3415 <dd class="description">Time the job was created</dd>
5a738aea 3416<dt>dest </dt>
abacc52b 3417 <dd class="description">Printer or class name</dd>
5a738aea 3418<dt>format </dt>
abacc52b 3419 <dd class="description">Document format</dd>
5a738aea 3420<dt>id </dt>
abacc52b 3421 <dd class="description">The job ID</dd>
5a738aea 3422<dt>priority </dt>
abacc52b 3423 <dd class="description">Priority (1-100)</dd>
5a738aea 3424<dt>processing_time </dt>
abacc52b 3425 <dd class="description">Time the job was processed</dd>
5a738aea 3426<dt>size </dt>
abacc52b 3427 <dd class="description">Size in kilobytes</dd>
5a738aea 3428<dt>state </dt>
abacc52b 3429 <dd class="description">Job state</dd>
5a738aea 3430<dt>title </dt>
abacc52b 3431 <dd class="description">Title/job name</dd>
5a738aea 3432<dt>user </dt>
abacc52b 3433 <dd class="description">User the submitted the job</dd>
5a738aea 3434</dl>
abacc52b
MS
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&#160;&#160;&#160;&#160;char *name;<br />
3439&#160;&#160;&#160;&#160;char *value;<br />
5a738aea
MS
3440};</p>
3441<h4 class="members">Members</h4>
3442<dl>
3443<dt>name </dt>
abacc52b 3444 <dd class="description">Name of option</dd>
5a738aea 3445<dt>value </dt>
abacc52b 3446 <dd class="description">Value of option</dd>
5a738aea 3447</dl>
abacc52b
MS
3448<h3 class="struct"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</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&#160;&#160;&#160;&#160;char media[128];<br />
3452&#160;&#160;&#160;&#160;int width, length, bottom, left, right, top;<br />
3e7fe0ca
MS
3453};</p>
3454<h4 class="members">Members</h4>
3455<dl>
3456<dt>media[128] </dt>
abacc52b 3457 <dd class="description">Media name to use</dd>
3e7fe0ca 3458<dt>top </dt>
abacc52b 3459 <dd class="description">Top margin in hundredths of
3e7fe0ca
MS
3460millimeters</dd>
3461</dl>
abacc52b
MS
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&#160;&#160;&#160;&#160;_cups_dnssd_data_t *data;<br />
3466&#160;&#160;&#160;&#160;else if(val 0) data - got_data;<br />
3467&#160;&#160;&#160;&#160;void) timeout;<br />
3468&#160;&#160;&#160;&#160;int val;<br />
a29fd7dd
MS
3469};</p>
3470<h4 class="members">Members</h4>
3471<dl>
3472<dt>data </dt>
abacc52b 3473 <dd class="description">Enumeration data</dd>
a29fd7dd
MS
3474<dt>got_data </dt>
3475<dt>timeout </dt>
3476<dt>val </dt>
abacc52b 3477 <dd class="description">Return value</dd>
a29fd7dd 3478</dl>
abacc52b
MS
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&#160;&#160;&#160;&#160;char *pwg, *ppd;<br />
6961465f
MS
3483};</p>
3484<h4 class="members">Members</h4>
3485<dl>
3486<dt>ppd </dt>
abacc52b 3487 <dd class="description">PPD option keyword</dd>
6961465f 3488</dl>
abacc52b
MS
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&#160;&#160;&#160;&#160;int width, length;<br />
3493&#160;&#160;&#160;&#160;const char *pwg, *legacy, *ppd;<br />
6961465f
MS
3494};</p>
3495<h4 class="members">Members</h4>
3496<dl>
3497<dt>length </dt>
abacc52b 3498 <dd class="description">Length in 2540ths</dd>
6961465f 3499<dt>ppd </dt>
abacc52b 3500 <dd class="description">Standard Adobe PPD name</dd>
6961465f 3501</dl>
abacc52b
MS
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&#160;&#160;&#160;&#160;<a href="#pwg_map_t">pwg_map_t</a> map;<br />
3506&#160;&#160;&#160;&#160;int width, length, left, bottom, right, top;<br />
6961465f
MS
3507};</p>
3508<h4 class="members">Members</h4>
3509<dl>
3510<dt>map </dt>
abacc52b 3511 <dd class="description">Map element</dd>
6961465f 3512<dt>top </dt>
abacc52b 3513 <dd class="description">Top margin in 2540ths</dd>
6961465f 3514</dl>
abacc52b
MS
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
22c9029b 3518locale ID.</p>
abacc52b
MS
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
3e7fe0ca 3523constants</p>
abacc52b
MS
3524 <h4 class="constants">Constants</h4>
3525 <dl>
3526 <dt>CUPS_PRINTER_AUTHENTICATED <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
3527 <dd class="description">Printer requires authentication
3e7fe0ca 3528</dd>
abacc52b
MS
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&amp;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">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
3540 <dd class="description">Printer supports maintenance commands
3e7fe0ca 3541</dd>
abacc52b
MS
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">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
3549 <dd class="description">Delete printer
3e7fe0ca 3550</dd>
abacc52b
MS
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">&#160;CUPS 1.4/macOS 10.6&#160;</span></dt>
3562 <dd class="description">Printer with scanning capabilities
3e7fe0ca 3563</dd>
abacc52b
MS
3564 <dt>CUPS_PRINTER_NOT_SHARED <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
3565 <dd class="description">Printer is not shared
3e7fe0ca 3566</dd>
abacc52b
MS
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">&#160;CUPS 1.4/macOS 10.6&#160;</span></dt>
3574 <dd class="description">Scanner-only device
3e7fe0ca 3575</dd>
abacc52b
MS
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>
3584</dl>
3585 </div>
3586 </body>
ef416fc2 3587</html>