]>
Commit | Line | Data |
---|---|---|
745129be | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
ef416fc2 | 2 | <html> |
3 | <!-- SECTION: Programming --> | |
4 | <head> | |
0268488e MS |
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.7"> | |
5a738aea MS |
9 | <style type="text/css"><!-- |
10 | BODY { | |
11 | font-family: lucida grande, geneva, helvetica, arial, sans-serif; | |
12 | } | |
13 | ||
14 | H1, H2, H3, H4, H5, H6, P, TD, TH { | |
15 | font-family: lucida grande, geneva, helvetica, arial, sans-serif; | |
16 | } | |
17 | ||
18 | KBD { | |
19 | font-family: monaco, courier, monospace; | |
20 | font-weight: bold; | |
21 | } | |
22 | ||
23 | PRE { | |
24 | font-family: monaco, courier, monospace; | |
25 | } | |
26 | ||
27 | PRE.command { | |
10d09e33 | 28 | border: dotted thin #7f7f7f; |
5a738aea | 29 | margin-left: 36pt; |
10d09e33 | 30 | padding: 10px; |
5a738aea MS |
31 | } |
32 | ||
f11a948a MS |
33 | P.compact { |
34 | margin: 0; | |
35 | } | |
36 | ||
e4572d57 MS |
37 | P.example { |
38 | font-style: italic; | |
39 | margin-left: 36pt; | |
40 | } | |
41 | ||
5a738aea MS |
42 | PRE.example { |
43 | background: #eeeeee; | |
44 | border: dotted thin #999999; | |
45 | margin-left: 36pt; | |
178cb736 | 46 | padding: 10pt; |
5a738aea MS |
47 | } |
48 | ||
49 | PRE.command EM, PRE.example EM { | |
50 | font-family: lucida grande, geneva, helvetica, arial, sans-serif; | |
51 | } | |
52 | ||
53 | P.command { | |
54 | font-family: monaco, courier, monospace; | |
55 | margin-left: 36pt; | |
56 | } | |
57 | ||
58 | P.formula { | |
59 | font-style: italic; | |
60 | margin-left: 36pt; | |
61 | } | |
62 | ||
63 | BLOCKQUOTE { | |
178cb736 | 64 | background: #eeeeee; |
5a738aea MS |
65 | border: solid thin #999999; |
66 | padding: 10pt; | |
67 | } | |
68 | ||
e4572d57 MS |
69 | A IMG { |
70 | border: none; | |
71 | } | |
72 | ||
73 | A:link:hover IMG { | |
74 | background: #f0f0f0; | |
75 | border-radius: 10px; | |
76 | -moz-border-radius: 10px; | |
77 | } | |
78 | ||
5a738aea | 79 | A:link, A:visited { |
568fa3fa | 80 | font-weight: normal; |
5a738aea | 81 | text-decoration: none; |
5a738aea MS |
82 | } |
83 | ||
84 | A:link:hover, A:visited:hover, A:active { | |
85 | text-decoration: underline; | |
5a738aea MS |
86 | } |
87 | ||
88 | SUB, SUP { | |
89 | font-size: 50%; | |
90 | } | |
91 | ||
e4572d57 MS |
92 | TR.data, TD.data, TR.data TD { |
93 | margin-top: 10pt; | |
94 | padding: 5pt; | |
95 | border-bottom: solid 1pt #999999; | |
96 | } | |
97 | ||
98 | TR.data TH { | |
99 | border-bottom: solid 1pt #999999; | |
100 | padding-top: 10pt; | |
101 | padding-left: 5pt; | |
102 | text-align: left; | |
103 | } | |
104 | ||
5a738aea MS |
105 | DIV.table TABLE { |
106 | border: solid thin #999999; | |
107 | border-collapse: collapse; | |
108 | border-spacing: 0; | |
109 | margin-left: auto; | |
110 | margin-right: auto; | |
111 | } | |
112 | ||
113 | DIV.table CAPTION { | |
114 | caption-side: top; | |
115 | font-size: 120%; | |
116 | font-style: italic; | |
117 | font-weight: bold; | |
118 | margin-left: auto; | |
119 | margin-right: auto; | |
120 | } | |
121 | ||
122 | DIV.table TABLE TD { | |
123 | border: solid thin #cccccc; | |
124 | padding-top: 5pt; | |
125 | } | |
126 | ||
127 | DIV.table TABLE TH { | |
128 | background: #cccccc; | |
129 | border: none; | |
130 | border-bottom: solid thin #999999; | |
131 | } | |
132 | ||
133 | DIV.figure TABLE { | |
134 | margin-left: auto; | |
135 | margin-right: auto; | |
136 | } | |
137 | ||
138 | DIV.figure CAPTION { | |
139 | caption-side: bottom; | |
140 | font-size: 120%; | |
141 | font-style: italic; | |
142 | font-weight: bold; | |
143 | margin-left: auto; | |
144 | margin-right: auto; | |
145 | } | |
146 | ||
147 | TH.label { | |
5a738aea MS |
148 | text-align: right; |
149 | vertical-align: top; | |
150 | } | |
151 | ||
e4572d57 MS |
152 | TH.sublabel { |
153 | text-align: right; | |
154 | font-weight: normal; | |
155 | } | |
156 | ||
5a738aea MS |
157 | HR { |
158 | border: solid thin; | |
159 | } | |
160 | ||
161 | SPAN.info { | |
e4572d57 MS |
162 | background: black; |
163 | border: thin solid black; | |
164 | color: white; | |
5a738aea MS |
165 | font-size: 80%; |
166 | font-style: italic; | |
167 | font-weight: bold; | |
168 | white-space: nowrap; | |
169 | } | |
170 | ||
171 | H2 SPAN.info, H3 SPAN.info, H4 SPAN.info { | |
172 | float: right; | |
173 | font-size: 100%; | |
174 | } | |
175 | ||
178cb736 MS |
176 | H1.title { |
177 | } | |
178 | ||
5a738aea MS |
179 | H2.title, H3.title { |
180 | border-bottom: solid 2pt #000000; | |
181 | } | |
182 | ||
e4572d57 MS |
183 | DIV.indent, TABLE.indent { |
184 | margin-top: 2em; | |
185 | margin-left: auto; | |
186 | margin-right: auto; | |
187 | width: 90%; | |
188 | } | |
189 | ||
190 | TABLE.indent { | |
191 | border-collapse: collapse; | |
192 | } | |
193 | ||
194 | TABLE.indent TD, TABLE.indent TH { | |
195 | padding: 0; | |
196 | } | |
197 | ||
198 | TABLE.list { | |
199 | border-collapse: collapse; | |
200 | margin-left: auto; | |
201 | margin-right: auto; | |
202 | width: 90%; | |
203 | } | |
204 | ||
205 | TABLE.list TH { | |
206 | background: white; | |
207 | border-bottom: solid thin #cccccc; | |
208 | color: #444444; | |
209 | padding-top: 10pt; | |
210 | padding-left: 5pt; | |
211 | text-align: left; | |
212 | vertical-align: bottom; | |
213 | white-space: nowrap; | |
214 | } | |
215 | ||
216 | TABLE.list TH A { | |
217 | color: #4444cc; | |
218 | } | |
219 | ||
220 | TABLE.list TD { | |
221 | border-bottom: solid thin #eeeeee; | |
222 | padding-top: 5pt; | |
223 | padding-left: 5pt; | |
224 | } | |
225 | ||
226 | TABLE.list TR:nth-child(even) { | |
227 | background: #f8f8f8; | |
228 | } | |
229 | ||
230 | TABLE.list TR:nth-child(odd) { | |
231 | background: #f4f4f4; | |
232 | } | |
233 | ||
5a738aea MS |
234 | DT { |
235 | margin-left: 36pt; | |
236 | margin-top: 12pt; | |
237 | } | |
238 | ||
239 | DD { | |
240 | margin-left: 54pt; | |
241 | } | |
242 | ||
243 | DL.category DT { | |
244 | font-weight: bold; | |
245 | } | |
246 | ||
247 | P.summary { | |
248 | margin-left: 36pt; | |
249 | font-family: monaco, courier, monospace; | |
250 | } | |
251 | ||
5a738aea MS |
252 | DIV.summary TABLE { |
253 | border: solid thin #999999; | |
254 | border-collapse: collapse; | |
255 | border-spacing: 0; | |
256 | margin: 10px; | |
257 | } | |
258 | ||
259 | DIV.summary TABLE TD, DIV.summary TABLE TH { | |
260 | border: solid thin #999999; | |
261 | padding: 5px; | |
262 | text-align: left; | |
263 | vertical-align: top; | |
264 | } | |
265 | ||
266 | DIV.summary TABLE THEAD TH { | |
267 | background: #eeeeee; | |
268 | } | |
269 | ||
270 | /* API documentation styles... */ | |
271 | div.body h1 { | |
272 | margin: 0; | |
273 | } | |
274 | div.body h2 { | |
275 | margin-top: 1.5em; | |
276 | } | |
277 | div.body h3, div.body h4, div.body h5 { | |
278 | margin-bottom: 0.5em; | |
279 | margin-top: 1.5em; | |
280 | } | |
281 | .class, .enumeration, .function, .struct, .typedef, .union { | |
282 | border-bottom: solid thin #999999; | |
283 | margin-bottom: 0; | |
284 | margin-top: 2em; | |
285 | } | |
286 | .description { | |
287 | margin-top: 0.5em; | |
288 | } | |
289 | code, p.code, pre, ul.code li { | |
290 | font-family: monaco, courier, monospace; | |
291 | font-size: 90%; | |
292 | } | |
293 | ul.code, ul.contents, ul.subcontents { | |
294 | list-style-type: none; | |
295 | margin: 0; | |
296 | padding-left: 0; | |
297 | } | |
298 | ul.code li { | |
299 | margin: 0; | |
300 | } | |
301 | ul.contents > li { | |
302 | margin-top: 1em; | |
303 | } | |
304 | ul.contents li ul.code, ul.contents li ul.subcontents { | |
305 | padding-left: 2em; | |
306 | } | |
307 | div.body dl { | |
308 | margin-left: 0; | |
309 | margin-top: 0; | |
310 | } | |
311 | div.body dt { | |
312 | font-style: italic; | |
313 | margin-left: 0; | |
314 | margin-top: 0; | |
315 | } | |
316 | div.body dd { | |
317 | margin-bottom: 0.5em; | |
318 | } | |
319 | ||
320 | /* This is just for the HTML files generated with the framedhelp target */ | |
321 | div.contents { | |
322 | background: #e8e8e8; | |
323 | border: solid thin black; | |
324 | padding: 10px; | |
325 | } | |
326 | div.contents h1 { | |
327 | font-size: 110%; | |
328 | } | |
329 | div.contents h2 { | |
330 | font-size: 100%; | |
331 | } | |
332 | div.contents ul.contents { | |
333 | font-size: 80%; | |
334 | } | |
ac884b6a MS |
335 | div.contents ul.subcontents li { |
336 | margin-left: 1em; | |
337 | text-indent: -1em; | |
338 | } | |
5a738aea | 339 | --></style> |
ef416fc2 | 340 | </head> |
341 | <body> | |
5a738aea MS |
342 | <div class='body'> |
343 | <!-- | |
68b10830 | 344 | "$Id$" |
5a738aea | 345 | |
321d8d57 | 346 | CUPS API header for CUPS. |
5a738aea | 347 | |
321d8d57 | 348 | Copyright 2008-2011 by Apple Inc. |
5a738aea MS |
349 | |
350 | These coded instructions, statements, and computer programs are the | |
351 | property of Apple Inc. and are protected by Federal copyright | |
352 | law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
353 | which should have been included with this file. If this file is | |
354 | file is missing or damaged, see the license at "http://www.cups.org/". | |
355 | --> | |
356 | ||
178cb736 MS |
357 | <h1 class='title'>CUPS API</h1> |
358 | ||
5a738aea MS |
359 | <div class='summary'><table summary='General Information'> |
360 | <thead> | |
361 | <tr> | |
362 | <th>Header</th> | |
363 | <th>cups/cups.h</th> | |
364 | </tr> | |
365 | </thead> | |
366 | <tbody> | |
367 | <tr> | |
368 | <th>Library</th> | |
369 | <td>-lcups</td> | |
370 | </tr> | |
371 | <tr> | |
372 | <th>See Also</th> | |
373 | <td>Programming: <a href='api-overview.html' target='_top'>Introduction to CUPS Programming</a><br> | |
374 | Programming: <a href='api-array.html' target='_top'>Array API</a><br> | |
375 | Programming: <a href='api-filedir.html' target='_top'>File and Directory APIs</a><br> | |
376 | Programming: <a href='api-filter.html' target='_top'>Filter and Backend Programming</a><br> | |
377 | Programming: <a href='api-httpipp.html' target='_top'>HTTP and IPP APIs</a><br> | |
378 | Programming: <a href='api-ppd.html' target='_top'>PPD API</a><br> | |
379 | Programming: <a href='api-raster.html' target='_top'>Raster API</a></td> | |
380 | </tr> | |
381 | </tbody> | |
382 | </table></div> | |
383 | <h2 class="title">Contents</h2> | |
384 | <ul class="contents"> | |
5a738aea | 385 | <li><a href="#OVERVIEW">Overview</a><ul class="subcontents"> |
0268488e MS |
386 | <li><a href="#CLIENTS_AND_SERVERS">Clients and Servers</a></li> |
387 | <li><a href="#PRINTERS_AND_CLASSES">Printers and Classes</a></li> | |
388 | <li><a href="#OPTIONS">Options</a></li> | |
389 | <li><a href="#PRINT_JOBS">Print Jobs</a></li> | |
390 | <li><a href="#ERROR_HANDLING">Error Handling</a></li> | |
391 | <li><a href="#PASSWORDS_AND_AUTHENTICATION">Passwords and Authentication</a></li> | |
5a738aea MS |
392 | </ul></li> |
393 | <li><a href="#FUNCTIONS">Functions</a><ul class="code"> | |
82f97232 | 394 | <li><a href="#appleGetPaperSize" title="Get the default paper size.">appleGetPaperSize</a></li> |
0268488e MS |
395 | <li><a href="#cupsAddDest" title="Add a destination to the list of destinations.">cupsAddDest</a></li> |
396 | <li><a href="#cupsAddOption" title="Add an option to an option array.">cupsAddOption</a></li> | |
397 | <li><a href="#cupsAdminCreateWindowsPPD" title="Create the Windows PPD file for a printer.">cupsAdminCreateWindowsPPD</a></li> | |
398 | <li><a href="#cupsAdminExportSamba" title="Export a printer to Samba.">cupsAdminExportSamba</a></li> | |
399 | <li><a href="#cupsAdminGetServerSettings" title="Get settings from the server.">cupsAdminGetServerSettings</a></li> | |
400 | <li><a href="#cupsAdminSetServerSettings" title="Set settings on the server.">cupsAdminSetServerSettings</a></li> | |
401 | <li><a href="#cupsCancelJob" title="Cancel a print job on the default server.">cupsCancelJob</a></li> | |
402 | <li><a href="#cupsCancelJob2" title="Cancel or purge a print job.">cupsCancelJob2</a></li> | |
3e7fe0ca MS |
403 | <li><a href="#cupsConnectDest" title="Connect to the server for a destination.">cupsConnectDest</a></li> |
404 | <li><a href="#cupsConnectDestBlock" title="Connect to the server for a destination.">cupsConnectDestBlock</a></li> | |
405 | <li><a href="#cupsCopyDest" title="Callback block">cupsCopyDest</a></li> | |
0268488e MS |
406 | <li><a href="#cupsCreateJob" title="Create an empty job for streaming.">cupsCreateJob</a></li> |
407 | <li><a href="#cupsEncryption" title="Get the current encryption settings.">cupsEncryption</a></li> | |
3e7fe0ca MS |
408 | <li><a href="#cupsEnumDests" title="Enumerate available destinations with a callback function.">cupsEnumDests</a></li> |
409 | <li><a href="#cupsEnumDestsBlock" title="Enumerate available destinations with a block.">cupsEnumDestsBlock</a></li> | |
0268488e MS |
410 | <li><a href="#cupsFinishDocument" title="Finish sending a document.">cupsFinishDocument</a></li> |
411 | <li><a href="#cupsFreeDests" title="Free the memory used by the list of destinations.">cupsFreeDests</a></li> | |
412 | <li><a href="#cupsFreeJobs" title="Free memory used by job data.">cupsFreeJobs</a></li> | |
413 | <li><a href="#cupsFreeOptions" title="Free all memory used by options.">cupsFreeOptions</a></li> | |
414 | <li><a href="#cupsGetClasses" title="Get a list of printer classes from the default server.">cupsGetClasses</a></li> | |
415 | <li><a href="#cupsGetDefault" title="Get the default printer or class for the default server.">cupsGetDefault</a></li> | |
416 | <li><a href="#cupsGetDefault2" title="Get the default printer or class for the specified server.">cupsGetDefault2</a></li> | |
417 | <li><a href="#cupsGetDest" title="Get the named destination from the list.">cupsGetDest</a></li> | |
418 | <li><a href="#cupsGetDests" title="Get the list of destinations from the default server.">cupsGetDests</a></li> | |
419 | <li><a href="#cupsGetDests2" title="Get the list of destinations from the specified server.">cupsGetDests2</a></li> | |
420 | <li><a href="#cupsGetJobs" title="Get the jobs from the default server.">cupsGetJobs</a></li> | |
421 | <li><a href="#cupsGetJobs2" title="Get the jobs from the specified server.">cupsGetJobs2</a></li> | |
422 | <li><a href="#cupsGetNamedDest" title="Get options for the named destination.">cupsGetNamedDest</a></li> | |
423 | <li><a href="#cupsGetOption" title="Get an option value.">cupsGetOption</a></li> | |
424 | <li><a href="#cupsGetPPD" title="Get the PPD file for a printer on the default server.">cupsGetPPD</a></li> | |
425 | <li><a href="#cupsGetPPD2" title="Get the PPD file for a printer from the specified server.">cupsGetPPD2</a></li> | |
426 | <li><a href="#cupsGetPPD3" title="Get the PPD file for a printer on the specified | |
5a738aea | 427 | server if it has changed.">cupsGetPPD3</a></li> |
0268488e MS |
428 | <li><a href="#cupsGetPassword" title="Get a password from the user.">cupsGetPassword</a></li> |
429 | <li><a href="#cupsGetPassword2" title="Get a password from the user using the advanced | |
aaf19ab0 | 430 | password callback.">cupsGetPassword2</a></li> |
0268488e MS |
431 | <li><a href="#cupsGetPrinters" title="Get a list of printers from the default server.">cupsGetPrinters</a></li> |
432 | <li><a href="#cupsGetServerPPD" title="Get an available PPD file from the server.">cupsGetServerPPD</a></li> | |
433 | <li><a href="#cupsLangDefault" title="Return the default language.">cupsLangDefault</a></li> | |
434 | <li><a href="#cupsLangEncoding" title="Return the character encoding (us-ascii, etc.) | |
5a738aea | 435 | for the given language.">cupsLangEncoding</a></li> |
0268488e MS |
436 | <li><a href="#cupsLangFlush" title="Flush all language data out of the cache.">cupsLangFlush</a></li> |
437 | <li><a href="#cupsLangFree" title="Free language data.">cupsLangFree</a></li> | |
438 | <li><a href="#cupsLangGet" title="Get a language.">cupsLangGet</a></li> | |
439 | <li><a href="#cupsNotifySubject" title="Return the subject for the given notification message.">cupsNotifySubject</a></li> | |
440 | <li><a href="#cupsNotifyText" title="Return the text for the given notification message.">cupsNotifyText</a></li> | |
441 | <li><a href="#cupsParseOptions" title="Parse options from a command-line argument.">cupsParseOptions</a></li> | |
442 | <li><a href="#cupsPrintFile" title="Print a file to a printer or class on the default server.">cupsPrintFile</a></li> | |
443 | <li><a href="#cupsPrintFile2" title="Print a file to a printer or class on the specified | |
5a738aea | 444 | server.">cupsPrintFile2</a></li> |
0268488e | 445 | <li><a href="#cupsPrintFiles" title="Print one or more files to a printer or class on the |
5a738aea | 446 | default server.">cupsPrintFiles</a></li> |
0268488e | 447 | <li><a href="#cupsPrintFiles2" title="Print one or more files to a printer or class on the |
5a738aea | 448 | specified server.">cupsPrintFiles2</a></li> |
0268488e MS |
449 | <li><a href="#cupsRemoveDest" title="Remove a destination from the destination list.">cupsRemoveDest</a></li> |
450 | <li><a href="#cupsRemoveOption" title="Remove an option from an option array.">cupsRemoveOption</a></li> | |
451 | <li><a href="#cupsServer" title="Return the hostname/address of the current server.">cupsServer</a></li> | |
452 | <li><a href="#cupsSetClientCertCB" title="Set the client certificate callback.">cupsSetClientCertCB</a></li> | |
453 | <li><a href="#cupsSetCredentials" title="Set the default credentials to be used for SSL/TLS | |
10d09e33 | 454 | connections.">cupsSetCredentials</a></li> |
0268488e MS |
455 | <li><a href="#cupsSetDefaultDest" title="Set the default destination.">cupsSetDefaultDest</a></li> |
456 | <li><a href="#cupsSetDests" title="Save the list of destinations for the default server.">cupsSetDests</a></li> | |
457 | <li><a href="#cupsSetDests2" title="Save the list of destinations for the specified server.">cupsSetDests2</a></li> | |
458 | <li><a href="#cupsSetEncryption" title="Set the encryption preference.">cupsSetEncryption</a></li> | |
459 | <li><a href="#cupsSetPasswordCB" title="Set the password callback for CUPS.">cupsSetPasswordCB</a></li> | |
460 | <li><a href="#cupsSetPasswordCB2" title="Set the advanced password callback for CUPS.">cupsSetPasswordCB2</a></li> | |
461 | <li><a href="#cupsSetServer" title="Set the default server name and port.">cupsSetServer</a></li> | |
462 | <li><a href="#cupsSetServerCertCB" title="Set the server certificate callback.">cupsSetServerCertCB</a></li> | |
463 | <li><a href="#cupsSetUser" title="Set the default user name.">cupsSetUser</a></li> | |
464 | <li><a href="#cupsStartDocument" title="Add a document to a job created with cupsCreateJob().">cupsStartDocument</a></li> | |
465 | <li><a href="#cupsTempFd" title="Creates a temporary file.">cupsTempFd</a></li> | |
466 | <li><a href="#cupsTempFile" title="Generates a temporary filename.">cupsTempFile</a></li> | |
467 | <li><a href="#cupsTempFile2" title="Creates a temporary CUPS file.">cupsTempFile2</a></li> | |
468 | <li><a href="#cupsUser" title="Return the current user's name.">cupsUser</a></li> | |
8b450588 | 469 | </ul></li> |
5a738aea | 470 | <li><a href="#TYPES">Data Types</a><ul class="code"> |
3e7fe0ca MS |
471 | <li><a href="#cups_client_cert_cb_t" title="Client credentials callback |
472 | ">cups_client_cert_cb_t</a></li> | |
473 | <li><a href="#cups_dest_block_t" title="Destination enumeration block | |
474 | ">cups_dest_block_t</a></li> | |
475 | <li><a href="#cups_dest_cb_t" title="Destination enumeration callback | |
476 | ">cups_dest_cb_t</a></li> | |
5a738aea | 477 | <li><a href="#cups_dest_t" title="Destination">cups_dest_t</a></li> |
3e7fe0ca MS |
478 | <li><a href="#cups_device_cb_t" title="Device callback |
479 | ">cups_device_cb_t</a></li> | |
480 | <li><a href="#cups_dinfo_t" title="Destination capability and status | |
481 | information ">cups_dinfo_t</a></li> | |
5a738aea MS |
482 | <li><a href="#cups_job_t" title="Job">cups_job_t</a></li> |
483 | <li><a href="#cups_option_t" title="Printer Options">cups_option_t</a></li> | |
3e7fe0ca MS |
484 | <li><a href="#cups_password_cb2_t" title="New password callback |
485 | ">cups_password_cb2_t</a></li> | |
5a738aea MS |
486 | <li><a href="#cups_password_cb_t" title="Password callback">cups_password_cb_t</a></li> |
487 | <li><a href="#cups_ptype_t" title="Printer type/capability bits">cups_ptype_t</a></li> | |
3e7fe0ca MS |
488 | <li><a href="#cups_server_cert_cb_t" title="Server credentials callback |
489 | ">cups_server_cert_cb_t</a></li> | |
490 | <li><a href="#cups_size_t" title="Media Size ">cups_size_t</a></li> | |
5a738aea MS |
491 | </ul></li> |
492 | <li><a href="#STRUCTURES">Structures</a><ul class="code"> | |
493 | <li><a href="#cups_dest_s" title="Destination">cups_dest_s</a></li> | |
494 | <li><a href="#cups_job_s" title="Job">cups_job_s</a></li> | |
495 | <li><a href="#cups_option_s" title="Printer Options">cups_option_s</a></li> | |
3e7fe0ca | 496 | <li><a href="#cups_size_s" title="Media Size ">cups_size_s</a></li> |
5a738aea | 497 | </ul></li> |
22c9029b MS |
498 | <li><a href="#VARIABLES">Variables</a><ul class="code"> |
499 | <li><a href="#CF_RETURNS_RETAINED" title="Get the Apple language identifier associated with a | |
500 | locale ID.">CF_RETURNS_RETAINED</a></li> | |
501 | </ul></li> | |
5a738aea | 502 | <li><a href="#ENUMERATIONS">Constants</a><ul class="code"> |
3e7fe0ca MS |
503 | <li><a href="#cups_ptype_e" title="Printer type/capability bit |
504 | constants">cups_ptype_e</a></li> | |
5a738aea | 505 | </ul></li> |
0268488e | 506 | </ul> |
ef416fc2 | 507 | <!-- |
68b10830 | 508 | "$Id$" |
ef416fc2 | 509 | |
eac3a0a0 | 510 | API introduction for CUPS. |
ef416fc2 | 511 | |
eac3a0a0 | 512 | Copyright 2007-2011 by Apple Inc. |
bc44d920 | 513 | Copyright 1997-2006 by Easy Software Products, all rights reserved. |
ef416fc2 | 514 | |
515 | These coded instructions, statements, and computer programs are the | |
bc44d920 | 516 | property of Apple Inc. and are protected by Federal copyright |
517 | law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
518 | which should have been included with this file. If this file is | |
519 | file is missing or damaged, see the license at "http://www.cups.org/". | |
ef416fc2 | 520 | --> |
521 | ||
5a738aea MS |
522 | <h2 class='title'><a name='OVERVIEW'>Overview</a></h2> |
523 | ||
524 | <p>The CUPS API provides the convenience functions needed to support | |
525 | applications, filters, printer drivers, and backends that need to interface | |
526 | with the CUPS scheduler.</p> | |
ef416fc2 | 527 | |
568fa3fa MS |
528 | <h3><a name='CLIENTS_AND_SERVERS'>Clients and Servers</a></h3> |
529 | ||
530 | <p>CUPS is based on the Internet Printing Protocol ("IPP"), which allows | |
531 | clients (applications) to communicate with a server (the scheduler) to get a | |
532 | list of printers, send print jobs, and so forth. You identify which server | |
533 | you want to communicate with using a pointer to the opaque structure | |
534 | <code>http_t</code>. All of the examples in this document use the | |
535 | <code>CUPS_HTTP_DEFAULT</code> constant, referring to the default connection | |
536 | to the scheduler. The <a href='api-httpipp.html' target='_top'>HTTP and IPP | |
537 | APIs</a> document provides more information on server connections.</p> | |
538 | ||
5a738aea | 539 | <h3><a name='PRINTERS_AND_CLASSES'>Printers and Classes</a></h3> |
ecdc0628 | 540 | |
5a738aea MS |
541 | <p>Printers and classes (collections of printers) are accessed through |
542 | the <a href="#cups_dest_t"><code>cups_dest_t</code></a> structure which | |
543 | includes the name (<code>name</code>), instance (<code>instance</code> - | |
568fa3fa MS |
544 | a way of selecting certain saved options/settings), and the options and |
545 | attributes associated with that destination (<code>num_options</code> and | |
5a738aea MS |
546 | <code>options</code>). Destinations are created using the |
547 | <a href="#cupsGetDests"><code>cupsGetDests</code></a> function and freed | |
548 | using the <a href='#cupsFreeDests'><code>cupsFreeDests</code></a> function. | |
549 | The <a href='#cupsGetDest'><code>cupsGetDest</code></a> function finds a | |
550 | specific destination for printing:</p> | |
ef416fc2 | 551 | |
5a738aea MS |
552 | <pre class='example'> |
553 | #include <cups/cups.h> | |
ef416fc2 | 554 | |
5a738aea MS |
555 | <a href='#cups_dest_t'>cups_dest_t</a> *dests; |
556 | int num_dests = <a href='#cupsGetDests'>cupsGetDests</a>(&dests); | |
557 | <a href='#cups_dest_t'>cups_dest_t</a> *dest = <a href='#cupsGetDest'>cupsGetDest</a>("name", NULL, num_dests, dests); | |
ef416fc2 | 558 | |
eac3a0a0 | 559 | /* do something with dest */ |
ef416fc2 | 560 | |
5a738aea | 561 | <a href='#cupsFreeDests'>cupsFreeDests</a>(num_dests, dests); |
ef416fc2 | 562 | </pre> |
563 | ||
5a738aea MS |
564 | <p>Passing <code>NULL</code> to |
565 | <a href='#cupsGetDest'><code>cupsGetDest</code></a> for the destination name | |
566 | will return the default destination. Similarly, passing a <code>NULL</code> | |
567 | instance will return the default instance for that destination.</p> | |
ef416fc2 | 568 | |
5a738aea MS |
569 | <div class='table'><table summary='Table 1: Printer Attributes' width='80%'> |
570 | <caption>Table 1: <a name='TABLE1'>Printer Attributes</a></caption> | |
571 | <thead> | |
572 | <tr> | |
573 | <th>Attribute Name</th> | |
574 | <th>Description</th> | |
575 | </tr> | |
576 | </thead> | |
ef416fc2 | 577 | <tbody> |
5a738aea MS |
578 | <tr> |
579 | <td>"auth-info-required"</td> | |
580 | <td>The type of authentication required for printing to this | |
581 | destination: "none", "username,password", "domain,username,password", | |
582 | or "negotiate" (Kerberos)</td> | |
583 | </tr> | |
584 | <tr> | |
585 | <td>"printer-info"</td> | |
586 | <td>The human-readable description of the destination such as "My | |
587 | Laser Printer".</td> | |
588 | </tr> | |
589 | <tr> | |
590 | <td>"printer-is-accepting-jobs"</td> | |
aaf19ab0 MS |
591 | <td>"true" if the destination is accepting new jobs, "false" if |
592 | not.</td> | |
5a738aea MS |
593 | </tr> |
594 | <tr> | |
595 | <td>"printer-is-shared"</td> | |
aaf19ab0 MS |
596 | <td>"true" if the destination is being shared with other computers, |
597 | "false" if not.</td> | |
5a738aea MS |
598 | </tr> |
599 | <tr> | |
600 | <td>"printer-location"</td> | |
601 | <td>The human-readable location of the destination such as "Lab 4".</td> | |
602 | </tr> | |
603 | <tr> | |
604 | <td>"printer-make-and-model"</td> | |
605 | <td>The human-readable make and model of the destination such as "HP | |
606 | LaserJet 4000 Series".</td> | |
607 | </tr> | |
608 | <tr> | |
609 | <td>"printer-state"</td> | |
610 | <td>"3" if the destination is idle, "4" if the destination is printing | |
611 | a job, and "5" if the destination is stopped.</td> | |
612 | </tr> | |
613 | <tr> | |
614 | <td>"printer-state-change-time"</td> | |
615 | <td>The UNIX time when the destination entered the current state.</td> | |
616 | </tr> | |
617 | <tr> | |
618 | <td>"printer-state-reasons"</td> | |
619 | <td>Additional comma-delimited state keywords for the destination | |
620 | such as "media-tray-empty-error" and "toner-low-warning".</td> | |
621 | </tr> | |
622 | <tr> | |
623 | <td>"printer-type"</td> | |
624 | <td>The <a href='#cups_printer_t'><code>cups_printer_t</code></a> | |
625 | value associated with the destination.</td> | |
626 | </tr> | |
627 | </tbody> | |
628 | </table></div> | |
629 | ||
630 | <h3><a name='OPTIONS'>Options</a></h3> | |
631 | ||
632 | <p>Options are stored in arrays of | |
633 | <a href='#cups_option_t'><code>cups_option_t</code></a> structures. Each | |
634 | option has a name (<code>name</code>) and value (<code>value</code>) | |
635 | associated with it. The <a href='#cups_dest_t'><code>cups_dest_t</code></a> | |
636 | <code>num_options</code> and <code>options</code> members contain the | |
637 | default options for a particular destination, along with several informational | |
638 | attributes about the destination as shown in <a href='#TABLE1'>Table 1</a>. | |
639 | The <a href='#cupsGetOption'><code>cupsGetOption</code></a> function gets | |
640 | the value for the named option. For example, the following code lists the | |
641 | available destinations and their human-readable descriptions:</p> | |
642 | ||
643 | <pre class='example'> | |
644 | #include <cups/cups.h> | |
645 | ||
646 | <a href='#cups_dest_t'>cups_dest_t</a> *dests; | |
647 | int num_dests = <a href='#cupsGetDests'>cupsGetDests</a>(&dests); | |
648 | <a href='#cups_dest_t'>cups_dest_t</a> *dest; | |
649 | int i; | |
650 | const char *value; | |
651 | ||
652 | for (i = num_dests, dest = dests; i > 0; i --, dest ++) | |
653 | if (dest->instance == NULL) | |
654 | { | |
655 | value = <a href='#cupsGetOption'>cupsGetOption</a>("printer-info", dest->num_options, dest->options); | |
656 | printf("%s (%s)\n", dest->name, value ? value : "no description"); | |
657 | } | |
658 | ||
659 | <a href='#cupsFreeDests'>cupsFreeDests</a>(num_dests, dests); | |
660 | </pre> | |
661 | ||
662 | <p>You can create your own option arrays using the | |
663 | <a href='#cupsAddOption'><code>cupsAddOption</code></a> function, which | |
664 | adds a single named option to an array:</p> | |
665 | ||
666 | <pre class='example'> | |
667 | #include <cups/cups.h> | |
668 | ||
669 | int num_options = 0; | |
670 | <a href='#cups_option_t'>cups_option_t</a> *options = NULL; | |
671 | ||
672 | /* The returned num_options value is updated as needed */ | |
673 | num_options = <a href='#cupsAddOption'>cupsAddOption</a>("first", "value", num_options, &options); | |
674 | ||
675 | /* This adds a second option value */ | |
676 | num_options = <a href='#cupsAddOption'>cupsAddOption</a>("second", "value", num_options, &options); | |
677 | ||
678 | /* This replaces the first option we added */ | |
679 | num_options = <a href='#cupsAddOption'>cupsAddOption</a>("first", "new value", num_options, &options); | |
680 | </pre> | |
681 | ||
682 | <p>Use a <code>for</code> loop to copy the options from a destination:</p> | |
683 | ||
684 | <pre class='example'> | |
685 | #include <cups/cups.h> | |
686 | ||
687 | int i; | |
688 | int num_options = 0; | |
689 | <a href='#cups_option_t'>cups_option_t</a> *options = NULL; | |
690 | <a href='#cups_dest_t'>cups_dest_t</a> *dest; | |
691 | ||
692 | for (i = 0; i < dest->num_options; i ++) | |
568fa3fa MS |
693 | num_options = <a href='#cupsAddOption'>cupsAddOption</a>(dest->options[i].name, dest->options[i].value, |
694 | num_options, &options); | |
5a738aea MS |
695 | </pre> |
696 | ||
697 | <p>Use the <a href='#cupsFreeOptions'><code>cupsFreeOptions</code></a> | |
698 | function to free the options array when you are done using it:</p> | |
699 | ||
700 | <pre class='example'> | |
701 | <a href='#cupsFreeOptions'>cupsFreeOptions</a>(num_options, options); | |
702 | </pre> | |
703 | ||
704 | <h3><a name='PRINT_JOBS'>Print Jobs</a></h3> | |
705 | ||
706 | <p>Print jobs are identified by a locally-unique job ID number from 1 to | |
707 | 2<sup>31</sup>-1 and have options and one or more files for printing to a | |
708 | single destination. The <a href='#cupsPrintFile'><code>cupsPrintFile</code></a> | |
709 | function creates a new job with one file. The following code prints the CUPS | |
710 | test page file:</p> | |
711 | ||
712 | <pre class='example'> | |
713 | #include <cups/cups.h> | |
714 | ||
715 | <a href='#cups_dest_t'>cups_dest_t</a> *dest; | |
716 | int num_options; | |
717 | <a href='#cups_option_t'>cups_option_t</a> *options; | |
718 | int job_id; | |
719 | ||
720 | /* Print a single file */ | |
568fa3fa MS |
721 | job_id = <a href='#cupsPrintFile'>cupsPrintFile</a>(dest->name, "/usr/share/cups/data/testprint.ps", |
722 | "Test Print", num_options, options); | |
5a738aea MS |
723 | </pre> |
724 | ||
725 | <p>The <a href='#cupsPrintFiles'><code>cupsPrintFiles</code></a> function | |
726 | creates a job with multiple files. The files are provided in a | |
727 | <code>char *</code> array:</p> | |
728 | ||
729 | <pre class='example'> | |
730 | #include <cups/cups.h> | |
731 | ||
732 | <a href='#cups_dest_t'>cups_dest_t</a> *dest; | |
733 | int num_options; | |
734 | <a href='#cups_option_t'>cups_option_t</a> *options; | |
735 | int job_id; | |
736 | char *files[3] = { "file1.pdf", "file2.pdf", "file3.pdf" }; | |
737 | ||
738 | /* Print three files */ | |
739 | job_id = <a href='#cupsPrintFiles'>cupsPrintFiles</a>(dest->name, 3, files, "Test Print", num_options, options); | |
740 | </pre> | |
741 | ||
742 | <p>Finally, the <a href='#cupsCreateJob'><code>cupsCreateJob</code></a> | |
743 | function creates a new job with no files in it. Files are added using the | |
744 | <a href='#cupsStartDocument'><code>cupsStartDocument</code></a>, | |
745 | <a href='api-httpipp.html#cupsWriteRequestData'><code>cupsWriteRequestData</code></a>, | |
746 | and <a href='#cupsFinishDocument'><code>cupsFinishDocument</code></a> functions. | |
747 | The following example creates a job with 10 text files for printing:</p> | |
748 | ||
749 | <pre class='example'> | |
750 | #include <cups/cups.h> | |
751 | ||
752 | <a href='#cups_dest_t'>cups_dest_t</a> *dest; | |
753 | int num_options; | |
754 | <a href='#cups_option_t'>cups_option_t</a> *options; | |
755 | int job_id; | |
756 | int i; | |
757 | char buffer[1024]; | |
758 | ||
759 | /* Create the job */ | |
568fa3fa MS |
760 | job_id = <a href='#cupsCreateJob'>cupsCreateJob</a>(CUPS_HTTP_DEFAULT, dest->name, "10 Text Files", |
761 | num_options, options); | |
5a738aea MS |
762 | |
763 | /* If the job is created, add 10 files */ | |
764 | if (job_id > 0) | |
765 | { | |
766 | for (i = 1; i <= 10; i ++) | |
767 | { | |
768 | snprintf(buffer, sizeof(buffer), "file%d.txt", i); | |
769 | ||
568fa3fa MS |
770 | <a href='#cupsStartDocument'>cupsStartDocument</a>(CUPS_HTTP_DEFAULT, dest->name, job_id, buffer, |
771 | CUPS_FORMAT_TEXT, i == 10); | |
5a738aea MS |
772 | |
773 | snprintf(buffer, sizeof(buffer), | |
774 | "File %d\n" | |
775 | "\n" | |
776 | "One fish,\n" | |
777 | "Two fish,\n | |
778 | "Red fish,\n | |
779 | "Blue fish\n", i); | |
780 | ||
781 | /* cupsWriteRequestData can be called as many times as needed */ | |
782 | <a href='#cupsWriteRequestData'>cupsWriteRequestData</a>(CUPS_HTTP_DEFAULT, buffer, strlen(buffer)); | |
783 | ||
784 | <a href='#cupsFinishDocument'>cupsFinishDocument</a>(CUPS_HTTP_DEFAULT, dest->name); | |
785 | } | |
786 | } | |
787 | </pre> | |
788 | ||
789 | <p>Once you have created a job, you can monitor its status using the | |
790 | <a href='#cupsGetJobs'><code>cupsGetJobs</code></a> function, which returns | |
791 | an array of <a href='#cups_job_t'><code>cups_job_t</code></a> structures. | |
792 | Each contains the job ID (<code>id</code>), destination name | |
793 | (<code>dest</code>), title (<code>title</code>), and other information | |
794 | associated with the job. The job array is freed using the | |
795 | <a href='#cupsFreeJobs'><code>cupsFreeJobs</code></a> function. The following | |
796 | example monitors a specific job ID, showing the current job state once every | |
797 | 5 seconds until the job is completed:</p> | |
798 | ||
799 | <pre class='example'> | |
800 | #include <cups/cups.h> | |
801 | ||
802 | <a href='#cups_dest_t'>cups_dest_t</a> *dest; | |
803 | int job_id; | |
804 | int num_jobs; | |
805 | <a href='#cups_job_t'>cups_job_t</a> *jobs; | |
806 | int i; | |
807 | ipp_jstate_t job_state = IPP_JOB_PENDING; | |
808 | ||
809 | while (job_state < IPP_JOB_STOPPED) | |
810 | { | |
811 | /* Get my jobs (1) with any state (-1) */ | |
812 | num_jobs = <a href='#cupsGetJobs'>cupsGetJobs</a>(&jobs, dest->name, 1, -1); | |
813 | ||
814 | /* Loop to find my job */ | |
815 | job_state = IPP_JOB_COMPLETED; | |
816 | ||
817 | for (i = 0; i < num_jobs; i ++) | |
818 | if (jobs[i].id == job_id) | |
819 | { | |
820 | job_state = jobs[i].state; | |
821 | break; | |
822 | } | |
823 | ||
824 | /* Free the job array */ | |
825 | <a href='#cupsFreeJobs'>cupsFreeJobs</a>(num_jobs, jobs); | |
826 | ||
827 | /* Show the current state */ | |
828 | switch (job_state) | |
829 | { | |
830 | case IPP_JOB_PENDING : | |
831 | printf("Job %d is pending.\n", job_id); | |
832 | break; | |
833 | case IPP_JOB_HELD : | |
834 | printf("Job %d is held.\n", job_id); | |
835 | break; | |
836 | case IPP_JOB_PROCESSING : | |
837 | printf("Job %d is processing.\n", job_id); | |
838 | break; | |
839 | case IPP_JOB_STOPPED : | |
840 | printf("Job %d is stopped.\n", job_id); | |
841 | break; | |
842 | case IPP_JOB_CANCELED : | |
843 | printf("Job %d is canceled.\n", job_id); | |
844 | break; | |
845 | case IPP_JOB_ABORTED : | |
846 | printf("Job %d is aborted.\n", job_id); | |
847 | break; | |
848 | case IPP_JOB_COMPLETED : | |
849 | printf("Job %d is completed.\n", job_id); | |
850 | break; | |
851 | } | |
852 | ||
853 | /* Sleep if the job is not finished */ | |
854 | if (job_state < IPP_JOB_STOPPED) | |
855 | sleep(5); | |
856 | } | |
857 | </pre> | |
858 | ||
859 | <p>To cancel a job, use the | |
860 | <a href='#cupsCancelJob'><code>cupsCancelJob</code></a> function with the | |
861 | job ID:</p> | |
862 | ||
568fa3fa | 863 | <pre class='example'> |
5a738aea MS |
864 | #include <cups/cups.h> |
865 | ||
866 | <a href='#cups_dest_t'>cups_dest_t</a> *dest; | |
867 | int job_id; | |
868 | ||
869 | <a href='#cupsCancelJob'>cupsCancelJob</a>(dest->name, job_id); | |
870 | </pre> | |
871 | ||
872 | <h3><a name='ERROR_HANDLING'>Error Handling</a></h3> | |
873 | ||
874 | <p>If any of the CUPS API printing functions returns an error, the reason for | |
875 | that error can be found by calling the | |
876 | <a href='#cupsLastError'><code>cupsLastError</code></a> and | |
877 | <a href='#cupsLastErrorString'><code>cupsLastErrorString</code></a> functions. | |
878 | <a href='#cupsLastError'><code>cupsLastError</code></a> returns the last IPP | |
879 | error code | |
880 | (<a href='api-httpipp.html#ipp_status_t'><code>ipp_status_t</code></a>) | |
881 | that was encountered, while | |
882 | <a href='#cupsLastErrorString'><code>cupsLastErrorString</code></a> returns | |
883 | a (localized) human-readable string that can be shown to the user. For example, | |
884 | if any of the job creation functions returns a job ID of 0, you can use | |
885 | <a href='#cupsLastErrorString'><code>cupsLastErrorString</code></a> to show | |
886 | the reason why the job could not be created:</p> | |
887 | ||
888 | <pre class='example'> | |
889 | #include <cups/cups.h> | |
890 | ||
891 | int job_id; | |
892 | ||
893 | if (job_id == 0) | |
894 | puts(cupsLastErrorString()); | |
895 | </pre> | |
896 | ||
897 | <h3><a name='PASSWORDS_AND_AUTHENTICATION'>Passwords and Authentication</a></h3> | |
898 | ||
899 | <p>CUPS supports authentication of any request, including submission of print | |
900 | jobs. The default mechanism for getting the username and password is to use the | |
901 | login user and a password from the console.</p> | |
902 | ||
903 | <p>To support other types of applications, in particular Graphical User | |
904 | Interfaces ("GUIs"), the CUPS API provides functions to set the default | |
905 | username and to register a callback function that returns a password string.</p> | |
906 | ||
907 | <p>The <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a> | |
908 | function is used to set a password callback in your program. Only one | |
909 | function can be used at any time.</p> | |
910 | ||
911 | <p>The <a href="#cupsSetUser"><code>cupsSetUser</code></a> function sets the | |
912 | current username for authentication. This function can be called by your | |
913 | password callback function to change the current username as needed.</p> | |
914 | ||
915 | <p>The following example shows a simple password callback that gets a | |
916 | username and password from the user:</p> | |
917 | ||
918 | <pre class='example'> | |
919 | #include <cups/cups.h> | |
920 | ||
921 | const char * | |
922 | my_password_cb(const char *prompt) | |
923 | { | |
924 | char user[65]; | |
925 | ||
926 | ||
927 | puts(prompt); | |
928 | ||
929 | /* Get a username from the user */ | |
930 | printf("Username: "); | |
931 | if (fgets(user, sizeof(user), stdin) == NULL) | |
932 | return (NULL); | |
933 | ||
934 | /* Strip the newline from the string and set the user */ | |
935 | user[strlen(user) - 1] = '\0'; | |
936 | ||
937 | <a href='#cupsSetUser'>cupsSetUser</a>(user); | |
938 | ||
939 | /* Use getpass() to ask for the password... */ | |
940 | return (getpass("Password: ")); | |
941 | } | |
942 | ||
943 | <a href='#cupsSetPasswordCB'>cupsSetPasswordCB</a>(my_password_cb); | |
944 | </pre> | |
945 | ||
946 | <p>Similarly, a GUI could display the prompt string in a window with input | |
947 | fields for the username and password. The username should default to the | |
948 | string returned by the <a href="#cupsUser"><code>cupsUser</code></a> | |
949 | function.</p> | |
950 | <h2 class="title"><a name="FUNCTIONS">Functions</a></h2> | |
82f97232 MS |
951 | <h3 class="function"><a name="appleGetPaperSize">appleGetPaperSize</a></h3> |
952 | <p class="description">Get the default paper size.</p> | |
953 | <p class="code"> | |
954 | char *appleGetPaperSize (<br> | |
955 | char *name,<br> | |
956 | int namesize<br> | |
957 | );</p> | |
958 | <h4 class="parameters">Parameters</h4> | |
959 | <dl> | |
960 | <dt>name</dt> | |
961 | <dd class="description">Paper size name buffer</dd> | |
962 | <dt>namesize</dt> | |
963 | <dd class="description">Size of buffer</dd> | |
964 | </dl> | |
965 | <h4 class="returnvalue">Return Value</h4> | |
966 | <p class="description">Default paper size</p> | |
5a738aea MS |
967 | <h3 class="function"><a name="cupsAddDest">cupsAddDest</a></h3> |
968 | <p class="description">Add a destination to the list of destinations.</p> | |
969 | <p class="code"> | |
970 | int cupsAddDest (<br> | |
971 | const char *name,<br> | |
972 | const char *instance,<br> | |
973 | int num_dests,<br> | |
974 | <a href="#cups_dest_t">cups_dest_t</a> **dests<br> | |
975 | );</p> | |
976 | <h4 class="parameters">Parameters</h4> | |
977 | <dl> | |
978 | <dt>name</dt> | |
979 | <dd class="description">Destination name</dd> | |
980 | <dt>instance</dt> | |
981 | <dd class="description">Instance name or <code>NULL</code> for none/primary</dd> | |
982 | <dt>num_dests</dt> | |
983 | <dd class="description">Number of destinations</dd> | |
984 | <dt>dests</dt> | |
985 | <dd class="description">Destinations</dd> | |
986 | </dl> | |
987 | <h4 class="returnvalue">Return Value</h4> | |
988 | <p class="description">New number of destinations</p> | |
989 | <h4 class="discussion">Discussion</h4> | |
990 | <p class="discussion">This function cannot be used to add a new class or printer queue, | |
2abf387c | 991 | it only adds a new container of saved options for the named |
5a738aea MS |
992 | destination or instance.<br> |
993 | <br> | |
994 | If the named destination already exists, the destination list is | |
2abf387c | 995 | returned unchanged. Adding a new instance of a destination creates |
5a738aea MS |
996 | a copy of that destination's options.<br> |
997 | <br> | |
998 | Use the <a href="#cupsSaveDests"><code>cupsSaveDests</code></a> function to save the updated list of | |
999 | destinations to the user's lpoptions file.</p> | |
1000 | <h3 class="function"><a name="cupsAddOption">cupsAddOption</a></h3> | |
1001 | <p class="description">Add an option to an option array.</p> | |
1002 | <p class="code"> | |
1003 | int cupsAddOption (<br> | |
1004 | const char *name,<br> | |
1005 | const char *value,<br> | |
1006 | int num_options,<br> | |
1007 | <a href="#cups_option_t">cups_option_t</a> **options<br> | |
1008 | );</p> | |
1009 | <h4 class="parameters">Parameters</h4> | |
1010 | <dl> | |
1011 | <dt>name</dt> | |
1012 | <dd class="description">Name of option</dd> | |
1013 | <dt>value</dt> | |
1014 | <dd class="description">Value of option</dd> | |
1015 | <dt>num_options</dt> | |
1016 | <dd class="description">Number of options</dd> | |
1017 | <dt>options</dt> | |
1018 | <dd class="description">Pointer to options</dd> | |
1019 | </dl> | |
1020 | <h4 class="returnvalue">Return Value</h4> | |
1021 | <p class="description">Number of options</p> | |
1022 | <h4 class="discussion">Discussion</h4> | |
1023 | <p class="discussion">New option arrays can be initialized simply by passing 0 for the | |
1024 | "num_options" parameter.</p> | |
426c6a59 MS |
1025 | <h3 class="function"><span class="info"> CUPS 1.2/Mac OS X 10.5 </span><a name="cupsAdminCreateWindowsPPD">cupsAdminCreateWindowsPPD</a></h3> |
1026 | <p class="description">Create the Windows PPD file for a printer.</p> | |
1027 | <p class="code"> | |
1028 | char *cupsAdminCreateWindowsPPD (<br> | |
1029 | http_t *http,<br> | |
1030 | const char *dest,<br> | |
1031 | char *buffer,<br> | |
1032 | int bufsize<br> | |
1033 | );</p> | |
1034 | <h4 class="parameters">Parameters</h4> | |
1035 | <dl> | |
1036 | <dt>http</dt> | |
1037 | <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd> | |
1038 | <dt>dest</dt> | |
1039 | <dd class="description">Printer or class</dd> | |
1040 | <dt>buffer</dt> | |
1041 | <dd class="description">Filename buffer</dd> | |
1042 | <dt>bufsize</dt> | |
1043 | <dd class="description">Size of filename buffer</dd> | |
1044 | </dl> | |
1045 | <h4 class="returnvalue">Return Value</h4> | |
1046 | <p class="description">PPD file or NULL</p> | |
1047 | <h3 class="function"><span class="info"> CUPS 1.2/Mac OS X 10.5 </span><a name="cupsAdminExportSamba">cupsAdminExportSamba</a></h3> | |
1048 | <p class="description">Export a printer to Samba.</p> | |
1049 | <p class="code"> | |
1050 | int cupsAdminExportSamba (<br> | |
1051 | const char *dest,<br> | |
1052 | const char *ppd,<br> | |
1053 | const char *samba_server,<br> | |
1054 | const char *samba_user,<br> | |
1055 | const char *samba_password,<br> | |
1056 | FILE *logfile<br> | |
1057 | );</p> | |
1058 | <h4 class="parameters">Parameters</h4> | |
1059 | <dl> | |
1060 | <dt>dest</dt> | |
1061 | <dd class="description">Destination to export</dd> | |
1062 | <dt>ppd</dt> | |
1063 | <dd class="description">PPD file</dd> | |
1064 | <dt>samba_server</dt> | |
1065 | <dd class="description">Samba server</dd> | |
1066 | <dt>samba_user</dt> | |
1067 | <dd class="description">Samba username</dd> | |
1068 | <dt>samba_password</dt> | |
1069 | <dd class="description">Samba password</dd> | |
1070 | <dt>logfile</dt> | |
1071 | <dd class="description">Log file, if any</dd> | |
1072 | </dl> | |
1073 | <h4 class="returnvalue">Return Value</h4> | |
1074 | <p class="description">1 on success, 0 on failure</p> | |
1075 | <h3 class="function"><span class="info"> CUPS 1.3/Mac OS X 10.5 </span><a name="cupsAdminGetServerSettings">cupsAdminGetServerSettings</a></h3> | |
1076 | <p class="description">Get settings from the server.</p> | |
1077 | <p class="code"> | |
1078 | int cupsAdminGetServerSettings (<br> | |
1079 | http_t *http,<br> | |
1080 | int *num_settings,<br> | |
1081 | <a href="#cups_option_t">cups_option_t</a> **settings<br> | |
1082 | );</p> | |
1083 | <h4 class="parameters">Parameters</h4> | |
1084 | <dl> | |
1085 | <dt>http</dt> | |
1086 | <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd> | |
1087 | <dt>num_settings</dt> | |
1088 | <dd class="description">Number of settings</dd> | |
1089 | <dt>settings</dt> | |
1090 | <dd class="description">Settings</dd> | |
1091 | </dl> | |
1092 | <h4 class="returnvalue">Return Value</h4> | |
1093 | <p class="description">1 on success, 0 on failure</p> | |
1094 | <h4 class="discussion">Discussion</h4> | |
1095 | <p class="discussion">The returned settings should be freed with cupsFreeOptions() when | |
1096 | you are done with them. | |
1097 | ||
1098 | </p> | |
1099 | <h3 class="function"><span class="info"> CUPS 1.3/Mac OS X 10.5 </span><a name="cupsAdminSetServerSettings">cupsAdminSetServerSettings</a></h3> | |
1100 | <p class="description">Set settings on the server.</p> | |
1101 | <p class="code"> | |
1102 | int cupsAdminSetServerSettings (<br> | |
1103 | http_t *http,<br> | |
1104 | int num_settings,<br> | |
1105 | <a href="#cups_option_t">cups_option_t</a> *settings<br> | |
1106 | );</p> | |
1107 | <h4 class="parameters">Parameters</h4> | |
1108 | <dl> | |
1109 | <dt>http</dt> | |
1110 | <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd> | |
1111 | <dt>num_settings</dt> | |
1112 | <dd class="description">Number of settings</dd> | |
1113 | <dt>settings</dt> | |
1114 | <dd class="description">Settings</dd> | |
1115 | </dl> | |
1116 | <h4 class="returnvalue">Return Value</h4> | |
1117 | <p class="description">1 on success, 0 on failure</p> | |
5a738aea MS |
1118 | <h3 class="function"><a name="cupsCancelJob">cupsCancelJob</a></h3> |
1119 | <p class="description">Cancel a print job on the default server.</p> | |
1120 | <p class="code"> | |
1121 | int cupsCancelJob (<br> | |
1122 | const char *name,<br> | |
1123 | int job_id<br> | |
1124 | );</p> | |
1125 | <h4 class="parameters">Parameters</h4> | |
1126 | <dl> | |
1127 | <dt>name</dt> | |
1128 | <dd class="description">Name of printer or class</dd> | |
1129 | <dt>job_id</dt> | |
568fa3fa | 1130 | <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 |
1131 | </dl> |
1132 | <h4 class="returnvalue">Return Value</h4> | |
1133 | <p class="description">1 on success, 0 on failure</p> | |
1134 | <h4 class="discussion">Discussion</h4> | |
1135 | <p class="discussion">Pass <code>CUPS_JOBID_ALL</code> to cancel all jobs or <code>CUPS_JOBID_CURRENT</code> | |
1136 | to cancel the current job on the named destination.<br> | |
1137 | <br> | |
1138 | Use the <a href="#cupsLastError"><code>cupsLastError</code></a> and <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> functions to get | |
1139 | the cause of any failure.</p> | |
178cb736 | 1140 | <h3 class="function"><span class="info"> CUPS 1.4/Mac OS X 10.6 </span><a name="cupsCancelJob2">cupsCancelJob2</a></h3> |
5a738aea MS |
1141 | <p class="description">Cancel or purge a print job.</p> |
1142 | <p class="code"> | |
1143 | ipp_status_t cupsCancelJob2 (<br> | |
1144 | http_t *http,<br> | |
1145 | const char *name,<br> | |
1146 | int job_id,<br> | |
1147 | int purge<br> | |
1148 | );</p> | |
1149 | <h4 class="parameters">Parameters</h4> | |
1150 | <dl> | |
1151 | <dt>http</dt> | |
568fa3fa | 1152 | <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd> |
5a738aea MS |
1153 | <dt>name</dt> |
1154 | <dd class="description">Name of printer or class</dd> | |
1155 | <dt>job_id</dt> | |
568fa3fa | 1156 | <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 |
1157 | <dt>purge</dt> |
1158 | <dd class="description">1 to purge, 0 to cancel</dd> | |
1159 | </dl> | |
1160 | <h4 class="returnvalue">Return Value</h4> | |
1161 | <p class="description">IPP status</p> | |
1162 | <h4 class="discussion">Discussion</h4> | |
1163 | <p class="discussion">Canceled jobs remain in the job history while purged jobs are removed | |
1164 | from the job history.<br> | |
1165 | <br> | |
1166 | Pass <code>CUPS_JOBID_ALL</code> to cancel all jobs or <code>CUPS_JOBID_CURRENT</code> | |
1167 | to cancel the current job on the named destination.<br> | |
1168 | <br> | |
1169 | Use the <a href="#cupsLastError"><code>cupsLastError</code></a> and <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> functions to get | |
bc44d920 | 1170 | the cause of any failure. |
5a738aea | 1171 | |
3e7fe0ca MS |
1172 | </p> |
1173 | <h3 class="function"><span class="info"> CUPS 1.6 </span><a name="cupsConnectDest">cupsConnectDest</a></h3> | |
1174 | <p class="description">Connect to the server for a destination.</p> | |
1175 | <p class="code"> | |
1176 | http_t *cupsConnectDest (<br> | |
1177 | <a href="#cups_dest_t">cups_dest_t</a> *dest,<br> | |
1178 | unsigned flags,<br> | |
1179 | int msec,<br> | |
1180 | int *cancel,<br> | |
1181 | char *resource,<br> | |
1182 | size_t resourcesize,<br> | |
1183 | <a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb,<br> | |
1184 | void *user_data<br> | |
1185 | );</p> | |
1186 | <h4 class="parameters">Parameters</h4> | |
1187 | <dl> | |
1188 | <dt>dest</dt> | |
1189 | <dd class="description">Destination</dd> | |
1190 | <dt>flags</dt> | |
1191 | <dd class="description">Connection flags</dd> | |
1192 | <dt>msec</dt> | |
1193 | <dd class="description">Timeout in milliseconds</dd> | |
1194 | <dt>cancel</dt> | |
1195 | <dd class="description">Pointer to "cancel" variable</dd> | |
1196 | <dt>resource</dt> | |
1197 | <dd class="description">Resource buffer</dd> | |
1198 | <dt>resourcesize</dt> | |
1199 | <dd class="description">Size of resource buffer</dd> | |
1200 | <dt>cb</dt> | |
1201 | <dd class="description">Callback function</dd> | |
1202 | <dt>user_data</dt> | |
1203 | <dd class="description">User data pointer</dd> | |
1204 | </dl> | |
1205 | <h4 class="returnvalue">Return Value</h4> | |
1206 | <p class="description">Connection to server or <code>NULL</code></p> | |
1207 | <h4 class="discussion">Discussion</h4> | |
1208 | <p class="discussion">Connect to the destination, returning a new http_t connection object and | |
1209 | optionally the resource path to use for the destination. These calls will | |
1210 | block until a connection is made, the timeout expires, the integer pointed | |
1211 | to by "cancel" is non-zero, or the callback function (or block) returns 0, | |
1212 | The caller is responsible for calling httpClose() on the returned object. | |
1213 | ||
1214 | </p> | |
1215 | <h3 class="function"><span class="info"> CUPS 1.6 </span><a name="cupsConnectDestBlock">cupsConnectDestBlock</a></h3> | |
1216 | <p class="description">Connect to the server for a destination.</p> | |
1217 | <p class="code"> | |
1218 | http_t *cupsConnectDestBlock (<br> | |
1219 | <a href="#cups_dest_t">cups_dest_t</a> *dest,<br> | |
1220 | unsigned flags,<br> | |
1221 | int msec,<br> | |
1222 | int *cancel,<br> | |
1223 | char *resource,<br> | |
1224 | size_t resourcesize,<br> | |
1225 | <a href="#cups_dest_block_t">cups_dest_block_t</a> block<br> | |
1226 | );</p> | |
1227 | <h4 class="parameters">Parameters</h4> | |
1228 | <dl> | |
1229 | <dt>dest</dt> | |
1230 | <dd class="description">Destination</dd> | |
1231 | <dt>flags</dt> | |
1232 | <dd class="description">Connection flags</dd> | |
1233 | <dt>msec</dt> | |
1234 | <dd class="description">Timeout in milliseconds</dd> | |
1235 | <dt>cancel</dt> | |
1236 | <dd class="description">Pointer to "cancel" variable</dd> | |
1237 | <dt>resource</dt> | |
1238 | <dd class="description">Resource buffer</dd> | |
1239 | <dt>resourcesize</dt> | |
1240 | <dd class="description">Size of resource buffer</dd> | |
1241 | <dt>block</dt> | |
1242 | <dd class="description">Callback block</dd> | |
1243 | </dl> | |
1244 | <h4 class="returnvalue">Return Value</h4> | |
1245 | <p class="description">Connection to server or <code>NULL</code></p> | |
1246 | <h4 class="discussion">Discussion</h4> | |
1247 | <p class="discussion">Connect to the destination, returning a new http_t connection object and | |
1248 | optionally the resource path to use for the destination. These calls will | |
1249 | block until a connection is made, the timeout expires, the integer pointed | |
1250 | to by "cancel" is non-zero, or the callback function (or block) returns 0, | |
1251 | The caller is responsible for calling httpClose() on the returned object. | |
1252 | ||
1253 | </p> | |
1254 | <h3 class="function"><a name="cupsCopyDest">cupsCopyDest</a></h3> | |
1255 | <p class="description">Callback block</p> | |
1256 | <p class="code"> | |
1257 | int cupsCopyDest (<br> | |
1258 | <a href="#cups_dest_t">cups_dest_t</a> *dest,<br> | |
1259 | int num_dests,<br> | |
1260 | <a href="#cups_dest_t">cups_dest_t</a> **dests<br> | |
1261 | );</p> | |
1262 | <h4 class="parameters">Parameters</h4> | |
1263 | <dl> | |
1264 | <dt>dest</dt> | |
1265 | <dt>num_dests</dt> | |
1266 | <dt>dests</dt> | |
1267 | </dl> | |
1268 | <h4 class="returnvalue">Return Value</h4> | |
1269 | <p class="description">Copy a destination.</p> | |
1270 | <p class="discussion">Make a copy of the destination to an array of destinations (or just a single | |
1271 | copy) - for use with the cupsEnumDests* functions. The caller is responsible | |
1272 | for calling cupsFreeDests() on the returned object(s). | |
1273 | ||
5a738aea | 1274 | </p> |
178cb736 | 1275 | <h3 class="function"><span class="info"> CUPS 1.4/Mac OS X 10.6 </span><a name="cupsCreateJob">cupsCreateJob</a></h3> |
568fa3fa | 1276 | <p class="description">Create an empty job for streaming.</p> |
5a738aea MS |
1277 | <p class="code"> |
1278 | int cupsCreateJob (<br> | |
1279 | http_t *http,<br> | |
1280 | const char *name,<br> | |
1281 | const char *title,<br> | |
1282 | int num_options,<br> | |
1283 | <a href="#cups_option_t">cups_option_t</a> *options<br> | |
1284 | );</p> | |
1285 | <h4 class="parameters">Parameters</h4> | |
1286 | <dl> | |
1287 | <dt>http</dt> | |
568fa3fa | 1288 | <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd> |
5a738aea | 1289 | <dt>name</dt> |
568fa3fa | 1290 | <dd class="description">Destination name</dd> |
5a738aea MS |
1291 | <dt>title</dt> |
1292 | <dd class="description">Title of job</dd> | |
1293 | <dt>num_options</dt> | |
1294 | <dd class="description">Number of options</dd> | |
1295 | <dt>options</dt> | |
1296 | <dd class="description">Options</dd> | |
1297 | </dl> | |
1298 | <h4 class="returnvalue">Return Value</h4> | |
1299 | <p class="description">Job ID or 0 on error</p> | |
1300 | <h4 class="discussion">Discussion</h4> | |
568fa3fa MS |
1301 | <p class="discussion">Use this function when you want to stream print data using the |
1302 | <a href="#cupsStartDocument"><code>cupsStartDocument</code></a>, <a href="#cupsWriteRequestData"><code>cupsWriteRequestData</code></a>, and | |
1303 | <a href="#cupsFinishDocument"><code>cupsFinishDocument</code></a> functions. If you have one or more files to | |
1304 | print, use the <a href="#cupsPrintFile2"><code>cupsPrintFile2</code></a> or <a href="#cupsPrintFiles2"><code>cupsPrintFiles2</code></a> function | |
1305 | instead. | |
5a738aea MS |
1306 | |
1307 | </p> | |
1308 | <h3 class="function"><a name="cupsEncryption">cupsEncryption</a></h3> | |
aaf19ab0 | 1309 | <p class="description">Get the current encryption settings.</p> |
5a738aea MS |
1310 | <p class="code"> |
1311 | http_encryption_t cupsEncryption (void);</p> | |
1312 | <h4 class="returnvalue">Return Value</h4> | |
1313 | <p class="description">Encryption settings</p> | |
1314 | <h4 class="discussion">Discussion</h4> | |
1315 | <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION | |
568fa3fa | 1316 | environment variable, then the ~/.cups/client.conf file, and finally the |
ef416fc2 | 1317 | /etc/cups/client.conf file. If not set, the default is |
aaf19ab0 MS |
1318 | <code>HTTP_ENCRYPT_IF_REQUESTED</code>.<br> |
1319 | <br> | |
1320 | Note: The current encryption setting is tracked separately for each thread | |
1321 | in a program. Multi-threaded programs that override the setting via the | |
1322 | <a href="#cupsSetEncryption"><code>cupsSetEncryption</code></a> function need to do so in each thread for the same | |
1323 | setting to be used.</p> | |
3e7fe0ca MS |
1324 | <h3 class="function"><span class="info"> CUPS 1.6 </span><a name="cupsEnumDests">cupsEnumDests</a></h3> |
1325 | <p class="description">Enumerate available destinations with a callback function.</p> | |
1326 | <p class="code"> | |
1327 | int cupsEnumDests (<br> | |
1328 | unsigned flags,<br> | |
1329 | int msec,<br> | |
1330 | int *cancel,<br> | |
1331 | <a href="#cups_ptype_t">cups_ptype_t</a> type,<br> | |
1332 | <a href="#cups_ptype_t">cups_ptype_t</a> mask,<br> | |
1333 | <a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb,<br> | |
1334 | void *user_data<br> | |
1335 | );</p> | |
1336 | <h4 class="parameters">Parameters</h4> | |
1337 | <dl> | |
1338 | <dt>flags</dt> | |
1339 | <dd class="description">Enumeration flags</dd> | |
1340 | <dt>msec</dt> | |
1341 | <dd class="description">Timeout in milliseconds, | |
1342 | -1 for indefinite</dd> | |
1343 | <dt>cancel</dt> | |
1344 | <dd class="description">Pointer to "cancel" variable</dd> | |
1345 | <dt>type</dt> | |
1346 | <dd class="description">Printer type bits</dd> | |
1347 | <dt>mask</dt> | |
1348 | <dd class="description">Mask for printer type bits</dd> | |
1349 | <dt>cb</dt> | |
1350 | <dd class="description">Callback function</dd> | |
1351 | <dt>user_data</dt> | |
1352 | <dd class="description">User data</dd> | |
1353 | </dl> | |
1354 | <h4 class="returnvalue">Return Value</h4> | |
1355 | <p class="description">1 on success, 0 on failure</p> | |
1356 | <h4 class="discussion">Discussion</h4> | |
1357 | <p class="discussion">Destinations are enumerated from one or more sources. The callback function | |
1358 | receives the <code>user_data</code> pointer, destination name, instance, number of | |
1359 | options, and options which can be used as input to the <a href="#cupsAddDest"><code>cupsAddDest</code></a> | |
1360 | function. The function must return 1 to continue enumeration or 0 to stop.<br> | |
1361 | <br> | |
1362 | Enumeration happens on the current thread and does not return until all | |
1363 | destinations have been enumerated or the callback function returns 0. | |
1364 | ||
1365 | </p> | |
1366 | <h3 class="function"><span class="info"> CUPS 1.6 </span><a name="cupsEnumDestsBlock">cupsEnumDestsBlock</a></h3> | |
1367 | <p class="description">Enumerate available destinations with a block.</p> | |
1368 | <p class="code"> | |
1369 | int cupsEnumDestsBlock (<br> | |
1370 | unsigned flags,<br> | |
1371 | int timeout,<br> | |
1372 | int *cancel,<br> | |
1373 | <a href="#cups_ptype_t">cups_ptype_t</a> type,<br> | |
1374 | <a href="#cups_ptype_t">cups_ptype_t</a> mask,<br> | |
1375 | <a href="#cups_dest_block_t">cups_dest_block_t</a> block<br> | |
1376 | );</p> | |
1377 | <h4 class="parameters">Parameters</h4> | |
1378 | <dl> | |
1379 | <dt>flags</dt> | |
1380 | <dd class="description">Enumeration flags</dd> | |
1381 | <dt>timeout</dt> | |
1382 | <dd class="description">Timeout in milliseconds, 0 for indefinite</dd> | |
1383 | <dt>cancel</dt> | |
1384 | <dd class="description">Pointer to "cancel" variable</dd> | |
1385 | <dt>type</dt> | |
1386 | <dd class="description">Printer type bits</dd> | |
1387 | <dt>mask</dt> | |
1388 | <dd class="description">Mask for printer type bits</dd> | |
1389 | <dt>block</dt> | |
1390 | <dd class="description">Block</dd> | |
1391 | </dl> | |
1392 | <h4 class="returnvalue">Return Value</h4> | |
1393 | <p class="description">1 on success, 0 on failure</p> | |
1394 | <h4 class="discussion">Discussion</h4> | |
1395 | <p class="discussion">Destinations are enumerated from one or more sources. The block receives the | |
1396 | destination name, instance, number of options, and options which can be used | |
1397 | as input to the <a href="#cupsAddDest"><code>cupsAddDest</code></a> function. The block must return 1 to | |
1398 | continue enumeration or 0 to stop.<br> | |
1399 | <br> | |
1400 | Enumeration happens on the current thread and does not return until all | |
1401 | destinations have been enumerated or the block returns 0. | |
1402 | ||
1403 | </p> | |
178cb736 | 1404 | <h3 class="function"><span class="info"> CUPS 1.4/Mac OS X 10.6 </span><a name="cupsFinishDocument">cupsFinishDocument</a></h3> |
5a738aea MS |
1405 | <p class="description">Finish sending a document.</p> |
1406 | <p class="code"> | |
1407 | ipp_status_t cupsFinishDocument (<br> | |
1408 | http_t *http,<br> | |
1409 | const char *name<br> | |
1410 | );</p> | |
1411 | <h4 class="parameters">Parameters</h4> | |
1412 | <dl> | |
1413 | <dt>http</dt> | |
568fa3fa | 1414 | <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd> |
5a738aea | 1415 | <dt>name</dt> |
568fa3fa | 1416 | <dd class="description">Destination name</dd> |
5a738aea MS |
1417 | </dl> |
1418 | <h4 class="returnvalue">Return Value</h4> | |
1419 | <p class="description">Status of document submission</p> | |
1420 | <h4 class="discussion">Discussion</h4> | |
1421 | <p class="discussion">The document must have been started using <a href="#cupsStartDocument"><code>cupsStartDocument</code></a>. | |
1422 | ||
1423 | </p> | |
1424 | <h3 class="function"><a name="cupsFreeDests">cupsFreeDests</a></h3> | |
1425 | <p class="description">Free the memory used by the list of destinations.</p> | |
1426 | <p class="code"> | |
1427 | void cupsFreeDests (<br> | |
1428 | int num_dests,<br> | |
1429 | <a href="#cups_dest_t">cups_dest_t</a> *dests<br> | |
1430 | );</p> | |
1431 | <h4 class="parameters">Parameters</h4> | |
1432 | <dl> | |
1433 | <dt>num_dests</dt> | |
1434 | <dd class="description">Number of destinations</dd> | |
1435 | <dt>dests</dt> | |
1436 | <dd class="description">Destinations</dd> | |
1437 | </dl> | |
1438 | <h3 class="function"><a name="cupsFreeJobs">cupsFreeJobs</a></h3> | |
1439 | <p class="description">Free memory used by job data.</p> | |
1440 | <p class="code"> | |
1441 | void cupsFreeJobs (<br> | |
1442 | int num_jobs,<br> | |
1443 | <a href="#cups_job_t">cups_job_t</a> *jobs<br> | |
1444 | );</p> | |
1445 | <h4 class="parameters">Parameters</h4> | |
1446 | <dl> | |
1447 | <dt>num_jobs</dt> | |
1448 | <dd class="description">Number of jobs</dd> | |
1449 | <dt>jobs</dt> | |
1450 | <dd class="description">Jobs</dd> | |
1451 | </dl> | |
1452 | <h3 class="function"><a name="cupsFreeOptions">cupsFreeOptions</a></h3> | |
1453 | <p class="description">Free all memory used by options.</p> | |
1454 | <p class="code"> | |
1455 | void cupsFreeOptions (<br> | |
1456 | int num_options,<br> | |
1457 | <a href="#cups_option_t">cups_option_t</a> *options<br> | |
1458 | );</p> | |
1459 | <h4 class="parameters">Parameters</h4> | |
1460 | <dl> | |
1461 | <dt>num_options</dt> | |
1462 | <dd class="description">Number of options</dd> | |
1463 | <dt>options</dt> | |
1464 | <dd class="description">Pointer to options</dd> | |
1465 | </dl> | |
1466 | <h3 class="function"><span class="info"> DEPRECATED </span><a name="cupsGetClasses">cupsGetClasses</a></h3> | |
1467 | <p class="description">Get a list of printer classes from the default server.</p> | |
1468 | <p class="code"> | |
1469 | int cupsGetClasses (<br> | |
1470 | char ***classes<br> | |
1471 | );</p> | |
1472 | <h4 class="parameters">Parameters</h4> | |
1473 | <dl> | |
1474 | <dt>classes</dt> | |
1475 | <dd class="description">Classes</dd> | |
1476 | </dl> | |
1477 | <h4 class="returnvalue">Return Value</h4> | |
1478 | <p class="description">Number of classes</p> | |
1479 | <h4 class="discussion">Discussion</h4> | |
1480 | <p class="discussion">This function is deprecated - use <a href="#cupsGetDests"><code>cupsGetDests</code></a> instead. | |
1481 | ||
1482 | </p> | |
1483 | <h3 class="function"><a name="cupsGetDefault">cupsGetDefault</a></h3> | |
1484 | <p class="description">Get the default printer or class for the default server.</p> | |
1485 | <p class="code"> | |
1486 | const char *cupsGetDefault (void);</p> | |
1487 | <h4 class="returnvalue">Return Value</h4> | |
1488 | <p class="description">Default printer or <code>NULL</code></p> | |
1489 | <h4 class="discussion">Discussion</h4> | |
1490 | <p class="discussion">This function returns the default printer or class as defined by | |
ef416fc2 | 1491 | the LPDEST or PRINTER environment variables. If these environment |
1492 | variables are not set, the server default destination is returned. | |
5a738aea MS |
1493 | Applications should use the <a href="#cupsGetDests"><code>cupsGetDests</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> |
1494 | functions to get the user-defined default printer, as this function does | |
1495 | not support the lpoptions-defined default printer.</p> | |
426c6a59 | 1496 | <h3 class="function"><span class="info"> CUPS 1.1.21/Mac OS X 10.4 </span><a name="cupsGetDefault2">cupsGetDefault2</a></h3> |
5a738aea MS |
1497 | <p class="description">Get the default printer or class for the specified server.</p> |
1498 | <p class="code"> | |
1499 | const char *cupsGetDefault2 (<br> | |
1500 | http_t *http<br> | |
1501 | );</p> | |
1502 | <h4 class="parameters">Parameters</h4> | |
1503 | <dl> | |
1504 | <dt>http</dt> | |
568fa3fa | 1505 | <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd> |
5a738aea MS |
1506 | </dl> |
1507 | <h4 class="returnvalue">Return Value</h4> | |
1508 | <p class="description">Default printer or <code>NULL</code></p> | |
1509 | <h4 class="discussion">Discussion</h4> | |
1510 | <p class="discussion">This function returns the default printer or class as defined by | |
ef416fc2 | 1511 | the LPDEST or PRINTER environment variables. If these environment |
1512 | variables are not set, the server default destination is returned. | |
5a738aea MS |
1513 | Applications should use the <a href="#cupsGetDests"><code>cupsGetDests</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> |
1514 | functions to get the user-defined default printer, as this function does | |
1515 | not support the lpoptions-defined default printer. | |
1516 | ||
1517 | </p> | |
1518 | <h3 class="function"><a name="cupsGetDest">cupsGetDest</a></h3> | |
1519 | <p class="description">Get the named destination from the list.</p> | |
1520 | <p class="code"> | |
1521 | <a href="#cups_dest_t">cups_dest_t</a> *cupsGetDest (<br> | |
1522 | const char *name,<br> | |
1523 | const char *instance,<br> | |
1524 | int num_dests,<br> | |
1525 | <a href="#cups_dest_t">cups_dest_t</a> *dests<br> | |
1526 | );</p> | |
1527 | <h4 class="parameters">Parameters</h4> | |
1528 | <dl> | |
1529 | <dt>name</dt> | |
1530 | <dd class="description">Destination name or <code>NULL</code> for the default destination</dd> | |
1531 | <dt>instance</dt> | |
1532 | <dd class="description">Instance name or <code>NULL</code></dd> | |
1533 | <dt>num_dests</dt> | |
1534 | <dd class="description">Number of destinations</dd> | |
1535 | <dt>dests</dt> | |
1536 | <dd class="description">Destinations</dd> | |
1537 | </dl> | |
1538 | <h4 class="returnvalue">Return Value</h4> | |
1539 | <p class="description">Destination pointer or <code>NULL</code></p> | |
1540 | <h4 class="discussion">Discussion</h4> | |
1541 | <p class="discussion">Use the <a href="#cupsGetDests"><code>cupsGetDests</code></a> or <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> functions to get a | |
1542 | list of supported destinations for the current user.</p> | |
1543 | <h3 class="function"><a name="cupsGetDests">cupsGetDests</a></h3> | |
1544 | <p class="description">Get the list of destinations from the default server.</p> | |
1545 | <p class="code"> | |
1546 | int cupsGetDests (<br> | |
1547 | <a href="#cups_dest_t">cups_dest_t</a> **dests<br> | |
1548 | );</p> | |
1549 | <h4 class="parameters">Parameters</h4> | |
1550 | <dl> | |
1551 | <dt>dests</dt> | |
1552 | <dd class="description">Destinations</dd> | |
1553 | </dl> | |
1554 | <h4 class="returnvalue">Return Value</h4> | |
1555 | <p class="description">Number of destinations</p> | |
1556 | <h4 class="discussion">Discussion</h4> | |
1557 | <p class="discussion">Starting with CUPS 1.2, the returned list of destinations include the | |
ecdc0628 | 1558 | printer-info, printer-is-accepting-jobs, printer-is-shared, |
1559 | printer-make-and-model, printer-state, printer-state-change-time, | |
426c6a59 MS |
1560 | printer-state-reasons, and printer-type attributes as options. CUPS 1.4 |
1561 | adds the marker-change-time, marker-colors, marker-high-levels, | |
1562 | marker-levels, marker-low-levels, marker-message, marker-names, | |
1563 | marker-types, and printer-commands attributes as well.<br> | |
5a738aea MS |
1564 | <br> |
1565 | Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and | |
1566 | the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination.</p> | |
426c6a59 | 1567 | <h3 class="function"><span class="info"> CUPS 1.1.21/Mac OS X 10.4 </span><a name="cupsGetDests2">cupsGetDests2</a></h3> |
5a738aea MS |
1568 | <p class="description">Get the list of destinations from the specified server.</p> |
1569 | <p class="code"> | |
1570 | int cupsGetDests2 (<br> | |
1571 | http_t *http,<br> | |
1572 | <a href="#cups_dest_t">cups_dest_t</a> **dests<br> | |
1573 | );</p> | |
1574 | <h4 class="parameters">Parameters</h4> | |
1575 | <dl> | |
1576 | <dt>http</dt> | |
568fa3fa | 1577 | <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd> |
5a738aea MS |
1578 | <dt>dests</dt> |
1579 | <dd class="description">Destinations</dd> | |
1580 | </dl> | |
1581 | <h4 class="returnvalue">Return Value</h4> | |
1582 | <p class="description">Number of destinations</p> | |
1583 | <h4 class="discussion">Discussion</h4> | |
1584 | <p class="discussion">Starting with CUPS 1.2, the returned list of destinations include the | |
ecdc0628 | 1585 | printer-info, printer-is-accepting-jobs, printer-is-shared, |
1586 | printer-make-and-model, printer-state, printer-state-change-time, | |
426c6a59 MS |
1587 | printer-state-reasons, and printer-type attributes as options. CUPS 1.4 |
1588 | adds the marker-change-time, marker-colors, marker-high-levels, | |
1589 | marker-levels, marker-low-levels, marker-message, marker-names, | |
1590 | marker-types, and printer-commands attributes as well.<br> | |
5a738aea MS |
1591 | <br> |
1592 | Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and | |
1593 | the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination. | |
ef416fc2 | 1594 | |
5a738aea MS |
1595 | </p> |
1596 | <h3 class="function"><a name="cupsGetJobs">cupsGetJobs</a></h3> | |
1597 | <p class="description">Get the jobs from the default server.</p> | |
1598 | <p class="code"> | |
1599 | int cupsGetJobs (<br> | |
1600 | <a href="#cups_job_t">cups_job_t</a> **jobs,<br> | |
1601 | const char *name,<br> | |
1602 | int myjobs,<br> | |
1603 | int whichjobs<br> | |
1604 | );</p> | |
1605 | <h4 class="parameters">Parameters</h4> | |
1606 | <dl> | |
1607 | <dt>jobs</dt> | |
1608 | <dd class="description">Job data</dd> | |
1609 | <dt>name</dt> | |
568fa3fa | 1610 | <dd class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</dd> |
5a738aea MS |
1611 | <dt>myjobs</dt> |
1612 | <dd class="description">0 = all users, 1 = mine</dd> | |
1613 | <dt>whichjobs</dt> | |
1614 | <dd class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></dd> | |
1615 | </dl> | |
1616 | <h4 class="returnvalue">Return Value</h4> | |
1617 | <p class="description">Number of jobs</p> | |
1618 | <h4 class="discussion">Discussion</h4> | |
1619 | <p class="discussion">A "whichjobs" value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless | |
1620 | of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are | |
1621 | pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns | |
1622 | jobs that are stopped, canceled, aborted, or completed.</p> | |
426c6a59 | 1623 | <h3 class="function"><span class="info"> CUPS 1.1.21/Mac OS X 10.4 </span><a name="cupsGetJobs2">cupsGetJobs2</a></h3> |
5a738aea MS |
1624 | <p class="description">Get the jobs from the specified server.</p> |
1625 | <p class="code"> | |
1626 | int cupsGetJobs2 (<br> | |
1627 | http_t *http,<br> | |
1628 | <a href="#cups_job_t">cups_job_t</a> **jobs,<br> | |
1629 | const char *name,<br> | |
1630 | int myjobs,<br> | |
1631 | int whichjobs<br> | |
1632 | );</p> | |
1633 | <h4 class="parameters">Parameters</h4> | |
1634 | <dl> | |
1635 | <dt>http</dt> | |
568fa3fa | 1636 | <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd> |
5a738aea MS |
1637 | <dt>jobs</dt> |
1638 | <dd class="description">Job data</dd> | |
1639 | <dt>name</dt> | |
568fa3fa | 1640 | <dd class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</dd> |
5a738aea MS |
1641 | <dt>myjobs</dt> |
1642 | <dd class="description">0 = all users, 1 = mine</dd> | |
1643 | <dt>whichjobs</dt> | |
1644 | <dd class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></dd> | |
1645 | </dl> | |
1646 | <h4 class="returnvalue">Return Value</h4> | |
1647 | <p class="description">Number of jobs</p> | |
1648 | <h4 class="discussion">Discussion</h4> | |
1649 | <p class="discussion">A "whichjobs" value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless | |
1650 | of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are | |
1651 | pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns | |
1652 | jobs that are stopped, canceled, aborted, or completed. | |
1653 | ||
1654 | </p> | |
178cb736 | 1655 | <h3 class="function"><span class="info"> CUPS 1.4/Mac OS X 10.6 </span><a name="cupsGetNamedDest">cupsGetNamedDest</a></h3> |
5a738aea MS |
1656 | <p class="description">Get options for the named destination.</p> |
1657 | <p class="code"> | |
1658 | <a href="#cups_dest_t">cups_dest_t</a> *cupsGetNamedDest (<br> | |
1659 | http_t *http,<br> | |
1660 | const char *name,<br> | |
1661 | const char *instance<br> | |
1662 | );</p> | |
1663 | <h4 class="parameters">Parameters</h4> | |
1664 | <dl> | |
1665 | <dt>http</dt> | |
568fa3fa | 1666 | <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd> |
5a738aea | 1667 | <dt>name</dt> |
568fa3fa | 1668 | <dd class="description">Destination name or <code>NULL</code> for the default destination</dd> |
5a738aea MS |
1669 | <dt>instance</dt> |
1670 | <dd class="description">Instance name or <code>NULL</code></dd> | |
1671 | </dl> | |
1672 | <h4 class="returnvalue">Return Value</h4> | |
1673 | <p class="description">Destination or <code>NULL</code></p> | |
1674 | <h4 class="discussion">Discussion</h4> | |
1675 | <p class="discussion">This function is optimized for retrieving a single destination and should | |
1676 | be used instead of <a href="#cupsGetDests"><code>cupsGetDests</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> when you either | |
1677 | know the name of the destination or want to print to the default destination. | |
1678 | If <code>NULL</code> is returned, the destination does not exist or there is no | |
1679 | default destination.<br> | |
1680 | <br> | |
1681 | If "http" is <code>CUPS_HTTP_DEFAULT</code>, the connection to the default print | |
1682 | server will be used.<br> | |
1683 | <br> | |
1684 | If "name" is <code>NULL</code>, the default printer for the current user will be | |
1685 | returned.<br> | |
1686 | <br> | |
1687 | The returned destination must be freed using <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> with a | |
1688 | "num_dests" value of 1. | |
1689 | ||
1690 | </p> | |
1691 | <h3 class="function"><a name="cupsGetOption">cupsGetOption</a></h3> | |
1692 | <p class="description">Get an option value.</p> | |
1693 | <p class="code"> | |
1694 | const char *cupsGetOption (<br> | |
1695 | const char *name,<br> | |
1696 | int num_options,<br> | |
1697 | <a href="#cups_option_t">cups_option_t</a> *options<br> | |
1698 | );</p> | |
1699 | <h4 class="parameters">Parameters</h4> | |
1700 | <dl> | |
1701 | <dt>name</dt> | |
1702 | <dd class="description">Name of option</dd> | |
1703 | <dt>num_options</dt> | |
1704 | <dd class="description">Number of options</dd> | |
1705 | <dt>options</dt> | |
1706 | <dd class="description">Options</dd> | |
1707 | </dl> | |
1708 | <h4 class="returnvalue">Return Value</h4> | |
1709 | <p class="description">Option value or <code>NULL</code></p> | |
1710 | <h3 class="function"><a name="cupsGetPPD">cupsGetPPD</a></h3> | |
1711 | <p class="description">Get the PPD file for a printer on the default server.</p> | |
1712 | <p class="code"> | |
1713 | const char *cupsGetPPD (<br> | |
1714 | const char *name<br> | |
1715 | );</p> | |
1716 | <h4 class="parameters">Parameters</h4> | |
1717 | <dl> | |
1718 | <dt>name</dt> | |
568fa3fa | 1719 | <dd class="description">Destination name</dd> |
5a738aea MS |
1720 | </dl> |
1721 | <h4 class="returnvalue">Return Value</h4> | |
1722 | <p class="description">Filename for PPD file</p> | |
1723 | <h4 class="discussion">Discussion</h4> | |
1724 | <p class="discussion">For classes, <code>cupsGetPPD</code> returns the PPD file for the first printer | |
568fa3fa MS |
1725 | in the class.<br> |
1726 | <br> | |
1727 | The returned filename is stored in a static buffer and is overwritten with | |
4e6f60f0 MS |
1728 | each call to <code>cupsGetPPD</code> or <a href="#cupsGetPPD2"><code>cupsGetPPD2</code></a>. The caller "owns" the |
1729 | file that is created and must <code>unlink</code> the returned filename.</p> | |
426c6a59 | 1730 | <h3 class="function"><span class="info"> CUPS 1.1.21/Mac OS X 10.4 </span><a name="cupsGetPPD2">cupsGetPPD2</a></h3> |
5a738aea MS |
1731 | <p class="description">Get the PPD file for a printer from the specified server.</p> |
1732 | <p class="code"> | |
1733 | const char *cupsGetPPD2 (<br> | |
1734 | http_t *http,<br> | |
1735 | const char *name<br> | |
1736 | );</p> | |
1737 | <h4 class="parameters">Parameters</h4> | |
1738 | <dl> | |
1739 | <dt>http</dt> | |
568fa3fa | 1740 | <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd> |
5a738aea | 1741 | <dt>name</dt> |
568fa3fa | 1742 | <dd class="description">Destination name</dd> |
5a738aea MS |
1743 | </dl> |
1744 | <h4 class="returnvalue">Return Value</h4> | |
1745 | <p class="description">Filename for PPD file</p> | |
1746 | <h4 class="discussion">Discussion</h4> | |
1747 | <p class="discussion">For classes, <code>cupsGetPPD2</code> returns the PPD file for the first printer | |
568fa3fa MS |
1748 | in the class.<br> |
1749 | <br> | |
1750 | The returned filename is stored in a static buffer and is overwritten with | |
4e6f60f0 MS |
1751 | each call to <a href="#cupsGetPPD"><code>cupsGetPPD</code></a> or <code>cupsGetPPD2</code>. The caller "owns" the |
1752 | file that is created and must <code>unlink</code> the returned filename. | |
5a738aea MS |
1753 | |
1754 | </p> | |
178cb736 | 1755 | <h3 class="function"><span class="info"> CUPS 1.4/Mac OS X 10.6 </span><a name="cupsGetPPD3">cupsGetPPD3</a></h3> |
5a738aea MS |
1756 | <p class="description">Get the PPD file for a printer on the specified |
1757 | server if it has changed.</p> | |
1758 | <p class="code"> | |
1759 | http_status_t cupsGetPPD3 (<br> | |
1760 | http_t *http,<br> | |
1761 | const char *name,<br> | |
1762 | time_t *modtime,<br> | |
1763 | char *buffer,<br> | |
1764 | size_t bufsize<br> | |
1765 | );</p> | |
1766 | <h4 class="parameters">Parameters</h4> | |
1767 | <dl> | |
1768 | <dt>http</dt> | |
1769 | <dd class="description">HTTP connection or <code>CUPS_HTTP_DEFAULT</code></dd> | |
1770 | <dt>name</dt> | |
568fa3fa | 1771 | <dd class="description">Destination name</dd> |
5a738aea MS |
1772 | <dt>modtime</dt> |
1773 | <dd class="description">Modification time</dd> | |
1774 | <dt>buffer</dt> | |
1775 | <dd class="description">Filename buffer</dd> | |
1776 | <dt>bufsize</dt> | |
1777 | <dd class="description">Size of filename buffer</dd> | |
1778 | </dl> | |
1779 | <h4 class="returnvalue">Return Value</h4> | |
1780 | <p class="description">HTTP status</p> | |
1781 | <h4 class="discussion">Discussion</h4> | |
1782 | <p class="discussion">The "modtime" parameter contains the modification time of any | |
2e4ff8af | 1783 | locally-cached content and is updated with the time from the PPD file on |
5a738aea MS |
1784 | the server.<br> |
1785 | <br> | |
1786 | The "buffer" parameter contains the local PPD filename. If it contains | |
2e4ff8af | 1787 | the empty string, a new temporary file is created, otherwise the existing |
4e6f60f0 MS |
1788 | file will be overwritten as needed. The caller "owns" the file that is |
1789 | created and must <code>unlink</code> the returned filename.<br> | |
5a738aea MS |
1790 | <br> |
1791 | On success, <code>HTTP_OK</code> is returned for a new PPD file and | |
1792 | <code>HTTP_NOT_MODIFIED</code> if the existing PPD file is up-to-date. Any other | |
1793 | status is an error.<br> | |
1794 | <br> | |
1795 | For classes, <code>cupsGetPPD3</code> returns the PPD file for the first printer | |
568fa3fa MS |
1796 | in the class. |
1797 | ||
1798 | </p> | |
5a738aea MS |
1799 | <h3 class="function"><a name="cupsGetPassword">cupsGetPassword</a></h3> |
1800 | <p class="description">Get a password from the user.</p> | |
1801 | <p class="code"> | |
1802 | const char *cupsGetPassword (<br> | |
1803 | const char *prompt<br> | |
1804 | );</p> | |
1805 | <h4 class="parameters">Parameters</h4> | |
1806 | <dl> | |
1807 | <dt>prompt</dt> | |
1808 | <dd class="description">Prompt string</dd> | |
1809 | </dl> | |
1810 | <h4 class="returnvalue">Return Value</h4> | |
1811 | <p class="description">Password</p> | |
1812 | <h4 class="discussion">Discussion</h4> | |
1813 | <p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the | |
aaf19ab0 MS |
1814 | user does not provide a password.<br> |
1815 | <br> | |
1816 | Note: The current password callback function is tracked separately for each | |
1817 | thread in a program. Multi-threaded programs that override the setting via | |
1818 | the <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a> or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> functions need to | |
1819 | do so in each thread for the same function to be used.</p> | |
178cb736 | 1820 | <h3 class="function"><span class="info"> CUPS 1.4/Mac OS X 10.6 </span><a name="cupsGetPassword2">cupsGetPassword2</a></h3> |
f11a948a | 1821 | <p class="description">Get a password from the user using the advanced |
aaf19ab0 | 1822 | password callback.</p> |
f11a948a MS |
1823 | <p class="code"> |
1824 | const char *cupsGetPassword2 (<br> | |
1825 | const char *prompt,<br> | |
1826 | http_t *http,<br> | |
1827 | const char *method,<br> | |
1828 | const char *resource<br> | |
1829 | );</p> | |
1830 | <h4 class="parameters">Parameters</h4> | |
1831 | <dl> | |
1832 | <dt>prompt</dt> | |
1833 | <dd class="description">Prompt string</dd> | |
1834 | <dt>http</dt> | |
1835 | <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd> | |
1836 | <dt>method</dt> | |
1837 | <dd class="description">Request method ("GET", "POST", "PUT")</dd> | |
1838 | <dt>resource</dt> | |
1839 | <dd class="description">Resource path</dd> | |
1840 | </dl> | |
1841 | <h4 class="returnvalue">Return Value</h4> | |
1842 | <p class="description">Password</p> | |
1843 | <h4 class="discussion">Discussion</h4> | |
1844 | <p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the | |
aaf19ab0 MS |
1845 | user does not provide a password.<br> |
1846 | <br> | |
1847 | Note: The current password callback function is tracked separately for each | |
1848 | thread in a program. Multi-threaded programs that override the setting via | |
1849 | the <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a> or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> functions need to | |
1850 | do so in each thread for the same function to be used. | |
f11a948a MS |
1851 | |
1852 | </p> | |
5a738aea MS |
1853 | <h3 class="function"><span class="info"> DEPRECATED </span><a name="cupsGetPrinters">cupsGetPrinters</a></h3> |
1854 | <p class="description">Get a list of printers from the default server.</p> | |
1855 | <p class="code"> | |
1856 | int cupsGetPrinters (<br> | |
1857 | char ***printers<br> | |
1858 | );</p> | |
1859 | <h4 class="parameters">Parameters</h4> | |
1860 | <dl> | |
1861 | <dt>printers</dt> | |
1862 | <dd class="description">Printers</dd> | |
1863 | </dl> | |
1864 | <h4 class="returnvalue">Return Value</h4> | |
1865 | <p class="description">Number of printers</p> | |
1866 | <h4 class="discussion">Discussion</h4> | |
1867 | <p class="discussion">This function is deprecated - use <a href="#cupsGetDests"><code>cupsGetDests</code></a> instead. | |
1868 | ||
1869 | </p> | |
426c6a59 | 1870 | <h3 class="function"><span class="info"> CUPS 1.3/Mac OS X 10.5 </span><a name="cupsGetServerPPD">cupsGetServerPPD</a></h3> |
5a738aea MS |
1871 | <p class="description">Get an available PPD file from the server.</p> |
1872 | <p class="code"> | |
1873 | char *cupsGetServerPPD (<br> | |
1874 | http_t *http,<br> | |
1875 | const char *name<br> | |
1876 | );</p> | |
1877 | <h4 class="parameters">Parameters</h4> | |
1878 | <dl> | |
1879 | <dt>http</dt> | |
568fa3fa | 1880 | <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd> |
5a738aea MS |
1881 | <dt>name</dt> |
1882 | <dd class="description">Name of PPD file ("ppd-name")</dd> | |
1883 | </dl> | |
1884 | <h4 class="returnvalue">Return Value</h4> | |
1885 | <p class="description">Name of PPD file or <code>NULL</code> on error</p> | |
1886 | <h4 class="discussion">Discussion</h4> | |
1887 | <p class="discussion">This function returns the named PPD file from the server. The | |
1888 | list of available PPDs is provided by the IPP <code>CUPS_GET_PPDS</code> | |
1889 | operation.<br> | |
1890 | <br> | |
1891 | You must remove (unlink) the PPD file when you are finished with | |
bc44d920 | 1892 | it. The PPD filename is stored in a static location that will be |
5a738aea MS |
1893 | overwritten on the next call to <a href="#cupsGetPPD"><code>cupsGetPPD</code></a>, <a href="#cupsGetPPD2"><code>cupsGetPPD2</code></a>, |
1894 | or <a href="#cupsGetServerPPD"><code>cupsGetServerPPD</code></a>. | |
1895 | ||
1896 | </p> | |
1897 | <h3 class="function"><a name="cupsLangDefault">cupsLangDefault</a></h3> | |
1898 | <p class="description">Return the default language.</p> | |
1899 | <p class="code"> | |
1900 | cups_lang_t *cupsLangDefault (void);</p> | |
1901 | <h4 class="returnvalue">Return Value</h4> | |
1902 | <p class="description">Language data</p> | |
1903 | <h3 class="function"><a name="cupsLangEncoding">cupsLangEncoding</a></h3> | |
1904 | <p class="description">Return the character encoding (us-ascii, etc.) | |
1905 | for the given language.</p> | |
1906 | <p class="code"> | |
1907 | const char *cupsLangEncoding (<br> | |
1908 | cups_lang_t *lang<br> | |
1909 | );</p> | |
1910 | <h4 class="parameters">Parameters</h4> | |
1911 | <dl> | |
1912 | <dt>lang</dt> | |
1913 | <dd class="description">Language data</dd> | |
1914 | </dl> | |
1915 | <h4 class="returnvalue">Return Value</h4> | |
1916 | <p class="description">Character encoding</p> | |
1917 | <h3 class="function"><a name="cupsLangFlush">cupsLangFlush</a></h3> | |
1918 | <p class="description">Flush all language data out of the cache.</p> | |
1919 | <p class="code"> | |
1920 | void cupsLangFlush (void);</p> | |
1921 | <h3 class="function"><a name="cupsLangFree">cupsLangFree</a></h3> | |
1922 | <p class="description">Free language data.</p> | |
1923 | <p class="code"> | |
1924 | void cupsLangFree (<br> | |
1925 | cups_lang_t *lang<br> | |
1926 | );</p> | |
1927 | <h4 class="parameters">Parameters</h4> | |
1928 | <dl> | |
1929 | <dt>lang</dt> | |
1930 | <dd class="description">Language to free</dd> | |
1931 | </dl> | |
1932 | <h4 class="discussion">Discussion</h4> | |
1933 | <p class="discussion">This does not actually free anything; use <a href="#cupsLangFlush"><code>cupsLangFlush</code></a> for that.</p> | |
1934 | <h3 class="function"><a name="cupsLangGet">cupsLangGet</a></h3> | |
1935 | <p class="description">Get a language.</p> | |
1936 | <p class="code"> | |
1937 | cups_lang_t *cupsLangGet (<br> | |
1938 | const char *language<br> | |
1939 | );</p> | |
1940 | <h4 class="parameters">Parameters</h4> | |
1941 | <dl> | |
1942 | <dt>language</dt> | |
1943 | <dd class="description">Language or locale</dd> | |
1944 | </dl> | |
1945 | <h4 class="returnvalue">Return Value</h4> | |
1946 | <p class="description">Language data</p> | |
426c6a59 | 1947 | <h3 class="function"><span class="info"> CUPS 1.2/Mac OS X 10.5 </span><a name="cupsNotifySubject">cupsNotifySubject</a></h3> |
5a738aea MS |
1948 | <p class="description">Return the subject for the given notification message.</p> |
1949 | <p class="code"> | |
1950 | char *cupsNotifySubject (<br> | |
1951 | cups_lang_t *lang,<br> | |
1952 | ipp_t *event<br> | |
1953 | );</p> | |
1954 | <h4 class="parameters">Parameters</h4> | |
1955 | <dl> | |
1956 | <dt>lang</dt> | |
1957 | <dd class="description">Language data</dd> | |
1958 | <dt>event</dt> | |
1959 | <dd class="description">Event data</dd> | |
1960 | </dl> | |
1961 | <h4 class="returnvalue">Return Value</h4> | |
1962 | <p class="description">Subject string or <code>NULL</code></p> | |
1963 | <h4 class="discussion">Discussion</h4> | |
568fa3fa | 1964 | <p class="discussion">The returned string must be freed by the caller using <code>free</code>. |
5a738aea MS |
1965 | |
1966 | </p> | |
426c6a59 | 1967 | <h3 class="function"><span class="info"> CUPS 1.2/Mac OS X 10.5 </span><a name="cupsNotifyText">cupsNotifyText</a></h3> |
5a738aea MS |
1968 | <p class="description">Return the text for the given notification message.</p> |
1969 | <p class="code"> | |
1970 | char *cupsNotifyText (<br> | |
1971 | cups_lang_t *lang,<br> | |
1972 | ipp_t *event<br> | |
1973 | );</p> | |
1974 | <h4 class="parameters">Parameters</h4> | |
1975 | <dl> | |
1976 | <dt>lang</dt> | |
1977 | <dd class="description">Language data</dd> | |
1978 | <dt>event</dt> | |
1979 | <dd class="description">Event data</dd> | |
1980 | </dl> | |
1981 | <h4 class="returnvalue">Return Value</h4> | |
1982 | <p class="description">Message text or <code>NULL</code></p> | |
1983 | <h4 class="discussion">Discussion</h4> | |
1984 | <p class="discussion">The returned string must be freed by the caller using <code>free</code>. | |
1985 | ||
1986 | </p> | |
1987 | <h3 class="function"><a name="cupsParseOptions">cupsParseOptions</a></h3> | |
1988 | <p class="description">Parse options from a command-line argument.</p> | |
1989 | <p class="code"> | |
1990 | int cupsParseOptions (<br> | |
1991 | const char *arg,<br> | |
1992 | int num_options,<br> | |
1993 | <a href="#cups_option_t">cups_option_t</a> **options<br> | |
1994 | );</p> | |
1995 | <h4 class="parameters">Parameters</h4> | |
1996 | <dl> | |
1997 | <dt>arg</dt> | |
1998 | <dd class="description">Argument to parse</dd> | |
1999 | <dt>num_options</dt> | |
2000 | <dd class="description">Number of options</dd> | |
2001 | <dt>options</dt> | |
2002 | <dd class="description">Options found</dd> | |
2003 | </dl> | |
2004 | <h4 class="returnvalue">Return Value</h4> | |
2005 | <p class="description">Number of options found</p> | |
2006 | <h4 class="discussion">Discussion</h4> | |
2007 | <p class="discussion">This function converts space-delimited name/value pairs according | |
ef416fc2 | 2008 | to the PAPI text option ABNF specification. Collection values |
2009 | ("name={a=... b=... c=...}") are stored with the curley brackets | |
5a738aea MS |
2010 | intact - use <code>cupsParseOptions</code> on the value to extract the |
2011 | collection attributes.</p> | |
2012 | <h3 class="function"><a name="cupsPrintFile">cupsPrintFile</a></h3> | |
2013 | <p class="description">Print a file to a printer or class on the default server.</p> | |
2014 | <p class="code"> | |
2015 | int cupsPrintFile (<br> | |
2016 | const char *name,<br> | |
2017 | const char *filename,<br> | |
2018 | const char *title,<br> | |
2019 | int num_options,<br> | |
2020 | <a href="#cups_option_t">cups_option_t</a> *options<br> | |
2021 | );</p> | |
2022 | <h4 class="parameters">Parameters</h4> | |
2023 | <dl> | |
2024 | <dt>name</dt> | |
568fa3fa | 2025 | <dd class="description">Destination name</dd> |
5a738aea MS |
2026 | <dt>filename</dt> |
2027 | <dd class="description">File to print</dd> | |
2028 | <dt>title</dt> | |
2029 | <dd class="description">Title of job</dd> | |
2030 | <dt>num_options</dt> | |
2031 | <dd class="description">Number of options</dd> | |
2032 | <dt>options</dt> | |
2033 | <dd class="description">Options</dd> | |
2034 | </dl> | |
2035 | <h4 class="returnvalue">Return Value</h4> | |
2036 | <p class="description">Job ID or 0 on error</p> | |
426c6a59 | 2037 | <h3 class="function"><span class="info"> CUPS 1.1.21/Mac OS X 10.4 </span><a name="cupsPrintFile2">cupsPrintFile2</a></h3> |
5a738aea MS |
2038 | <p class="description">Print a file to a printer or class on the specified |
2039 | server.</p> | |
2040 | <p class="code"> | |
2041 | int cupsPrintFile2 (<br> | |
2042 | http_t *http,<br> | |
2043 | const char *name,<br> | |
2044 | const char *filename,<br> | |
2045 | const char *title,<br> | |
2046 | int num_options,<br> | |
2047 | <a href="#cups_option_t">cups_option_t</a> *options<br> | |
2048 | );</p> | |
2049 | <h4 class="parameters">Parameters</h4> | |
2050 | <dl> | |
2051 | <dt>http</dt> | |
568fa3fa | 2052 | <dd class="description">Connection to server</dd> |
5a738aea | 2053 | <dt>name</dt> |
568fa3fa | 2054 | <dd class="description">Destination name</dd> |
5a738aea MS |
2055 | <dt>filename</dt> |
2056 | <dd class="description">File to print</dd> | |
2057 | <dt>title</dt> | |
2058 | <dd class="description">Title of job</dd> | |
2059 | <dt>num_options</dt> | |
2060 | <dd class="description">Number of options</dd> | |
2061 | <dt>options</dt> | |
2062 | <dd class="description">Options</dd> | |
2063 | </dl> | |
2064 | <h4 class="returnvalue">Return Value</h4> | |
2065 | <p class="description">Job ID or 0 on error</p> | |
2066 | <h3 class="function"><a name="cupsPrintFiles">cupsPrintFiles</a></h3> | |
2067 | <p class="description">Print one or more files to a printer or class on the | |
2068 | default server.</p> | |
2069 | <p class="code"> | |
2070 | int cupsPrintFiles (<br> | |
2071 | const char *name,<br> | |
2072 | int num_files,<br> | |
2073 | const char **files,<br> | |
2074 | const char *title,<br> | |
2075 | int num_options,<br> | |
2076 | <a href="#cups_option_t">cups_option_t</a> *options<br> | |
2077 | );</p> | |
2078 | <h4 class="parameters">Parameters</h4> | |
2079 | <dl> | |
2080 | <dt>name</dt> | |
568fa3fa | 2081 | <dd class="description">Destination name</dd> |
5a738aea MS |
2082 | <dt>num_files</dt> |
2083 | <dd class="description">Number of files</dd> | |
2084 | <dt>files</dt> | |
2085 | <dd class="description">File(s) to print</dd> | |
2086 | <dt>title</dt> | |
2087 | <dd class="description">Title of job</dd> | |
2088 | <dt>num_options</dt> | |
2089 | <dd class="description">Number of options</dd> | |
2090 | <dt>options</dt> | |
2091 | <dd class="description">Options</dd> | |
2092 | </dl> | |
2093 | <h4 class="returnvalue">Return Value</h4> | |
2094 | <p class="description">Job ID or 0 on error</p> | |
426c6a59 | 2095 | <h3 class="function"><span class="info"> CUPS 1.1.21/Mac OS X 10.4 </span><a name="cupsPrintFiles2">cupsPrintFiles2</a></h3> |
5a738aea MS |
2096 | <p class="description">Print one or more files to a printer or class on the |
2097 | specified server.</p> | |
2098 | <p class="code"> | |
2099 | int cupsPrintFiles2 (<br> | |
2100 | http_t *http,<br> | |
2101 | const char *name,<br> | |
2102 | int num_files,<br> | |
2103 | const char **files,<br> | |
2104 | const char *title,<br> | |
2105 | int num_options,<br> | |
2106 | <a href="#cups_option_t">cups_option_t</a> *options<br> | |
2107 | );</p> | |
2108 | <h4 class="parameters">Parameters</h4> | |
2109 | <dl> | |
2110 | <dt>http</dt> | |
568fa3fa | 2111 | <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd> |
5a738aea | 2112 | <dt>name</dt> |
568fa3fa | 2113 | <dd class="description">Destination name</dd> |
5a738aea MS |
2114 | <dt>num_files</dt> |
2115 | <dd class="description">Number of files</dd> | |
2116 | <dt>files</dt> | |
2117 | <dd class="description">File(s) to print</dd> | |
2118 | <dt>title</dt> | |
2119 | <dd class="description">Title of job</dd> | |
2120 | <dt>num_options</dt> | |
2121 | <dd class="description">Number of options</dd> | |
2122 | <dt>options</dt> | |
2123 | <dd class="description">Options</dd> | |
2124 | </dl> | |
2125 | <h4 class="returnvalue">Return Value</h4> | |
2126 | <p class="description">Job ID or 0 on error</p> | |
426c6a59 | 2127 | <h3 class="function"><span class="info"> CUPS 1.3/Mac OS X 10.5 </span><a name="cupsRemoveDest">cupsRemoveDest</a></h3> |
5a738aea MS |
2128 | <p class="description">Remove a destination from the destination list.</p> |
2129 | <p class="code"> | |
2130 | int cupsRemoveDest (<br> | |
2131 | const char *name,<br> | |
2132 | const char *instance,<br> | |
2133 | int num_dests,<br> | |
2134 | <a href="#cups_dest_t">cups_dest_t</a> **dests<br> | |
2135 | );</p> | |
2136 | <h4 class="parameters">Parameters</h4> | |
2137 | <dl> | |
2138 | <dt>name</dt> | |
2139 | <dd class="description">Destination name</dd> | |
2140 | <dt>instance</dt> | |
2141 | <dd class="description">Instance name or <code>NULL</code></dd> | |
2142 | <dt>num_dests</dt> | |
2143 | <dd class="description">Number of destinations</dd> | |
2144 | <dt>dests</dt> | |
2145 | <dd class="description">Destinations</dd> | |
2146 | </dl> | |
2147 | <h4 class="returnvalue">Return Value</h4> | |
2148 | <p class="description">New number of destinations</p> | |
2149 | <h4 class="discussion">Discussion</h4> | |
2150 | <p class="discussion">Removing a destination/instance does not delete the class or printer | |
f7deaa1a | 2151 | queue, merely the lpoptions for that destination/instance. Use the |
5a738aea MS |
2152 | <a href="#cupsSetDests"><code>cupsSetDests</code></a> or <a href="#cupsSetDests2"><code>cupsSetDests2</code></a> functions to save the new |
2153 | options for the user. | |
2154 | ||
2155 | </p> | |
426c6a59 | 2156 | <h3 class="function"><span class="info"> CUPS 1.2/Mac OS X 10.5 </span><a name="cupsRemoveOption">cupsRemoveOption</a></h3> |
5a738aea MS |
2157 | <p class="description">Remove an option from an option array.</p> |
2158 | <p class="code"> | |
2159 | int cupsRemoveOption (<br> | |
2160 | const char *name,<br> | |
2161 | int num_options,<br> | |
2162 | <a href="#cups_option_t">cups_option_t</a> **options<br> | |
2163 | );</p> | |
2164 | <h4 class="parameters">Parameters</h4> | |
2165 | <dl> | |
2166 | <dt>name</dt> | |
2167 | <dd class="description">Option name</dd> | |
2168 | <dt>num_options</dt> | |
2169 | <dd class="description">Current number of options</dd> | |
2170 | <dt>options</dt> | |
2171 | <dd class="description">Options</dd> | |
2172 | </dl> | |
2173 | <h4 class="returnvalue">Return Value</h4> | |
2174 | <p class="description">New number of options</p> | |
2175 | <h3 class="function"><a name="cupsServer">cupsServer</a></h3> | |
aaf19ab0 | 2176 | <p class="description">Return the hostname/address of the current server.</p> |
5a738aea MS |
2177 | <p class="code"> |
2178 | const char *cupsServer (void);</p> | |
2179 | <h4 class="returnvalue">Return Value</h4> | |
2180 | <p class="description">Server name</p> | |
2181 | <h4 class="discussion">Discussion</h4> | |
aaf19ab0 MS |
2182 | <p class="discussion">The default server comes from the CUPS_SERVER environment variable, then the |
2183 | ~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not | |
2184 | set, the default is the local system - either "localhost" or a domain socket | |
2185 | path.<br> | |
2186 | <br> | |
2187 | The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6 | |
2188 | address, or a domain socket pathname.<br> | |
2189 | <br> | |
2190 | Note: The current server is tracked separately for each thread in a program. | |
2191 | Multi-threaded programs that override the server via the | |
2192 | <a href="#cupsSetServer"><code>cupsSetServer</code></a> function need to do so in each thread for the same | |
2193 | server to be used.</p> | |
321d8d57 | 2194 | <h3 class="function"><span class="info"> CUPS 1.5/Mac OS X 10.7 </span><a name="cupsSetClientCertCB">cupsSetClientCertCB</a></h3> |
10d09e33 MS |
2195 | <p class="description">Set the client certificate callback.</p> |
2196 | <p class="code"> | |
2197 | void cupsSetClientCertCB (<br> | |
2198 | <a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a> cb,<br> | |
2199 | void *user_data<br> | |
2200 | );</p> | |
2201 | <h4 class="parameters">Parameters</h4> | |
2202 | <dl> | |
2203 | <dt>cb</dt> | |
2204 | <dd class="description">Callback function</dd> | |
2205 | <dt>user_data</dt> | |
2206 | <dd class="description">User data pointer</dd> | |
2207 | </dl> | |
2208 | <h4 class="discussion">Discussion</h4> | |
2209 | <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br> | |
2210 | <br> | |
2211 | Note: The current certificate callback is tracked separately for each thread | |
2212 | in a program. Multi-threaded programs that override the callback need to do | |
2213 | so in each thread for the same callback to be used. | |
2214 | ||
2215 | </p> | |
321d8d57 | 2216 | <h3 class="function"><span class="info"> CUPS 1.5/Mac OS X 10.7 </span><a name="cupsSetCredentials">cupsSetCredentials</a></h3> |
10d09e33 MS |
2217 | <p class="description">Set the default credentials to be used for SSL/TLS |
2218 | connections.</p> | |
2219 | <p class="code"> | |
2220 | int cupsSetCredentials (<br> | |
2221 | cups_array_t *credentials<br> | |
2222 | );</p> | |
2223 | <h4 class="parameters">Parameters</h4> | |
2224 | <dl> | |
2225 | <dt>credentials</dt> | |
2226 | <dd class="description">Array of credentials</dd> | |
2227 | </dl> | |
2228 | <h4 class="returnvalue">Return Value</h4> | |
2229 | <p class="description">Status of call (0 = success)</p> | |
2230 | <h4 class="discussion">Discussion</h4> | |
2231 | <p class="discussion">Note: The default credentials are tracked separately for each thread in a | |
2232 | program. Multi-threaded programs that override the setting need to do so in | |
2233 | each thread for the same setting to be used. | |
2234 | ||
2235 | </p> | |
426c6a59 | 2236 | <h3 class="function"><span class="info"> CUPS 1.3/Mac OS X 10.5 </span><a name="cupsSetDefaultDest">cupsSetDefaultDest</a></h3> |
5a738aea MS |
2237 | <p class="description">Set the default destination.</p> |
2238 | <p class="code"> | |
2239 | void cupsSetDefaultDest (<br> | |
2240 | const char *name,<br> | |
2241 | const char *instance,<br> | |
2242 | int num_dests,<br> | |
2243 | <a href="#cups_dest_t">cups_dest_t</a> *dests<br> | |
2244 | );</p> | |
2245 | <h4 class="parameters">Parameters</h4> | |
2246 | <dl> | |
2247 | <dt>name</dt> | |
2248 | <dd class="description">Destination name</dd> | |
2249 | <dt>instance</dt> | |
2250 | <dd class="description">Instance name or <code>NULL</code></dd> | |
2251 | <dt>num_dests</dt> | |
2252 | <dd class="description">Number of destinations</dd> | |
2253 | <dt>dests</dt> | |
2254 | <dd class="description">Destinations</dd> | |
2255 | </dl> | |
2256 | <h3 class="function"><a name="cupsSetDests">cupsSetDests</a></h3> | |
2257 | <p class="description">Save the list of destinations for the default server.</p> | |
2258 | <p class="code"> | |
2259 | void cupsSetDests (<br> | |
2260 | int num_dests,<br> | |
2261 | <a href="#cups_dest_t">cups_dest_t</a> *dests<br> | |
2262 | );</p> | |
2263 | <h4 class="parameters">Parameters</h4> | |
2264 | <dl> | |
2265 | <dt>num_dests</dt> | |
2266 | <dd class="description">Number of destinations</dd> | |
2267 | <dt>dests</dt> | |
2268 | <dd class="description">Destinations</dd> | |
2269 | </dl> | |
2270 | <h4 class="discussion">Discussion</h4> | |
2271 | <p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run | |
2272 | as root and ~/.cups/lpoptions when run as a normal user.</p> | |
426c6a59 | 2273 | <h3 class="function"><span class="info"> CUPS 1.1.21/Mac OS X 10.4 </span><a name="cupsSetDests2">cupsSetDests2</a></h3> |
5a738aea MS |
2274 | <p class="description">Save the list of destinations for the specified server.</p> |
2275 | <p class="code"> | |
2276 | int cupsSetDests2 (<br> | |
2277 | http_t *http,<br> | |
2278 | int num_dests,<br> | |
2279 | <a href="#cups_dest_t">cups_dest_t</a> *dests<br> | |
2280 | );</p> | |
2281 | <h4 class="parameters">Parameters</h4> | |
2282 | <dl> | |
2283 | <dt>http</dt> | |
568fa3fa | 2284 | <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd> |
5a738aea MS |
2285 | <dt>num_dests</dt> |
2286 | <dd class="description">Number of destinations</dd> | |
2287 | <dt>dests</dt> | |
2288 | <dd class="description">Destinations</dd> | |
2289 | </dl> | |
2290 | <h4 class="returnvalue">Return Value</h4> | |
2291 | <p class="description">0 on success, -1 on error</p> | |
2292 | <h4 class="discussion">Discussion</h4> | |
2293 | <p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run | |
80ca4592 | 2294 | as root and ~/.cups/lpoptions when run as a normal user. |
ef416fc2 | 2295 | |
5a738aea MS |
2296 | </p> |
2297 | <h3 class="function"><a name="cupsSetEncryption">cupsSetEncryption</a></h3> | |
2298 | <p class="description">Set the encryption preference.</p> | |
2299 | <p class="code"> | |
2300 | void cupsSetEncryption (<br> | |
2301 | http_encryption_t e<br> | |
2302 | );</p> | |
2303 | <h4 class="parameters">Parameters</h4> | |
2304 | <dl> | |
2305 | <dt>e</dt> | |
2306 | <dd class="description">New encryption preference</dd> | |
2307 | </dl> | |
aaf19ab0 MS |
2308 | <h4 class="discussion">Discussion</h4> |
2309 | <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION | |
2310 | environment variable, then the ~/.cups/client.conf file, and finally the | |
2311 | /etc/cups/client.conf file. If not set, the default is | |
2312 | <code>HTTP_ENCRYPT_IF_REQUESTED</code>.<br> | |
2313 | <br> | |
2314 | Note: The current encryption setting is tracked separately for each thread | |
2315 | in a program. Multi-threaded programs that override the setting need to do | |
2316 | so in each thread for the same setting to be used.</p> | |
5a738aea MS |
2317 | <h3 class="function"><a name="cupsSetPasswordCB">cupsSetPasswordCB</a></h3> |
2318 | <p class="description">Set the password callback for CUPS.</p> | |
2319 | <p class="code"> | |
2320 | void cupsSetPasswordCB (<br> | |
2321 | <a href="#cups_password_cb_t">cups_password_cb_t</a> cb<br> | |
2322 | );</p> | |
2323 | <h4 class="parameters">Parameters</h4> | |
2324 | <dl> | |
2325 | <dt>cb</dt> | |
2326 | <dd class="description">Callback function</dd> | |
2327 | </dl> | |
2328 | <h4 class="discussion">Discussion</h4> | |
aaf19ab0 MS |
2329 | <p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which |
2330 | reads the password from the console. Programs should call either this | |
2331 | function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered | |
2332 | by a program per thread.<br> | |
2333 | <br> | |
2334 | Note: The current password callback is tracked separately for each thread | |
2335 | in a program. Multi-threaded programs that override the callback need to do | |
2336 | so in each thread for the same callback to be used.</p> | |
178cb736 | 2337 | <h3 class="function"><span class="info"> CUPS 1.4/Mac OS X 10.6 </span><a name="cupsSetPasswordCB2">cupsSetPasswordCB2</a></h3> |
f11a948a MS |
2338 | <p class="description">Set the advanced password callback for CUPS.</p> |
2339 | <p class="code"> | |
2340 | void cupsSetPasswordCB2 (<br> | |
2341 | <a href="#cups_password_cb2_t">cups_password_cb2_t</a> cb,<br> | |
2342 | void *user_data<br> | |
2343 | );</p> | |
2344 | <h4 class="parameters">Parameters</h4> | |
2345 | <dl> | |
2346 | <dt>cb</dt> | |
2347 | <dd class="description">Callback function</dd> | |
2348 | <dt>user_data</dt> | |
2349 | <dd class="description">User data pointer</dd> | |
2350 | </dl> | |
2351 | <h4 class="discussion">Discussion</h4> | |
aaf19ab0 MS |
2352 | <p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which |
2353 | reads the password from the console. Programs should call either this | |
2354 | function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered | |
2355 | by a program per thread.<br> | |
2356 | <br> | |
2357 | Note: The current password callback is tracked separately for each thread | |
2358 | in a program. Multi-threaded programs that override the callback need to do | |
2359 | so in each thread for the same callback to be used. | |
f11a948a MS |
2360 | |
2361 | </p> | |
5a738aea | 2362 | <h3 class="function"><a name="cupsSetServer">cupsSetServer</a></h3> |
aaf19ab0 | 2363 | <p class="description">Set the default server name and port.</p> |
5a738aea MS |
2364 | <p class="code"> |
2365 | void cupsSetServer (<br> | |
2366 | const char *server<br> | |
2367 | );</p> | |
2368 | <h4 class="parameters">Parameters</h4> | |
2369 | <dl> | |
2370 | <dt>server</dt> | |
2371 | <dd class="description">Server name</dd> | |
2372 | </dl> | |
2373 | <h4 class="discussion">Discussion</h4> | |
2374 | <p class="discussion">The "server" string can be a fully-qualified hostname, a numeric | |
aaf19ab0 MS |
2375 | IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP |
2376 | addresses can be optionally followed by a colon and port number to override | |
2377 | the default port 631, e.g. "hostname:8631". Pass <code>NULL</code> to restore the | |
2378 | default server name and port.<br> | |
2379 | <br> | |
2380 | Note: The current server is tracked separately for each thread in a program. | |
2381 | Multi-threaded programs that override the server need to do so in each | |
2382 | thread for the same server to be used.</p> | |
321d8d57 | 2383 | <h3 class="function"><span class="info"> CUPS 1.5/Mac OS X 10.7 </span><a name="cupsSetServerCertCB">cupsSetServerCertCB</a></h3> |
10d09e33 MS |
2384 | <p class="description">Set the server certificate callback.</p> |
2385 | <p class="code"> | |
2386 | void cupsSetServerCertCB (<br> | |
2387 | <a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a> cb,<br> | |
2388 | void *user_data<br> | |
2389 | );</p> | |
2390 | <h4 class="parameters">Parameters</h4> | |
2391 | <dl> | |
2392 | <dt>cb</dt> | |
2393 | <dd class="description">Callback function</dd> | |
2394 | <dt>user_data</dt> | |
2395 | <dd class="description">User data pointer</dd> | |
2396 | </dl> | |
2397 | <h4 class="discussion">Discussion</h4> | |
2398 | <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br> | |
2399 | <br> | |
2400 | Note: The current credentials callback is tracked separately for each thread | |
2401 | in a program. Multi-threaded programs that override the callback need to do | |
2402 | so in each thread for the same callback to be used. | |
2403 | ||
2404 | </p> | |
5a738aea MS |
2405 | <h3 class="function"><a name="cupsSetUser">cupsSetUser</a></h3> |
2406 | <p class="description">Set the default user name.</p> | |
2407 | <p class="code"> | |
2408 | void cupsSetUser (<br> | |
2409 | const char *user<br> | |
2410 | );</p> | |
2411 | <h4 class="parameters">Parameters</h4> | |
2412 | <dl> | |
2413 | <dt>user</dt> | |
2414 | <dd class="description">User name</dd> | |
2415 | </dl> | |
2416 | <h4 class="discussion">Discussion</h4> | |
aaf19ab0 MS |
2417 | <p class="discussion">Pass <code>NULL</code> to restore the default user name.<br> |
2418 | <br> | |
2419 | Note: The current user name is tracked separately for each thread in a | |
2420 | program. Multi-threaded programs that override the user name need to do so | |
2421 | in each thread for the same user name to be used.</p> | |
178cb736 | 2422 | <h3 class="function"><span class="info"> CUPS 1.4/Mac OS X 10.6 </span><a name="cupsStartDocument">cupsStartDocument</a></h3> |
5a738aea MS |
2423 | <p class="description">Add a document to a job created with cupsCreateJob().</p> |
2424 | <p class="code"> | |
2425 | http_status_t cupsStartDocument (<br> | |
2426 | http_t *http,<br> | |
2427 | const char *name,<br> | |
2428 | int job_id,<br> | |
2429 | const char *docname,<br> | |
2430 | const char *format,<br> | |
2431 | int last_document<br> | |
2432 | );</p> | |
2433 | <h4 class="parameters">Parameters</h4> | |
2434 | <dl> | |
2435 | <dt>http</dt> | |
568fa3fa | 2436 | <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd> |
5a738aea | 2437 | <dt>name</dt> |
568fa3fa | 2438 | <dd class="description">Destination name</dd> |
5a738aea MS |
2439 | <dt>job_id</dt> |
2440 | <dd class="description">Job ID from <a href="#cupsCreateJob"><code>cupsCreateJob</code></a></dd> | |
2441 | <dt>docname</dt> | |
2442 | <dd class="description">Name of document</dd> | |
2443 | <dt>format</dt> | |
2444 | <dd class="description">MIME type or <code>CUPS_FORMAT_foo</code></dd> | |
2445 | <dt>last_document</dt> | |
2446 | <dd class="description">1 for last document in job, 0 otherwise</dd> | |
2447 | </dl> | |
2448 | <h4 class="returnvalue">Return Value</h4> | |
2449 | <p class="description">HTTP status of request</p> | |
2450 | <h4 class="discussion">Discussion</h4> | |
2451 | <p class="discussion">Use <a href="#cupsWriteRequestData"><code>cupsWriteRequestData</code></a> to write data for the document and | |
2452 | <a href="#cupsFinishDocument"><code>cupsFinishDocument</code></a> to finish the document and get the submission status.<br> | |
2453 | <br> | |
2454 | The MIME type constants <code>CUPS_FORMAT_AUTO</code>, <code>CUPS_FORMAT_PDF</code>, | |
2455 | <code>CUPS_FORMAT_POSTSCRIPT</code>, <code>CUPS_FORMAT_RAW</code>, and | |
2456 | <code>CUPS_FORMAT_TEXT</code> are provided for the "format" argument, although | |
2457 | any supported MIME type string can be supplied. | |
bc44d920 | 2458 | |
5a738aea MS |
2459 | </p> |
2460 | <h3 class="function"><a name="cupsTempFd">cupsTempFd</a></h3> | |
2461 | <p class="description">Creates a temporary file.</p> | |
2462 | <p class="code"> | |
2463 | int cupsTempFd (<br> | |
2464 | char *filename,<br> | |
2465 | int len<br> | |
2466 | );</p> | |
2467 | <h4 class="parameters">Parameters</h4> | |
2468 | <dl> | |
2469 | <dt>filename</dt> | |
2470 | <dd class="description">Pointer to buffer</dd> | |
2471 | <dt>len</dt> | |
2472 | <dd class="description">Size of buffer</dd> | |
2473 | </dl> | |
2474 | <h4 class="returnvalue">Return Value</h4> | |
2475 | <p class="description">New file descriptor or -1 on error</p> | |
2476 | <h4 class="discussion">Discussion</h4> | |
2477 | <p class="discussion">The temporary filename is returned in the filename buffer. | |
2478 | The temporary file is opened for reading and writing.</p> | |
2479 | <h3 class="function"><span class="info"> DEPRECATED </span><a name="cupsTempFile">cupsTempFile</a></h3> | |
2480 | <p class="description">Generates a temporary filename.</p> | |
2481 | <p class="code"> | |
2482 | char *cupsTempFile (<br> | |
2483 | char *filename,<br> | |
2484 | int len<br> | |
2485 | );</p> | |
2486 | <h4 class="parameters">Parameters</h4> | |
2487 | <dl> | |
2488 | <dt>filename</dt> | |
2489 | <dd class="description">Pointer to buffer</dd> | |
2490 | <dt>len</dt> | |
2491 | <dd class="description">Size of buffer</dd> | |
2492 | </dl> | |
2493 | <h4 class="returnvalue">Return Value</h4> | |
568fa3fa | 2494 | <p class="description">Filename or <code>NULL</code> on error</p> |
5a738aea MS |
2495 | <h4 class="discussion">Discussion</h4> |
2496 | <p class="discussion">The temporary filename is returned in the filename buffer. | |
2497 | This function is deprecated - use <a href="#cupsTempFd"><code>cupsTempFd</code></a> or | |
2498 | <a href="#cupsTempFile2"><code>cupsTempFile2</code></a> instead. | |
ef416fc2 | 2499 | |
5a738aea | 2500 | </p> |
426c6a59 | 2501 | <h3 class="function"><span class="info"> CUPS 1.2/Mac OS X 10.5 </span><a name="cupsTempFile2">cupsTempFile2</a></h3> |
5a738aea MS |
2502 | <p class="description">Creates a temporary CUPS file.</p> |
2503 | <p class="code"> | |
2504 | cups_file_t *cupsTempFile2 (<br> | |
2505 | char *filename,<br> | |
2506 | int len<br> | |
2507 | );</p> | |
2508 | <h4 class="parameters">Parameters</h4> | |
2509 | <dl> | |
2510 | <dt>filename</dt> | |
2511 | <dd class="description">Pointer to buffer</dd> | |
2512 | <dt>len</dt> | |
2513 | <dd class="description">Size of buffer</dd> | |
2514 | </dl> | |
2515 | <h4 class="returnvalue">Return Value</h4> | |
568fa3fa | 2516 | <p class="description">CUPS file or <code>NULL</code> on error</p> |
5a738aea MS |
2517 | <h4 class="discussion">Discussion</h4> |
2518 | <p class="discussion">The temporary filename is returned in the filename buffer. | |
2519 | The temporary file is opened for writing. | |
bc44d920 | 2520 | |
5a738aea MS |
2521 | </p> |
2522 | <h3 class="function"><a name="cupsUser">cupsUser</a></h3> | |
2523 | <p class="description">Return the current user's name.</p> | |
2524 | <p class="code"> | |
2525 | const char *cupsUser (void);</p> | |
2526 | <h4 class="returnvalue">Return Value</h4> | |
2527 | <p class="description">User name</p> | |
aaf19ab0 MS |
2528 | <h4 class="discussion">Discussion</h4> |
2529 | <p class="discussion">Note: The current user name is tracked separately for each thread in a | |
2530 | program. Multi-threaded programs that override the user name with the | |
2531 | <a href="#cupsSetUser"><code>cupsSetUser</code></a> function need to do so in each thread for the same user | |
2532 | name to be used.</p> | |
5a738aea | 2533 | <h2 class="title"><a name="TYPES">Data Types</a></h2> |
321d8d57 | 2534 | <h3 class="typedef"><span class="info"> CUPS 1.5/Mac OS X 10.7 </span><a name="cups_client_cert_cb_t">cups_client_cert_cb_t</a></h3> |
3e7fe0ca MS |
2535 | <p class="description">Client credentials callback |
2536 | </p> | |
10d09e33 MS |
2537 | <p class="code"> |
2538 | typedef int (*cups_client_cert_cb_t)(http_t *http, void *tls, cups_array_t *distinguished_names, void *user_data); | |
2539 | </p> | |
3e7fe0ca MS |
2540 | <h3 class="typedef"><span class="info"> CUPS 1.6 </span><a name="cups_dest_block_t">cups_dest_block_t</a></h3> |
2541 | <p class="description">Destination enumeration block | |
2542 | </p> | |
2543 | <p class="code"> | |
2544 | typedef int (*cups_dest_block_t(unsigned flags, <a href="#cups_dest_t">cups_dest_t</a> *dest); | |
2545 | </p> | |
2546 | <h3 class="typedef"><span class="info"> CUPS 1.6 </span><a name="cups_dest_cb_t">cups_dest_cb_t</a></h3> | |
2547 | <p class="description">Destination enumeration callback | |
2548 | </p> | |
2549 | <p class="code"> | |
2550 | typedef int (*cups_dest_cb_t)(void *user_data, unsigned flags, <a href="#cups_dest_t">cups_dest_t</a> *dest); | |
2551 | </p> | |
5a738aea MS |
2552 | <h3 class="typedef"><a name="cups_dest_t">cups_dest_t</a></h3> |
2553 | <p class="description">Destination</p> | |
2554 | <p class="code"> | |
2555 | typedef struct <a href="#cups_dest_s">cups_dest_s</a> cups_dest_t; | |
2556 | </p> | |
178cb736 | 2557 | <h3 class="typedef"><span class="info"> CUPS 1.4/Mac OS X 10.6 </span><a name="cups_device_cb_t">cups_device_cb_t</a></h3> |
3e7fe0ca MS |
2558 | <p class="description">Device callback |
2559 | </p> | |
ae71f5de | 2560 | <p class="code"> |
06d4e77b | 2561 | typedef void (*cups_device_cb_t)(const char *device_class, const char *device_id, const char *device_info, const char *device_make_and_model, const char *device_uri, const char *device_location, void *user_data); |
ae71f5de | 2562 | </p> |
3e7fe0ca MS |
2563 | <h3 class="typedef"><span class="info"> CUPS 1.6 </span><a name="cups_dinfo_t">cups_dinfo_t</a></h3> |
2564 | <p class="description">Destination capability and status | |
2565 | information </p> | |
2566 | <p class="code"> | |
2567 | typedef struct _cups_dinfo_s cups_dinfo_t; | |
2568 | </p> | |
5a738aea MS |
2569 | <h3 class="typedef"><a name="cups_job_t">cups_job_t</a></h3> |
2570 | <p class="description">Job</p> | |
2571 | <p class="code"> | |
2572 | typedef struct <a href="#cups_job_s">cups_job_s</a> cups_job_t; | |
2573 | </p> | |
2574 | <h3 class="typedef"><a name="cups_option_t">cups_option_t</a></h3> | |
2575 | <p class="description">Printer Options</p> | |
2576 | <p class="code"> | |
2577 | typedef struct <a href="#cups_option_s">cups_option_s</a> cups_option_t; | |
2578 | </p> | |
178cb736 | 2579 | <h3 class="typedef"><span class="info"> CUPS 1.4/Mac OS X 10.6 </span><a name="cups_password_cb2_t">cups_password_cb2_t</a></h3> |
3e7fe0ca MS |
2580 | <p class="description">New password callback |
2581 | </p> | |
f11a948a MS |
2582 | <p class="code"> |
2583 | typedef const char *(*cups_password_cb2_t)(const char *prompt, http_t *http, const char *method, const char *resource, void *user_data); | |
2584 | </p> | |
5a738aea MS |
2585 | <h3 class="typedef"><a name="cups_password_cb_t">cups_password_cb_t</a></h3> |
2586 | <p class="description">Password callback</p> | |
2587 | <p class="code"> | |
ae71f5de | 2588 | typedef const char *(*cups_password_cb_t)(const char *prompt); |
5a738aea MS |
2589 | </p> |
2590 | <h3 class="typedef"><a name="cups_ptype_t">cups_ptype_t</a></h3> | |
2591 | <p class="description">Printer type/capability bits</p> | |
2592 | <p class="code"> | |
ef416fc2 | 2593 | typedef unsigned cups_ptype_t; |
5a738aea | 2594 | </p> |
321d8d57 | 2595 | <h3 class="typedef"><span class="info"> CUPS 1.5/Mac OS X 10.7 </span><a name="cups_server_cert_cb_t">cups_server_cert_cb_t</a></h3> |
3e7fe0ca MS |
2596 | <p class="description">Server credentials callback |
2597 | </p> | |
10d09e33 MS |
2598 | <p class="code"> |
2599 | typedef int (*cups_server_cert_cb_t)(http_t *http, void *tls, cups_array_t *certs, void *user_data); | |
2600 | </p> | |
3e7fe0ca MS |
2601 | <h3 class="typedef"><span class="info"> CUPS 1.6 </span><a name="cups_size_t">cups_size_t</a></h3> |
2602 | <p class="description">Media Size </p> | |
2603 | <p class="code"> | |
2604 | typedef struct <a href="#cups_size_s">cups_size_s</a> cups_size_t; | |
2605 | </p> | |
5a738aea MS |
2606 | <h2 class="title"><a name="STRUCTURES">Structures</a></h2> |
2607 | <h3 class="struct"><a name="cups_dest_s">cups_dest_s</a></h3> | |
2608 | <p class="description">Destination</p> | |
2609 | <p class="code">struct cups_dest_s {<br> | |
2610 | char *name, *instance;<br> | |
2611 | int is_default;<br> | |
2612 | int num_options;<br> | |
2613 | <a href="#cups_option_t">cups_option_t</a> *options;<br> | |
2614 | };</p> | |
2615 | <h4 class="members">Members</h4> | |
2616 | <dl> | |
2617 | <dt>instance </dt> | |
2618 | <dd class="description">Local instance name or NULL</dd> | |
2619 | <dt>is_default </dt> | |
2620 | <dd class="description">Is this printer the default?</dd> | |
2621 | <dt>num_options </dt> | |
2622 | <dd class="description">Number of options</dd> | |
2623 | <dt>options </dt> | |
2624 | <dd class="description">Options</dd> | |
2625 | </dl> | |
2626 | <h3 class="struct"><a name="cups_job_s">cups_job_s</a></h3> | |
2627 | <p class="description">Job</p> | |
2628 | <p class="code">struct cups_job_s {<br> | |
2629 | time_t completed_time;<br> | |
2630 | time_t creation_time;<br> | |
2631 | char *dest;<br> | |
2632 | char *format;<br> | |
2633 | int id;<br> | |
2634 | int priority;<br> | |
2635 | time_t processing_time;<br> | |
2636 | int size;<br> | |
2637 | ipp_jstate_t state;<br> | |
2638 | char *title;<br> | |
2639 | char *user;<br> | |
2640 | };</p> | |
2641 | <h4 class="members">Members</h4> | |
2642 | <dl> | |
2643 | <dt>completed_time </dt> | |
2644 | <dd class="description">Time the job was completed</dd> | |
2645 | <dt>creation_time </dt> | |
2646 | <dd class="description">Time the job was created</dd> | |
2647 | <dt>dest </dt> | |
2648 | <dd class="description">Printer or class name</dd> | |
2649 | <dt>format </dt> | |
2650 | <dd class="description">Document format</dd> | |
2651 | <dt>id </dt> | |
2652 | <dd class="description">The job ID</dd> | |
2653 | <dt>priority </dt> | |
2654 | <dd class="description">Priority (1-100)</dd> | |
2655 | <dt>processing_time </dt> | |
2656 | <dd class="description">Time the job was processed</dd> | |
2657 | <dt>size </dt> | |
2658 | <dd class="description">Size in kilobytes</dd> | |
2659 | <dt>state </dt> | |
2660 | <dd class="description">Job state</dd> | |
2661 | <dt>title </dt> | |
2662 | <dd class="description">Title/job name</dd> | |
2663 | <dt>user </dt> | |
2664 | <dd class="description">User the submitted the job</dd> | |
2665 | </dl> | |
2666 | <h3 class="struct"><a name="cups_option_s">cups_option_s</a></h3> | |
2667 | <p class="description">Printer Options</p> | |
2668 | <p class="code">struct cups_option_s {<br> | |
2669 | char *name;<br> | |
2670 | char *value;<br> | |
2671 | };</p> | |
2672 | <h4 class="members">Members</h4> | |
2673 | <dl> | |
2674 | <dt>name </dt> | |
2675 | <dd class="description">Name of option</dd> | |
2676 | <dt>value </dt> | |
2677 | <dd class="description">Value of option</dd> | |
2678 | </dl> | |
3e7fe0ca MS |
2679 | <h3 class="struct"><span class="info"> CUPS 1.6 </span><a name="cups_size_s">cups_size_s</a></h3> |
2680 | <p class="description">Media Size </p> | |
2681 | <p class="code">struct cups_size_s {<br> | |
2682 | char media[128];<br> | |
2683 | int width, length, bottom, left, right, top;<br> | |
2684 | };</p> | |
2685 | <h4 class="members">Members</h4> | |
2686 | <dl> | |
2687 | <dt>media[128] </dt> | |
2688 | <dd class="description">Media name to use</dd> | |
2689 | <dt>top </dt> | |
2690 | <dd class="description">Top margin in hundredths of | |
2691 | millimeters</dd> | |
2692 | </dl> | |
22c9029b MS |
2693 | <h2 class="title"><a name="VARIABLES">Variables</a></h2> |
2694 | <h3 class="variable"><a name="CF_RETURNS_RETAINED">CF_RETURNS_RETAINED</a></h3> | |
2695 | <p class="description">Get the Apple language identifier associated with a | |
2696 | locale ID.</p> | |
2697 | <p class="code">const char *locale) CF_RETURNS_RETAINED;</p> | |
5a738aea MS |
2698 | <h2 class="title"><a name="ENUMERATIONS">Constants</a></h2> |
2699 | <h3 class="enumeration"><a name="cups_ptype_e">cups_ptype_e</a></h3> | |
3e7fe0ca MS |
2700 | <p class="description">Printer type/capability bit |
2701 | constants</p> | |
5a738aea MS |
2702 | <h4 class="constants">Constants</h4> |
2703 | <dl> | |
426c6a59 | 2704 | <dt>CUPS_PRINTER_AUTHENTICATED <span class="info"> CUPS 1.2/Mac OS X 10.5 </span></dt> |
3e7fe0ca MS |
2705 | <dd class="description">Printer requires authentication |
2706 | </dd> | |
5a738aea MS |
2707 | <dt>CUPS_PRINTER_BIND </dt> |
2708 | <dd class="description">Can bind output</dd> | |
2709 | <dt>CUPS_PRINTER_BW </dt> | |
2710 | <dd class="description">Can do B&W printing</dd> | |
2711 | <dt>CUPS_PRINTER_CLASS </dt> | |
2712 | <dd class="description">Printer class</dd> | |
2713 | <dt>CUPS_PRINTER_COLLATE </dt> | |
2714 | <dd class="description">Can collage copies</dd> | |
2715 | <dt>CUPS_PRINTER_COLOR </dt> | |
2716 | <dd class="description">Can do color printing</dd> | |
426c6a59 | 2717 | <dt>CUPS_PRINTER_COMMANDS <span class="info"> CUPS 1.2/Mac OS X 10.5 </span></dt> |
3e7fe0ca MS |
2718 | <dd class="description">Printer supports maintenance commands |
2719 | </dd> | |
5a738aea MS |
2720 | <dt>CUPS_PRINTER_COPIES </dt> |
2721 | <dd class="description">Can do copies</dd> | |
2722 | <dt>CUPS_PRINTER_COVER </dt> | |
2723 | <dd class="description">Can cover output</dd> | |
2724 | <dt>CUPS_PRINTER_DEFAULT </dt> | |
2725 | <dd class="description">Default printer on network</dd> | |
426c6a59 | 2726 | <dt>CUPS_PRINTER_DELETE <span class="info"> CUPS 1.2/Mac OS X 10.5 </span></dt> |
3e7fe0ca MS |
2727 | <dd class="description">Delete printer |
2728 | </dd> | |
5a738aea MS |
2729 | <dt>CUPS_PRINTER_DUPLEX </dt> |
2730 | <dd class="description">Can do duplexing</dd> | |
2731 | <dt>CUPS_PRINTER_FAX </dt> | |
2732 | <dd class="description">Fax queue</dd> | |
5a738aea MS |
2733 | <dt>CUPS_PRINTER_LARGE </dt> |
2734 | <dd class="description">Can do D/E/A1/A0</dd> | |
2735 | <dt>CUPS_PRINTER_LOCAL </dt> | |
2736 | <dd class="description">Local printer or class</dd> | |
2737 | <dt>CUPS_PRINTER_MEDIUM </dt> | |
2738 | <dd class="description">Can do Tabloid/B/C/A3/A2</dd> | |
178cb736 | 2739 | <dt>CUPS_PRINTER_MFP <span class="info"> CUPS 1.4/Mac OS X 10.6 </span></dt> |
3e7fe0ca MS |
2740 | <dd class="description">Printer with scanning capabilities |
2741 | </dd> | |
426c6a59 | 2742 | <dt>CUPS_PRINTER_NOT_SHARED <span class="info"> CUPS 1.2/Mac OS X 10.5 </span></dt> |
3e7fe0ca MS |
2743 | <dd class="description">Printer is not shared |
2744 | </dd> | |
5a738aea MS |
2745 | <dt>CUPS_PRINTER_PUNCH </dt> |
2746 | <dd class="description">Can punch output</dd> | |
2747 | <dt>CUPS_PRINTER_REJECTING </dt> | |
2748 | <dd class="description">Printer is rejecting jobs</dd> | |
2749 | <dt>CUPS_PRINTER_REMOTE </dt> | |
2750 | <dd class="description">Remote printer or class</dd> | |
178cb736 | 2751 | <dt>CUPS_PRINTER_SCANNER <span class="info"> CUPS 1.4/Mac OS X 10.6 </span></dt> |
3e7fe0ca MS |
2752 | <dd class="description">Scanner-only device |
2753 | </dd> | |
5a738aea MS |
2754 | <dt>CUPS_PRINTER_SMALL </dt> |
2755 | <dd class="description">Can do Letter/Legal/A4</dd> | |
2756 | <dt>CUPS_PRINTER_SORT </dt> | |
2757 | <dd class="description">Can sort output</dd> | |
2758 | <dt>CUPS_PRINTER_STAPLE </dt> | |
2759 | <dd class="description">Can staple output</dd> | |
2760 | <dt>CUPS_PRINTER_VARIABLE </dt> | |
2761 | <dd class="description">Can do variable sizes</dd> | |
2762 | </dl> | |
2763 | </div> | |
ef416fc2 | 2764 | </body> |
2765 | </html> |