]>
Commit | Line | Data |
---|---|---|
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 |
12 | BODY { |
13 | font-family: lucida grande, geneva, helvetica, arial, sans-serif; | |
14 | } | |
15 | ||
16 | H1, H2, H3, H4, H5, H6, P, TD, TH { | |
17 | font-family: lucida grande, geneva, helvetica, arial, sans-serif; | |
18 | } | |
19 | ||
20 | KBD { | |
21 | font-family: monaco, courier, monospace; | |
22 | font-weight: bold; | |
23 | } | |
24 | ||
25 | PRE { | |
26 | font-family: monaco, courier, monospace; | |
27 | } | |
28 | ||
29 | PRE.command { | |
10d09e33 | 30 | border: dotted thin #7f7f7f; |
5a738aea | 31 | margin-left: 36pt; |
10d09e33 | 32 | padding: 10px; |
5a738aea MS |
33 | } |
34 | ||
f11a948a MS |
35 | P.compact { |
36 | margin: 0; | |
37 | } | |
38 | ||
e4572d57 MS |
39 | P.example { |
40 | font-style: italic; | |
41 | margin-left: 36pt; | |
42 | } | |
ca6b43fc | 43 | |
240214ef MS |
44 | DL.man DD { |
45 | margin-left: 5em; | |
46 | } | |
47 | ||
48 | DL.man DT { | |
49 | margin-left: 0; | |
50 | } | |
51 | ||
52 | PRE.man { | |
53 | margin: 0; | |
54 | } | |
55 | ||
5a738aea MS |
56 | PRE.example { |
57 | background: #eeeeee; | |
58 | border: dotted thin #999999; | |
59 | margin-left: 36pt; | |
178cb736 | 60 | padding: 10pt; |
5a738aea MS |
61 | } |
62 | ||
63 | PRE.command EM, PRE.example EM { | |
64 | font-family: lucida grande, geneva, helvetica, arial, sans-serif; | |
65 | } | |
66 | ||
67 | P.command { | |
68 | font-family: monaco, courier, monospace; | |
69 | margin-left: 36pt; | |
70 | } | |
71 | ||
72 | P.formula { | |
73 | font-style: italic; | |
74 | margin-left: 36pt; | |
75 | } | |
76 | ||
77 | BLOCKQUOTE { | |
178cb736 | 78 | background: #eeeeee; |
5a738aea MS |
79 | border: solid thin #999999; |
80 | padding: 10pt; | |
81 | } | |
82 | ||
e4572d57 MS |
83 | A IMG { |
84 | border: none; | |
85 | } | |
86 | ||
87 | A:link:hover IMG { | |
88 | background: #f0f0f0; | |
89 | border-radius: 10px; | |
90 | -moz-border-radius: 10px; | |
91 | } | |
92 | ||
5a738aea | 93 | A:link, A:visited { |
ca6b43fc | 94 | font-weight: inherit; |
5a738aea | 95 | text-decoration: none; |
5a738aea MS |
96 | } |
97 | ||
98 | A:link:hover, A:visited:hover, A:active { | |
99 | text-decoration: underline; | |
5a738aea MS |
100 | } |
101 | ||
102 | SUB, SUP { | |
103 | font-size: 50%; | |
104 | } | |
105 | ||
e4572d57 MS |
106 | TR.data, TD.data, TR.data TD { |
107 | margin-top: 10pt; | |
108 | padding: 5pt; | |
109 | border-bottom: solid 1pt #999999; | |
110 | } | |
111 | ||
112 | TR.data TH { | |
113 | border-bottom: solid 1pt #999999; | |
114 | padding-top: 10pt; | |
115 | padding-left: 5pt; | |
116 | text-align: left; | |
117 | } | |
118 | ||
5a738aea MS |
119 | DIV.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 | ||
127 | DIV.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 | ||
136 | DIV.table TABLE TD { | |
137 | border: solid thin #cccccc; | |
138 | padding-top: 5pt; | |
139 | } | |
140 | ||
141 | DIV.table TABLE TH { | |
142 | background: #cccccc; | |
143 | border: none; | |
144 | border-bottom: solid thin #999999; | |
145 | } | |
146 | ||
147 | DIV.figure TABLE { | |
148 | margin-left: auto; | |
149 | margin-right: auto; | |
150 | } | |
151 | ||
152 | DIV.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 | ||
161 | TH.label { | |
5a738aea MS |
162 | text-align: right; |
163 | vertical-align: top; | |
164 | } | |
165 | ||
e4572d57 MS |
166 | TH.sublabel { |
167 | text-align: right; | |
168 | font-weight: normal; | |
169 | } | |
170 | ||
5a738aea MS |
171 | HR { |
172 | border: solid thin; | |
173 | } | |
174 | ||
175 | SPAN.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 | ||
185 | H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { | |
186 | float: right; | |
187 | font-size: 100%; | |
188 | } | |
189 | ||
178cb736 MS |
190 | H1.title { |
191 | } | |
192 | ||
5a738aea MS |
193 | H2.title, H3.title { |
194 | border-bottom: solid 2pt #000000; | |
195 | } | |
196 | ||
e4572d57 MS |
197 | DIV.indent, TABLE.indent { |
198 | margin-top: 2em; | |
199 | margin-left: auto; | |
200 | margin-right: auto; | |
201 | width: 90%; | |
202 | } | |
203 | ||
204 | TABLE.indent { | |
205 | border-collapse: collapse; | |
206 | } | |
207 | ||
208 | TABLE.indent TD, TABLE.indent TH { | |
209 | padding: 0; | |
210 | } | |
211 | ||
212 | TABLE.list { | |
213 | border-collapse: collapse; | |
214 | margin-left: auto; | |
215 | margin-right: auto; | |
216 | width: 90%; | |
217 | } | |
218 | ||
219 | TABLE.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 | ||
230 | TABLE.list TH A { | |
231 | color: #4444cc; | |
232 | } | |
233 | ||
234 | TABLE.list TD { | |
235 | border-bottom: solid thin #eeeeee; | |
236 | padding-top: 5pt; | |
237 | padding-left: 5pt; | |
238 | } | |
239 | ||
240 | TABLE.list TR:nth-child(even) { | |
241 | background: #f8f8f8; | |
242 | } | |
243 | ||
244 | TABLE.list TR:nth-child(odd) { | |
245 | background: #f4f4f4; | |
246 | } | |
247 | ||
5a738aea MS |
248 | DT { |
249 | margin-left: 36pt; | |
250 | margin-top: 12pt; | |
251 | } | |
252 | ||
253 | DD { | |
254 | margin-left: 54pt; | |
255 | } | |
256 | ||
257 | DL.category DT { | |
258 | font-weight: bold; | |
259 | } | |
260 | ||
261 | P.summary { | |
262 | margin-left: 36pt; | |
263 | font-family: monaco, courier, monospace; | |
264 | } | |
265 | ||
5a738aea MS |
266 | DIV.summary TABLE { |
267 | border: solid thin #999999; | |
268 | border-collapse: collapse; | |
269 | border-spacing: 0; | |
270 | margin: 10px; | |
271 | } | |
272 | ||
273 | DIV.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 | ||
280 | DIV.summary TABLE THEAD TH { | |
281 | background: #eeeeee; | |
282 | } | |
283 | ||
284 | /* API documentation styles... */ | |
285 | div.body h1 { | |
286 | margin: 0; | |
287 | } | |
288 | div.body h2 { | |
289 | margin-top: 1.5em; | |
290 | } | |
291 | div.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 | } | |
303 | code, p.code, pre, ul.code li { | |
304 | font-family: monaco, courier, monospace; | |
305 | font-size: 90%; | |
306 | } | |
307 | ul.code, ul.contents, ul.subcontents { | |
308 | list-style-type: none; | |
309 | margin: 0; | |
310 | padding-left: 0; | |
311 | } | |
312 | ul.code li { | |
313 | margin: 0; | |
314 | } | |
315 | ul.contents > li { | |
316 | margin-top: 1em; | |
317 | } | |
318 | ul.contents li ul.code, ul.contents li ul.subcontents { | |
319 | padding-left: 2em; | |
320 | } | |
321 | div.body dl { | |
322 | margin-left: 0; | |
323 | margin-top: 0; | |
324 | } | |
325 | div.body dt { | |
326 | font-style: italic; | |
327 | margin-left: 0; | |
328 | margin-top: 0; | |
329 | } | |
330 | div.body dd { | |
331 | margin-bottom: 0.5em; | |
332 | } | |
333 | ||
334 | /* This is just for the HTML files generated with the framedhelp target */ | |
335 | div.contents { | |
336 | background: #e8e8e8; | |
337 | border: solid thin black; | |
338 | padding: 10px; | |
339 | } | |
340 | div.contents h1 { | |
341 | font-size: 110%; | |
342 | } | |
343 | div.contents h2 { | |
344 | font-size: 100%; | |
345 | } | |
346 | div.contents ul.contents { | |
347 | font-size: 80%; | |
348 | } | |
ac884b6a MS |
349 | div.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 | |
551 | applications, filters, printer drivers, and backends that need to interface | |
552 | with 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 | |
557 | clients (applications) to communicate with a server (the scheduler) to get a | |
558 | list of printers, send print jobs, and so forth. You identify which server | |
559 | you want to communicate with using a pointer to the opaque structure | |
560 | <code>http_t</code>. All of the examples in this document use the | |
561 | <code>CUPS_HTTP_DEFAULT</code> constant, referring to the default connection | |
562 | to the scheduler. The <a href='api-httpipp.html' target='_top'>HTTP and IPP | |
563 | APIs</a> document provides more information on server connections.</p> | |
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 |
568 | the <a href="#cups_dest_t"><code>cups_dest_t</code></a> structure which | |
569 | includes the name (<code>name</code>), instance (<code>instance</code> - | |
568fa3fa MS |
570 | a way of selecting certain saved options/settings), and the options and |
571 | attributes 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 | |
574 | using the <a href='#cupsFreeDests'><code>cupsFreeDests</code></a> function. | |
575 | The <a href='#cupsGetDest'><code>cupsGetDest</code></a> function finds a | |
576 | specific destination for printing:</p> | |
ef416fc2 | 577 | |
5a738aea MS |
578 | <pre class='example'> |
579 | #include <cups/cups.h> | |
ef416fc2 | 580 | |
5a738aea MS |
581 | <a href='#cups_dest_t'>cups_dest_t</a> *dests; |
582 | int num_dests = <a href='#cupsGetDests'>cupsGetDests</a>(&dests); | |
583 | <a href='#cups_dest_t'>cups_dest_t</a> *dest = <a href='#cupsGetDest'>cupsGetDest</a>("name", NULL, num_dests, dests); | |
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 | |
592 | will return the default destination. Similarly, passing a <code>NULL</code> | |
593 | instance 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 | |
660 | option has a name (<code>name</code>) and value (<code>value</code>) | |
661 | associated with it. The <a href='#cups_dest_t'><code>cups_dest_t</code></a> | |
662 | <code>num_options</code> and <code>options</code> members contain the | |
663 | default options for a particular destination, along with several informational | |
664 | attributes about the destination as shown in <a href='#TABLE1'>Table 1</a>. | |
665 | The <a href='#cupsGetOption'><code>cupsGetOption</code></a> function gets | |
666 | the value for the named option. For example, the following code lists the | |
667 | available destinations and their human-readable descriptions:</p> | |
668 | ||
669 | <pre class='example'> | |
670 | #include <cups/cups.h> | |
671 | ||
672 | <a href='#cups_dest_t'>cups_dest_t</a> *dests; | |
673 | int num_dests = <a href='#cupsGetDests'>cupsGetDests</a>(&dests); | |
674 | <a href='#cups_dest_t'>cups_dest_t</a> *dest; | |
675 | int i; | |
676 | const char *value; | |
677 | ||
678 | for (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 | |
690 | adds a single named option to an array:</p> | |
691 | ||
692 | <pre class='example'> | |
693 | #include <cups/cups.h> | |
694 | ||
695 | int 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 */ | |
699 | num_options = <a href='#cupsAddOption'>cupsAddOption</a>("first", "value", num_options, &options); | |
700 | ||
701 | /* This adds a second option value */ | |
702 | num_options = <a href='#cupsAddOption'>cupsAddOption</a>("second", "value", num_options, &options); | |
703 | ||
704 | /* This replaces the first option we added */ | |
705 | num_options = <a href='#cupsAddOption'>cupsAddOption</a>("first", "new value", num_options, &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 <cups/cups.h> | |
712 | ||
713 | int i; | |
714 | int 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 | 718 | for (i = 0; i < 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, &options); | |
5a738aea MS |
721 | </pre> |
722 | ||
723 | <p>Use the <a href='#cupsFreeOptions'><code>cupsFreeOptions</code></a> | |
724 | function to free the options array when you are done using it:</p> | |
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 | |
733 | 2<sup>31</sup>-1 and have options and one or more files for printing to a | |
734 | single destination. The <a href='#cupsPrintFile'><code>cupsPrintFile</code></a> | |
735 | function creates a new job with one file. The following code prints the CUPS | |
736 | test page file:</p> | |
737 | ||
738 | <pre class='example'> | |
739 | #include <cups/cups.h> | |
740 | ||
741 | <a href='#cups_dest_t'>cups_dest_t</a> *dest; | |
742 | int num_options; | |
743 | <a href='#cups_option_t'>cups_option_t</a> *options; | |
744 | int job_id; | |
745 | ||
746 | /* Print a single file */ | |
568fa3fa MS |
747 | job_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 | |
752 | creates a job with multiple files. The files are provided in a | |
753 | <code>char *</code> array:</p> | |
754 | ||
755 | <pre class='example'> | |
756 | #include <cups/cups.h> | |
757 | ||
758 | <a href='#cups_dest_t'>cups_dest_t</a> *dest; | |
759 | int num_options; | |
760 | <a href='#cups_option_t'>cups_option_t</a> *options; | |
761 | int job_id; | |
762 | char *files[3] = { "file1.pdf", "file2.pdf", "file3.pdf" }; | |
763 | ||
764 | /* Print three files */ | |
765 | job_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> | |
769 | function 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>, |
772 | and <a href='#cupsFinishDocument'><code>cupsFinishDocument</code></a> functions. | |
773 | The following example creates a job with 10 text files for printing:</p> | |
774 | ||
775 | <pre class='example'> | |
776 | #include <cups/cups.h> | |
777 | ||
778 | <a href='#cups_dest_t'>cups_dest_t</a> *dest; | |
779 | int num_options; | |
780 | <a href='#cups_option_t'>cups_option_t</a> *options; | |
781 | int job_id; | |
782 | int i; | |
783 | char buffer[1024]; | |
784 | ||
785 | /* Create the job */ | |
568fa3fa MS |
786 | job_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 */ | |
790 | if (job_id > 0) | |
791 | { | |
792 | for (i = 1; i <= 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 | |
817 | an array of <a href='#cups_job_t'><code>cups_job_t</code></a> structures. | |
818 | Each contains the job ID (<code>id</code>), destination name | |
819 | (<code>dest</code>), title (<code>title</code>), and other information | |
820 | associated with the job. The job array is freed using the | |
821 | <a href='#cupsFreeJobs'><code>cupsFreeJobs</code></a> function. The following | |
822 | example monitors a specific job ID, showing the current job state once every | |
823 | 5 seconds until the job is completed:</p> | |
824 | ||
825 | <pre class='example'> | |
826 | #include <cups/cups.h> | |
827 | ||
828 | <a href='#cups_dest_t'>cups_dest_t</a> *dest; | |
829 | int job_id; | |
830 | int num_jobs; | |
831 | <a href='#cups_job_t'>cups_job_t</a> *jobs; | |
832 | int i; | |
833 | ipp_jstate_t job_state = IPP_JOB_PENDING; | |
7374e9e5 | 834 | |
5a738aea MS |
835 | while (job_state < IPP_JOB_STOPPED) |
836 | { | |
837 | /* Get my jobs (1) with any state (-1) */ | |
838 | num_jobs = <a href='#cupsGetJobs'>cupsGetJobs</a>(&jobs, dest->name, 1, -1); | |
839 | ||
840 | /* Loop to find my job */ | |
841 | job_state = IPP_JOB_COMPLETED; | |
842 | ||
843 | for (i = 0; i < 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 < 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 | |
887 | job ID:</p> | |
888 | ||
568fa3fa | 889 | <pre class='example'> |
5a738aea MS |
890 | #include <cups/cups.h> |
891 | ||
892 | <a href='#cups_dest_t'>cups_dest_t</a> *dest; | |
893 | int 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 | |
901 | that error can be found by calling the | |
902 | <a href='#cupsLastError'><code>cupsLastError</code></a> and | |
903 | <a href='#cupsLastErrorString'><code>cupsLastErrorString</code></a> functions. | |
904 | <a href='#cupsLastError'><code>cupsLastError</code></a> returns the last IPP | |
905 | error code | |
906 | (<a href='api-httpipp.html#ipp_status_t'><code>ipp_status_t</code></a>) | |
907 | that was encountered, while | |
908 | <a href='#cupsLastErrorString'><code>cupsLastErrorString</code></a> returns | |
909 | a (localized) human-readable string that can be shown to the user. For example, | |
910 | if any of the job creation functions returns a job ID of 0, you can use | |
911 | <a href='#cupsLastErrorString'><code>cupsLastErrorString</code></a> to show | |
912 | the reason why the job could not be created:</p> | |
913 | ||
914 | <pre class='example'> | |
915 | #include <cups/cups.h> | |
916 | ||
917 | int job_id; | |
918 | ||
919 | if (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 | |
926 | jobs. The default mechanism for getting the username and password is to use the | |
927 | login user and a password from the console.</p> | |
928 | ||
929 | <p>To support other types of applications, in particular Graphical User | |
930 | Interfaces ("GUIs"), the CUPS API provides functions to set the default | |
931 | username and to register a callback function that returns a password string.</p> | |
932 | ||
933 | <p>The <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a> | |
934 | function is used to set a password callback in your program. Only one | |
935 | function can be used at any time.</p> | |
936 | ||
937 | <p>The <a href="#cupsSetUser"><code>cupsSetUser</code></a> function sets the | |
938 | current username for authentication. This function can be called by your | |
939 | password callback function to change the current username as needed.</p> | |
940 | ||
941 | <p>The following example shows a simple password callback that gets a | |
942 | username and password from the user:</p> | |
943 | ||
944 | <pre class='example'> | |
945 | #include <cups/cups.h> | |
946 | ||
947 | const char * | |
948 | my_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 | |
973 | fields for the username and password. The username should default to the | |
974 | string returned by the <a href="#cupsUser"><code>cupsUser</code></a> | |
975 | function.</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 |
980 | int cupsAddDest (<br /> |
981 |     const char *name,<br /> | |
982 |     const char *instance,<br /> | |
983 |     int num_dests,<br /> | |
984 |     <a href="#cups_dest_t">cups_dest_t</a> **dests<br /> | |
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 | 1001 | it only adds a new container of saved options for the named |
5a738aea MS |
1002 | destination or instance.<br> |
1003 | <br> | |
1004 | If the named destination already exists, the destination list is | |
2abf387c | 1005 | returned unchanged. Adding a new instance of a destination creates |
5a738aea MS |
1006 | a copy of that destination's options.<br> |
1007 | <br> | |
1008 | Use the <a href="#cupsSaveDests"><code>cupsSaveDests</code></a> function to save the updated list of | |
1009 | destinations to the user's lpoptions file.</p> | |
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 |
1013 | int cupsAddOption (<br /> |
1014 |     const char *name,<br /> | |
1015 |     const char *value,<br /> | |
1016 |     int num_options,<br /> | |
1017 |     <a href="#cups_option_t">cups_option_t</a> **options<br /> | |
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 | "num_options" parameter.</p> |
abacc52b MS |
1035 | <h3 class="function"><span class="info"> DEPRECATED </span><a id="cupsAdminCreateWindowsPPD">cupsAdminCreateWindowsPPD</a></h3> |
1036 | <p class="description">Create the Windows PPD file for a printer.</p> | |
426c6a59 | 1037 | <p class="code"> |
abacc52b MS |
1038 | char *cupsAdminCreateWindowsPPD (<br /> |
1039 |     http_t *http,<br /> | |
1040 |     const char *dest,<br /> | |
1041 |     char *buffer,<br /> | |
1042 |     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"> DEPRECATED </span><a id="cupsAdminExportSamba">cupsAdminExportSamba</a></h3> | |
1058 | <p class="description">Export a printer to Samba.</p> | |
426c6a59 | 1059 | <p class="code"> |
abacc52b MS |
1060 | int cupsAdminExportSamba (<br /> |
1061 |     const char *dest,<br /> | |
1062 |     const char *ppd,<br /> | |
1063 |     const char *samba_server,<br /> | |
1064 |     const char *samba_user,<br /> | |
1065 |     const char *samba_password,<br /> | |
1066 |     FILE *logfile<br /> | |
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"> CUPS 1.3/macOS 10.5 </span><a id="cupsAdminGetServerSettings">cupsAdminGetServerSettings</a></h3> | |
1086 | <p class="description">Get settings from the server.</p> | |
426c6a59 | 1087 | <p class="code"> |
abacc52b MS |
1088 | int cupsAdminGetServerSettings (<br /> |
1089 |     http_t *http,<br /> | |
1090 |     int *num_settings,<br /> | |
1091 |     <a href="#cups_option_t">cups_option_t</a> **settings<br /> | |
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 |
1106 | you are done with them. |
1107 | ||
1108 | </p> | |
abacc52b MS |
1109 | <h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="cupsAdminSetServerSettings">cupsAdminSetServerSettings</a></h3> |
1110 | <p class="description">Set settings on the server.</p> | |
426c6a59 | 1111 | <p class="code"> |
abacc52b MS |
1112 | int cupsAdminSetServerSettings (<br /> |
1113 |     http_t *http,<br /> | |
1114 |     int num_settings,<br /> | |
1115 |     <a href="#cups_option_t">cups_option_t</a> *settings<br /> | |
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 |
1131 | ipp_status_t cupsCancelDestJob (<br /> |
1132 |     http_t *http,<br /> | |
1133 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
1134 |     int job_id<br /> | |
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 "job_id" is the number returned by cupsCreateDestJob.<br> | |
5a9febac | 1148 | <br> |
503b54c9 MS |
1149 | Returns <code>IPP_STATUS_OK</code> on success and |
1150 | <code>IPP_STATUS_ERRPR_NOT_AUTHORIZED</code> or | |
1151 | <code>IPP_STATUS_ERROR_FORBIDDEN</code> on failure. | |
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 |
1157 | int cupsCancelJob (<br /> |
1158 |     const char *name,<br /> | |
1159 |     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 |
1172 | to cancel the current job on the named destination.<br> |
1173 | <br> | |
1174 | Use the <a href="#cupsLastError"><code>cupsLastError</code></a> and <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> functions to get | |
1175 | the cause of any failure.</p> | |
abacc52b MS |
1176 | <h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsCancelJob2">cupsCancelJob2</a></h3> |
1177 | <p class="description">Cancel or purge a print job.</p> | |
5a738aea | 1178 | <p class="code"> |
abacc52b MS |
1179 | ipp_status_t cupsCancelJob2 (<br /> |
1180 |     http_t *http,<br /> | |
1181 |     const char *name,<br /> | |
1182 |     int job_id,<br /> | |
1183 |     int purge<br /> | |
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 |
1200 | from the job history.<br> |
1201 | <br> | |
1202 | Pass <code>CUPS_JOBID_ALL</code> to cancel all jobs or <code>CUPS_JOBID_CURRENT</code> | |
1203 | to cancel the current job on the named destination.<br> | |
1204 | <br> | |
1205 | Use the <a href="#cupsLastError"><code>cupsLastError</code></a> and <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> functions to get | |
bc44d920 | 1206 | the cause of any failure. |
5a738aea | 1207 | |
5a9febac | 1208 | </p> |
abacc52b MS |
1209 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCheckDestSupported">cupsCheckDestSupported</a></h3> |
1210 | <p class="description">Check that the option and value are supported | |
5a9febac MS |
1211 | by the destination.</p> |
1212 | <p class="code"> | |
abacc52b MS |
1213 | int cupsCheckDestSupported (<br /> |
1214 |     http_t *http,<br /> | |
1215 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
1216 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br /> | |
1217 |     const char *option,<br /> | |
1218 |     const char *value<br /> | |
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"> CUPS 1.6/macOS 10.8 </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 |
1242 | ipp_status_t cupsCloseDestJob (<br /> |
1243 |     http_t *http,<br /> | |
1244 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
1245 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *info,<br /> | |
1246 |     int job_id<br /> | |
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 "last_document". |
6961465f | 1263 | "job_id" is the job ID returned by cupsCreateDestJob. Returns <code>IPP_STATUS_OK</code> |
5a9febac MS |
1264 | on success. |
1265 | ||
3e7fe0ca | 1266 | </p> |
abacc52b MS |
1267 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsConnectDest">cupsConnectDest</a></h3> |
1268 | <p class="description">Connect to the server for a destination.</p> | |
3e7fe0ca | 1269 | <p class="code"> |
abacc52b MS |
1270 | http_t *cupsConnectDest (<br /> |
1271 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
1272 |     unsigned flags,<br /> | |
1273 |     int msec,<br /> | |
1274 |     int *cancel,<br /> | |
1275 |     char *resource,<br /> | |
1276 |     size_t resourcesize,<br /> | |
1277 |     <a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb,<br /> | |
1278 |     void *user_data<br /> | |
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 "cancel" 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 |
1303 | optionally the resource path to use for the destination. These calls will |
1304 | block until a connection is made, the timeout expires, the integer pointed | |
1305 | to by "cancel" is non-zero, or the callback function (or block) returns 0, | |
1306 | The caller is responsible for calling httpClose() on the returned object. | |
1307 | ||
1308 | </p> | |
abacc52b MS |
1309 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsConnectDestBlock">cupsConnectDestBlock</a></h3> |
1310 | <p class="description">Connect to the server for a destination.</p> | |
3e7fe0ca | 1311 | <p class="code"> |
abacc52b MS |
1312 | http_t *cupsConnectDestBlock (<br /> |
1313 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
1314 |     unsigned flags,<br /> | |
1315 |     int msec,<br /> | |
1316 |     int *cancel,<br /> | |
1317 |     char *resource,<br /> | |
1318 |     size_t resourcesize,<br /> | |
1319 |     <a href="#cups_dest_block_t">cups_dest_block_t</a> block<br /> | |
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 "cancel" 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 |
1342 | optionally the resource path to use for the destination. These calls will |
1343 | block until a connection is made, the timeout expires, the integer pointed | |
1344 | to by "cancel" is non-zero, or the callback function (or block) returns 0, | |
1345 | The caller is responsible for calling httpClose() on the returned object. | |
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 |
1351 | int cupsCopyDest (<br /> |
1352 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
1353 |     int num_dests,<br /> | |
1354 |     <a href="#cups_dest_t">cups_dest_t</a> **dests<br /> | |
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 |
1365 | copy) - for use with the cupsEnumDests* functions. The caller is responsible |
1366 | for calling cupsFreeDests() on the returned object(s). | |
1367 | ||
5a9febac | 1368 | </p> |
abacc52b MS |
1369 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCopyDestConflicts">cupsCopyDestConflicts</a></h3> |
1370 | <p class="description">Get conflicts and resolutions for a new | |
5a9febac MS |
1371 | option/value pair.</p> |
1372 | <p class="code"> | |
abacc52b MS |
1373 | int cupsCopyDestConflicts (<br /> |
1374 |     http_t *http,<br /> | |
1375 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
1376 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br /> | |
1377 |     int num_options,<br /> | |
1378 |     <a href="#cups_option_t">cups_option_t</a> *options,<br /> | |
1379 |     const char *new_option,<br /> | |
1380 |     const char *new_value,<br /> | |
1381 |     int *num_conflicts,<br /> | |
1382 |     <a href="#cups_option_t">cups_option_t</a> **conflicts,<br /> | |
1383 |     int *num_resolved,<br /> | |
1384 |     <a href="#cups_option_t">cups_option_t</a> **resolved<br /> | |
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">"num_options" and "options" represent the currently selected options by the |
5a9febac MS |
1415 | user. "new_option" and "new_value" are the setting the user has just |
1416 | changed.<br> | |
1417 | <br> | |
1418 | Returns 1 if there is a conflict, 0 if there are no conflicts, and -1 if | |
1419 | there was an unrecoverable error such as a resolver loop.<br> | |
1420 | <br> | |
1421 | If "num_conflicts" and "conflicts" are not <code>NULL</code>, they are set to | |
1422 | contain the list of conflicting option/value pairs. Similarly, if | |
1423 | "num_resolved" and "resolved" are not <code>NULL</code> they will be set to the | |
1424 | list of changes needed to resolve the conflict.<br> | |
1425 | <br> | |
1426 | If cupsCopyDestConflicts returns 1 but "num_resolved" and "resolved" are set | |
1427 | to 0 and <code>NULL</code>, respectively, then the conflict cannot be resolved. | |
1428 | ||
1429 | </p> | |
abacc52b MS |
1430 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCopyDestInfo">cupsCopyDestInfo</a></h3> |
1431 | <p class="description">Get the supported values/capabilities for the | |
5a9febac MS |
1432 | destination.</p> |
1433 | <p class="code"> | |
abacc52b MS |
1434 | <a href="#cups_dinfo_t">cups_dinfo_t</a> *cupsCopyDestInfo (<br /> |
1435 |     http_t *http,<br /> | |
1436 |     <a href="#cups_dest_t">cups_dest_t</a> *dest<br /> | |
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 |
1449 | value. <code>NULL</code> is returned on error. |
1450 | ||
1451 | </p> | |
abacc52b MS |
1452 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCreateDestJob">cupsCreateDestJob</a></h3> |
1453 | <p class="description">Create a job on a destination.</p> | |
5a9febac | 1454 | <p class="code"> |
abacc52b MS |
1455 | ipp_status_t cupsCreateDestJob (<br /> |
1456 |     http_t *http,<br /> | |
1457 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
1458 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *info,<br /> | |
1459 |     int *job_id,<br /> | |
1460 |     const char *title,<br /> | |
1461 |     int num_options,<br /> | |
1462 |     <a href="#cups_option_t">cups_option_t</a> *options<br /> | |
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 |
1485 | in the variable pointed to by "job_id". |
1486 | ||
5a738aea | 1487 | </p> |
abacc52b MS |
1488 | <h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsCreateJob">cupsCreateJob</a></h3> |
1489 | <p class="description">Create an empty job for streaming.</p> | |
5a738aea | 1490 | <p class="code"> |
abacc52b MS |
1491 | int cupsCreateJob (<br /> |
1492 |     http_t *http,<br /> | |
1493 |     const char *name,<br /> | |
1494 |     const char *title,<br /> | |
1495 |     int num_options,<br /> | |
1496 |     <a href="#cups_option_t">cups_option_t</a> *options<br /> | |
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 | |
1517 | print, use the <a href="#cupsPrintFile2"><code>cupsPrintFile2</code></a> or <a href="#cupsPrintFiles2"><code>cupsPrintFiles2</code></a> function | |
1518 | instead. | |
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"> |
1524 | http_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 | 1529 | environment 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> |
1533 | Note: The current encryption setting is tracked separately for each thread | |
1534 | in a program. Multi-threaded programs that override the setting via the | |
1535 | <a href="#cupsSetEncryption"><code>cupsSetEncryption</code></a> function need to do so in each thread for the same | |
1536 | setting to be used.</p> | |
abacc52b MS |
1537 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsEnumDests">cupsEnumDests</a></h3> |
1538 | <p class="description">Enumerate available destinations with a callback function.</p> | |
3e7fe0ca | 1539 | <p class="code"> |
abacc52b MS |
1540 | int cupsEnumDests (<br /> |
1541 |     unsigned flags,<br /> | |
1542 |     int msec,<br /> | |
1543 |     int *cancel,<br /> | |
1544 |     <a href="#cups_ptype_t">cups_ptype_t</a> type,<br /> | |
1545 |     <a href="#cups_ptype_t">cups_ptype_t</a> mask,<br /> | |
1546 |     <a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb,<br /> | |
1547 |     void *user_data<br /> | |
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 "cancel" 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 |
1571 | receives the <code>user_data</code> pointer, destination name, instance, number of |
1572 | options, and options which can be used as input to the <a href="#cupsAddDest"><code>cupsAddDest</code></a> | |
1573 | function. The function must return 1 to continue enumeration or 0 to stop.<br> | |
1574 | <br> | |
1575 | Enumeration happens on the current thread and does not return until all | |
1576 | destinations have been enumerated or the callback function returns 0. | |
1577 | ||
1578 | </p> | |
abacc52b MS |
1579 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsEnumDestsBlock">cupsEnumDestsBlock</a></h3> |
1580 | <p class="description">Enumerate available destinations with a block.</p> | |
3e7fe0ca | 1581 | <p class="code"> |
abacc52b MS |
1582 | int cupsEnumDestsBlock (<br /> |
1583 |     unsigned flags,<br /> | |
1584 |     int timeout,<br /> | |
1585 |     int *cancel,<br /> | |
1586 |     <a href="#cups_ptype_t">cups_ptype_t</a> type,<br /> | |
1587 |     <a href="#cups_ptype_t">cups_ptype_t</a> mask,<br /> | |
1588 |     <a href="#cups_dest_block_t">cups_dest_block_t</a> block<br /> | |
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 "cancel" 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 |
1609 | destination name, instance, number of options, and options which can be used |
1610 | as input to the <a href="#cupsAddDest"><code>cupsAddDest</code></a> function. The block must return 1 to | |
1611 | continue enumeration or 0 to stop.<br> | |
1612 | <br> | |
1613 | Enumeration happens on the current thread and does not return until all | |
1614 | destinations have been enumerated or the block returns 0. | |
1615 | ||
6961465f | 1616 | </p> |
abacc52b MS |
1617 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsFindDestDefault">cupsFindDestDefault</a></h3> |
1618 | <p class="description">Find the default value(s) for the given option.</p> | |
6961465f | 1619 | <p class="code"> |
abacc52b MS |
1620 | ipp_attribute_t *cupsFindDestDefault (<br /> |
1621 |     http_t *http,<br /> | |
1622 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
1623 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br /> | |
1624 |     const char *option<br /> | |
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> | |
1644 | functions to inspect the default value(s) as needed. | |
1645 | ||
1646 | </p> | |
abacc52b MS |
1647 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsFindDestReady">cupsFindDestReady</a></h3> |
1648 | <p class="description">Find the default value(s) for the given option.</p> | |
6961465f | 1649 | <p class="code"> |
abacc52b MS |
1650 | ipp_attribute_t *cupsFindDestReady (<br /> |
1651 |     http_t *http,<br /> | |
1652 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
1653 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br /> | |
1654 |     const char *option<br /> | |
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> | |
1674 | functions to inspect the default value(s) as needed. | |
1675 | ||
1676 | </p> | |
abacc52b MS |
1677 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsFindDestSupported">cupsFindDestSupported</a></h3> |
1678 | <p class="description">Find the default value(s) for the given option.</p> | |
6961465f | 1679 | <p class="code"> |
abacc52b MS |
1680 | ipp_attribute_t *cupsFindDestSupported (<br /> |
1681 |     http_t *http,<br /> | |
1682 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
1683 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br /> | |
1684 |     const char *option<br /> | |
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> | |
1704 | functions to inspect the default value(s) as needed. | |
1705 | ||
5a9febac | 1706 | </p> |
abacc52b MS |
1707 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsFinishDestDocument">cupsFinishDestDocument</a></h3> |
1708 | <p class="description">Finish the current document.</p> | |
5a9febac | 1709 | <p class="code"> |
abacc52b MS |
1710 | ipp_status_t cupsFinishDestDocument (<br /> |
1711 |     http_t *http,<br /> | |
1712 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
1713 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *info<br /> | |
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"> CUPS 1.4/macOS 10.6 </span><a id="cupsFinishDocument">cupsFinishDocument</a></h3> |
1731 | <p class="description">Finish sending a document.</p> | |
5a738aea | 1732 | <p class="code"> |
abacc52b MS |
1733 | ipp_status_t cupsFinishDocument (<br /> |
1734 |     http_t *http,<br /> | |
1735 |     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 |
1754 | void cupsFreeDestInfo (<br /> |
1755 |     <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 |
1765 | void cupsFreeDests (<br /> |
1766 |     int num_dests,<br /> | |
1767 |     <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 |
1779 | void cupsFreeJobs (<br /> |
1780 |     int num_jobs,<br /> | |
1781 |     <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 |
1793 | void cupsFreeOptions (<br /> |
1794 |     int num_options,<br /> | |
1795 |     <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"> DEPRECATED </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 |
1807 | int cupsGetClasses (<br /> |
1808 |     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 | 1819 | classes - 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"> |
1825 | const 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 | 1830 | the LPDEST or PRINTER environment variables. If these environment |
1831 | variables are not set, the server default destination is returned. | |
5a738aea MS |
1832 | Applications should use the <a href="#cupsGetDests"><code>cupsGetDests</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> |
1833 | functions to get the user-defined default printer, as this function does | |
1834 | not support the lpoptions-defined default printer.</p> | |
abacc52b MS |
1835 | <h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsGetDefault2">cupsGetDefault2</a></h3> |
1836 | <p class="description">Get the default printer or class for the specified server.</p> | |
5a738aea | 1837 | <p class="code"> |
abacc52b MS |
1838 | const char *cupsGetDefault2 (<br /> |
1839 |     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 | 1850 | the LPDEST or PRINTER environment variables. If these environment |
1851 | variables are not set, the server default destination is returned. | |
5a738aea MS |
1852 | Applications should use the <a href="#cupsGetDests"><code>cupsGetDests</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> |
1853 | functions to get the user-defined default printer, as this function does | |
1854 | not support the lpoptions-defined default printer. | |
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 |     const char *name,<br /> | |
1862 |     const char *instance,<br /> | |
1863 |     int num_dests,<br /> | |
1864 |     <a href="#cups_dest_t">cups_dest_t</a> *dests<br /> | |
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 | 1881 | list of supported destinations for the current user.</p> |
abacc52b MS |
1882 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></h3> |
1883 | <p class="description">Get a media name, dimension, and margins for a | |
6961465f MS |
1884 | specific size.</p> |
1885 | <p class="code"> | |
abacc52b MS |
1886 | int cupsGetDestMediaByIndex (<br /> |
1887 |     http_t *http,<br /> | |
1888 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
1889 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br /> | |
1890 |     int n,<br /> | |
1891 |     unsigned flags,<br /> | |
1892 |     <a href="#cups_size_t">cups_size_t</a> *size<br /> | |
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 |
1913 | example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will get the Nth |
1914 | borderless size supported by the printer. | |
1915 | ||
1916 | </p> | |
abacc52b MS |
1917 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsGetDestMediaByName">cupsGetDestMediaByName</a></h3> |
1918 | <p class="description">Get media names, dimensions, and margins.</p> | |
5a9febac | 1919 | <p class="code"> |
abacc52b MS |
1920 | int cupsGetDestMediaByName (<br /> |
1921 |     http_t *http,<br /> | |
1922 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
1923 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br /> | |
1924 |     const char *media,<br /> | |
1925 |     unsigned flags,<br /> | |
1926 |     <a href="#cups_size_t">cups_size_t</a> *size<br /> | |
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 "media" string is a PWG media name. "Flags" provides some matching |
5a9febac MS |
1947 | guidance (multiple flags can be combined):<br> |
1948 | <br> | |
1949 | CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer, | |
1950 | CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size, | |
1951 | CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing, | |
1952 | CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and | |
1953 | CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the | |
1954 | size amongst the "ready" media.<br> | |
1955 | <br> | |
1956 | The matching result (if any) is returned in the "cups_size_t" structure.<br> | |
1957 | <br> | |
1958 | Returns 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"> CUPS 1.6/macOS 10.8 </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 |
1964 | int cupsGetDestMediaBySize (<br /> |
1965 |     http_t *http,<br /> | |
1966 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
1967 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br /> | |
1968 |     int width,<br /> | |
1969 |     int length,<br /> | |
1970 |     unsigned flags,<br /> | |
1971 |     <a href="#cups_size_t">cups_size_t</a> *size<br /> | |
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 |
1983 | of millimeters</dd> |
1984 | <dt>length</dt> | |
abacc52b | 1985 | <dd class="description">Media length in hundredths of |
5a9febac MS |
1986 | of 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">"Width" and "length" are the dimensions in hundredths of millimeters. |
5a9febac MS |
1996 | "Flags" provides some matching guidance (multiple flags can be combined):<br> |
1997 | <br> | |
1998 | CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer, | |
1999 | CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size, | |
2000 | CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing, | |
2001 | CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and | |
2002 | CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the | |
2003 | size amongst the "ready" media.<br> | |
2004 | <br> | |
2005 | The matching result (if any) is returned in the "cups_size_t" structure.<br> | |
2006 | <br> | |
2007 | Returns 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"> CUPS 1.7/macOS 10.9 </span><a id="cupsGetDestMediaCount">cupsGetDestMediaCount</a></h3> |
2011 | <p class="description">Get the number of sizes supported by a | |
6961465f MS |
2012 | destination.</p> |
2013 | <p class="code"> | |
abacc52b MS |
2014 | int cupsGetDestMediaCount (<br /> |
2015 |     http_t *http,<br /> | |
2016 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
2017 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br /> | |
2018 |     unsigned flags<br /> | |
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 |
2035 | counted. For example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return |
2036 | the number of borderless sizes. | |
2037 | ||
2038 | </p> | |
abacc52b MS |
2039 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></h3> |
2040 | <p class="description">Get the default size for a destination.</p> | |
6961465f | 2041 | <p class="code"> |
abacc52b MS |
2042 | int cupsGetDestMediaDefault (<br /> |
2043 |     http_t *http,<br /> | |
2044 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
2045 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br /> | |
2046 |     unsigned flags,<br /> | |
2047 |     <a href="#cups_size_t">cups_size_t</a> *size<br /> | |
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 |
2066 | example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the default |
2067 | borderless size, typically US Letter or A4, but sometimes 4x6 photo media. | |
2068 | ||
240214ef | 2069 | </p> |
abacc52b MS |
2070 | <h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="cupsGetDestWithURI">cupsGetDestWithURI</a></h3> |
2071 | <p class="description">Get a destination associated with a URI.</p> | |
240214ef | 2072 | <p class="code"> |
abacc52b MS |
2073 | <a href="#cups_dest_t">cups_dest_t</a> *cupsGetDestWithURI (<br /> |
2074 |     const char *name,<br /> | |
2075 |     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">"name" is the desired name for the printer. If <code>NULL</code>, a name will be |
240214ef MS |
2088 | created using the URI.<br> |
2089 | <br> | |
2090 | "uri" is the "ipp" or "ipps" 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 |
2096 | int cupsGetDests (<br /> |
2097 |     <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 | 2108 | printer-info, printer-is-accepting-jobs, printer-is-shared, |
2109 | printer-make-and-model, printer-state, printer-state-change-time, | |
426c6a59 MS |
2110 | printer-state-reasons, and printer-type attributes as options. CUPS 1.4 |
2111 | adds the marker-change-time, marker-colors, marker-high-levels, | |
2112 | marker-levels, marker-low-levels, marker-message, marker-names, | |
2113 | marker-types, and printer-commands attributes as well.<br> | |
5a738aea MS |
2114 | <br> |
2115 | Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and | |
2116 | the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination.</p> | |
abacc52b MS |
2117 | <h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsGetDests2">cupsGetDests2</a></h3> |
2118 | <p class="description">Get the list of destinations from the specified server.</p> | |
5a738aea | 2119 | <p class="code"> |
abacc52b MS |
2120 | int cupsGetDests2 (<br /> |
2121 |     http_t *http,<br /> | |
2122 |     <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 | 2135 | printer-info, printer-is-accepting-jobs, printer-is-shared, |
2136 | printer-make-and-model, printer-state, printer-state-change-time, | |
426c6a59 MS |
2137 | printer-state-reasons, and printer-type attributes as options. CUPS 1.4 |
2138 | adds the marker-change-time, marker-colors, marker-high-levels, | |
2139 | marker-levels, marker-low-levels, marker-message, marker-names, | |
2140 | marker-types, and printer-commands attributes as well.<br> | |
5a738aea MS |
2141 | <br> |
2142 | Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and | |
2143 | the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination. | |
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 |
2149 | int cupsGetJobs (<br /> |
2150 |     <a href="#cups_job_t">cups_job_t</a> **jobs,<br /> | |
2151 |     const char *name,<br /> | |
2152 |     int myjobs,<br /> | |
2153 |     int whichjobs<br /> | |
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 "whichjobs" value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless |
5a738aea MS |
2170 | of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are |
2171 | pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns | |
2172 | jobs that are stopped, canceled, aborted, or completed.</p> | |
abacc52b MS |
2173 | <h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsGetJobs2">cupsGetJobs2</a></h3> |
2174 | <p class="description">Get the jobs from the specified server.</p> | |
5a738aea | 2175 | <p class="code"> |
abacc52b MS |
2176 | int cupsGetJobs2 (<br /> |
2177 |     http_t *http,<br /> | |
2178 |     <a href="#cups_job_t">cups_job_t</a> **jobs,<br /> | |
2179 |     const char *name,<br /> | |
2180 |     int myjobs,<br /> | |
2181 |     int whichjobs<br /> | |
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 "whichjobs" value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless |
5a738aea MS |
2200 | of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are |
2201 | pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns | |
2202 | jobs that are stopped, canceled, aborted, or completed. | |
2203 | ||
2204 | </p> | |
abacc52b MS |
2205 | <h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsGetNamedDest">cupsGetNamedDest</a></h3> |
2206 | <p class="description">Get options for the named destination.</p> | |
5a738aea | 2207 | <p class="code"> |
abacc52b MS |
2208 | <a href="#cups_dest_t">cups_dest_t</a> *cupsGetNamedDest (<br /> |
2209 |     http_t *http,<br /> | |
2210 |     const char *name,<br /> | |
2211 |     const char *instance<br /> | |
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 |
2226 | be used instead of <a href="#cupsGetDests"><code>cupsGetDests</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> when you either |
2227 | know the name of the destination or want to print to the default destination. | |
2228 | If <code>NULL</code> is returned, the destination does not exist or there is no | |
2229 | default destination.<br> | |
2230 | <br> | |
2231 | If "http" is <code>CUPS_HTTP_DEFAULT</code>, the connection to the default print | |
2232 | server will be used.<br> | |
2233 | <br> | |
2234 | If "name" is <code>NULL</code>, the default printer for the current user will be | |
2235 | returned.<br> | |
2236 | <br> | |
2237 | The returned destination must be freed using <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> with a | |
2238 | "num_dests" 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 |
2244 | const char *cupsGetOption (<br /> |
2245 |     const char *name,<br /> | |
2246 |     int num_options,<br /> | |
2247 |     <a href="#cups_option_t">cups_option_t</a> *options<br /> | |
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 |
2263 | const char *cupsGetPassword (<br /> |
2264 |     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 |
2275 | user does not provide a password.<br> |
2276 | <br> | |
2277 | Note: The current password callback function is tracked separately for each | |
2278 | thread in a program. Multi-threaded programs that override the setting via | |
2279 | the <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a> or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> functions need to | |
2280 | do so in each thread for the same function to be used.</p> | |
abacc52b MS |
2281 | <h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsGetPassword2">cupsGetPassword2</a></h3> |
2282 | <p class="description">Get a password from the user using the advanced | |
aaf19ab0 | 2283 | password callback.</p> |
f11a948a | 2284 | <p class="code"> |
abacc52b MS |
2285 | const char *cupsGetPassword2 (<br /> |
2286 |     const char *prompt,<br /> | |
2287 |     http_t *http,<br /> | |
2288 |     const char *method,<br /> | |
2289 |     const char *resource<br /> | |
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 ("GET", "POST", "PUT")</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 |
2306 | user does not provide a password.<br> |
2307 | <br> | |
2308 | Note: The current password callback function is tracked separately for each | |
2309 | thread in a program. Multi-threaded programs that override the setting via | |
2310 | the <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a> or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> functions need to | |
2311 | do so in each thread for the same function to be used. | |
f11a948a MS |
2312 | |
2313 | </p> | |
abacc52b MS |
2314 | <h3 class="function"><span class="info"> DEPRECATED </span><a id="cupsGetPrinters">cupsGetPrinters</a></h3> |
2315 | <p class="description">Get a list of printers from the default server.</p> | |
5a738aea | 2316 | <p class="code"> |
abacc52b MS |
2317 | int cupsGetPrinters (<br /> |
2318 |     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"> |
2335 | cups_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 |
2340 | for the given language.</p> |
2341 | <p class="code"> | |
abacc52b MS |
2342 | const char *cupsLangEncoding (<br /> |
2343 |     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"> |
2355 | void 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 |
2359 | void cupsLangFree (<br /> |
2360 |     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 |
2372 | cups_lang_t *cupsLangGet (<br /> |
2373 |     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"> CUPS 2.0/macOS 10.10 </span><a id="cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></h3> | |
2383 | <p class="description">Get the localized string for a destination media | |
240214ef MS |
2384 | size.</p> |
2385 | <p class="code"> | |
abacc52b MS |
2386 | const char *cupsLocalizeDestMedia (<br /> |
2387 |     http_t *http,<br /> | |
2388 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
2389 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br /> | |
2390 |     unsigned flags,<br /> | |
2391 |     <a href="#cups_size_t">cups_size_t</a> *size<br /> | |
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 |
2410 | invalid if the destination information is deleted. |
2411 | ||
2412 | </p> | |
abacc52b MS |
2413 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsLocalizeDestOption">cupsLocalizeDestOption</a></h3> |
2414 | <p class="description">Get the localized string for a destination | |
5a9febac MS |
2415 | option.</p> |
2416 | <p class="code"> | |
abacc52b MS |
2417 | const char *cupsLocalizeDestOption (<br /> |
2418 |     http_t *http,<br /> | |
2419 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
2420 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br /> | |
2421 |     const char *option<br /> | |
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 |
2438 | invalid if the destination information is deleted. |
2439 | ||
2440 | </p> | |
abacc52b MS |
2441 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsLocalizeDestValue">cupsLocalizeDestValue</a></h3> |
2442 | <p class="description">Get the localized string for a destination | |
5a9febac MS |
2443 | option+value pair.</p> |
2444 | <p class="code"> | |
abacc52b MS |
2445 | const char *cupsLocalizeDestValue (<br /> |
2446 |     http_t *http,<br /> | |
2447 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
2448 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br /> | |
2449 |     const char *option,<br /> | |
2450 |     const char *value<br /> | |
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 |
2469 | invalid if the destination information is deleted. |
2470 | ||
2471 | </p> | |
abacc52b MS |
2472 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsNotifySubject">cupsNotifySubject</a></h3> |
2473 | <p class="description">Return the subject for the given notification message.</p> | |
5a738aea | 2474 | <p class="code"> |
abacc52b MS |
2475 | char *cupsNotifySubject (<br /> |
2476 |     cups_lang_t *lang,<br /> | |
2477 |     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"> CUPS 1.2/macOS 10.5 </span><a id="cupsNotifyText">cupsNotifyText</a></h3> |
2493 | <p class="description">Return the text for the given notification message.</p> | |
5a738aea | 2494 | <p class="code"> |
abacc52b MS |
2495 | char *cupsNotifyText (<br /> |
2496 |     cups_lang_t *lang,<br /> | |
2497 |     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 |
2515 | int cupsParseOptions (<br /> |
2516 |     const char *arg,<br /> | |
2517 |     int num_options,<br /> | |
2518 |     <a href="#cups_option_t">cups_option_t</a> **options<br /> | |
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 | 2533 | to the PAPI text option ABNF specification. Collection values |
2534 | ("name={a=... b=... c=...}") are stored with the curley brackets | |
5a738aea MS |
2535 | intact - use <code>cupsParseOptions</code> on the value to extract the |
2536 | collection 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 |
2540 | int cupsPrintFile (<br /> |
2541 |     const char *name,<br /> | |
2542 |     const char *filename,<br /> | |
2543 |     const char *title,<br /> | |
2544 |     int num_options,<br /> | |
2545 |     <a href="#cups_option_t">cups_option_t</a> *options<br /> | |
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"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsPrintFile2">cupsPrintFile2</a></h3> | |
2563 | <p class="description">Print a file to a printer or class on the specified | |
5a738aea MS |
2564 | server.</p> |
2565 | <p class="code"> | |
abacc52b MS |
2566 | int cupsPrintFile2 (<br /> |
2567 |     http_t *http,<br /> | |
2568 |     const char *name,<br /> | |
2569 |     const char *filename,<br /> | |
2570 |     const char *title,<br /> | |
2571 |     int num_options,<br /> | |
2572 |     <a href="#cups_option_t">cups_option_t</a> *options<br /> | |
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 |
2593 | default server.</p> |
2594 | <p class="code"> | |
abacc52b MS |
2595 | int cupsPrintFiles (<br /> |
2596 |     const char *name,<br /> | |
2597 |     int num_files,<br /> | |
2598 |     const char **files,<br /> | |
2599 |     const char *title,<br /> | |
2600 |     int num_options,<br /> | |
2601 |     <a href="#cups_option_t">cups_option_t</a> *options<br /> | |
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"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsPrintFiles2">cupsPrintFiles2</a></h3> | |
2621 | <p class="description">Print one or more files to a printer or class on the | |
5a738aea MS |
2622 | specified server.</p> |
2623 | <p class="code"> | |
abacc52b MS |
2624 | int cupsPrintFiles2 (<br /> |
2625 |     http_t *http,<br /> | |
2626 |     const char *name,<br /> | |
2627 |     int num_files,<br /> | |
2628 |     const char **files,<br /> | |
2629 |     const char *title,<br /> | |
2630 |     int num_options,<br /> | |
2631 |     <a href="#cups_option_t">cups_option_t</a> *options<br /> | |
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"> CUPS 1.3/macOS 10.5 </span><a id="cupsRemoveDest">cupsRemoveDest</a></h3> | |
2653 | <p class="description">Remove a destination from the destination list.</p> | |
5a738aea | 2654 | <p class="code"> |
abacc52b MS |
2655 | int cupsRemoveDest (<br /> |
2656 |     const char *name,<br /> | |
2657 |     const char *instance,<br /> | |
2658 |     int num_dests,<br /> | |
2659 |     <a href="#cups_dest_t">cups_dest_t</a> **dests<br /> | |
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 | 2676 | queue, 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 |
2678 | options for the user. | |
2679 | ||
2680 | </p> | |
abacc52b MS |
2681 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsRemoveOption">cupsRemoveOption</a></h3> |
2682 | <p class="description">Remove an option from an option array.</p> | |
5a738aea | 2683 | <p class="code"> |
abacc52b MS |
2684 | int cupsRemoveOption (<br /> |
2685 |     const char *name,<br /> | |
2686 |     int num_options,<br /> | |
2687 |     <a href="#cups_option_t">cups_option_t</a> **options<br /> | |
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"> |
2703 | const 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 |
2709 | set, the default is the local system - either "localhost" or a domain socket | |
2710 | path.<br> | |
2711 | <br> | |
2712 | The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6 | |
2713 | address, or a domain socket pathname.<br> | |
2714 | <br> | |
2715 | Note: The current server is tracked separately for each thread in a program. | |
2716 | Multi-threaded programs that override the server via the | |
2717 | <a href="#cupsSetServer"><code>cupsSetServer</code></a> function need to do so in each thread for the same | |
2718 | server to be used.</p> | |
abacc52b MS |
2719 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="cupsSetClientCertCB">cupsSetClientCertCB</a></h3> |
2720 | <p class="description">Set the client certificate callback.</p> | |
10d09e33 | 2721 | <p class="code"> |
abacc52b MS |
2722 | void cupsSetClientCertCB (<br /> |
2723 |     <a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a> cb,<br /> | |
2724 |     void *user_data<br /> | |
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> |
2736 | Note: The current certificate callback is tracked separately for each thread | |
2737 | in a program. Multi-threaded programs that override the callback need to do | |
2738 | so in each thread for the same callback to be used. | |
2739 | ||
2740 | </p> | |
abacc52b MS |
2741 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="cupsSetCredentials">cupsSetCredentials</a></h3> |
2742 | <p class="description">Set the default credentials to be used for SSL/TLS | |
10d09e33 MS |
2743 | connections.</p> |
2744 | <p class="code"> | |
abacc52b MS |
2745 | int cupsSetCredentials (<br /> |
2746 |     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 |
2757 | program. Multi-threaded programs that override the setting need to do so in |
2758 | each thread for the same setting to be used. | |
2759 | ||
2760 | </p> | |
abacc52b MS |
2761 | <h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="cupsSetDefaultDest">cupsSetDefaultDest</a></h3> |
2762 | <p class="description">Set the default destination.</p> | |
5a738aea | 2763 | <p class="code"> |
abacc52b MS |
2764 | void cupsSetDefaultDest (<br /> |
2765 |     const char *name,<br /> | |
2766 |     const char *instance,<br /> | |
2767 |     int num_dests,<br /> | |
2768 |     <a href="#cups_dest_t">cups_dest_t</a> *dests<br /> | |
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 |
2784 | void cupsSetDests (<br /> |
2785 |     int num_dests,<br /> | |
2786 |     <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 | 2797 | as root and ~/.cups/lpoptions when run as a normal user.</p> |
abacc52b MS |
2798 | <h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsSetDests2">cupsSetDests2</a></h3> |
2799 | <p class="description">Save the list of destinations for the specified server.</p> | |
5a738aea | 2800 | <p class="code"> |
abacc52b MS |
2801 | int cupsSetDests2 (<br /> |
2802 |     http_t *http,<br /> | |
2803 |     int num_dests,<br /> | |
2804 |     <a href="#cups_dest_t">cups_dest_t</a> *dests<br /> | |
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 | 2819 | as 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 |
2825 | void cupsSetEncryption (<br /> |
2826 |     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 |
2835 | environment 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> |
2839 | Note: The current encryption setting is tracked separately for each thread | |
2840 | in a program. Multi-threaded programs that override the setting need to do | |
2841 | so in each thread for the same setting to be used.</p> | |
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 |
2845 | void cupsSetPasswordCB (<br /> |
2846 |     <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 |
2855 | reads the password from the console. Programs should call either this |
2856 | function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered | |
2857 | by a program per thread.<br> | |
2858 | <br> | |
2859 | Note: The current password callback is tracked separately for each thread | |
2860 | in a program. Multi-threaded programs that override the callback need to do | |
2861 | so in each thread for the same callback to be used.</p> | |
abacc52b MS |
2862 | <h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsSetPasswordCB2">cupsSetPasswordCB2</a></h3> |
2863 | <p class="description">Set the advanced password callback for CUPS.</p> | |
f11a948a | 2864 | <p class="code"> |
abacc52b MS |
2865 | void cupsSetPasswordCB2 (<br /> |
2866 |     <a href="#cups_password_cb2_t">cups_password_cb2_t</a> cb,<br /> | |
2867 |     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 |
2878 | reads the password from the console. Programs should call either this |
2879 | function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered | |
2880 | by a program per thread.<br> | |
2881 | <br> | |
2882 | Note: The current password callback is tracked separately for each thread | |
2883 | in a program. Multi-threaded programs that override the callback need to do | |
2884 | so in each thread for the same callback to be used. | |
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 |
2890 | void cupsSetServer (<br /> |
2891 |     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 "server" string can be a fully-qualified hostname, a numeric |
aaf19ab0 MS |
2900 | IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP |
2901 | addresses can be optionally followed by a colon and port number to override | |
2902 | the default port 631, e.g. "hostname:8631". Pass <code>NULL</code> to restore the | |
2903 | default server name and port.<br> | |
2904 | <br> | |
2905 | Note: The current server is tracked separately for each thread in a program. | |
2906 | Multi-threaded programs that override the server need to do so in each | |
2907 | thread for the same server to be used.</p> | |
abacc52b MS |
2908 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="cupsSetServerCertCB">cupsSetServerCertCB</a></h3> |
2909 | <p class="description">Set the server certificate callback.</p> | |
10d09e33 | 2910 | <p class="code"> |
abacc52b MS |
2911 | void cupsSetServerCertCB (<br /> |
2912 |     <a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a> cb,<br /> | |
2913 |     void *user_data<br /> | |
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> |
2925 | Note: The current credentials callback is tracked separately for each thread | |
2926 | in a program. Multi-threaded programs that override the callback need to do | |
2927 | so in each thread for the same callback to be used. | |
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 |
2933 | void cupsSetUser (<br /> |
2934 |     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> |
2944 | Note: The current user name is tracked separately for each thread in a | |
2945 | program. Multi-threaded programs that override the user name need to do so | |
2946 | in each thread for the same user name to be used.</p> | |
abacc52b MS |
2947 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsSetUserAgent">cupsSetUserAgent</a></h3> |
2948 | <p class="description">Set the default HTTP User-Agent string.</p> | |
db8b865d | 2949 | <p class="code"> |
abacc52b MS |
2950 | void cupsSetUserAgent (<br /> |
2951 |     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 |
2960 | version, IPP version, and operating system version and architecture. |
2961 | ||
2962 | </p> | |
abacc52b MS |
2963 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsStartDestDocument">cupsStartDestDocument</a></h3> |
2964 | <p class="description">Start a new document.</p> | |
5a9febac | 2965 | <p class="code"> |
abacc52b MS |
2966 | http_status_t cupsStartDestDocument (<br /> |
2967 |     http_t *http,<br /> | |
2968 |     <a href="#cups_dest_t">cups_dest_t</a> *dest,<br /> | |
2969 |     <a href="#cups_dinfo_t">cups_dinfo_t</a> *info,<br /> | |
2970 |     int job_id,<br /> | |
2971 |     const char *docname,<br /> | |
2972 |     const char *format,<br /> | |
2973 |     int num_options,<br /> | |
2974 |     <a href="#cups_option_t">cups_option_t</a> *options,<br /> | |
2975 |     int last_document<br /> | |
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">"job_id" is the job ID returned by cupsCreateDestJob. "docname" is the name |
5a9febac MS |
3002 | of the document/file being printed, "format" is the MIME media type for the |
3003 | document (see CUPS_FORMAT_xxx constants), and "num_options" and "options" | |
3004 | are the options do be applied to the document. "last_document" should be 1 | |
3005 | if this is the last document to be submitted in the job. Returns | |
3006 | <code>HTTP_CONTINUE</code> on success. | |
3007 | ||
3008 | </p> | |
abacc52b MS |
3009 | <h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsStartDocument">cupsStartDocument</a></h3> |
3010 | <p class="description">Add a document to a job created with cupsCreateJob().</p> | |
5a738aea | 3011 | <p class="code"> |
abacc52b MS |
3012 | http_status_t cupsStartDocument (<br /> |
3013 |     http_t *http,<br /> | |
3014 |     const char *name,<br /> | |
3015 |     int job_id,<br /> | |
3016 |     const char *docname,<br /> | |
3017 |     const char *format,<br /> | |
3018 |     int last_document<br /> | |
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> | |
3041 | The MIME type constants <code>CUPS_FORMAT_AUTO</code>, <code>CUPS_FORMAT_PDF</code>, | |
3042 | <code>CUPS_FORMAT_POSTSCRIPT</code>, <code>CUPS_FORMAT_RAW</code>, and | |
3043 | <code>CUPS_FORMAT_TEXT</code> are provided for the "format" argument, although | |
3044 | any supported MIME type string can be supplied. | |
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 |
3050 | int cupsTempFd (<br /> |
3051 |     char *filename,<br /> | |
3052 |     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 | 3065 | The temporary file is opened for reading and writing.</p> |
abacc52b MS |
3066 | <h3 class="function"><span class="info"> DEPRECATED </span><a id="cupsTempFile">cupsTempFile</a></h3> |
3067 | <p class="description">Generates a temporary filename.</p> | |
5a738aea | 3068 | <p class="code"> |
abacc52b MS |
3069 | char *cupsTempFile (<br /> |
3070 |     char *filename,<br /> | |
3071 |     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 |
3084 | This function is deprecated and will no longer generate a temporary |
3085 | filename - use <a href="#cupsTempFd"><code>cupsTempFd</code></a> or <a href="#cupsTempFile2"><code>cupsTempFile2</code></a> instead. | |
ef416fc2 | 3086 | |
5a738aea | 3087 | </p> |
abacc52b MS |
3088 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsTempFile2">cupsTempFile2</a></h3> |
3089 | <p class="description">Creates a temporary CUPS file.</p> | |
5a738aea | 3090 | <p class="code"> |
abacc52b MS |
3091 | cups_file_t *cupsTempFile2 (<br /> |
3092 |     char *filename,<br /> | |
3093 |     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 | 3106 | The 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"> |
3112 | const 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 |
3117 | program. Multi-threaded programs that override the user name with the |
3118 | <a href="#cupsSetUser"><code>cupsSetUser</code></a> function need to do so in each thread for the same user | |
3119 | name to be used.</p> | |
abacc52b MS |
3120 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsUserAgent">cupsUserAgent</a></h3> |
3121 | <p class="description">Return the default HTTP User-Agent string.</p> | |
db8b865d MS |
3122 | <p class="code"> |
3123 | const 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"> CUPS 1.7/macOS 10.9 </span><a id="pwgFormatSizeName">pwgFormatSizeName</a></h3> | |
3127 | <p class="description">Generate a PWG self-describing media size name.</p> | |
6961465f | 3128 | <p class="code"> |
abacc52b MS |
3129 | int pwgFormatSizeName (<br /> |
3130 |     char *keyword,<br /> | |
3131 |     size_t keysize,<br /> | |
3132 |     const char *prefix,<br /> | |
3133 |     const char *name,<br /> | |
3134 |     int width,<br /> | |
3135 |     int length,<br /> | |
3136 |     const char *units<br /> | |
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 - "in", "mm", 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 | "prefix_name_WIDTHxLENGTHunits". The prefix is typically "custom" or "roll" |
3160 | for user-supplied sizes but can also be "disc", "iso", "jis", "jpn", "na", | |
3161 | "oe", "om", "prc", or "roc". A value of <code>NULL</code> automatically chooses | |
3162 | "oe" or "om" depending on the units.<br> | |
3163 | <br> | |
3164 | The size name may only contain lowercase letters, numbers, "-", and ".". If | |
3165 | <code>NULL</code> is passed, the size name will contain the formatted dimensions.<br> | |
3166 | <br> | |
3167 | The width and length are specified in hundredths of millimeters, equivalent | |
3168 | to 1/100000th of a meter or 1/2540th of an inch. The width, length, and | |
3169 | units used for the generated size name are calculated automatically if the | |
3170 | units string is <code>NULL</code>, otherwise inches ("in") or millimeters ("mm") | |
3171 | are used. | |
3172 | ||
3173 | </p> | |
abacc52b MS |
3174 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="pwgInitSize">pwgInitSize</a></h3> |
3175 | <p class="description">Initialize a pwg_size_t structure using IPP Job Template | |
6961465f MS |
3176 | attributes.</p> |
3177 | <p class="code"> | |
abacc52b MS |
3178 | int pwgInitSize (<br /> |
3179 |     <a href="#pwg_size_t">pwg_size_t</a> *size,<br /> | |
3180 |     ipp_t *job,<br /> | |
3181 |     int *margins_set<br /> | |
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 "media" or |
6961465f MS |
3196 | "media-col" attribute in the specified IPP message. 0 is returned if neither |
3197 | attribute is found in the message or the values are not valid.<br> | |
3198 | <br> | |
3199 | The "margins_set" variable is initialized to 1 if any "media-xxx-margin" | |
3200 | member attribute was specified in the "media-col" Job Template attribute, | |
3201 | otherwise it is initialized to 0. | |
3202 | ||
3203 | </p> | |
abacc52b MS |
3204 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="pwgMediaForLegacy">pwgMediaForLegacy</a></h3> |
3205 | <p class="description">Find a PWG media size by ISO/IPP legacy name.</p> | |
6961465f | 3206 | <p class="code"> |
abacc52b MS |
3207 | <a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForLegacy (<br /> |
3208 |     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 "name" argument specifies the legacy ISO media size name, for example |
6961465f MS |
3219 | "iso-a4" or "na-letter". |
3220 | ||
3221 | </p> | |
abacc52b MS |
3222 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="pwgMediaForPPD">pwgMediaForPPD</a></h3> |
3223 | <p class="description">Find a PWG media size by Adobe PPD name.</p> | |
6961465f | 3224 | <p class="code"> |
abacc52b MS |
3225 | <a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForPPD (<br /> |
3226 |     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 "ppd" argument specifies an Adobe page size name as defined in Table B.1 |
6961465f MS |
3237 | of the Adobe PostScript Printer Description File Format Specification Version |
3238 | 4.3.<br> | |
3239 | <br> | |
3240 | If the name is non-standard, the returned PWG media size is stored in | |
3241 | thread-local storage and is overwritten by each call to the function in the | |
3242 | thread. Custom names can be of the form "Custom.WIDTHxLENGTH[units]" or | |
3243 | "WIDTHxLENGTH[units]". | |
3244 | ||
3245 | </p> | |
abacc52b MS |
3246 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="pwgMediaForPWG">pwgMediaForPWG</a></h3> |
3247 | <p class="description">Find a PWG media size by 5101.1 self-describing name.</p> | |
6961465f | 3248 | <p class="code"> |
abacc52b MS |
3249 | <a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForPWG (<br /> |
3250 |     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 "pwg" argument specifies a self-describing media size name of the form |
6961465f MS |
3261 | "prefix_name_WIDTHxLENGTHunits" as defined in PWG 5101.1.<br> |
3262 | <br> | |
3263 | If the name is non-standard, the returned PWG media size is stored in | |
3264 | thread-local storage and is overwritten by each call to the function in the | |
3265 | thread. | |
3266 | ||
3267 | </p> | |
abacc52b MS |
3268 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="pwgMediaForSize">pwgMediaForSize</a></h3> |
3269 | <p class="description">Get the PWG media size for the given dimensions.</p> | |
6961465f | 3270 | <p class="code"> |
abacc52b MS |
3271 | <a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForSize (<br /> |
3272 |     int width,<br /> | |
3273 |     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 "width" and "length" are in hundredths of millimeters, equivalent to |
6961465f MS |
3286 | 1/100000th of a meter or 1/2540th of an inch.<br> |
3287 | <br> | |
3288 | If the dimensions are non-standard, the returned PWG media size is stored in | |
3289 | thread-local storage and is overwritten by each call to the function in the | |
3290 | thread. | |
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"> CUPS 1.5/macOS 10.7 </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 |
3298 | typedef 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"> CUPS 1.6/macOS 10.8 </span>cups_dest_block_t</a></h3> |
3301 | <p class="description">Destination enumeration block | |
3e7fe0ca | 3302 | </p> |
abacc52b | 3303 | <p class="code"> |
3e7fe0ca MS |
3304 | typedef 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"> CUPS 1.6/macOS 10.8 </span>cups_dest_cb_t</a></h3> |
3307 | <p class="description">Destination enumeration callback | |
3e7fe0ca | 3308 | </p> |
abacc52b | 3309 | <p class="code"> |
3e7fe0ca MS |
3310 | typedef 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 |
3315 | typedef 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"> CUPS 1.6/macOS 10.8 </span>cups_dinfo_t</a></h3> |
3318 | <p class="description">Destination capability and status | |
3e7fe0ca | 3319 | information </p> |
abacc52b | 3320 | <p class="code"> |
3e7fe0ca MS |
3321 | typedef 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 |
3326 | typedef 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 |
3331 | typedef 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"> CUPS 1.4/macOS 10.6 </span>cups_password_cb2_t</a></h3> |
3334 | <p class="description">New password callback | |
3e7fe0ca | 3335 | </p> |
abacc52b | 3336 | <p class="code"> |
f11a948a MS |
3337 | typedef 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 | 3342 | typedef 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 | 3347 | typedef unsigned cups_ptype_t; |
5a738aea | 3348 | </p> |
abacc52b MS |
3349 | <h3 class="typedef"><a id="cups_server_cert_cb_t"><span class="info"> CUPS 1.5/macOS 10.7 </span>cups_server_cert_cb_t</a></h3> |
3350 | <p class="description">Server credentials callback | |
3e7fe0ca | 3351 | </p> |
abacc52b | 3352 | <p class="code"> |
10d09e33 MS |
3353 | typedef 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"> CUPS 1.6/macOS 10.8 </span>cups_size_t</a></h3> |
3356 | <p class="description">Media Size </p> | |
3357 | <p class="code"> | |
3e7fe0ca MS |
3358 | typedef 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 |
3363 | typedef 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 |
3368 | typedef 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 |
3373 | typedef 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 |     char *name, *instance;<br /> | |
3380 |     int is_default;<br /> | |
3381 |     int num_options;<br /> | |
3382 |     <a href="#cups_option_t">cups_option_t</a> *options;<br /> | |
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 |     time_t completed_time;<br /> | |
3399 |     time_t creation_time;<br /> | |
3400 |     char *dest;<br /> | |
3401 |     char *format;<br /> | |
3402 |     int id;<br /> | |
3403 |     int priority;<br /> | |
3404 |     time_t processing_time;<br /> | |
3405 |     int size;<br /> | |
3406 |     ipp_jstate_t state;<br /> | |
3407 |     char *title;<br /> | |
3408 |     char *user;<br /> | |
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 |     char *name;<br /> | |
3439 |     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"> CUPS 1.6/macOS 10.8 </span><a id="cups_size_s">cups_size_s</a></h3> |
3449 | <p class="description">Media Size </p> | |
3450 | <p class="code">struct cups_size_s {<br /> | |
3451 |     char media[128];<br /> | |
3452 |     int width, length, bottom, left, right, top;<br /> | |
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 |
3460 | millimeters</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 |     _cups_dnssd_data_t *data;<br /> | |
3466 |     else if(val 0) data - got_data;<br /> | |
3467 |     void) timeout;<br /> | |
3468 |     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 |     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 |     int width, length;<br /> | |
3493 |     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 |     <a href="#pwg_map_t">pwg_map_t</a> map;<br /> | |
3506 |     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 | 3518 | locale 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 | 3523 | constants</p> |
abacc52b MS |
3524 | <h4 class="constants">Constants</h4> |
3525 | <dl> | |
3526 | <dt>CUPS_PRINTER_AUTHENTICATED <span class="info"> CUPS 1.2/macOS 10.5 </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&W printing</dd> | |
3533 | <dt>CUPS_PRINTER_CLASS </dt> | |
3534 | <dd class="description">Printer class</dd> | |
3535 | <dt>CUPS_PRINTER_COLLATE </dt> | |
3536 | <dd class="description">Can collage copies</dd> | |
3537 | <dt>CUPS_PRINTER_COLOR </dt> | |
3538 | <dd class="description">Can do color printing</dd> | |
3539 | <dt>CUPS_PRINTER_COMMANDS <span class="info"> CUPS 1.2/macOS 10.5 </span></dt> | |
3540 | <dd class="description">Printer supports maintenance commands | |
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"> CUPS 1.2/macOS 10.5 </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"> CUPS 1.4/macOS 10.6 </span></dt> | |
3562 | <dd class="description">Printer with scanning capabilities | |
3e7fe0ca | 3563 | </dd> |
abacc52b MS |
3564 | <dt>CUPS_PRINTER_NOT_SHARED <span class="info"> CUPS 1.2/macOS 10.5 </span></dt> |
3565 | <dd class="description">Printer is not shared | |
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"> CUPS 1.4/macOS 10.6 </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> |