]> git.ipfire.org Git - thirdparty/cups.git/blob - doc/help/cupspm.html
Merge pull request #5621 from zdohnal/cgigetarray-sigsegv
[thirdparty/cups.git] / doc / help / cupspm.html
1 <!DOCTYPE html>
2 <html>
3 <!-- SECTION: Programming -->
4 <head>
5 <title>CUPS Programming Manual</title>
6 <meta name="keywords" content="Programming">
7 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
8 <meta name="creator" content="codedoc v3.2">
9 <meta name="author" content="Michael R Sweet">
10 <meta name="copyright" content="Copyright &#xa9; 2007-2019 by Apple Inc. All Rights Reserved.">
11 <meta name="version" content="2.3.0">
12 <style type="text/css"><!--
13 body, p, h1, h2, h3, h4, h5, h6 {
14 font-family: sans-serif;
15 line-height: 1.4;
16 }
17 h1, h2, h3, h4, h5, h6 {
18 font-weight: bold;
19 page-break-inside: avoid;
20 }
21 h1 {
22 font-size: 250%;
23 margin: 0;
24 }
25 h2 {
26 font-size: 250%;
27 margin-top: 1.5em;
28 }
29 h3 {
30 font-size: 200%;
31 margin-bottom: 0.5em;
32 margin-top: 1.5em;
33 }
34 h4 {
35 font-size: 150%;
36 margin-bottom: 0.5em;
37 margin-top: 1.5em;
38 }
39 h5 {
40 font-size: 125%;
41 margin-bottom: 0.5em;
42 margin-top: 1.5em;
43 }
44 h6 {
45 font-size: 110%;
46 margin-bottom: 0.5em;
47 margin-top: 1.5em;
48 }
49 div.header h1, div.header p {
50 text-align: center;
51 }
52 div.contents, div.body, div.footer {
53 page-break-before: always;
54 }
55 .class, .enumeration, .function, .struct, .typedef, .union {
56 border-bottom: solid 2px gray;
57 }
58 .description {
59 margin-top: 0.5em;
60 }
61 .function {
62 margin-bottom: 0;
63 }
64 blockquote {
65 border: solid thin gray;
66 box-shadow: 3px 3px 5px rgba(0,0,0,0.5);
67 padding: 0px 10px;
68 page-break-inside: avoid;
69 }
70 p code, li code, p.code, pre, ul.code li {
71 font-family: monospace;
72 hyphens: manual;
73 -webkit-hyphens: manual;
74 }
75 p.code, pre, ul.code li {
76 background: rgba(127,127,127,0.1);
77 border: thin dotted gray;
78 padding: 10px;
79 page-break-inside: avoid;
80 }
81 a:link, a:visited {
82 text-decoration: none;
83 }
84 span.info {
85 background: black;
86 border: solid thin black;
87 color: white;
88 font-size: 80%;
89 font-style: italic;
90 font-weight: bold;
91 white-space: nowrap;
92 }
93 h1 span.info, h2 span.info, h3 span.info, h4 span.info {
94 border-top-left-radius: 10px;
95 border-top-right-radius: 10px;
96 float: right;
97 padding: 3px 6px;
98 }
99 ul.code, ul.contents, ul.subcontents {
100 list-style-type: none;
101 margin: 0;
102 padding-left: 0;
103 }
104 ul.code li {
105 margin: 0;
106 }
107 ul.contents > li {
108 margin-top: 1em;
109 }
110 ul.contents li ul.code, ul.contents li ul.subcontents {
111 padding-left: 2em;
112 }
113 table {
114 border-collapse: collapse;
115 border-spacing: 0;
116 }
117 td {
118 border: solid 1px #666;
119 padding: 5px 10px;
120 vertical-align: top;
121 }
122 td.left {
123 text-align: left;
124 }
125 td.center {
126 text-align: center;
127 }
128 td.right {
129 text-align: right;
130 }
131 th {
132 border-bottom: solid 2px #000;
133 padding: 1px 5px;
134 text-align: center;
135 vertical-align: bottom;
136 }
137 tr:nth-child(even) {
138 background: rgba(127,127,127,0.1);n}
139 table.list {
140 border-collapse: collapse;
141 width: 100%;
142 }
143 table.list th {
144 border-bottom: none;
145 border-right: 2px solid gray;
146 font-family: monospace;
147 padding: 5px 10px 5px 2px;
148 text-align: right;
149 vertical-align: top;
150 }
151 table.list td {
152 border: none;
153 padding: 5px 2px 5px 10px;
154 text-align: left;
155 vertical-align: top;
156 }
157 h2.title, h3.title {
158 border-bottom: solid 2px black;
159 }
160 --></style>
161 </head>
162 <body>
163 <div class="header">
164 <h1 class="title">CUPS Programming Manual</h1>
165 <p>Michael R Sweet</p>
166 <p>Copyright &#xa9; 2007-2019 by Apple Inc. All Rights Reserved.</p>
167 </div>
168 <div class="contents">
169 <h2 class="title">Contents</h2>
170 <ul class="contents">
171 <li><a href="#introduction">Introduction</a><ul class="subcontents">
172 <li><a href="#guidelines">Guidelines</a></li>
173 <li><a href="#terms-used-in-this-document">Terms Used in This Document</a></li>
174 <li><a href="#compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></li>
175 </ul></li>
176 <li><a href="#working-with-destinations">Working with Destinations</a><ul class="subcontents">
177 <li><a href="#finding-available-destinations">Finding Available Destinations</a></li>
178 <li><a href="#basic-destination-information">Basic Destination Information</a></li>
179 <li><a href="#detailed-destination-information">Detailed Destination Information</a></li>
180 <li><a href="#submitting-a-print-job">Submitting a Print Job</a></li>
181 </ul></li>
182 <li><a href="#sending-ipp-requests">Sending IPP Requests</a><ul class="subcontents">
183 <li><a href="#connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</a></li>
184 <li><a href="#creating-an-ipp-request">Creating an IPP Request</a></li>
185 <li><a href="#sending-the-ipp-request">Sending the IPP Request</a></li>
186 <li><a href="#processing-the-ipp-response">Processing the IPP Response</a></li>
187 <li><a href="#authentication">Authentication</a></li>
188 </ul></li>
189 <li><a href="#FUNCTIONS">Functions</a><ul class="subcontents">
190 <li><a href="#cupsAddDest">cupsAddDest</a></li>
191 <li><a href="#cupsAddDestMediaOptions">cupsAddDestMediaOptions</a></li>
192 <li><a href="#cupsAddIntegerOption">cupsAddIntegerOption</a></li>
193 <li><a href="#cupsAddOption">cupsAddOption</a></li>
194 <li><a href="#cupsCancelDestJob">cupsCancelDestJob</a></li>
195 <li><a href="#cupsCheckDestSupported">cupsCheckDestSupported</a></li>
196 <li><a href="#cupsCloseDestJob">cupsCloseDestJob</a></li>
197 <li><a href="#cupsConnectDest">cupsConnectDest</a></li>
198 <li><a href="#cupsCopyDest">cupsCopyDest</a></li>
199 <li><a href="#cupsCopyDestConflicts">cupsCopyDestConflicts</a></li>
200 <li><a href="#cupsCopyDestInfo">cupsCopyDestInfo</a></li>
201 <li><a href="#cupsCreateDestJob">cupsCreateDestJob</a></li>
202 <li><a href="#cupsDoAuthentication">cupsDoAuthentication</a></li>
203 <li><a href="#cupsEncodeOption">cupsEncodeOption</a></li>
204 <li><a href="#cupsEncodeOptions">cupsEncodeOptions</a></li>
205 <li><a href="#cupsEncodeOptions2">cupsEncodeOptions2</a></li>
206 <li><a href="#cupsEncryption">cupsEncryption</a></li>
207 <li><a href="#cupsEnumDests">cupsEnumDests</a></li>
208 <li><a href="#cupsFindDestDefault">cupsFindDestDefault</a></li>
209 <li><a href="#cupsFindDestReady">cupsFindDestReady</a></li>
210 <li><a href="#cupsFindDestSupported">cupsFindDestSupported</a></li>
211 <li><a href="#cupsFinishDestDocument">cupsFinishDestDocument</a></li>
212 <li><a href="#cupsFreeDestInfo">cupsFreeDestInfo</a></li>
213 <li><a href="#cupsFreeDests">cupsFreeDests</a></li>
214 <li><a href="#cupsFreeJobs">cupsFreeJobs</a></li>
215 <li><a href="#cupsFreeOptions">cupsFreeOptions</a></li>
216 <li><a href="#cupsGetDest">cupsGetDest</a></li>
217 <li><a href="#cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></li>
218 <li><a href="#cupsGetDestMediaByName">cupsGetDestMediaByName</a></li>
219 <li><a href="#cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></li>
220 <li><a href="#cupsGetDestMediaCount">cupsGetDestMediaCount</a></li>
221 <li><a href="#cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></li>
222 <li><a href="#cupsGetDestWithURI">cupsGetDestWithURI</a></li>
223 <li><a href="#cupsGetDests2">cupsGetDests2</a></li>
224 <li><a href="#cupsGetIntegerOption">cupsGetIntegerOption</a></li>
225 <li><a href="#cupsGetJobs2">cupsGetJobs2</a></li>
226 <li><a href="#cupsGetNamedDest">cupsGetNamedDest</a></li>
227 <li><a href="#cupsGetOption">cupsGetOption</a></li>
228 <li><a href="#cupsGetPassword2">cupsGetPassword2</a></li>
229 <li><a href="#cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></li>
230 <li><a href="#cupsLocalizeDestOption">cupsLocalizeDestOption</a></li>
231 <li><a href="#cupsLocalizeDestValue">cupsLocalizeDestValue</a></li>
232 <li><a href="#cupsMakeServerCredentials">cupsMakeServerCredentials</a></li>
233 <li><a href="#cupsParseOptions">cupsParseOptions</a></li>
234 <li><a href="#cupsRemoveDest">cupsRemoveDest</a></li>
235 <li><a href="#cupsRemoveOption">cupsRemoveOption</a></li>
236 <li><a href="#cupsServer">cupsServer</a></li>
237 <li><a href="#cupsSetClientCertCB">cupsSetClientCertCB</a></li>
238 <li><a href="#cupsSetCredentials">cupsSetCredentials</a></li>
239 <li><a href="#cupsSetDefaultDest">cupsSetDefaultDest</a></li>
240 <li><a href="#cupsSetDests2">cupsSetDests2</a></li>
241 <li><a href="#cupsSetEncryption">cupsSetEncryption</a></li>
242 <li><a href="#cupsSetPasswordCB2">cupsSetPasswordCB2</a></li>
243 <li><a href="#cupsSetServer">cupsSetServer</a></li>
244 <li><a href="#cupsSetServerCertCB">cupsSetServerCertCB</a></li>
245 <li><a href="#cupsSetServerCredentials">cupsSetServerCredentials</a></li>
246 <li><a href="#cupsSetUser">cupsSetUser</a></li>
247 <li><a href="#cupsSetUserAgent">cupsSetUserAgent</a></li>
248 <li><a href="#cupsStartDestDocument">cupsStartDestDocument</a></li>
249 <li><a href="#cupsUser">cupsUser</a></li>
250 <li><a href="#cupsUserAgent">cupsUserAgent</a></li>
251 <li><a href="#httpAcceptConnection">httpAcceptConnection</a></li>
252 <li><a href="#httpAddCredential">httpAddCredential</a></li>
253 <li><a href="#httpAddrAny">httpAddrAny</a></li>
254 <li><a href="#httpAddrClose">httpAddrClose</a></li>
255 <li><a href="#httpAddrConnect2">httpAddrConnect2</a></li>
256 <li><a href="#httpAddrCopyList">httpAddrCopyList</a></li>
257 <li><a href="#httpAddrEqual">httpAddrEqual</a></li>
258 <li><a href="#httpAddrFamily">httpAddrFamily</a></li>
259 <li><a href="#httpAddrFreeList">httpAddrFreeList</a></li>
260 <li><a href="#httpAddrGetList">httpAddrGetList</a></li>
261 <li><a href="#httpAddrLength">httpAddrLength</a></li>
262 <li><a href="#httpAddrListen">httpAddrListen</a></li>
263 <li><a href="#httpAddrLocalhost">httpAddrLocalhost</a></li>
264 <li><a href="#httpAddrLookup">httpAddrLookup</a></li>
265 <li><a href="#httpAddrPort">httpAddrPort</a></li>
266 <li><a href="#httpAddrString">httpAddrString</a></li>
267 <li><a href="#httpAssembleURI">httpAssembleURI</a></li>
268 <li><a href="#httpAssembleURIf">httpAssembleURIf</a></li>
269 <li><a href="#httpAssembleUUID">httpAssembleUUID</a></li>
270 <li><a href="#httpBlocking">httpBlocking</a></li>
271 <li><a href="#httpCheck">httpCheck</a></li>
272 <li><a href="#httpClearCookie">httpClearCookie</a></li>
273 <li><a href="#httpClearFields">httpClearFields</a></li>
274 <li><a href="#httpClose">httpClose</a></li>
275 <li><a href="#httpCompareCredentials">httpCompareCredentials</a></li>
276 <li><a href="#httpConnect2">httpConnect2</a></li>
277 <li><a href="#httpCopyCredentials">httpCopyCredentials</a></li>
278 <li><a href="#httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></li>
279 <li><a href="#httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></li>
280 <li><a href="#httpCredentialsGetTrust">httpCredentialsGetTrust</a></li>
281 <li><a href="#httpCredentialsString">httpCredentialsString</a></li>
282 <li><a href="#httpDecode64_2">httpDecode64_2</a></li>
283 <li><a href="#httpDelete">httpDelete</a></li>
284 <li><a href="#httpEncode64_2">httpEncode64_2</a></li>
285 <li><a href="#httpEncryption">httpEncryption</a></li>
286 <li><a href="#httpError">httpError</a></li>
287 <li><a href="#httpFieldValue">httpFieldValue</a></li>
288 <li><a href="#httpFlush">httpFlush</a></li>
289 <li><a href="#httpFlushWrite">httpFlushWrite</a></li>
290 <li><a href="#httpFreeCredentials">httpFreeCredentials</a></li>
291 <li><a href="#httpGet">httpGet</a></li>
292 <li><a href="#httpGetActivity">httpGetActivity</a></li>
293 <li><a href="#httpGetAddress">httpGetAddress</a></li>
294 <li><a href="#httpGetAuthString">httpGetAuthString</a></li>
295 <li><a href="#httpGetBlocking">httpGetBlocking</a></li>
296 <li><a href="#httpGetContentEncoding">httpGetContentEncoding</a></li>
297 <li><a href="#httpGetCookie">httpGetCookie</a></li>
298 <li><a href="#httpGetDateString2">httpGetDateString2</a></li>
299 <li><a href="#httpGetDateTime">httpGetDateTime</a></li>
300 <li><a href="#httpGetEncryption">httpGetEncryption</a></li>
301 <li><a href="#httpGetExpect">httpGetExpect</a></li>
302 <li><a href="#httpGetFd">httpGetFd</a></li>
303 <li><a href="#httpGetField">httpGetField</a></li>
304 <li><a href="#httpGetHostname">httpGetHostname</a></li>
305 <li><a href="#httpGetKeepAlive">httpGetKeepAlive</a></li>
306 <li><a href="#httpGetLength2">httpGetLength2</a></li>
307 <li><a href="#httpGetPending">httpGetPending</a></li>
308 <li><a href="#httpGetReady">httpGetReady</a></li>
309 <li><a href="#httpGetRemaining">httpGetRemaining</a></li>
310 <li><a href="#httpGetState">httpGetState</a></li>
311 <li><a href="#httpGetStatus">httpGetStatus</a></li>
312 <li><a href="#httpGetSubField2">httpGetSubField2</a></li>
313 <li><a href="#httpGetVersion">httpGetVersion</a></li>
314 <li><a href="#httpGets">httpGets</a></li>
315 <li><a href="#httpHead">httpHead</a></li>
316 <li><a href="#httpInitialize">httpInitialize</a></li>
317 <li><a href="#httpIsChunked">httpIsChunked</a></li>
318 <li><a href="#httpIsEncrypted">httpIsEncrypted</a></li>
319 <li><a href="#httpLoadCredentials">httpLoadCredentials</a></li>
320 <li><a href="#httpOptions">httpOptions</a></li>
321 <li><a href="#httpPeek">httpPeek</a></li>
322 <li><a href="#httpPost">httpPost</a></li>
323 <li><a href="#httpPut">httpPut</a></li>
324 <li><a href="#httpRead2">httpRead2</a></li>
325 <li><a href="#httpReadRequest">httpReadRequest</a></li>
326 <li><a href="#httpReconnect2">httpReconnect2</a></li>
327 <li><a href="#httpResolveHostname">httpResolveHostname</a></li>
328 <li><a href="#httpSaveCredentials">httpSaveCredentials</a></li>
329 <li><a href="#httpSeparateURI">httpSeparateURI</a></li>
330 <li><a href="#httpSetAuthString">httpSetAuthString</a></li>
331 <li><a href="#httpSetCookie">httpSetCookie</a></li>
332 <li><a href="#httpSetCredentials">httpSetCredentials</a></li>
333 <li><a href="#httpSetDefaultField">httpSetDefaultField</a></li>
334 <li><a href="#httpSetExpect">httpSetExpect</a></li>
335 <li><a href="#httpSetField">httpSetField</a></li>
336 <li><a href="#httpSetKeepAlive">httpSetKeepAlive</a></li>
337 <li><a href="#httpSetLength">httpSetLength</a></li>
338 <li><a href="#httpSetTimeout">httpSetTimeout</a></li>
339 <li><a href="#httpShutdown">httpShutdown</a></li>
340 <li><a href="#httpStateString">httpStateString</a></li>
341 <li><a href="#httpStatus">httpStatus</a></li>
342 <li><a href="#httpURIStatusString">httpURIStatusString</a></li>
343 <li><a href="#httpUpdate">httpUpdate</a></li>
344 <li><a href="#httpWait">httpWait</a></li>
345 <li><a href="#httpWrite2">httpWrite2</a></li>
346 <li><a href="#httpWriteResponse">httpWriteResponse</a></li>
347 <li><a href="#ippAddBoolean">ippAddBoolean</a></li>
348 <li><a href="#ippAddBooleans">ippAddBooleans</a></li>
349 <li><a href="#ippAddCollection">ippAddCollection</a></li>
350 <li><a href="#ippAddCollections">ippAddCollections</a></li>
351 <li><a href="#ippAddDate">ippAddDate</a></li>
352 <li><a href="#ippAddInteger">ippAddInteger</a></li>
353 <li><a href="#ippAddIntegers">ippAddIntegers</a></li>
354 <li><a href="#ippAddOctetString">ippAddOctetString</a></li>
355 <li><a href="#ippAddOutOfBand">ippAddOutOfBand</a></li>
356 <li><a href="#ippAddRange">ippAddRange</a></li>
357 <li><a href="#ippAddRanges">ippAddRanges</a></li>
358 <li><a href="#ippAddResolution">ippAddResolution</a></li>
359 <li><a href="#ippAddResolutions">ippAddResolutions</a></li>
360 <li><a href="#ippAddSeparator">ippAddSeparator</a></li>
361 <li><a href="#ippAddString">ippAddString</a></li>
362 <li><a href="#ippAddStringf">ippAddStringf</a></li>
363 <li><a href="#ippAddStringfv">ippAddStringfv</a></li>
364 <li><a href="#ippAddStrings">ippAddStrings</a></li>
365 <li><a href="#ippAttributeString">ippAttributeString</a></li>
366 <li><a href="#ippContainsInteger">ippContainsInteger</a></li>
367 <li><a href="#ippContainsString">ippContainsString</a></li>
368 <li><a href="#ippCopyAttribute">ippCopyAttribute</a></li>
369 <li><a href="#ippCopyAttributes">ippCopyAttributes</a></li>
370 <li><a href="#ippCreateRequestedArray">ippCreateRequestedArray</a></li>
371 <li><a href="#ippDateToTime">ippDateToTime</a></li>
372 <li><a href="#ippDelete">ippDelete</a></li>
373 <li><a href="#ippDeleteAttribute">ippDeleteAttribute</a></li>
374 <li><a href="#ippDeleteValues">ippDeleteValues</a></li>
375 <li><a href="#ippEnumString">ippEnumString</a></li>
376 <li><a href="#ippEnumValue">ippEnumValue</a></li>
377 <li><a href="#ippErrorString">ippErrorString</a></li>
378 <li><a href="#ippErrorValue">ippErrorValue</a></li>
379 <li><a href="#ippFindAttribute">ippFindAttribute</a></li>
380 <li><a href="#ippFindNextAttribute">ippFindNextAttribute</a></li>
381 <li><a href="#ippFirstAttribute">ippFirstAttribute</a></li>
382 <li><a href="#ippGetBoolean">ippGetBoolean</a></li>
383 <li><a href="#ippGetCollection">ippGetCollection</a></li>
384 <li><a href="#ippGetCount">ippGetCount</a></li>
385 <li><a href="#ippGetDate">ippGetDate</a></li>
386 <li><a href="#ippGetGroupTag">ippGetGroupTag</a></li>
387 <li><a href="#ippGetInteger">ippGetInteger</a></li>
388 <li><a href="#ippGetName">ippGetName</a></li>
389 <li><a href="#ippGetOctetString">ippGetOctetString</a></li>
390 <li><a href="#ippGetOperation">ippGetOperation</a></li>
391 <li><a href="#ippGetRange">ippGetRange</a></li>
392 <li><a href="#ippGetRequestId">ippGetRequestId</a></li>
393 <li><a href="#ippGetResolution">ippGetResolution</a></li>
394 <li><a href="#ippGetState">ippGetState</a></li>
395 <li><a href="#ippGetStatusCode">ippGetStatusCode</a></li>
396 <li><a href="#ippGetString">ippGetString</a></li>
397 <li><a href="#ippGetValueTag">ippGetValueTag</a></li>
398 <li><a href="#ippGetVersion">ippGetVersion</a></li>
399 <li><a href="#ippLength">ippLength</a></li>
400 <li><a href="#ippNew">ippNew</a></li>
401 <li><a href="#ippNewRequest">ippNewRequest</a></li>
402 <li><a href="#ippNewResponse">ippNewResponse</a></li>
403 <li><a href="#ippNextAttribute">ippNextAttribute</a></li>
404 <li><a href="#ippOpString">ippOpString</a></li>
405 <li><a href="#ippOpValue">ippOpValue</a></li>
406 <li><a href="#ippPort">ippPort</a></li>
407 <li><a href="#ippRead">ippRead</a></li>
408 <li><a href="#ippReadFile">ippReadFile</a></li>
409 <li><a href="#ippReadIO">ippReadIO</a></li>
410 <li><a href="#ippSetBoolean">ippSetBoolean</a></li>
411 <li><a href="#ippSetCollection">ippSetCollection</a></li>
412 <li><a href="#ippSetDate">ippSetDate</a></li>
413 <li><a href="#ippSetGroupTag">ippSetGroupTag</a></li>
414 <li><a href="#ippSetInteger">ippSetInteger</a></li>
415 <li><a href="#ippSetName">ippSetName</a></li>
416 <li><a href="#ippSetOctetString">ippSetOctetString</a></li>
417 <li><a href="#ippSetOperation">ippSetOperation</a></li>
418 <li><a href="#ippSetPort">ippSetPort</a></li>
419 <li><a href="#ippSetRange">ippSetRange</a></li>
420 <li><a href="#ippSetRequestId">ippSetRequestId</a></li>
421 <li><a href="#ippSetResolution">ippSetResolution</a></li>
422 <li><a href="#ippSetState">ippSetState</a></li>
423 <li><a href="#ippSetStatusCode">ippSetStatusCode</a></li>
424 <li><a href="#ippSetString">ippSetString</a></li>
425 <li><a href="#ippSetStringf">ippSetStringf</a></li>
426 <li><a href="#ippSetStringfv">ippSetStringfv</a></li>
427 <li><a href="#ippSetValueTag">ippSetValueTag</a></li>
428 <li><a href="#ippSetVersion">ippSetVersion</a></li>
429 <li><a href="#ippStateString">ippStateString</a></li>
430 <li><a href="#ippTagString">ippTagString</a></li>
431 <li><a href="#ippTagValue">ippTagValue</a></li>
432 <li><a href="#ippTimeToDate">ippTimeToDate</a></li>
433 <li><a href="#ippValidateAttribute">ippValidateAttribute</a></li>
434 <li><a href="#ippValidateAttributes">ippValidateAttributes</a></li>
435 <li><a href="#ippWrite">ippWrite</a></li>
436 <li><a href="#ippWriteFile">ippWriteFile</a></li>
437 <li><a href="#ippWriteIO">ippWriteIO</a></li>
438 </ul></li>
439 <li><a href="#TYPES">Data Types</a><ul class="subcontents">
440 <li><a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a></li>
441 <li><a href="#cups_dest_cb_t">cups_dest_cb_t</a></li>
442 <li><a href="#cups_dest_t">cups_dest_t</a></li>
443 <li><a href="#cups_dinfo_t">cups_dinfo_t</a></li>
444 <li><a href="#cups_job_t">cups_job_t</a></li>
445 <li><a href="#cups_option_t">cups_option_t</a></li>
446 <li><a href="#cups_password_cb2_t">cups_password_cb2_t</a></li>
447 <li><a href="#cups_ptype_t">cups_ptype_t</a></li>
448 <li><a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a></li>
449 <li><a href="#cups_size_t">cups_size_t</a></li>
450 <li><a href="#http_addr_t">http_addr_t</a></li>
451 <li><a href="#http_encoding_t">http_encoding_t</a></li>
452 <li><a href="#http_encryption_t">http_encryption_t</a></li>
453 <li><a href="#http_field_t">http_field_t</a></li>
454 <li><a href="#http_keepalive_t">http_keepalive_t</a></li>
455 <li><a href="#http_state_t">http_state_t</a></li>
456 <li><a href="#http_t">http_t</a></li>
457 <li><a href="#http_timeout_cb_t">http_timeout_cb_t</a></li>
458 <li><a href="#http_trust_t">http_trust_t</a></li>
459 <li><a href="#http_uri_coding_t">http_uri_coding_t</a></li>
460 <li><a href="#http_uri_status_t">http_uri_status_t</a></li>
461 <li><a href="#ipp_attribute_t">ipp_attribute_t</a></li>
462 <li><a href="#ipp_copycb_t">ipp_copycb_t</a></li>
463 <li><a href="#ipp_iocb_t">ipp_iocb_t</a></li>
464 <li><a href="#ipp_orient_t">ipp_orient_t</a></li>
465 <li><a href="#ipp_pstate_t">ipp_pstate_t</a></li>
466 <li><a href="#ipp_quality_t">ipp_quality_t</a></li>
467 <li><a href="#ipp_res_t">ipp_res_t</a></li>
468 <li><a href="#ipp_rstate_t">ipp_rstate_t</a></li>
469 <li><a href="#ipp_sstate_t">ipp_sstate_t</a></li>
470 <li><a href="#ipp_state_t">ipp_state_t</a></li>
471 <li><a href="#ipp_t">ipp_t</a></li>
472 </ul></li>
473 <li><a href="#STRUCTURES">Structures</a><ul class="subcontents">
474 <li><a href="#cups_dest_s">cups_dest_s</a></li>
475 <li><a href="#cups_job_s">cups_job_s</a></li>
476 <li><a href="#cups_option_s">cups_option_s</a></li>
477 <li><a href="#cups_size_s">cups_size_s</a></li>
478 </ul></li>
479 <li><a href="#ENUMERATIONS">Enumerations</a><ul class="subcontents">
480 <li><a href="#cups_ptype_e">cups_ptype_e</a></li>
481 <li><a href="#http_encoding_e">http_encoding_e</a></li>
482 <li><a href="#http_encryption_e">http_encryption_e</a></li>
483 <li><a href="#http_field_e">http_field_e</a></li>
484 <li><a href="#http_keepalive_e">http_keepalive_e</a></li>
485 <li><a href="#http_state_e">http_state_e</a></li>
486 <li><a href="#http_status_e">http_status_e</a></li>
487 <li><a href="#http_trust_e">http_trust_e</a></li>
488 <li><a href="#http_uri_coding_e">http_uri_coding_e</a></li>
489 <li><a href="#http_uri_status_e">http_uri_status_e</a></li>
490 <li><a href="#ipp_finishings_e">ipp_finishings_e</a></li>
491 <li><a href="#ipp_jstate_e">ipp_jstate_e</a></li>
492 <li><a href="#ipp_op_e">ipp_op_e</a></li>
493 <li><a href="#ipp_orient_e">ipp_orient_e</a></li>
494 <li><a href="#ipp_pstate_e">ipp_pstate_e</a></li>
495 <li><a href="#ipp_quality_e">ipp_quality_e</a></li>
496 <li><a href="#ipp_res_e">ipp_res_e</a></li>
497 <li><a href="#ipp_rstate_e">ipp_rstate_e</a></li>
498 <li><a href="#ipp_sstate_e">ipp_sstate_e</a></li>
499 <li><a href="#ipp_state_e">ipp_state_e</a></li>
500 <li><a href="#ipp_status_e">ipp_status_e</a></li>
501 <li><a href="#ipp_tag_e">ipp_tag_e</a></li>
502 </ul></li>
503 </ul>
504 </div>
505 <div class="body">
506 <blockquote>
507 <p>Please <a href="https://github.com/apple/cups/issues">file issues on Github</a> to provide feedback on this document.</p>
508 </blockquote>
509 <h2 class="title" id="introduction">Introduction</h2>
510 <p>CUPS provides the &quot;cups&quot; library to talk to the different parts of CUPS and with Internet Printing Protocol (IPP) printers. The &quot;cups&quot; library functions are accessed by including the <code>&lt;cups/cups.h&gt;</code> header.</p>
511 <p>CUPS is based on the Internet Printing Protocol (&quot;IPP&quot;), which allows clients (applications) to communicate with a server (the scheduler, printers, etc.) to get a list of destinations, send print jobs, and so forth. You identify which server you want to communicate with using a pointer to the opaque structure <code>http_t</code>. The <code>CUPS_HTTP_DEFAULT</code> constant can be used when you want to talk to the CUPS scheduler.</p>
512 <h3 class="title" id="guidelines">Guidelines</h3>
513 <p>When writing software (other than printer drivers) that uses the &quot;cups&quot; library:</p>
514 <ul>
515 <li> <p>Do not use undocumented or deprecated APIs,</p>
516 </li>
517 <li> <p>Do not rely on pre-configured printers,</p>
518 </li>
519 <li> <p>Do not assume that printers support specific features or formats, and</p>
520 </li>
521 <li> <p>Do not rely on implementation details (PPDs, etc.)</p>
522 </li>
523 </ul>
524 <p>CUPS is designed to insulate users and developers from the implementation details of printers and file formats. The goal is to allow an application to supply a print file in a standard format with the user intent (&quot;print four copies, two-sided on A4 media, and staple each copy&quot;) and have the printing system manage the printer communication and format conversion needed.</p>
525 <p>Similarly, printer and job management applications can use standard query operations to obtain the status information in a common, generic form and use standard management operations to control the state of those printers and jobs.</p>
526 <blockquote>
527 <p><strong>Note:</strong></p>
528 <p>CUPS printer drivers necessarily depend on specific file formats and certain implementation details of the CUPS software. Please consult the Postscript and raster printer driver developer documentation on <a href="https://www.cups.org/documentation.html">CUPS.org</a> for more information.</p>
529 </blockquote>
530 <h3 class="title" id="terms-used-in-this-document">Terms Used in This Document</h3>
531 <p>A <em>Destination</em> is a printer or print queue that accepts print jobs. A <em>Print Job</em> is a collection of one or more documents that are processed by a destination using options supplied when creating the job. A <em>Document</em> is a file (JPEG image, PDF file, etc.) suitable for printing. An <em>Option</em> controls some aspect of printing, such as the media used. <em>Media</em> is the sheets or roll that is printed on. An <em>Attribute</em> is an option encoded for an Internet Printing Protocol (IPP) request.</p>
532 <h3 class="title" id="compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</h3>
533 <p>The CUPS libraries can be used from any C, C++, or Objective C program. The method of compiling against the libraries varies depending on the operating system and installation of CUPS. The following sections show how to compile a simple program (shown below) in two common environments.</p>
534 <p>The following simple program lists the available destinations:</p>
535 <pre><code>#include &lt;stdio.h&gt;
536 #include &lt;cups/cups.h&gt;
537
538 int print_dest(void *user_data, unsigned flags, cups_dest_t *dest)
539 {
540 if (dest-&gt;instance)
541 printf(&quot;%s/%s\n&quot;, dest-&gt;name, dest-&gt;instance);
542 else
543 puts(dest-&gt;name);
544
545 return (1);
546 }
547
548 int main(void)
549 {
550 cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, 0, 0, print_dest, NULL);
551
552 return (0);
553 }
554 </code></pre>
555 <h4 id="compiling-with-xcode">Compiling with Xcode</h4>
556 <p>In Xcode, choose <em>New Project...</em> from the <em>File</em> menu (or press SHIFT+CMD+N), then select the <em>Command Line Tool</em> under the macOS Application project type. Click <em>Next</em> and enter a name for the project, for example &quot;firstcups&quot;. Click <em>Next</em> and choose a project directory. The click <em>Next</em> to create the project.</p>
557 <p>In the project window, click on the <em>Build Phases</em> group and expand the <em>Link Binary with Libraries</em> section. Click <em>+</em>, type &quot;libcups&quot; to show the library, and then double-click on <code>libcups.tbd</code>.</p>
558 <p>Finally, click on the <code>main.c</code> file in the sidebar and copy the example program to the file. Build and run (CMD+R) to see the list of destinations.</p>
559 <h4 id="compiling-with-gcc">Compiling with GCC</h4>
560 <p>From the command-line, create a file called <code>sample.c</code> using your favorite editor, copy the example to this file, and save. Then run the following command to compile it with GCC and run it:</p>
561 <pre><code>gcc -o simple `cups-config --cflags` simple.c `cups-config --libs`
562 ./simple
563 </code></pre>
564 <p>The <code>cups-config</code> command provides the compiler flags (<code>cups-config --cflags</code>) and libraries (<code>cups-config --libs</code>) needed for the local system.</p>
565 <h2 class="title" id="working-with-destinations">Working with Destinations</h2>
566 <p>Destinations, which in CUPS represent individual printers or classes (collections or pools) of printers, are represented by the <code>cups_dest_t</code> structure which includes the name (<code>name</code>), instance (<code>instance</code>, saved options/settings), whether the destination is the default for the user (<code>is_default</code>), and the options and basic information associated with that destination (<code>num_options</code> and <code>options</code>).</p>
567 <p>Historically destinations have been manually maintained by the administrator of a system or network, but CUPS also supports dynamic discovery of destinations on the current network.</p>
568 <h3 class="title" id="finding-available-destinations">Finding Available Destinations</h3>
569 <p>The <code>cupsEnumDests</code> function finds all of the available destinations:</p>
570 <pre><code> int
571 cupsEnumDests(unsigned flags, int msec, int *cancel,
572 cups_ptype_t type, cups_ptype_t mask,
573 cups_dest_cb_t cb, void *user_data)
574 </code></pre>
575 <p>The <code>flags</code> argument specifies enumeration options, which at present must be <code>CUPS_DEST_FLAGS_NONE</code>.</p>
576 <p>The <code>msec</code> argument specifies the maximum amount of time that should be used for enumeration in milliseconds - interactive applications should keep this value to 5000 or less when run on the main thread.</p>
577 <p>The <code>cancel</code> argument points to an integer variable that, when set to a non-zero value, will cause enumeration to stop as soon as possible. It can be <code>NULL</code> if not needed.</p>
578 <p>The <code>type</code> and <code>mask</code> arguments are bitfields that allow the caller to filter the destinations based on categories and/or capabilities. The destination's &quot;printer-type&quot; value is masked by the <code>mask</code> value and compared to the <code>type</code> value when filtering. For example, to only enumerate destinations that are hosted on the local system, pass <code>CUPS_PRINTER_LOCAL</code> for the <code>type</code> argument and <code>CUPS_PRINTER_DISCOVERED</code> for the <code>mask</code> argument. The following constants can be used for filtering:</p>
579 <ul>
580 <li> <p><code>CUPS_PRINTER_CLASS</code>: A collection of destinations.</p>
581 </li>
582 <li> <p><code>CUPS_PRINTER_FAX</code>: A facsimile device.</p>
583 </li>
584 <li> <p><code>CUPS_PRINTER_LOCAL</code>: A local printer or class. This constant has the value 0 (no bits set) and is only used for the <code>type</code> argument and is paired with the <code>CUPS_PRINTER_REMOTE</code> or <code>CUPS_PRINTER_DISCOVERED</code> constant passed in the <code>mask</code> argument.</p>
585 </li>
586 <li> <p><code>CUPS_PRINTER_REMOTE</code>: A remote (shared) printer or class.</p>
587 </li>
588 <li> <p><code>CUPS_PRINTER_DISCOVERED</code>: An available network printer or class.</p>
589 </li>
590 <li> <p><code>CUPS_PRINTER_BW</code>: Can do B&amp;W printing.</p>
591 </li>
592 <li> <p><code>CUPS_PRINTER_COLOR</code>: Can do color printing.</p>
593 </li>
594 <li> <p><code>CUPS_PRINTER_DUPLEX</code>: Can do two-sided printing.</p>
595 </li>
596 <li> <p><code>CUPS_PRINTER_STAPLE</code>: Can staple output.</p>
597 </li>
598 <li> <p><code>CUPS_PRINTER_COLLATE</code>: Can quickly collate copies.</p>
599 </li>
600 <li> <p><code>CUPS_PRINTER_PUNCH</code>: Can punch output.</p>
601 </li>
602 <li> <p><code>CUPS_PRINTER_COVER</code>: Can cover output.</p>
603 </li>
604 <li> <p><code>CUPS_PRINTER_BIND</code>: Can bind output.</p>
605 </li>
606 <li> <p><code>CUPS_PRINTER_SORT</code>: Can sort output (mailboxes, etc.)</p>
607 </li>
608 <li> <p><code>CUPS_PRINTER_SMALL</code>: Can print on Letter/Legal/A4-size media.</p>
609 </li>
610 <li> <p><code>CUPS_PRINTER_MEDIUM</code>: Can print on Tabloid/B/C/A3/A2-size media.</p>
611 </li>
612 <li> <p><code>CUPS_PRINTER_LARGE</code>: Can print on D/E/A1/A0-size media.</p>
613 </li>
614 <li> <p><code>CUPS_PRINTER_VARIABLE</code>: Can print on rolls and custom-size media.</p>
615 </li>
616 </ul>
617 <p>The <code>cb</code> argument specifies a function to call for every destination that is found:</p>
618 <pre><code>typedef int (*cups_dest_cb_t)(void *user_data,
619 unsigned flags,
620 cups_dest_t *dest);
621 </code></pre>
622 <p>The callback function receives a copy of the <code>user_data</code> argument along with a bitfield (<code>flags</code>) and the destination that was found. The <code>flags</code> argument can have any of the following constant (bit) values set:</p>
623 <ul>
624 <li> <p><code>CUPS_DEST_FLAGS_MORE</code>: There are more destinations coming.</p>
625 </li>
626 <li> <p><code>CUPS_DEST_FLAGS_REMOVED</code>: The destination has gone away and should be removed from the list of destinations a user can select.</p>
627 </li>
628 <li> <p><code>CUPS_DEST_FLAGS_ERROR</code>: An error occurred. The reason for the error can be found by calling the <code>cupsLastError</code> and/or <code>cupsLastErrorString</code> functions.</p>
629 </li>
630 </ul>
631 <p>The callback function returns 0 to stop enumeration or 1 to continue.</p>
632 <blockquote>
633 <p><strong>Note:</strong></p>
634 <p>The callback function will likely be called multiple times for the same destination, so it is up to the caller to suppress any duplicate destinations.</p>
635 </blockquote>
636 <p>The following example shows how to use <code>cupsEnumDests</code> to get a filtered array of destinations:</p>
637 <pre><code>typedef struct
638 {
639 int num_dests;
640 cups_dest_t *dests;
641 } my_user_data_t;
642
643 int
644 my_dest_cb(my_user_data_t *user_data, unsigned flags,
645 cups_dest_t *dest)
646 {
647 if (flags &amp; CUPS_DEST_FLAGS_REMOVED)
648 {
649 /*
650 * Remove destination from array...
651 */
652
653 user_data-&gt;num_dests =
654 cupsRemoveDest(dest-&gt;name, dest-&gt;instance,
655 user_data-&gt;num_dests,
656 &amp;(user_data-&gt;dests));
657 }
658 else
659 {
660 /*
661 * Add destination to array...
662 */
663
664 user_data-&gt;num_dests =
665 cupsCopyDest(dest, user_data-&gt;num_dests,
666 &amp;(user_data-&gt;dests));
667 }
668
669 return (1);
670 }
671
672 int
673 my_get_dests(cups_ptype_t type, cups_ptype_t mask,
674 cups_dest_t **dests)
675 {
676 my_user_data_t user_data = { 0, NULL };
677
678 if (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, type,
679 mask, (cups_dest_cb_t)my_dest_cb,
680 &amp;user_data))
681 {
682 /*
683 * An error occurred, free all of the destinations and
684 * return...
685 */
686
687 cupsFreeDests(user_data.num_dests, user_dasta.dests);
688
689 *dests = NULL;
690
691 return (0);
692 }
693
694 /*
695 * Return the destination array...
696 */
697
698 *dests = user_data.dests;
699
700 return (user_data.num_dests);
701 }
702 </code></pre>
703 <h3 class="title" id="basic-destination-information">Basic Destination Information</h3>
704 <p>The <code>num_options</code> and <code>options</code> members of the <code>cups_dest_t</code> structure provide basic attributes about the destination in addition to the user default options and values for that destination. The following names are predefined for various destination attributes:</p>
705 <ul>
706 <li> <p>&quot;auth-info-required&quot;: The type of authentication required for printing to this destination: &quot;none&quot;, &quot;username,password&quot;, &quot;domain,username,password&quot;, or &quot;negotiate&quot; (Kerberos).</p>
707 </li>
708 <li> <p>&quot;printer-info&quot;: The human-readable description of the destination such as &quot;My Laser Printer&quot;.</p>
709 </li>
710 <li> <p>&quot;printer-is-accepting-jobs&quot;: &quot;true&quot; if the destination is accepting new jobs, &quot;false&quot; otherwise.</p>
711 </li>
712 <li> <p>&quot;printer-is-shared&quot;: &quot;true&quot; if the destination is being shared with other computers, &quot;false&quot; otherwise.</p>
713 </li>
714 <li> <p>&quot;printer-location&quot;: The human-readable location of the destination such as &quot;Lab 4&quot;.</p>
715 </li>
716 <li> <p>&quot;printer-make-and-model&quot;: The human-readable make and model of the destination such as &quot;ExampleCorp LaserPrinter 4000 Series&quot;.</p>
717 </li>
718 <li> <p>&quot;printer-state&quot;: &quot;3&quot; if the destination is idle, &quot;4&quot; if the destination is printing a job, and &quot;5&quot; if the destination is stopped.</p>
719 </li>
720 <li> <p>&quot;printer-state-change-time&quot;: The UNIX time when the destination entered the current state.</p>
721 </li>
722 <li> <p>&quot;printer-state-reasons&quot;: Additional comma-delimited state keywords for the destination such as &quot;media-tray-empty-error&quot; and &quot;toner-low-warning&quot;.</p>
723 </li>
724 <li> <p>&quot;printer-type&quot;: The <code>cups_ptype_t</code> value associated with the destination.</p>
725 </li>
726 <li> <p>&quot;printer-uri-supported&quot;: The URI associated with the destination; if not set, this destination was discovered but is not yet setup as a local printer.</p>
727 </li>
728 </ul>
729 <p>Use the <code>cupsGetOption</code> function to retrieve the value. For example, the following code gets the make and model of a destination:</p>
730 <pre><code>const char *model = cupsGetOption(&quot;printer-make-and-model&quot;,
731 dest-&gt;num_options,
732 dest-&gt;options);
733 </code></pre>
734 <h3 class="title" id="detailed-destination-information">Detailed Destination Information</h3>
735 <p>Once a destination has been chosen, the <code>cupsCopyDestInfo</code> function can be used to gather detailed information about the destination:</p>
736 <pre><code>cups_dinfo_t *
737 cupsCopyDestInfo(http_t *http, cups_dest_t *dest);
738 </code></pre>
739 <p>The <code>http</code> argument specifies a connection to the CUPS scheduler and is typically the constant <code>CUPS_HTTP_DEFAULT</code>. The <code>dest</code> argument specifies the destination to query.</p>
740 <p>The <code>cups_dinfo_t</code> structure that is returned contains a snapshot of the supported options and their supported, ready, and default values. It also can report constraints between different options and values, and recommend changes to resolve those constraints.</p>
741 <h4 id="getting-supported-options-and-values">Getting Supported Options and Values</h4>
742 <p>The <code>cupsCheckDestSupported</code> function can be used to test whether a particular option or option and value is supported:</p>
743 <pre><code>int
744 cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
745 cups_dinfo_t *info,
746 const char *option,
747 const char *value);
748 </code></pre>
749 <p>The <code>option</code> argument specifies the name of the option to check. The following constants can be used to check the various standard options:</p>
750 <ul>
751 <li> <p><code>CUPS_COPIES</code>: Controls the number of copies that are produced.</p>
752 </li>
753 <li> <p><code>CUPS_FINISHINGS</code>: A comma-delimited list of integer constants that control the finishing processes that are applied to the job, including stapling, punching, and folding.</p>
754 </li>
755 <li> <p><code>CUPS_MEDIA</code>: Controls the media size that is used, typically one of the following: <code>CUPS_MEDIA_3X5</code>, <code>CUPS_MEDIA_4X6</code>, <code>CUPS_MEDIA_5X7</code>, <code>CUPS_MEDIA_8X10</code>, <code>CUPS_MEDIA_A3</code>, <code>CUPS_MEDIA_A4</code>, <code>CUPS_MEDIA_A5</code>, <code>CUPS_MEDIA_A6</code>, <code>CUPS_MEDIA_ENV10</code>, <code>CUPS_MEDIA_ENVDL</code>, <code>CUPS_MEDIA_LEGAL</code>, <code>CUPS_MEDIA_LETTER</code>, <code>CUPS_MEDIA_PHOTO_L</code>, <code>CUPS_MEDIA_SUPERBA3</code>, or <code>CUPS_MEDIA_TABLOID</code>.</p>
756 </li>
757 <li> <p><code>CUPS_MEDIA_SOURCE</code>: Controls where the media is pulled from, typically either <code>CUPS_MEDIA_SOURCE_AUTO</code> or <code>CUPS_MEDIA_SOURCE_MANUAL</code>.</p>
758 </li>
759 <li> <p><code>CUPS_MEDIA_TYPE</code>: Controls the type of media that is used, typically one of the following: <code>CUPS_MEDIA_TYPE_AUTO</code>, <code>CUPS_MEDIA_TYPE_ENVELOPE</code>, <code>CUPS_MEDIA_TYPE_LABELS</code>, <code>CUPS_MEDIA_TYPE_LETTERHEAD</code>, <code>CUPS_MEDIA_TYPE_PHOTO</code>, <code>CUPS_MEDIA_TYPE_PHOTO_GLOSSY</code>, <code>CUPS_MEDIA_TYPE_PHOTO_MATTE</code>, <code>CUPS_MEDIA_TYPE_PLAIN</code>, or <code>CUPS_MEDIA_TYPE_TRANSPARENCY</code>.</p>
760 </li>
761 <li> <p><code>CUPS_NUMBER_UP</code>: Controls the number of document pages that are placed on each media side.</p>
762 </li>
763 <li> <p><code>CUPS_ORIENTATION</code>: Controls the orientation of document pages placed on the media: <code>CUPS_ORIENTATION_PORTRAIT</code> or <code>CUPS_ORIENTATION_LANDSCAPE</code>.</p>
764 </li>
765 <li> <p><code>CUPS_PRINT_COLOR_MODE</code>: Controls whether the output is in color (<code>CUPS_PRINT_COLOR_MODE_COLOR</code>), grayscale (<code>CUPS_PRINT_COLOR_MODE_MONOCHROME</code>), or either (<code>CUPS_PRINT_COLOR_MODE_AUTO</code>).</p>
766 </li>
767 <li> <p><code>CUPS_PRINT_QUALITY</code>: Controls the generate quality of the output: <code>CUPS_PRINT_QUALITY_DRAFT</code>, <code>CUPS_PRINT_QUALITY_NORMAL</code>, or <code>CUPS_PRINT_QUALITY_HIGH</code>.</p>
768 </li>
769 <li> <p><code>CUPS_SIDES</code>: Controls whether prints are placed on one or both sides of the media: <code>CUPS_SIDES_ONE_SIDED</code>, <code>CUPS_SIDES_TWO_SIDED_PORTRAIT</code>, or <code>CUPS_SIDES_TWO_SIDED_LANDSCAPE</code>.</p>
770 </li>
771 </ul>
772 <p>If the <code>value</code> argument is <code>NULL</code>, the <code>cupsCheckDestSupported</code> function returns whether the option is supported by the destination. Otherwise, the function returns whether the specified value of the option is supported.</p>
773 <p>The <code>cupsFindDestSupported</code> function returns the IPP attribute containing the supported values for a given option:</p>
774 <pre><code> ipp_attribute_t *
775 cupsFindDestSupported(http_t *http, cups_dest_t *dest,
776 cups_dinfo_t *dinfo,
777 const char *option);
778 </code></pre>
779 <p>For example, the following code prints the supported finishing processes for a destination, if any, to the standard output:</p>
780 <pre><code>cups_dinfo_t *info = cupsCopyDestInfo(CUPS_HTTP_DEFAULT,
781 dest);
782
783 if (cupsCheckDestSupported(CUPS_HTTP_DEFAULT, dest, info,
784 CUPS_FINISHINGS, NULL))
785 {
786 ipp_attribute_t *finishings =
787 cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
788 CUPS_FINISHINGS);
789 int i, count = ippGetCount(finishings);
790
791 puts(&quot;finishings supported:&quot;);
792 for (i = 0; i &lt; count; i ++)
793 printf(&quot; %d\n&quot;, ippGetInteger(finishings, i));
794 }
795 else
796 puts(&quot;finishings not supported.&quot;);
797 </code></pre>
798 <p>The &quot;job-creation-attributes&quot; option can be queried to get a list of supported options. For example, the following code prints the list of supported options to the standard output:</p>
799 <pre><code>ipp_attribute_t *attrs =
800 cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
801 &quot;job-creation-attributes&quot;);
802 int i, count = ippGetCount(attrs);
803
804 for (i = 0; i &lt; count; i ++)
805 puts(ippGetString(attrs, i, NULL));
806 </code></pre>
807 <h4 id="getting-default-values">Getting Default Values</h4>
808 <p>There are two sets of default values - user defaults that are available via the <code>num_options</code> and <code>options</code> members of the <code>cups_dest_t</code> structure, and destination defaults that available via the <code>cups_dinfo_t</code> structure and the <code>cupsFindDestDefault</code> function which returns the IPP attribute containing the default value(s) for a given option:</p>
809 <pre><code>ipp_attribute_t *
810 cupsFindDestDefault(http_t *http, cups_dest_t *dest,
811 cups_dinfo_t *dinfo,
812 const char *option);
813 </code></pre>
814 <p>The user defaults from <code>cupsGetOption</code> should always take preference over the destination defaults. For example, the following code prints the default finishings value(s) to the standard output:</p>
815 <pre><code>const char *def_value =
816 cupsGetOption(CUPS_FINISHINGS, dest-&gt;num_options,
817 dest-&gt;options);
818 ipp_attribute_t *def_attr =
819 cupsFindDestDefault(CUPS_HTTP_DEFAULT, dest, info,
820 CUPS_FINISHINGS);
821
822 if (def_value != NULL)
823 {
824 printf(&quot;Default finishings: %s\n&quot;, def_value);
825 }
826 else
827 {
828 int i, count = ippGetCount(def_attr);
829
830 printf(&quot;Default finishings: %d&quot;,
831 ippGetInteger(def_attr, 0));
832 for (i = 1; i &lt; count; i ++)
833 printf(&quot;,%d&quot;, ippGetInteger(def_attr, i));
834 putchar('\n');
835 }
836 </code></pre>
837 <h4 id="getting-ready-loaded-values">Getting Ready (Loaded) Values</h4>
838 <p>The finishings and media options also support queries for the ready, or loaded, values. For example, a printer may have punch and staple finishers installed but be out of staples - the supported values will list both punch and staple finishing processes but the ready values will only list the punch processes. Similarly, a printer may support hundreds of different sizes of media but only have a single size loaded at any given time - the ready values are limited to the media that is actually in the printer.</p>
839 <p>The <code>cupsFindDestReady</code> function finds the IPP attribute containing the ready values for a given option:</p>
840 <pre><code>ipp_attribute_t *
841 cupsFindDestReady(http_t *http, cups_dest_t *dest,
842 cups_dinfo_t *dinfo, const char *option);
843 </code></pre>
844 <p>For example, the following code lists the ready finishing processes:</p>
845 <pre><code>ipp_attribute_t *ready_finishings =
846 cupsFindDestReady(CUPS_HTTP_DEFAULT, dest, info,
847 CUPS_FINISHINGS);
848
849 if (ready_finishings != NULL)
850 {
851 int i, count = ippGetCount(ready_finishings);
852
853 puts(&quot;finishings ready:&quot;);
854 for (i = 0; i &lt; count; i ++)
855 printf(&quot; %d\n&quot;, ippGetInteger(ready_finishings, i));
856 }
857 else
858 puts(&quot;no finishings are ready.&quot;);
859 </code></pre>
860 <h4 id="media-size-options">Media Size Options</h4>
861 <p>CUPS provides functions for querying the dimensions and margins for each of the supported media size options. The <code>cups_size_t</code> structure is used to describe a media size:</p>
862 <pre><code>typedef struct cups_size_s
863 {
864 char media[128];
865 int width, length;
866 int bottom, left, right, top;
867 } cups_size_t;
868 </code></pre>
869 <p>The <code>width</code> and <code>length</code> members specify the dimensions of the media in hundredths of millimeters (1/2540th of an inch). The <code>bottom</code>, <code>left</code>, <code>right</code>, and <code>top</code> members specify the margins of the printable area, also in hundredths of millimeters.</p>
870 <p>The <code>cupsGetDestMediaByName</code> and <code>cupsGetDestMediaBySize</code> functions lookup the media size information using a standard media size name or dimensions in hundredths of millimeters:</p>
871 <pre><code>int
872 cupsGetDestMediaByName(http_t *http, cups_dest_t *dest,
873 cups_dinfo_t *dinfo,
874 const char *media,
875 unsigned flags, cups_size_t *size);
876
877 int
878 cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest,
879 cups_dinfo_t *dinfo,
880 int width, int length,
881 unsigned flags, cups_size_t *size);
882 </code></pre>
883 <p>The <code>media</code>, <code>width</code>, and <code>length</code> arguments specify the size to lookup. The <code>flags</code> argument specifies a bitfield controlling various lookup options:</p>
884 <ul>
885 <li> <p><code>CUPS_MEDIA_FLAGS_DEFAULT</code>: Find the closest size supported by the printer.</p>
886 </li>
887 <li> <p><code>CUPS_MEDIA_FLAGS_BORDERLESS</code>: Find a borderless size.</p>
888 </li>
889 <li> <p><code>CUPS_MEDIA_FLAGS_DUPLEX</code>: Find a size compatible with two-sided printing.</p>
890 </li>
891 <li> <p><code>CUPS_MEDIA_FLAGS_EXACT</code>: Find an exact match for the size.</p>
892 </li>
893 <li> <p><code>CUPS_MEDIA_FLAGS_READY</code>: If the printer supports media sensing or configuration of the media in each tray/source, find the size amongst the &quot;ready&quot; media.</p>
894 </li>
895 </ul>
896 <p>If a matching size is found for the destination, the size information is stored in the structure pointed to by the <code>size</code> argument and 1 is returned. Otherwise 0 is returned.</p>
897 <p>For example, the following code prints the margins for two-sided printing on US Letter media:</p>
898 <pre><code>cups_size_t size;
899
900 if (cupsGetDestMediaByName(CUPS_HTTP_DEFAULT, dest, info,
901 CUPS_MEDIA_LETTER,
902 CUPS_MEDIA_FLAGS_DUPLEX, &amp;size))
903 {
904 puts(&quot;Margins for duplex US Letter:&quot;);
905 printf(&quot; Bottom: %.2fin\n&quot;, size.bottom / 2540.0);
906 printf(&quot; Left: %.2fin\n&quot;, size.left / 2540.0);
907 printf(&quot; Right: %.2fin\n&quot;, size.right / 2540.0);
908 printf(&quot; Top: %.2fin\n&quot;, size.top / 2540.0);
909 }
910 else
911 puts(&quot;Margins for duplex US Letter are not available.&quot;);
912 </code></pre>
913 <p>You can also enumerate all of the sizes that match a given <code>flags</code> value using the <code>cupsGetDestMediaByIndex</code> and <code>cupsGetDestMediaCount</code> functions:</p>
914 <pre><code>int
915 cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest,
916 cups_dinfo_t *dinfo, int n,
917 unsigned flags, cups_size_t *size);
918
919 int
920 cupsGetDestMediaCount(http_t *http, cups_dest_t *dest,
921 cups_dinfo_t *dinfo, unsigned flags);
922 </code></pre>
923 <p>For example, the following code prints the list of ready media and corresponding margins:</p>
924 <pre><code>cups_size_t size;
925 int i;
926 int count = cupsGetDestMediaCount(CUPS_HTTP_DEFAULT,
927 dest, info,
928 CUPS_MEDIA_FLAGS_READY);
929
930 for (i = 0; i &lt; count; i ++)
931 {
932 if (cupsGetDestMediaByIndex(CUPS_HTTP_DEFAULT, dest, info,
933 i, CUPS_MEDIA_FLAGS_READY,
934 &amp;size))
935 {
936 printf(&quot;%s:\n&quot;, size.name);
937 printf(&quot; Width: %.2fin\n&quot;, size.width / 2540.0);
938 printf(&quot; Length: %.2fin\n&quot;, size.length / 2540.0);
939 printf(&quot; Bottom: %.2fin\n&quot;, size.bottom / 2540.0);
940 printf(&quot; Left: %.2fin\n&quot;, size.left / 2540.0);
941 printf(&quot; Right: %.2fin\n&quot;, size.right / 2540.0);
942 printf(&quot; Top: %.2fin\n&quot;, size.top / 2540.0);
943 }
944 }
945 </code></pre>
946 <p>Finally, the <code>cupsGetDestMediaDefault</code> function returns the default media size:</p>
947 <pre><code>int
948 cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
949 cups_dinfo_t *dinfo, unsigned flags,
950 cups_size_t *size);
951 </code></pre>
952 <h4 id="localizing-options-and-values">Localizing Options and Values</h4>
953 <p>CUPS provides three functions to get localized, human-readable strings in the user's current locale for options and values: <code>cupsLocalizeDestMedia</code>, <code>cupsLocalizeDestOption</code>, and <code>cupsLocalizeDestValue</code>:</p>
954 <pre><code>const char *
955 cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest,
956 cups_dinfo_t *info, unsigned flags,
957 cups_size_t *size);
958
959 const char *
960 cupsLocalizeDestOption(http_t *http, cups_dest_t *dest,
961 cups_dinfo_t *info,
962 const char *option);
963
964 const char *
965 cupsLocalizeDestValue(http_t *http, cups_dest_t *dest,
966 cups_dinfo_t *info,
967 const char *option, const char *value);
968 </code></pre>
969 <h3 class="title" id="submitting-a-print-job">Submitting a Print Job</h3>
970 <p>Once you are ready to submit a print job, you create a job using the <code>cupsCreateDestJob</code> function:</p>
971 <pre><code>ipp_status_t
972 cupsCreateDestJob(http_t *http, cups_dest_t *dest,
973 cups_dinfo_t *info, int *job_id,
974 const char *title, int num_options,
975 cups_option_t *options);
976 </code></pre>
977 <p>The <code>title</code> argument specifies a name for the print job such as &quot;My Document&quot;. The <code>num_options</code> and <code>options</code> arguments specify the options for the print job which are allocated using the <code>cupsAddOption</code> function.</p>
978 <p>When successful, the job's numeric identifier is stored in the integer pointed to by the <code>job_id</code> argument and <code>IPP_STATUS_OK</code> is returned. Otherwise, an IPP error status is returned.</p>
979 <p>For example, the following code creates a new job that will print 42 copies of a two-sided US Letter document:</p>
980 <pre><code>int job_id = 0;
981 int num_options = 0;
982 cups_option_t *options = NULL;
983
984 num_options = cupsAddOption(CUPS_COPIES, &quot;42&quot;,
985 num_options, &amp;options);
986 num_options = cupsAddOption(CUPS_MEDIA, CUPS_MEDIA_LETTER,
987 num_options, &amp;options);
988 num_options = cupsAddOption(CUPS_SIDES,
989 CUPS_SIDES_TWO_SIDED_PORTRAIT,
990 num_options, &amp;options);
991
992 if (cupsCreateDestJob(CUPS_HTTP_DEFAULT, dest, info,
993 &amp;job_id, &quot;My Document&quot;, num_options,
994 options) == IPP_STATUS_OK)
995 printf(&quot;Created job: %d\n&quot;, job_id);
996 else
997 printf(&quot;Unable to create job: %s\n&quot;,
998 cupsLastErrorString());
999 </code></pre>
1000 <p>Once the job is created, you submit documents for the job using the <code>cupsStartDestDocument</code>, <code>cupsWriteRequestData</code>, and <code>cupsFinishDestDocument</code> functions:</p>
1001 <pre><code>http_status_t
1002 cupsStartDestDocument(http_t *http, cups_dest_t *dest,
1003 cups_dinfo_t *info, int job_id,
1004 const char *docname,
1005 const char *format,
1006 int num_options,
1007 cups_option_t *options,
1008 int last_document);
1009
1010 http_status_t
1011 cupsWriteRequestData(http_t *http, const char *buffer,
1012 size_t length);
1013
1014 ipp_status_t
1015 cupsFinishDestDocument(http_t *http, cups_dest_t *dest,
1016 cups_dinfo_t *info);
1017 </code></pre>
1018 <p>The <code>docname</code> argument specifies the name of the document, typically the original filename. The <code>format</code> argument specifies the MIME media type of the document, including the following constants:</p>
1019 <ul>
1020 <li> <p><code>CUPS_FORMAT_JPEG</code>: &quot;image/jpeg&quot;</p>
1021 </li>
1022 <li> <p><code>CUPS_FORMAT_PDF</code>: &quot;application/pdf&quot;</p>
1023 </li>
1024 <li> <p><code>CUPS_FORMAT_POSTSCRIPT</code>: &quot;application/postscript&quot;</p>
1025 </li>
1026 <li> <p><code>CUPS_FORMAT_TEXT</code>: &quot;text/plain&quot;</p>
1027 </li>
1028 </ul>
1029 <p>The <code>num_options</code> and <code>options</code> arguments specify per-document print options, which at present must be 0 and <code>NULL</code>. The <code>last_document</code> argument specifies whether this is the last document in the job.</p>
1030 <p>For example, the following code submits a PDF file to the job that was just created:</p>
1031 <pre><code>FILE *fp = fopen(&quot;filename.pdf&quot;, &quot;rb&quot;);
1032 size_t bytes;
1033 char buffer[65536];
1034
1035 if (cupsStartDestDocument(CUPS_HTTP_DEFAULT, dest, info,
1036 job_id, &quot;filename.pdf&quot;, 0, NULL,
1037 1) == HTTP_STATUS_CONTINUE)
1038 {
1039 while ((bytes = fread(buffer, 1, sizeof(buffer), fp)) &gt; 0)
1040 if (cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer,
1041 bytes) != HTTP_STATUS_CONTINUE)
1042 break;
1043
1044 if (cupsFinishDestDocument(CUPS_HTTP_DEFAULT, dest,
1045 info) == IPP_STATUS_OK)
1046 puts(&quot;Document send succeeded.&quot;);
1047 else
1048 printf(&quot;Document send failed: %s\n&quot;,
1049 cupsLastErrorString());
1050 }
1051
1052 fclose(fp);
1053 </code></pre>
1054 <h2 class="title" id="sending-ipp-requests">Sending IPP Requests</h2>
1055 <p>CUPS provides a rich API for sending IPP requests to the scheduler or printers, typically from management or utility applications whose primary purpose is not to send print jobs.</p>
1056 <h3 class="title" id="connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</h3>
1057 <p>The connection to the scheduler or printer is represented by the HTTP connection type <code>http_t</code>. The <code>cupsConnectDest</code> function connects to the scheduler or printer associated with the destination:</p>
1058 <pre><code>http_t *
1059 cupsConnectDest(cups_dest_t *dest, unsigned flags, int msec,
1060 int *cancel, char *resource,
1061 size_t resourcesize, cups_dest_cb_t cb,
1062 void *user_data);
1063 </code></pre>
1064 <p>The <code>dest</code> argument specifies the destination to connect to.</p>
1065 <p>The <code>flags</code> argument specifies whether you want to connect to the scheduler (<code>CUPS_DEST_FLAGS_NONE</code>) or device/printer (<code>CUPS_DEST_FLAGS_DEVICE</code>) associated with the destination.</p>
1066 <p>The <code>msec</code> argument specifies how long you are willing to wait for the connection to be established in milliseconds. Specify a value of <code>-1</code> to wait indefinitely.</p>
1067 <p>The <code>cancel</code> argument specifies the address of an integer variable that can be set to a non-zero value to cancel the connection. Specify a value of <code>NULL</code> to not provide a cancel variable.</p>
1068 <p>The <code>resource</code> and <code>resourcesize</code> arguments specify the address and size of a character string array to hold the path to use when sending an IPP request.</p>
1069 <p>The <code>cb</code> and <code>user_data</code> arguments specify a destination callback function that returns 1 to continue connecting or 0 to stop. The destination callback work the same way as the one used for the <code>cupsEnumDests</code> function.</p>
1070 <p>On success, a HTTP connection is returned that can be used to send IPP requests and get IPP responses.</p>
1071 <p>For example, the following code connects to the printer associated with a destination with a 30 second timeout:</p>
1072 <pre><code>char resource[256];
1073 http_t *http = cupsConnectDest(dest, CUPS_DEST_FLAGS_DEVICE,
1074 30000, NULL, resource,
1075 sizeof(resource), NULL, NULL);
1076 </code></pre>
1077 <h3 class="title" id="creating-an-ipp-request">Creating an IPP Request</h3>
1078 <p>IPP requests are represented by the IPP message type <code>ipp_t</code> and each IPP attribute in the request is representing using the type <code>ipp_attribute_t</code>. Each IPP request includes an operation code (<code>IPP_OP_CREATE_JOB</code>, <code>IPP_OP_GET_PRINTER_ATTRIBUTES</code>, etc.) and a 32-bit integer identifier.</p>
1079 <p>The <code>ippNewRequest</code> function creates a new IPP request:</p>
1080 <pre><code>ipp_t *
1081 ippNewRequest(ipp_op_t op);
1082 </code></pre>
1083 <p>The <code>op</code> argument specifies the IPP operation code for the request. For example, the following code creates an IPP Get-Printer-Attributes request:</p>
1084 <pre><code>ipp_t *request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
1085 </code></pre>
1086 <p>The request identifier is automatically set to a unique value for the current process.</p>
1087 <p>Each IPP request starts with two IPP attributes, &quot;attributes-charset&quot; and &quot;attributes-natural-language&quot;, followed by IPP attribute(s) that specify the target of the operation. The <code>ippNewRequest</code> automatically adds the correct &quot;attributes-charset&quot; and &quot;attributes-natural-language&quot; attributes, but you must add the target attribute(s). For example, the following code adds the &quot;printer-uri&quot; attribute to the IPP Get-Printer-Attributes request to specify which printer is being queried:</p>
1088 <pre><code>const char *printer_uri = cupsGetOption(&quot;device-uri&quot;,
1089 dest-&gt;num_options,
1090 dest-&gt;options);
1091
1092 ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
1093 &quot;printer-uri&quot;, NULL, printer_uri);
1094 </code></pre>
1095 <blockquote>
1096 <p><strong>Note:</strong></p>
1097 <p>If we wanted to query the scheduler instead of the device, we would look up the &quot;printer-uri-supported&quot; option instead of the &quot;device-uri&quot; value.</p>
1098 </blockquote>
1099 <p>The <code>ippAddString</code> function adds the &quot;printer-uri&quot; attribute the the IPP request. The <code>IPP_TAG_OPERATION</code> argument specifies that the attribute is part of the operation. The <code>IPP_TAG_URI</code> argument specifies that the value is a Universal Resource Identifier (URI) string. The <code>NULL</code> argument specifies there is no language (English, French, Japanese, etc.) associated with the string, and the <code>printer_uri</code> argument specifies the string value.</p>
1100 <p>The IPP Get-Printer-Attributes request also supports an IPP attribute called &quot;requested-attributes&quot; that lists the attributes and values you are interested in. For example, the following code requests the printer state attributes:</p>
1101 <pre><code>static const char * const requested_attributes[] =
1102 {
1103 &quot;printer-state&quot;,
1104 &quot;printer-state-message&quot;,
1105 &quot;printer-state-reasons&quot;
1106 };
1107
1108 ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
1109 &quot;requested-attributes&quot;, 3, NULL,
1110 requested_attributes);
1111 </code></pre>
1112 <p>The <code>ippAddStrings</code> function adds an attribute with one or more strings, in this case three. The <code>IPP_TAG_KEYWORD</code> argument specifies that the strings are keyword values, which are used for attribute names. All strings use the same language (<code>NULL</code>), and the attribute will contain the three strings in the array <code>requested_attributes</code>.</p>
1113 <p>CUPS provides many functions to adding attributes of different types:</p>
1114 <ul>
1115 <li> <p><code>ippAddBoolean</code> adds a boolean (<code>IPP_TAG_BOOLEAN</code>) attribute with one value.</p>
1116 </li>
1117 <li> <p><code>ippAddInteger</code> adds an enum (<code>IPP_TAG_ENUM</code>) or integer (<code>IPP_TAG_INTEGER</code>) attribute with one value.</p>
1118 </li>
1119 <li> <p><code>ippAddIntegers</code> adds an enum or integer attribute with one or more values.</p>
1120 </li>
1121 <li> <p><code>ippAddOctetString</code> adds an octetString attribute with one value.</p>
1122 </li>
1123 <li> <p><code>ippAddOutOfBand</code> adds a admin-defined (<code>IPP_TAG_ADMINDEFINE</code>), default (<code>IPP_TAG_DEFAULT</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable (<code>IPP_TAG_NOTSETTABLE</code>), unknown (<code>IPP_TAG_UNKNOWN</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_VALUE</code>) out-of-band attribute.</p>
1124 </li>
1125 <li> <p><code>ippAddRange</code> adds a rangeOfInteger attribute with one range.</p>
1126 </li>
1127 <li> <p><code>ippAddRanges</code> adds a rangeOfInteger attribute with one or more ranges.</p>
1128 </li>
1129 <li> <p><code>ippAddResolution</code> adds a resolution attribute with one resolution.</p>
1130 </li>
1131 <li> <p><code>ippAddResolutions</code> adds a resolution attribute with one or more resolutions.</p>
1132 </li>
1133 <li> <p><code>ippAddString</code> adds a charset (<code>IPP_TAG_CHARSET</code>), keyword (<code>IPP_TAG_KEYWORD</code>), mimeMediaType (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code> and <code>IPP_TAG_NAMELANG</code>), naturalLanguage (<code>IPP_TAG_NATURAL_LANGUAGE</code>), text (<code>IPP_TAG_TEXT</code> and <code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), or uriScheme (<code>IPP_TAG_URISCHEME</code>) attribute with one value.</p>
1134 </li>
1135 <li> <p><code>ippAddStrings</code> adds a charset, keyword, mimeMediaType, name, naturalLanguage, text, uri, or uriScheme attribute with one or more values.</p>
1136 </li>
1137 </ul>
1138 <h3 class="title" id="sending-the-ipp-request">Sending the IPP Request</h3>
1139 <p>Once you have created the IPP request, you can send it using the <code>cupsDoRequest</code> function. For example, the following code sends the IPP Get-Printer-Attributes request to the destination and saves the response:</p>
1140 <pre><code>ipp_t *response = cupsDoRequest(http, request, resource);
1141 </code></pre>
1142 <p>For requests like Send-Document that include a file, the <code>cupsDoFileRequest</code> function should be used:</p>
1143 <pre><code>ipp_t *response = cupsDoFileRequest(http, request, resource,
1144 filename);
1145 </code></pre>
1146 <p>Both <code>cupsDoRequest</code> and <code>cupsDoFileRequest</code> free the IPP request. If a valid IPP response is received, it is stored in a new IPP message (<code>ipp_t</code>) and returned to the caller. Otherwise <code>NULL</code> is returned.</p>
1147 <p>The status from the most recent request can be queried using the <code>cupsLastError</code> function, for example:</p>
1148 <pre><code>if (cupsLastError() &gt;= IPP_STATUS_ERROR_BAD_REQUEST)
1149 {
1150 /* request failed */
1151 }
1152 </code></pre>
1153 <p>A human-readable error message is also available using the <code>cupsLastErrorString</code> function:</p>
1154 <pre><code>if (cupsLastError() &gt;= IPP_STATUS_ERROR_BAD_REQUEST)
1155 {
1156 /* request failed */
1157 printf(&quot;Request failed: %s\n&quot;, cupsLastErrorString());
1158 }
1159 </code></pre>
1160 <h3 class="title" id="processing-the-ipp-response">Processing the IPP Response</h3>
1161 <p>Each response to an IPP request is also an IPP message (<code>ipp_t</code>) with its own IPP attributes (<code>ipp_attribute_t</code>) that includes a status code (<code>IPP_STATUS_OK</code>, <code>IPP_STATUS_ERROR_BAD_REQUEST</code>, etc.) and the corresponding 32-bit integer identifier from the request.</p>
1162 <p>For example, the following code finds the printer state attributes and prints their values:</p>
1163 <pre><code>ipp_attribute_t *attr;
1164
1165 if ((attr = ippFindAttribute(response, &quot;printer-state&quot;,
1166 IPP_TAG_ENUM)) != NULL)
1167 {
1168 printf(&quot;printer-state=%s\n&quot;,
1169 ippEnumString(&quot;printer-state&quot;, ippGetInteger(attr, 0)));
1170 }
1171 else
1172 puts(&quot;printer-state=unknown&quot;);
1173
1174 if ((attr = ippFindAttribute(response, &quot;printer-state-message&quot;,
1175 IPP_TAG_TEXT)) != NULL)
1176 {
1177 printf(&quot;printer-state-message=\&quot;%s\&quot;\n&quot;,
1178 ippGetString(attr, 0, NULL)));
1179 }
1180
1181 if ((attr = ippFindAttribute(response, &quot;printer-state-reasons&quot;,
1182 IPP_TAG_KEYWORD)) != NULL)
1183 {
1184 int i, count = ippGetCount(attr);
1185
1186 puts(&quot;printer-state-reasons=&quot;);
1187 for (i = 0; i &lt; count; i ++)
1188 printf(&quot; %s\n&quot;, ippGetString(attr, i, NULL)));
1189 }
1190 </code></pre>
1191 <p>The <code>ippGetCount</code> function returns the number of values in an attribute.</p>
1192 <p>The <code>ippGetInteger</code> and <code>ippGetString</code> functions return a single integer or string value from an attribute.</p>
1193 <p>The <code>ippEnumString</code> function converts a enum value to its keyword (string) equivalent.</p>
1194 <p>Once you are done using the IPP response message, free it using the <code>ippDelete</code> function:</p>
1195 <pre><code>ippDelete(response);
1196 </code></pre>
1197 <h3 class="title" id="authentication">Authentication</h3>
1198 <p>CUPS normally handles authentication through the console. GUI applications should set a password callback using the <code>cupsSetPasswordCB2</code> function:</p>
1199 <pre><code>void
1200 cupsSetPasswordCB2(cups_password_cb2_t cb, void *user_data);
1201 </code></pre>
1202 <p>The password callback will be called when needed and is responsible for setting the current user name using <code>cupsSetUser</code> and returning a string:</p>
1203 <pre><code>const char *
1204 cups_password_cb2(const char *prompt, http_t *http,
1205 const char *method, const char *resource,
1206 void *user_data);
1207 </code></pre>
1208 <p>The <code>prompt</code> argument is a string from CUPS that should be displayed to the user.</p>
1209 <p>The <code>http</code> argument is the connection hosting the request that is being authenticated. The password callback can call the <code>httpGetField</code> and <code>httpGetSubField</code> functions to look for additional details concerning the authentication challenge.</p>
1210 <p>The <code>method</code> argument specifies the HTTP method used for the request and is typically &quot;POST&quot;.</p>
1211 <p>The <code>resource</code> argument specifies the path used for the request.</p>
1212 <p>The <code>user_data</code> argument provides the user data pointer from the <code>cupsSetPasswordCB2</code> call.</p>
1213 <h2 class="title"><a id="FUNCTIONS">Functions</a></h2>
1214 <h3 class="function"><a id="cupsAddDest">cupsAddDest</a></h3>
1215 <p class="description">Add a destination to the list of destinations.</p>
1216 <p class="code">
1217 int cupsAddDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
1218 <h4 class="parameters">Parameters</h4>
1219 <table class="list"><tbody>
1220 <tr><th>name</th>
1221 <td class="description">Destination name</td></tr>
1222 <tr><th>instance</th>
1223 <td class="description">Instance name or <code>NULL</code> for none/primary</td></tr>
1224 <tr><th>num_dests</th>
1225 <td class="description">Number of destinations</td></tr>
1226 <tr><th>dests</th>
1227 <td class="description">Destinations</td></tr>
1228 </tbody></table>
1229 <h4 class="returnvalue">Return Value</h4>
1230 <p class="description">New number of destinations</p>
1231 <h4 class="discussion">Discussion</h4>
1232 <p class="discussion">This function cannot be used to add a new class or printer queue,
1233 it only adds a new container of saved options for the named
1234 destination or instance.<br>
1235 <br>
1236 If the named destination already exists, the destination list is
1237 returned unchanged. Adding a new instance of a destination creates
1238 a copy of that destination's options.<br>
1239 <br>
1240 Use the <a href="#cupsSaveDests"><code>cupsSaveDests</code></a> function to save the updated list of
1241 destinations to the user's lpoptions file.</p>
1242 <h3 class="function"><span class="info">&#160;CUPS 2.3/macOS 10.14&#160;</span><a id="cupsAddDestMediaOptions">cupsAddDestMediaOptions</a></h3>
1243 <p class="description">Add the option corresponding to the specified media size.</p>
1244 <p class="code">
1245 int cupsAddDestMediaOptions(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
1246 <h4 class="parameters">Parameters</h4>
1247 <table class="list"><tbody>
1248 <tr><th>http</th>
1249 <td class="description">Connection to destination</td></tr>
1250 <tr><th>dest</th>
1251 <td class="description">Destination</td></tr>
1252 <tr><th>dinfo</th>
1253 <td class="description">Destination information</td></tr>
1254 <tr><th>flags</th>
1255 <td class="description">Media matching flags</td></tr>
1256 <tr><th>size</th>
1257 <td class="description">Media size</td></tr>
1258 <tr><th>num_options</th>
1259 <td class="description">Current number of options</td></tr>
1260 <tr><th>options</th>
1261 <td class="description">Options</td></tr>
1262 </tbody></table>
1263 <h4 class="returnvalue">Return Value</h4>
1264 <p class="description">New number of options</p>
1265 <h3 class="function"><span class="info">&#160;CUPS 2.2.4/macOS 10.13&#160;</span><a id="cupsAddIntegerOption">cupsAddIntegerOption</a></h3>
1266 <p class="description">Add an integer option to an option array.</p>
1267 <p class="code">
1268 int cupsAddIntegerOption(const char *name, int value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
1269 <h4 class="parameters">Parameters</h4>
1270 <table class="list"><tbody>
1271 <tr><th>name</th>
1272 <td class="description">Name of option</td></tr>
1273 <tr><th>value</th>
1274 <td class="description">Value of option</td></tr>
1275 <tr><th>num_options</th>
1276 <td class="description">Number of options</td></tr>
1277 <tr><th>options</th>
1278 <td class="description">Pointer to options</td></tr>
1279 </tbody></table>
1280 <h4 class="returnvalue">Return Value</h4>
1281 <p class="description">Number of options</p>
1282 <h4 class="discussion">Discussion</h4>
1283 <p class="discussion">New option arrays can be initialized simply by passing 0 for the
1284 &quot;num_options&quot; parameter.
1285
1286 </p>
1287 <h3 class="function"><a id="cupsAddOption">cupsAddOption</a></h3>
1288 <p class="description">Add an option to an option array.</p>
1289 <p class="code">
1290 int cupsAddOption(const char *name, const char *value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
1291 <h4 class="parameters">Parameters</h4>
1292 <table class="list"><tbody>
1293 <tr><th>name</th>
1294 <td class="description">Name of option</td></tr>
1295 <tr><th>value</th>
1296 <td class="description">Value of option</td></tr>
1297 <tr><th>num_options</th>
1298 <td class="description">Number of options</td></tr>
1299 <tr><th>options</th>
1300 <td class="description">Pointer to options</td></tr>
1301 </tbody></table>
1302 <h4 class="returnvalue">Return Value</h4>
1303 <p class="description">Number of options</p>
1304 <h4 class="discussion">Discussion</h4>
1305 <p class="discussion">New option arrays can be initialized simply by passing 0 for the
1306 &quot;num_options&quot; parameter.</p>
1307 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCancelDestJob">cupsCancelDestJob</a></h3>
1308 <p class="description">Cancel a job on a destination.</p>
1309 <p class="code">
1310 ipp_status_t cupsCancelDestJob(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, int job_id);</p>
1311 <h4 class="parameters">Parameters</h4>
1312 <table class="list"><tbody>
1313 <tr><th>http</th>
1314 <td class="description">Connection to destination</td></tr>
1315 <tr><th>dest</th>
1316 <td class="description">Destination</td></tr>
1317 <tr><th>job_id</th>
1318 <td class="description">Job ID</td></tr>
1319 </tbody></table>
1320 <h4 class="returnvalue">Return Value</h4>
1321 <p class="description">Status of cancel operation</p>
1322 <h4 class="discussion">Discussion</h4>
1323 <p class="discussion">The &quot;job_id&quot; is the number returned by cupsCreateDestJob.<br>
1324 <br>
1325 Returns <code>IPP_STATUS_OK</code> on success and
1326 <code>IPP_STATUS_ERROR_NOT_AUTHORIZED</code> or
1327 <code>IPP_STATUS_ERROR_FORBIDDEN</code> on failure.
1328
1329 </p>
1330 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCheckDestSupported">cupsCheckDestSupported</a></h3>
1331 <p class="description">Check that the option and value are supported
1332 by the destination.</p>
1333 <p class="code">
1334 int cupsCheckDestSupported(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option, const char *value);</p>
1335 <h4 class="parameters">Parameters</h4>
1336 <table class="list"><tbody>
1337 <tr><th>http</th>
1338 <td class="description">Connection to destination</td></tr>
1339 <tr><th>dest</th>
1340 <td class="description">Destination</td></tr>
1341 <tr><th>dinfo</th>
1342 <td class="description">Destination information</td></tr>
1343 <tr><th>option</th>
1344 <td class="description">Option</td></tr>
1345 <tr><th>value</th>
1346 <td class="description">Value or <code>NULL</code></td></tr>
1347 </tbody></table>
1348 <h4 class="returnvalue">Return Value</h4>
1349 <p class="description">1 if supported, 0 otherwise</p>
1350 <h4 class="discussion">Discussion</h4>
1351 <p class="discussion">Returns 1 if supported, 0 otherwise.
1352
1353 </p>
1354 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCloseDestJob">cupsCloseDestJob</a></h3>
1355 <p class="description">Close a job and start printing.</p>
1356 <p class="code">
1357 ipp_status_t cupsCloseDestJob(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info, int job_id);</p>
1358 <h4 class="parameters">Parameters</h4>
1359 <table class="list"><tbody>
1360 <tr><th>http</th>
1361 <td class="description">Connection to destination</td></tr>
1362 <tr><th>dest</th>
1363 <td class="description">Destination</td></tr>
1364 <tr><th>info</th>
1365 <td class="description">Destination information</td></tr>
1366 <tr><th>job_id</th>
1367 <td class="description">Job ID</td></tr>
1368 </tbody></table>
1369 <h4 class="returnvalue">Return Value</h4>
1370 <p class="description">IPP status code</p>
1371 <h4 class="discussion">Discussion</h4>
1372 <p class="discussion">Use when the last call to cupsStartDocument passed 0 for &quot;last_document&quot;.
1373 &quot;job_id&quot; is the job ID returned by cupsCreateDestJob. Returns <code>IPP_STATUS_OK</code>
1374 on success.
1375
1376 </p>
1377 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsConnectDest">cupsConnectDest</a></h3>
1378 <p class="description">Open a connection to the destination.</p>
1379 <p class="code">
1380 <a href="#http_t">http_t</a> *cupsConnectDest(<a href="#cups_dest_t">cups_dest_t</a> *dest, unsigned flags, int msec, int *cancel, char *resource, size_t resourcesize, <a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb, void *user_data);</p>
1381 <h4 class="parameters">Parameters</h4>
1382 <table class="list"><tbody>
1383 <tr><th>dest</th>
1384 <td class="description">Destination</td></tr>
1385 <tr><th>flags</th>
1386 <td class="description">Connection flags</td></tr>
1387 <tr><th>msec</th>
1388 <td class="description">Timeout in milliseconds</td></tr>
1389 <tr><th>cancel</th>
1390 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
1391 <tr><th>resource</th>
1392 <td class="description">Resource buffer</td></tr>
1393 <tr><th>resourcesize</th>
1394 <td class="description">Size of resource buffer</td></tr>
1395 <tr><th>cb</th>
1396 <td class="description">Callback function</td></tr>
1397 <tr><th>user_data</th>
1398 <td class="description">User data pointer</td></tr>
1399 </tbody></table>
1400 <h4 class="returnvalue">Return Value</h4>
1401 <p class="description">Connection to destination or <code>NULL</code></p>
1402 <h4 class="discussion">Discussion</h4>
1403 <p class="discussion">Connect to the destination, returning a new <code>http_t</code> connection object
1404 and optionally the resource path to use for the destination. These calls
1405 will block until a connection is made, the timeout expires, the integer
1406 pointed to by &quot;cancel&quot; is non-zero, or the callback function (or block)
1407 returns 0. The caller is responsible for calling <a href="#httpClose"><code>httpClose</code></a> on the
1408 returned connection.<br>
1409 <br>
1410 Starting with CUPS 2.2.4, the caller can pass <code>CUPS_DEST_FLAGS_DEVICE</code>
1411 for the &quot;flags&quot; argument to connect directly to the device associated with
1412 the destination. Otherwise, the connection is made to the CUPS scheduler
1413 associated with the destination.
1414
1415 </p>
1416 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDest">cupsCopyDest</a></h3>
1417 <p class="description">Copy a destination.</p>
1418 <p class="code">
1419 int cupsCopyDest(<a href="#cups_dest_t">cups_dest_t</a> *dest, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
1420 <h4 class="parameters">Parameters</h4>
1421 <table class="list"><tbody>
1422 <tr><th>dest</th>
1423 <td class="description">Destination to copy</td></tr>
1424 <tr><th>num_dests</th>
1425 <td class="description">Number of destinations</td></tr>
1426 <tr><th>dests</th>
1427 <td class="description">Destination array</td></tr>
1428 </tbody></table>
1429 <h4 class="returnvalue">Return Value</h4>
1430 <p class="description">New number of destinations</p>
1431 <h4 class="discussion">Discussion</h4>
1432 <p class="discussion">Make a copy of the destination to an array of destinations (or just a single
1433 copy) - for use with the cupsEnumDests* functions. The caller is responsible
1434 for calling cupsFreeDests() on the returned object(s).
1435
1436 </p>
1437 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDestConflicts">cupsCopyDestConflicts</a></h3>
1438 <p class="description">Get conflicts and resolutions for a new
1439 option/value pair.</p>
1440 <p class="code">
1441 int cupsCopyDestConflicts(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, int num_options, <a href="#cups_option_t">cups_option_t</a> *options, const char *new_option, const char *new_value, int *num_conflicts, <a href="#cups_option_t">cups_option_t</a> **conflicts, int *num_resolved, <a href="#cups_option_t">cups_option_t</a> **resolved);</p>
1442 <h4 class="parameters">Parameters</h4>
1443 <table class="list"><tbody>
1444 <tr><th>http</th>
1445 <td class="description">Connection to destination</td></tr>
1446 <tr><th>dest</th>
1447 <td class="description">Destination</td></tr>
1448 <tr><th>dinfo</th>
1449 <td class="description">Destination information</td></tr>
1450 <tr><th>num_options</th>
1451 <td class="description">Number of current options</td></tr>
1452 <tr><th>options</th>
1453 <td class="description">Current options</td></tr>
1454 <tr><th>new_option</th>
1455 <td class="description">New option</td></tr>
1456 <tr><th>new_value</th>
1457 <td class="description">New value</td></tr>
1458 <tr><th>num_conflicts</th>
1459 <td class="description">Number of conflicting options</td></tr>
1460 <tr><th>conflicts</th>
1461 <td class="description">Conflicting options</td></tr>
1462 <tr><th>num_resolved</th>
1463 <td class="description">Number of options to resolve</td></tr>
1464 <tr><th>resolved</th>
1465 <td class="description">Resolved options</td></tr>
1466 </tbody></table>
1467 <h4 class="returnvalue">Return Value</h4>
1468 <p class="description">1 if there is a conflict, 0 if none, -1 on error</p>
1469 <h4 class="discussion">Discussion</h4>
1470 <p class="discussion">&quot;num_options&quot; and &quot;options&quot; represent the currently selected options by the
1471 user. &quot;new_option&quot; and &quot;new_value&quot; are the setting the user has just
1472 changed.<br>
1473 <br>
1474 Returns 1 if there is a conflict, 0 if there are no conflicts, and -1 if
1475 there was an unrecoverable error such as a resolver loop.<br>
1476 <br>
1477 If &quot;num_conflicts&quot; and &quot;conflicts&quot; are not <code>NULL</code>, they are set to
1478 contain the list of conflicting option/value pairs. Similarly, if
1479 &quot;num_resolved&quot; and &quot;resolved&quot; are not <code>NULL</code> they will be set to the
1480 list of changes needed to resolve the conflict.<br>
1481 <br>
1482 If cupsCopyDestConflicts returns 1 but &quot;num_resolved&quot; and &quot;resolved&quot; are set
1483 to 0 and <code>NULL</code>, respectively, then the conflict cannot be resolved.
1484
1485 </p>
1486 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDestInfo">cupsCopyDestInfo</a></h3>
1487 <p class="description">Get the supported values/capabilities for the
1488 destination.</p>
1489 <p class="code">
1490 <a href="#cups_dinfo_t">cups_dinfo_t</a> *cupsCopyDestInfo(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest);</p>
1491 <h4 class="parameters">Parameters</h4>
1492 <table class="list"><tbody>
1493 <tr><th>http</th>
1494 <td class="description">Connection to destination</td></tr>
1495 <tr><th>dest</th>
1496 <td class="description">Destination</td></tr>
1497 </tbody></table>
1498 <h4 class="returnvalue">Return Value</h4>
1499 <p class="description">Destination information</p>
1500 <h4 class="discussion">Discussion</h4>
1501 <p class="discussion">The caller is responsible for calling <a href="#cupsFreeDestInfo"><code>cupsFreeDestInfo</code></a> on the return
1502 value. <code>NULL</code> is returned on error.
1503
1504 </p>
1505 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCreateDestJob">cupsCreateDestJob</a></h3>
1506 <p class="description">Create a job on a destination.</p>
1507 <p class="code">
1508 ipp_status_t cupsCreateDestJob(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info, int *job_id, const char *title, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
1509 <h4 class="parameters">Parameters</h4>
1510 <table class="list"><tbody>
1511 <tr><th>http</th>
1512 <td class="description">Connection to destination</td></tr>
1513 <tr><th>dest</th>
1514 <td class="description">Destination</td></tr>
1515 <tr><th>info</th>
1516 <td class="description">Destination information</td></tr>
1517 <tr><th>job_id</th>
1518 <td class="description">Job ID or 0 on error</td></tr>
1519 <tr><th>title</th>
1520 <td class="description">Job name</td></tr>
1521 <tr><th>num_options</th>
1522 <td class="description">Number of job options</td></tr>
1523 <tr><th>options</th>
1524 <td class="description">Job options</td></tr>
1525 </tbody></table>
1526 <h4 class="returnvalue">Return Value</h4>
1527 <p class="description">IPP status code</p>
1528 <h4 class="discussion">Discussion</h4>
1529 <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success, saving the job ID
1530 in the variable pointed to by &quot;job_id&quot;.
1531
1532 </p>
1533 <h3 class="function"><span class="info">&#160;CUPS 1.1.20/macOS 10.4&#160;</span><a id="cupsDoAuthentication">cupsDoAuthentication</a></h3>
1534 <p class="description">Authenticate a request.</p>
1535 <p class="code">
1536 int cupsDoAuthentication(<a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p>
1537 <h4 class="parameters">Parameters</h4>
1538 <table class="list"><tbody>
1539 <tr><th>http</th>
1540 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
1541 <tr><th>method</th>
1542 <td class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</td></tr>
1543 <tr><th>resource</th>
1544 <td class="description">Resource path</td></tr>
1545 </tbody></table>
1546 <h4 class="returnvalue">Return Value</h4>
1547 <p class="description">0 on success, -1 on error</p>
1548 <h4 class="discussion">Discussion</h4>
1549 <p class="discussion">This function should be called in response to a <code>HTTP_STATUS_UNAUTHORIZED</code>
1550 status, prior to resubmitting your request.
1551
1552 </p>
1553 <h3 class="function"><span class="info">&#160;CUPS 2.3/macOS 10.14&#160;</span><a id="cupsEncodeOption">cupsEncodeOption</a></h3>
1554 <p class="description">Encode a single option into an IPP attribute.</p>
1555 <p class="code">
1556 <a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsEncodeOption(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group_tag, const char *name, const char *value);</p>
1557 <h4 class="parameters">Parameters</h4>
1558 <table class="list"><tbody>
1559 <tr><th>ipp</th>
1560 <td class="description">IPP request/response</td></tr>
1561 <tr><th>group_tag</th>
1562 <td class="description">Attribute group</td></tr>
1563 <tr><th>name</th>
1564 <td class="description">Option name</td></tr>
1565 <tr><th>value</th>
1566 <td class="description">Option string value</td></tr>
1567 </tbody></table>
1568 <h4 class="returnvalue">Return Value</h4>
1569 <p class="description">New attribute or <code>NULL</code> on error</p>
1570 <h3 class="function"><a id="cupsEncodeOptions">cupsEncodeOptions</a></h3>
1571 <p class="description">Encode printer options into IPP attributes.</p>
1572 <p class="code">
1573 void cupsEncodeOptions(<a href="#ipp_t">ipp_t</a> *ipp, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
1574 <h4 class="parameters">Parameters</h4>
1575 <table class="list"><tbody>
1576 <tr><th>ipp</th>
1577 <td class="description">IPP request/response</td></tr>
1578 <tr><th>num_options</th>
1579 <td class="description">Number of options</td></tr>
1580 <tr><th>options</th>
1581 <td class="description">Options</td></tr>
1582 </tbody></table>
1583 <h4 class="discussion">Discussion</h4>
1584 <p class="discussion">This function adds operation, job, and then subscription attributes,
1585 in that order. Use the <a href="#cupsEncodeOptions2"><code>cupsEncodeOptions2</code></a> function to add attributes
1586 for a single group.</p>
1587 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsEncodeOptions2">cupsEncodeOptions2</a></h3>
1588 <p class="description">Encode printer options into IPP attributes for a group.</p>
1589 <p class="code">
1590 void cupsEncodeOptions2(<a href="#ipp_t">ipp_t</a> *ipp, int num_options, <a href="#cups_option_t">cups_option_t</a> *options, ipp_tag_t group_tag);</p>
1591 <h4 class="parameters">Parameters</h4>
1592 <table class="list"><tbody>
1593 <tr><th>ipp</th>
1594 <td class="description">IPP request/response</td></tr>
1595 <tr><th>num_options</th>
1596 <td class="description">Number of options</td></tr>
1597 <tr><th>options</th>
1598 <td class="description">Options</td></tr>
1599 <tr><th>group_tag</th>
1600 <td class="description">Group to encode</td></tr>
1601 </tbody></table>
1602 <h4 class="discussion">Discussion</h4>
1603 <p class="discussion">This function only adds attributes for a single group. Call this
1604 function multiple times for each group, or use <a href="#cupsEncodeOptions"><code>cupsEncodeOptions</code></a>
1605 to add the standard groups.
1606
1607 </p>
1608 <h3 class="function"><a id="cupsEncryption">cupsEncryption</a></h3>
1609 <p class="description">Get the current encryption settings.</p>
1610 <p class="code">
1611 <a href="#http_encryption_t">http_encryption_t</a> cupsEncryption(void);</p>
1612 <h4 class="returnvalue">Return Value</h4>
1613 <p class="description">Encryption settings</p>
1614 <h4 class="discussion">Discussion</h4>
1615 <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
1616 environment variable, then the ~/.cups/client.conf file, and finally the
1617 /etc/cups/client.conf file. If not set, the default is
1618 <code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
1619 <br>
1620 Note: The current encryption setting is tracked separately for each thread
1621 in a program. Multi-threaded programs that override the setting via the
1622 <a href="#cupsSetEncryption"><code>cupsSetEncryption</code></a> function need to do so in each thread for the same
1623 setting to be used.</p>
1624 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsEnumDests">cupsEnumDests</a></h3>
1625 <p class="description">Enumerate available destinations with a callback function.</p>
1626 <p class="code">
1627 int cupsEnumDests(unsigned flags, int msec, int *cancel, <a href="#cups_ptype_t">cups_ptype_t</a> type, <a href="#cups_ptype_t">cups_ptype_t</a> mask, <a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb, void *user_data);</p>
1628 <h4 class="parameters">Parameters</h4>
1629 <table class="list"><tbody>
1630 <tr><th>flags</th>
1631 <td class="description">Enumeration flags</td></tr>
1632 <tr><th>msec</th>
1633 <td class="description">Timeout in milliseconds, -1 for indefinite</td></tr>
1634 <tr><th>cancel</th>
1635 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
1636 <tr><th>type</th>
1637 <td class="description">Printer type bits</td></tr>
1638 <tr><th>mask</th>
1639 <td class="description">Mask for printer type bits</td></tr>
1640 <tr><th>cb</th>
1641 <td class="description">Callback function</td></tr>
1642 <tr><th>user_data</th>
1643 <td class="description">User data</td></tr>
1644 </tbody></table>
1645 <h4 class="returnvalue">Return Value</h4>
1646 <p class="description">1 on success, 0 on failure</p>
1647 <h4 class="discussion">Discussion</h4>
1648 <p class="discussion">Destinations are enumerated from one or more sources. The callback function
1649 receives the <code>user_data</code> pointer and the destination pointer which can
1650 be used as input to the <a href="#cupsCopyDest"><code>cupsCopyDest</code></a> function. The function must
1651 return 1 to continue enumeration or 0 to stop.<br>
1652 <br>
1653 The <code>type</code> and <code>mask</code> arguments allow the caller to filter the
1654 destinations that are enumerated. Passing 0 for both will enumerate all
1655 printers. The constant <code>CUPS_PRINTER_DISCOVERED</code> is used to filter on
1656 destinations that are available but have not yet been added locally.<br>
1657 <br>
1658 Enumeration happens on the current thread and does not return until all
1659 destinations have been enumerated or the callback function returns 0.<br>
1660 <br>
1661 Note: The callback function will likely receive multiple updates for the same
1662 destinations - it is up to the caller to suppress any duplicate destinations.
1663
1664 </p>
1665 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestDefault">cupsFindDestDefault</a></h3>
1666 <p class="description">Find the default value(s) for the given option.</p>
1667 <p class="code">
1668 <a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestDefault(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option);</p>
1669 <h4 class="parameters">Parameters</h4>
1670 <table class="list"><tbody>
1671 <tr><th>http</th>
1672 <td class="description">Connection to destination</td></tr>
1673 <tr><th>dest</th>
1674 <td class="description">Destination</td></tr>
1675 <tr><th>dinfo</th>
1676 <td class="description">Destination information</td></tr>
1677 <tr><th>option</th>
1678 <td class="description">Option/attribute name</td></tr>
1679 </tbody></table>
1680 <h4 class="returnvalue">Return Value</h4>
1681 <p class="description">Default attribute or <code>NULL</code> for none</p>
1682 <h4 class="discussion">Discussion</h4>
1683 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1684 <code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1685 <code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1686 <code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1687 functions to inspect the default value(s) as needed.
1688
1689 </p>
1690 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestReady">cupsFindDestReady</a></h3>
1691 <p class="description">Find the default value(s) for the given option.</p>
1692 <p class="code">
1693 <a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestReady(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option);</p>
1694 <h4 class="parameters">Parameters</h4>
1695 <table class="list"><tbody>
1696 <tr><th>http</th>
1697 <td class="description">Connection to destination</td></tr>
1698 <tr><th>dest</th>
1699 <td class="description">Destination</td></tr>
1700 <tr><th>dinfo</th>
1701 <td class="description">Destination information</td></tr>
1702 <tr><th>option</th>
1703 <td class="description">Option/attribute name</td></tr>
1704 </tbody></table>
1705 <h4 class="returnvalue">Return Value</h4>
1706 <p class="description">Default attribute or <code>NULL</code> for none</p>
1707 <h4 class="discussion">Discussion</h4>
1708 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1709 <code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1710 <code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1711 <code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1712 functions to inspect the default value(s) as needed.
1713
1714 </p>
1715 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestSupported">cupsFindDestSupported</a></h3>
1716 <p class="description">Find the default value(s) for the given option.</p>
1717 <p class="code">
1718 <a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestSupported(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option);</p>
1719 <h4 class="parameters">Parameters</h4>
1720 <table class="list"><tbody>
1721 <tr><th>http</th>
1722 <td class="description">Connection to destination</td></tr>
1723 <tr><th>dest</th>
1724 <td class="description">Destination</td></tr>
1725 <tr><th>dinfo</th>
1726 <td class="description">Destination information</td></tr>
1727 <tr><th>option</th>
1728 <td class="description">Option/attribute name</td></tr>
1729 </tbody></table>
1730 <h4 class="returnvalue">Return Value</h4>
1731 <p class="description">Default attribute or <code>NULL</code> for none</p>
1732 <h4 class="discussion">Discussion</h4>
1733 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1734 <code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1735 <code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1736 <code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1737 functions to inspect the default value(s) as needed.
1738
1739 </p>
1740 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsFinishDestDocument">cupsFinishDestDocument</a></h3>
1741 <p class="description">Finish the current document.</p>
1742 <p class="code">
1743 ipp_status_t cupsFinishDestDocument(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info);</p>
1744 <h4 class="parameters">Parameters</h4>
1745 <table class="list"><tbody>
1746 <tr><th>http</th>
1747 <td class="description">Connection to destination</td></tr>
1748 <tr><th>dest</th>
1749 <td class="description">Destination</td></tr>
1750 <tr><th>info</th>
1751 <td class="description">Destination information</td></tr>
1752 </tbody></table>
1753 <h4 class="returnvalue">Return Value</h4>
1754 <p class="description">Status of document submission</p>
1755 <h4 class="discussion">Discussion</h4>
1756 <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success.
1757
1758 </p>
1759 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsFreeDestInfo">cupsFreeDestInfo</a></h3>
1760 <p class="description">Free destination information obtained using
1761 <a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a>.</p>
1762 <p class="code">
1763 void cupsFreeDestInfo(<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo);</p>
1764 <h4 class="parameters">Parameters</h4>
1765 <table class="list"><tbody>
1766 <tr><th>dinfo</th>
1767 <td class="description">Destination information</td></tr>
1768 </tbody></table>
1769 <h3 class="function"><a id="cupsFreeDests">cupsFreeDests</a></h3>
1770 <p class="description">Free the memory used by the list of destinations.</p>
1771 <p class="code">
1772 void cupsFreeDests(int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
1773 <h4 class="parameters">Parameters</h4>
1774 <table class="list"><tbody>
1775 <tr><th>num_dests</th>
1776 <td class="description">Number of destinations</td></tr>
1777 <tr><th>dests</th>
1778 <td class="description">Destinations</td></tr>
1779 </tbody></table>
1780 <h3 class="function"><a id="cupsFreeJobs">cupsFreeJobs</a></h3>
1781 <p class="description">Free memory used by job data.</p>
1782 <p class="code">
1783 void cupsFreeJobs(int num_jobs, <a href="#cups_job_t">cups_job_t</a> *jobs);</p>
1784 <h4 class="parameters">Parameters</h4>
1785 <table class="list"><tbody>
1786 <tr><th>num_jobs</th>
1787 <td class="description">Number of jobs</td></tr>
1788 <tr><th>jobs</th>
1789 <td class="description">Jobs</td></tr>
1790 </tbody></table>
1791 <h3 class="function"><a id="cupsFreeOptions">cupsFreeOptions</a></h3>
1792 <p class="description">Free all memory used by options.</p>
1793 <p class="code">
1794 void cupsFreeOptions(int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
1795 <h4 class="parameters">Parameters</h4>
1796 <table class="list"><tbody>
1797 <tr><th>num_options</th>
1798 <td class="description">Number of options</td></tr>
1799 <tr><th>options</th>
1800 <td class="description">Pointer to options</td></tr>
1801 </tbody></table>
1802 <h3 class="function"><a id="cupsGetDest">cupsGetDest</a></h3>
1803 <p class="description">Get the named destination from the list.</p>
1804 <p class="code">
1805 <a href="#cups_dest_t">cups_dest_t</a> *cupsGetDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
1806 <h4 class="parameters">Parameters</h4>
1807 <table class="list"><tbody>
1808 <tr><th>name</th>
1809 <td class="description">Destination name or <code>NULL</code> for the default destination</td></tr>
1810 <tr><th>instance</th>
1811 <td class="description">Instance name or <code>NULL</code></td></tr>
1812 <tr><th>num_dests</th>
1813 <td class="description">Number of destinations</td></tr>
1814 <tr><th>dests</th>
1815 <td class="description">Destinations</td></tr>
1816 </tbody></table>
1817 <h4 class="returnvalue">Return Value</h4>
1818 <p class="description">Destination pointer or <code>NULL</code></p>
1819 <h4 class="discussion">Discussion</h4>
1820 <p class="discussion">Use the <a href="#cupsEnumDests"><code>cupsEnumDests</code></a> or <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> functions to get a
1821 list of supported destinations for the current user.</p>
1822 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></h3>
1823 <p class="description">Get a media name, dimension, and margins for a
1824 specific size.</p>
1825 <p class="code">
1826 int cupsGetDestMediaByIndex(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, int n, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p>
1827 <h4 class="parameters">Parameters</h4>
1828 <table class="list"><tbody>
1829 <tr><th>http</th>
1830 <td class="description">Connection to destination</td></tr>
1831 <tr><th>dest</th>
1832 <td class="description">Destination</td></tr>
1833 <tr><th>dinfo</th>
1834 <td class="description">Destination information</td></tr>
1835 <tr><th>n</th>
1836 <td class="description">Media size number (0-based)</td></tr>
1837 <tr><th>flags</th>
1838 <td class="description">Media flags</td></tr>
1839 <tr><th>size</th>
1840 <td class="description">Media size information</td></tr>
1841 </tbody></table>
1842 <h4 class="returnvalue">Return Value</h4>
1843 <p class="description">1 on success, 0 on failure</p>
1844 <h4 class="discussion">Discussion</h4>
1845 <p class="discussion">The <code>flags</code> parameter determines which set of media are indexed. For
1846 example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will get the Nth
1847 borderless size supported by the printer.
1848
1849 </p>
1850 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsGetDestMediaByName">cupsGetDestMediaByName</a></h3>
1851 <p class="description">Get media names, dimensions, and margins.</p>
1852 <p class="code">
1853 int cupsGetDestMediaByName(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *media, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p>
1854 <h4 class="parameters">Parameters</h4>
1855 <table class="list"><tbody>
1856 <tr><th>http</th>
1857 <td class="description">Connection to destination</td></tr>
1858 <tr><th>dest</th>
1859 <td class="description">Destination</td></tr>
1860 <tr><th>dinfo</th>
1861 <td class="description">Destination information</td></tr>
1862 <tr><th>media</th>
1863 <td class="description">Media name</td></tr>
1864 <tr><th>flags</th>
1865 <td class="description">Media matching flags</td></tr>
1866 <tr><th>size</th>
1867 <td class="description">Media size information</td></tr>
1868 </tbody></table>
1869 <h4 class="returnvalue">Return Value</h4>
1870 <p class="description">1 on match, 0 on failure</p>
1871 <h4 class="discussion">Discussion</h4>
1872 <p class="discussion">The &quot;media&quot; string is a PWG media name. &quot;Flags&quot; provides some matching
1873 guidance (multiple flags can be combined):<br>
1874 <br>
1875 CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
1876 CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
1877 CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
1878 CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
1879 CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
1880 size amongst the &quot;ready&quot; media.<br>
1881 <br>
1882 The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
1883 <br>
1884 Returns 1 when there is a match and 0 if there is not a match.
1885
1886 </p>
1887 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></h3>
1888 <p class="description">Get media names, dimensions, and margins.</p>
1889 <p class="code">
1890 int cupsGetDestMediaBySize(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, int width, int length, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p>
1891 <h4 class="parameters">Parameters</h4>
1892 <table class="list"><tbody>
1893 <tr><th>http</th>
1894 <td class="description">Connection to destination</td></tr>
1895 <tr><th>dest</th>
1896 <td class="description">Destination</td></tr>
1897 <tr><th>dinfo</th>
1898 <td class="description">Destination information</td></tr>
1899 <tr><th>width</th>
1900 <td class="description">Media width in hundredths of
1901 of millimeters</td></tr>
1902 <tr><th>length</th>
1903 <td class="description">Media length in hundredths of
1904 of millimeters</td></tr>
1905 <tr><th>flags</th>
1906 <td class="description">Media matching flags</td></tr>
1907 <tr><th>size</th>
1908 <td class="description">Media size information</td></tr>
1909 </tbody></table>
1910 <h4 class="returnvalue">Return Value</h4>
1911 <p class="description">1 on match, 0 on failure</p>
1912 <h4 class="discussion">Discussion</h4>
1913 <p class="discussion">&quot;Width&quot; and &quot;length&quot; are the dimensions in hundredths of millimeters.
1914 &quot;Flags&quot; provides some matching guidance (multiple flags can be combined):<br>
1915 <br>
1916 CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
1917 CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
1918 CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
1919 CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
1920 CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
1921 size amongst the &quot;ready&quot; media.<br>
1922 <br>
1923 The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
1924 <br>
1925 Returns 1 when there is a match and 0 if there is not a match.
1926
1927 </p>
1928 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaCount">cupsGetDestMediaCount</a></h3>
1929 <p class="description">Get the number of sizes supported by a
1930 destination.</p>
1931 <p class="code">
1932 int cupsGetDestMediaCount(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags);</p>
1933 <h4 class="parameters">Parameters</h4>
1934 <table class="list"><tbody>
1935 <tr><th>http</th>
1936 <td class="description">Connection to destination</td></tr>
1937 <tr><th>dest</th>
1938 <td class="description">Destination</td></tr>
1939 <tr><th>dinfo</th>
1940 <td class="description">Destination information</td></tr>
1941 <tr><th>flags</th>
1942 <td class="description">Media flags</td></tr>
1943 </tbody></table>
1944 <h4 class="returnvalue">Return Value</h4>
1945 <p class="description">Number of sizes</p>
1946 <h4 class="discussion">Discussion</h4>
1947 <p class="discussion">The <code>flags</code> parameter determines the set of media sizes that are
1948 counted. For example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return
1949 the number of borderless sizes.
1950
1951 </p>
1952 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></h3>
1953 <p class="description">Get the default size for a destination.</p>
1954 <p class="code">
1955 int cupsGetDestMediaDefault(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p>
1956 <h4 class="parameters">Parameters</h4>
1957 <table class="list"><tbody>
1958 <tr><th>http</th>
1959 <td class="description">Connection to destination</td></tr>
1960 <tr><th>dest</th>
1961 <td class="description">Destination</td></tr>
1962 <tr><th>dinfo</th>
1963 <td class="description">Destination information</td></tr>
1964 <tr><th>flags</th>
1965 <td class="description">Media flags</td></tr>
1966 <tr><th>size</th>
1967 <td class="description">Media size information</td></tr>
1968 </tbody></table>
1969 <h4 class="returnvalue">Return Value</h4>
1970 <p class="description">1 on success, 0 on failure</p>
1971 <h4 class="discussion">Discussion</h4>
1972 <p class="discussion">The <code>flags</code> parameter determines which default size is returned. For
1973 example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the default
1974 borderless size, typically US Letter or A4, but sometimes 4x6 photo media.
1975
1976 </p>
1977 <h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsGetDestWithURI">cupsGetDestWithURI</a></h3>
1978 <p class="description">Get a destination associated with a URI.</p>
1979 <p class="code">
1980 <a href="#cups_dest_t">cups_dest_t</a> *cupsGetDestWithURI(const char *name, const char *uri);</p>
1981 <h4 class="parameters">Parameters</h4>
1982 <table class="list"><tbody>
1983 <tr><th>name</th>
1984 <td class="description">Desired printer name or <code>NULL</code></td></tr>
1985 <tr><th>uri</th>
1986 <td class="description">URI for the printer</td></tr>
1987 </tbody></table>
1988 <h4 class="returnvalue">Return Value</h4>
1989 <p class="description">Destination or <code>NULL</code></p>
1990 <h4 class="discussion">Discussion</h4>
1991 <p class="discussion">&quot;name&quot; is the desired name for the printer. If <code>NULL</code>, a name will be
1992 created using the URI.<br>
1993 <br>
1994 &quot;uri&quot; is the &quot;ipp&quot; or &quot;ipps&quot; URI for the printer.
1995
1996 </p>
1997 <h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetDests2">cupsGetDests2</a></h3>
1998 <p class="description">Get the list of destinations from the specified server.</p>
1999 <p class="code">
2000 int cupsGetDests2(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
2001 <h4 class="parameters">Parameters</h4>
2002 <table class="list"><tbody>
2003 <tr><th>http</th>
2004 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
2005 <tr><th>dests</th>
2006 <td class="description">Destinations</td></tr>
2007 </tbody></table>
2008 <h4 class="returnvalue">Return Value</h4>
2009 <p class="description">Number of destinations</p>
2010 <h4 class="discussion">Discussion</h4>
2011 <p class="discussion">Starting with CUPS 1.2, the returned list of destinations include the
2012 &quot;printer-info&quot;, &quot;printer-is-accepting-jobs&quot;, &quot;printer-is-shared&quot;,
2013 &quot;printer-make-and-model&quot;, &quot;printer-state&quot;, &quot;printer-state-change-time&quot;,
2014 &quot;printer-state-reasons&quot;, &quot;printer-type&quot;, and &quot;printer-uri-supported&quot;
2015 attributes as options.<br>
2016 <br>
2017 CUPS 1.4 adds the &quot;marker-change-time&quot;, &quot;marker-colors&quot;,
2018 &quot;marker-high-levels&quot;, &quot;marker-levels&quot;, &quot;marker-low-levels&quot;, &quot;marker-message&quot;,
2019 &quot;marker-names&quot;, &quot;marker-types&quot;, and &quot;printer-commands&quot; attributes as options.<br>
2020 <br>
2021 CUPS 2.2 adds accessible IPP printers to the list of destinations that can
2022 be used. The &quot;printer-uri-supported&quot; option will be present for those IPP
2023 printers that have been recently used.<br>
2024 <br>
2025 Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and
2026 the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination.
2027
2028 </p>
2029 <h3 class="function"><span class="info">&#160;CUPS 2.2.4/macOS 10.13&#160;</span><a id="cupsGetIntegerOption">cupsGetIntegerOption</a></h3>
2030 <p class="description">Get an integer option value.</p>
2031 <p class="code">
2032 int cupsGetIntegerOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
2033 <h4 class="parameters">Parameters</h4>
2034 <table class="list"><tbody>
2035 <tr><th>name</th>
2036 <td class="description">Name of option</td></tr>
2037 <tr><th>num_options</th>
2038 <td class="description">Number of options</td></tr>
2039 <tr><th>options</th>
2040 <td class="description">Options</td></tr>
2041 </tbody></table>
2042 <h4 class="returnvalue">Return Value</h4>
2043 <p class="description">Option value or <code>INT_MIN</code></p>
2044 <h4 class="discussion">Discussion</h4>
2045 <p class="discussion">INT_MIN is returned when the option does not exist, is not an integer, or
2046 exceeds the range of values for the &quot;int&quot; type.
2047
2048 </p>
2049 <h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetJobs2">cupsGetJobs2</a></h3>
2050 <p class="description">Get the jobs from the specified server.</p>
2051 <p class="code">
2052 int cupsGetJobs2(<a href="#http_t">http_t</a> *http, <a href="#cups_job_t">cups_job_t</a> **jobs, const char *name, int myjobs, int whichjobs);</p>
2053 <h4 class="parameters">Parameters</h4>
2054 <table class="list"><tbody>
2055 <tr><th>http</th>
2056 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
2057 <tr><th>jobs</th>
2058 <td class="description">Job data</td></tr>
2059 <tr><th>name</th>
2060 <td class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</td></tr>
2061 <tr><th>myjobs</th>
2062 <td class="description">0 = all users, 1 = mine</td></tr>
2063 <tr><th>whichjobs</th>
2064 <td class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></td></tr>
2065 </tbody></table>
2066 <h4 class="returnvalue">Return Value</h4>
2067 <p class="description">Number of jobs</p>
2068 <h4 class="discussion">Discussion</h4>
2069 <p class="discussion">A &quot;whichjobs&quot; value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless
2070 of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are
2071 pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns
2072 jobs that are stopped, canceled, aborted, or completed.
2073
2074 </p>
2075 <h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsGetNamedDest">cupsGetNamedDest</a></h3>
2076 <p class="description">Get options for the named destination.</p>
2077 <p class="code">
2078 <a href="#cups_dest_t">cups_dest_t</a> *cupsGetNamedDest(<a href="#http_t">http_t</a> *http, const char *name, const char *instance);</p>
2079 <h4 class="parameters">Parameters</h4>
2080 <table class="list"><tbody>
2081 <tr><th>http</th>
2082 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
2083 <tr><th>name</th>
2084 <td class="description">Destination name or <code>NULL</code> for the default destination</td></tr>
2085 <tr><th>instance</th>
2086 <td class="description">Instance name or <code>NULL</code></td></tr>
2087 </tbody></table>
2088 <h4 class="returnvalue">Return Value</h4>
2089 <p class="description">Destination or <code>NULL</code></p>
2090 <h4 class="discussion">Discussion</h4>
2091 <p class="discussion">This function is optimized for retrieving a single destination and should
2092 be used instead of <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> when you
2093 either know the name of the destination or want to print to the default
2094 destination. If <code>NULL</code> is returned, the destination does not exist or
2095 there is no default destination.<br>
2096 <br>
2097 If &quot;http&quot; is <code>CUPS_HTTP_DEFAULT</code>, the connection to the default print
2098 server will be used.<br>
2099 <br>
2100 If &quot;name&quot; is <code>NULL</code>, the default printer for the current user will be
2101 returned.<br>
2102 <br>
2103 The returned destination must be freed using <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> with a
2104 &quot;num_dests&quot; value of 1.
2105
2106 </p>
2107 <h3 class="function"><a id="cupsGetOption">cupsGetOption</a></h3>
2108 <p class="description">Get an option value.</p>
2109 <p class="code">
2110 const char *cupsGetOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
2111 <h4 class="parameters">Parameters</h4>
2112 <table class="list"><tbody>
2113 <tr><th>name</th>
2114 <td class="description">Name of option</td></tr>
2115 <tr><th>num_options</th>
2116 <td class="description">Number of options</td></tr>
2117 <tr><th>options</th>
2118 <td class="description">Options</td></tr>
2119 </tbody></table>
2120 <h4 class="returnvalue">Return Value</h4>
2121 <p class="description">Option value or <code>NULL</code></p>
2122 <h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsGetPassword2">cupsGetPassword2</a></h3>
2123 <p class="description">Get a password from the user using the current
2124 password callback.</p>
2125 <p class="code">
2126 const char *cupsGetPassword2(const char *prompt, <a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p>
2127 <h4 class="parameters">Parameters</h4>
2128 <table class="list"><tbody>
2129 <tr><th>prompt</th>
2130 <td class="description">Prompt string</td></tr>
2131 <tr><th>http</th>
2132 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
2133 <tr><th>method</th>
2134 <td class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</td></tr>
2135 <tr><th>resource</th>
2136 <td class="description">Resource path</td></tr>
2137 </tbody></table>
2138 <h4 class="returnvalue">Return Value</h4>
2139 <p class="description">Password</p>
2140 <h4 class="discussion">Discussion</h4>
2141 <p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the
2142 user does not provide a password.<br>
2143 <br>
2144 Note: The current password callback function is tracked separately for each
2145 thread in a program. Multi-threaded programs that override the setting via
2146 the <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> function need to do so in each thread for the
2147 same function to be used.
2148
2149 </p>
2150 <h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></h3>
2151 <p class="description">Get the localized string for a destination media
2152 size.</p>
2153 <p class="code">
2154 const char *cupsLocalizeDestMedia(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p>
2155 <h4 class="parameters">Parameters</h4>
2156 <table class="list"><tbody>
2157 <tr><th>http</th>
2158 <td class="description">Connection to destination</td></tr>
2159 <tr><th>dest</th>
2160 <td class="description">Destination</td></tr>
2161 <tr><th>dinfo</th>
2162 <td class="description">Destination information</td></tr>
2163 <tr><th>flags</th>
2164 <td class="description">Media flags</td></tr>
2165 <tr><th>size</th>
2166 <td class="description">Media size</td></tr>
2167 </tbody></table>
2168 <h4 class="returnvalue">Return Value</h4>
2169 <p class="description">Localized string</p>
2170 <h4 class="discussion">Discussion</h4>
2171 <p class="discussion">The returned string is stored in the destination information and will become
2172 invalid if the destination information is deleted.
2173
2174 </p>
2175 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsLocalizeDestOption">cupsLocalizeDestOption</a></h3>
2176 <p class="description">Get the localized string for a destination
2177 option.</p>
2178 <p class="code">
2179 const char *cupsLocalizeDestOption(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option);</p>
2180 <h4 class="parameters">Parameters</h4>
2181 <table class="list"><tbody>
2182 <tr><th>http</th>
2183 <td class="description">Connection to destination</td></tr>
2184 <tr><th>dest</th>
2185 <td class="description">Destination</td></tr>
2186 <tr><th>dinfo</th>
2187 <td class="description">Destination information</td></tr>
2188 <tr><th>option</th>
2189 <td class="description">Option to localize</td></tr>
2190 </tbody></table>
2191 <h4 class="returnvalue">Return Value</h4>
2192 <p class="description">Localized string</p>
2193 <h4 class="discussion">Discussion</h4>
2194 <p class="discussion">The returned string is stored in the destination information and will become
2195 invalid if the destination information is deleted.
2196
2197 </p>
2198 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsLocalizeDestValue">cupsLocalizeDestValue</a></h3>
2199 <p class="description">Get the localized string for a destination
2200 option+value pair.</p>
2201 <p class="code">
2202 const char *cupsLocalizeDestValue(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option, const char *value);</p>
2203 <h4 class="parameters">Parameters</h4>
2204 <table class="list"><tbody>
2205 <tr><th>http</th>
2206 <td class="description">Connection to destination</td></tr>
2207 <tr><th>dest</th>
2208 <td class="description">Destination</td></tr>
2209 <tr><th>dinfo</th>
2210 <td class="description">Destination information</td></tr>
2211 <tr><th>option</th>
2212 <td class="description">Option to localize</td></tr>
2213 <tr><th>value</th>
2214 <td class="description">Value to localize</td></tr>
2215 </tbody></table>
2216 <h4 class="returnvalue">Return Value</h4>
2217 <p class="description">Localized string</p>
2218 <h4 class="discussion">Discussion</h4>
2219 <p class="discussion">The returned string is stored in the destination information and will become
2220 invalid if the destination information is deleted.
2221
2222 </p>
2223 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="cupsMakeServerCredentials">cupsMakeServerCredentials</a></h3>
2224 <p class="description">Make a self-signed certificate and private key pair.</p>
2225 <p class="code">
2226 int cupsMakeServerCredentials(const char *path, const char *common_name, int num_alt_names, const char **alt_names, time_t expiration_date);</p>
2227 <h4 class="parameters">Parameters</h4>
2228 <table class="list"><tbody>
2229 <tr><th>path</th>
2230 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
2231 <tr><th>common_name</th>
2232 <td class="description">Common name</td></tr>
2233 <tr><th>num_alt_names</th>
2234 <td class="description">Number of subject alternate names</td></tr>
2235 <tr><th>alt_names</th>
2236 <td class="description">Subject Alternate Names</td></tr>
2237 <tr><th>expiration_date</th>
2238 <td class="description">Expiration date</td></tr>
2239 </tbody></table>
2240 <h4 class="returnvalue">Return Value</h4>
2241 <p class="description">1 on success, 0 on failure</p>
2242 <h3 class="function"><a id="cupsParseOptions">cupsParseOptions</a></h3>
2243 <p class="description">Parse options from a command-line argument.</p>
2244 <p class="code">
2245 int cupsParseOptions(const char *arg, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
2246 <h4 class="parameters">Parameters</h4>
2247 <table class="list"><tbody>
2248 <tr><th>arg</th>
2249 <td class="description">Argument to parse</td></tr>
2250 <tr><th>num_options</th>
2251 <td class="description">Number of options</td></tr>
2252 <tr><th>options</th>
2253 <td class="description">Options found</td></tr>
2254 </tbody></table>
2255 <h4 class="returnvalue">Return Value</h4>
2256 <p class="description">Number of options found</p>
2257 <h4 class="discussion">Discussion</h4>
2258 <p class="discussion">This function converts space-delimited name/value pairs according
2259 to the PAPI text option ABNF specification. Collection values
2260 (&quot;name={a=... b=... c=...}&quot;) are stored with the curley brackets
2261 intact - use <code>cupsParseOptions</code> on the value to extract the
2262 collection attributes.</p>
2263 <h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsRemoveDest">cupsRemoveDest</a></h3>
2264 <p class="description">Remove a destination from the destination list.</p>
2265 <p class="code">
2266 int cupsRemoveDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
2267 <h4 class="parameters">Parameters</h4>
2268 <table class="list"><tbody>
2269 <tr><th>name</th>
2270 <td class="description">Destination name</td></tr>
2271 <tr><th>instance</th>
2272 <td class="description">Instance name or <code>NULL</code></td></tr>
2273 <tr><th>num_dests</th>
2274 <td class="description">Number of destinations</td></tr>
2275 <tr><th>dests</th>
2276 <td class="description">Destinations</td></tr>
2277 </tbody></table>
2278 <h4 class="returnvalue">Return Value</h4>
2279 <p class="description">New number of destinations</p>
2280 <h4 class="discussion">Discussion</h4>
2281 <p class="discussion">Removing a destination/instance does not delete the class or printer
2282 queue, merely the lpoptions for that destination/instance. Use the
2283 <a href="#cupsSetDests"><code>cupsSetDests</code></a> or <a href="#cupsSetDests2"><code>cupsSetDests2</code></a> functions to save the new
2284 options for the user.
2285
2286 </p>
2287 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsRemoveOption">cupsRemoveOption</a></h3>
2288 <p class="description">Remove an option from an option array.</p>
2289 <p class="code">
2290 int cupsRemoveOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
2291 <h4 class="parameters">Parameters</h4>
2292 <table class="list"><tbody>
2293 <tr><th>name</th>
2294 <td class="description">Option name</td></tr>
2295 <tr><th>num_options</th>
2296 <td class="description">Current number of options</td></tr>
2297 <tr><th>options</th>
2298 <td class="description">Options</td></tr>
2299 </tbody></table>
2300 <h4 class="returnvalue">Return Value</h4>
2301 <p class="description">New number of options</p>
2302 <h3 class="function"><a id="cupsServer">cupsServer</a></h3>
2303 <p class="description">Return the hostname/address of the current server.</p>
2304 <p class="code">
2305 const char *cupsServer(void);</p>
2306 <h4 class="returnvalue">Return Value</h4>
2307 <p class="description">Server name</p>
2308 <h4 class="discussion">Discussion</h4>
2309 <p class="discussion">The default server comes from the CUPS_SERVER environment variable, then the
2310 ~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not
2311 set, the default is the local system - either &quot;localhost&quot; or a domain socket
2312 path.<br>
2313 <br>
2314 The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6
2315 address, or a domain socket pathname.<br>
2316 <br>
2317 Note: The current server is tracked separately for each thread in a program.
2318 Multi-threaded programs that override the server via the
2319 <a href="#cupsSetServer"><code>cupsSetServer</code></a> function need to do so in each thread for the same
2320 server to be used.</p>
2321 <h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetClientCertCB">cupsSetClientCertCB</a></h3>
2322 <p class="description">Set the client certificate callback.</p>
2323 <p class="code">
2324 void cupsSetClientCertCB(<a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a> cb, void *user_data);</p>
2325 <h4 class="parameters">Parameters</h4>
2326 <table class="list"><tbody>
2327 <tr><th>cb</th>
2328 <td class="description">Callback function</td></tr>
2329 <tr><th>user_data</th>
2330 <td class="description">User data pointer</td></tr>
2331 </tbody></table>
2332 <h4 class="discussion">Discussion</h4>
2333 <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
2334 <br>
2335 Note: The current certificate callback is tracked separately for each thread
2336 in a program. Multi-threaded programs that override the callback need to do
2337 so in each thread for the same callback to be used.
2338
2339 </p>
2340 <h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetCredentials">cupsSetCredentials</a></h3>
2341 <p class="description">Set the default credentials to be used for SSL/TLS
2342 connections.</p>
2343 <p class="code">
2344 int cupsSetCredentials(cups_array_t *credentials);</p>
2345 <h4 class="parameters">Parameters</h4>
2346 <table class="list"><tbody>
2347 <tr><th>credentials</th>
2348 <td class="description">Array of credentials</td></tr>
2349 </tbody></table>
2350 <h4 class="returnvalue">Return Value</h4>
2351 <p class="description">Status of call (0 = success)</p>
2352 <h4 class="discussion">Discussion</h4>
2353 <p class="discussion">Note: The default credentials are tracked separately for each thread in a
2354 program. Multi-threaded programs that override the setting need to do so in
2355 each thread for the same setting to be used.
2356
2357 </p>
2358 <h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsSetDefaultDest">cupsSetDefaultDest</a></h3>
2359 <p class="description">Set the default destination.</p>
2360 <p class="code">
2361 void cupsSetDefaultDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
2362 <h4 class="parameters">Parameters</h4>
2363 <table class="list"><tbody>
2364 <tr><th>name</th>
2365 <td class="description">Destination name</td></tr>
2366 <tr><th>instance</th>
2367 <td class="description">Instance name or <code>NULL</code></td></tr>
2368 <tr><th>num_dests</th>
2369 <td class="description">Number of destinations</td></tr>
2370 <tr><th>dests</th>
2371 <td class="description">Destinations</td></tr>
2372 </tbody></table>
2373 <h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsSetDests2">cupsSetDests2</a></h3>
2374 <p class="description">Save the list of destinations for the specified server.</p>
2375 <p class="code">
2376 int cupsSetDests2(<a href="#http_t">http_t</a> *http, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
2377 <h4 class="parameters">Parameters</h4>
2378 <table class="list"><tbody>
2379 <tr><th>http</th>
2380 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
2381 <tr><th>num_dests</th>
2382 <td class="description">Number of destinations</td></tr>
2383 <tr><th>dests</th>
2384 <td class="description">Destinations</td></tr>
2385 </tbody></table>
2386 <h4 class="returnvalue">Return Value</h4>
2387 <p class="description">0 on success, -1 on error</p>
2388 <h4 class="discussion">Discussion</h4>
2389 <p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run
2390 as root and ~/.cups/lpoptions when run as a normal user.
2391
2392 </p>
2393 <h3 class="function"><a id="cupsSetEncryption">cupsSetEncryption</a></h3>
2394 <p class="description">Set the encryption preference.</p>
2395 <p class="code">
2396 void cupsSetEncryption(<a href="#http_encryption_t">http_encryption_t</a> e);</p>
2397 <h4 class="parameters">Parameters</h4>
2398 <table class="list"><tbody>
2399 <tr><th>e</th>
2400 <td class="description">New encryption preference</td></tr>
2401 </tbody></table>
2402 <h4 class="discussion">Discussion</h4>
2403 <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
2404 environment variable, then the ~/.cups/client.conf file, and finally the
2405 /etc/cups/client.conf file. If not set, the default is
2406 <code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
2407 <br>
2408 Note: The current encryption setting is tracked separately for each thread
2409 in a program. Multi-threaded programs that override the setting need to do
2410 so in each thread for the same setting to be used.</p>
2411 <h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsSetPasswordCB2">cupsSetPasswordCB2</a></h3>
2412 <p class="description">Set the advanced password callback for CUPS.</p>
2413 <p class="code">
2414 void cupsSetPasswordCB2(<a href="#cups_password_cb2_t">cups_password_cb2_t</a> cb, void *user_data);</p>
2415 <h4 class="parameters">Parameters</h4>
2416 <table class="list"><tbody>
2417 <tr><th>cb</th>
2418 <td class="description">Callback function</td></tr>
2419 <tr><th>user_data</th>
2420 <td class="description">User data pointer</td></tr>
2421 </tbody></table>
2422 <h4 class="discussion">Discussion</h4>
2423 <p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which
2424 reads the password from the console. Programs should call either this
2425 function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered
2426 by a program per thread.<br>
2427 <br>
2428 Note: The current password callback is tracked separately for each thread
2429 in a program. Multi-threaded programs that override the callback need to do
2430 so in each thread for the same callback to be used.
2431
2432 </p>
2433 <h3 class="function"><a id="cupsSetServer">cupsSetServer</a></h3>
2434 <p class="description">Set the default server name and port.</p>
2435 <p class="code">
2436 void cupsSetServer(const char *server);</p>
2437 <h4 class="parameters">Parameters</h4>
2438 <table class="list"><tbody>
2439 <tr><th>server</th>
2440 <td class="description">Server name</td></tr>
2441 </tbody></table>
2442 <h4 class="discussion">Discussion</h4>
2443 <p class="discussion">The &quot;server&quot; string can be a fully-qualified hostname, a numeric
2444 IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP
2445 addresses can be optionally followed by a colon and port number to override
2446 the default port 631, e.g. &quot;hostname:8631&quot;. Pass <code>NULL</code> to restore the
2447 default server name and port.<br>
2448 <br>
2449 Note: The current server is tracked separately for each thread in a program.
2450 Multi-threaded programs that override the server need to do so in each
2451 thread for the same server to be used.</p>
2452 <h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetServerCertCB">cupsSetServerCertCB</a></h3>
2453 <p class="description">Set the server certificate callback.</p>
2454 <p class="code">
2455 void cupsSetServerCertCB(<a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a> cb, void *user_data);</p>
2456 <h4 class="parameters">Parameters</h4>
2457 <table class="list"><tbody>
2458 <tr><th>cb</th>
2459 <td class="description">Callback function</td></tr>
2460 <tr><th>user_data</th>
2461 <td class="description">User data pointer</td></tr>
2462 </tbody></table>
2463 <h4 class="discussion">Discussion</h4>
2464 <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
2465 <br>
2466 Note: The current credentials callback is tracked separately for each thread
2467 in a program. Multi-threaded programs that override the callback need to do
2468 so in each thread for the same callback to be used.
2469
2470 </p>
2471 <h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsSetServerCredentials">cupsSetServerCredentials</a></h3>
2472 <p class="description">Set the default server credentials.</p>
2473 <p class="code">
2474 int cupsSetServerCredentials(const char *path, const char *common_name, int auto_create);</p>
2475 <h4 class="parameters">Parameters</h4>
2476 <table class="list"><tbody>
2477 <tr><th>path</th>
2478 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
2479 <tr><th>common_name</th>
2480 <td class="description">Default common name for server</td></tr>
2481 <tr><th>auto_create</th>
2482 <td class="description">1 = automatically create self-signed certificates</td></tr>
2483 </tbody></table>
2484 <h4 class="returnvalue">Return Value</h4>
2485 <p class="description">1 on success, 0 on failure</p>
2486 <h4 class="discussion">Discussion</h4>
2487 <p class="discussion">Note: The server credentials are used by all threads in the running process.
2488 This function is threadsafe.
2489
2490 </p>
2491 <h3 class="function"><a id="cupsSetUser">cupsSetUser</a></h3>
2492 <p class="description">Set the default user name.</p>
2493 <p class="code">
2494 void cupsSetUser(const char *user);</p>
2495 <h4 class="parameters">Parameters</h4>
2496 <table class="list"><tbody>
2497 <tr><th>user</th>
2498 <td class="description">User name</td></tr>
2499 </tbody></table>
2500 <h4 class="discussion">Discussion</h4>
2501 <p class="discussion">Pass <code>NULL</code> to restore the default user name.<br>
2502 <br>
2503 Note: The current user name is tracked separately for each thread in a
2504 program. Multi-threaded programs that override the user name need to do so
2505 in each thread for the same user name to be used.</p>
2506 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsSetUserAgent">cupsSetUserAgent</a></h3>
2507 <p class="description">Set the default HTTP User-Agent string.</p>
2508 <p class="code">
2509 void cupsSetUserAgent(const char *user_agent);</p>
2510 <h4 class="parameters">Parameters</h4>
2511 <table class="list"><tbody>
2512 <tr><th>user_agent</th>
2513 <td class="description">User-Agent string or <code>NULL</code></td></tr>
2514 </tbody></table>
2515 <h4 class="discussion">Discussion</h4>
2516 <p class="discussion">Setting the string to NULL forces the default value containing the CUPS
2517 version, IPP version, and operating system version and architecture.
2518
2519 </p>
2520 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsStartDestDocument">cupsStartDestDocument</a></h3>
2521 <p class="description">Start a new document.</p>
2522 <p class="code">
2523 http_status_t cupsStartDestDocument(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info, int job_id, const char *docname, const char *format, int num_options, <a href="#cups_option_t">cups_option_t</a> *options, int last_document);</p>
2524 <h4 class="parameters">Parameters</h4>
2525 <table class="list"><tbody>
2526 <tr><th>http</th>
2527 <td class="description">Connection to destination</td></tr>
2528 <tr><th>dest</th>
2529 <td class="description">Destination</td></tr>
2530 <tr><th>info</th>
2531 <td class="description">Destination information</td></tr>
2532 <tr><th>job_id</th>
2533 <td class="description">Job ID</td></tr>
2534 <tr><th>docname</th>
2535 <td class="description">Document name</td></tr>
2536 <tr><th>format</th>
2537 <td class="description">Document format</td></tr>
2538 <tr><th>num_options</th>
2539 <td class="description">Number of document options</td></tr>
2540 <tr><th>options</th>
2541 <td class="description">Document options</td></tr>
2542 <tr><th>last_document</th>
2543 <td class="description">1 if this is the last document</td></tr>
2544 </tbody></table>
2545 <h4 class="returnvalue">Return Value</h4>
2546 <p class="description">Status of document creation</p>
2547 <h4 class="discussion">Discussion</h4>
2548 <p class="discussion">&quot;job_id&quot; is the job ID returned by cupsCreateDestJob. &quot;docname&quot; is the name
2549 of the document/file being printed, &quot;format&quot; is the MIME media type for the
2550 document (see CUPS_FORMAT_xxx constants), and &quot;num_options&quot; and &quot;options&quot;
2551 are the options do be applied to the document. &quot;last_document&quot; should be 1
2552 if this is the last document to be submitted in the job. Returns
2553 <code>HTTP_CONTINUE</code> on success.
2554
2555 </p>
2556 <h3 class="function"><a id="cupsUser">cupsUser</a></h3>
2557 <p class="description">Return the current user's name.</p>
2558 <p class="code">
2559 const char *cupsUser(void);</p>
2560 <h4 class="returnvalue">Return Value</h4>
2561 <p class="description">User name</p>
2562 <h4 class="discussion">Discussion</h4>
2563 <p class="discussion">Note: The current user name is tracked separately for each thread in a
2564 program. Multi-threaded programs that override the user name with the
2565 <a href="#cupsSetUser"><code>cupsSetUser</code></a> function need to do so in each thread for the same user
2566 name to be used.</p>
2567 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsUserAgent">cupsUserAgent</a></h3>
2568 <p class="description">Return the default HTTP User-Agent string.</p>
2569 <p class="code">
2570 const char *cupsUserAgent(void);</p>
2571 <h4 class="returnvalue">Return Value</h4>
2572 <p class="description">User-Agent string</p>
2573 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAcceptConnection">httpAcceptConnection</a></h3>
2574 <p class="description">Accept a new HTTP client connection from the
2575 specified listening socket.</p>
2576 <p class="code">
2577 <a href="#http_t">http_t</a> *httpAcceptConnection(int fd, int blocking);</p>
2578 <h4 class="parameters">Parameters</h4>
2579 <table class="list"><tbody>
2580 <tr><th>fd</th>
2581 <td class="description">Listen socket file descriptor</td></tr>
2582 <tr><th>blocking</th>
2583 <td class="description">1 if the connection should be
2584 blocking, 0 otherwise</td></tr>
2585 </tbody></table>
2586 <h4 class="returnvalue">Return Value</h4>
2587 <p class="description">HTTP connection or <code>NULL</code></p>
2588 <h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpAddCredential">httpAddCredential</a></h3>
2589 <p class="description">Allocates and adds a single credential to an array.</p>
2590 <p class="code">
2591 int httpAddCredential(cups_array_t *credentials, const void *data, size_t datalen);</p>
2592 <h4 class="parameters">Parameters</h4>
2593 <table class="list"><tbody>
2594 <tr><th>credentials</th>
2595 <td class="description">Credentials array</td></tr>
2596 <tr><th>data</th>
2597 <td class="description">PEM-encoded X.509 data</td></tr>
2598 <tr><th>datalen</th>
2599 <td class="description">Length of data</td></tr>
2600 </tbody></table>
2601 <h4 class="returnvalue">Return Value</h4>
2602 <p class="description">0 on success, -1 on error</p>
2603 <h4 class="discussion">Discussion</h4>
2604 <p class="discussion">Use <code>cupsArrayNew(NULL, NULL)</code> to create a credentials array.
2605
2606 </p>
2607 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrAny">httpAddrAny</a></h3>
2608 <p class="description">Check for the &quot;any&quot; address.</p>
2609 <p class="code">
2610 int httpAddrAny(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
2611 <h4 class="parameters">Parameters</h4>
2612 <table class="list"><tbody>
2613 <tr><th>addr</th>
2614 <td class="description">Address to check</td></tr>
2615 </tbody></table>
2616 <h4 class="returnvalue">Return Value</h4>
2617 <p class="description">1 if &quot;any&quot;, 0 otherwise</p>
2618 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpAddrClose">httpAddrClose</a></h3>
2619 <p class="description">Close a socket created by <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> or
2620 <a href="#httpAddrListen"><code>httpAddrListen</code></a>.</p>
2621 <p class="code">
2622 int httpAddrClose(<a href="#http_addr_t">http_addr_t</a> *addr, int fd);</p>
2623 <h4 class="parameters">Parameters</h4>
2624 <table class="list"><tbody>
2625 <tr><th>addr</th>
2626 <td class="description">Listen address or <code>NULL</code></td></tr>
2627 <tr><th>fd</th>
2628 <td class="description">Socket file descriptor</td></tr>
2629 </tbody></table>
2630 <h4 class="returnvalue">Return Value</h4>
2631 <p class="description">0 on success, -1 on failure</p>
2632 <h4 class="discussion">Discussion</h4>
2633 <p class="discussion">Pass <code>NULL</code> for sockets created with <a href="#httpAddrConnect2"><code>httpAddrConnect2</code></a> and the
2634 listen address for sockets created with <a href="#httpAddrListen"><code>httpAddrListen</code></a>. This function
2635 ensures that domain sockets are removed when closed.
2636
2637 </p>
2638 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrConnect2">httpAddrConnect2</a></h3>
2639 <p class="description">Connect to any of the addresses in the list with a
2640 timeout and optional cancel.</p>
2641 <p class="code">
2642 <a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrConnect2(<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist, int *sock, int msec, int *cancel);</p>
2643 <h4 class="parameters">Parameters</h4>
2644 <table class="list"><tbody>
2645 <tr><th>addrlist</th>
2646 <td class="description">List of potential addresses</td></tr>
2647 <tr><th>sock</th>
2648 <td class="description">Socket</td></tr>
2649 <tr><th>msec</th>
2650 <td class="description">Timeout in milliseconds</td></tr>
2651 <tr><th>cancel</th>
2652 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
2653 </tbody></table>
2654 <h4 class="returnvalue">Return Value</h4>
2655 <p class="description">Connected address or NULL on failure</p>
2656 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrCopyList">httpAddrCopyList</a></h3>
2657 <p class="description">Copy an address list.</p>
2658 <p class="code">
2659 <a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrCopyList(<a href="#http_addrlist_t">http_addrlist_t</a> *src);</p>
2660 <h4 class="parameters">Parameters</h4>
2661 <table class="list"><tbody>
2662 <tr><th>src</th>
2663 <td class="description">Source address list</td></tr>
2664 </tbody></table>
2665 <h4 class="returnvalue">Return Value</h4>
2666 <p class="description">New address list or <code>NULL</code> on error</p>
2667 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrEqual">httpAddrEqual</a></h3>
2668 <p class="description">Compare two addresses.</p>
2669 <p class="code">
2670 int httpAddrEqual(const <a href="#http_addr_t">http_addr_t</a> *addr1, const <a href="#http_addr_t">http_addr_t</a> *addr2);</p>
2671 <h4 class="parameters">Parameters</h4>
2672 <table class="list"><tbody>
2673 <tr><th>addr1</th>
2674 <td class="description">First address</td></tr>
2675 <tr><th>addr2</th>
2676 <td class="description">Second address</td></tr>
2677 </tbody></table>
2678 <h4 class="returnvalue">Return Value</h4>
2679 <p class="description">1 if equal, 0 if not</p>
2680 <h3 class="function"><a id="httpAddrFamily">httpAddrFamily</a></h3>
2681 <p class="description">Get the address family of an address.</p>
2682 <p class="code">
2683 int httpAddrFamily(<a href="#http_addr_t">http_addr_t</a> *addr);</p>
2684 <h4 class="parameters">Parameters</h4>
2685 <table class="list"><tbody>
2686 <tr><th>addr</th>
2687 <td class="description">Address</td></tr>
2688 </tbody></table>
2689 <h4 class="returnvalue">Return Value</h4>
2690 <p class="description">Address family</p>
2691 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrFreeList">httpAddrFreeList</a></h3>
2692 <p class="description">Free an address list.</p>
2693 <p class="code">
2694 void httpAddrFreeList(<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist);</p>
2695 <h4 class="parameters">Parameters</h4>
2696 <table class="list"><tbody>
2697 <tr><th>addrlist</th>
2698 <td class="description">Address list to free</td></tr>
2699 </tbody></table>
2700 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrGetList">httpAddrGetList</a></h3>
2701 <p class="description">Get a list of addresses for a hostname.</p>
2702 <p class="code">
2703 <a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrGetList(const char *hostname, int family, const char *service);</p>
2704 <h4 class="parameters">Parameters</h4>
2705 <table class="list"><tbody>
2706 <tr><th>hostname</th>
2707 <td class="description">Hostname, IP address, or NULL for passive listen address</td></tr>
2708 <tr><th>family</th>
2709 <td class="description">Address family or AF_UNSPEC</td></tr>
2710 <tr><th>service</th>
2711 <td class="description">Service name or port number</td></tr>
2712 </tbody></table>
2713 <h4 class="returnvalue">Return Value</h4>
2714 <p class="description">List of addresses or NULL</p>
2715 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLength">httpAddrLength</a></h3>
2716 <p class="description">Return the length of the address in bytes.</p>
2717 <p class="code">
2718 int httpAddrLength(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
2719 <h4 class="parameters">Parameters</h4>
2720 <table class="list"><tbody>
2721 <tr><th>addr</th>
2722 <td class="description">Address</td></tr>
2723 </tbody></table>
2724 <h4 class="returnvalue">Return Value</h4>
2725 <p class="description">Length in bytes</p>
2726 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrListen">httpAddrListen</a></h3>
2727 <p class="description">Create a listening socket bound to the specified
2728 address and port.</p>
2729 <p class="code">
2730 int httpAddrListen(<a href="#http_addr_t">http_addr_t</a> *addr, int port);</p>
2731 <h4 class="parameters">Parameters</h4>
2732 <table class="list"><tbody>
2733 <tr><th>addr</th>
2734 <td class="description">Address to bind to</td></tr>
2735 <tr><th>port</th>
2736 <td class="description">Port number to bind to</td></tr>
2737 </tbody></table>
2738 <h4 class="returnvalue">Return Value</h4>
2739 <p class="description">Socket or -1 on error</p>
2740 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLocalhost">httpAddrLocalhost</a></h3>
2741 <p class="description">Check for the local loopback address.</p>
2742 <p class="code">
2743 int httpAddrLocalhost(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
2744 <h4 class="parameters">Parameters</h4>
2745 <table class="list"><tbody>
2746 <tr><th>addr</th>
2747 <td class="description">Address to check</td></tr>
2748 </tbody></table>
2749 <h4 class="returnvalue">Return Value</h4>
2750 <p class="description">1 if local host, 0 otherwise</p>
2751 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLookup">httpAddrLookup</a></h3>
2752 <p class="description">Lookup the hostname associated with the address.</p>
2753 <p class="code">
2754 char *httpAddrLookup(const <a href="#http_addr_t">http_addr_t</a> *addr, char *name, int namelen);</p>
2755 <h4 class="parameters">Parameters</h4>
2756 <table class="list"><tbody>
2757 <tr><th>addr</th>
2758 <td class="description">Address to lookup</td></tr>
2759 <tr><th>name</th>
2760 <td class="description">Host name buffer</td></tr>
2761 <tr><th>namelen</th>
2762 <td class="description">Size of name buffer</td></tr>
2763 </tbody></table>
2764 <h4 class="returnvalue">Return Value</h4>
2765 <p class="description">Host name</p>
2766 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrPort">httpAddrPort</a></h3>
2767 <p class="description">Get the port number associated with an address.</p>
2768 <p class="code">
2769 int httpAddrPort(<a href="#http_addr_t">http_addr_t</a> *addr);</p>
2770 <h4 class="parameters">Parameters</h4>
2771 <table class="list"><tbody>
2772 <tr><th>addr</th>
2773 <td class="description">Address</td></tr>
2774 </tbody></table>
2775 <h4 class="returnvalue">Return Value</h4>
2776 <p class="description">Port number</p>
2777 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrString">httpAddrString</a></h3>
2778 <p class="description">Convert an address to a numeric string.</p>
2779 <p class="code">
2780 char *httpAddrString(const <a href="#http_addr_t">http_addr_t</a> *addr, char *s, int slen);</p>
2781 <h4 class="parameters">Parameters</h4>
2782 <table class="list"><tbody>
2783 <tr><th>addr</th>
2784 <td class="description">Address to convert</td></tr>
2785 <tr><th>s</th>
2786 <td class="description">String buffer</td></tr>
2787 <tr><th>slen</th>
2788 <td class="description">Length of string</td></tr>
2789 </tbody></table>
2790 <h4 class="returnvalue">Return Value</h4>
2791 <p class="description">Numeric address string</p>
2792 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAssembleURI">httpAssembleURI</a></h3>
2793 <p class="description">Assemble a uniform resource identifier from its
2794 components.</p>
2795 <p class="code">
2796 <a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURI(<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding, char *uri, int urilen, const char *scheme, const char *username, const char *host, int port, const char *resource);</p>
2797 <h4 class="parameters">Parameters</h4>
2798 <table class="list"><tbody>
2799 <tr><th>encoding</th>
2800 <td class="description">Encoding flags</td></tr>
2801 <tr><th>uri</th>
2802 <td class="description">URI buffer</td></tr>
2803 <tr><th>urilen</th>
2804 <td class="description">Size of URI buffer</td></tr>
2805 <tr><th>scheme</th>
2806 <td class="description">Scheme name</td></tr>
2807 <tr><th>username</th>
2808 <td class="description">Username</td></tr>
2809 <tr><th>host</th>
2810 <td class="description">Hostname or address</td></tr>
2811 <tr><th>port</th>
2812 <td class="description">Port number</td></tr>
2813 <tr><th>resource</th>
2814 <td class="description">Resource</td></tr>
2815 </tbody></table>
2816 <h4 class="returnvalue">Return Value</h4>
2817 <p class="description">URI status</p>
2818 <h4 class="discussion">Discussion</h4>
2819 <p class="discussion">This function escapes reserved characters in the URI depending on the
2820 value of the &quot;encoding&quot; argument. You should use this function in
2821 place of traditional string functions whenever you need to create a
2822 URI string.
2823
2824 </p>
2825 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAssembleURIf">httpAssembleURIf</a></h3>
2826 <p class="description">Assemble a uniform resource identifier from its
2827 components with a formatted resource.</p>
2828 <p class="code">
2829 <a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURIf(<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding, char *uri, int urilen, const char *scheme, const char *username, const char *host, int port, const char *resourcef, ...);</p>
2830 <h4 class="parameters">Parameters</h4>
2831 <table class="list"><tbody>
2832 <tr><th>encoding</th>
2833 <td class="description">Encoding flags</td></tr>
2834 <tr><th>uri</th>
2835 <td class="description">URI buffer</td></tr>
2836 <tr><th>urilen</th>
2837 <td class="description">Size of URI buffer</td></tr>
2838 <tr><th>scheme</th>
2839 <td class="description">Scheme name</td></tr>
2840 <tr><th>username</th>
2841 <td class="description">Username</td></tr>
2842 <tr><th>host</th>
2843 <td class="description">Hostname or address</td></tr>
2844 <tr><th>port</th>
2845 <td class="description">Port number</td></tr>
2846 <tr><th>resourcef</th>
2847 <td class="description">Printf-style resource</td></tr>
2848 <tr><th>...</th>
2849 <td class="description">Additional arguments as needed</td></tr>
2850 </tbody></table>
2851 <h4 class="returnvalue">Return Value</h4>
2852 <p class="description">URI status</p>
2853 <h4 class="discussion">Discussion</h4>
2854 <p class="discussion">This function creates a formatted version of the resource string
2855 argument &quot;resourcef&quot; and escapes reserved characters in the URI
2856 depending on the value of the &quot;encoding&quot; argument. You should use
2857 this function in place of traditional string functions whenever
2858 you need to create a URI string.
2859
2860 </p>
2861 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAssembleUUID">httpAssembleUUID</a></h3>
2862 <p class="description">Assemble a name-based UUID URN conforming to RFC 4122.</p>
2863 <p class="code">
2864 char *httpAssembleUUID(const char *server, int port, const char *name, int number, char *buffer, size_t bufsize);</p>
2865 <h4 class="parameters">Parameters</h4>
2866 <table class="list"><tbody>
2867 <tr><th>server</th>
2868 <td class="description">Server name</td></tr>
2869 <tr><th>port</th>
2870 <td class="description">Port number</td></tr>
2871 <tr><th>name</th>
2872 <td class="description">Object name or NULL</td></tr>
2873 <tr><th>number</th>
2874 <td class="description">Object number or 0</td></tr>
2875 <tr><th>buffer</th>
2876 <td class="description">String buffer</td></tr>
2877 <tr><th>bufsize</th>
2878 <td class="description">Size of buffer</td></tr>
2879 </tbody></table>
2880 <h4 class="returnvalue">Return Value</h4>
2881 <p class="description">UUID string</p>
2882 <h4 class="discussion">Discussion</h4>
2883 <p class="discussion">This function creates a unique 128-bit identifying number using the server
2884 name, port number, random data, and optionally an object name and/or object
2885 number. The result is formatted as a UUID URN as defined in RFC 4122.<br>
2886 <br>
2887 The buffer needs to be at least 46 bytes in size.
2888
2889 </p>
2890 <h3 class="function"><a id="httpBlocking">httpBlocking</a></h3>
2891 <p class="description">Set blocking/non-blocking behavior on a connection.</p>
2892 <p class="code">
2893 void httpBlocking(<a href="#http_t">http_t</a> *http, int b);</p>
2894 <h4 class="parameters">Parameters</h4>
2895 <table class="list"><tbody>
2896 <tr><th>http</th>
2897 <td class="description">HTTP connection</td></tr>
2898 <tr><th>b</th>
2899 <td class="description">1 = blocking, 0 = non-blocking</td></tr>
2900 </tbody></table>
2901 <h3 class="function"><a id="httpCheck">httpCheck</a></h3>
2902 <p class="description">Check to see if there is a pending response from the server.</p>
2903 <p class="code">
2904 int httpCheck(<a href="#http_t">http_t</a> *http);</p>
2905 <h4 class="parameters">Parameters</h4>
2906 <table class="list"><tbody>
2907 <tr><th>http</th>
2908 <td class="description">HTTP connection</td></tr>
2909 </tbody></table>
2910 <h4 class="returnvalue">Return Value</h4>
2911 <p class="description">0 = no data, 1 = data available</p>
2912 <h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpClearCookie">httpClearCookie</a></h3>
2913 <p class="description">Clear the cookie value(s).</p>
2914 <p class="code">
2915 void httpClearCookie(<a href="#http_t">http_t</a> *http);</p>
2916 <h4 class="parameters">Parameters</h4>
2917 <table class="list"><tbody>
2918 <tr><th>http</th>
2919 <td class="description">HTTP connection</td></tr>
2920 </tbody></table>
2921 <h3 class="function"><a id="httpClearFields">httpClearFields</a></h3>
2922 <p class="description">Clear HTTP request fields.</p>
2923 <p class="code">
2924 void httpClearFields(<a href="#http_t">http_t</a> *http);</p>
2925 <h4 class="parameters">Parameters</h4>
2926 <table class="list"><tbody>
2927 <tr><th>http</th>
2928 <td class="description">HTTP connection</td></tr>
2929 </tbody></table>
2930 <h3 class="function"><a id="httpClose">httpClose</a></h3>
2931 <p class="description">Close an HTTP connection.</p>
2932 <p class="code">
2933 void httpClose(<a href="#http_t">http_t</a> *http);</p>
2934 <h4 class="parameters">Parameters</h4>
2935 <table class="list"><tbody>
2936 <tr><th>http</th>
2937 <td class="description">HTTP connection</td></tr>
2938 </tbody></table>
2939 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpCompareCredentials">httpCompareCredentials</a></h3>
2940 <p class="description">Compare two sets of X.509 credentials.</p>
2941 <p class="code">
2942 int httpCompareCredentials(cups_array_t *cred1, cups_array_t *cred2);</p>
2943 <h4 class="parameters">Parameters</h4>
2944 <table class="list"><tbody>
2945 <tr><th>cred1</th>
2946 <td class="description">First set of X.509 credentials</td></tr>
2947 <tr><th>cred2</th>
2948 <td class="description">Second set of X.509 credentials</td></tr>
2949 </tbody></table>
2950 <h4 class="returnvalue">Return Value</h4>
2951 <p class="description">1 if they match, 0 if they do not</p>
2952 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpConnect2">httpConnect2</a></h3>
2953 <p class="description">Connect to a HTTP server.</p>
2954 <p class="code">
2955 <a href="#http_t">http_t</a> *httpConnect2(const char *host, int port, <a href="#http_addrlist_t">http_addrlist_t</a> *addrlist, int family, <a href="#http_encryption_t">http_encryption_t</a> encryption, int blocking, int msec, int *cancel);</p>
2956 <h4 class="parameters">Parameters</h4>
2957 <table class="list"><tbody>
2958 <tr><th>host</th>
2959 <td class="description">Host to connect to</td></tr>
2960 <tr><th>port</th>
2961 <td class="description">Port number</td></tr>
2962 <tr><th>addrlist</th>
2963 <td class="description">List of addresses or <code>NULL</code> to lookup</td></tr>
2964 <tr><th>family</th>
2965 <td class="description">Address family to use or <code>AF_UNSPEC</code> for any</td></tr>
2966 <tr><th>encryption</th>
2967 <td class="description">Type of encryption to use</td></tr>
2968 <tr><th>blocking</th>
2969 <td class="description">1 for blocking connection, 0 for non-blocking</td></tr>
2970 <tr><th>msec</th>
2971 <td class="description">Connection timeout in milliseconds, 0 means don't connect</td></tr>
2972 <tr><th>cancel</th>
2973 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
2974 </tbody></table>
2975 <h4 class="returnvalue">Return Value</h4>
2976 <p class="description">New HTTP connection</p>
2977 <h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpCopyCredentials">httpCopyCredentials</a></h3>
2978 <p class="description">Copy the credentials associated with the peer in
2979 an encrypted connection.</p>
2980 <p class="code">
2981 int httpCopyCredentials(<a href="#http_t">http_t</a> *http, cups_array_t **credentials);</p>
2982 <h4 class="parameters">Parameters</h4>
2983 <table class="list"><tbody>
2984 <tr><th>http</th>
2985 <td class="description">Connection to server</td></tr>
2986 <tr><th>credentials</th>
2987 <td class="description">Array of credentials</td></tr>
2988 </tbody></table>
2989 <h4 class="returnvalue">Return Value</h4>
2990 <p class="description">Status of call (0 = success)</p>
2991 <h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></h3>
2992 <p class="description">Return whether the credentials are valid for the given name.</p>
2993 <p class="code">
2994 int httpCredentialsAreValidForName(cups_array_t *credentials, const char *common_name);</p>
2995 <h4 class="parameters">Parameters</h4>
2996 <table class="list"><tbody>
2997 <tr><th>credentials</th>
2998 <td class="description">Credentials</td></tr>
2999 <tr><th>common_name</th>
3000 <td class="description">Name to check</td></tr>
3001 </tbody></table>
3002 <h4 class="returnvalue">Return Value</h4>
3003 <p class="description">1 if valid, 0 otherwise</p>
3004 <h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></h3>
3005 <p class="description">Return the expiration date of the credentials.</p>
3006 <p class="code">
3007 time_t httpCredentialsGetExpiration(cups_array_t *credentials);</p>
3008 <h4 class="parameters">Parameters</h4>
3009 <table class="list"><tbody>
3010 <tr><th>credentials</th>
3011 <td class="description">Credentials</td></tr>
3012 </tbody></table>
3013 <h4 class="returnvalue">Return Value</h4>
3014 <p class="description">Expiration date of credentials</p>
3015 <h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsGetTrust">httpCredentialsGetTrust</a></h3>
3016 <p class="description">Return the trust of credentials.</p>
3017 <p class="code">
3018 <a href="#http_trust_t">http_trust_t</a> httpCredentialsGetTrust(cups_array_t *credentials, const char *common_name);</p>
3019 <h4 class="parameters">Parameters</h4>
3020 <table class="list"><tbody>
3021 <tr><th>credentials</th>
3022 <td class="description">Credentials</td></tr>
3023 <tr><th>common_name</th>
3024 <td class="description">Common name for trust lookup</td></tr>
3025 </tbody></table>
3026 <h4 class="returnvalue">Return Value</h4>
3027 <p class="description">Level of trust</p>
3028 <h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsString">httpCredentialsString</a></h3>
3029 <p class="description">Return a string representing the credentials.</p>
3030 <p class="code">
3031 size_t httpCredentialsString(cups_array_t *credentials, char *buffer, size_t bufsize);</p>
3032 <h4 class="parameters">Parameters</h4>
3033 <table class="list"><tbody>
3034 <tr><th>credentials</th>
3035 <td class="description">Credentials</td></tr>
3036 <tr><th>buffer</th>
3037 <td class="description">Buffer or <code>NULL</code></td></tr>
3038 <tr><th>bufsize</th>
3039 <td class="description">Size of buffer</td></tr>
3040 </tbody></table>
3041 <h4 class="returnvalue">Return Value</h4>
3042 <p class="description">Total size of credentials string</p>
3043 <h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="httpDecode64_2">httpDecode64_2</a></h3>
3044 <p class="description">Base64-decode a string.</p>
3045 <p class="code">
3046 char *httpDecode64_2(char *out, int *outlen, const char *in);</p>
3047 <h4 class="parameters">Parameters</h4>
3048 <table class="list"><tbody>
3049 <tr><th>out</th>
3050 <td class="description">String to write to</td></tr>
3051 <tr><th>outlen</th>
3052 <td class="description">Size of output string</td></tr>
3053 <tr><th>in</th>
3054 <td class="description">String to read from</td></tr>
3055 </tbody></table>
3056 <h4 class="returnvalue">Return Value</h4>
3057 <p class="description">Decoded string</p>
3058 <h4 class="discussion">Discussion</h4>
3059 <p class="discussion">The caller must initialize &quot;outlen&quot; to the maximum size of the decoded
3060 string before calling <code>httpDecode64_2</code>. On return &quot;outlen&quot; contains the
3061 decoded length of the string.
3062
3063 </p>
3064 <h3 class="function"><a id="httpDelete">httpDelete</a></h3>
3065 <p class="description">Send a DELETE request to the server.</p>
3066 <p class="code">
3067 int httpDelete(<a href="#http_t">http_t</a> *http, const char *uri);</p>
3068 <h4 class="parameters">Parameters</h4>
3069 <table class="list"><tbody>
3070 <tr><th>http</th>
3071 <td class="description">HTTP connection</td></tr>
3072 <tr><th>uri</th>
3073 <td class="description">URI to delete</td></tr>
3074 </tbody></table>
3075 <h4 class="returnvalue">Return Value</h4>
3076 <p class="description">Status of call (0 = success)</p>
3077 <h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="httpEncode64_2">httpEncode64_2</a></h3>
3078 <p class="description">Base64-encode a string.</p>
3079 <p class="code">
3080 char *httpEncode64_2(char *out, int outlen, const char *in, int inlen);</p>
3081 <h4 class="parameters">Parameters</h4>
3082 <table class="list"><tbody>
3083 <tr><th>out</th>
3084 <td class="description">String to write to</td></tr>
3085 <tr><th>outlen</th>
3086 <td class="description">Maximum size of output string</td></tr>
3087 <tr><th>in</th>
3088 <td class="description">String to read from</td></tr>
3089 <tr><th>inlen</th>
3090 <td class="description">Size of input string</td></tr>
3091 </tbody></table>
3092 <h4 class="returnvalue">Return Value</h4>
3093 <p class="description">Encoded string</p>
3094 <h3 class="function"><a id="httpEncryption">httpEncryption</a></h3>
3095 <p class="description">Set the required encryption on the link.</p>
3096 <p class="code">
3097 int httpEncryption(<a href="#http_t">http_t</a> *http, <a href="#http_encryption_t">http_encryption_t</a> e);</p>
3098 <h4 class="parameters">Parameters</h4>
3099 <table class="list"><tbody>
3100 <tr><th>http</th>
3101 <td class="description">HTTP connection</td></tr>
3102 <tr><th>e</th>
3103 <td class="description">New encryption preference</td></tr>
3104 </tbody></table>
3105 <h4 class="returnvalue">Return Value</h4>
3106 <p class="description">-1 on error, 0 on success</p>
3107 <h3 class="function"><a id="httpError">httpError</a></h3>
3108 <p class="description">Get the last error on a connection.</p>
3109 <p class="code">
3110 int httpError(<a href="#http_t">http_t</a> *http);</p>
3111 <h4 class="parameters">Parameters</h4>
3112 <table class="list"><tbody>
3113 <tr><th>http</th>
3114 <td class="description">HTTP connection</td></tr>
3115 </tbody></table>
3116 <h4 class="returnvalue">Return Value</h4>
3117 <p class="description">Error code (errno) value</p>
3118 <h3 class="function"><a id="httpFieldValue">httpFieldValue</a></h3>
3119 <p class="description">Return the HTTP field enumeration value for a field
3120 name.</p>
3121 <p class="code">
3122 <a href="#http_field_t">http_field_t</a> httpFieldValue(const char *name);</p>
3123 <h4 class="parameters">Parameters</h4>
3124 <table class="list"><tbody>
3125 <tr><th>name</th>
3126 <td class="description">String name</td></tr>
3127 </tbody></table>
3128 <h4 class="returnvalue">Return Value</h4>
3129 <p class="description">Field index</p>
3130 <h3 class="function"><a id="httpFlush">httpFlush</a></h3>
3131 <p class="description">Flush data read from a HTTP connection.</p>
3132 <p class="code">
3133 void httpFlush(<a href="#http_t">http_t</a> *http);</p>
3134 <h4 class="parameters">Parameters</h4>
3135 <table class="list"><tbody>
3136 <tr><th>http</th>
3137 <td class="description">HTTP connection</td></tr>
3138 </tbody></table>
3139 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpFlushWrite">httpFlushWrite</a></h3>
3140 <p class="description">Flush data written to a HTTP connection.</p>
3141 <p class="code">
3142 int httpFlushWrite(<a href="#http_t">http_t</a> *http);</p>
3143 <h4 class="parameters">Parameters</h4>
3144 <table class="list"><tbody>
3145 <tr><th>http</th>
3146 <td class="description">HTTP connection</td></tr>
3147 </tbody></table>
3148 <h4 class="returnvalue">Return Value</h4>
3149 <p class="description">Bytes written or -1 on error</p>
3150 <h3 class="function"><a id="httpFreeCredentials">httpFreeCredentials</a></h3>
3151 <p class="description">Free an array of credentials.</p>
3152 <p class="code">
3153 void httpFreeCredentials(cups_array_t *credentials);</p>
3154 <h4 class="parameters">Parameters</h4>
3155 <table class="list"><tbody>
3156 <tr><th>credentials</th>
3157 <td class="description">Array of credentials</td></tr>
3158 </tbody></table>
3159 <h3 class="function"><a id="httpGet">httpGet</a></h3>
3160 <p class="description">Send a GET request to the server.</p>
3161 <p class="code">
3162 int httpGet(<a href="#http_t">http_t</a> *http, const char *uri);</p>
3163 <h4 class="parameters">Parameters</h4>
3164 <table class="list"><tbody>
3165 <tr><th>http</th>
3166 <td class="description">HTTP connection</td></tr>
3167 <tr><th>uri</th>
3168 <td class="description">URI to get</td></tr>
3169 </tbody></table>
3170 <h4 class="returnvalue">Return Value</h4>
3171 <p class="description">Status of call (0 = success)</p>
3172 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetActivity">httpGetActivity</a></h3>
3173 <p class="description">Get the most recent activity for a connection.</p>
3174 <p class="code">
3175 time_t httpGetActivity(<a href="#http_t">http_t</a> *http);</p>
3176 <h4 class="parameters">Parameters</h4>
3177 <table class="list"><tbody>
3178 <tr><th>http</th>
3179 <td class="description">HTTP connection</td></tr>
3180 </tbody></table>
3181 <h4 class="returnvalue">Return Value</h4>
3182 <p class="description">Time of last read or write</p>
3183 <h4 class="discussion">Discussion</h4>
3184 <p class="discussion">The return value is the time in seconds of the last read or write.
3185
3186 </p>
3187 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetAddress">httpGetAddress</a></h3>
3188 <p class="description">Get the address of the connected peer of a connection.</p>
3189 <p class="code">
3190 <a href="#http_addr_t">http_addr_t</a> *httpGetAddress(<a href="#http_t">http_t</a> *http);</p>
3191 <h4 class="parameters">Parameters</h4>
3192 <table class="list"><tbody>
3193 <tr><th>http</th>
3194 <td class="description">HTTP connection</td></tr>
3195 </tbody></table>
3196 <h4 class="returnvalue">Return Value</h4>
3197 <p class="description">Connected address or <code>NULL</code></p>
3198 <h4 class="discussion">Discussion</h4>
3199 <p class="discussion">For connections created with <a href="#httpConnect2"><code>httpConnect2</code></a>, the address is for the
3200 server. For connections created with <a href="#httpAccept"><code>httpAccept</code></a>, the address is for
3201 the client.<br>
3202 <br>
3203 Returns <code>NULL</code> if the socket is currently unconnected.
3204
3205 </p>
3206 <h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="httpGetAuthString">httpGetAuthString</a></h3>
3207 <p class="description">Get the current authorization string.</p>
3208 <p class="code">
3209 char *httpGetAuthString(<a href="#http_t">http_t</a> *http);</p>
3210 <h4 class="parameters">Parameters</h4>
3211 <table class="list"><tbody>
3212 <tr><th>http</th>
3213 <td class="description">HTTP connection</td></tr>
3214 </tbody></table>
3215 <h4 class="returnvalue">Return Value</h4>
3216 <p class="description">Authorization string</p>
3217 <h4 class="discussion">Discussion</h4>
3218 <p class="discussion">The authorization string is set by <a href="#cupsDoAuthentication"><code>cupsDoAuthentication</code></a> and
3219 <a href="#httpSetAuthString"><code>httpSetAuthString</code></a>. Use <a href="#httpGetAuthString"><code>httpGetAuthString</code></a> to retrieve the
3220 string to use with <a href="#httpSetField"><code>httpSetField</code></a> for the
3221 <code>HTTP_FIELD_AUTHORIZATION</code> value.
3222
3223 </p>
3224 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetBlocking">httpGetBlocking</a></h3>
3225 <p class="description">Get the blocking/non-block state of a connection.</p>
3226 <p class="code">
3227 int httpGetBlocking(<a href="#http_t">http_t</a> *http);</p>
3228 <h4 class="parameters">Parameters</h4>
3229 <table class="list"><tbody>
3230 <tr><th>http</th>
3231 <td class="description">HTTP connection</td></tr>
3232 </tbody></table>
3233 <h4 class="returnvalue">Return Value</h4>
3234 <p class="description">1 if blocking, 0 if non-blocking</p>
3235 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpGetContentEncoding">httpGetContentEncoding</a></h3>
3236 <p class="description">Get a common content encoding, if any, between
3237 the client and server.</p>
3238 <p class="code">
3239 const char *httpGetContentEncoding(<a href="#http_t">http_t</a> *http);</p>
3240 <h4 class="parameters">Parameters</h4>
3241 <table class="list"><tbody>
3242 <tr><th>http</th>
3243 <td class="description">HTTP connection</td></tr>
3244 </tbody></table>
3245 <h4 class="returnvalue">Return Value</h4>
3246 <p class="description">Content-Coding value or
3247 <code>NULL</code> for the identity
3248 coding.</p>
3249 <h4 class="discussion">Discussion</h4>
3250 <p class="discussion">This function uses the value of the Accepts-Encoding HTTP header and must be
3251 called after receiving a response from the server or a request from the
3252 client. The value returned can be use in subsequent requests (for clients)
3253 or in the response (for servers) in order to compress the content stream.
3254
3255 </p>
3256 <h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpGetCookie">httpGetCookie</a></h3>
3257 <p class="description">Get any cookie data from the response.</p>
3258 <p class="code">
3259 const char *httpGetCookie(<a href="#http_t">http_t</a> *http);</p>
3260 <h4 class="parameters">Parameters</h4>
3261 <table class="list"><tbody>
3262 <tr><th>http</th>
3263 <td class="description">HTTP connection</td></tr>
3264 </tbody></table>
3265 <h4 class="returnvalue">Return Value</h4>
3266 <p class="description">Cookie data or <code>NULL</code></p>
3267 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetDateString2">httpGetDateString2</a></h3>
3268 <p class="description">Get a formatted date/time string from a time value.</p>
3269 <p class="code">
3270 const char *httpGetDateString2(time_t t, char *s, int slen);</p>
3271 <h4 class="parameters">Parameters</h4>
3272 <table class="list"><tbody>
3273 <tr><th>t</th>
3274 <td class="description">Time in seconds</td></tr>
3275 <tr><th>s</th>
3276 <td class="description">String buffer</td></tr>
3277 <tr><th>slen</th>
3278 <td class="description">Size of string buffer</td></tr>
3279 </tbody></table>
3280 <h4 class="returnvalue">Return Value</h4>
3281 <p class="description">Date/time string</p>
3282 <h3 class="function"><a id="httpGetDateTime">httpGetDateTime</a></h3>
3283 <p class="description">Get a time value from a formatted date/time string.</p>
3284 <p class="code">
3285 time_t httpGetDateTime(const char *s);</p>
3286 <h4 class="parameters">Parameters</h4>
3287 <table class="list"><tbody>
3288 <tr><th>s</th>
3289 <td class="description">Date/time string</td></tr>
3290 </tbody></table>
3291 <h4 class="returnvalue">Return Value</h4>
3292 <p class="description">Time in seconds</p>
3293 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetEncryption">httpGetEncryption</a></h3>
3294 <p class="description">Get the current encryption mode of a connection.</p>
3295 <p class="code">
3296 <a href="#http_encryption_t">http_encryption_t</a> httpGetEncryption(<a href="#http_t">http_t</a> *http);</p>
3297 <h4 class="parameters">Parameters</h4>
3298 <table class="list"><tbody>
3299 <tr><th>http</th>
3300 <td class="description">HTTP connection</td></tr>
3301 </tbody></table>
3302 <h4 class="returnvalue">Return Value</h4>
3303 <p class="description">Current encryption mode</p>
3304 <h4 class="discussion">Discussion</h4>
3305 <p class="discussion">This function returns the encryption mode for the connection. Use the
3306 <a href="#httpIsEncrypted"><code>httpIsEncrypted</code></a> function to determine whether a TLS session has
3307 been established.
3308
3309 </p>
3310 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpGetExpect">httpGetExpect</a></h3>
3311 <p class="description">Get the value of the Expect header, if any.</p>
3312 <p class="code">
3313 http_status_t httpGetExpect(<a href="#http_t">http_t</a> *http);</p>
3314 <h4 class="parameters">Parameters</h4>
3315 <table class="list"><tbody>
3316 <tr><th>http</th>
3317 <td class="description">HTTP connection</td></tr>
3318 </tbody></table>
3319 <h4 class="returnvalue">Return Value</h4>
3320 <p class="description">Expect: status, if any</p>
3321 <h4 class="discussion">Discussion</h4>
3322 <p class="discussion">Returns <code>HTTP_STATUS_NONE</code> if there is no Expect header, otherwise
3323 returns the expected HTTP status code, typically <code>HTTP_STATUS_CONTINUE</code>.
3324
3325 </p>
3326 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetFd">httpGetFd</a></h3>
3327 <p class="description">Get the file descriptor associated with a connection.</p>
3328 <p class="code">
3329 int httpGetFd(<a href="#http_t">http_t</a> *http);</p>
3330 <h4 class="parameters">Parameters</h4>
3331 <table class="list"><tbody>
3332 <tr><th>http</th>
3333 <td class="description">HTTP connection</td></tr>
3334 </tbody></table>
3335 <h4 class="returnvalue">Return Value</h4>
3336 <p class="description">File descriptor or -1 if none</p>
3337 <h3 class="function"><a id="httpGetField">httpGetField</a></h3>
3338 <p class="description">Get a field value from a request/response.</p>
3339 <p class="code">
3340 const char *httpGetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field);</p>
3341 <h4 class="parameters">Parameters</h4>
3342 <table class="list"><tbody>
3343 <tr><th>http</th>
3344 <td class="description">HTTP connection</td></tr>
3345 <tr><th>field</th>
3346 <td class="description">Field to get</td></tr>
3347 </tbody></table>
3348 <h4 class="returnvalue">Return Value</h4>
3349 <p class="description">Field value</p>
3350 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetHostname">httpGetHostname</a></h3>
3351 <p class="description">Get the FQDN for the connection or local system.</p>
3352 <p class="code">
3353 const char *httpGetHostname(<a href="#http_t">http_t</a> *http, char *s, int slen);</p>
3354 <h4 class="parameters">Parameters</h4>
3355 <table class="list"><tbody>
3356 <tr><th>http</th>
3357 <td class="description">HTTP connection or NULL</td></tr>
3358 <tr><th>s</th>
3359 <td class="description">String buffer for name</td></tr>
3360 <tr><th>slen</th>
3361 <td class="description">Size of buffer</td></tr>
3362 </tbody></table>
3363 <h4 class="returnvalue">Return Value</h4>
3364 <p class="description">FQDN for connection or system</p>
3365 <h4 class="discussion">Discussion</h4>
3366 <p class="discussion">When &quot;http&quot; points to a connected socket, return the hostname or
3367 address that was used in the call to httpConnect() or httpConnectEncrypt(),
3368 or the address of the client for the connection from httpAcceptConnection().
3369 Otherwise, return the FQDN for the local system using both gethostname()
3370 and gethostbyname() to get the local hostname with domain.
3371
3372 </p>
3373 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetKeepAlive">httpGetKeepAlive</a></h3>
3374 <p class="description">Get the current Keep-Alive state of the connection.</p>
3375 <p class="code">
3376 <a href="#http_keepalive_t">http_keepalive_t</a> httpGetKeepAlive(<a href="#http_t">http_t</a> *http);</p>
3377 <h4 class="parameters">Parameters</h4>
3378 <table class="list"><tbody>
3379 <tr><th>http</th>
3380 <td class="description">HTTP connection</td></tr>
3381 </tbody></table>
3382 <h4 class="returnvalue">Return Value</h4>
3383 <p class="description">Keep-Alive state</p>
3384 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetLength2">httpGetLength2</a></h3>
3385 <p class="description">Get the amount of data remaining from the
3386 content-length or transfer-encoding fields.</p>
3387 <p class="code">
3388 off_t httpGetLength2(<a href="#http_t">http_t</a> *http);</p>
3389 <h4 class="parameters">Parameters</h4>
3390 <table class="list"><tbody>
3391 <tr><th>http</th>
3392 <td class="description">HTTP connection</td></tr>
3393 </tbody></table>
3394 <h4 class="returnvalue">Return Value</h4>
3395 <p class="description">Content length</p>
3396 <h4 class="discussion">Discussion</h4>
3397 <p class="discussion">This function returns the complete content length, even for
3398 content larger than 2^31 - 1.
3399
3400 </p>
3401 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetPending">httpGetPending</a></h3>
3402 <p class="description">Get the number of bytes that are buffered for writing.</p>
3403 <p class="code">
3404 size_t httpGetPending(<a href="#http_t">http_t</a> *http);</p>
3405 <h4 class="parameters">Parameters</h4>
3406 <table class="list"><tbody>
3407 <tr><th>http</th>
3408 <td class="description">HTTP connection</td></tr>
3409 </tbody></table>
3410 <h4 class="returnvalue">Return Value</h4>
3411 <p class="description">Number of bytes buffered</p>
3412 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetReady">httpGetReady</a></h3>
3413 <p class="description">Get the number of bytes that can be read without blocking.</p>
3414 <p class="code">
3415 size_t httpGetReady(<a href="#http_t">http_t</a> *http);</p>
3416 <h4 class="parameters">Parameters</h4>
3417 <table class="list"><tbody>
3418 <tr><th>http</th>
3419 <td class="description">HTTP connection</td></tr>
3420 </tbody></table>
3421 <h4 class="returnvalue">Return Value</h4>
3422 <p class="description">Number of bytes available</p>
3423 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetRemaining">httpGetRemaining</a></h3>
3424 <p class="description">Get the number of remaining bytes in the message
3425 body or current chunk.</p>
3426 <p class="code">
3427 size_t httpGetRemaining(<a href="#http_t">http_t</a> *http);</p>
3428 <h4 class="parameters">Parameters</h4>
3429 <table class="list"><tbody>
3430 <tr><th>http</th>
3431 <td class="description">HTTP connection</td></tr>
3432 </tbody></table>
3433 <h4 class="returnvalue">Return Value</h4>
3434 <p class="description">Remaining bytes</p>
3435 <h4 class="discussion">Discussion</h4>
3436 <p class="discussion">The <a href="#httpIsChunked"><code>httpIsChunked</code></a> function can be used to determine whether the
3437 message body is chunked or fixed-length.
3438
3439 </p>
3440 <h3 class="function"><a id="httpGetState">httpGetState</a></h3>
3441 <p class="description">Get the current state of the HTTP request.</p>
3442 <p class="code">
3443 <a href="#http_state_t">http_state_t</a> httpGetState(<a href="#http_t">http_t</a> *http);</p>
3444 <h4 class="parameters">Parameters</h4>
3445 <table class="list"><tbody>
3446 <tr><th>http</th>
3447 <td class="description">HTTP connection</td></tr>
3448 </tbody></table>
3449 <h4 class="returnvalue">Return Value</h4>
3450 <p class="description">HTTP state</p>
3451 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetStatus">httpGetStatus</a></h3>
3452 <p class="description">Get the status of the last HTTP request.</p>
3453 <p class="code">
3454 http_status_t httpGetStatus(<a href="#http_t">http_t</a> *http);</p>
3455 <h4 class="parameters">Parameters</h4>
3456 <table class="list"><tbody>
3457 <tr><th>http</th>
3458 <td class="description">HTTP connection</td></tr>
3459 </tbody></table>
3460 <h4 class="returnvalue">Return Value</h4>
3461 <p class="description">HTTP status</p>
3462 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetSubField2">httpGetSubField2</a></h3>
3463 <p class="description">Get a sub-field value.</p>
3464 <p class="code">
3465 char *httpGetSubField2(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *name, char *value, int valuelen);</p>
3466 <h4 class="parameters">Parameters</h4>
3467 <table class="list"><tbody>
3468 <tr><th>http</th>
3469 <td class="description">HTTP connection</td></tr>
3470 <tr><th>field</th>
3471 <td class="description">Field index</td></tr>
3472 <tr><th>name</th>
3473 <td class="description">Name of sub-field</td></tr>
3474 <tr><th>value</th>
3475 <td class="description">Value string</td></tr>
3476 <tr><th>valuelen</th>
3477 <td class="description">Size of value buffer</td></tr>
3478 </tbody></table>
3479 <h4 class="returnvalue">Return Value</h4>
3480 <p class="description">Value or <code>NULL</code></p>
3481 <h3 class="function"><a id="httpGetVersion">httpGetVersion</a></h3>
3482 <p class="description">Get the HTTP version at the other end.</p>
3483 <p class="code">
3484 <a href="#http_version_t">http_version_t</a> httpGetVersion(<a href="#http_t">http_t</a> *http);</p>
3485 <h4 class="parameters">Parameters</h4>
3486 <table class="list"><tbody>
3487 <tr><th>http</th>
3488 <td class="description">HTTP connection</td></tr>
3489 </tbody></table>
3490 <h4 class="returnvalue">Return Value</h4>
3491 <p class="description">Version number</p>
3492 <h3 class="function"><a id="httpGets">httpGets</a></h3>
3493 <p class="description">Get a line of text from a HTTP connection.</p>
3494 <p class="code">
3495 char *httpGets(char *line, int length, <a href="#http_t">http_t</a> *http);</p>
3496 <h4 class="parameters">Parameters</h4>
3497 <table class="list"><tbody>
3498 <tr><th>line</th>
3499 <td class="description">Line to read into</td></tr>
3500 <tr><th>length</th>
3501 <td class="description">Max length of buffer</td></tr>
3502 <tr><th>http</th>
3503 <td class="description">HTTP connection</td></tr>
3504 </tbody></table>
3505 <h4 class="returnvalue">Return Value</h4>
3506 <p class="description">Line or <code>NULL</code></p>
3507 <h3 class="function"><a id="httpHead">httpHead</a></h3>
3508 <p class="description">Send a HEAD request to the server.</p>
3509 <p class="code">
3510 int httpHead(<a href="#http_t">http_t</a> *http, const char *uri);</p>
3511 <h4 class="parameters">Parameters</h4>
3512 <table class="list"><tbody>
3513 <tr><th>http</th>
3514 <td class="description">HTTP connection</td></tr>
3515 <tr><th>uri</th>
3516 <td class="description">URI for head</td></tr>
3517 </tbody></table>
3518 <h4 class="returnvalue">Return Value</h4>
3519 <p class="description">Status of call (0 = success)</p>
3520 <h3 class="function"><a id="httpInitialize">httpInitialize</a></h3>
3521 <p class="description">Initialize the HTTP interface library and set the
3522 default HTTP proxy (if any).</p>
3523 <p class="code">
3524 void httpInitialize(void);</p>
3525 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpIsChunked">httpIsChunked</a></h3>
3526 <p class="description">Report whether a message body is chunked.</p>
3527 <p class="code">
3528 int httpIsChunked(<a href="#http_t">http_t</a> *http);</p>
3529 <h4 class="parameters">Parameters</h4>
3530 <table class="list"><tbody>
3531 <tr><th>http</th>
3532 <td class="description">HTTP connection</td></tr>
3533 </tbody></table>
3534 <h4 class="returnvalue">Return Value</h4>
3535 <p class="description">1 if chunked, 0 if not</p>
3536 <h4 class="discussion">Discussion</h4>
3537 <p class="discussion">This function returns non-zero if the message body is composed of
3538 variable-length chunks.
3539
3540 </p>
3541 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpIsEncrypted">httpIsEncrypted</a></h3>
3542 <p class="description">Report whether a connection is encrypted.</p>
3543 <p class="code">
3544 int httpIsEncrypted(<a href="#http_t">http_t</a> *http);</p>
3545 <h4 class="parameters">Parameters</h4>
3546 <table class="list"><tbody>
3547 <tr><th>http</th>
3548 <td class="description">HTTP connection</td></tr>
3549 </tbody></table>
3550 <h4 class="returnvalue">Return Value</h4>
3551 <p class="description">1 if encrypted, 0 if not</p>
3552 <h4 class="discussion">Discussion</h4>
3553 <p class="discussion">This function returns non-zero if the connection is currently encrypted.
3554
3555 </p>
3556 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpLoadCredentials">httpLoadCredentials</a></h3>
3557 <p class="description">Load X.509 credentials from a keychain file.</p>
3558 <p class="code">
3559 int httpLoadCredentials(const char *path, cups_array_t **credentials, const char *common_name);</p>
3560 <h4 class="parameters">Parameters</h4>
3561 <table class="list"><tbody>
3562 <tr><th>path</th>
3563 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
3564 <tr><th>credentials</th>
3565 <td class="description">Credentials</td></tr>
3566 <tr><th>common_name</th>
3567 <td class="description">Common name for credentials</td></tr>
3568 </tbody></table>
3569 <h4 class="returnvalue">Return Value</h4>
3570 <p class="description">0 on success, -1 on error</p>
3571 <h3 class="function"><a id="httpOptions">httpOptions</a></h3>
3572 <p class="description">Send an OPTIONS request to the server.</p>
3573 <p class="code">
3574 int httpOptions(<a href="#http_t">http_t</a> *http, const char *uri);</p>
3575 <h4 class="parameters">Parameters</h4>
3576 <table class="list"><tbody>
3577 <tr><th>http</th>
3578 <td class="description">HTTP connection</td></tr>
3579 <tr><th>uri</th>
3580 <td class="description">URI for options</td></tr>
3581 </tbody></table>
3582 <h4 class="returnvalue">Return Value</h4>
3583 <p class="description">Status of call (0 = success)</p>
3584 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpPeek">httpPeek</a></h3>
3585 <p class="description">Peek at data from a HTTP connection.</p>
3586 <p class="code">
3587 ssize_t httpPeek(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p>
3588 <h4 class="parameters">Parameters</h4>
3589 <table class="list"><tbody>
3590 <tr><th>http</th>
3591 <td class="description">HTTP connection</td></tr>
3592 <tr><th>buffer</th>
3593 <td class="description">Buffer for data</td></tr>
3594 <tr><th>length</th>
3595 <td class="description">Maximum number of bytes</td></tr>
3596 </tbody></table>
3597 <h4 class="returnvalue">Return Value</h4>
3598 <p class="description">Number of bytes copied</p>
3599 <h4 class="discussion">Discussion</h4>
3600 <p class="discussion">This function copies available data from the given HTTP connection, reading
3601 a buffer as needed. The data is still available for reading using
3602 <a href="#httpRead2"><code>httpRead2</code></a>.<br>
3603 <br>
3604 For non-blocking connections the usual timeouts apply.
3605
3606 </p>
3607 <h3 class="function"><a id="httpPost">httpPost</a></h3>
3608 <p class="description">Send a POST request to the server.</p>
3609 <p class="code">
3610 int httpPost(<a href="#http_t">http_t</a> *http, const char *uri);</p>
3611 <h4 class="parameters">Parameters</h4>
3612 <table class="list"><tbody>
3613 <tr><th>http</th>
3614 <td class="description">HTTP connection</td></tr>
3615 <tr><th>uri</th>
3616 <td class="description">URI for post</td></tr>
3617 </tbody></table>
3618 <h4 class="returnvalue">Return Value</h4>
3619 <p class="description">Status of call (0 = success)</p>
3620 <h3 class="function"><a id="httpPut">httpPut</a></h3>
3621 <p class="description">Send a PUT request to the server.</p>
3622 <p class="code">
3623 int httpPut(<a href="#http_t">http_t</a> *http, const char *uri);</p>
3624 <h4 class="parameters">Parameters</h4>
3625 <table class="list"><tbody>
3626 <tr><th>http</th>
3627 <td class="description">HTTP connection</td></tr>
3628 <tr><th>uri</th>
3629 <td class="description">URI to put</td></tr>
3630 </tbody></table>
3631 <h4 class="returnvalue">Return Value</h4>
3632 <p class="description">Status of call (0 = success)</p>
3633 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpRead2">httpRead2</a></h3>
3634 <p class="description">Read data from a HTTP connection.</p>
3635 <p class="code">
3636 ssize_t httpRead2(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p>
3637 <h4 class="parameters">Parameters</h4>
3638 <table class="list"><tbody>
3639 <tr><th>http</th>
3640 <td class="description">HTTP connection</td></tr>
3641 <tr><th>buffer</th>
3642 <td class="description">Buffer for data</td></tr>
3643 <tr><th>length</th>
3644 <td class="description">Maximum number of bytes</td></tr>
3645 </tbody></table>
3646 <h4 class="returnvalue">Return Value</h4>
3647 <p class="description">Number of bytes read</p>
3648 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpReadRequest">httpReadRequest</a></h3>
3649 <p class="description">Read a HTTP request from a connection.</p>
3650 <p class="code">
3651 <a href="#http_state_t">http_state_t</a> httpReadRequest(<a href="#http_t">http_t</a> *http, char *uri, size_t urilen);</p>
3652 <h4 class="parameters">Parameters</h4>
3653 <table class="list"><tbody>
3654 <tr><th>http</th>
3655 <td class="description">HTTP connection</td></tr>
3656 <tr><th>uri</th>
3657 <td class="description">URI buffer</td></tr>
3658 <tr><th>urilen</th>
3659 <td class="description">Size of URI buffer</td></tr>
3660 </tbody></table>
3661 <h4 class="returnvalue">Return Value</h4>
3662 <p class="description">New state of connection</p>
3663 <h3 class="function"><a id="httpReconnect2">httpReconnect2</a></h3>
3664 <p class="description">Reconnect to a HTTP server with timeout and optional
3665 cancel.</p>
3666 <p class="code">
3667 int httpReconnect2(<a href="#http_t">http_t</a> *http, int msec, int *cancel);</p>
3668 <h4 class="parameters">Parameters</h4>
3669 <table class="list"><tbody>
3670 <tr><th>http</th>
3671 <td class="description">HTTP connection</td></tr>
3672 <tr><th>msec</th>
3673 <td class="description">Timeout in milliseconds</td></tr>
3674 <tr><th>cancel</th>
3675 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
3676 </tbody></table>
3677 <h4 class="returnvalue">Return Value</h4>
3678 <p class="description">0 on success, non-zero on failure</p>
3679 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpResolveHostname">httpResolveHostname</a></h3>
3680 <p class="description">Resolve the hostname of the HTTP connection
3681 address.</p>
3682 <p class="code">
3683 const char *httpResolveHostname(<a href="#http_t">http_t</a> *http, char *buffer, size_t bufsize);</p>
3684 <h4 class="parameters">Parameters</h4>
3685 <table class="list"><tbody>
3686 <tr><th>http</th>
3687 <td class="description">HTTP connection</td></tr>
3688 <tr><th>buffer</th>
3689 <td class="description">Hostname buffer</td></tr>
3690 <tr><th>bufsize</th>
3691 <td class="description">Size of buffer</td></tr>
3692 </tbody></table>
3693 <h4 class="returnvalue">Return Value</h4>
3694 <p class="description">Resolved hostname or <code>NULL</code></p>
3695 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpSaveCredentials">httpSaveCredentials</a></h3>
3696 <p class="description">Save X.509 credentials to a keychain file.</p>
3697 <p class="code">
3698 int httpSaveCredentials(const char *path, cups_array_t *credentials, const char *common_name);</p>
3699 <h4 class="parameters">Parameters</h4>
3700 <table class="list"><tbody>
3701 <tr><th>path</th>
3702 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
3703 <tr><th>credentials</th>
3704 <td class="description">Credentials</td></tr>
3705 <tr><th>common_name</th>
3706 <td class="description">Common name for credentials</td></tr>
3707 </tbody></table>
3708 <h4 class="returnvalue">Return Value</h4>
3709 <p class="description">-1 on error, 0 on success</p>
3710 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSeparateURI">httpSeparateURI</a></h3>
3711 <p class="description">Separate a Universal Resource Identifier into its
3712 components.</p>
3713 <p class="code">
3714 <a href="#http_uri_status_t">http_uri_status_t</a> httpSeparateURI(<a href="#http_uri_coding_t">http_uri_coding_t</a> decoding, const char *uri, char *scheme, int schemelen, char *username, int usernamelen, char *host, int hostlen, int *port, char *resource, int resourcelen);</p>
3715 <h4 class="parameters">Parameters</h4>
3716 <table class="list"><tbody>
3717 <tr><th>decoding</th>
3718 <td class="description">Decoding flags</td></tr>
3719 <tr><th>uri</th>
3720 <td class="description">Universal Resource Identifier</td></tr>
3721 <tr><th>scheme</th>
3722 <td class="description">Scheme (http, https, etc.)</td></tr>
3723 <tr><th>schemelen</th>
3724 <td class="description">Size of scheme buffer</td></tr>
3725 <tr><th>username</th>
3726 <td class="description">Username</td></tr>
3727 <tr><th>usernamelen</th>
3728 <td class="description">Size of username buffer</td></tr>
3729 <tr><th>host</th>
3730 <td class="description">Hostname</td></tr>
3731 <tr><th>hostlen</th>
3732 <td class="description">Size of hostname buffer</td></tr>
3733 <tr><th>port</th>
3734 <td class="description">Port number to use</td></tr>
3735 <tr><th>resource</th>
3736 <td class="description">Resource/filename</td></tr>
3737 <tr><th>resourcelen</th>
3738 <td class="description">Size of resource buffer</td></tr>
3739 </tbody></table>
3740 <h4 class="returnvalue">Return Value</h4>
3741 <p class="description">Result of separation</p>
3742 <h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="httpSetAuthString">httpSetAuthString</a></h3>
3743 <p class="description">Set the current authorization string.</p>
3744 <p class="code">
3745 void httpSetAuthString(<a href="#http_t">http_t</a> *http, const char *scheme, const char *data);</p>
3746 <h4 class="parameters">Parameters</h4>
3747 <table class="list"><tbody>
3748 <tr><th>http</th>
3749 <td class="description">HTTP connection</td></tr>
3750 <tr><th>scheme</th>
3751 <td class="description">Auth scheme (NULL to clear it)</td></tr>
3752 <tr><th>data</th>
3753 <td class="description">Auth data (NULL for none)</td></tr>
3754 </tbody></table>
3755 <h4 class="discussion">Discussion</h4>
3756 <p class="discussion">This function just stores a copy of the current authorization string in
3757 the HTTP connection object. You must still call <a href="#httpSetField"><code>httpSetField</code></a> to set
3758 <code>HTTP_FIELD_AUTHORIZATION</code> prior to issuing a HTTP request using
3759 <a href="#httpGet"><code>httpGet</code></a>, <a href="#httpHead"><code>httpHead</code></a>, <a href="#httpOptions"><code>httpOptions</code></a>, <a href="#httpPost"><code>httpPost</code></a>, or
3760 <a href="#httpPut"><code>httpPut</code></a>.
3761
3762 </p>
3763 <h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpSetCookie">httpSetCookie</a></h3>
3764 <p class="description">Set the cookie value(s).</p>
3765 <p class="code">
3766 void httpSetCookie(<a href="#http_t">http_t</a> *http, const char *cookie);</p>
3767 <h4 class="parameters">Parameters</h4>
3768 <table class="list"><tbody>
3769 <tr><th>http</th>
3770 <td class="description">Connection</td></tr>
3771 <tr><th>cookie</th>
3772 <td class="description">Cookie string</td></tr>
3773 </tbody></table>
3774 <h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpSetCredentials">httpSetCredentials</a></h3>
3775 <p class="description">Set the credentials associated with an encrypted
3776 connection.</p>
3777 <p class="code">
3778 int httpSetCredentials(<a href="#http_t">http_t</a> *http, cups_array_t *credentials);</p>
3779 <h4 class="parameters">Parameters</h4>
3780 <table class="list"><tbody>
3781 <tr><th>http</th>
3782 <td class="description">HTTP connection</td></tr>
3783 <tr><th>credentials</th>
3784 <td class="description">Array of credentials</td></tr>
3785 </tbody></table>
3786 <h4 class="returnvalue">Return Value</h4>
3787 <p class="description">Status of call (0 = success)</p>
3788 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpSetDefaultField">httpSetDefaultField</a></h3>
3789 <p class="description">Set the default value of an HTTP header.</p>
3790 <p class="code">
3791 void httpSetDefaultField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p>
3792 <h4 class="parameters">Parameters</h4>
3793 <table class="list"><tbody>
3794 <tr><th>http</th>
3795 <td class="description">HTTP connection</td></tr>
3796 <tr><th>field</th>
3797 <td class="description">Field index</td></tr>
3798 <tr><th>value</th>
3799 <td class="description">Value</td></tr>
3800 </tbody></table>
3801 <h4 class="discussion">Discussion</h4>
3802 <p class="discussion">Currently only <code>HTTP_FIELD_ACCEPT_ENCODING</code>, <code>HTTP_FIELD_SERVER</code>,
3803 and <code>HTTP_FIELD_USER_AGENT</code> can be set.
3804
3805 </p>
3806 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSetExpect">httpSetExpect</a></h3>
3807 <p class="description">Set the Expect: header in a request.</p>
3808 <p class="code">
3809 void httpSetExpect(<a href="#http_t">http_t</a> *http, http_status_t expect);</p>
3810 <h4 class="parameters">Parameters</h4>
3811 <table class="list"><tbody>
3812 <tr><th>http</th>
3813 <td class="description">HTTP connection</td></tr>
3814 <tr><th>expect</th>
3815 <td class="description">HTTP status to expect
3816 (<code>HTTP_STATUS_CONTINUE</code>)</td></tr>
3817 </tbody></table>
3818 <h4 class="discussion">Discussion</h4>
3819 <p class="discussion">Currently only <code>HTTP_STATUS_CONTINUE</code> is supported for the &quot;expect&quot;
3820 argument.
3821
3822 </p>
3823 <h3 class="function"><a id="httpSetField">httpSetField</a></h3>
3824 <p class="description">Set the value of an HTTP header.</p>
3825 <p class="code">
3826 void httpSetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p>
3827 <h4 class="parameters">Parameters</h4>
3828 <table class="list"><tbody>
3829 <tr><th>http</th>
3830 <td class="description">HTTP connection</td></tr>
3831 <tr><th>field</th>
3832 <td class="description">Field index</td></tr>
3833 <tr><th>value</th>
3834 <td class="description">Value</td></tr>
3835 </tbody></table>
3836 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpSetKeepAlive">httpSetKeepAlive</a></h3>
3837 <p class="description">Set the current Keep-Alive state of a connection.</p>
3838 <p class="code">
3839 void httpSetKeepAlive(<a href="#http_t">http_t</a> *http, <a href="#http_keepalive_t">http_keepalive_t</a> keep_alive);</p>
3840 <h4 class="parameters">Parameters</h4>
3841 <table class="list"><tbody>
3842 <tr><th>http</th>
3843 <td class="description">HTTP connection</td></tr>
3844 <tr><th>keep_alive</th>
3845 <td class="description">New Keep-Alive value</td></tr>
3846 </tbody></table>
3847 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSetLength">httpSetLength</a></h3>
3848 <p class="description">Set the content-length and content-encoding.</p>
3849 <p class="code">
3850 void httpSetLength(<a href="#http_t">http_t</a> *http, size_t length);</p>
3851 <h4 class="parameters">Parameters</h4>
3852 <table class="list"><tbody>
3853 <tr><th>http</th>
3854 <td class="description">HTTP connection</td></tr>
3855 <tr><th>length</th>
3856 <td class="description">Length (0 for chunked)</td></tr>
3857 </tbody></table>
3858 <h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpSetTimeout">httpSetTimeout</a></h3>
3859 <p class="description">Set read/write timeouts and an optional callback.</p>
3860 <p class="code">
3861 void httpSetTimeout(<a href="#http_t">http_t</a> *http, double timeout, <a href="#http_timeout_cb_t">http_timeout_cb_t</a> cb, void *user_data);</p>
3862 <h4 class="parameters">Parameters</h4>
3863 <table class="list"><tbody>
3864 <tr><th>http</th>
3865 <td class="description">HTTP connection</td></tr>
3866 <tr><th>timeout</th>
3867 <td class="description">Number of seconds for timeout,
3868 must be greater than 0</td></tr>
3869 <tr><th>cb</th>
3870 <td class="description">Callback function or <code>NULL</code></td></tr>
3871 <tr><th>user_data</th>
3872 <td class="description">User data pointer</td></tr>
3873 </tbody></table>
3874 <h4 class="discussion">Discussion</h4>
3875 <p class="discussion">The optional timeout callback receives both the HTTP connection and a user
3876 data pointer and must return 1 to continue or 0 to error (time) out.
3877
3878 </p>
3879 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpShutdown">httpShutdown</a></h3>
3880 <p class="description">Shutdown one side of an HTTP connection.</p>
3881 <p class="code">
3882 void httpShutdown(<a href="#http_t">http_t</a> *http);</p>
3883 <h4 class="parameters">Parameters</h4>
3884 <table class="list"><tbody>
3885 <tr><th>http</th>
3886 <td class="description">HTTP connection</td></tr>
3887 </tbody></table>
3888 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpStateString">httpStateString</a></h3>
3889 <p class="description">Return the string describing a HTTP state value.</p>
3890 <p class="code">
3891 const char *httpStateString(<a href="#http_state_t">http_state_t</a> state);</p>
3892 <h4 class="parameters">Parameters</h4>
3893 <table class="list"><tbody>
3894 <tr><th>state</th>
3895 <td class="description">HTTP state value</td></tr>
3896 </tbody></table>
3897 <h4 class="returnvalue">Return Value</h4>
3898 <p class="description">State string</p>
3899 <h3 class="function"><a id="httpStatus">httpStatus</a></h3>
3900 <p class="description">Return a short string describing a HTTP status code.</p>
3901 <p class="code">
3902 const char *httpStatus(http_status_t status);</p>
3903 <h4 class="parameters">Parameters</h4>
3904 <table class="list"><tbody>
3905 <tr><th>status</th>
3906 <td class="description">HTTP status code</td></tr>
3907 </tbody></table>
3908 <h4 class="returnvalue">Return Value</h4>
3909 <p class="description">Localized status string</p>
3910 <h4 class="discussion">Discussion</h4>
3911 <p class="discussion">The returned string is localized to the current POSIX locale and is based
3912 on the status strings defined in RFC 7231.</p>
3913 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpURIStatusString">httpURIStatusString</a></h3>
3914 <p class="description">Return a string describing a URI status code.</p>
3915 <p class="code">
3916 const char *httpURIStatusString(<a href="#http_uri_status_t">http_uri_status_t</a> status);</p>
3917 <h4 class="parameters">Parameters</h4>
3918 <table class="list"><tbody>
3919 <tr><th>status</th>
3920 <td class="description">URI status code</td></tr>
3921 </tbody></table>
3922 <h4 class="returnvalue">Return Value</h4>
3923 <p class="description">Localized status string</p>
3924 <h3 class="function"><a id="httpUpdate">httpUpdate</a></h3>
3925 <p class="description">Update the current HTTP state for incoming data.</p>
3926 <p class="code">
3927 http_status_t httpUpdate(<a href="#http_t">http_t</a> *http);</p>
3928 <h4 class="parameters">Parameters</h4>
3929 <table class="list"><tbody>
3930 <tr><th>http</th>
3931 <td class="description">HTTP connection</td></tr>
3932 </tbody></table>
3933 <h4 class="returnvalue">Return Value</h4>
3934 <p class="description">HTTP status</p>
3935 <h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpWait">httpWait</a></h3>
3936 <p class="description">Wait for data available on a connection.</p>
3937 <p class="code">
3938 int httpWait(<a href="#http_t">http_t</a> *http, int msec);</p>
3939 <h4 class="parameters">Parameters</h4>
3940 <table class="list"><tbody>
3941 <tr><th>http</th>
3942 <td class="description">HTTP connection</td></tr>
3943 <tr><th>msec</th>
3944 <td class="description">Milliseconds to wait</td></tr>
3945 </tbody></table>
3946 <h4 class="returnvalue">Return Value</h4>
3947 <p class="description">1 if data is available, 0 otherwise</p>
3948 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpWrite2">httpWrite2</a></h3>
3949 <p class="description">Write data to a HTTP connection.</p>
3950 <p class="code">
3951 ssize_t httpWrite2(<a href="#http_t">http_t</a> *http, const char *buffer, size_t length);</p>
3952 <h4 class="parameters">Parameters</h4>
3953 <table class="list"><tbody>
3954 <tr><th>http</th>
3955 <td class="description">HTTP connection</td></tr>
3956 <tr><th>buffer</th>
3957 <td class="description">Buffer for data</td></tr>
3958 <tr><th>length</th>
3959 <td class="description">Number of bytes to write</td></tr>
3960 </tbody></table>
3961 <h4 class="returnvalue">Return Value</h4>
3962 <p class="description">Number of bytes written</p>
3963 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpWriteResponse">httpWriteResponse</a></h3>
3964 <p class="description">Write a HTTP response to a client connection.</p>
3965 <p class="code">
3966 int httpWriteResponse(<a href="#http_t">http_t</a> *http, http_status_t status);</p>
3967 <h4 class="parameters">Parameters</h4>
3968 <table class="list"><tbody>
3969 <tr><th>http</th>
3970 <td class="description">HTTP connection</td></tr>
3971 <tr><th>status</th>
3972 <td class="description">Status code</td></tr>
3973 </tbody></table>
3974 <h4 class="returnvalue">Return Value</h4>
3975 <p class="description">0 on success, -1 on error</p>
3976 <h3 class="function"><a id="ippAddBoolean">ippAddBoolean</a></h3>
3977 <p class="description">Add a boolean attribute to an IPP message.</p>
3978 <p class="code">
3979 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBoolean(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, char value);</p>
3980 <h4 class="parameters">Parameters</h4>
3981 <table class="list"><tbody>
3982 <tr><th>ipp</th>
3983 <td class="description">IPP message</td></tr>
3984 <tr><th>group</th>
3985 <td class="description">IPP group</td></tr>
3986 <tr><th>name</th>
3987 <td class="description">Name of attribute</td></tr>
3988 <tr><th>value</th>
3989 <td class="description">Value of attribute</td></tr>
3990 </tbody></table>
3991 <h4 class="returnvalue">Return Value</h4>
3992 <p class="description">New attribute</p>
3993 <h4 class="discussion">Discussion</h4>
3994 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3995 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3996 <br>
3997 The <code>group</code> parameter specifies the IPP attribute group tag: none
3998 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3999 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4000 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4001 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4002 <h3 class="function"><a id="ippAddBooleans">ippAddBooleans</a></h3>
4003 <p class="description">Add an array of boolean values.</p>
4004 <p class="code">
4005 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBooleans(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int num_values, const char *values);</p>
4006 <h4 class="parameters">Parameters</h4>
4007 <table class="list"><tbody>
4008 <tr><th>ipp</th>
4009 <td class="description">IPP message</td></tr>
4010 <tr><th>group</th>
4011 <td class="description">IPP group</td></tr>
4012 <tr><th>name</th>
4013 <td class="description">Name of attribute</td></tr>
4014 <tr><th>num_values</th>
4015 <td class="description">Number of values</td></tr>
4016 <tr><th>values</th>
4017 <td class="description">Values</td></tr>
4018 </tbody></table>
4019 <h4 class="returnvalue">Return Value</h4>
4020 <p class="description">New attribute</p>
4021 <h4 class="discussion">Discussion</h4>
4022 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4023 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4024 <br>
4025 The <code>group</code> parameter specifies the IPP attribute group tag: none
4026 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4027 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4028 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4029 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4030 <h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippAddCollection">ippAddCollection</a></h3>
4031 <p class="description">Add a collection value.</p>
4032 <p class="code">
4033 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollection(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, <a href="#ipp_t">ipp_t</a> *value);</p>
4034 <h4 class="parameters">Parameters</h4>
4035 <table class="list"><tbody>
4036 <tr><th>ipp</th>
4037 <td class="description">IPP message</td></tr>
4038 <tr><th>group</th>
4039 <td class="description">IPP group</td></tr>
4040 <tr><th>name</th>
4041 <td class="description">Name of attribute</td></tr>
4042 <tr><th>value</th>
4043 <td class="description">Value</td></tr>
4044 </tbody></table>
4045 <h4 class="returnvalue">Return Value</h4>
4046 <p class="description">New attribute</p>
4047 <h4 class="discussion">Discussion</h4>
4048 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4049 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4050 <br>
4051 The <code>group</code> parameter specifies the IPP attribute group tag: none
4052 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4053 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4054 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4055 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
4056
4057 </p>
4058 <h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippAddCollections">ippAddCollections</a></h3>
4059 <p class="description">Add an array of collection values.</p>
4060 <p class="code">
4061 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollections(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int num_values, const <a href="#ipp_t">ipp_t</a> **values);</p>
4062 <h4 class="parameters">Parameters</h4>
4063 <table class="list"><tbody>
4064 <tr><th>ipp</th>
4065 <td class="description">IPP message</td></tr>
4066 <tr><th>group</th>
4067 <td class="description">IPP group</td></tr>
4068 <tr><th>name</th>
4069 <td class="description">Name of attribute</td></tr>
4070 <tr><th>num_values</th>
4071 <td class="description">Number of values</td></tr>
4072 <tr><th>values</th>
4073 <td class="description">Values</td></tr>
4074 </tbody></table>
4075 <h4 class="returnvalue">Return Value</h4>
4076 <p class="description">New attribute</p>
4077 <h4 class="discussion">Discussion</h4>
4078 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4079 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4080 <br>
4081 The <code>group</code> parameter specifies the IPP attribute group tag: none
4082 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4083 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4084 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4085 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
4086
4087 </p>
4088 <h3 class="function"><a id="ippAddDate">ippAddDate</a></h3>
4089 <p class="description">Add a dateTime attribute to an IPP message.</p>
4090 <p class="code">
4091 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddDate(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, const <a href="#ipp_uchar_t">ipp_uchar_t</a> *value);</p>
4092 <h4 class="parameters">Parameters</h4>
4093 <table class="list"><tbody>
4094 <tr><th>ipp</th>
4095 <td class="description">IPP message</td></tr>
4096 <tr><th>group</th>
4097 <td class="description">IPP group</td></tr>
4098 <tr><th>name</th>
4099 <td class="description">Name of attribute</td></tr>
4100 <tr><th>value</th>
4101 <td class="description">Value</td></tr>
4102 </tbody></table>
4103 <h4 class="returnvalue">Return Value</h4>
4104 <p class="description">New attribute</p>
4105 <h4 class="discussion">Discussion</h4>
4106 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4107 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4108 <br>
4109 The <code>group</code> parameter specifies the IPP attribute group tag: none
4110 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4111 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4112 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4113 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4114 <h3 class="function"><a id="ippAddInteger">ippAddInteger</a></h3>
4115 <p class="description">Add a integer attribute to an IPP message.</p>
4116 <p class="code">
4117 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddInteger(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, int value);</p>
4118 <h4 class="parameters">Parameters</h4>
4119 <table class="list"><tbody>
4120 <tr><th>ipp</th>
4121 <td class="description">IPP message</td></tr>
4122 <tr><th>group</th>
4123 <td class="description">IPP group</td></tr>
4124 <tr><th>value_tag</th>
4125 <td class="description">Type of attribute</td></tr>
4126 <tr><th>name</th>
4127 <td class="description">Name of attribute</td></tr>
4128 <tr><th>value</th>
4129 <td class="description">Value of attribute</td></tr>
4130 </tbody></table>
4131 <h4 class="returnvalue">Return Value</h4>
4132 <p class="description">New attribute</p>
4133 <h4 class="discussion">Discussion</h4>
4134 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4135 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4136 <br>
4137 The <code>group</code> parameter specifies the IPP attribute group tag: none
4138 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4139 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4140 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4141 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4142 <br>
4143 Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
4144 (<code>IPP_TAG_INTEGER</code>).</p>
4145 <h3 class="function"><a id="ippAddIntegers">ippAddIntegers</a></h3>
4146 <p class="description">Add an array of integer values.</p>
4147 <p class="code">
4148 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddIntegers(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, int num_values, const int *values);</p>
4149 <h4 class="parameters">Parameters</h4>
4150 <table class="list"><tbody>
4151 <tr><th>ipp</th>
4152 <td class="description">IPP message</td></tr>
4153 <tr><th>group</th>
4154 <td class="description">IPP group</td></tr>
4155 <tr><th>value_tag</th>
4156 <td class="description">Type of attribute</td></tr>
4157 <tr><th>name</th>
4158 <td class="description">Name of attribute</td></tr>
4159 <tr><th>num_values</th>
4160 <td class="description">Number of values</td></tr>
4161 <tr><th>values</th>
4162 <td class="description">Values</td></tr>
4163 </tbody></table>
4164 <h4 class="returnvalue">Return Value</h4>
4165 <p class="description">New attribute</p>
4166 <h4 class="discussion">Discussion</h4>
4167 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4168 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4169 <br>
4170 The <code>group</code> parameter specifies the IPP attribute group tag: none
4171 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4172 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4173 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4174 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4175 <br>
4176 Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
4177 (<code>IPP_TAG_INTEGER</code>).</p>
4178 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippAddOctetString">ippAddOctetString</a></h3>
4179 <p class="description">Add an octetString value to an IPP message.</p>
4180 <p class="code">
4181 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOctetString(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, const void *data, int datalen);</p>
4182 <h4 class="parameters">Parameters</h4>
4183 <table class="list"><tbody>
4184 <tr><th>ipp</th>
4185 <td class="description">IPP message</td></tr>
4186 <tr><th>group</th>
4187 <td class="description">IPP group</td></tr>
4188 <tr><th>name</th>
4189 <td class="description">Name of attribute</td></tr>
4190 <tr><th>data</th>
4191 <td class="description">octetString data</td></tr>
4192 <tr><th>datalen</th>
4193 <td class="description">Length of data in bytes</td></tr>
4194 </tbody></table>
4195 <h4 class="returnvalue">Return Value</h4>
4196 <p class="description">New attribute</p>
4197 <h4 class="discussion">Discussion</h4>
4198 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4199 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4200 <br>
4201 The <code>group</code> parameter specifies the IPP attribute group tag: none
4202 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4203 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4204 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4205 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
4206
4207 </p>
4208 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippAddOutOfBand">ippAddOutOfBand</a></h3>
4209 <p class="description">Add an out-of-band value to an IPP message.</p>
4210 <p class="code">
4211 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOutOfBand(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name);</p>
4212 <h4 class="parameters">Parameters</h4>
4213 <table class="list"><tbody>
4214 <tr><th>ipp</th>
4215 <td class="description">IPP message</td></tr>
4216 <tr><th>group</th>
4217 <td class="description">IPP group</td></tr>
4218 <tr><th>value_tag</th>
4219 <td class="description">Type of attribute</td></tr>
4220 <tr><th>name</th>
4221 <td class="description">Name of attribute</td></tr>
4222 </tbody></table>
4223 <h4 class="returnvalue">Return Value</h4>
4224 <p class="description">New attribute</p>
4225 <h4 class="discussion">Discussion</h4>
4226 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4227 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4228 <br>
4229 The <code>group</code> parameter specifies the IPP attribute group tag: none
4230 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4231 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4232 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4233 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4234 <br>
4235 Supported out-of-band values include unsupported-value
4236 (<code>IPP_TAG_UNSUPPORTED_VALUE</code>), default (<code>IPP_TAG_DEFAULT</code>), unknown
4237 (<code>IPP_TAG_UNKNOWN</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable
4238 (<code>IPP_TAG_NOTSETTABLE</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), and
4239 admin-define (<code>IPP_TAG_ADMINDEFINE</code>).
4240
4241 </p>
4242 <h3 class="function"><a id="ippAddRange">ippAddRange</a></h3>
4243 <p class="description">Add a range of values to an IPP message.</p>
4244 <p class="code">
4245 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRange(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int lower, int upper);</p>
4246 <h4 class="parameters">Parameters</h4>
4247 <table class="list"><tbody>
4248 <tr><th>ipp</th>
4249 <td class="description">IPP message</td></tr>
4250 <tr><th>group</th>
4251 <td class="description">IPP group</td></tr>
4252 <tr><th>name</th>
4253 <td class="description">Name of attribute</td></tr>
4254 <tr><th>lower</th>
4255 <td class="description">Lower value</td></tr>
4256 <tr><th>upper</th>
4257 <td class="description">Upper value</td></tr>
4258 </tbody></table>
4259 <h4 class="returnvalue">Return Value</h4>
4260 <p class="description">New attribute</p>
4261 <h4 class="discussion">Discussion</h4>
4262 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4263 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4264 <br>
4265 The <code>group</code> parameter specifies the IPP attribute group tag: none
4266 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4267 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4268 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4269 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4270 <br>
4271 The <code>lower</code> parameter must be less than or equal to the <code>upper</code> parameter.</p>
4272 <h3 class="function"><a id="ippAddRanges">ippAddRanges</a></h3>
4273 <p class="description">Add ranges of values to an IPP message.</p>
4274 <p class="code">
4275 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRanges(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int num_values, const int *lower, const int *upper);</p>
4276 <h4 class="parameters">Parameters</h4>
4277 <table class="list"><tbody>
4278 <tr><th>ipp</th>
4279 <td class="description">IPP message</td></tr>
4280 <tr><th>group</th>
4281 <td class="description">IPP group</td></tr>
4282 <tr><th>name</th>
4283 <td class="description">Name of attribute</td></tr>
4284 <tr><th>num_values</th>
4285 <td class="description">Number of values</td></tr>
4286 <tr><th>lower</th>
4287 <td class="description">Lower values</td></tr>
4288 <tr><th>upper</th>
4289 <td class="description">Upper values</td></tr>
4290 </tbody></table>
4291 <h4 class="returnvalue">Return Value</h4>
4292 <p class="description">New attribute</p>
4293 <h4 class="discussion">Discussion</h4>
4294 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4295 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4296 <br>
4297 The <code>group</code> parameter specifies the IPP attribute group tag: none
4298 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4299 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4300 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4301 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4302 <h3 class="function"><a id="ippAddResolution">ippAddResolution</a></h3>
4303 <p class="description">Add a resolution value to an IPP message.</p>
4304 <p class="code">
4305 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolution(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, <a href="#ipp_res_t">ipp_res_t</a> units, int xres, int yres);</p>
4306 <h4 class="parameters">Parameters</h4>
4307 <table class="list"><tbody>
4308 <tr><th>ipp</th>
4309 <td class="description">IPP message</td></tr>
4310 <tr><th>group</th>
4311 <td class="description">IPP group</td></tr>
4312 <tr><th>name</th>
4313 <td class="description">Name of attribute</td></tr>
4314 <tr><th>units</th>
4315 <td class="description">Units for resolution</td></tr>
4316 <tr><th>xres</th>
4317 <td class="description">X resolution</td></tr>
4318 <tr><th>yres</th>
4319 <td class="description">Y resolution</td></tr>
4320 </tbody></table>
4321 <h4 class="returnvalue">Return Value</h4>
4322 <p class="description">New attribute</p>
4323 <h4 class="discussion">Discussion</h4>
4324 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4325 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4326 <br>
4327 The <code>group</code> parameter specifies the IPP attribute group tag: none
4328 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4329 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4330 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4331 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4332 <h3 class="function"><a id="ippAddResolutions">ippAddResolutions</a></h3>
4333 <p class="description">Add resolution values to an IPP message.</p>
4334 <p class="code">
4335 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolutions(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int num_values, <a href="#ipp_res_t">ipp_res_t</a> units, const int *xres, const int *yres);</p>
4336 <h4 class="parameters">Parameters</h4>
4337 <table class="list"><tbody>
4338 <tr><th>ipp</th>
4339 <td class="description">IPP message</td></tr>
4340 <tr><th>group</th>
4341 <td class="description">IPP group</td></tr>
4342 <tr><th>name</th>
4343 <td class="description">Name of attribute</td></tr>
4344 <tr><th>num_values</th>
4345 <td class="description">Number of values</td></tr>
4346 <tr><th>units</th>
4347 <td class="description">Units for resolution</td></tr>
4348 <tr><th>xres</th>
4349 <td class="description">X resolutions</td></tr>
4350 <tr><th>yres</th>
4351 <td class="description">Y resolutions</td></tr>
4352 </tbody></table>
4353 <h4 class="returnvalue">Return Value</h4>
4354 <p class="description">New attribute</p>
4355 <h4 class="discussion">Discussion</h4>
4356 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4357 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4358 <br>
4359 The <code>group</code> parameter specifies the IPP attribute group tag: none
4360 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4361 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4362 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4363 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4364 <h3 class="function"><a id="ippAddSeparator">ippAddSeparator</a></h3>
4365 <p class="description">Add a group separator to an IPP message.</p>
4366 <p class="code">
4367 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddSeparator(<a href="#ipp_t">ipp_t</a> *ipp);</p>
4368 <h4 class="parameters">Parameters</h4>
4369 <table class="list"><tbody>
4370 <tr><th>ipp</th>
4371 <td class="description">IPP message</td></tr>
4372 </tbody></table>
4373 <h4 class="returnvalue">Return Value</h4>
4374 <p class="description">New attribute</p>
4375 <h4 class="discussion">Discussion</h4>
4376 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4377 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.</p>
4378 <h3 class="function"><a id="ippAddString">ippAddString</a></h3>
4379 <p class="description">Add a language-encoded string to an IPP message.</p>
4380 <p class="code">
4381 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddString(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, const char *language, const char *value);</p>
4382 <h4 class="parameters">Parameters</h4>
4383 <table class="list"><tbody>
4384 <tr><th>ipp</th>
4385 <td class="description">IPP message</td></tr>
4386 <tr><th>group</th>
4387 <td class="description">IPP group</td></tr>
4388 <tr><th>value_tag</th>
4389 <td class="description">Type of attribute</td></tr>
4390 <tr><th>name</th>
4391 <td class="description">Name of attribute</td></tr>
4392 <tr><th>language</th>
4393 <td class="description">Language code</td></tr>
4394 <tr><th>value</th>
4395 <td class="description">Value</td></tr>
4396 </tbody></table>
4397 <h4 class="returnvalue">Return Value</h4>
4398 <p class="description">New attribute</p>
4399 <h4 class="discussion">Discussion</h4>
4400 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4401 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4402 <br>
4403 The <code>group</code> parameter specifies the IPP attribute group tag: none
4404 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4405 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4406 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4407 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4408 <br>
4409 Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4410 (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4411 (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4412 (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4413 (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4414 (<code>IPP_TAG_URISCHEME</code>).<br>
4415 <br>
4416 The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
4417 textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
4418 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippAddStringf">ippAddStringf</a></h3>
4419 <p class="description">Add a formatted string to an IPP message.</p>
4420 <p class="code">
4421 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStringf(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, const char *language, const char *format, ...);</p>
4422 <h4 class="parameters">Parameters</h4>
4423 <table class="list"><tbody>
4424 <tr><th>ipp</th>
4425 <td class="description">IPP message</td></tr>
4426 <tr><th>group</th>
4427 <td class="description">IPP group</td></tr>
4428 <tr><th>value_tag</th>
4429 <td class="description">Type of attribute</td></tr>
4430 <tr><th>name</th>
4431 <td class="description">Name of attribute</td></tr>
4432 <tr><th>language</th>
4433 <td class="description">Language code (<code>NULL</code> for default)</td></tr>
4434 <tr><th>format</th>
4435 <td class="description">Printf-style format string</td></tr>
4436 <tr><th>...</th>
4437 <td class="description">Additional arguments as needed</td></tr>
4438 </tbody></table>
4439 <h4 class="returnvalue">Return Value</h4>
4440 <p class="description">New attribute</p>
4441 <h4 class="discussion">Discussion</h4>
4442 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4443 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4444 <br>
4445 The <code>group</code> parameter specifies the IPP attribute group tag: none
4446 (<code>IPP_TAG_ZERO</code>, for member attributes), document
4447 (<code>IPP_TAG_DOCUMENT</code>), event notification
4448 (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
4449 printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
4450 or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4451 <br>
4452 Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4453 (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4454 (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4455 (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4456 (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4457 (<code>IPP_TAG_URISCHEME</code>).<br>
4458 <br>
4459 The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
4460 and textWithLanguage string values and must be <code>NULL</code> for all other
4461 string values.<br>
4462 <br>
4463 The <code>format</code> parameter uses formatting characters compatible with the
4464 printf family of standard functions. Additional arguments follow it as
4465 needed. The formatted string is truncated as needed to the maximum length of
4466 the corresponding value type.
4467
4468 </p>
4469 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippAddStringfv">ippAddStringfv</a></h3>
4470 <p class="description">Add a formatted string to an IPP message.</p>
4471 <p class="code">
4472 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStringfv(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, const char *language, const char *format, va_list ap);</p>
4473 <h4 class="parameters">Parameters</h4>
4474 <table class="list"><tbody>
4475 <tr><th>ipp</th>
4476 <td class="description">IPP message</td></tr>
4477 <tr><th>group</th>
4478 <td class="description">IPP group</td></tr>
4479 <tr><th>value_tag</th>
4480 <td class="description">Type of attribute</td></tr>
4481 <tr><th>name</th>
4482 <td class="description">Name of attribute</td></tr>
4483 <tr><th>language</th>
4484 <td class="description">Language code (<code>NULL</code> for default)</td></tr>
4485 <tr><th>format</th>
4486 <td class="description">Printf-style format string</td></tr>
4487 <tr><th>ap</th>
4488 <td class="description">Additional arguments</td></tr>
4489 </tbody></table>
4490 <h4 class="returnvalue">Return Value</h4>
4491 <p class="description">New attribute</p>
4492 <h4 class="discussion">Discussion</h4>
4493 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4494 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4495 <br>
4496 The <code>group</code> parameter specifies the IPP attribute group tag: none
4497 (<code>IPP_TAG_ZERO</code>, for member attributes), document
4498 (<code>IPP_TAG_DOCUMENT</code>), event notification
4499 (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
4500 printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
4501 or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4502 <br>
4503 Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4504 (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4505 (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4506 (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4507 (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4508 (<code>IPP_TAG_URISCHEME</code>).<br>
4509 <br>
4510 The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
4511 and textWithLanguage string values and must be <code>NULL</code> for all other
4512 string values.<br>
4513 <br>
4514 The <code>format</code> parameter uses formatting characters compatible with the
4515 printf family of standard functions. Additional arguments are passed in the
4516 stdarg pointer <code>ap</code>. The formatted string is truncated as needed to the
4517 maximum length of the corresponding value type.
4518
4519 </p>
4520 <h3 class="function"><a id="ippAddStrings">ippAddStrings</a></h3>
4521 <p class="description">Add language-encoded strings to an IPP message.</p>
4522 <p class="code">
4523 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStrings(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, int num_values, const char *language, const char *const *values);</p>
4524 <h4 class="parameters">Parameters</h4>
4525 <table class="list"><tbody>
4526 <tr><th>ipp</th>
4527 <td class="description">IPP message</td></tr>
4528 <tr><th>group</th>
4529 <td class="description">IPP group</td></tr>
4530 <tr><th>value_tag</th>
4531 <td class="description">Type of attribute</td></tr>
4532 <tr><th>name</th>
4533 <td class="description">Name of attribute</td></tr>
4534 <tr><th>num_values</th>
4535 <td class="description">Number of values</td></tr>
4536 <tr><th>language</th>
4537 <td class="description">Language code (<code>NULL</code> for default)</td></tr>
4538 <tr><th>values</th>
4539 <td class="description">Values</td></tr>
4540 </tbody></table>
4541 <h4 class="returnvalue">Return Value</h4>
4542 <p class="description">New attribute</p>
4543 <h4 class="discussion">Discussion</h4>
4544 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4545 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4546 <br>
4547 The <code>group</code> parameter specifies the IPP attribute group tag: none
4548 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4549 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4550 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4551 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4552 <br>
4553 Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4554 (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4555 (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4556 (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4557 (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4558 (<code>IPP_TAG_URISCHEME</code>).<br>
4559 <br>
4560 The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
4561 textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
4562 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippAttributeString">ippAttributeString</a></h3>
4563 <p class="description">Convert the attribute's value to a string.</p>
4564 <p class="code">
4565 size_t ippAttributeString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, char *buffer, size_t bufsize);</p>
4566 <h4 class="parameters">Parameters</h4>
4567 <table class="list"><tbody>
4568 <tr><th>attr</th>
4569 <td class="description">Attribute</td></tr>
4570 <tr><th>buffer</th>
4571 <td class="description">String buffer or NULL</td></tr>
4572 <tr><th>bufsize</th>
4573 <td class="description">Size of string buffer</td></tr>
4574 </tbody></table>
4575 <h4 class="returnvalue">Return Value</h4>
4576 <p class="description">Number of bytes less nul</p>
4577 <h4 class="discussion">Discussion</h4>
4578 <p class="discussion">Returns the number of bytes that would be written, not including the
4579 trailing nul. The buffer pointer can be NULL to get the required length,
4580 just like (v)snprintf.
4581
4582 </p>
4583 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippContainsInteger">ippContainsInteger</a></h3>
4584 <p class="description">Determine whether an attribute contains the
4585 specified value or is within the list of ranges.</p>
4586 <p class="code">
4587 int ippContainsInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int value);</p>
4588 <h4 class="parameters">Parameters</h4>
4589 <table class="list"><tbody>
4590 <tr><th>attr</th>
4591 <td class="description">Attribute</td></tr>
4592 <tr><th>value</th>
4593 <td class="description">Integer/enum value</td></tr>
4594 </tbody></table>
4595 <h4 class="returnvalue">Return Value</h4>
4596 <p class="description">1 on a match, 0 on no match</p>
4597 <h4 class="discussion">Discussion</h4>
4598 <p class="discussion">Returns non-zero when the attribute contains either a matching integer or
4599 enum value, or the value falls within one of the rangeOfInteger values for
4600 the attribute.
4601
4602 </p>
4603 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippContainsString">ippContainsString</a></h3>
4604 <p class="description">Determine whether an attribute contains the
4605 specified string value.</p>
4606 <p class="code">
4607 int ippContainsString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, const char *value);</p>
4608 <h4 class="parameters">Parameters</h4>
4609 <table class="list"><tbody>
4610 <tr><th>attr</th>
4611 <td class="description">Attribute</td></tr>
4612 <tr><th>value</th>
4613 <td class="description">String value</td></tr>
4614 </tbody></table>
4615 <h4 class="returnvalue">Return Value</h4>
4616 <p class="description">1 on a match, 0 on no match</p>
4617 <h4 class="discussion">Discussion</h4>
4618 <p class="discussion">Returns non-zero when the attribute contains a matching charset, keyword,
4619 naturalLanguage, mimeMediaType, name, text, uri, or uriScheme value.
4620
4621 </p>
4622 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippCopyAttribute">ippCopyAttribute</a></h3>
4623 <p class="description">Copy an attribute.</p>
4624 <p class="code">
4625 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippCopyAttribute(<a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_attribute_t">ipp_attribute_t</a> *srcattr, int quickcopy);</p>
4626 <h4 class="parameters">Parameters</h4>
4627 <table class="list"><tbody>
4628 <tr><th>dst</th>
4629 <td class="description">Destination IPP message</td></tr>
4630 <tr><th>srcattr</th>
4631 <td class="description">Attribute to copy</td></tr>
4632 <tr><th>quickcopy</th>
4633 <td class="description">1 for a referenced copy, 0 for normal</td></tr>
4634 </tbody></table>
4635 <h4 class="returnvalue">Return Value</h4>
4636 <p class="description">New attribute</p>
4637 <h4 class="discussion">Discussion</h4>
4638 <p class="discussion">The specified attribute, <code>attr</code>, is copied to the destination IPP message.
4639 When <code>quickcopy</code> is non-zero, a &quot;shallow&quot; reference copy of the attribute is
4640 created - this should only be done as long as the original source IPP message will
4641 not be freed for the life of the destination.
4642
4643 </p>
4644 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippCopyAttributes">ippCopyAttributes</a></h3>
4645 <p class="description">Copy attributes from one IPP message to another.</p>
4646 <p class="code">
4647 int ippCopyAttributes(<a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_t">ipp_t</a> *src, int quickcopy, <a href="#ipp_copycb_t">ipp_copycb_t</a> cb, void *context);</p>
4648 <h4 class="parameters">Parameters</h4>
4649 <table class="list"><tbody>
4650 <tr><th>dst</th>
4651 <td class="description">Destination IPP message</td></tr>
4652 <tr><th>src</th>
4653 <td class="description">Source IPP message</td></tr>
4654 <tr><th>quickcopy</th>
4655 <td class="description">1 for a referenced copy, 0 for normal</td></tr>
4656 <tr><th>cb</th>
4657 <td class="description">Copy callback or <code>NULL</code> for none</td></tr>
4658 <tr><th>context</th>
4659 <td class="description">Context pointer</td></tr>
4660 </tbody></table>
4661 <h4 class="returnvalue">Return Value</h4>
4662 <p class="description">1 on success, 0 on error</p>
4663 <h4 class="discussion">Discussion</h4>
4664 <p class="discussion">Zero or more attributes are copied from the source IPP message, <code>src</code>, to the
4665 destination IPP message, <code>dst</code>. When <code>quickcopy</code> is non-zero, a &quot;shallow&quot;
4666 reference copy of the attribute is created - this should only be done as long as the
4667 original source IPP message will not be freed for the life of the destination.<br>
4668 <br>
4669 The <code>cb</code> and <code>context</code> parameters provide a generic way to &quot;filter&quot; the
4670 attributes that are copied - the function must return 1 to copy the attribute or
4671 0 to skip it. The function may also choose to do a partial copy of the source attribute
4672 itself.
4673
4674 </p>
4675 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippCreateRequestedArray">ippCreateRequestedArray</a></h3>
4676 <p class="description">Create a CUPS array of attribute names from the
4677 given requested-attributes attribute.</p>
4678 <p class="code">
4679 cups_array_t *ippCreateRequestedArray(<a href="#ipp_t">ipp_t</a> *request);</p>
4680 <h4 class="parameters">Parameters</h4>
4681 <table class="list"><tbody>
4682 <tr><th>request</th>
4683 <td class="description">IPP request</td></tr>
4684 </tbody></table>
4685 <h4 class="returnvalue">Return Value</h4>
4686 <p class="description">CUPS array or <code>NULL</code> if all</p>
4687 <h4 class="discussion">Discussion</h4>
4688 <p class="discussion">This function creates a (sorted) CUPS array of attribute names matching the
4689 list of &quot;requested-attribute&quot; values supplied in an IPP request. All IANA-
4690 registered values are supported in addition to the CUPS IPP extension
4691 attributes.<br>
4692 <br>
4693 The <code>request</code> parameter specifies the request message that was read from
4694 the client.
4695
4696 <code>NULL</code> is returned if all attributes should be returned. Otherwise, the
4697 result is a sorted array of attribute names, where <code>cupsArrayFind(array,
4698 "attribute-name")</code> will return a non-NULL pointer. The array must be freed
4699 using the <code>cupsArrayDelete</code> function.
4700
4701 </p>
4702 <h3 class="function"><a id="ippDateToTime">ippDateToTime</a></h3>
4703 <p class="description">Convert from RFC 2579 Date/Time format to time in
4704 seconds.</p>
4705 <p class="code">
4706 time_t ippDateToTime(const <a href="#ipp_uchar_t">ipp_uchar_t</a> *date);</p>
4707 <h4 class="parameters">Parameters</h4>
4708 <table class="list"><tbody>
4709 <tr><th>date</th>
4710 <td class="description">RFC 2579 date info</td></tr>
4711 </tbody></table>
4712 <h4 class="returnvalue">Return Value</h4>
4713 <p class="description">UNIX time value</p>
4714 <h3 class="function"><a id="ippDelete">ippDelete</a></h3>
4715 <p class="description">Delete an IPP message.</p>
4716 <p class="code">
4717 void ippDelete(<a href="#ipp_t">ipp_t</a> *ipp);</p>
4718 <h4 class="parameters">Parameters</h4>
4719 <table class="list"><tbody>
4720 <tr><th>ipp</th>
4721 <td class="description">IPP message</td></tr>
4722 </tbody></table>
4723 <h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippDeleteAttribute">ippDeleteAttribute</a></h3>
4724 <p class="description">Delete a single attribute in an IPP message.</p>
4725 <p class="code">
4726 void ippDeleteAttribute(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
4727 <h4 class="parameters">Parameters</h4>
4728 <table class="list"><tbody>
4729 <tr><th>ipp</th>
4730 <td class="description">IPP message</td></tr>
4731 <tr><th>attr</th>
4732 <td class="description">Attribute to delete</td></tr>
4733 </tbody></table>
4734 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippDeleteValues">ippDeleteValues</a></h3>
4735 <p class="description">Delete values in an attribute.</p>
4736 <p class="code">
4737 int ippDeleteValues(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int count);</p>
4738 <h4 class="parameters">Parameters</h4>
4739 <table class="list"><tbody>
4740 <tr><th>ipp</th>
4741 <td class="description">IPP message</td></tr>
4742 <tr><th>attr</th>
4743 <td class="description">Attribute</td></tr>
4744 <tr><th>element</th>
4745 <td class="description">Index of first value to delete (0-based)</td></tr>
4746 <tr><th>count</th>
4747 <td class="description">Number of values to delete</td></tr>
4748 </tbody></table>
4749 <h4 class="returnvalue">Return Value</h4>
4750 <p class="description">1 on success, 0 on failure</p>
4751 <h4 class="discussion">Discussion</h4>
4752 <p class="discussion">The <code>element</code> parameter specifies the first value to delete, starting at
4753 0. It must be less than the number of values returned by <a href="#ippGetCount"><code>ippGetCount</code></a>.<br>
4754 <br>
4755 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4756 <br>
4757 Deleting all values in an attribute deletes the attribute.
4758
4759 </p>
4760 <h3 class="function"><a id="ippEnumString">ippEnumString</a></h3>
4761 <p class="description">Return a string corresponding to the enum value.</p>
4762 <p class="code">
4763 const char *ippEnumString(const char *attrname, int enumvalue);</p>
4764 <h4 class="parameters">Parameters</h4>
4765 <table class="list"><tbody>
4766 <tr><th>attrname</th>
4767 <td class="description">Attribute name</td></tr>
4768 <tr><th>enumvalue</th>
4769 <td class="description">Enum value</td></tr>
4770 </tbody></table>
4771 <h4 class="returnvalue">Return Value</h4>
4772 <p class="description">Enum string</p>
4773 <h3 class="function"><a id="ippEnumValue">ippEnumValue</a></h3>
4774 <p class="description">Return the value associated with a given enum string.</p>
4775 <p class="code">
4776 int ippEnumValue(const char *attrname, const char *enumstring);</p>
4777 <h4 class="parameters">Parameters</h4>
4778 <table class="list"><tbody>
4779 <tr><th>attrname</th>
4780 <td class="description">Attribute name</td></tr>
4781 <tr><th>enumstring</th>
4782 <td class="description">Enum string</td></tr>
4783 </tbody></table>
4784 <h4 class="returnvalue">Return Value</h4>
4785 <p class="description">Enum value or -1 if unknown</p>
4786 <h3 class="function"><a id="ippErrorString">ippErrorString</a></h3>
4787 <p class="description">Return a name for the given status code.</p>
4788 <p class="code">
4789 const char *ippErrorString(ipp_status_t error);</p>
4790 <h4 class="parameters">Parameters</h4>
4791 <table class="list"><tbody>
4792 <tr><th>error</th>
4793 <td class="description">Error status</td></tr>
4794 </tbody></table>
4795 <h4 class="returnvalue">Return Value</h4>
4796 <p class="description">Text string</p>
4797 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippErrorValue">ippErrorValue</a></h3>
4798 <p class="description">Return a status code for the given name.</p>
4799 <p class="code">
4800 ipp_status_t ippErrorValue(const char *name);</p>
4801 <h4 class="parameters">Parameters</h4>
4802 <table class="list"><tbody>
4803 <tr><th>name</th>
4804 <td class="description">Name</td></tr>
4805 </tbody></table>
4806 <h4 class="returnvalue">Return Value</h4>
4807 <p class="description">IPP status code</p>
4808 <h3 class="function"><a id="ippFindAttribute">ippFindAttribute</a></h3>
4809 <p class="description">Find a named attribute in a request.</p>
4810 <p class="code">
4811 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindAttribute(<a href="#ipp_t">ipp_t</a> *ipp, const char *name, ipp_tag_t type);</p>
4812 <h4 class="parameters">Parameters</h4>
4813 <table class="list"><tbody>
4814 <tr><th>ipp</th>
4815 <td class="description">IPP message</td></tr>
4816 <tr><th>name</th>
4817 <td class="description">Name of attribute</td></tr>
4818 <tr><th>type</th>
4819 <td class="description">Type of attribute</td></tr>
4820 </tbody></table>
4821 <h4 class="returnvalue">Return Value</h4>
4822 <p class="description">Matching attribute</p>
4823 <h4 class="discussion">Discussion</h4>
4824 <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
4825 of attribute and member names separated by slashes, for example
4826 &quot;media-col/media-size&quot;.</p>
4827 <h3 class="function"><a id="ippFindNextAttribute">ippFindNextAttribute</a></h3>
4828 <p class="description">Find the next named attribute in a request.</p>
4829 <p class="code">
4830 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindNextAttribute(<a href="#ipp_t">ipp_t</a> *ipp, const char *name, ipp_tag_t type);</p>
4831 <h4 class="parameters">Parameters</h4>
4832 <table class="list"><tbody>
4833 <tr><th>ipp</th>
4834 <td class="description">IPP message</td></tr>
4835 <tr><th>name</th>
4836 <td class="description">Name of attribute</td></tr>
4837 <tr><th>type</th>
4838 <td class="description">Type of attribute</td></tr>
4839 </tbody></table>
4840 <h4 class="returnvalue">Return Value</h4>
4841 <p class="description">Matching attribute</p>
4842 <h4 class="discussion">Discussion</h4>
4843 <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
4844 of attribute and member names separated by slashes, for example
4845 &quot;media-col/media-size&quot;.</p>
4846 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippFirstAttribute">ippFirstAttribute</a></h3>
4847 <p class="description">Return the first attribute in the message.</p>
4848 <p class="code">
4849 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFirstAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p>
4850 <h4 class="parameters">Parameters</h4>
4851 <table class="list"><tbody>
4852 <tr><th>ipp</th>
4853 <td class="description">IPP message</td></tr>
4854 </tbody></table>
4855 <h4 class="returnvalue">Return Value</h4>
4856 <p class="description">First attribute or <code>NULL</code> if none</p>
4857 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetBoolean">ippGetBoolean</a></h3>
4858 <p class="description">Get a boolean value for an attribute.</p>
4859 <p class="code">
4860 int ippGetBoolean(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
4861 <h4 class="parameters">Parameters</h4>
4862 <table class="list"><tbody>
4863 <tr><th>attr</th>
4864 <td class="description">IPP attribute</td></tr>
4865 <tr><th>element</th>
4866 <td class="description">Value number (0-based)</td></tr>
4867 </tbody></table>
4868 <h4 class="returnvalue">Return Value</h4>
4869 <p class="description">Boolean value or 0 on error</p>
4870 <h4 class="discussion">Discussion</h4>
4871 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4872 <code>ippGetCount(attr)</code> - 1.
4873
4874 </p>
4875 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetCollection">ippGetCollection</a></h3>
4876 <p class="description">Get a collection value for an attribute.</p>
4877 <p class="code">
4878 <a href="#ipp_t">ipp_t</a> *ippGetCollection(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
4879 <h4 class="parameters">Parameters</h4>
4880 <table class="list"><tbody>
4881 <tr><th>attr</th>
4882 <td class="description">IPP attribute</td></tr>
4883 <tr><th>element</th>
4884 <td class="description">Value number (0-based)</td></tr>
4885 </tbody></table>
4886 <h4 class="returnvalue">Return Value</h4>
4887 <p class="description">Collection value or <code>NULL</code> on error</p>
4888 <h4 class="discussion">Discussion</h4>
4889 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4890 <code>ippGetCount(attr)</code> - 1.
4891
4892 </p>
4893 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetCount">ippGetCount</a></h3>
4894 <p class="description">Get the number of values in an attribute.</p>
4895 <p class="code">
4896 int ippGetCount(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
4897 <h4 class="parameters">Parameters</h4>
4898 <table class="list"><tbody>
4899 <tr><th>attr</th>
4900 <td class="description">IPP attribute</td></tr>
4901 </tbody></table>
4902 <h4 class="returnvalue">Return Value</h4>
4903 <p class="description">Number of values or 0 on error</p>
4904 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetDate">ippGetDate</a></h3>
4905 <p class="description">Get a dateTime value for an attribute.</p>
4906 <p class="code">
4907 const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippGetDate(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
4908 <h4 class="parameters">Parameters</h4>
4909 <table class="list"><tbody>
4910 <tr><th>attr</th>
4911 <td class="description">IPP attribute</td></tr>
4912 <tr><th>element</th>
4913 <td class="description">Value number (0-based)</td></tr>
4914 </tbody></table>
4915 <h4 class="returnvalue">Return Value</h4>
4916 <p class="description">dateTime value or <code>NULL</code></p>
4917 <h4 class="discussion">Discussion</h4>
4918 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4919 <code>ippGetCount(attr)</code> - 1.
4920
4921 </p>
4922 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetGroupTag">ippGetGroupTag</a></h3>
4923 <p class="description">Get the group associated with an attribute.</p>
4924 <p class="code">
4925 ipp_tag_t ippGetGroupTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
4926 <h4 class="parameters">Parameters</h4>
4927 <table class="list"><tbody>
4928 <tr><th>attr</th>
4929 <td class="description">IPP attribute</td></tr>
4930 </tbody></table>
4931 <h4 class="returnvalue">Return Value</h4>
4932 <p class="description">Group tag or <code>IPP_TAG_ZERO</code> on error</p>
4933 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetInteger">ippGetInteger</a></h3>
4934 <p class="description">Get the integer/enum value for an attribute.</p>
4935 <p class="code">
4936 int ippGetInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
4937 <h4 class="parameters">Parameters</h4>
4938 <table class="list"><tbody>
4939 <tr><th>attr</th>
4940 <td class="description">IPP attribute</td></tr>
4941 <tr><th>element</th>
4942 <td class="description">Value number (0-based)</td></tr>
4943 </tbody></table>
4944 <h4 class="returnvalue">Return Value</h4>
4945 <p class="description">Value or 0 on error</p>
4946 <h4 class="discussion">Discussion</h4>
4947 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4948 <code>ippGetCount(attr)</code> - 1.
4949
4950 </p>
4951 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetName">ippGetName</a></h3>
4952 <p class="description">Get the attribute name.</p>
4953 <p class="code">
4954 const char *ippGetName(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
4955 <h4 class="parameters">Parameters</h4>
4956 <table class="list"><tbody>
4957 <tr><th>attr</th>
4958 <td class="description">IPP attribute</td></tr>
4959 </tbody></table>
4960 <h4 class="returnvalue">Return Value</h4>
4961 <p class="description">Attribute name or <code>NULL</code> for separators</p>
4962 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippGetOctetString">ippGetOctetString</a></h3>
4963 <p class="description">Get an octetString value from an IPP attribute.</p>
4964 <p class="code">
4965 void *ippGetOctetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *datalen);</p>
4966 <h4 class="parameters">Parameters</h4>
4967 <table class="list"><tbody>
4968 <tr><th>attr</th>
4969 <td class="description">IPP attribute</td></tr>
4970 <tr><th>element</th>
4971 <td class="description">Value number (0-based)</td></tr>
4972 <tr><th>datalen</th>
4973 <td class="description">Length of octetString data</td></tr>
4974 </tbody></table>
4975 <h4 class="returnvalue">Return Value</h4>
4976 <p class="description">Pointer to octetString data</p>
4977 <h4 class="discussion">Discussion</h4>
4978 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4979 <code>ippGetCount(attr)</code> - 1.
4980
4981 </p>
4982 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetOperation">ippGetOperation</a></h3>
4983 <p class="description">Get the operation ID in an IPP message.</p>
4984 <p class="code">
4985 ipp_op_t ippGetOperation(<a href="#ipp_t">ipp_t</a> *ipp);</p>
4986 <h4 class="parameters">Parameters</h4>
4987 <table class="list"><tbody>
4988 <tr><th>ipp</th>
4989 <td class="description">IPP request message</td></tr>
4990 </tbody></table>
4991 <h4 class="returnvalue">Return Value</h4>
4992 <p class="description">Operation ID or 0 on error</p>
4993 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetRange">ippGetRange</a></h3>
4994 <p class="description">Get a rangeOfInteger value from an attribute.</p>
4995 <p class="code">
4996 int ippGetRange(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *uppervalue);</p>
4997 <h4 class="parameters">Parameters</h4>
4998 <table class="list"><tbody>
4999 <tr><th>attr</th>
5000 <td class="description">IPP attribute</td></tr>
5001 <tr><th>element</th>
5002 <td class="description">Value number (0-based)</td></tr>
5003 <tr><th>uppervalue</th>
5004 <td class="description">Upper value of range</td></tr>
5005 </tbody></table>
5006 <h4 class="returnvalue">Return Value</h4>
5007 <p class="description">Lower value of range or 0</p>
5008 <h4 class="discussion">Discussion</h4>
5009 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
5010 <code>ippGetCount(attr)</code> - 1.
5011
5012 </p>
5013 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetRequestId">ippGetRequestId</a></h3>
5014 <p class="description">Get the request ID from an IPP message.</p>
5015 <p class="code">
5016 int ippGetRequestId(<a href="#ipp_t">ipp_t</a> *ipp);</p>
5017 <h4 class="parameters">Parameters</h4>
5018 <table class="list"><tbody>
5019 <tr><th>ipp</th>
5020 <td class="description">IPP message</td></tr>
5021 </tbody></table>
5022 <h4 class="returnvalue">Return Value</h4>
5023 <p class="description">Request ID or 0 on error</p>
5024 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetResolution">ippGetResolution</a></h3>
5025 <p class="description">Get a resolution value for an attribute.</p>
5026 <p class="code">
5027 int ippGetResolution(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *yres, <a href="#ipp_res_t">ipp_res_t</a> *units);</p>
5028 <h4 class="parameters">Parameters</h4>
5029 <table class="list"><tbody>
5030 <tr><th>attr</th>
5031 <td class="description">IPP attribute</td></tr>
5032 <tr><th>element</th>
5033 <td class="description">Value number (0-based)</td></tr>
5034 <tr><th>yres</th>
5035 <td class="description">Vertical/feed resolution</td></tr>
5036 <tr><th>units</th>
5037 <td class="description">Units for resolution</td></tr>
5038 </tbody></table>
5039 <h4 class="returnvalue">Return Value</h4>
5040 <p class="description">Horizontal/cross feed resolution or 0</p>
5041 <h4 class="discussion">Discussion</h4>
5042 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
5043 <code>ippGetCount(attr)</code> - 1.
5044
5045 </p>
5046 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetState">ippGetState</a></h3>
5047 <p class="description">Get the IPP message state.</p>
5048 <p class="code">
5049 <a href="#ipp_state_t">ipp_state_t</a> ippGetState(<a href="#ipp_t">ipp_t</a> *ipp);</p>
5050 <h4 class="parameters">Parameters</h4>
5051 <table class="list"><tbody>
5052 <tr><th>ipp</th>
5053 <td class="description">IPP message</td></tr>
5054 </tbody></table>
5055 <h4 class="returnvalue">Return Value</h4>
5056 <p class="description">IPP message state value</p>
5057 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetStatusCode">ippGetStatusCode</a></h3>
5058 <p class="description">Get the status code from an IPP response or event message.</p>
5059 <p class="code">
5060 ipp_status_t ippGetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp);</p>
5061 <h4 class="parameters">Parameters</h4>
5062 <table class="list"><tbody>
5063 <tr><th>ipp</th>
5064 <td class="description">IPP response or event message</td></tr>
5065 </tbody></table>
5066 <h4 class="returnvalue">Return Value</h4>
5067 <p class="description">Status code in IPP message</p>
5068 <h3 class="function"><a id="ippGetString">ippGetString</a></h3>
5069 <p class="description"></p>
5070 <p class="code">
5071 const char *ippGetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, const char **language);</p>
5072 <h4 class="parameters">Parameters</h4>
5073 <table class="list"><tbody>
5074 <tr><th>attr</th>
5075 <td class="description">IPP attribute</td></tr>
5076 <tr><th>element</th>
5077 <td class="description">Value number (0-based)</td></tr>
5078 <tr><th>language</th>
5079 <td class="description">Language code (<code>NULL</code> for don't care)</td></tr>
5080 </tbody></table>
5081 <h4 class="returnvalue">Return Value</h4>
5082 <p class="description">Get the string and optionally the language code for an attribute.</p>
5083 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
5084 <code>ippGetCount(attr)</code> - 1.
5085
5086 </p>
5087 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetValueTag">ippGetValueTag</a></h3>
5088 <p class="description">Get the value tag for an attribute.</p>
5089 <p class="code">
5090 ipp_tag_t ippGetValueTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
5091 <h4 class="parameters">Parameters</h4>
5092 <table class="list"><tbody>
5093 <tr><th>attr</th>
5094 <td class="description">IPP attribute</td></tr>
5095 </tbody></table>
5096 <h4 class="returnvalue">Return Value</h4>
5097 <p class="description">Value tag or <code>IPP_TAG_ZERO</code> on error</p>
5098 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetVersion">ippGetVersion</a></h3>
5099 <p class="description">Get the major and minor version number from an IPP message.</p>
5100 <p class="code">
5101 int ippGetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int *minor);</p>
5102 <h4 class="parameters">Parameters</h4>
5103 <table class="list"><tbody>
5104 <tr><th>ipp</th>
5105 <td class="description">IPP message</td></tr>
5106 <tr><th>minor</th>
5107 <td class="description">Minor version number or <code>NULL</code> for don't care</td></tr>
5108 </tbody></table>
5109 <h4 class="returnvalue">Return Value</h4>
5110 <p class="description">Major version number or 0 on error</p>
5111 <h3 class="function"><a id="ippLength">ippLength</a></h3>
5112 <p class="description">Compute the length of an IPP message.</p>
5113 <p class="code">
5114 size_t ippLength(<a href="#ipp_t">ipp_t</a> *ipp);</p>
5115 <h4 class="parameters">Parameters</h4>
5116 <table class="list"><tbody>
5117 <tr><th>ipp</th>
5118 <td class="description">IPP message</td></tr>
5119 </tbody></table>
5120 <h4 class="returnvalue">Return Value</h4>
5121 <p class="description">Size of IPP message</p>
5122 <h3 class="function"><a id="ippNew">ippNew</a></h3>
5123 <p class="description">Allocate a new IPP message.</p>
5124 <p class="code">
5125 <a href="#ipp_t">ipp_t</a> *ippNew(void);</p>
5126 <h4 class="returnvalue">Return Value</h4>
5127 <p class="description">New IPP message</p>
5128 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippNewRequest">ippNewRequest</a></h3>
5129 <p class="description">Allocate a new IPP request message.</p>
5130 <p class="code">
5131 <a href="#ipp_t">ipp_t</a> *ippNewRequest(ipp_op_t op);</p>
5132 <h4 class="parameters">Parameters</h4>
5133 <table class="list"><tbody>
5134 <tr><th>op</th>
5135 <td class="description">Operation code</td></tr>
5136 </tbody></table>
5137 <h4 class="returnvalue">Return Value</h4>
5138 <p class="description">IPP request message</p>
5139 <h4 class="discussion">Discussion</h4>
5140 <p class="discussion">The new request message is initialized with the &quot;attributes-charset&quot; and
5141 &quot;attributes-natural-language&quot; attributes added. The
5142 &quot;attributes-natural-language&quot; value is derived from the current locale.
5143
5144 </p>
5145 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippNewResponse">ippNewResponse</a></h3>
5146 <p class="description">Allocate a new IPP response message.</p>
5147 <p class="code">
5148 <a href="#ipp_t">ipp_t</a> *ippNewResponse(<a href="#ipp_t">ipp_t</a> *request);</p>
5149 <h4 class="parameters">Parameters</h4>
5150 <table class="list"><tbody>
5151 <tr><th>request</th>
5152 <td class="description">IPP request message</td></tr>
5153 </tbody></table>
5154 <h4 class="returnvalue">Return Value</h4>
5155 <p class="description">IPP response message</p>
5156 <h4 class="discussion">Discussion</h4>
5157 <p class="discussion">The new response message is initialized with the same &quot;version-number&quot;,
5158 &quot;request-id&quot;, &quot;attributes-charset&quot;, and &quot;attributes-natural-language&quot; as the
5159 provided request message. If the &quot;attributes-charset&quot; or
5160 &quot;attributes-natural-language&quot; attributes are missing from the request,
5161 'utf-8' and a value derived from the current locale are substituted,
5162 respectively.
5163
5164 </p>
5165 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippNextAttribute">ippNextAttribute</a></h3>
5166 <p class="description">Return the next attribute in the message.</p>
5167 <p class="code">
5168 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippNextAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p>
5169 <h4 class="parameters">Parameters</h4>
5170 <table class="list"><tbody>
5171 <tr><th>ipp</th>
5172 <td class="description">IPP message</td></tr>
5173 </tbody></table>
5174 <h4 class="returnvalue">Return Value</h4>
5175 <p class="description">Next attribute or <code>NULL</code> if none</p>
5176 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippOpString">ippOpString</a></h3>
5177 <p class="description">Return a name for the given operation id.</p>
5178 <p class="code">
5179 const char *ippOpString(ipp_op_t op);</p>
5180 <h4 class="parameters">Parameters</h4>
5181 <table class="list"><tbody>
5182 <tr><th>op</th>
5183 <td class="description">Operation ID</td></tr>
5184 </tbody></table>
5185 <h4 class="returnvalue">Return Value</h4>
5186 <p class="description">Name</p>
5187 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippOpValue">ippOpValue</a></h3>
5188 <p class="description">Return an operation id for the given name.</p>
5189 <p class="code">
5190 ipp_op_t ippOpValue(const char *name);</p>
5191 <h4 class="parameters">Parameters</h4>
5192 <table class="list"><tbody>
5193 <tr><th>name</th>
5194 <td class="description">Textual name</td></tr>
5195 </tbody></table>
5196 <h4 class="returnvalue">Return Value</h4>
5197 <p class="description">Operation ID</p>
5198 <h3 class="function"><a id="ippPort">ippPort</a></h3>
5199 <p class="description">Return the default IPP port number.</p>
5200 <p class="code">
5201 int ippPort(void);</p>
5202 <h4 class="returnvalue">Return Value</h4>
5203 <p class="description">Port number</p>
5204 <h3 class="function"><a id="ippRead">ippRead</a></h3>
5205 <p class="description">Read data for an IPP message from a HTTP connection.</p>
5206 <p class="code">
5207 <a href="#ipp_state_t">ipp_state_t</a> ippRead(<a href="#http_t">http_t</a> *http, <a href="#ipp_t">ipp_t</a> *ipp);</p>
5208 <h4 class="parameters">Parameters</h4>
5209 <table class="list"><tbody>
5210 <tr><th>http</th>
5211 <td class="description">HTTP connection</td></tr>
5212 <tr><th>ipp</th>
5213 <td class="description">IPP data</td></tr>
5214 </tbody></table>
5215 <h4 class="returnvalue">Return Value</h4>
5216 <p class="description">Current state</p>
5217 <h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippReadFile">ippReadFile</a></h3>
5218 <p class="description">Read data for an IPP message from a file.</p>
5219 <p class="code">
5220 <a href="#ipp_state_t">ipp_state_t</a> ippReadFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p>
5221 <h4 class="parameters">Parameters</h4>
5222 <table class="list"><tbody>
5223 <tr><th>fd</th>
5224 <td class="description">HTTP data</td></tr>
5225 <tr><th>ipp</th>
5226 <td class="description">IPP data</td></tr>
5227 </tbody></table>
5228 <h4 class="returnvalue">Return Value</h4>
5229 <p class="description">Current state</p>
5230 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippReadIO">ippReadIO</a></h3>
5231 <p class="description">Read data for an IPP message.</p>
5232 <p class="code">
5233 <a href="#ipp_state_t">ipp_state_t</a> ippReadIO(void *src, <a href="#ipp_iocb_t">ipp_iocb_t</a> cb, int blocking, <a href="#ipp_t">ipp_t</a> *parent, <a href="#ipp_t">ipp_t</a> *ipp);</p>
5234 <h4 class="parameters">Parameters</h4>
5235 <table class="list"><tbody>
5236 <tr><th>src</th>
5237 <td class="description">Data source</td></tr>
5238 <tr><th>cb</th>
5239 <td class="description">Read callback function</td></tr>
5240 <tr><th>blocking</th>
5241 <td class="description">Use blocking IO?</td></tr>
5242 <tr><th>parent</th>
5243 <td class="description">Parent request, if any</td></tr>
5244 <tr><th>ipp</th>
5245 <td class="description">IPP data</td></tr>
5246 </tbody></table>
5247 <h4 class="returnvalue">Return Value</h4>
5248 <p class="description">Current state</p>
5249 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetBoolean">ippSetBoolean</a></h3>
5250 <p class="description">Set a boolean value in an attribute.</p>
5251 <p class="code">
5252 int ippSetBoolean(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int boolvalue);</p>
5253 <h4 class="parameters">Parameters</h4>
5254 <table class="list"><tbody>
5255 <tr><th>ipp</th>
5256 <td class="description">IPP message</td></tr>
5257 <tr><th>attr</th>
5258 <td class="description">IPP attribute</td></tr>
5259 <tr><th>element</th>
5260 <td class="description">Value number (0-based)</td></tr>
5261 <tr><th>boolvalue</th>
5262 <td class="description">Boolean value</td></tr>
5263 </tbody></table>
5264 <h4 class="returnvalue">Return Value</h4>
5265 <p class="description">1 on success, 0 on failure</p>
5266 <h4 class="discussion">Discussion</h4>
5267 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5268 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5269 <br>
5270 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5271 <br>
5272 The <code>element</code> parameter specifies which value to set from 0 to
5273 <code>ippGetCount(attr)</code>.
5274
5275 </p>
5276 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetCollection">ippSetCollection</a></h3>
5277 <p class="description">Set a collection value in an attribute.</p>
5278 <p class="code">
5279 int ippSetCollection(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, <a href="#ipp_t">ipp_t</a> *colvalue);</p>
5280 <h4 class="parameters">Parameters</h4>
5281 <table class="list"><tbody>
5282 <tr><th>ipp</th>
5283 <td class="description">IPP message</td></tr>
5284 <tr><th>attr</th>
5285 <td class="description">IPP attribute</td></tr>
5286 <tr><th>element</th>
5287 <td class="description">Value number (0-based)</td></tr>
5288 <tr><th>colvalue</th>
5289 <td class="description">Collection value</td></tr>
5290 </tbody></table>
5291 <h4 class="returnvalue">Return Value</h4>
5292 <p class="description">1 on success, 0 on failure</p>
5293 <h4 class="discussion">Discussion</h4>
5294 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5295 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5296 <br>
5297 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5298 <br>
5299 The <code>element</code> parameter specifies which value to set from 0 to
5300 <code>ippGetCount(attr)</code>.
5301
5302 </p>
5303 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetDate">ippSetDate</a></h3>
5304 <p class="description">Set a dateTime value in an attribute.</p>
5305 <p class="code">
5306 int ippSetDate(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const <a href="#ipp_uchar_t">ipp_uchar_t</a> *datevalue);</p>
5307 <h4 class="parameters">Parameters</h4>
5308 <table class="list"><tbody>
5309 <tr><th>ipp</th>
5310 <td class="description">IPP message</td></tr>
5311 <tr><th>attr</th>
5312 <td class="description">IPP attribute</td></tr>
5313 <tr><th>element</th>
5314 <td class="description">Value number (0-based)</td></tr>
5315 <tr><th>datevalue</th>
5316 <td class="description">dateTime value</td></tr>
5317 </tbody></table>
5318 <h4 class="returnvalue">Return Value</h4>
5319 <p class="description">1 on success, 0 on failure</p>
5320 <h4 class="discussion">Discussion</h4>
5321 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5322 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5323 <br>
5324 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5325 <br>
5326 The <code>element</code> parameter specifies which value to set from 0 to
5327 <code>ippGetCount(attr)</code>.
5328
5329 </p>
5330 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetGroupTag">ippSetGroupTag</a></h3>
5331 <p class="description">Set the group tag of an attribute.</p>
5332 <p class="code">
5333 int ippSetGroupTag(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, ipp_tag_t group_tag);</p>
5334 <h4 class="parameters">Parameters</h4>
5335 <table class="list"><tbody>
5336 <tr><th>ipp</th>
5337 <td class="description">IPP message</td></tr>
5338 <tr><th>attr</th>
5339 <td class="description">Attribute</td></tr>
5340 <tr><th>group_tag</th>
5341 <td class="description">Group tag</td></tr>
5342 </tbody></table>
5343 <h4 class="returnvalue">Return Value</h4>
5344 <p class="description">1 on success, 0 on failure</p>
5345 <h4 class="discussion">Discussion</h4>
5346 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5347 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5348 <br>
5349 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5350 <br>
5351 The <code>group</code> parameter specifies the IPP attribute group tag: none
5352 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
5353 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
5354 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
5355 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
5356
5357 </p>
5358 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetInteger">ippSetInteger</a></h3>
5359 <p class="description">Set an integer or enum value in an attribute.</p>
5360 <p class="code">
5361 int ippSetInteger(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int intvalue);</p>
5362 <h4 class="parameters">Parameters</h4>
5363 <table class="list"><tbody>
5364 <tr><th>ipp</th>
5365 <td class="description">IPP message</td></tr>
5366 <tr><th>attr</th>
5367 <td class="description">IPP attribute</td></tr>
5368 <tr><th>element</th>
5369 <td class="description">Value number (0-based)</td></tr>
5370 <tr><th>intvalue</th>
5371 <td class="description">Integer/enum value</td></tr>
5372 </tbody></table>
5373 <h4 class="returnvalue">Return Value</h4>
5374 <p class="description">1 on success, 0 on failure</p>
5375 <h4 class="discussion">Discussion</h4>
5376 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5377 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5378 <br>
5379 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5380 <br>
5381 The <code>element</code> parameter specifies which value to set from 0 to
5382 <code>ippGetCount(attr)</code>.
5383
5384 </p>
5385 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetName">ippSetName</a></h3>
5386 <p class="description">Set the name of an attribute.</p>
5387 <p class="code">
5388 int ippSetName(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, const char *name);</p>
5389 <h4 class="parameters">Parameters</h4>
5390 <table class="list"><tbody>
5391 <tr><th>ipp</th>
5392 <td class="description">IPP message</td></tr>
5393 <tr><th>attr</th>
5394 <td class="description">IPP attribute</td></tr>
5395 <tr><th>name</th>
5396 <td class="description">Attribute name</td></tr>
5397 </tbody></table>
5398 <h4 class="returnvalue">Return Value</h4>
5399 <p class="description">1 on success, 0 on failure</p>
5400 <h4 class="discussion">Discussion</h4>
5401 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5402 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5403 <br>
5404 The <code>attr</code> parameter may be modified as a result of setting the value.
5405
5406 </p>
5407 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetOctetString">ippSetOctetString</a></h3>
5408 <p class="description">Set an octetString value in an IPP attribute.</p>
5409 <p class="code">
5410 int ippSetOctetString(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const void *data, int datalen);</p>
5411 <h4 class="parameters">Parameters</h4>
5412 <table class="list"><tbody>
5413 <tr><th>ipp</th>
5414 <td class="description">IPP message</td></tr>
5415 <tr><th>attr</th>
5416 <td class="description">IPP attribute</td></tr>
5417 <tr><th>element</th>
5418 <td class="description">Value number (0-based)</td></tr>
5419 <tr><th>data</th>
5420 <td class="description">Pointer to octetString data</td></tr>
5421 <tr><th>datalen</th>
5422 <td class="description">Length of octetString data</td></tr>
5423 </tbody></table>
5424 <h4 class="returnvalue">Return Value</h4>
5425 <p class="description">1 on success, 0 on failure</p>
5426 <h4 class="discussion">Discussion</h4>
5427 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5428 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5429 <br>
5430 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5431 <br>
5432 The <code>element</code> parameter specifies which value to set from 0 to
5433 <code>ippGetCount(attr)</code>.
5434
5435 </p>
5436 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetOperation">ippSetOperation</a></h3>
5437 <p class="description">Set the operation ID in an IPP request message.</p>
5438 <p class="code">
5439 int ippSetOperation(<a href="#ipp_t">ipp_t</a> *ipp, ipp_op_t op);</p>
5440 <h4 class="parameters">Parameters</h4>
5441 <table class="list"><tbody>
5442 <tr><th>ipp</th>
5443 <td class="description">IPP request message</td></tr>
5444 <tr><th>op</th>
5445 <td class="description">Operation ID</td></tr>
5446 </tbody></table>
5447 <h4 class="returnvalue">Return Value</h4>
5448 <p class="description">1 on success, 0 on failure</p>
5449 <h4 class="discussion">Discussion</h4>
5450 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5451 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
5452
5453 </p>
5454 <h3 class="function"><a id="ippSetPort">ippSetPort</a></h3>
5455 <p class="description">Set the default port number.</p>
5456 <p class="code">
5457 void ippSetPort(int p);</p>
5458 <h4 class="parameters">Parameters</h4>
5459 <table class="list"><tbody>
5460 <tr><th>p</th>
5461 <td class="description">Port number to use</td></tr>
5462 </tbody></table>
5463 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetRange">ippSetRange</a></h3>
5464 <p class="description">Set a rangeOfInteger value in an attribute.</p>
5465 <p class="code">
5466 int ippSetRange(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int lowervalue, int uppervalue);</p>
5467 <h4 class="parameters">Parameters</h4>
5468 <table class="list"><tbody>
5469 <tr><th>ipp</th>
5470 <td class="description">IPP message</td></tr>
5471 <tr><th>attr</th>
5472 <td class="description">IPP attribute</td></tr>
5473 <tr><th>element</th>
5474 <td class="description">Value number (0-based)</td></tr>
5475 <tr><th>lowervalue</th>
5476 <td class="description">Lower bound for range</td></tr>
5477 <tr><th>uppervalue</th>
5478 <td class="description">Upper bound for range</td></tr>
5479 </tbody></table>
5480 <h4 class="returnvalue">Return Value</h4>
5481 <p class="description">1 on success, 0 on failure</p>
5482 <h4 class="discussion">Discussion</h4>
5483 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5484 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5485 <br>
5486 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5487 <br>
5488 The <code>element</code> parameter specifies which value to set from 0 to
5489 <code>ippGetCount(attr)</code>.
5490
5491 </p>
5492 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetRequestId">ippSetRequestId</a></h3>
5493 <p class="description">Set the request ID in an IPP message.</p>
5494 <p class="code">
5495 int ippSetRequestId(<a href="#ipp_t">ipp_t</a> *ipp, int request_id);</p>
5496 <h4 class="parameters">Parameters</h4>
5497 <table class="list"><tbody>
5498 <tr><th>ipp</th>
5499 <td class="description">IPP message</td></tr>
5500 <tr><th>request_id</th>
5501 <td class="description">Request ID</td></tr>
5502 </tbody></table>
5503 <h4 class="returnvalue">Return Value</h4>
5504 <p class="description">1 on success, 0 on failure</p>
5505 <h4 class="discussion">Discussion</h4>
5506 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5507 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5508 <br>
5509 The <code>request_id</code> parameter must be greater than 0.
5510
5511 </p>
5512 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetResolution">ippSetResolution</a></h3>
5513 <p class="description">Set a resolution value in an attribute.</p>
5514 <p class="code">
5515 int ippSetResolution(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, <a href="#ipp_res_t">ipp_res_t</a> unitsvalue, int xresvalue, int yresvalue);</p>
5516 <h4 class="parameters">Parameters</h4>
5517 <table class="list"><tbody>
5518 <tr><th>ipp</th>
5519 <td class="description">IPP message</td></tr>
5520 <tr><th>attr</th>
5521 <td class="description">IPP attribute</td></tr>
5522 <tr><th>element</th>
5523 <td class="description">Value number (0-based)</td></tr>
5524 <tr><th>unitsvalue</th>
5525 <td class="description">Resolution units</td></tr>
5526 <tr><th>xresvalue</th>
5527 <td class="description">Horizontal/cross feed resolution</td></tr>
5528 <tr><th>yresvalue</th>
5529 <td class="description">Vertical/feed resolution</td></tr>
5530 </tbody></table>
5531 <h4 class="returnvalue">Return Value</h4>
5532 <p class="description">1 on success, 0 on failure</p>
5533 <h4 class="discussion">Discussion</h4>
5534 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5535 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5536 <br>
5537 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5538 <br>
5539 The <code>element</code> parameter specifies which value to set from 0 to
5540 <code>ippGetCount(attr)</code>.
5541
5542 </p>
5543 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetState">ippSetState</a></h3>
5544 <p class="description">Set the current state of the IPP message.</p>
5545 <p class="code">
5546 int ippSetState(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_state_t">ipp_state_t</a> state);</p>
5547 <h4 class="parameters">Parameters</h4>
5548 <table class="list"><tbody>
5549 <tr><th>ipp</th>
5550 <td class="description">IPP message</td></tr>
5551 <tr><th>state</th>
5552 <td class="description">IPP state value</td></tr>
5553 </tbody></table>
5554 <h4 class="returnvalue">Return Value</h4>
5555 <p class="description">1 on success, 0 on failure</p>
5556 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetStatusCode">ippSetStatusCode</a></h3>
5557 <p class="description">Set the status code in an IPP response or event message.</p>
5558 <p class="code">
5559 int ippSetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp, ipp_status_t status);</p>
5560 <h4 class="parameters">Parameters</h4>
5561 <table class="list"><tbody>
5562 <tr><th>ipp</th>
5563 <td class="description">IPP response or event message</td></tr>
5564 <tr><th>status</th>
5565 <td class="description">Status code</td></tr>
5566 </tbody></table>
5567 <h4 class="returnvalue">Return Value</h4>
5568 <p class="description">1 on success, 0 on failure</p>
5569 <h4 class="discussion">Discussion</h4>
5570 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5571 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
5572
5573 </p>
5574 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetString">ippSetString</a></h3>
5575 <p class="description">Set a string value in an attribute.</p>
5576 <p class="code">
5577 int ippSetString(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const char *strvalue);</p>
5578 <h4 class="parameters">Parameters</h4>
5579 <table class="list"><tbody>
5580 <tr><th>ipp</th>
5581 <td class="description">IPP message</td></tr>
5582 <tr><th>attr</th>
5583 <td class="description">IPP attribute</td></tr>
5584 <tr><th>element</th>
5585 <td class="description">Value number (0-based)</td></tr>
5586 <tr><th>strvalue</th>
5587 <td class="description">String value</td></tr>
5588 </tbody></table>
5589 <h4 class="returnvalue">Return Value</h4>
5590 <p class="description">1 on success, 0 on failure</p>
5591 <h4 class="discussion">Discussion</h4>
5592 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5593 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5594 <br>
5595 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5596 <br>
5597 The <code>element</code> parameter specifies which value to set from 0 to
5598 <code>ippGetCount(attr)</code>.
5599
5600 </p>
5601 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetStringf">ippSetStringf</a></h3>
5602 <p class="description">Set a formatted string value of an attribute.</p>
5603 <p class="code">
5604 int ippSetStringf(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const char *format, ...);</p>
5605 <h4 class="parameters">Parameters</h4>
5606 <table class="list"><tbody>
5607 <tr><th>ipp</th>
5608 <td class="description">IPP message</td></tr>
5609 <tr><th>attr</th>
5610 <td class="description">IPP attribute</td></tr>
5611 <tr><th>element</th>
5612 <td class="description">Value number (0-based)</td></tr>
5613 <tr><th>format</th>
5614 <td class="description">Printf-style format string</td></tr>
5615 <tr><th>...</th>
5616 <td class="description">Additional arguments as needed</td></tr>
5617 </tbody></table>
5618 <h4 class="returnvalue">Return Value</h4>
5619 <p class="description">1 on success, 0 on failure</p>
5620 <h4 class="discussion">Discussion</h4>
5621 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5622 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5623 <br>
5624 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5625 <br>
5626 The <code>element</code> parameter specifies which value to set from 0 to
5627 <code>ippGetCount(attr)</code>.<br>
5628 <br>
5629 The <code>format</code> parameter uses formatting characters compatible with the
5630 printf family of standard functions. Additional arguments follow it as
5631 needed. The formatted string is truncated as needed to the maximum length of
5632 the corresponding value type.
5633
5634 </p>
5635 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetStringfv">ippSetStringfv</a></h3>
5636 <p class="description">Set a formatted string value of an attribute.</p>
5637 <p class="code">
5638 int ippSetStringfv(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const char *format, va_list ap);</p>
5639 <h4 class="parameters">Parameters</h4>
5640 <table class="list"><tbody>
5641 <tr><th>ipp</th>
5642 <td class="description">IPP message</td></tr>
5643 <tr><th>attr</th>
5644 <td class="description">IPP attribute</td></tr>
5645 <tr><th>element</th>
5646 <td class="description">Value number (0-based)</td></tr>
5647 <tr><th>format</th>
5648 <td class="description">Printf-style format string</td></tr>
5649 <tr><th>ap</th>
5650 <td class="description">Pointer to additional arguments</td></tr>
5651 </tbody></table>
5652 <h4 class="returnvalue">Return Value</h4>
5653 <p class="description">1 on success, 0 on failure</p>
5654 <h4 class="discussion">Discussion</h4>
5655 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5656 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5657 <br>
5658 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5659 <br>
5660 The <code>element</code> parameter specifies which value to set from 0 to
5661 <code>ippGetCount(attr)</code>.<br>
5662 <br>
5663 The <code>format</code> parameter uses formatting characters compatible with the
5664 printf family of standard functions. Additional arguments follow it as
5665 needed. The formatted string is truncated as needed to the maximum length of
5666 the corresponding value type.
5667
5668 </p>
5669 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetValueTag">ippSetValueTag</a></h3>
5670 <p class="description">Set the value tag of an attribute.</p>
5671 <p class="code">
5672 int ippSetValueTag(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, ipp_tag_t value_tag);</p>
5673 <h4 class="parameters">Parameters</h4>
5674 <table class="list"><tbody>
5675 <tr><th>ipp</th>
5676 <td class="description">IPP message</td></tr>
5677 <tr><th>attr</th>
5678 <td class="description">IPP attribute</td></tr>
5679 <tr><th>value_tag</th>
5680 <td class="description">Value tag</td></tr>
5681 </tbody></table>
5682 <h4 class="returnvalue">Return Value</h4>
5683 <p class="description">1 on success, 0 on failure</p>
5684 <h4 class="discussion">Discussion</h4>
5685 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5686 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5687 <br>
5688 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5689 <br>
5690 Integer (<code>IPP_TAG_INTEGER</code>) values can be promoted to rangeOfInteger
5691 (<code>IPP_TAG_RANGE</code>) values, the various string tags can be promoted to name
5692 (<code>IPP_TAG_NAME</code>) or nameWithLanguage (<code>IPP_TAG_NAMELANG</code>) values, text
5693 (<code>IPP_TAG_TEXT</code>) values can be promoted to textWithLanguage
5694 (<code>IPP_TAG_TEXTLANG</code>) values, and all values can be demoted to the various
5695 out-of-band value tags such as no-value (<code>IPP_TAG_NOVALUE</code>). All other changes
5696 will be rejected.<br>
5697 <br>
5698 Promoting a string attribute to nameWithLanguage or textWithLanguage adds the language
5699 code in the &quot;attributes-natural-language&quot; attribute or, if not present, the language
5700 code for the current locale.
5701
5702 </p>
5703 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetVersion">ippSetVersion</a></h3>
5704 <p class="description">Set the version number in an IPP message.</p>
5705 <p class="code">
5706 int ippSetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int major, int minor);</p>
5707 <h4 class="parameters">Parameters</h4>
5708 <table class="list"><tbody>
5709 <tr><th>ipp</th>
5710 <td class="description">IPP message</td></tr>
5711 <tr><th>major</th>
5712 <td class="description">Major version number (major.minor)</td></tr>
5713 <tr><th>minor</th>
5714 <td class="description">Minor version number (major.minor)</td></tr>
5715 </tbody></table>
5716 <h4 class="returnvalue">Return Value</h4>
5717 <p class="description">1 on success, 0 on failure</p>
5718 <h4 class="discussion">Discussion</h4>
5719 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5720 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5721 <br>
5722 The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2.
5723
5724 </p>
5725 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="ippStateString">ippStateString</a></h3>
5726 <p class="description">Return the name corresponding to a state value.</p>
5727 <p class="code">
5728 const char *ippStateString(<a href="#ipp_state_t">ipp_state_t</a> state);</p>
5729 <h4 class="parameters">Parameters</h4>
5730 <table class="list"><tbody>
5731 <tr><th>state</th>
5732 <td class="description">State value</td></tr>
5733 </tbody></table>
5734 <h4 class="returnvalue">Return Value</h4>
5735 <p class="description">State name</p>
5736 <h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="ippTagString">ippTagString</a></h3>
5737 <p class="description">Return the tag name corresponding to a tag value.</p>
5738 <p class="code">
5739 const char *ippTagString(ipp_tag_t tag);</p>
5740 <h4 class="parameters">Parameters</h4>
5741 <table class="list"><tbody>
5742 <tr><th>tag</th>
5743 <td class="description">Tag value</td></tr>
5744 </tbody></table>
5745 <h4 class="returnvalue">Return Value</h4>
5746 <p class="description">Tag name</p>
5747 <h4 class="discussion">Discussion</h4>
5748 <p class="discussion">The returned names are defined in RFC 8011 and the IANA IPP Registry.
5749
5750 </p>
5751 <h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="ippTagValue">ippTagValue</a></h3>
5752 <p class="description">Return the tag value corresponding to a tag name.</p>
5753 <p class="code">
5754 ipp_tag_t ippTagValue(const char *name);</p>
5755 <h4 class="parameters">Parameters</h4>
5756 <table class="list"><tbody>
5757 <tr><th>name</th>
5758 <td class="description">Tag name</td></tr>
5759 </tbody></table>
5760 <h4 class="returnvalue">Return Value</h4>
5761 <p class="description">Tag value</p>
5762 <h4 class="discussion">Discussion</h4>
5763 <p class="discussion">The tag names are defined in RFC 8011 and the IANA IPP Registry.
5764
5765 </p>
5766 <h3 class="function"><a id="ippTimeToDate">ippTimeToDate</a></h3>
5767 <p class="description">Convert from time in seconds to RFC 2579 format.</p>
5768 <p class="code">
5769 const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippTimeToDate(time_t t);</p>
5770 <h4 class="parameters">Parameters</h4>
5771 <table class="list"><tbody>
5772 <tr><th>t</th>
5773 <td class="description">Time in seconds</td></tr>
5774 </tbody></table>
5775 <h4 class="returnvalue">Return Value</h4>
5776 <p class="description">RFC-2579 date/time data</p>
5777 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippValidateAttribute">ippValidateAttribute</a></h3>
5778 <p class="description">Validate the contents of an attribute.</p>
5779 <p class="code">
5780 int ippValidateAttribute(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
5781 <h4 class="parameters">Parameters</h4>
5782 <table class="list"><tbody>
5783 <tr><th>attr</th>
5784 <td class="description">Attribute</td></tr>
5785 </tbody></table>
5786 <h4 class="returnvalue">Return Value</h4>
5787 <p class="description">1 if valid, 0 otherwise</p>
5788 <h4 class="discussion">Discussion</h4>
5789 <p class="discussion">This function validates the contents of an attribute based on the name and
5790 value tag. 1 is returned if the attribute is valid, 0 otherwise. On
5791 failure, <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> is set to a human-readable message.
5792
5793 </p>
5794 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippValidateAttributes">ippValidateAttributes</a></h3>
5795 <p class="description">Validate all attributes in an IPP message.</p>
5796 <p class="code">
5797 int ippValidateAttributes(<a href="#ipp_t">ipp_t</a> *ipp);</p>
5798 <h4 class="parameters">Parameters</h4>
5799 <table class="list"><tbody>
5800 <tr><th>ipp</th>
5801 <td class="description">IPP message</td></tr>
5802 </tbody></table>
5803 <h4 class="returnvalue">Return Value</h4>
5804 <p class="description">1 if valid, 0 otherwise</p>
5805 <h4 class="discussion">Discussion</h4>
5806 <p class="discussion">This function validates the contents of the IPP message, including each
5807 attribute. Like <a href="#ippValidateAttribute"><code>ippValidateAttribute</code></a>, <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> is
5808 set to a human-readable message on failure.
5809
5810 </p>
5811 <h3 class="function"><a id="ippWrite">ippWrite</a></h3>
5812 <p class="description">Write data for an IPP message to a HTTP connection.</p>
5813 <p class="code">
5814 <a href="#ipp_state_t">ipp_state_t</a> ippWrite(<a href="#http_t">http_t</a> *http, <a href="#ipp_t">ipp_t</a> *ipp);</p>
5815 <h4 class="parameters">Parameters</h4>
5816 <table class="list"><tbody>
5817 <tr><th>http</th>
5818 <td class="description">HTTP connection</td></tr>
5819 <tr><th>ipp</th>
5820 <td class="description">IPP data</td></tr>
5821 </tbody></table>
5822 <h4 class="returnvalue">Return Value</h4>
5823 <p class="description">Current state</p>
5824 <h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippWriteFile">ippWriteFile</a></h3>
5825 <p class="description">Write data for an IPP message to a file.</p>
5826 <p class="code">
5827 <a href="#ipp_state_t">ipp_state_t</a> ippWriteFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p>
5828 <h4 class="parameters">Parameters</h4>
5829 <table class="list"><tbody>
5830 <tr><th>fd</th>
5831 <td class="description">HTTP data</td></tr>
5832 <tr><th>ipp</th>
5833 <td class="description">IPP data</td></tr>
5834 </tbody></table>
5835 <h4 class="returnvalue">Return Value</h4>
5836 <p class="description">Current state</p>
5837 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippWriteIO">ippWriteIO</a></h3>
5838 <p class="description">Write data for an IPP message.</p>
5839 <p class="code">
5840 <a href="#ipp_state_t">ipp_state_t</a> ippWriteIO(void *dst, <a href="#ipp_iocb_t">ipp_iocb_t</a> cb, int blocking, <a href="#ipp_t">ipp_t</a> *parent, <a href="#ipp_t">ipp_t</a> *ipp);</p>
5841 <h4 class="parameters">Parameters</h4>
5842 <table class="list"><tbody>
5843 <tr><th>dst</th>
5844 <td class="description">Destination</td></tr>
5845 <tr><th>cb</th>
5846 <td class="description">Write callback function</td></tr>
5847 <tr><th>blocking</th>
5848 <td class="description">Use blocking IO?</td></tr>
5849 <tr><th>parent</th>
5850 <td class="description">Parent IPP message</td></tr>
5851 <tr><th>ipp</th>
5852 <td class="description">IPP data</td></tr>
5853 </tbody></table>
5854 <h4 class="returnvalue">Return Value</h4>
5855 <p class="description">Current state</p>
5856 <h2 class="title"><a id="TYPES">Data Types</a></h2>
5857 <h3 class="typedef"><a id="cups_client_cert_cb_t"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span>cups_client_cert_cb_t</a></h3>
5858 <p class="description">Client credentials callback
5859 </p>
5860 <p class="code">
5861 typedef int(*)(http_t *http, void *tls, cups_array_t *distinguished_names, void *user_data)cups_client_cert_cb_t;
5862 </p>
5863 <h3 class="typedef"><a id="cups_dest_cb_t"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span>cups_dest_cb_t</a></h3>
5864 <p class="description">Destination enumeration callback
5865 </p>
5866 <p class="code">
5867 typedef int(*)(void *user_data, unsigned flags, <a href="#cups_dest_t">cups_dest_t</a> *dest)cups_dest_cb_t;
5868 </p>
5869 <h3 class="typedef"><a id="cups_dest_t">cups_dest_t</a></h3>
5870 <p class="description">Destination</p>
5871 <p class="code">
5872 typedef struct <a href="#cups_dest_s">cups_dest_s</a> cups_dest_t;
5873 </p>
5874 <h3 class="typedef"><a id="cups_dinfo_t"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span>cups_dinfo_t</a></h3>
5875 <p class="description">Destination capability and status
5876 information </p>
5877 <p class="code">
5878 typedef struct _cups_dinfo_s cups_dinfo_t;
5879 </p>
5880 <h3 class="typedef"><a id="cups_job_t">cups_job_t</a></h3>
5881 <p class="description">Job</p>
5882 <p class="code">
5883 typedef struct <a href="#cups_job_s">cups_job_s</a> cups_job_t;
5884 </p>
5885 <h3 class="typedef"><a id="cups_option_t">cups_option_t</a></h3>
5886 <p class="description">Printer Options</p>
5887 <p class="code">
5888 typedef struct <a href="#cups_option_s">cups_option_s</a> cups_option_t;
5889 </p>
5890 <h3 class="typedef"><a id="cups_password_cb2_t"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span>cups_password_cb2_t</a></h3>
5891 <p class="description">New password callback
5892 </p>
5893 <p class="code">
5894 typedef const char *(*)(const char *prompt, <a href="#http_t">http_t</a> *http, const char *method, const char *resource, void *user_data)cups_password_cb2_t;
5895 </p>
5896 <h3 class="typedef"><a id="cups_ptype_t">cups_ptype_t</a></h3>
5897 <p class="description">Printer type/capability bits</p>
5898 <p class="code">
5899 typedef unsigned cups_ptype_t;
5900 </p>
5901 <h3 class="typedef"><a id="cups_server_cert_cb_t"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span>cups_server_cert_cb_t</a></h3>
5902 <p class="description">Server credentials callback
5903 </p>
5904 <p class="code">
5905 typedef int(*)(http_t *http, void *tls, cups_array_t *certs, void *user_data)cups_server_cert_cb_t;
5906 </p>
5907 <h3 class="typedef"><a id="cups_size_t"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span>cups_size_t</a></h3>
5908 <p class="description">Media Size </p>
5909 <p class="code">
5910 typedef struct <a href="#cups_size_s">cups_size_s</a> cups_size_t;
5911 </p>
5912 <h3 class="typedef"><a id="http_addr_t"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span>http_addr_t</a></h3>
5913 <p class="description">Socket address union, which
5914 makes using IPv6 and other
5915 address types easier and
5916 more portable. </p>
5917 <p class="code">
5918 typedef union _http_addr_u / http_addr_t;
5919 </p>
5920 <h3 class="typedef"><a id="http_encoding_t">http_encoding_t</a></h3>
5921 <p class="description">HTTP transfer encoding values</p>
5922 <p class="code">
5923 typedef enum <a href="#http_encoding_e">http_encoding_e</a> http_encoding_t;
5924 </p>
5925 <h3 class="typedef"><a id="http_encryption_t">http_encryption_t</a></h3>
5926 <p class="description">HTTP encryption values</p>
5927 <p class="code">
5928 typedef enum <a href="#http_encryption_e">http_encryption_e</a> http_encryption_t;
5929 </p>
5930 <h3 class="typedef"><a id="http_field_t">http_field_t</a></h3>
5931 <p class="description">HTTP field names</p>
5932 <p class="code">
5933 typedef enum <a href="#http_field_e">http_field_e</a> http_field_t;
5934 </p>
5935 <h3 class="typedef"><a id="http_keepalive_t">http_keepalive_t</a></h3>
5936 <p class="description">HTTP keep-alive values</p>
5937 <p class="code">
5938 typedef enum <a href="#http_keepalive_e">http_keepalive_e</a> http_keepalive_t;
5939 </p>
5940 <h3 class="typedef"><a id="http_state_t">http_state_t</a></h3>
5941 <p class="description">HTTP state values; states
5942 are server-oriented...</p>
5943 <p class="code">
5944 typedef enum <a href="#http_state_e">http_state_e</a> http_state_t;
5945 </p>
5946 <h3 class="typedef"><a id="http_t">http_t</a></h3>
5947 <p class="description">HTTP connection type</p>
5948 <p class="code">
5949 typedef struct _http_s http_t;
5950 </p>
5951 <h3 class="typedef"><a id="http_timeout_cb_t"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span>http_timeout_cb_t</a></h3>
5952 <p class="description">HTTP timeout callback </p>
5953 <p class="code">
5954 typedef int(*)(http_t *http, void *user_data)http_timeout_cb_t;
5955 </p>
5956 <h3 class="typedef"><a id="http_trust_t"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span>http_trust_t</a></h3>
5957 <p class="description">Level of trust for credentials </p>
5958 <p class="code">
5959 typedef enum <a href="#http_trust_e">http_trust_e</a> http_trust_t;
5960 </p>
5961 <h3 class="typedef"><a id="http_uri_coding_t">http_uri_coding_t</a></h3>
5962 <p class="description">URI en/decode flags</p>
5963 <p class="code">
5964 typedef enum <a href="#http_uri_coding_e">http_uri_coding_e</a> http_uri_coding_t;
5965 </p>
5966 <h3 class="typedef"><a id="http_uri_status_t"><span class="info">&#160;CUPS 1.2&#160;</span>http_uri_status_t</a></h3>
5967 <p class="description">URI separation status </p>
5968 <p class="code">
5969 typedef enum <a href="#http_uri_status_e">http_uri_status_e</a> http_uri_status_t;
5970 </p>
5971 <h3 class="typedef"><a id="ipp_attribute_t">ipp_attribute_t</a></h3>
5972 <p class="description">IPP attribute</p>
5973 <p class="code">
5974 typedef struct _ipp_attribute_s ipp_attribute_t;
5975 </p>
5976 <h3 class="typedef"><a id="ipp_copycb_t"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span>ipp_copycb_t</a></h3>
5977 <p class="description">ippCopyAttributes callback function </p>
5978 <p class="code">
5979 typedef int(*)(void *context, <a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr)ipp_copycb_t;
5980 </p>
5981 <h3 class="typedef"><a id="ipp_iocb_t"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span>ipp_iocb_t</a></h3>
5982 <p class="description">ippReadIO/ippWriteIO callback function </p>
5983 <p class="code">
5984 typedef ssize_t(*)(void *context, ipp_uchar_t *buffer, size_t bytes) ipp_iocb_t;
5985 </p>
5986 <h3 class="typedef"><a id="ipp_orient_t">ipp_orient_t</a></h3>
5987 <p class="description">Orientation values</p>
5988 <p class="code">
5989 typedef enum <a href="#ipp_orient_e">ipp_orient_e</a> ipp_orient_t;
5990 </p>
5991 <h3 class="typedef"><a id="ipp_pstate_t">ipp_pstate_t</a></h3>
5992 <p class="description">Printer state values</p>
5993 <p class="code">
5994 typedef enum <a href="#ipp_pstate_e">ipp_pstate_e</a> ipp_pstate_t;
5995 </p>
5996 <h3 class="typedef"><a id="ipp_quality_t">ipp_quality_t</a></h3>
5997 <p class="description">Print quality values</p>
5998 <p class="code">
5999 typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t;
6000 </p>
6001 <h3 class="typedef"><a id="ipp_res_t">ipp_res_t</a></h3>
6002 <p class="description">Resolution units</p>
6003 <p class="code">
6004 typedef enum <a href="#ipp_res_e">ipp_res_e</a> ipp_res_t;
6005 </p>
6006 <h3 class="typedef"><a id="ipp_rstate_t">ipp_rstate_t</a></h3>
6007 <p class="description">resource-state values</p>
6008 <p class="code">
6009 typedef enum <a href="#ipp_rstate_e">ipp_rstate_e</a> ipp_rstate_t;
6010 </p>
6011 <h3 class="typedef"><a id="ipp_sstate_t">ipp_sstate_t</a></h3>
6012 <p class="description">system-state values</p>
6013 <p class="code">
6014 typedef enum <a href="#ipp_sstate_e">ipp_sstate_e</a> ipp_sstate_t;
6015 </p>
6016 <h3 class="typedef"><a id="ipp_state_t">ipp_state_t</a></h3>
6017 <p class="description">ipp_t state values</p>
6018 <p class="code">
6019 typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t;
6020 </p>
6021 <h3 class="typedef"><a id="ipp_t">ipp_t</a></h3>
6022 <p class="description">IPP request/response data</p>
6023 <p class="code">
6024 typedef struct _ipp_s ipp_t;
6025 </p>
6026 <h2 class="title"><a id="STRUCTURES">Structures</a></h2>
6027 <h3 class="struct"><a id="cups_dest_s">cups_dest_s</a></h3>
6028 <p class="description">Destination</p>
6029 <p class="code">struct cups_dest_s {<br>
6030 &#160;&#160;&#160;&#160;char *name, *instance;<br>
6031 &#160;&#160;&#160;&#160;int is_default;<br>
6032 &#160;&#160;&#160;&#160;int num_options;<br>
6033 &#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options;<br>
6034 };</p>
6035 <h4 class="members">Members</h4>
6036 <table class="list"><tbody>
6037 <tr><th>instance </th>
6038 <td class="description">Local instance name or NULL</td></tr>
6039 <tr><th>is_default </th>
6040 <td class="description">Is this printer the default?</td></tr>
6041 <tr><th>num_options </th>
6042 <td class="description">Number of options</td></tr>
6043 <tr><th>options </th>
6044 <td class="description">Options</td></tr>
6045 </tbody></table>
6046 <h3 class="struct"><a id="cups_job_s">cups_job_s</a></h3>
6047 <p class="description">Job</p>
6048 <p class="code">struct cups_job_s {<br>
6049 &#160;&#160;&#160;&#160;time_t completed_time;<br>
6050 &#160;&#160;&#160;&#160;time_t creation_time;<br>
6051 &#160;&#160;&#160;&#160;char *dest;<br>
6052 &#160;&#160;&#160;&#160;char *format;<br>
6053 &#160;&#160;&#160;&#160;int id;<br>
6054 &#160;&#160;&#160;&#160;int priority;<br>
6055 &#160;&#160;&#160;&#160;time_t processing_time;<br>
6056 &#160;&#160;&#160;&#160;int size;<br>
6057 &#160;&#160;&#160;&#160;ipp_jstate_t state;<br>
6058 &#160;&#160;&#160;&#160;char *title;<br>
6059 &#160;&#160;&#160;&#160;char *user;<br>
6060 };</p>
6061 <h4 class="members">Members</h4>
6062 <table class="list"><tbody>
6063 <tr><th>completed_time </th>
6064 <td class="description">Time the job was completed</td></tr>
6065 <tr><th>creation_time </th>
6066 <td class="description">Time the job was created</td></tr>
6067 <tr><th>dest </th>
6068 <td class="description">Printer or class name</td></tr>
6069 <tr><th>format </th>
6070 <td class="description">Document format</td></tr>
6071 <tr><th>id </th>
6072 <td class="description">The job ID</td></tr>
6073 <tr><th>priority </th>
6074 <td class="description">Priority (1-100)</td></tr>
6075 <tr><th>processing_time </th>
6076 <td class="description">Time the job was processed</td></tr>
6077 <tr><th>size </th>
6078 <td class="description">Size in kilobytes</td></tr>
6079 <tr><th>state </th>
6080 <td class="description">Job state</td></tr>
6081 <tr><th>title </th>
6082 <td class="description">Title/job name</td></tr>
6083 <tr><th>user </th>
6084 <td class="description">User that submitted the job</td></tr>
6085 </tbody></table>
6086 <h3 class="struct"><a id="cups_option_s">cups_option_s</a></h3>
6087 <p class="description">Printer Options</p>
6088 <p class="code">struct cups_option_s {<br>
6089 &#160;&#160;&#160;&#160;char *name;<br>
6090 &#160;&#160;&#160;&#160;char *value;<br>
6091 };</p>
6092 <h4 class="members">Members</h4>
6093 <table class="list"><tbody>
6094 <tr><th>name </th>
6095 <td class="description">Name of option</td></tr>
6096 <tr><th>value </th>
6097 <td class="description">Value of option</td></tr>
6098 </tbody></table>
6099 <h3 class="struct"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cups_size_s">cups_size_s</a></h3>
6100 <p class="description">Media Size </p>
6101 <p class="code">struct cups_size_s {<br>
6102 &#160;&#160;&#160;&#160;char media[128];<br>
6103 &#160;&#160;&#160;&#160;int width, length, bottom, left, right, top;<br>
6104 };</p>
6105 <h4 class="members">Members</h4>
6106 <table class="list"><tbody>
6107 <tr><th>media[128] </th>
6108 <td class="description">Media name to use</td></tr>
6109 <tr><th>top </th>
6110 <td class="description">Top margin in hundredths of
6111 millimeters</td></tr>
6112 </tbody></table>
6113 <h2 class="title"><a id="ENUMERATIONS">Constants</a></h2>
6114 <h3 class="enumeration"><a id="cups_ptype_e">cups_ptype_e</a></h3>
6115 <p class="description">Printer type/capability bit
6116 constants</p>
6117 <h4 class="constants">Constants</h4>
6118 <table class="list"><tbody>
6119 <tr><th>CUPS_PRINTER_AUTHENTICATED <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Printer requires authentication
6120 </td></tr>
6121 <tr><th>CUPS_PRINTER_BIND </th> <td class="description">Can bind output</td></tr>
6122 <tr><th>CUPS_PRINTER_BW </th> <td class="description">Can do B&amp;W printing</td></tr>
6123 <tr><th>CUPS_PRINTER_CLASS </th> <td class="description">Printer class</td></tr>
6124 <tr><th>CUPS_PRINTER_COLLATE </th> <td class="description">Can quickly collate copies</td></tr>
6125 <tr><th>CUPS_PRINTER_COLOR </th> <td class="description">Can do color printing</td></tr>
6126 <tr><th>CUPS_PRINTER_COMMANDS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Printer supports maintenance commands
6127 </td></tr>
6128 <tr><th>CUPS_PRINTER_COPIES </th> <td class="description">Can do copies in hardware</td></tr>
6129 <tr><th>CUPS_PRINTER_COVER </th> <td class="description">Can cover output</td></tr>
6130 <tr><th>CUPS_PRINTER_DEFAULT </th> <td class="description">Default printer on network</td></tr>
6131 <tr><th>CUPS_PRINTER_DISCOVERED <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Printer was discovered </td></tr>
6132 <tr><th>CUPS_PRINTER_DUPLEX </th> <td class="description">Can do two-sided printing</td></tr>
6133 <tr><th>CUPS_PRINTER_FAX </th> <td class="description">Fax queue</td></tr>
6134 <tr><th>CUPS_PRINTER_LARGE </th> <td class="description">Can print on D/E/A1/A0-size media</td></tr>
6135 <tr><th>CUPS_PRINTER_LOCAL </th> <td class="description">Local printer or class</td></tr>
6136 <tr><th>CUPS_PRINTER_MEDIUM </th> <td class="description">Can print on Tabloid/B/C/A3/A2-size media</td></tr>
6137 <tr><th>CUPS_PRINTER_NOT_SHARED <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Printer is not shared
6138 </td></tr>
6139 <tr><th>CUPS_PRINTER_PUNCH </th> <td class="description">Can punch output</td></tr>
6140 <tr><th>CUPS_PRINTER_REJECTING </th> <td class="description">Printer is rejecting jobs</td></tr>
6141 <tr><th>CUPS_PRINTER_REMOTE </th> <td class="description">Remote printer or class</td></tr>
6142 <tr><th>CUPS_PRINTER_SMALL </th> <td class="description">Can print on Letter/Legal/A4-size media</td></tr>
6143 <tr><th>CUPS_PRINTER_SORT </th> <td class="description">Can sort output</td></tr>
6144 <tr><th>CUPS_PRINTER_STAPLE </th> <td class="description">Can staple output</td></tr>
6145 <tr><th>CUPS_PRINTER_VARIABLE </th> <td class="description">Can print on rolls and custom-size media</td></tr>
6146 </tbody></table>
6147 <h3 class="enumeration"><a id="http_encoding_e">http_encoding_e</a></h3>
6148 <p class="description">HTTP transfer encoding values</p>
6149 <h4 class="constants">Constants</h4>
6150 <table class="list"><tbody>
6151 <tr><th>HTTP_ENCODING_CHUNKED </th> <td class="description">Data is chunked</td></tr>
6152 <tr><th>HTTP_ENCODING_FIELDS </th> <td class="description">Sending HTTP fields</td></tr>
6153 <tr><th>HTTP_ENCODING_LENGTH </th> <td class="description">Data is sent with Content-Length</td></tr>
6154 </tbody></table>
6155 <h3 class="enumeration"><a id="http_encryption_e">http_encryption_e</a></h3>
6156 <p class="description">HTTP encryption values</p>
6157 <h4 class="constants">Constants</h4>
6158 <table class="list"><tbody>
6159 <tr><th>HTTP_ENCRYPTION_ALWAYS </th> <td class="description">Always encrypt (SSL)</td></tr>
6160 <tr><th>HTTP_ENCRYPTION_IF_REQUESTED </th> <td class="description">Encrypt if requested (TLS upgrade)</td></tr>
6161 <tr><th>HTTP_ENCRYPTION_NEVER </th> <td class="description">Never encrypt</td></tr>
6162 <tr><th>HTTP_ENCRYPTION_REQUIRED </th> <td class="description">Encryption is required (TLS upgrade)</td></tr>
6163 </tbody></table>
6164 <h3 class="enumeration"><a id="http_field_e">http_field_e</a></h3>
6165 <p class="description">HTTP field names</p>
6166 <h4 class="constants">Constants</h4>
6167 <table class="list"><tbody>
6168 <tr><th>HTTP_FIELD_ACCEPT_ENCODING <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></th> <td class="description">Accepting-Encoding field </td></tr>
6169 <tr><th>HTTP_FIELD_ACCEPT_LANGUAGE </th> <td class="description">Accept-Language field</td></tr>
6170 <tr><th>HTTP_FIELD_ACCEPT_RANGES </th> <td class="description">Accept-Ranges field</td></tr>
6171 <tr><th>HTTP_FIELD_ALLOW <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></th> <td class="description">Allow field </td></tr>
6172 <tr><th>HTTP_FIELD_AUTHENTICATION_INFO <span class="info">&#160;CUPS 2.2.9)&#160;</span></th> <td class="description">Authentication-Info field (</td></tr>
6173 <tr><th>HTTP_FIELD_AUTHORIZATION </th> <td class="description">Authorization field</td></tr>
6174 <tr><th>HTTP_FIELD_CONNECTION </th> <td class="description">Connection field</td></tr>
6175 <tr><th>HTTP_FIELD_CONTENT_ENCODING </th> <td class="description">Content-Encoding field</td></tr>
6176 <tr><th>HTTP_FIELD_CONTENT_LANGUAGE </th> <td class="description">Content-Language field</td></tr>
6177 <tr><th>HTTP_FIELD_CONTENT_LENGTH </th> <td class="description">Content-Length field</td></tr>
6178 <tr><th>HTTP_FIELD_CONTENT_LOCATION </th> <td class="description">Content-Location field</td></tr>
6179 <tr><th>HTTP_FIELD_CONTENT_MD5 </th> <td class="description">Content-MD5 field</td></tr>
6180 <tr><th>HTTP_FIELD_CONTENT_RANGE </th> <td class="description">Content-Range field</td></tr>
6181 <tr><th>HTTP_FIELD_CONTENT_TYPE </th> <td class="description">Content-Type field</td></tr>
6182 <tr><th>HTTP_FIELD_CONTENT_VERSION </th> <td class="description">Content-Version field</td></tr>
6183 <tr><th>HTTP_FIELD_DATE </th> <td class="description">Date field</td></tr>
6184 <tr><th>HTTP_FIELD_HOST </th> <td class="description">Host field</td></tr>
6185 <tr><th>HTTP_FIELD_IF_MODIFIED_SINCE </th> <td class="description">If-Modified-Since field</td></tr>
6186 <tr><th>HTTP_FIELD_IF_UNMODIFIED_SINCE </th> <td class="description">If-Unmodified-Since field</td></tr>
6187 <tr><th>HTTP_FIELD_KEEP_ALIVE </th> <td class="description">Keep-Alive field</td></tr>
6188 <tr><th>HTTP_FIELD_LAST_MODIFIED </th> <td class="description">Last-Modified field</td></tr>
6189 <tr><th>HTTP_FIELD_LINK </th> <td class="description">Link field</td></tr>
6190 <tr><th>HTTP_FIELD_LOCATION </th> <td class="description">Location field</td></tr>
6191 <tr><th>HTTP_FIELD_MAX </th> <td class="description">Maximum field index</td></tr>
6192 <tr><th>HTTP_FIELD_RANGE </th> <td class="description">Range field</td></tr>
6193 <tr><th>HTTP_FIELD_REFERER </th> <td class="description">Referer field</td></tr>
6194 <tr><th>HTTP_FIELD_RETRY_AFTER </th> <td class="description">Retry-After field</td></tr>
6195 <tr><th>HTTP_FIELD_SERVER <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></th> <td class="description">Server field </td></tr>
6196 <tr><th>HTTP_FIELD_TRANSFER_ENCODING </th> <td class="description">Transfer-Encoding field</td></tr>
6197 <tr><th>HTTP_FIELD_UNKNOWN </th> <td class="description">Unknown field</td></tr>
6198 <tr><th>HTTP_FIELD_UPGRADE </th> <td class="description">Upgrade field</td></tr>
6199 <tr><th>HTTP_FIELD_USER_AGENT </th> <td class="description">User-Agent field</td></tr>
6200 <tr><th>HTTP_FIELD_WWW_AUTHENTICATE </th> <td class="description">WWW-Authenticate field</td></tr>
6201 </tbody></table>
6202 <h3 class="enumeration"><a id="http_keepalive_e">http_keepalive_e</a></h3>
6203 <p class="description">HTTP keep-alive values</p>
6204 <h4 class="constants">Constants</h4>
6205 <table class="list"><tbody>
6206 <tr><th>HTTP_KEEPALIVE_OFF </th> <td class="description">No keep alive support</td></tr>
6207 <tr><th>HTTP_KEEPALIVE_ON </th> <td class="description">Use keep alive</td></tr>
6208 </tbody></table>
6209 <h3 class="enumeration"><a id="http_state_e">http_state_e</a></h3>
6210 <p class="description">HTTP state values; states
6211 are server-oriented...</p>
6212 <h4 class="constants">Constants</h4>
6213 <table class="list"><tbody>
6214 <tr><th>HTTP_STATE_CONNECT </th> <td class="description">CONNECT command, waiting for blank line</td></tr>
6215 <tr><th>HTTP_STATE_DELETE </th> <td class="description">DELETE command, waiting for blank line</td></tr>
6216 <tr><th>HTTP_STATE_ERROR </th> <td class="description">Error on socket</td></tr>
6217 <tr><th>HTTP_STATE_GET </th> <td class="description">GET command, waiting for blank line</td></tr>
6218 <tr><th>HTTP_STATE_GET_SEND </th> <td class="description">GET command, sending data</td></tr>
6219 <tr><th>HTTP_STATE_HEAD </th> <td class="description">HEAD command, waiting for blank line</td></tr>
6220 <tr><th>HTTP_STATE_OPTIONS </th> <td class="description">OPTIONS command, waiting for blank line</td></tr>
6221 <tr><th>HTTP_STATE_POST </th> <td class="description">POST command, waiting for blank line</td></tr>
6222 <tr><th>HTTP_STATE_POST_RECV </th> <td class="description">POST command, receiving data</td></tr>
6223 <tr><th>HTTP_STATE_POST_SEND </th> <td class="description">POST command, sending data</td></tr>
6224 <tr><th>HTTP_STATE_PUT </th> <td class="description">PUT command, waiting for blank line</td></tr>
6225 <tr><th>HTTP_STATE_PUT_RECV </th> <td class="description">PUT command, receiving data</td></tr>
6226 <tr><th>HTTP_STATE_STATUS </th> <td class="description">Command complete, sending status</td></tr>
6227 <tr><th>HTTP_STATE_TRACE </th> <td class="description">TRACE command, waiting for blank line</td></tr>
6228 <tr><th>HTTP_STATE_UNKNOWN_METHOD <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></th> <td class="description">Unknown request method, waiting for blank line </td></tr>
6229 <tr><th>HTTP_STATE_UNKNOWN_VERSION <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></th> <td class="description">Unknown request method, waiting for blank line </td></tr>
6230 <tr><th>HTTP_STATE_WAITING </th> <td class="description">Waiting for command</td></tr>
6231 </tbody></table>
6232 <h3 class="enumeration"><a id="http_status_e">http_status_e</a></h3>
6233 <p class="description">HTTP status codes</p>
6234 <h4 class="constants">Constants</h4>
6235 <table class="list"><tbody>
6236 <tr><th>HTTP_STATUS_ACCEPTED </th> <td class="description">DELETE command was successful</td></tr>
6237 <tr><th>HTTP_STATUS_BAD_GATEWAY </th> <td class="description">Bad gateway</td></tr>
6238 <tr><th>HTTP_STATUS_BAD_REQUEST </th> <td class="description">Bad request</td></tr>
6239 <tr><th>HTTP_STATUS_CONFLICT </th> <td class="description">Request is self-conflicting</td></tr>
6240 <tr><th>HTTP_STATUS_CONTINUE </th> <td class="description">Everything OK, keep going...</td></tr>
6241 <tr><th>HTTP_STATUS_CREATED </th> <td class="description">PUT command was successful</td></tr>
6242 <tr><th>HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED <span class="info">&#160;CUPS 1.4&#160;</span></th> <td class="description">User canceled authorization </td></tr>
6243 <tr><th>HTTP_STATUS_CUPS_PKI_ERROR <span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span></th> <td class="description">Error negotiating a secure connection </td></tr>
6244 <tr><th>HTTP_STATUS_ERROR </th> <td class="description">An error response from httpXxxx()</td></tr>
6245 <tr><th>HTTP_STATUS_EXPECTATION_FAILED </th> <td class="description">The expectation given in an Expect header field was not met</td></tr>
6246 <tr><th>HTTP_STATUS_FORBIDDEN </th> <td class="description">Forbidden to access this URI</td></tr>
6247 <tr><th>HTTP_STATUS_FOUND </th> <td class="description">Document was found at a different URI</td></tr>
6248 <tr><th>HTTP_STATUS_GATEWAY_TIMEOUT </th> <td class="description">Gateway connection timed out</td></tr>
6249 <tr><th>HTTP_STATUS_GONE </th> <td class="description">Server has gone away</td></tr>
6250 <tr><th>HTTP_STATUS_LENGTH_REQUIRED </th> <td class="description">A content length or encoding is required</td></tr>
6251 <tr><th>HTTP_STATUS_METHOD_NOT_ALLOWED </th> <td class="description">Method is not allowed</td></tr>
6252 <tr><th>HTTP_STATUS_MOVED_PERMANENTLY </th> <td class="description">Document has moved permanently</td></tr>
6253 <tr><th>HTTP_STATUS_MULTIPLE_CHOICES </th> <td class="description">Multiple files match request</td></tr>
6254 <tr><th>HTTP_STATUS_NONE <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></th> <td class="description">No Expect value </td></tr>
6255 <tr><th>HTTP_STATUS_NOT_ACCEPTABLE </th> <td class="description">Not Acceptable</td></tr>
6256 <tr><th>HTTP_STATUS_NOT_AUTHORITATIVE </th> <td class="description">Information isn't authoritative</td></tr>
6257 <tr><th>HTTP_STATUS_NOT_FOUND </th> <td class="description">URI was not found</td></tr>
6258 <tr><th>HTTP_STATUS_NOT_IMPLEMENTED </th> <td class="description">Feature not implemented</td></tr>
6259 <tr><th>HTTP_STATUS_NOT_MODIFIED </th> <td class="description">File not modified</td></tr>
6260 <tr><th>HTTP_STATUS_NOT_SUPPORTED </th> <td class="description">HTTP version not supported</td></tr>
6261 <tr><th>HTTP_STATUS_NO_CONTENT </th> <td class="description">Successful command, no new data</td></tr>
6262 <tr><th>HTTP_STATUS_OK </th> <td class="description">OPTIONS/GET/HEAD/POST/TRACE command was successful</td></tr>
6263 <tr><th>HTTP_STATUS_PARTIAL_CONTENT </th> <td class="description">Only a partial file was received/sent</td></tr>
6264 <tr><th>HTTP_STATUS_PAYMENT_REQUIRED </th> <td class="description">Payment required</td></tr>
6265 <tr><th>HTTP_STATUS_PRECONDITION </th> <td class="description">Precondition failed</td></tr>
6266 <tr><th>HTTP_STATUS_PROXY_AUTHENTICATION </th> <td class="description">Proxy Authentication is Required</td></tr>
6267 <tr><th>HTTP_STATUS_REQUESTED_RANGE </th> <td class="description">The requested range is not satisfiable</td></tr>
6268 <tr><th>HTTP_STATUS_REQUEST_TIMEOUT </th> <td class="description">Request timed out</td></tr>
6269 <tr><th>HTTP_STATUS_REQUEST_TOO_LARGE </th> <td class="description">Request entity too large</td></tr>
6270 <tr><th>HTTP_STATUS_RESET_CONTENT </th> <td class="description">Content was reset/recreated</td></tr>
6271 <tr><th>HTTP_STATUS_SEE_OTHER </th> <td class="description">See this other link</td></tr>
6272 <tr><th>HTTP_STATUS_SERVER_ERROR </th> <td class="description">Internal server error</td></tr>
6273 <tr><th>HTTP_STATUS_SERVICE_UNAVAILABLE </th> <td class="description">Service is unavailable</td></tr>
6274 <tr><th>HTTP_STATUS_SWITCHING_PROTOCOLS </th> <td class="description">HTTP upgrade to TLS/SSL</td></tr>
6275 <tr><th>HTTP_STATUS_TEMPORARY_REDIRECT </th> <td class="description">Temporary redirection</td></tr>
6276 <tr><th>HTTP_STATUS_UNAUTHORIZED </th> <td class="description">Unauthorized to access host</td></tr>
6277 <tr><th>HTTP_STATUS_UNSUPPORTED_MEDIATYPE </th> <td class="description">The requested media type is unsupported</td></tr>
6278 <tr><th>HTTP_STATUS_UPGRADE_REQUIRED </th> <td class="description">Upgrade to SSL/TLS required</td></tr>
6279 <tr><th>HTTP_STATUS_URI_TOO_LONG </th> <td class="description">URI too long</td></tr>
6280 <tr><th>HTTP_STATUS_USE_PROXY </th> <td class="description">Must use a proxy to access this URI</td></tr>
6281 </tbody></table>
6282 <h3 class="enumeration"><a id="http_trust_e"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span>http_trust_e</a></h3>
6283 <p class="description">Level of trust for credentials </p>
6284 <h4 class="constants">Constants</h4>
6285 <table class="list"><tbody>
6286 <tr><th>HTTP_TRUST_CHANGED </th> <td class="description">Credentials have changed</td></tr>
6287 <tr><th>HTTP_TRUST_EXPIRED </th> <td class="description">Credentials are expired</td></tr>
6288 <tr><th>HTTP_TRUST_INVALID </th> <td class="description">Credentials are invalid</td></tr>
6289 <tr><th>HTTP_TRUST_OK </th> <td class="description">Credentials are OK/trusted</td></tr>
6290 <tr><th>HTTP_TRUST_RENEWED </th> <td class="description">Credentials have been renewed</td></tr>
6291 <tr><th>HTTP_TRUST_UNKNOWN </th> <td class="description">Credentials are unknown/new</td></tr>
6292 </tbody></table>
6293 <h3 class="enumeration"><a id="http_uri_coding_e">http_uri_coding_e</a></h3>
6294 <p class="description">URI en/decode flags</p>
6295 <h4 class="constants">Constants</h4>
6296 <table class="list"><tbody>
6297 <tr><th>HTTP_URI_CODING_ALL </th> <td class="description">En/decode everything</td></tr>
6298 <tr><th>HTTP_URI_CODING_HOSTNAME </th> <td class="description">En/decode the hostname portion</td></tr>
6299 <tr><th>HTTP_URI_CODING_MOST </th> <td class="description">En/decode all but the query</td></tr>
6300 <tr><th>HTTP_URI_CODING_NONE </th> <td class="description">Don't en/decode anything</td></tr>
6301 <tr><th>HTTP_URI_CODING_QUERY </th> <td class="description">En/decode the query portion</td></tr>
6302 <tr><th>HTTP_URI_CODING_RESOURCE </th> <td class="description">En/decode the resource portion</td></tr>
6303 <tr><th>HTTP_URI_CODING_RFC6874 </th> <td class="description">Use RFC 6874 address format</td></tr>
6304 <tr><th>HTTP_URI_CODING_USERNAME </th> <td class="description">En/decode the username portion</td></tr>
6305 </tbody></table>
6306 <h3 class="enumeration"><a id="http_uri_status_e"><span class="info">&#160;CUPS 1.2&#160;</span>http_uri_status_e</a></h3>
6307 <p class="description">URI separation status </p>
6308 <h4 class="constants">Constants</h4>
6309 <table class="list"><tbody>
6310 <tr><th>HTTP_URI_STATUS_BAD_ARGUMENTS </th> <td class="description">Bad arguments to function (error)</td></tr>
6311 <tr><th>HTTP_URI_STATUS_BAD_HOSTNAME </th> <td class="description">Bad hostname in URI (error)</td></tr>
6312 <tr><th>HTTP_URI_STATUS_BAD_PORT </th> <td class="description">Bad port number in URI (error)</td></tr>
6313 <tr><th>HTTP_URI_STATUS_BAD_RESOURCE </th> <td class="description">Bad resource in URI (error)</td></tr>
6314 <tr><th>HTTP_URI_STATUS_BAD_SCHEME </th> <td class="description">Bad scheme in URI (error)</td></tr>
6315 <tr><th>HTTP_URI_STATUS_BAD_URI </th> <td class="description">Bad/empty URI (error)</td></tr>
6316 <tr><th>HTTP_URI_STATUS_BAD_USERNAME </th> <td class="description">Bad username in URI (error)</td></tr>
6317 <tr><th>HTTP_URI_STATUS_MISSING_RESOURCE </th> <td class="description">Missing resource in URI (warning)</td></tr>
6318 <tr><th>HTTP_URI_STATUS_MISSING_SCHEME </th> <td class="description">Missing scheme in URI (warning)</td></tr>
6319 <tr><th>HTTP_URI_STATUS_OK </th> <td class="description">URI decoded OK</td></tr>
6320 <tr><th>HTTP_URI_STATUS_OVERFLOW </th> <td class="description">URI buffer for httpAssembleURI is too small</td></tr>
6321 <tr><th>HTTP_URI_STATUS_UNKNOWN_SCHEME </th> <td class="description">Unknown scheme in URI (warning)</td></tr>
6322 </tbody></table>
6323 <h3 class="enumeration"><a id="ipp_finishings_e">ipp_finishings_e</a></h3>
6324 <p class="description">Finishings values</p>
6325 <h4 class="constants">Constants</h4>
6326 <table class="list"><tbody>
6327 <tr><th>IPP_FINISHINGS_BALE </th> <td class="description">Bale (any type)</td></tr>
6328 <tr><th>IPP_FINISHINGS_BIND </th> <td class="description">Bind</td></tr>
6329 <tr><th>IPP_FINISHINGS_BIND_BOTTOM </th> <td class="description">Bind on bottom</td></tr>
6330 <tr><th>IPP_FINISHINGS_BIND_LEFT </th> <td class="description">Bind on left</td></tr>
6331 <tr><th>IPP_FINISHINGS_BIND_RIGHT </th> <td class="description">Bind on right</td></tr>
6332 <tr><th>IPP_FINISHINGS_BIND_TOP </th> <td class="description">Bind on top</td></tr>
6333 <tr><th>IPP_FINISHINGS_BOOKLET_MAKER </th> <td class="description">Fold to make booklet</td></tr>
6334 <tr><th>IPP_FINISHINGS_COAT </th> <td class="description">Apply protective liquid or powder coating</td></tr>
6335 <tr><th>IPP_FINISHINGS_COVER </th> <td class="description">Add cover</td></tr>
6336 <tr><th>IPP_FINISHINGS_EDGE_STITCH </th> <td class="description">Stitch along any side</td></tr>
6337 <tr><th>IPP_FINISHINGS_EDGE_STITCH_BOTTOM </th> <td class="description">Stitch along bottom edge</td></tr>
6338 <tr><th>IPP_FINISHINGS_EDGE_STITCH_LEFT </th> <td class="description">Stitch along left side</td></tr>
6339 <tr><th>IPP_FINISHINGS_EDGE_STITCH_RIGHT </th> <td class="description">Stitch along right side</td></tr>
6340 <tr><th>IPP_FINISHINGS_EDGE_STITCH_TOP </th> <td class="description">Stitch along top edge</td></tr>
6341 <tr><th>IPP_FINISHINGS_FOLD </th> <td class="description">Fold (any type)</td></tr>
6342 <tr><th>IPP_FINISHINGS_FOLD_ACCORDIAN </th> <td class="description">Accordian-fold the paper vertically into four sections</td></tr>
6343 <tr><th>IPP_FINISHINGS_FOLD_DOUBLE_GATE </th> <td class="description">Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically</td></tr>
6344 <tr><th>IPP_FINISHINGS_FOLD_ENGINEERING_Z </th> <td class="description">Fold the paper vertically into two small sections and one larger, forming an elongated Z</td></tr>
6345 <tr><th>IPP_FINISHINGS_FOLD_GATE </th> <td class="description">Fold the top and bottom quarters of the paper towards the midline</td></tr>
6346 <tr><th>IPP_FINISHINGS_FOLD_HALF </th> <td class="description">Fold the paper in half vertically</td></tr>
6347 <tr><th>IPP_FINISHINGS_FOLD_HALF_Z </th> <td class="description">Fold the paper in half horizontally, then Z-fold the paper vertically</td></tr>
6348 <tr><th>IPP_FINISHINGS_FOLD_LEFT_GATE </th> <td class="description">Fold the top quarter of the paper towards the midline</td></tr>
6349 <tr><th>IPP_FINISHINGS_FOLD_LETTER </th> <td class="description">Fold the paper into three sections vertically; sometimes also known as a C fold</td></tr>
6350 <tr><th>IPP_FINISHINGS_FOLD_PARALLEL </th> <td class="description">Fold the paper in half vertically two times, yielding four sections</td></tr>
6351 <tr><th>IPP_FINISHINGS_FOLD_POSTER </th> <td class="description">Fold the paper in half horizontally and vertically; sometimes also called a cross fold</td></tr>
6352 <tr><th>IPP_FINISHINGS_FOLD_RIGHT_GATE </th> <td class="description">Fold the bottom quarter of the paper towards the midline</td></tr>
6353 <tr><th>IPP_FINISHINGS_FOLD_Z </th> <td class="description">Fold the paper vertically into three sections, forming a Z</td></tr>
6354 <tr><th>IPP_FINISHINGS_JOG_OFFSET </th> <td class="description">Offset for binding (any type)</td></tr>
6355 <tr><th>IPP_FINISHINGS_LAMINATE </th> <td class="description">Apply protective (solid) material</td></tr>
6356 <tr><th>IPP_FINISHINGS_NONE </th> <td class="description">No finishing</td></tr>
6357 <tr><th>IPP_FINISHINGS_PUNCH </th> <td class="description">Punch (any location/count)</td></tr>
6358 <tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_LEFT </th> <td class="description">Punch 1 hole bottom left</td></tr>
6359 <tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT </th> <td class="description">Punch 1 hole bottom right</td></tr>
6360 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_BOTTOM </th> <td class="description">Punch 2 holes bottom edge</td></tr>
6361 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_LEFT </th> <td class="description">Punch 2 holes left side</td></tr>
6362 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_RIGHT </th> <td class="description">Punch 2 holes right side</td></tr>
6363 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_TOP </th> <td class="description">Punch 2 holes top edge</td></tr>
6364 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM </th> <td class="description">Pucnh multiple holes bottom edge</td></tr>
6365 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT </th> <td class="description">Pucnh multiple holes left side</td></tr>
6366 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT </th> <td class="description">Pucnh multiple holes right side</td></tr>
6367 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_TOP </th> <td class="description">Pucnh multiple holes top edge</td></tr>
6368 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_BOTTOM </th> <td class="description">Punch 4 holes bottom edge</td></tr>
6369 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_LEFT </th> <td class="description">Punch 4 holes left side</td></tr>
6370 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_RIGHT </th> <td class="description">Punch 4 holes right side</td></tr>
6371 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_TOP </th> <td class="description">Punch 4 holes top edge</td></tr>
6372 <tr><th>IPP_FINISHINGS_PUNCH_TOP_LEFT </th> <td class="description">Punch 1 hole top left</td></tr>
6373 <tr><th>IPP_FINISHINGS_PUNCH_TOP_RIGHT </th> <td class="description">Punch 1 hole top right</td></tr>
6374 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM </th> <td class="description">Punch 3 holes bottom edge</td></tr>
6375 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_LEFT </th> <td class="description">Punch 3 holes left side</td></tr>
6376 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT </th> <td class="description">Punch 3 holes right side</td></tr>
6377 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_TOP </th> <td class="description">Punch 3 holes top edge</td></tr>
6378 <tr><th>IPP_FINISHINGS_SADDLE_STITCH </th> <td class="description">Staple interior</td></tr>
6379 <tr><th>IPP_FINISHINGS_STAPLE </th> <td class="description">Staple (any location/method)</td></tr>
6380 <tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_LEFT </th> <td class="description">Staple bottom left corner</td></tr>
6381 <tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT </th> <td class="description">Staple bottom right corner</td></tr>
6382 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_BOTTOM </th> <td class="description">Two staples on bottom</td></tr>
6383 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_LEFT </th> <td class="description">Two staples on left</td></tr>
6384 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_RIGHT </th> <td class="description">Two staples on right</td></tr>
6385 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_TOP </th> <td class="description">Two staples on top</td></tr>
6386 <tr><th>IPP_FINISHINGS_STAPLE_TOP_LEFT </th> <td class="description">Staple top left corner</td></tr>
6387 <tr><th>IPP_FINISHINGS_STAPLE_TOP_RIGHT </th> <td class="description">Staple top right corner</td></tr>
6388 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM </th> <td class="description">Three staples on bottom</td></tr>
6389 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_LEFT </th> <td class="description">Three staples on left</td></tr>
6390 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT </th> <td class="description">Three staples on right</td></tr>
6391 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_TOP </th> <td class="description">Three staples on top</td></tr>
6392 <tr><th>IPP_FINISHINGS_TRIM </th> <td class="description">Trim (any type)</td></tr>
6393 <tr><th>IPP_FINISHINGS_TRIM_AFTER_COPIES </th> <td class="description">Trim output after each copy</td></tr>
6394 <tr><th>IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS </th> <td class="description">Trim output after each document</td></tr>
6395 <tr><th>IPP_FINISHINGS_TRIM_AFTER_JOB </th> <td class="description">Trim output after job</td></tr>
6396 <tr><th>IPP_FINISHINGS_TRIM_AFTER_PAGES </th> <td class="description">Trim output after each page</td></tr>
6397 </tbody></table>
6398 <h3 class="enumeration"><a id="ipp_jstate_e">ipp_jstate_e</a></h3>
6399 <p class="description">Job states</p>
6400 <h4 class="constants">Constants</h4>
6401 <table class="list"><tbody>
6402 <tr><th>IPP_JSTATE_ABORTED </th> <td class="description">Job has aborted due to error</td></tr>
6403 <tr><th>IPP_JSTATE_CANCELED </th> <td class="description">Job has been canceled</td></tr>
6404 <tr><th>IPP_JSTATE_COMPLETED </th> <td class="description">Job has completed successfully</td></tr>
6405 <tr><th>IPP_JSTATE_HELD </th> <td class="description">Job is held for printing</td></tr>
6406 <tr><th>IPP_JSTATE_PENDING </th> <td class="description">Job is waiting to be printed</td></tr>
6407 <tr><th>IPP_JSTATE_PROCESSING </th> <td class="description">Job is currently printing</td></tr>
6408 <tr><th>IPP_JSTATE_STOPPED </th> <td class="description">Job has been stopped</td></tr>
6409 </tbody></table>
6410 <h3 class="enumeration"><a id="ipp_op_e">ipp_op_e</a></h3>
6411 <p class="description">IPP operations</p>
6412 <h4 class="constants">Constants</h4>
6413 <table class="list"><tbody>
6414 <tr><th>IPP_OP_ALLOCATE_PRINTER_RESOURCES </th> <td class="description">Allocate-Printer-Resources: Use resources for a printer.</td></tr>
6415 <tr><th>IPP_OP_CANCEL_CURRENT_JOB </th> <td class="description">Cancel-Current-Job: Cancel the current job</td></tr>
6416 <tr><th>IPP_OP_CANCEL_JOB </th> <td class="description">Cancel-Job: Cancel a job</td></tr>
6417 <tr><th>IPP_OP_CANCEL_JOBS </th> <td class="description">Cancel-Jobs: Cancel all jobs (administrative)</td></tr>
6418 <tr><th>IPP_OP_CANCEL_MY_JOBS </th> <td class="description">Cancel-My-Jobs: Cancel a user's jobs</td></tr>
6419 <tr><th>IPP_OP_CANCEL_RESOURCE </th> <td class="description">Cancel-Resource: Uninstall a resource.</td></tr>
6420 <tr><th>IPP_OP_CANCEL_SUBSCRIPTION <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Cancel-Subscription: Cancel a subscription </td></tr>
6421 <tr><th>IPP_OP_CLOSE_JOB </th> <td class="description">Close-Job: Close a job and start printing</td></tr>
6422 <tr><th>IPP_OP_CREATE_JOB </th> <td class="description">Create-Job: Create an empty print job</td></tr>
6423 <tr><th>IPP_OP_CREATE_JOB_SUBSCRIPTIONS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Create-Job-Subscriptions: Create one of more job subscriptions </td></tr>
6424 <tr><th>IPP_OP_CREATE_PRINTER </th> <td class="description">Create-Printer: Create a new service.</td></tr>
6425 <tr><th>IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Create-Printer-Subscriptions: Create one or more printer subscriptions </td></tr>
6426 <tr><th>IPP_OP_CREATE_RESOURCE </th> <td class="description">Create-Resource: Create a new (empty) resource.</td></tr>
6427 <tr><th>IPP_OP_CREATE_RESOURCE_SUBSCRIPTIONS </th> <td class="description">Create-Resource-Subscriptions: Create event subscriptions for a resource.</td></tr>
6428 <tr><th>IPP_OP_CREATE_SYSTEM_SUBSCRIPTIONS </th> <td class="description">Create-System-Subscriptions: Create event subscriptions for a system.</td></tr>
6429 <tr><th>IPP_OP_CUPS_ADD_MODIFY_CLASS </th> <td class="description">CUPS-Add-Modify-Class: Add or modify a class</td></tr>
6430 <tr><th>IPP_OP_CUPS_ADD_MODIFY_PRINTER </th> <td class="description">CUPS-Add-Modify-Printer: Add or modify a printer</td></tr>
6431 <tr><th>IPP_OP_CUPS_AUTHENTICATE_JOB <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">CUPS-Authenticate-Job: Authenticate a job </td></tr>
6432 <tr><th>IPP_OP_CUPS_CREATE_LOCAL_PRINTER <span class="info">&#160;CUPS 2.2&#160;</span></th> <td class="description">CUPS-Create-Local-Printer: Create a local (temporary) printer </td></tr>
6433 <tr><th>IPP_OP_CUPS_DELETE_CLASS </th> <td class="description">CUPS-Delete-Class: Delete a class</td></tr>
6434 <tr><th>IPP_OP_CUPS_DELETE_PRINTER </th> <td class="description">CUPS-Delete-Printer: Delete a printer</td></tr>
6435 <tr><th>IPP_OP_CUPS_GET_DEFAULT </th> <td class="description">CUPS-Get-Default: Get the default printer</td></tr>
6436 <tr><th>IPP_OP_CUPS_GET_DEVICES <span class="info">&#160;DEPRECATED&#160;</span></th> <td class="description">CUPS-Get-Devices: Get a list of supported devices </td></tr>
6437 <tr><th>IPP_OP_CUPS_GET_DOCUMENT <span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span></th> <td class="description">CUPS-Get-Document: Get a document file </td></tr>
6438 <tr><th>IPP_OP_CUPS_GET_PPD <span class="info">&#160;DEPRECATED&#160;</span></th> <td class="description">CUPS-Get-PPD: Get a PPD file </td></tr>
6439 <tr><th>IPP_OP_CUPS_GET_PPDS <span class="info">&#160;DEPRECATED&#160;</span></th> <td class="description">CUPS-Get-PPDs: Get a list of supported drivers </td></tr>
6440 <tr><th>IPP_OP_CUPS_GET_PRINTERS </th> <td class="description">CUPS-Get-Printers: Get a list of printers and/or classes</td></tr>
6441 <tr><th>IPP_OP_CUPS_INVALID </th> <td class="description">Invalid operation name for <a href="#ippOpValue"><code>ippOpValue</code></a></td></tr>
6442 <tr><th>IPP_OP_CUPS_MOVE_JOB </th> <td class="description">CUPS-Move-Job: Move a job to a different printer</td></tr>
6443 <tr><th>IPP_OP_CUPS_SET_DEFAULT </th> <td class="description">CUPS-Set-Default: Set the default printer</td></tr>
6444 <tr><th>IPP_OP_DEALLOCATE_PRINTER_RESOURCES </th> <td class="description">Deallocate-Printer-Resources: Stop using resources for a printer.</td></tr>
6445 <tr><th>IPP_OP_DELETE_PRINTER </th> <td class="description">Delete-Printer: Delete an existing service.</td></tr>
6446 <tr><th>IPP_OP_DISABLE_ALL_PRINTERS </th> <td class="description">Disable-All-Printers: Stop accepting new jobs on all services.</td></tr>
6447 <tr><th>IPP_OP_DISABLE_PRINTER </th> <td class="description">Disable-Printer: Reject new jobs for a printer</td></tr>
6448 <tr><th>IPP_OP_ENABLE_ALL_PRINTERS </th> <td class="description">Enable-All-Printers: Start accepting new jobs on all services.</td></tr>
6449 <tr><th>IPP_OP_ENABLE_PRINTER </th> <td class="description">Enable-Printer: Accept new jobs for a printer</td></tr>
6450 <tr><th>IPP_OP_GET_JOBS </th> <td class="description">Get-Jobs: Get a list of jobs</td></tr>
6451 <tr><th>IPP_OP_GET_JOB_ATTRIBUTES </th> <td class="description">Get-Job-Attribute: Get information about a job</td></tr>
6452 <tr><th>IPP_OP_GET_NOTIFICATIONS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Get-Notifications: Get notification events </td></tr>
6453 <tr><th>IPP_OP_GET_PRINTERS </th> <td class="description">Get-Printers: Get a list of services.</td></tr>
6454 <tr><th>IPP_OP_GET_PRINTER_ATTRIBUTES </th> <td class="description">Get-Printer-Attributes: Get information about a printer</td></tr>
6455 <tr><th>IPP_OP_GET_PRINTER_SUPPORTED_VALUES </th> <td class="description">Get-Printer-Supported-Values: Get supported values</td></tr>
6456 <tr><th>IPP_OP_GET_SUBSCRIPTIONS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Get-Subscriptions: Get list of subscriptions </td></tr>
6457 <tr><th>IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Get-Subscription-Attributes: Get subscription information </td></tr>
6458 <tr><th>IPP_OP_GET_SYSTEM_ATTRIBUTES </th> <td class="description">Get-System-Attributes: Get system object attributes.</td></tr>
6459 <tr><th>IPP_OP_GET_SYSTEM_SUPPORTED_VALUES </th> <td class="description">Get-System-Supported-Values: Get supported values for system object attributes.</td></tr>
6460 <tr><th>IPP_OP_HOLD_JOB </th> <td class="description">Hold-Job: Hold a job for printing</td></tr>
6461 <tr><th>IPP_OP_HOLD_NEW_JOBS </th> <td class="description">Hold-New-Jobs: Hold new jobs</td></tr>
6462 <tr><th>IPP_OP_IDENTIFY_PRINTER </th> <td class="description">Identify-Printer: Make the printer beep, flash, or display a message for identification</td></tr>
6463 <tr><th>IPP_OP_INSTALL_RESOURCE </th> <td class="description">Install-Resource: Install a resource.</td></tr>
6464 <tr><th>IPP_OP_PAUSE_ALL_PRINTERS </th> <td class="description">Pause-All-Printers: Stop all services immediately.</td></tr>
6465 <tr><th>IPP_OP_PAUSE_ALL_PRINTERS_AFTER_CURRENT_JOB </th> <td class="description">Pause-All-Printers-After-Current-Job: Stop all services after processing the current jobs.</td></tr>
6466 <tr><th>IPP_OP_PAUSE_PRINTER </th> <td class="description">Pause-Printer: Stop a printer</td></tr>
6467 <tr><th>IPP_OP_PAUSE_PRINTER_AFTER_CURRENT_JOB </th> <td class="description">Pause-Printer-After-Current-Job: Stop printer after the current job</td></tr>
6468 <tr><th>IPP_OP_PRINT_JOB </th> <td class="description">Print-Job: Print a single file</td></tr>
6469 <tr><th>IPP_OP_PROMOTE_JOB </th> <td class="description">Promote-Job: Promote a job to print sooner</td></tr>
6470 <tr><th>IPP_OP_REGISTER_OUTPUT_DEVICE </th> <td class="description">Register-Output-Device: Register a remote service.</td></tr>
6471 <tr><th>IPP_OP_RELEASE_HELD_NEW_JOBS </th> <td class="description">Release-Held-New-Jobs: Release new jobs that were previously held</td></tr>
6472 <tr><th>IPP_OP_RELEASE_JOB </th> <td class="description">Release-Job: Release a job for printing</td></tr>
6473 <tr><th>IPP_OP_RENEW_SUBSCRIPTION <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Renew-Subscription: Renew a printer subscription </td></tr>
6474 <tr><th>IPP_OP_RESTART_JOB <span class="info">&#160;DEPRECATED&#160;</span></th> <td class="description">Restart-Job: Reprint a job </td></tr>
6475 <tr><th>IPP_OP_RESTART_SYSTEM </th> <td class="description">Restart-System: Restart all services.</td></tr>
6476 <tr><th>IPP_OP_RESUME_ALL_PRINTERS </th> <td class="description">Resume-All-Printers: Start job processing on all services.</td></tr>
6477 <tr><th>IPP_OP_RESUME_JOB </th> <td class="description">Resume-Job: Resume the current job</td></tr>
6478 <tr><th>IPP_OP_RESUME_PRINTER </th> <td class="description">Resume-Printer: Start a printer</td></tr>
6479 <tr><th>IPP_OP_SCHEDULE_JOB_AFTER </th> <td class="description">Schedule-Job-After: Schedule a job to print after another</td></tr>
6480 <tr><th>IPP_OP_SEND_DOCUMENT </th> <td class="description">Send-Document: Add a file to a job</td></tr>
6481 <tr><th>IPP_OP_SEND_RESOURCE_DATA </th> <td class="description">Send-Resource-Data: Upload the data for a resource.</td></tr>
6482 <tr><th>IPP_OP_SET_JOB_ATTRIBUTES </th> <td class="description">Set-Job-Attributes: Set job values</td></tr>
6483 <tr><th>IPP_OP_SET_PRINTER_ATTRIBUTES </th> <td class="description">Set-Printer-Attributes: Set printer values</td></tr>
6484 <tr><th>IPP_OP_SET_RESOURCE_ATTRIBUTES </th> <td class="description">Set-Resource-Attributes: Set resource object attributes.</td></tr>
6485 <tr><th>IPP_OP_SET_SYSTEM_ATTRIBUTES </th> <td class="description">Set-System-Attributes: Set system object attributes.</td></tr>
6486 <tr><th>IPP_OP_SHUTDOWN_ALL_PRINTERS </th> <td class="description">Shutdown-All-Printers: Shutdown all services.</td></tr>
6487 <tr><th>IPP_OP_SHUTDOWN_ONE_PRINTER </th> <td class="description">Shutdown-One-Printer: Shutdown a service.</td></tr>
6488 <tr><th>IPP_OP_STARTUP_ALL_PRINTERS </th> <td class="description">Startup-All-Printers: Startup all services.</td></tr>
6489 <tr><th>IPP_OP_STARTUP_ONE_PRINTER </th> <td class="description">Startup-One-Printer: Start a service.</td></tr>
6490 <tr><th>IPP_OP_SUSPEND_CURRENT_JOB </th> <td class="description">Suspend-Current-Job: Suspend the current job</td></tr>
6491 <tr><th>IPP_OP_VALIDATE_JOB </th> <td class="description">Validate-Job: Validate job values prior to submission</td></tr>
6492 </tbody></table>
6493 <h3 class="enumeration"><a id="ipp_orient_e">ipp_orient_e</a></h3>
6494 <p class="description">Orientation values</p>
6495 <h4 class="constants">Constants</h4>
6496 <table class="list"><tbody>
6497 <tr><th>IPP_ORIENT_LANDSCAPE </th> <td class="description">90 degrees counter-clockwise</td></tr>
6498 <tr><th>IPP_ORIENT_NONE </th> <td class="description">No rotation</td></tr>
6499 <tr><th>IPP_ORIENT_PORTRAIT </th> <td class="description">No rotation</td></tr>
6500 <tr><th>IPP_ORIENT_REVERSE_LANDSCAPE </th> <td class="description">90 degrees clockwise</td></tr>
6501 <tr><th>IPP_ORIENT_REVERSE_PORTRAIT </th> <td class="description">180 degrees</td></tr>
6502 </tbody></table>
6503 <h3 class="enumeration"><a id="ipp_pstate_e">ipp_pstate_e</a></h3>
6504 <p class="description">Printer state values</p>
6505 <h4 class="constants">Constants</h4>
6506 <table class="list"><tbody>
6507 <tr><th>IPP_PSTATE_IDLE </th> <td class="description">Printer is idle</td></tr>
6508 <tr><th>IPP_PSTATE_PROCESSING </th> <td class="description">Printer is working</td></tr>
6509 <tr><th>IPP_PSTATE_STOPPED </th> <td class="description">Printer is stopped</td></tr>
6510 </tbody></table>
6511 <h3 class="enumeration"><a id="ipp_quality_e">ipp_quality_e</a></h3>
6512 <p class="description">Print quality values</p>
6513 <h4 class="constants">Constants</h4>
6514 <table class="list"><tbody>
6515 <tr><th>IPP_QUALITY_DRAFT </th> <td class="description">Draft quality</td></tr>
6516 <tr><th>IPP_QUALITY_HIGH </th> <td class="description">High quality</td></tr>
6517 <tr><th>IPP_QUALITY_NORMAL </th> <td class="description">Normal quality</td></tr>
6518 </tbody></table>
6519 <h3 class="enumeration"><a id="ipp_res_e">ipp_res_e</a></h3>
6520 <p class="description">Resolution units</p>
6521 <h4 class="constants">Constants</h4>
6522 <table class="list"><tbody>
6523 <tr><th>IPP_RES_PER_CM </th> <td class="description">Pixels per centimeter</td></tr>
6524 <tr><th>IPP_RES_PER_INCH </th> <td class="description">Pixels per inch</td></tr>
6525 </tbody></table>
6526 <h3 class="enumeration"><a id="ipp_rstate_e">ipp_rstate_e</a></h3>
6527 <p class="description">resource-state values</p>
6528 <h4 class="constants">Constants</h4>
6529 <table class="list"><tbody>
6530 <tr><th>IPP_RSTATE_ABORTED </th> <td class="description">Resource has been aborted and is pending deletion.</td></tr>
6531 <tr><th>IPP_RSTATE_AVAILABLE </th> <td class="description">Resource is available for installation.</td></tr>
6532 <tr><th>IPP_RSTATE_CANCELED </th> <td class="description">Resource has been canceled and is pending deletion.</td></tr>
6533 <tr><th>IPP_RSTATE_INSTALLED </th> <td class="description">Resource is installed.</td></tr>
6534 <tr><th>IPP_RSTATE_PENDING </th> <td class="description">Resource is created but has no data yet.</td></tr>
6535 </tbody></table>
6536 <h3 class="enumeration"><a id="ipp_sstate_e">ipp_sstate_e</a></h3>
6537 <p class="description">system-state values</p>
6538 <h4 class="constants">Constants</h4>
6539 <table class="list"><tbody>
6540 <tr><th>IPP_SSTATE_IDLE </th> <td class="description">At least one printer is idle and none are processing a job.</td></tr>
6541 <tr><th>IPP_SSTATE_PROCESSING </th> <td class="description">At least one printer is processing a job.</td></tr>
6542 <tr><th>IPP_SSTATE_STOPPED </th> <td class="description">All printers are stopped.</td></tr>
6543 </tbody></table>
6544 <h3 class="enumeration"><a id="ipp_state_e">ipp_state_e</a></h3>
6545 <p class="description">ipp_t state values</p>
6546 <h4 class="constants">Constants</h4>
6547 <table class="list"><tbody>
6548 <tr><th>IPP_STATE_ATTRIBUTE </th> <td class="description">One or more attributes need to be sent/received</td></tr>
6549 <tr><th>IPP_STATE_DATA </th> <td class="description">IPP request data needs to be sent/received</td></tr>
6550 <tr><th>IPP_STATE_ERROR </th> <td class="description">An error occurred</td></tr>
6551 <tr><th>IPP_STATE_HEADER </th> <td class="description">The request header needs to be sent/received</td></tr>
6552 <tr><th>IPP_STATE_IDLE </th> <td class="description">Nothing is happening/request completed</td></tr>
6553 </tbody></table>
6554 <h3 class="enumeration"><a id="ipp_status_e">ipp_status_e</a></h3>
6555 <p class="description">IPP status code values</p>
6556 <h4 class="constants">Constants</h4>
6557 <table class="list"><tbody>
6558 <tr><th>IPP_STATUS_CUPS_INVALID </th> <td class="description">Invalid status name for <a href="#ippErrorValue"><code>ippErrorValue</code></a></td></tr>
6559 <tr><th>IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED </th> <td class="description">client-error-account-authorization-failed</td></tr>
6560 <tr><th>IPP_STATUS_ERROR_ACCOUNT_CLOSED </th> <td class="description">client-error-account-closed</td></tr>
6561 <tr><th>IPP_STATUS_ERROR_ACCOUNT_INFO_NEEDED </th> <td class="description">client-error-account-info-needed</td></tr>
6562 <tr><th>IPP_STATUS_ERROR_ACCOUNT_LIMIT_REACHED </th> <td class="description">client-error-account-limit-reached</td></tr>
6563 <tr><th>IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE </th> <td class="description">client-error-attributes-not-settable</td></tr>
6564 <tr><th>IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES </th> <td class="description">client-error-attributes-or-values-not-supported</td></tr>
6565 <tr><th>IPP_STATUS_ERROR_BAD_REQUEST </th> <td class="description">client-error-bad-request</td></tr>
6566 <tr><th>IPP_STATUS_ERROR_BUSY </th> <td class="description">server-error-busy</td></tr>
6567 <tr><th>IPP_STATUS_ERROR_CHARSET </th> <td class="description">client-error-charset-not-supported</td></tr>
6568 <tr><th>IPP_STATUS_ERROR_COMPRESSION_ERROR </th> <td class="description">client-error-compression-error</td></tr>
6569 <tr><th>IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED </th> <td class="description">client-error-compression-not-supported</td></tr>
6570 <tr><th>IPP_STATUS_ERROR_CONFLICTING </th> <td class="description">client-error-conflicting-attributes</td></tr>
6571 <tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED <span class="info">&#160;DEPRECATED&#160;</span></th> <td class="description">cups-error-account-authorization-failed </td></tr>
6572 <tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED </th> <td class="description">cups-error-account-closed @deprecate@</td></tr>
6573 <tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED <span class="info">&#160;DEPRECATED&#160;</span></th> <td class="description">cups-error-account-info-needed </td></tr>
6574 <tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED <span class="info">&#160;DEPRECATED&#160;</span></th> <td class="description">cups-error-account-limit-reached </td></tr>
6575 <tr><th>IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED <span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span></th> <td class="description">cups-authentication-canceled - Authentication canceled by user </td></tr>
6576 <tr><th>IPP_STATUS_ERROR_CUPS_PKI <span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span></th> <td class="description">cups-pki-error - Error negotiating a secure connection </td></tr>
6577 <tr><th>IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED <span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span></th> <td class="description">cups-upgrade-required - TLS upgrade required </td></tr>
6578 <tr><th>IPP_STATUS_ERROR_DEVICE </th> <td class="description">server-error-device-error</td></tr>
6579 <tr><th>IPP_STATUS_ERROR_DOCUMENT_ACCESS </th> <td class="description">client-error-document-access-error</td></tr>
6580 <tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR </th> <td class="description">client-error-document-format-error</td></tr>
6581 <tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED </th> <td class="description">client-error-document-format-not-supported</td></tr>
6582 <tr><th>IPP_STATUS_ERROR_DOCUMENT_PASSWORD </th> <td class="description">client-error-document-password-error</td></tr>
6583 <tr><th>IPP_STATUS_ERROR_DOCUMENT_PERMISSION </th> <td class="description">client-error-document-permission-error</td></tr>
6584 <tr><th>IPP_STATUS_ERROR_DOCUMENT_SECURITY </th> <td class="description">client-error-document-security-error</td></tr>
6585 <tr><th>IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE </th> <td class="description">client-error-document-unprintable-error</td></tr>
6586 <tr><th>IPP_STATUS_ERROR_FORBIDDEN </th> <td class="description">client-error-forbidden</td></tr>
6587 <tr><th>IPP_STATUS_ERROR_GONE </th> <td class="description">client-error-gone</td></tr>
6588 <tr><th>IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS </th> <td class="description">client-error-ignored-all-subscriptions</td></tr>
6589 <tr><th>IPP_STATUS_ERROR_INTERNAL </th> <td class="description">server-error-internal-error</td></tr>
6590 <tr><th>IPP_STATUS_ERROR_JOB_CANCELED </th> <td class="description">server-error-job-canceled</td></tr>
6591 <tr><th>IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED </th> <td class="description">server-error-multiple-document-jobs-not-supported</td></tr>
6592 <tr><th>IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS </th> <td class="description">server-error-not-accepting-jobs</td></tr>
6593 <tr><th>IPP_STATUS_ERROR_NOT_AUTHENTICATED </th> <td class="description">client-error-not-authenticated</td></tr>
6594 <tr><th>IPP_STATUS_ERROR_NOT_AUTHORIZED </th> <td class="description">client-error-not-authorized</td></tr>
6595 <tr><th>IPP_STATUS_ERROR_NOT_FETCHABLE </th> <td class="description">client-error-not-fetchable</td></tr>
6596 <tr><th>IPP_STATUS_ERROR_NOT_FOUND </th> <td class="description">client-error-not-found</td></tr>
6597 <tr><th>IPP_STATUS_ERROR_NOT_POSSIBLE </th> <td class="description">client-error-not-possible</td></tr>
6598 <tr><th>IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED </th> <td class="description">server-error-operation-not-supported</td></tr>
6599 <tr><th>IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED </th> <td class="description">server-error-printer-is-deactivated</td></tr>
6600 <tr><th>IPP_STATUS_ERROR_REQUEST_ENTITY </th> <td class="description">client-error-request-entity-too-large</td></tr>
6601 <tr><th>IPP_STATUS_ERROR_REQUEST_VALUE </th> <td class="description">client-error-request-value-too-long</td></tr>
6602 <tr><th>IPP_STATUS_ERROR_SERVICE_UNAVAILABLE </th> <td class="description">server-error-service-unavailable</td></tr>
6603 <tr><th>IPP_STATUS_ERROR_TEMPORARY </th> <td class="description">server-error-temporary-error</td></tr>
6604 <tr><th>IPP_STATUS_ERROR_TIMEOUT </th> <td class="description">client-error-timeout</td></tr>
6605 <tr><th>IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS </th> <td class="description">server-error-too-many-documents</td></tr>
6606 <tr><th>IPP_STATUS_ERROR_TOO_MANY_JOBS </th> <td class="description">server-error-too-many-jobs</td></tr>
6607 <tr><th>IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS </th> <td class="description">client-error-too-many-subscriptions</td></tr>
6608 <tr><th>IPP_STATUS_ERROR_URI_SCHEME </th> <td class="description">client-error-uri-scheme-not-supported</td></tr>
6609 <tr><th>IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED </th> <td class="description">server-error-version-not-supported</td></tr>
6610 <tr><th>IPP_STATUS_OK </th> <td class="description">successful-ok</td></tr>
6611 <tr><th>IPP_STATUS_OK_CONFLICTING </th> <td class="description">successful-ok-conflicting-attributes</td></tr>
6612 <tr><th>IPP_STATUS_OK_EVENTS_COMPLETE </th> <td class="description">successful-ok-events-complete</td></tr>
6613 <tr><th>IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED </th> <td class="description">successful-ok-ignored-or-substituted-attributes</td></tr>
6614 <tr><th>IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS </th> <td class="description">successful-ok-ignored-subscriptions</td></tr>
6615 <tr><th>IPP_STATUS_OK_TOO_MANY_EVENTS </th> <td class="description">successful-ok-too-many-events</td></tr>
6616 </tbody></table>
6617 <h3 class="enumeration"><a id="ipp_tag_e">ipp_tag_e</a></h3>
6618 <p class="description">Value and group tag values for attributes</p>
6619 <h4 class="constants">Constants</h4>
6620 <table class="list"><tbody>
6621 <tr><th>IPP_TAG_ADMINDEFINE </th> <td class="description">Admin-defined value</td></tr>
6622 <tr><th>IPP_TAG_BOOLEAN </th> <td class="description">Boolean value</td></tr>
6623 <tr><th>IPP_TAG_CHARSET </th> <td class="description">Character set value</td></tr>
6624 <tr><th>IPP_TAG_CUPS_INVALID </th> <td class="description">Invalid tag name for <a href="#ippTagValue"><code>ippTagValue</code></a></td></tr>
6625 <tr><th>IPP_TAG_DATE </th> <td class="description">Date/time value</td></tr>
6626 <tr><th>IPP_TAG_DEFAULT </th> <td class="description">Default value</td></tr>
6627 <tr><th>IPP_TAG_DELETEATTR </th> <td class="description">Delete-attribute value</td></tr>
6628 <tr><th>IPP_TAG_DOCUMENT </th> <td class="description">Document group</td></tr>
6629 <tr><th>IPP_TAG_END </th> <td class="description">End-of-attributes</td></tr>
6630 <tr><th>IPP_TAG_ENUM </th> <td class="description">Enumeration value</td></tr>
6631 <tr><th>IPP_TAG_EVENT_NOTIFICATION </th> <td class="description">Event group</td></tr>
6632 <tr><th>IPP_TAG_INTEGER </th> <td class="description">Integer value</td></tr>
6633 <tr><th>IPP_TAG_JOB </th> <td class="description">Job group</td></tr>
6634 <tr><th>IPP_TAG_KEYWORD </th> <td class="description">Keyword value</td></tr>
6635 <tr><th>IPP_TAG_LANGUAGE </th> <td class="description">Language value</td></tr>
6636 <tr><th>IPP_TAG_MIMETYPE </th> <td class="description">MIME media type value</td></tr>
6637 <tr><th>IPP_TAG_NAME </th> <td class="description">Name value</td></tr>
6638 <tr><th>IPP_TAG_NAMELANG </th> <td class="description">Name-with-language value</td></tr>
6639 <tr><th>IPP_TAG_NOTSETTABLE </th> <td class="description">Not-settable value</td></tr>
6640 <tr><th>IPP_TAG_NOVALUE </th> <td class="description">No-value value</td></tr>
6641 <tr><th>IPP_TAG_OPERATION </th> <td class="description">Operation group</td></tr>
6642 <tr><th>IPP_TAG_PRINTER </th> <td class="description">Printer group</td></tr>
6643 <tr><th>IPP_TAG_RANGE </th> <td class="description">Range value</td></tr>
6644 <tr><th>IPP_TAG_RESOLUTION </th> <td class="description">Resolution value</td></tr>
6645 <tr><th>IPP_TAG_RESOURCE </th> <td class="description">Resource group</td></tr>
6646 <tr><th>IPP_TAG_STRING </th> <td class="description">Octet string value</td></tr>
6647 <tr><th>IPP_TAG_SUBSCRIPTION </th> <td class="description">Subscription group</td></tr>
6648 <tr><th>IPP_TAG_SYSTEM </th> <td class="description">System group</td></tr>
6649 <tr><th>IPP_TAG_TEXT </th> <td class="description">Text value</td></tr>
6650 <tr><th>IPP_TAG_TEXTLANG </th> <td class="description">Text-with-language value</td></tr>
6651 <tr><th>IPP_TAG_UNKNOWN </th> <td class="description">Unknown value</td></tr>
6652 <tr><th>IPP_TAG_UNSUPPORTED_GROUP </th> <td class="description">Unsupported attributes group</td></tr>
6653 <tr><th>IPP_TAG_UNSUPPORTED_VALUE </th> <td class="description">Unsupported value</td></tr>
6654 <tr><th>IPP_TAG_URI </th> <td class="description">URI value</td></tr>
6655 <tr><th>IPP_TAG_URISCHEME </th> <td class="description">URI scheme value</td></tr>
6656 <tr><th>IPP_TAG_ZERO </th> <td class="description">Zero tag - used for separators</td></tr>
6657 </tbody></table>
6658 </div>
6659 </body>
6660 </html>