]> git.ipfire.org Git - thirdparty/cups.git/blob - doc/help/cupspm.html
17aeb9ad4e0a0f38b94fe3980b13e19b2065850f
[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="Mini-XML v2.11">
9 <meta name="author" content="Michael R Sweet">
10 <meta name="copyright" content="Copyright &#xa9; 2007-2017 by Apple Inc. All Rights Reserved.">
11 <meta name="version" content="2.2.4">
12 <style type="text/css"><!--
13 body, p, h1, h2, h3, h4 {
14 font-family: sans-serif;
15 }
16 div.body h1 {
17 font-size: 250%;
18 font-weight: bold;
19 margin: 0;
20 }
21 div.body h2 {
22 font-size: 250%;
23 margin-top: 1.5em;
24 }
25 div.body h3 {
26 font-size: 150%;
27 margin-bottom: 0.5em;
28 margin-top: 1.5em;
29 }
30 div.body h4 {
31 font-size: 110%;
32 margin-bottom: 0.5em;
33 margin-top: 1.5em;
34 }
35 div.body h5 {
36 font-size: 100%;
37 margin-bottom: 0.5em;
38 margin-top: 1.5em;
39 }
40 div.contents {
41 background: #e8e8e8;
42 border: solid thin black;
43 padding: 10px;
44 }
45 div.contents h1 {
46 font-size: 110%;
47 }
48 div.contents h2 {
49 font-size: 100%;
50 }
51 div.contents ul.contents {
52 font-size: 80%;
53 }
54 .class {
55 border-bottom: solid 2px gray;
56 }
57 .constants {
58 }
59 .description {
60 margin-top: 0.5em;
61 }
62 .discussion {
63 }
64 .enumeration {
65 border-bottom: solid 2px gray;
66 }
67 .function {
68 border-bottom: solid 2px gray;
69 margin-bottom: 0;
70 }
71 .members {
72 }
73 .method {
74 }
75 .parameters {
76 }
77 .returnvalue {
78 }
79 .struct {
80 border-bottom: solid 2px gray;
81 }
82 .typedef {
83 border-bottom: solid 2px gray;
84 }
85 .union {
86 border-bottom: solid 2px gray;
87 }
88 .variable {
89 }
90 h1, h2, h3, h4, h5, h6 {
91 page-break-inside: avoid;
92 }
93 blockquote {
94 border: solid thin gray;
95 box-shadow: 3px 3px 5px rgba(0,0,0,0.5);
96 padding: 0px 10px;
97 page-break-inside: avoid;
98 }
99 p code, li code, p.code, pre, ul.code li {
100 background: rgba(127,127,127,0.1);
101 border: thin dotted gray;
102 font-family: monospace;
103 font-size: 90%;
104 hyphens: manual;
105 -webkit-hyphens: manual;
106 page-break-inside: avoid;
107 }
108 p.code, pre, ul.code li {
109 padding: 10px;
110 }
111 p code, li code {
112 padding: 2px 5px;
113 }
114 a:link, a:visited {
115 text-decoration: none;
116 }
117 span.info {
118 background: black;
119 border: solid thin black;
120 color: white;
121 font-size: 80%;
122 font-style: italic;
123 font-weight: bold;
124 white-space: nowrap;
125 }
126 h3 span.info, h4 span.info {
127 float: right;
128 font-size: 100%;
129 }
130 ul.code, ul.contents, ul.subcontents {
131 list-style-type: none;
132 margin: 0;
133 padding-left: 0;
134 }
135 ul.code li {
136 margin: 0;
137 }
138 ul.contents > li {
139 margin-top: 1em;
140 }
141 ul.contents li ul.code, ul.contents li ul.subcontents {
142 padding-left: 2em;
143 }
144 div.body dl {
145 margin-top: 0;
146 }
147 div.body dt {
148 font-style: italic;
149 margin-top: 0;
150 }
151 div.body dd {
152 margin-bottom: 0.5em;
153 }
154 h1.title {
155 }
156 h2.title {
157 border-bottom: solid 2px black;
158 }
159 h3.title {
160 border-bottom: solid 2px black;
161 }
162 --></style>
163 </head>
164 <body>
165 <h1 class="title">CUPS Programming Manual</h1>
166 <p>Michael R Sweet</p>
167 <p>Copyright &#xa9; 2007-2017 by Apple Inc. All Rights Reserved.</p>
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="#FUNCTIONS">Functions</a><ul class="subcontents">
183 <li><a href="#cupsAddDest">cupsAddDest</a></li>
184 <li><a href="#cupsAddIntegerOption">cupsAddIntegerOption</a></li>
185 <li><a href="#cupsAddOption">cupsAddOption</a></li>
186 <li><a href="#cupsCancelDestJob">cupsCancelDestJob</a></li>
187 <li><a href="#cupsCheckDestSupported">cupsCheckDestSupported</a></li>
188 <li><a href="#cupsCloseDestJob">cupsCloseDestJob</a></li>
189 <li><a href="#cupsConnectDest">cupsConnectDest</a></li>
190 <li><a href="#cupsCopyDest">cupsCopyDest</a></li>
191 <li><a href="#cupsCopyDestConflicts">cupsCopyDestConflicts</a></li>
192 <li><a href="#cupsCopyDestInfo">cupsCopyDestInfo</a></li>
193 <li><a href="#cupsCreateDestJob">cupsCreateDestJob</a></li>
194 <li><a href="#cupsDoAuthentication">cupsDoAuthentication</a></li>
195 <li><a href="#cupsEncodeOptions">cupsEncodeOptions</a></li>
196 <li><a href="#cupsEncodeOptions2">cupsEncodeOptions2</a></li>
197 <li><a href="#cupsEncryption">cupsEncryption</a></li>
198 <li><a href="#cupsEnumDests">cupsEnumDests</a></li>
199 <li><a href="#cupsFindDestDefault">cupsFindDestDefault</a></li>
200 <li><a href="#cupsFindDestReady">cupsFindDestReady</a></li>
201 <li><a href="#cupsFindDestSupported">cupsFindDestSupported</a></li>
202 <li><a href="#cupsFinishDestDocument">cupsFinishDestDocument</a></li>
203 <li><a href="#cupsFreeDestInfo">cupsFreeDestInfo</a></li>
204 <li><a href="#cupsFreeDests">cupsFreeDests</a></li>
205 <li><a href="#cupsFreeJobs">cupsFreeJobs</a></li>
206 <li><a href="#cupsFreeOptions">cupsFreeOptions</a></li>
207 <li><a href="#cupsGetDest">cupsGetDest</a></li>
208 <li><a href="#cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></li>
209 <li><a href="#cupsGetDestMediaByName">cupsGetDestMediaByName</a></li>
210 <li><a href="#cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></li>
211 <li><a href="#cupsGetDestMediaCount">cupsGetDestMediaCount</a></li>
212 <li><a href="#cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></li>
213 <li><a href="#cupsGetDestWithURI">cupsGetDestWithURI</a></li>
214 <li><a href="#cupsGetIntegerOption">cupsGetIntegerOption</a></li>
215 <li><a href="#cupsGetJobs2">cupsGetJobs2</a></li>
216 <li><a href="#cupsGetNamedDest">cupsGetNamedDest</a></li>
217 <li><a href="#cupsGetOption">cupsGetOption</a></li>
218 <li><a href="#cupsGetPassword2">cupsGetPassword2</a></li>
219 <li><a href="#cupsLangDefault">cupsLangDefault</a></li>
220 <li><a href="#cupsLangEncoding">cupsLangEncoding</a></li>
221 <li><a href="#cupsLangFlush">cupsLangFlush</a></li>
222 <li><a href="#cupsLangFree">cupsLangFree</a></li>
223 <li><a href="#cupsLangGet">cupsLangGet</a></li>
224 <li><a href="#cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></li>
225 <li><a href="#cupsLocalizeDestOption">cupsLocalizeDestOption</a></li>
226 <li><a href="#cupsLocalizeDestValue">cupsLocalizeDestValue</a></li>
227 <li><a href="#cupsMakeServerCredentials">cupsMakeServerCredentials</a></li>
228 <li><a href="#cupsNotifySubject">cupsNotifySubject</a></li>
229 <li><a href="#cupsNotifyText">cupsNotifyText</a></li>
230 <li><a href="#cupsParseOptions">cupsParseOptions</a></li>
231 <li><a href="#cupsRemoveDest">cupsRemoveDest</a></li>
232 <li><a href="#cupsRemoveOption">cupsRemoveOption</a></li>
233 <li><a href="#cupsServer">cupsServer</a></li>
234 <li><a href="#cupsSetClientCertCB">cupsSetClientCertCB</a></li>
235 <li><a href="#cupsSetCredentials">cupsSetCredentials</a></li>
236 <li><a href="#cupsSetDefaultDest">cupsSetDefaultDest</a></li>
237 <li><a href="#cupsSetDests">cupsSetDests</a></li>
238 <li><a href="#cupsSetDests2">cupsSetDests2</a></li>
239 <li><a href="#cupsSetEncryption">cupsSetEncryption</a></li>
240 <li><a href="#cupsSetPasswordCB">cupsSetPasswordCB</a></li>
241 <li><a href="#cupsSetPasswordCB2">cupsSetPasswordCB2</a></li>
242 <li><a href="#cupsSetServer">cupsSetServer</a></li>
243 <li><a href="#cupsSetServerCertCB">cupsSetServerCertCB</a></li>
244 <li><a href="#cupsSetServerCredentials">cupsSetServerCredentials</a></li>
245 <li><a href="#cupsSetUser">cupsSetUser</a></li>
246 <li><a href="#cupsSetUserAgent">cupsSetUserAgent</a></li>
247 <li><a href="#cupsStartDestDocument">cupsStartDestDocument</a></li>
248 <li><a href="#cupsUser">cupsUser</a></li>
249 <li><a href="#cupsUserAgent">cupsUserAgent</a></li>
250 <li><a href="#httpAcceptConnection">httpAcceptConnection</a></li>
251 <li><a href="#httpAddCredential">httpAddCredential</a></li>
252 <li><a href="#httpAddrAny">httpAddrAny</a></li>
253 <li><a href="#httpAddrClose">httpAddrClose</a></li>
254 <li><a href="#httpAddrConnect2">httpAddrConnect2</a></li>
255 <li><a href="#httpAddrCopyList">httpAddrCopyList</a></li>
256 <li><a href="#httpAddrEqual">httpAddrEqual</a></li>
257 <li><a href="#httpAddrFamily">httpAddrFamily</a></li>
258 <li><a href="#httpAddrFreeList">httpAddrFreeList</a></li>
259 <li><a href="#httpAddrGetList">httpAddrGetList</a></li>
260 <li><a href="#httpAddrLength">httpAddrLength</a></li>
261 <li><a href="#httpAddrListen">httpAddrListen</a></li>
262 <li><a href="#httpAddrLocalhost">httpAddrLocalhost</a></li>
263 <li><a href="#httpAddrLookup">httpAddrLookup</a></li>
264 <li><a href="#httpAddrPort">httpAddrPort</a></li>
265 <li><a href="#httpAddrString">httpAddrString</a></li>
266 <li><a href="#httpAssembleURI">httpAssembleURI</a></li>
267 <li><a href="#httpAssembleURIf">httpAssembleURIf</a></li>
268 <li><a href="#httpAssembleUUID">httpAssembleUUID</a></li>
269 <li><a href="#httpBlocking">httpBlocking</a></li>
270 <li><a href="#httpCheck">httpCheck</a></li>
271 <li><a href="#httpClearCookie">httpClearCookie</a></li>
272 <li><a href="#httpClearFields">httpClearFields</a></li>
273 <li><a href="#httpClose">httpClose</a></li>
274 <li><a href="#httpCompareCredentials">httpCompareCredentials</a></li>
275 <li><a href="#httpConnect2">httpConnect2</a></li>
276 <li><a href="#httpCopyCredentials">httpCopyCredentials</a></li>
277 <li><a href="#httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></li>
278 <li><a href="#httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></li>
279 <li><a href="#httpCredentialsGetTrust">httpCredentialsGetTrust</a></li>
280 <li><a href="#httpCredentialsString">httpCredentialsString</a></li>
281 <li><a href="#httpDecode64_2">httpDecode64_2</a></li>
282 <li><a href="#httpDelete">httpDelete</a></li>
283 <li><a href="#httpEncode64_2">httpEncode64_2</a></li>
284 <li><a href="#httpEncryption">httpEncryption</a></li>
285 <li><a href="#httpError">httpError</a></li>
286 <li><a href="#httpFieldValue">httpFieldValue</a></li>
287 <li><a href="#httpFlush">httpFlush</a></li>
288 <li><a href="#httpFlushWrite">httpFlushWrite</a></li>
289 <li><a href="#httpFreeCredentials">httpFreeCredentials</a></li>
290 <li><a href="#httpGet">httpGet</a></li>
291 <li><a href="#httpGetActivity">httpGetActivity</a></li>
292 <li><a href="#httpGetAddress">httpGetAddress</a></li>
293 <li><a href="#httpGetAuthString">httpGetAuthString</a></li>
294 <li><a href="#httpGetBlocking">httpGetBlocking</a></li>
295 <li><a href="#httpGetContentEncoding">httpGetContentEncoding</a></li>
296 <li><a href="#httpGetCookie">httpGetCookie</a></li>
297 <li><a href="#httpGetDateString2">httpGetDateString2</a></li>
298 <li><a href="#httpGetDateTime">httpGetDateTime</a></li>
299 <li><a href="#httpGetEncryption">httpGetEncryption</a></li>
300 <li><a href="#httpGetExpect">httpGetExpect</a></li>
301 <li><a href="#httpGetFd">httpGetFd</a></li>
302 <li><a href="#httpGetField">httpGetField</a></li>
303 <li><a href="#httpGetHostByName">httpGetHostByName</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="#httpSeparate">httpSeparate</a></li>
330 <li><a href="#httpSeparate2">httpSeparate2</a></li>
331 <li><a href="#httpSeparateURI">httpSeparateURI</a></li>
332 <li><a href="#httpSetAuthString">httpSetAuthString</a></li>
333 <li><a href="#httpSetCookie">httpSetCookie</a></li>
334 <li><a href="#httpSetCredentials">httpSetCredentials</a></li>
335 <li><a href="#httpSetDefaultField">httpSetDefaultField</a></li>
336 <li><a href="#httpSetExpect">httpSetExpect</a></li>
337 <li><a href="#httpSetField">httpSetField</a></li>
338 <li><a href="#httpSetKeepAlive">httpSetKeepAlive</a></li>
339 <li><a href="#httpSetLength">httpSetLength</a></li>
340 <li><a href="#httpSetTimeout">httpSetTimeout</a></li>
341 <li><a href="#httpShutdown">httpShutdown</a></li>
342 <li><a href="#httpStateString">httpStateString</a></li>
343 <li><a href="#httpStatus">httpStatus</a></li>
344 <li><a href="#httpTrace">httpTrace</a></li>
345 <li><a href="#httpURIStatusString">httpURIStatusString</a></li>
346 <li><a href="#httpUpdate">httpUpdate</a></li>
347 <li><a href="#httpWait">httpWait</a></li>
348 <li><a href="#httpWrite2">httpWrite2</a></li>
349 <li><a href="#httpWriteResponse">httpWriteResponse</a></li>
350 <li><a href="#ippAddBoolean">ippAddBoolean</a></li>
351 <li><a href="#ippAddBooleans">ippAddBooleans</a></li>
352 <li><a href="#ippAddCollection">ippAddCollection</a></li>
353 <li><a href="#ippAddCollections">ippAddCollections</a></li>
354 <li><a href="#ippAddDate">ippAddDate</a></li>
355 <li><a href="#ippAddInteger">ippAddInteger</a></li>
356 <li><a href="#ippAddIntegers">ippAddIntegers</a></li>
357 <li><a href="#ippAddOctetString">ippAddOctetString</a></li>
358 <li><a href="#ippAddOutOfBand">ippAddOutOfBand</a></li>
359 <li><a href="#ippAddRange">ippAddRange</a></li>
360 <li><a href="#ippAddRanges">ippAddRanges</a></li>
361 <li><a href="#ippAddResolution">ippAddResolution</a></li>
362 <li><a href="#ippAddResolutions">ippAddResolutions</a></li>
363 <li><a href="#ippAddSeparator">ippAddSeparator</a></li>
364 <li><a href="#ippAddString">ippAddString</a></li>
365 <li><a href="#ippAddStringf">ippAddStringf</a></li>
366 <li><a href="#ippAddStringfv">ippAddStringfv</a></li>
367 <li><a href="#ippAddStrings">ippAddStrings</a></li>
368 <li><a href="#ippAttributeString">ippAttributeString</a></li>
369 <li><a href="#ippContainsInteger">ippContainsInteger</a></li>
370 <li><a href="#ippContainsString">ippContainsString</a></li>
371 <li><a href="#ippCopyAttribute">ippCopyAttribute</a></li>
372 <li><a href="#ippCopyAttributes">ippCopyAttributes</a></li>
373 <li><a href="#ippCreateRequestedArray">ippCreateRequestedArray</a></li>
374 <li><a href="#ippDateToTime">ippDateToTime</a></li>
375 <li><a href="#ippDelete">ippDelete</a></li>
376 <li><a href="#ippDeleteAttribute">ippDeleteAttribute</a></li>
377 <li><a href="#ippDeleteValues">ippDeleteValues</a></li>
378 <li><a href="#ippEnumString">ippEnumString</a></li>
379 <li><a href="#ippEnumValue">ippEnumValue</a></li>
380 <li><a href="#ippErrorString">ippErrorString</a></li>
381 <li><a href="#ippErrorValue">ippErrorValue</a></li>
382 <li><a href="#ippFindAttribute">ippFindAttribute</a></li>
383 <li><a href="#ippFindNextAttribute">ippFindNextAttribute</a></li>
384 <li><a href="#ippFirstAttribute">ippFirstAttribute</a></li>
385 <li><a href="#ippGetBoolean">ippGetBoolean</a></li>
386 <li><a href="#ippGetCollection">ippGetCollection</a></li>
387 <li><a href="#ippGetCount">ippGetCount</a></li>
388 <li><a href="#ippGetDate">ippGetDate</a></li>
389 <li><a href="#ippGetGroupTag">ippGetGroupTag</a></li>
390 <li><a href="#ippGetInteger">ippGetInteger</a></li>
391 <li><a href="#ippGetName">ippGetName</a></li>
392 <li><a href="#ippGetOctetString">ippGetOctetString</a></li>
393 <li><a href="#ippGetOperation">ippGetOperation</a></li>
394 <li><a href="#ippGetRange">ippGetRange</a></li>
395 <li><a href="#ippGetRequestId">ippGetRequestId</a></li>
396 <li><a href="#ippGetResolution">ippGetResolution</a></li>
397 <li><a href="#ippGetState">ippGetState</a></li>
398 <li><a href="#ippGetStatusCode">ippGetStatusCode</a></li>
399 <li><a href="#ippGetString">ippGetString</a></li>
400 <li><a href="#ippGetValueTag">ippGetValueTag</a></li>
401 <li><a href="#ippGetVersion">ippGetVersion</a></li>
402 <li><a href="#ippLength">ippLength</a></li>
403 <li><a href="#ippNew">ippNew</a></li>
404 <li><a href="#ippNewRequest">ippNewRequest</a></li>
405 <li><a href="#ippNewResponse">ippNewResponse</a></li>
406 <li><a href="#ippNextAttribute">ippNextAttribute</a></li>
407 <li><a href="#ippOpString">ippOpString</a></li>
408 <li><a href="#ippOpValue">ippOpValue</a></li>
409 <li><a href="#ippPort">ippPort</a></li>
410 <li><a href="#ippRead">ippRead</a></li>
411 <li><a href="#ippReadFile">ippReadFile</a></li>
412 <li><a href="#ippReadIO">ippReadIO</a></li>
413 <li><a href="#ippSetBoolean">ippSetBoolean</a></li>
414 <li><a href="#ippSetCollection">ippSetCollection</a></li>
415 <li><a href="#ippSetDate">ippSetDate</a></li>
416 <li><a href="#ippSetGroupTag">ippSetGroupTag</a></li>
417 <li><a href="#ippSetInteger">ippSetInteger</a></li>
418 <li><a href="#ippSetName">ippSetName</a></li>
419 <li><a href="#ippSetOctetString">ippSetOctetString</a></li>
420 <li><a href="#ippSetOperation">ippSetOperation</a></li>
421 <li><a href="#ippSetPort">ippSetPort</a></li>
422 <li><a href="#ippSetRange">ippSetRange</a></li>
423 <li><a href="#ippSetRequestId">ippSetRequestId</a></li>
424 <li><a href="#ippSetResolution">ippSetResolution</a></li>
425 <li><a href="#ippSetState">ippSetState</a></li>
426 <li><a href="#ippSetStatusCode">ippSetStatusCode</a></li>
427 <li><a href="#ippSetString">ippSetString</a></li>
428 <li><a href="#ippSetStringf">ippSetStringf</a></li>
429 <li><a href="#ippSetStringfv">ippSetStringfv</a></li>
430 <li><a href="#ippSetValueTag">ippSetValueTag</a></li>
431 <li><a href="#ippSetVersion">ippSetVersion</a></li>
432 <li><a href="#ippStateString">ippStateString</a></li>
433 <li><a href="#ippTagString">ippTagString</a></li>
434 <li><a href="#ippTagValue">ippTagValue</a></li>
435 <li><a href="#ippTimeToDate">ippTimeToDate</a></li>
436 <li><a href="#ippValidateAttribute">ippValidateAttribute</a></li>
437 <li><a href="#ippValidateAttributes">ippValidateAttributes</a></li>
438 <li><a href="#ippWrite">ippWrite</a></li>
439 <li><a href="#ippWriteFile">ippWriteFile</a></li>
440 <li><a href="#ippWriteIO">ippWriteIO</a></li>
441 </ul></li>
442 <li><a href="#TYPES">Data Types</a><ul class="subcontents">
443 <li><a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a></li>
444 <li><a href="#cups_dest_cb_t">cups_dest_cb_t</a></li>
445 <li><a href="#cups_dest_t">cups_dest_t</a></li>
446 <li><a href="#cups_dinfo_t">cups_dinfo_t</a></li>
447 <li><a href="#cups_job_t">cups_job_t</a></li>
448 <li><a href="#cups_lang_t">cups_lang_t</a></li>
449 <li><a href="#cups_option_t">cups_option_t</a></li>
450 <li><a href="#cups_password_cb2_t">cups_password_cb2_t</a></li>
451 <li><a href="#cups_ptype_t">cups_ptype_t</a></li>
452 <li><a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a></li>
453 <li><a href="#cups_size_t">cups_size_t</a></li>
454 <li><a href="#http_addr_t">http_addr_t</a></li>
455 <li><a href="#http_encoding_t">http_encoding_t</a></li>
456 <li><a href="#http_encryption_t">http_encryption_t</a></li>
457 <li><a href="#http_field_t">http_field_t</a></li>
458 <li><a href="#http_keepalive_t">http_keepalive_t</a></li>
459 <li><a href="#http_state_t">http_state_t</a></li>
460 <li><a href="#http_t">http_t</a></li>
461 <li><a href="#http_timeout_cb_t">http_timeout_cb_t</a></li>
462 <li><a href="#http_trust_t">http_trust_t</a></li>
463 <li><a href="#http_uri_coding_t">http_uri_coding_t</a></li>
464 <li><a href="#http_uri_status_t">http_uri_status_t</a></li>
465 <li><a href="#ipp_attribute_t">ipp_attribute_t</a></li>
466 <li><a href="#ipp_copycb_t">ipp_copycb_t</a></li>
467 <li><a href="#ipp_iocb_t">ipp_iocb_t</a></li>
468 <li><a href="#ipp_orient_t">ipp_orient_t</a></li>
469 <li><a href="#ipp_pstate_t">ipp_pstate_t</a></li>
470 <li><a href="#ipp_quality_t">ipp_quality_t</a></li>
471 <li><a href="#ipp_res_t">ipp_res_t</a></li>
472 <li><a href="#ipp_state_t">ipp_state_t</a></li>
473 <li><a href="#ipp_t">ipp_t</a></li>
474 <li><a href="#ipp_uchar_t">ipp_uchar_t</a></li>
475 </ul></li>
476 <li><a href="#STRUCTURES">Structures</a><ul class="subcontents">
477 <li><a href="#cups_dest_s">cups_dest_s</a></li>
478 <li><a href="#cups_job_s">cups_job_s</a></li>
479 <li><a href="#cups_lang_s">cups_lang_s</a></li>
480 <li><a href="#cups_option_s">cups_option_s</a></li>
481 <li><a href="#cups_size_s">cups_size_s</a></li>
482 </ul></li>
483 <li><a href="#ENUMERATIONS">Enumerations</a><ul class="subcontents">
484 <li><a href="#cups_ptype_e">cups_ptype_e</a></li>
485 <li><a href="#http_encoding_e">http_encoding_e</a></li>
486 <li><a href="#http_encryption_e">http_encryption_e</a></li>
487 <li><a href="#http_field_e">http_field_e</a></li>
488 <li><a href="#http_keepalive_e">http_keepalive_e</a></li>
489 <li><a href="#http_state_e">http_state_e</a></li>
490 <li><a href="#http_status_e">http_status_e</a></li>
491 <li><a href="#http_trust_e">http_trust_e</a></li>
492 <li><a href="#http_uri_coding_e">http_uri_coding_e</a></li>
493 <li><a href="#http_uri_status_e">http_uri_status_e</a></li>
494 <li><a href="#ipp_finishings_e">ipp_finishings_e</a></li>
495 <li><a href="#ipp_jstate_e">ipp_jstate_e</a></li>
496 <li><a href="#ipp_op_e">ipp_op_e</a></li>
497 <li><a href="#ipp_orient_e">ipp_orient_e</a></li>
498 <li><a href="#ipp_pstate_e">ipp_pstate_e</a></li>
499 <li><a href="#ipp_quality_e">ipp_quality_e</a></li>
500 <li><a href="#ipp_res_e">ipp_res_e</a></li>
501 <li><a href="#ipp_state_e">ipp_state_e</a></li>
502 <li><a href="#ipp_status_e">ipp_status_e</a></li>
503 <li><a href="#ipp_tag_e">ipp_tag_e</a></li>
504 </ul></li>
505 </ul>
506 </div>
507 <div class="body">
508 <blockquote>
509 <p>Note: This document is under active development and is incomplete, with a goal completing it prior to releasing CUPS 2.2.4. Please <a href="https://github.com/apple/cups/issues">file issues on Github</a> to provide any feedback.</p>
510 </blockquote>
511 <h2><a id="introduction">Introduction</a></h2>
512 <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>
513 <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>
514 <h3><a id="guidelines">Guidelines</a></h3>
515 <p>When writing software that uses the &quot;cups&quot; library:</p>
516 <ul>
517 <li>Do not use undocumented or deprecated APIs,</li>
518 <li>Do not rely on pre-configured printers,</li>
519 <li>Do not assume that printers support specific features or formats, and</li>
520 <li>Do not rely on implementation details (PPDs, etc.)</li>
521 </ul>
522 <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>
523 <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>
524 <h3><a id="terms-used-in-this-document">Terms Used in This Document</a></h3>
525 <p>A <em>Destination</em> is a printer or print queue that accepts print jobs. A <em>Print</em> <em>Job</em> is 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>
526 <h3><a id="compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></h3>
527 <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>
528 <p>The following simple program lists the available destinations:</p>
529 <pre><code>#include &lt;stdio.h&gt;
530 #include &lt;cups/cups.h&gt;
531
532 int print_dest(void *user_data, unsigned flags, cups_dest_t *dest)
533 {
534 if (dest-&gt;instance)
535 printf(&quot;%s/%s\n&quot;, dest-&gt;name, dest-&gt;instance);
536 else
537 puts(dest-&gt;name);
538
539 return (1);
540 }
541
542 int main(void)
543 {
544 cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, 0, 0, print_dest, NULL);
545
546 return (0);
547 }
548 </code></pre>
549 <h4><a id="compiling-with-xcode">Compiling with Xcode</a></h4>
550 <p>In Xcode, choose <em>New</em> <em>Project...</em> from the <em>File</em> menu (or press SHIFT+CMD+N), then select the <em>Command</em> <em>Line</em> <em>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>
551 <p>In the project window, click on the <em>Build</em> <em>Phases</em> group and expand the <em>Link</em> <em>Binary</em> <em>with</em> <em>Libraries</em> section. Click <em>+</em>, type &quot;libcups&quot; to show the library, and then double-click on <code>libcups.tbd</code>.</p>
552 <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>
553 <h4><a id="compiling-with-gcc">Compiling with GCC</a></h4>
554 <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>
555 <pre><code>gcc -o simple `cups-config --cflags` simple.c `cups-config --libs`
556 ./simple
557 </code></pre>
558 <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>
559 <h2><a id="working-with-destinations">Working with Destinations</a></h2>
560 <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>
561 <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>
562 <h3><a id="finding-available-destinations">Finding Available Destinations</a></h3>
563 <p>The <code>cupsEnumDests</code> function finds all of the available destinations:</p>
564 <pre><code> int
565 cupsEnumDests(unsigned flags, int msec, int *cancel,
566 cups_ptype_t type, cups_ptype_t mask,
567 cups_dest_cb_t cb, void *user_data)
568 </code></pre>
569 <p>The <code>flags</code> argument specifies enumeration options, which at present must be <code>CUPS_DEST_FLAGS_NONE</code>.</p>
570 <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>
571 <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>
572 <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>
573 <ul>
574 <li><code>CUPS_PRINTER_CLASS</code>: A collection of destinations.</li>
575 <li><code>CUPS_PRINTER_FAX</code>: A facsimile device.</li>
576 <li><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.</li>
577 <li><code>CUPS_PRINTER_REMOTE</code>: A remote (shared) printer or class.</li>
578 <li><code>CUPS_PRINTER_DISCOVERED</code>: An available network printer or class.</li>
579 <li><code>CUPS_PRINTER_BW</code>: Can do B&amp;W printing.</li>
580 <li><code>CUPS_PRINTER_COLOR</code>: Can do color printing.</li>
581 <li><code>CUPS_PRINTER_DUPLEX</code>: Can do two-sided printing.</li>
582 <li><code>CUPS_PRINTER_STAPLE</code>: Can staple output.</li>
583 <li><code>CUPS_PRINTER_COLLATE</code>: Can quickly collate copies.</li>
584 <li><code>CUPS_PRINTER_PUNCH</code>: Can punch output.</li>
585 <li><code>CUPS_PRINTER_COVER</code>: Can cover output.</li>
586 <li><code>CUPS_PRINTER_BIND</code>: Can bind output.</li>
587 <li><code>CUPS_PRINTER_SORT</code>: Can sort output (mailboxes, etc.)</li>
588 <li><code>CUPS_PRINTER_SMALL</code>: Can print on Letter/Legal/A4-size media.</li>
589 <li><code>CUPS_PRINTER_MEDIUM</code>: Can print on Tabloid/B/C/A3/A2-size media.</li>
590 <li><code>CUPS_PRINTER_LARGE</code>: Can print on D/E/A1/A0-size media.</li>
591 <li><code>CUPS_PRINTER_VARIABLE</code>: Can print on rolls and custom-size media.</li>
592 </ul>
593 <p>The <code>cb</code> argument specifies a function to call for every destination that is found:</p>
594 <pre><code>typedef int (*cups_dest_cb_t)(void *user_data,
595 unsigned flags,
596 cups_dest_t *dest);
597 </code></pre>
598 <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>
599 <ul>
600 <li><code>CUPS_DEST_FLAGS_MORE</code>: There are more destinations coming.</li>
601 <li><code>CUPS_DEST_FLAGS_REMOVED</code>: The destination has gone away and should be removed from the list of destinations a user can select.</li>
602 <li><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.</li>
603 </ul>
604 <p>The callback function returns 0 to stop enumeration or 1 to continue.</p>
605 <blockquote>
606 <p>Note that 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>
607 </blockquote>
608 <p>The following example shows how to use <code>cupsEnumDests</code> to get a filtered array of destinations:</p>
609 <pre><code>typedef struct
610 {
611 int num_dests;
612 cups_dest_t *dests;
613 } my_user_data_t;
614
615 int
616 my_dest_cb(my_user_data_t *user_data, unsigned flags,
617 cups_dest_t *dest)
618 {
619 if (flags &amp; CUPS_DEST_FLAGS_REMOVED)
620 {
621 /*
622 * Remove destination from array...
623 */
624
625 user_data-&gt;num_dests =
626 cupsRemoveDest(dest-&gt;name, dest-&gt;instance,
627 user_data-&gt;num_dests,
628 &amp;(user_data-&gt;dests));
629 }
630 else
631 {
632 /*
633 * Add destination to array...
634 */
635
636 user_data-&gt;num_dests =
637 cupsCopyDest(dest, user_data-&gt;num_dests,
638 &amp;(user_data-&gt;dests));
639 }
640
641 return (1);
642 }
643
644 int
645 my_get_dests(cups_ptype_t type, cups_ptype_t mask,
646 cups_dest_t **dests)
647 {
648 my_user_data_t user_data = { 0, NULL };
649
650 if (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, type,
651 mask, (cups_dest_cb_t)my_dest_cb,
652 &amp;user_data))
653 {
654 /*
655 * An error occurred, free all of the destinations and
656 * return...
657 */
658
659 cupsFreeDests(user_data.num_dests, user_dasta.dests);
660
661 *dests = NULL;
662
663 return (0);
664 }
665
666 /*
667 * Return the destination array...
668 */
669
670 *dests = user_data.dests;
671
672 return (user_data.num_dests);
673 }
674 </code></pre>
675 <h3><a id="basic-destination-information">Basic Destination Information</a></h3>
676 <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>
677 <ul>
678 <li>&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).</li>
679 <li>&quot;printer-info&quot;: The human-readable description of the destination such as &quot;My Laser Printer&quot;.</li>
680 <li>&quot;printer-is-accepting-jobs&quot;: &quot;true&quot; if the destination is accepting new jobs, &quot;false&quot; otherwise.</li>
681 <li>&quot;printer-is-shared&quot;: &quot;true&quot; if the destination is being shared with other computers, &quot;false&quot; otherwise.</li>
682 <li>&quot;printer-location&quot;: The human-readable location of the destination such as &quot;Lab 4&quot;.</li>
683 <li>&quot;printer-make-and-model&quot;: The human-readable make and model of the destination such as &quot;ExampleCorp LaserPrinter 4000 Series&quot;.</li>
684 <li>&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.</li>
685 <li>&quot;printer-state-change-time&quot;: The UNIX time when the destination entered the current state.</li>
686 <li>&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;.</li>
687 <li>&quot;printer-type&quot;: The <code>cups_ptype_t</code> value associated with the destination.</li>
688 <li>&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.</li>
689 </ul>
690 <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>
691 <pre><code>const char *model = cupsGetOption(&quot;printer-make-and-model&quot;,
692 dest-&gt;num_options,
693 dest-&gt;options);
694 </code></pre>
695 <h3><a id="detailed-destination-information">Detailed Destination Information</a></h3>
696 <p>Once a destination has been chosen, the <code>cupsCopyDestInfo</code> function can be used to gather detailed information about the destination:</p>
697 <pre><code>cups_dinfo_t *
698 cupsCopyDestInfo(http_t *http, cups_dest_t *dest);
699 </code></pre>
700 <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>
701 <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>
702 <h4><a id="getting-supported-options-and-values">Getting Supported Options and Values</a></h4>
703 <p>The <code>cupsCheckDestSupported</code> function can be used to test whether a particular option or option and value is supported:</p>
704 <pre><code>int
705 cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
706 cups_dinfo_t *info,
707 const char *option,
708 const char *value);
709 </code></pre>
710 <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>
711 <ul>
712 <li><code>CUPS_COPIES</code>: Controls the number of copies that are produced.</li>
713 <li><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.</li>
714 <li><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>.</li>
715 <li><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>.</li>
716 <li><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>.</li>
717 <li><code>CUPS_NUMBER_UP</code>: Controls the number of document pages that are placed on each media side.</li>
718 <li><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>.</li>
719 <li><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>).</li>
720 <li><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>.</li>
721 <li><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>.</li>
722 </ul>
723 <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>
724 <p>The <code>cupsFindDestSupported</code> function returns the IPP attribute containing the supported values for a given option:</p>
725 <pre><code> ipp_attribute_t *
726 cupsFindDestSupported(http_t *http, cups_dest_t *dest,
727 cups_dinfo_t *dinfo,
728 const char *option);
729 </code></pre>
730 <p>For example, the following code prints the supported finishing processes for a destination, if any, to the standard output:</p>
731 <pre><code>cups_dinfo_t *info = cupsCopyDestInfo(CUPS_HTTP_DEFAULT,
732 dest);
733
734 if (cupsCheckDestSupported(CUPS_HTTP_DEFAULT, dest, info,
735 CUPS_FINISHINGS, NULL))
736 {
737 ipp_attribute_t *finishings =
738 cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
739 CUPS_FINISHINGS);
740 int i, count = ippGetCount(finishings);
741
742 puts(&quot;finishings supported:&quot;);
743 for (i = 0; i &lt; count; i ++)
744 printf(&quot; %d\n&quot;, ippGetInteger(finishings, i));
745 }
746 else
747 puts(&quot;finishings not supported.&quot;);
748 </code></pre>
749 <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>
750 <pre><code>ipp_attribute_t *attrs =
751 cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
752 &quot;job-creation-attributes&quot;);
753 int i, count = ippGetCount(attrs);
754
755 for (i = 0; i &lt; count; i ++)
756 puts(ippGetString(attrs, i, NULL));
757 </code></pre>
758 <h4><a id="getting-default-values">Getting Default Values</a></h4>
759 <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>
760 <pre><code>ipp_attribute_t *
761 cupsFindDestDefault(http_t *http, cups_dest_t *dest,
762 cups_dinfo_t *dinfo,
763 const char *option);
764 </code></pre>
765 <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>
766 <pre><code>const char *def_value =
767 cupsGetOption(CUPS_FINISHINGS, dest-&gt;num_options,
768 dest-&gt;options);
769 ipp_attribute_t *def_attr =
770 cupsFindDestDefault(CUPS_HTTP_DEFAULT, dest, info,
771 CUPS_FINISHINGS);
772
773 if (def_value != NULL)
774 {
775 printf(&quot;Default finishings: %s\n&quot;, def_value);
776 }
777 else
778 {
779 int i, count = ippGetCount(def_attr);
780
781 printf(&quot;Default finishings: %d&quot;,
782 ippGetInteger(def_attr, 0));
783 for (i = 1; i &lt; count; i ++)
784 printf(&quot;,%d&quot;, ippGetInteger(def_attr, i));
785 putchar('\n');
786 }
787 </code></pre>
788 <h4><a id="getting-ready-loaded-values">Getting Ready (Loaded) Values</a></h4>
789 <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>
790 <p>The <code>cupsFindDestReady</code> function finds the IPP attribute containing the ready values for a given option:</p>
791 <pre><code>ipp_attribute_t *
792 cupsFindDestReady(http_t *http, cups_dest_t *dest,
793 cups_dinfo_t *dinfo, const char *option);
794 </code></pre>
795 <p>For example, the following code lists the ready finishing processes:</p>
796 <pre><code>ipp_attribute_t *ready_finishings =
797 cupsFindDestReady(CUPS_HTTP_DEFAULT, dest, info,
798 CUPS_FINISHINGS);
799
800 if (ready_finishings != NULL)
801 {
802 int i, count = ippGetCount(ready_finishings);
803
804 puts(&quot;finishings ready:&quot;);
805 for (i = 0; i &lt; count; i ++)
806 printf(&quot; %d\n&quot;, ippGetInteger(ready_finishings, i));
807 }
808 else
809 puts(&quot;no finishings are ready.&quot;);
810 </code></pre>
811 <h4><a id="media-size-options">Media Size Options</a></h4>
812 <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>
813 <pre><code>typedef struct cups_size_s
814 {
815 char media[128];
816 int width, length;
817 int bottom, left, right, top;
818 } cups_size_t;
819 </code></pre>
820 <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>
821 <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>
822 <pre><code>int
823 cupsGetDestMediaByName(http_t *http, cups_dest_t *dest,
824 cups_dinfo_t *dinfo,
825 const char *media,
826 unsigned flags, cups_size_t *size);
827
828 int
829 cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest,
830 cups_dinfo_t *dinfo,
831 int width, int length,
832 unsigned flags, cups_size_t *size);
833 </code></pre>
834 <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>
835 <ul>
836 <li><code>CUPS_MEDIA_FLAGS_DEFAULT</code>: Find the closest size supported by the printer.</li>
837 <li><code>CUPS_MEDIA_FLAGS_BORDERLESS</code>: Find a borderless size.</li>
838 <li><code>CUPS_MEDIA_FLAGS_DUPLEX</code>: Find a size compatible with two-sided printing.</li>
839 <li><code>CUPS_MEDIA_FLAGS_EXACT</code>: Find an exact match for the size.</li>
840 <li><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.</li>
841 </ul>
842 <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>
843 <p>For example, the following code prints the margins for two-sided printing on US Letter media:</p>
844 <pre><code>cups_size_t size;
845
846 if (cupsGetDestMediaByName(CUPS_HTTP_DEFAULT, dest, info,
847 CUPS_MEDIA_LETTER,
848 CUPS_MEDIA_FLAGS_DUPLEX, &amp;size))
849 {
850 puts(&quot;Margins for duplex US Letter:&quot;);
851 printf(&quot; Bottom: %.2fin\n&quot;, size.bottom / 2540.0);
852 printf(&quot; Left: %.2fin\n&quot;, size.left / 2540.0);
853 printf(&quot; Right: %.2fin\n&quot;, size.right / 2540.0);
854 printf(&quot; Top: %.2fin\n&quot;, size.top / 2540.0);
855 }
856 else
857 puts(&quot;Margins for duplex US Letter are not available.&quot;);
858 </code></pre>
859 <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>
860 <pre><code>int
861 cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest,
862 cups_dinfo_t *dinfo, int n,
863 unsigned flags, cups_size_t *size);
864
865 int
866 cupsGetDestMediaCount(http_t *http, cups_dest_t *dest,
867 cups_dinfo_t *dinfo, unsigned flags);
868 </code></pre>
869 <p>For example, the following code prints the list of ready media and corresponding margins:</p>
870 <pre><code>cups_size_t size;
871 int i;
872 int count = cupsGetDestMediaCount(CUPS_HTTP_DEFAULT,
873 dest, info,
874 CUPS_MEDIA_FLAGS_READY);
875
876 for (i = 0; i &lt; count; i ++)
877 {
878 if (cupsGetDestMediaByIndex(CUPS_HTTP_DEFAULT, dest, info,
879 i, CUPS_MEDIA_FLAGS_READY,
880 &amp;size))
881 {
882 printf(&quot;%s:\n&quot;, size.name);
883 printf(&quot; Width: %.2fin\n&quot;, size.width / 2540.0);
884 printf(&quot; Length: %.2fin\n&quot;, size.length / 2540.0);
885 printf(&quot; Bottom: %.2fin\n&quot;, size.bottom / 2540.0);
886 printf(&quot; Left: %.2fin\n&quot;, size.left / 2540.0);
887 printf(&quot; Right: %.2fin\n&quot;, size.right / 2540.0);
888 printf(&quot; Top: %.2fin\n&quot;, size.top / 2540.0);
889 }
890 }
891 </code></pre>
892 <p>Finally, the <code>cupsGetDestMediaDefault</code> function returns the default media size:</p>
893 <pre><code>int
894 cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
895 cups_dinfo_t *dinfo, unsigned flags,
896 cups_size_t *size);
897 </code></pre>
898 <h4><a id="localizing-options-and-values">Localizing Options and Values</a></h4>
899 <p>CUPS provides three functions to get localized versions of options and values: <code>cupsLocalizeDestMedia</code>, <code>cupsLocalizeDestOption</code>, and <code>cupsLocalizeDestValue</code>:</p>
900 <pre><code>const char *
901 cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest,
902 cups_dinfo_t *info, unsigned flags,
903 cups_size_t *size);
904
905 const char *
906 cupsLocalizeDestOption(http_t *http, cups_dest_t *dest,
907 cups_dinfo_t *info,
908 const char *option);
909
910 const char *
911 cupsLocalizeDestValue(http_t *http, cups_dest_t *dest,
912 cups_dinfo_t *info,
913 const char *option, const char *value);
914 </code></pre>
915 <h3><a id="submitting-a-print-job">Submitting a Print Job</a></h3>
916 <p>Once you are ready to submit a print job, you create a job using the <code>cupsCreateDestJob</code> function:</p>
917 <pre><code>ipp_status_t
918 cupsCreateDestJob(http_t *http, cups_dest_t *dest,
919 cups_dinfo_t *info, int *job_id,
920 const char *title, int num_options,
921 cups_option_t *options);
922 </code></pre>
923 <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>
924 <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>
925 <p>For example, the following code creates a new job that will print 42 copies of a two-sided US Letter document:</p>
926 <pre><code>int job_id = 0;
927 int num_options = 0;
928 cups_option_t *options = NULL;
929
930 num_options = cupsAddOption(CUPS_COPIES, &quot;42&quot;,
931 num_options, &amp;options);
932 num_options = cupsAddOption(CUPS_MEDIA, CUPS_MEDIA_LETTER,
933 num_options, &amp;options);
934 num_options = cupsAddOption(CUPS_SIDES,
935 CUPS_SIDES_TWO_SIDED_PORTRAIT,
936 num_options, &amp;options);
937
938 if (cupsCreateDestJob(CUPS_HTTP_DEFAULT, dest, info,
939 &amp;job_id, &quot;My Document&quot;, num_options,
940 options) == IPP_STATUS_OK)
941 printf(&quot;Created job: %d\n&quot;, job_id);
942 else
943 printf(&quot;Unable to create job: %s\n&quot;,
944 cupsLastErrorString());
945 </code></pre>
946 <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>
947 <pre><code>http_status_t
948 cupsStartDestDocument(http_t *http, cups_dest_t *dest,
949 cups_dinfo_t *info, int job_id,
950 const char *docname,
951 const char *format,
952 int num_options,
953 cups_option_t *options,
954 int last_document);
955
956 http_status_t
957 cupsWriteRequestData(http_t *http, const char *buffer,
958 size_t length);
959
960 ipp_status_t
961 cupsFinishDestDocument(http_t *http, cups_dest_t *dest,
962 cups_dinfo_t *info);
963 </code></pre>
964 <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>
965 <ul>
966 <li><code>CUPS_FORMAT_JPEG</code>: &quot;image/jpeg&quot;</li>
967 <li><code>CUPS_FORMAT_PDF</code>: &quot;application/pdf&quot;</li>
968 <li><code>CUPS_FORMAT_POSTSCRIPT</code>: &quot;application/postscript&quot;</li>
969 <li><code>CUPS_FORMAT_TEXT</code>: &quot;text/plain&quot;</li>
970 </ul>
971 <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>
972 <p>For example, the following code submits a PDF file to the job that was just created:</p>
973 <pre><code>FILE *fp = fopen(&quot;filename.pdf&quot;, &quot;rb&quot;);
974 size_t bytes;
975 char buffer[65536];
976
977 if (cupsStartDestDocument(CUPS_HTTP_DEFAULT, dest, info,
978 job_id, &quot;filename.pdf&quot;, 0, NULL,
979 1) == HTTP_STATUS_CONTINUE)
980 {
981 while ((bytes = fread(buffer, 1, sizeof(buffer), fp)) &gt; 0)
982 if (cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer,
983 bytes) != HTTP_STATUS_CONTINUE)
984 break;
985
986 if (cupsFinishDestDocument(CUPS_HTTP_DEFAULT, dest,
987 info) == IPP_STATUS_OK)
988 puts(&quot;Document send succeeded.&quot;);
989 else
990 printf(&quot;Document send failed: %s\n&quot;,
991 cupsLastErrorString());
992 }
993
994 fclose(fp);
995 </code></pre>
996 <h2 class="title"><a id="FUNCTIONS">Functions</a></h2>
997 <h3 class="function"><a id="cupsAddDest">cupsAddDest</a></h3>
998 <p class="description">Add a destination to the list of destinations.</p>
999 <p class="code">
1000 int cupsAddDest (<br>
1001 &#160;&#160;&#160;&#160;const char *name,<br>
1002 &#160;&#160;&#160;&#160;const char *instance,<br>
1003 &#160;&#160;&#160;&#160;int num_dests,<br>
1004 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> **dests<br>
1005 );</p>
1006 <h4 class="parameters">Parameters</h4>
1007 <dl>
1008 <dt>name</dt>
1009 <dd class="description">Destination name</dd>
1010 <dt>instance</dt>
1011 <dd class="description">Instance name or <code>NULL</code> for none/primary</dd>
1012 <dt>num_dests</dt>
1013 <dd class="description">Number of destinations</dd>
1014 <dt>dests</dt>
1015 <dd class="description">Destinations</dd>
1016 </dl>
1017 <h4 class="returnvalue">Return Value</h4>
1018 <p class="description">New number of destinations</p>
1019 <h4 class="discussion">Discussion</h4>
1020 <p class="discussion">This function cannot be used to add a new class or printer queue,
1021 it only adds a new container of saved options for the named
1022 destination or instance.<br>
1023 <br>
1024 If the named destination already exists, the destination list is
1025 returned unchanged. Adding a new instance of a destination creates
1026 a copy of that destination's options.<br>
1027 <br>
1028 Use the <a href="#cupsSaveDests"><code>cupsSaveDests</code></a> function to save the updated list of
1029 destinations to the user's lpoptions file.</p>
1030 <h3 class="function"><span class="info">&#160;CUPS 2.2.4&#160;</span><a id="cupsAddIntegerOption">cupsAddIntegerOption</a></h3>
1031 <p class="description">Add an integer option to an option array.</p>
1032 <p class="code">
1033 int cupsAddIntegerOption (<br>
1034 &#160;&#160;&#160;&#160;const char *name,<br>
1035 &#160;&#160;&#160;&#160;int value,<br>
1036 &#160;&#160;&#160;&#160;int num_options,<br>
1037 &#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **options<br>
1038 );</p>
1039 <h4 class="parameters">Parameters</h4>
1040 <dl>
1041 <dt>name</dt>
1042 <dd class="description">Name of option</dd>
1043 <dt>value</dt>
1044 <dd class="description">Value of option</dd>
1045 <dt>num_options</dt>
1046 <dd class="description">Number of options</dd>
1047 <dt>options</dt>
1048 <dd class="description">Pointer to options</dd>
1049 </dl>
1050 <h4 class="returnvalue">Return Value</h4>
1051 <p class="description">Number of options</p>
1052 <h4 class="discussion">Discussion</h4>
1053 <p class="discussion">New option arrays can be initialized simply by passing 0 for the
1054 &quot;num_options&quot; parameter.
1055
1056 </p>
1057 <h3 class="function"><a id="cupsAddOption">cupsAddOption</a></h3>
1058 <p class="description">Add an option to an option array.</p>
1059 <p class="code">
1060 int cupsAddOption (<br>
1061 &#160;&#160;&#160;&#160;const char *name,<br>
1062 &#160;&#160;&#160;&#160;const char *value,<br>
1063 &#160;&#160;&#160;&#160;int num_options,<br>
1064 &#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **options<br>
1065 );</p>
1066 <h4 class="parameters">Parameters</h4>
1067 <dl>
1068 <dt>name</dt>
1069 <dd class="description">Name of option</dd>
1070 <dt>value</dt>
1071 <dd class="description">Value of option</dd>
1072 <dt>num_options</dt>
1073 <dd class="description">Number of options</dd>
1074 <dt>options</dt>
1075 <dd class="description">Pointer to options</dd>
1076 </dl>
1077 <h4 class="returnvalue">Return Value</h4>
1078 <p class="description">Number of options</p>
1079 <h4 class="discussion">Discussion</h4>
1080 <p class="discussion">New option arrays can be initialized simply by passing 0 for the
1081 &quot;num_options&quot; parameter.</p>
1082 <h3 class="function"><a id="cupsCancelDestJob">cupsCancelDestJob</a></h3>
1083 <p class="description">Include necessary headers...</p>
1084 <p class="code">
1085 ipp_status_t cupsCancelDestJob (<br>
1086 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1087 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1088 &#160;&#160;&#160;&#160;int job_id<br>
1089 );</p>
1090 <h4 class="parameters">Parameters</h4>
1091 <dl>
1092 <dt>http</dt>
1093 <dd class="description">Connection to destination</dd>
1094 <dt>dest</dt>
1095 <dd class="description">Destination</dd>
1096 <dt>job_id</dt>
1097 <dd class="description">Job ID</dd>
1098 </dl>
1099 <h4 class="returnvalue">Return Value</h4>
1100 <p class="description">Cancel a job on a destination.</p>
1101 <p class="discussion">The &quot;job_id&quot; is the number returned by cupsCreateDestJob.<br>
1102 <br>
1103 Returns <code>IPP_STATUS_OK</code> on success and
1104 <code>IPP_STATUS_ERRPR_NOT_AUTHORIZED</code> or
1105 <code>IPP_STATUS_ERROR_FORBIDDEN</code> on failure.
1106
1107 </p>
1108 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCheckDestSupported">cupsCheckDestSupported</a></h3>
1109 <p class="description">Check that the option and value are supported
1110 by the destination.</p>
1111 <p class="code">
1112 int cupsCheckDestSupported (<br>
1113 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1114 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1115 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
1116 &#160;&#160;&#160;&#160;const char *option,<br>
1117 &#160;&#160;&#160;&#160;const char *value<br>
1118 );</p>
1119 <h4 class="parameters">Parameters</h4>
1120 <dl>
1121 <dt>http</dt>
1122 <dd class="description">Connection to destination</dd>
1123 <dt>dest</dt>
1124 <dd class="description">Destination</dd>
1125 <dt>dinfo</dt>
1126 <dd class="description">Destination information</dd>
1127 <dt>option</dt>
1128 <dd class="description">Option</dd>
1129 <dt>value</dt>
1130 <dd class="description">Value</dd>
1131 </dl>
1132 <h4 class="returnvalue">Return Value</h4>
1133 <p class="description">1 if supported, 0 otherwise</p>
1134 <h4 class="discussion">Discussion</h4>
1135 <p class="discussion">Returns 1 if supported, 0 otherwise.
1136
1137 </p>
1138 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCloseDestJob">cupsCloseDestJob</a></h3>
1139 <p class="description">Close a job and start printing.</p>
1140 <p class="code">
1141 ipp_status_t cupsCloseDestJob (<br>
1142 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1143 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1144 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *info,<br>
1145 &#160;&#160;&#160;&#160;int job_id<br>
1146 );</p>
1147 <h4 class="parameters">Parameters</h4>
1148 <dl>
1149 <dt>http</dt>
1150 <dd class="description">Connection to destination</dd>
1151 <dt>dest</dt>
1152 <dd class="description">Destination</dd>
1153 <dt>info</dt>
1154 <dd class="description">Destination information</dd>
1155 <dt>job_id</dt>
1156 <dd class="description">Job ID</dd>
1157 </dl>
1158 <h4 class="returnvalue">Return Value</h4>
1159 <p class="description">IPP status code</p>
1160 <h4 class="discussion">Discussion</h4>
1161 <p class="discussion">Use when the last call to cupsStartDocument passed 0 for &quot;last_document&quot;.
1162 &quot;job_id&quot; is the job ID returned by cupsCreateDestJob. Returns <code>IPP_STATUS_OK</code>
1163 on success.
1164
1165 </p>
1166 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsConnectDest">cupsConnectDest</a></h3>
1167 <p class="description">Connect to the server for a destination.</p>
1168 <p class="code">
1169 <a href="#http_t">http_t</a> *cupsConnectDest (<br>
1170 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1171 &#160;&#160;&#160;&#160;unsigned flags,<br>
1172 &#160;&#160;&#160;&#160;int msec,<br>
1173 &#160;&#160;&#160;&#160;int *cancel,<br>
1174 &#160;&#160;&#160;&#160;char *resource,<br>
1175 &#160;&#160;&#160;&#160;size_t resourcesize,<br>
1176 &#160;&#160;&#160;&#160;<a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb,<br>
1177 &#160;&#160;&#160;&#160;void *user_data<br>
1178 );</p>
1179 <h4 class="parameters">Parameters</h4>
1180 <dl>
1181 <dt>dest</dt>
1182 <dd class="description">Destination</dd>
1183 <dt>flags</dt>
1184 <dd class="description">Connection flags</dd>
1185 <dt>msec</dt>
1186 <dd class="description">Timeout in milliseconds</dd>
1187 <dt>cancel</dt>
1188 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
1189 <dt>resource</dt>
1190 <dd class="description">Resource buffer</dd>
1191 <dt>resourcesize</dt>
1192 <dd class="description">Size of resource buffer</dd>
1193 <dt>cb</dt>
1194 <dd class="description">Callback function</dd>
1195 <dt>user_data</dt>
1196 <dd class="description">User data pointer</dd>
1197 </dl>
1198 <h4 class="returnvalue">Return Value</h4>
1199 <p class="description">Connection to server or <code>NULL</code></p>
1200 <h4 class="discussion">Discussion</h4>
1201 <p class="discussion">Connect to the destination, returning a new http_t connection object and
1202 optionally the resource path to use for the destination. These calls will
1203 block until a connection is made, the timeout expires, the integer pointed
1204 to by &quot;cancel&quot; is non-zero, or the callback function (or block) returns 0,
1205 The caller is responsible for calling httpClose() on the returned object.
1206
1207 </p>
1208 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDest">cupsCopyDest</a></h3>
1209 <p class="description">Copy a destination.</p>
1210 <p class="code">
1211 int cupsCopyDest (<br>
1212 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1213 &#160;&#160;&#160;&#160;int num_dests,<br>
1214 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> **dests<br>
1215 );</p>
1216 <h4 class="parameters">Parameters</h4>
1217 <dl>
1218 <dt>dest</dt>
1219 <dd class="description">Destination to copy</dd>
1220 <dt>num_dests</dt>
1221 <dd class="description">Number of destinations</dd>
1222 <dt>dests</dt>
1223 <dd class="description">Destination array</dd>
1224 </dl>
1225 <h4 class="returnvalue">Return Value</h4>
1226 <p class="description">New number of destinations</p>
1227 <h4 class="discussion">Discussion</h4>
1228 <p class="discussion">Make a copy of the destination to an array of destinations (or just a single
1229 copy) - for use with the cupsEnumDests* functions. The caller is responsible
1230 for calling cupsFreeDests() on the returned object(s).
1231
1232 </p>
1233 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDestConflicts">cupsCopyDestConflicts</a></h3>
1234 <p class="description">Get conflicts and resolutions for a new
1235 option/value pair.</p>
1236 <p class="code">
1237 int cupsCopyDestConflicts (<br>
1238 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1239 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1240 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
1241 &#160;&#160;&#160;&#160;int num_options,<br>
1242 &#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options,<br>
1243 &#160;&#160;&#160;&#160;const char *new_option,<br>
1244 &#160;&#160;&#160;&#160;const char *new_value,<br>
1245 &#160;&#160;&#160;&#160;int *num_conflicts,<br>
1246 &#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **conflicts,<br>
1247 &#160;&#160;&#160;&#160;int *num_resolved,<br>
1248 &#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **resolved<br>
1249 );</p>
1250 <h4 class="parameters">Parameters</h4>
1251 <dl>
1252 <dt>http</dt>
1253 <dd class="description">Connection to destination</dd>
1254 <dt>dest</dt>
1255 <dd class="description">Destination</dd>
1256 <dt>dinfo</dt>
1257 <dd class="description">Destination information</dd>
1258 <dt>num_options</dt>
1259 <dd class="description">Number of current options</dd>
1260 <dt>options</dt>
1261 <dd class="description">Current options</dd>
1262 <dt>new_option</dt>
1263 <dd class="description">New option</dd>
1264 <dt>new_value</dt>
1265 <dd class="description">New value</dd>
1266 <dt>num_conflicts</dt>
1267 <dd class="description">Number of conflicting options</dd>
1268 <dt>conflicts</dt>
1269 <dd class="description">Conflicting options</dd>
1270 <dt>num_resolved</dt>
1271 <dd class="description">Number of options to resolve</dd>
1272 <dt>resolved</dt>
1273 <dd class="description">Resolved options</dd>
1274 </dl>
1275 <h4 class="returnvalue">Return Value</h4>
1276 <p class="description">1 if there is a conflict, 0 if none, -1 on error</p>
1277 <h4 class="discussion">Discussion</h4>
1278 <p class="discussion">&quot;num_options&quot; and &quot;options&quot; represent the currently selected options by the
1279 user. &quot;new_option&quot; and &quot;new_value&quot; are the setting the user has just
1280 changed.<br>
1281 <br>
1282 Returns 1 if there is a conflict, 0 if there are no conflicts, and -1 if
1283 there was an unrecoverable error such as a resolver loop.<br>
1284 <br>
1285 If &quot;num_conflicts&quot; and &quot;conflicts&quot; are not <code>NULL</code>, they are set to
1286 contain the list of conflicting option/value pairs. Similarly, if
1287 &quot;num_resolved&quot; and &quot;resolved&quot; are not <code>NULL</code> they will be set to the
1288 list of changes needed to resolve the conflict.<br>
1289 <br>
1290 If cupsCopyDestConflicts returns 1 but &quot;num_resolved&quot; and &quot;resolved&quot; are set
1291 to 0 and <code>NULL</code>, respectively, then the conflict cannot be resolved.
1292
1293 </p>
1294 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDestInfo">cupsCopyDestInfo</a></h3>
1295 <p class="description">Get the supported values/capabilities for the
1296 destination.</p>
1297 <p class="code">
1298 <a href="#cups_dinfo_t">cups_dinfo_t</a> *cupsCopyDestInfo (<br>
1299 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1300 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest<br>
1301 );</p>
1302 <h4 class="parameters">Parameters</h4>
1303 <dl>
1304 <dt>http</dt>
1305 <dd class="description">Connection to destination</dd>
1306 <dt>dest</dt>
1307 <dd class="description">Destination</dd>
1308 </dl>
1309 <h4 class="returnvalue">Return Value</h4>
1310 <p class="description">Destination information</p>
1311 <h4 class="discussion">Discussion</h4>
1312 <p class="discussion">The caller is responsible for calling <a href="#cupsFreeDestInfo"><code>cupsFreeDestInfo</code></a> on the return
1313 value. <code>NULL</code> is returned on error.
1314
1315 </p>
1316 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCreateDestJob">cupsCreateDestJob</a></h3>
1317 <p class="description">Create a job on a destination.</p>
1318 <p class="code">
1319 ipp_status_t cupsCreateDestJob (<br>
1320 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1321 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1322 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *info,<br>
1323 &#160;&#160;&#160;&#160;int *job_id,<br>
1324 &#160;&#160;&#160;&#160;const char *title,<br>
1325 &#160;&#160;&#160;&#160;int num_options,<br>
1326 &#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br>
1327 );</p>
1328 <h4 class="parameters">Parameters</h4>
1329 <dl>
1330 <dt>http</dt>
1331 <dd class="description">Connection to destination</dd>
1332 <dt>dest</dt>
1333 <dd class="description">Destination</dd>
1334 <dt>info</dt>
1335 <dd class="description">Destination information</dd>
1336 <dt>job_id</dt>
1337 <dd class="description">Job ID or 0 on error</dd>
1338 <dt>title</dt>
1339 <dd class="description">Job name</dd>
1340 <dt>num_options</dt>
1341 <dd class="description">Number of job options</dd>
1342 <dt>options</dt>
1343 <dd class="description">Job options</dd>
1344 </dl>
1345 <h4 class="returnvalue">Return Value</h4>
1346 <p class="description">IPP status code</p>
1347 <h4 class="discussion">Discussion</h4>
1348 <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success, saving the job ID
1349 in the variable pointed to by &quot;job_id&quot;.
1350
1351 </p>
1352 <h3 class="function"><span class="info">&#160;CUPS 1.1.20/macOS 10.4&#160;</span><a id="cupsDoAuthentication">cupsDoAuthentication</a></h3>
1353 <p class="description">Authenticate a request.</p>
1354 <p class="code">
1355 int cupsDoAuthentication (<br>
1356 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1357 &#160;&#160;&#160;&#160;const char *method,<br>
1358 &#160;&#160;&#160;&#160;const char *resource<br>
1359 );</p>
1360 <h4 class="parameters">Parameters</h4>
1361 <dl>
1362 <dt>http</dt>
1363 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1364 <dt>method</dt>
1365 <dd class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</dd>
1366 <dt>resource</dt>
1367 <dd class="description">Resource path</dd>
1368 </dl>
1369 <h4 class="returnvalue">Return Value</h4>
1370 <p class="description">0 on success, -1 on error</p>
1371 <h4 class="discussion">Discussion</h4>
1372 <p class="discussion">This function should be called in response to a <code>HTTP_STATUS_UNAUTHORIZED</code>
1373 status, prior to resubmitting your request.
1374
1375 </p>
1376 <h3 class="function"><a id="cupsEncodeOptions">cupsEncodeOptions</a></h3>
1377 <p class="description"></p>
1378 <p class="code">
1379 void cupsEncodeOptions (<br>
1380 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
1381 &#160;&#160;&#160;&#160;int num_options,<br>
1382 &#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br>
1383 );</p>
1384 <h4 class="parameters">Parameters</h4>
1385 <dl>
1386 <dt>ipp</dt>
1387 <dd class="description">Request to add to</dd>
1388 <dt>num_options</dt>
1389 <dd class="description">Number of options</dd>
1390 <dt>options</dt>
1391 <dd class="description">Options</dd>
1392 </dl>
1393 <h4 class="returnvalue">Return Value</h4>
1394 <p class="description">Encode printer options into IPP attributes.</p>
1395 <p class="discussion">This function adds operation, job, and then subscription attributes,
1396 in that order. Use the cupsEncodeOptions2() function to add attributes
1397 for a single group.
1398
1399 </p>
1400 <h3 class="function"><a id="cupsEncodeOptions2">cupsEncodeOptions2</a></h3>
1401 <p class="description">Add the options in the proper groups &amp; order...</p>
1402 <p class="code">
1403 void cupsEncodeOptions2 (<br>
1404 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
1405 &#160;&#160;&#160;&#160;int num_options,<br>
1406 &#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options,<br>
1407 &#160;&#160;&#160;&#160;ipp_tag_t group_tag<br>
1408 );</p>
1409 <h4 class="parameters">Parameters</h4>
1410 <dl>
1411 <dt>ipp</dt>
1412 <dd class="description">Request to add to</dd>
1413 <dt>num_options</dt>
1414 <dd class="description">Number of options</dd>
1415 <dt>options</dt>
1416 <dd class="description">Options</dd>
1417 <dt>group_tag</dt>
1418 <dd class="description">Group to encode</dd>
1419 </dl>
1420 <h4 class="returnvalue">Return Value</h4>
1421 <p class="description">Encode printer options into IPP attributes for a group.</p>
1422 <p class="discussion">This function only adds attributes for a single group. Call this
1423 function multiple times for each group, or use cupsEncodeOptions()
1424 to add the standard groups.
1425
1426 </p>
1427 <h3 class="function"><a id="cupsEncryption">cupsEncryption</a></h3>
1428 <p class="description">Get the current encryption settings.</p>
1429 <p class="code">
1430 <a href="#http_encryption_t">http_encryption_t</a> cupsEncryption (void);</p>
1431 <h4 class="returnvalue">Return Value</h4>
1432 <p class="description">Encryption settings</p>
1433 <h4 class="discussion">Discussion</h4>
1434 <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
1435 environment variable, then the ~/.cups/client.conf file, and finally the
1436 /etc/cups/client.conf file. If not set, the default is
1437 <code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
1438 <br>
1439 Note: The current encryption setting is tracked separately for each thread
1440 in a program. Multi-threaded programs that override the setting via the
1441 <a href="#cupsSetEncryption"><code>cupsSetEncryption</code></a> function need to do so in each thread for the same
1442 setting to be used.</p>
1443 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsEnumDests">cupsEnumDests</a></h3>
1444 <p class="description">Enumerate available destinations with a callback function.</p>
1445 <p class="code">
1446 int cupsEnumDests (<br>
1447 &#160;&#160;&#160;&#160;unsigned flags,<br>
1448 &#160;&#160;&#160;&#160;int msec,<br>
1449 &#160;&#160;&#160;&#160;int *cancel,<br>
1450 &#160;&#160;&#160;&#160;<a href="#cups_ptype_t">cups_ptype_t</a> type,<br>
1451 &#160;&#160;&#160;&#160;<a href="#cups_ptype_t">cups_ptype_t</a> mask,<br>
1452 &#160;&#160;&#160;&#160;<a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb,<br>
1453 &#160;&#160;&#160;&#160;void *user_data<br>
1454 );</p>
1455 <h4 class="parameters">Parameters</h4>
1456 <dl>
1457 <dt>flags</dt>
1458 <dd class="description">Enumeration flags</dd>
1459 <dt>msec</dt>
1460 <dd class="description">Timeout in milliseconds, -1 for indefinite</dd>
1461 <dt>cancel</dt>
1462 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
1463 <dt>type</dt>
1464 <dd class="description">Printer type bits</dd>
1465 <dt>mask</dt>
1466 <dd class="description">Mask for printer type bits</dd>
1467 <dt>cb</dt>
1468 <dd class="description">Callback function</dd>
1469 <dt>user_data</dt>
1470 <dd class="description">User data</dd>
1471 </dl>
1472 <h4 class="returnvalue">Return Value</h4>
1473 <p class="description">1 on success, 0 on failure</p>
1474 <h4 class="discussion">Discussion</h4>
1475 <p class="discussion">Destinations are enumerated from one or more sources. The callback function
1476 receives the <code>user_data</code> pointer and the destination pointer which can
1477 be used as input to the <a href="#cupsCopyDest"><code>cupsCopyDest</code></a> function. The function must
1478 return 1 to continue enumeration or 0 to stop.<br>
1479 <br>
1480 The <code>type</code> and <code>mask</code> arguments allow the caller to filter the
1481 destinations that are enumerated. Passing 0 for both will enumerate all
1482 printers. The constant <code>CUPS_PRINTER_DISCOVERED</code> is used to filter on
1483 destinations that are available but have not yet been added locally.<br>
1484 <br>
1485 Enumeration happens on the current thread and does not return until all
1486 destinations have been enumerated or the callback function returns 0.<br>
1487 <br>
1488 Note: The callback function will likely receive multiple updates for the same
1489 destinations - it is up to the caller to suppress any duplicate destinations.
1490
1491 </p>
1492 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestDefault">cupsFindDestDefault</a></h3>
1493 <p class="description">Find the default value(s) for the given option.</p>
1494 <p class="code">
1495 <a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestDefault (<br>
1496 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1497 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1498 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
1499 &#160;&#160;&#160;&#160;const char *option<br>
1500 );</p>
1501 <h4 class="parameters">Parameters</h4>
1502 <dl>
1503 <dt>http</dt>
1504 <dd class="description">Connection to destination</dd>
1505 <dt>dest</dt>
1506 <dd class="description">Destination</dd>
1507 <dt>dinfo</dt>
1508 <dd class="description">Destination information</dd>
1509 <dt>option</dt>
1510 <dd class="description">Option/attribute name</dd>
1511 </dl>
1512 <h4 class="returnvalue">Return Value</h4>
1513 <p class="description">Default attribute or <code>NULL</code> for none</p>
1514 <h4 class="discussion">Discussion</h4>
1515 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1516 <code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1517 <code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1518 <code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1519 functions to inspect the default value(s) as needed.
1520
1521 </p>
1522 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestReady">cupsFindDestReady</a></h3>
1523 <p class="description">Find the default value(s) for the given option.</p>
1524 <p class="code">
1525 <a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestReady (<br>
1526 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1527 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1528 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
1529 &#160;&#160;&#160;&#160;const char *option<br>
1530 );</p>
1531 <h4 class="parameters">Parameters</h4>
1532 <dl>
1533 <dt>http</dt>
1534 <dd class="description">Connection to destination</dd>
1535 <dt>dest</dt>
1536 <dd class="description">Destination</dd>
1537 <dt>dinfo</dt>
1538 <dd class="description">Destination information</dd>
1539 <dt>option</dt>
1540 <dd class="description">Option/attribute name</dd>
1541 </dl>
1542 <h4 class="returnvalue">Return Value</h4>
1543 <p class="description">Default attribute or <code>NULL</code> for none</p>
1544 <h4 class="discussion">Discussion</h4>
1545 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1546 <code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1547 <code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1548 <code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1549 functions to inspect the default value(s) as needed.
1550
1551 </p>
1552 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestSupported">cupsFindDestSupported</a></h3>
1553 <p class="description">Find the default value(s) for the given option.</p>
1554 <p class="code">
1555 <a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestSupported (<br>
1556 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1557 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1558 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
1559 &#160;&#160;&#160;&#160;const char *option<br>
1560 );</p>
1561 <h4 class="parameters">Parameters</h4>
1562 <dl>
1563 <dt>http</dt>
1564 <dd class="description">Connection to destination</dd>
1565 <dt>dest</dt>
1566 <dd class="description">Destination</dd>
1567 <dt>dinfo</dt>
1568 <dd class="description">Destination information</dd>
1569 <dt>option</dt>
1570 <dd class="description">Option/attribute name</dd>
1571 </dl>
1572 <h4 class="returnvalue">Return Value</h4>
1573 <p class="description">Default attribute or <code>NULL</code> for none</p>
1574 <h4 class="discussion">Discussion</h4>
1575 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1576 <code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1577 <code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1578 <code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1579 functions to inspect the default value(s) as needed.
1580
1581 </p>
1582 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsFinishDestDocument">cupsFinishDestDocument</a></h3>
1583 <p class="description">Finish the current document.</p>
1584 <p class="code">
1585 ipp_status_t cupsFinishDestDocument (<br>
1586 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1587 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1588 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *info<br>
1589 );</p>
1590 <h4 class="parameters">Parameters</h4>
1591 <dl>
1592 <dt>http</dt>
1593 <dd class="description">Connection to destination</dd>
1594 <dt>dest</dt>
1595 <dd class="description">Destination</dd>
1596 <dt>info</dt>
1597 <dd class="description">Destination information</dd>
1598 </dl>
1599 <h4 class="returnvalue">Return Value</h4>
1600 <p class="description">Status of document submission</p>
1601 <h4 class="discussion">Discussion</h4>
1602 <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success.
1603
1604 </p>
1605 <h3 class="function"><a id="cupsFreeDestInfo">cupsFreeDestInfo</a></h3>
1606 <p class="description">Find and return the attribute...</p>
1607 <p class="code">
1608 void cupsFreeDestInfo (<br>
1609 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo<br>
1610 );</p>
1611 <h4 class="parameters">Parameters</h4>
1612 <dl>
1613 <dt>dinfo</dt>
1614 <dd class="description">Destination information</dd>
1615 </dl>
1616 <h4 class="returnvalue">Return Value</h4>
1617 <p class="description">Free destination information obtained using
1618 <a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a>.</p>
1619 <h3 class="function"><a id="cupsFreeDests">cupsFreeDests</a></h3>
1620 <p class="description">Block</p>
1621 <p class="code">
1622 void cupsFreeDests (<br>
1623 &#160;&#160;&#160;&#160;int num_dests,<br>
1624 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dests<br>
1625 );</p>
1626 <h4 class="parameters">Parameters</h4>
1627 <dl>
1628 <dt>num_dests</dt>
1629 <dd class="description">Number of destinations</dd>
1630 <dt>dests</dt>
1631 <dd class="description">Destinations</dd>
1632 </dl>
1633 <h4 class="returnvalue">Return Value</h4>
1634 <p class="description">Free the memory used by the list of destinations.</p>
1635 <h3 class="function"><a id="cupsFreeJobs">cupsFreeJobs</a></h3>
1636 <p class="description">Printer resource</p>
1637 <p class="code">
1638 void cupsFreeJobs (<br>
1639 &#160;&#160;&#160;&#160;int num_jobs,<br>
1640 &#160;&#160;&#160;&#160;<a href="#cups_job_t">cups_job_t</a> *jobs<br>
1641 );</p>
1642 <h4 class="parameters">Parameters</h4>
1643 <dl>
1644 <dt>num_jobs</dt>
1645 <dd class="description">Number of jobs</dd>
1646 <dt>jobs</dt>
1647 <dd class="description">Jobs</dd>
1648 </dl>
1649 <h4 class="returnvalue">Return Value</h4>
1650 <p class="description">Free memory used by job data.</p>
1651 <h3 class="function"><a id="cupsFreeOptions">cupsFreeOptions</a></h3>
1652 <p class="description">Match found; free the old value...</p>
1653 <p class="code">
1654 void cupsFreeOptions (<br>
1655 &#160;&#160;&#160;&#160;int num_options,<br>
1656 &#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br>
1657 );</p>
1658 <h4 class="parameters">Parameters</h4>
1659 <dl>
1660 <dt>num_options</dt>
1661 <dd class="description">Number of options</dd>
1662 <dt>options</dt>
1663 <dd class="description">Pointer to options</dd>
1664 </dl>
1665 <h4 class="returnvalue">Return Value</h4>
1666 <p class="description">Free all memory used by options.</p>
1667 <h3 class="function"><a id="cupsGetDest">cupsGetDest</a></h3>
1668 <p class="description">Get the named destination from the list.</p>
1669 <p class="code">
1670 <a href="#cups_dest_t">cups_dest_t</a> *cupsGetDest (<br>
1671 &#160;&#160;&#160;&#160;const char *name,<br>
1672 &#160;&#160;&#160;&#160;const char *instance,<br>
1673 &#160;&#160;&#160;&#160;int num_dests,<br>
1674 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dests<br>
1675 );</p>
1676 <h4 class="parameters">Parameters</h4>
1677 <dl>
1678 <dt>name</dt>
1679 <dd class="description">Destination name or <code>NULL</code> for the default destination</dd>
1680 <dt>instance</dt>
1681 <dd class="description">Instance name or <code>NULL</code></dd>
1682 <dt>num_dests</dt>
1683 <dd class="description">Number of destinations</dd>
1684 <dt>dests</dt>
1685 <dd class="description">Destinations</dd>
1686 </dl>
1687 <h4 class="returnvalue">Return Value</h4>
1688 <p class="description">Destination pointer or <code>NULL</code></p>
1689 <h4 class="discussion">Discussion</h4>
1690 <p class="discussion">Use the <a href="#cupsGetDests"><code>cupsGetDests</code></a> or <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> functions to get a
1691 list of supported destinations for the current user.</p>
1692 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></h3>
1693 <p class="description">Get a media name, dimension, and margins for a
1694 specific size.</p>
1695 <p class="code">
1696 int cupsGetDestMediaByIndex (<br>
1697 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1698 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1699 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
1700 &#160;&#160;&#160;&#160;int n,<br>
1701 &#160;&#160;&#160;&#160;unsigned flags,<br>
1702 &#160;&#160;&#160;&#160;<a href="#cups_size_t">cups_size_t</a> *size<br>
1703 );</p>
1704 <h4 class="parameters">Parameters</h4>
1705 <dl>
1706 <dt>http</dt>
1707 <dd class="description">Connection to destination</dd>
1708 <dt>dest</dt>
1709 <dd class="description">Destination</dd>
1710 <dt>dinfo</dt>
1711 <dd class="description">Destination information</dd>
1712 <dt>n</dt>
1713 <dd class="description">Media size number (0-based)</dd>
1714 <dt>flags</dt>
1715 <dd class="description">Media flags</dd>
1716 <dt>size</dt>
1717 <dd class="description">Media size information</dd>
1718 </dl>
1719 <h4 class="returnvalue">Return Value</h4>
1720 <p class="description">1 on success, 0 on failure</p>
1721 <h4 class="discussion">Discussion</h4>
1722 <p class="discussion">The <code>flags</code> parameter determines which set of media are indexed. For
1723 example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will get the Nth
1724 borderless size supported by the printer.
1725
1726 </p>
1727 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsGetDestMediaByName">cupsGetDestMediaByName</a></h3>
1728 <p class="description">Get media names, dimensions, and margins.</p>
1729 <p class="code">
1730 int cupsGetDestMediaByName (<br>
1731 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1732 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1733 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
1734 &#160;&#160;&#160;&#160;const char *media,<br>
1735 &#160;&#160;&#160;&#160;unsigned flags,<br>
1736 &#160;&#160;&#160;&#160;<a href="#cups_size_t">cups_size_t</a> *size<br>
1737 );</p>
1738 <h4 class="parameters">Parameters</h4>
1739 <dl>
1740 <dt>http</dt>
1741 <dd class="description">Connection to destination</dd>
1742 <dt>dest</dt>
1743 <dd class="description">Destination</dd>
1744 <dt>dinfo</dt>
1745 <dd class="description">Destination information</dd>
1746 <dt>media</dt>
1747 <dd class="description">Media name</dd>
1748 <dt>flags</dt>
1749 <dd class="description">Media matching flags</dd>
1750 <dt>size</dt>
1751 <dd class="description">Media size information</dd>
1752 </dl>
1753 <h4 class="returnvalue">Return Value</h4>
1754 <p class="description">1 on match, 0 on failure</p>
1755 <h4 class="discussion">Discussion</h4>
1756 <p class="discussion">The &quot;media&quot; string is a PWG media name. &quot;Flags&quot; provides some matching
1757 guidance (multiple flags can be combined):<br>
1758 <br>
1759 CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
1760 CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
1761 CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
1762 CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
1763 CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
1764 size amongst the &quot;ready&quot; media.<br>
1765 <br>
1766 The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
1767 <br>
1768 Returns 1 when there is a match and 0 if there is not a match.
1769
1770 </p>
1771 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></h3>
1772 <p class="description">Get media names, dimensions, and margins.</p>
1773 <p class="code">
1774 int cupsGetDestMediaBySize (<br>
1775 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1776 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1777 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
1778 &#160;&#160;&#160;&#160;int width,<br>
1779 &#160;&#160;&#160;&#160;int length,<br>
1780 &#160;&#160;&#160;&#160;unsigned flags,<br>
1781 &#160;&#160;&#160;&#160;<a href="#cups_size_t">cups_size_t</a> *size<br>
1782 );</p>
1783 <h4 class="parameters">Parameters</h4>
1784 <dl>
1785 <dt>http</dt>
1786 <dd class="description">Connection to destination</dd>
1787 <dt>dest</dt>
1788 <dd class="description">Destination</dd>
1789 <dt>dinfo</dt>
1790 <dd class="description">Destination information</dd>
1791 <dt>width</dt>
1792 <dd class="description">Media width in hundredths of
1793 of millimeters</dd>
1794 <dt>length</dt>
1795 <dd class="description">Media length in hundredths of
1796 of millimeters</dd>
1797 <dt>flags</dt>
1798 <dd class="description">Media matching flags</dd>
1799 <dt>size</dt>
1800 <dd class="description">Media size information</dd>
1801 </dl>
1802 <h4 class="returnvalue">Return Value</h4>
1803 <p class="description">1 on match, 0 on failure</p>
1804 <h4 class="discussion">Discussion</h4>
1805 <p class="discussion">&quot;Width&quot; and &quot;length&quot; are the dimensions in hundredths of millimeters.
1806 &quot;Flags&quot; provides some matching guidance (multiple flags can be combined):<br>
1807 <br>
1808 CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
1809 CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
1810 CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
1811 CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
1812 CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
1813 size amongst the &quot;ready&quot; media.<br>
1814 <br>
1815 The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
1816 <br>
1817 Returns 1 when there is a match and 0 if there is not a match.
1818
1819 </p>
1820 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaCount">cupsGetDestMediaCount</a></h3>
1821 <p class="description">Get the number of sizes supported by a
1822 destination.</p>
1823 <p class="code">
1824 int cupsGetDestMediaCount (<br>
1825 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1826 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1827 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
1828 &#160;&#160;&#160;&#160;unsigned flags<br>
1829 );</p>
1830 <h4 class="parameters">Parameters</h4>
1831 <dl>
1832 <dt>http</dt>
1833 <dd class="description">Connection to destination</dd>
1834 <dt>dest</dt>
1835 <dd class="description">Destination</dd>
1836 <dt>dinfo</dt>
1837 <dd class="description">Destination information</dd>
1838 <dt>flags</dt>
1839 <dd class="description">Media flags</dd>
1840 </dl>
1841 <h4 class="returnvalue">Return Value</h4>
1842 <p class="description">Number of sizes</p>
1843 <h4 class="discussion">Discussion</h4>
1844 <p class="discussion">The <code>flags</code> parameter determines the set of media sizes that are
1845 counted. For example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return
1846 the number of borderless sizes.
1847
1848 </p>
1849 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></h3>
1850 <p class="description">Get the default size for a destination.</p>
1851 <p class="code">
1852 int cupsGetDestMediaDefault (<br>
1853 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1854 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1855 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
1856 &#160;&#160;&#160;&#160;unsigned flags,<br>
1857 &#160;&#160;&#160;&#160;<a href="#cups_size_t">cups_size_t</a> *size<br>
1858 );</p>
1859 <h4 class="parameters">Parameters</h4>
1860 <dl>
1861 <dt>http</dt>
1862 <dd class="description">Connection to destination</dd>
1863 <dt>dest</dt>
1864 <dd class="description">Destination</dd>
1865 <dt>dinfo</dt>
1866 <dd class="description">Destination information</dd>
1867 <dt>flags</dt>
1868 <dd class="description">Media flags</dd>
1869 <dt>size</dt>
1870 <dd class="description">Media size information</dd>
1871 </dl>
1872 <h4 class="returnvalue">Return Value</h4>
1873 <p class="description">1 on success, 0 on failure</p>
1874 <h4 class="discussion">Discussion</h4>
1875 <p class="discussion">The <code>flags</code> parameter determines which default size is returned. For
1876 example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the default
1877 borderless size, typically US Letter or A4, but sometimes 4x6 photo media.
1878
1879 </p>
1880 <h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsGetDestWithURI">cupsGetDestWithURI</a></h3>
1881 <p class="description">Get a destination associated with a URI.</p>
1882 <p class="code">
1883 <a href="#cups_dest_t">cups_dest_t</a> *cupsGetDestWithURI (<br>
1884 &#160;&#160;&#160;&#160;const char *name,<br>
1885 &#160;&#160;&#160;&#160;const char *uri<br>
1886 );</p>
1887 <h4 class="parameters">Parameters</h4>
1888 <dl>
1889 <dt>name</dt>
1890 <dd class="description">Desired printer name or <code>NULL</code></dd>
1891 <dt>uri</dt>
1892 <dd class="description">URI for the printer</dd>
1893 </dl>
1894 <h4 class="returnvalue">Return Value</h4>
1895 <p class="description">Destination or <code>NULL</code></p>
1896 <h4 class="discussion">Discussion</h4>
1897 <p class="discussion">&quot;name&quot; is the desired name for the printer. If <code>NULL</code>, a name will be
1898 created using the URI.<br>
1899 <br>
1900 &quot;uri&quot; is the &quot;ipp&quot; or &quot;ipps&quot; URI for the printer.
1901
1902 </p>
1903 <h3 class="function"><span class="info">&#160;2.2.4&#160;</span><a id="cupsGetIntegerOption">cupsGetIntegerOption</a></h3>
1904 <p class="description">Get an integer option value.</p>
1905 <p class="code">
1906 int cupsGetIntegerOption (<br>
1907 &#160;&#160;&#160;&#160;const char *name,<br>
1908 &#160;&#160;&#160;&#160;int num_options,<br>
1909 &#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br>
1910 );</p>
1911 <h4 class="parameters">Parameters</h4>
1912 <dl>
1913 <dt>name</dt>
1914 <dd class="description">Name of option</dd>
1915 <dt>num_options</dt>
1916 <dd class="description">Number of options</dd>
1917 <dt>options</dt>
1918 <dd class="description">Options</dd>
1919 </dl>
1920 <h4 class="returnvalue">Return Value</h4>
1921 <p class="description">Option value or <code>INT_MIN</code></p>
1922 <h4 class="discussion">Discussion</h4>
1923 <p class="discussion">INT_MIN is returned when the option does not exist, is not an integer, or
1924 exceeds the range of values for the &quot;int&quot; type.
1925
1926 </p>
1927 <h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetJobs2">cupsGetJobs2</a></h3>
1928 <p class="description">Get the jobs from the specified server.</p>
1929 <p class="code">
1930 int cupsGetJobs2 (<br>
1931 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1932 &#160;&#160;&#160;&#160;<a href="#cups_job_t">cups_job_t</a> **jobs,<br>
1933 &#160;&#160;&#160;&#160;const char *name,<br>
1934 &#160;&#160;&#160;&#160;int myjobs,<br>
1935 &#160;&#160;&#160;&#160;int whichjobs<br>
1936 );</p>
1937 <h4 class="parameters">Parameters</h4>
1938 <dl>
1939 <dt>http</dt>
1940 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1941 <dt>jobs</dt>
1942 <dd class="description">Job data</dd>
1943 <dt>name</dt>
1944 <dd class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</dd>
1945 <dt>myjobs</dt>
1946 <dd class="description">0 = all users, 1 = mine</dd>
1947 <dt>whichjobs</dt>
1948 <dd class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></dd>
1949 </dl>
1950 <h4 class="returnvalue">Return Value</h4>
1951 <p class="description">Number of jobs</p>
1952 <h4 class="discussion">Discussion</h4>
1953 <p class="discussion">A &quot;whichjobs&quot; value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless
1954 of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are
1955 pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns
1956 jobs that are stopped, canceled, aborted, or completed.
1957
1958 </p>
1959 <h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsGetNamedDest">cupsGetNamedDest</a></h3>
1960 <p class="description">Get options for the named destination.</p>
1961 <p class="code">
1962 <a href="#cups_dest_t">cups_dest_t</a> *cupsGetNamedDest (<br>
1963 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1964 &#160;&#160;&#160;&#160;const char *name,<br>
1965 &#160;&#160;&#160;&#160;const char *instance<br>
1966 );</p>
1967 <h4 class="parameters">Parameters</h4>
1968 <dl>
1969 <dt>http</dt>
1970 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1971 <dt>name</dt>
1972 <dd class="description">Destination name or <code>NULL</code> for the default destination</dd>
1973 <dt>instance</dt>
1974 <dd class="description">Instance name or <code>NULL</code></dd>
1975 </dl>
1976 <h4 class="returnvalue">Return Value</h4>
1977 <p class="description">Destination or <code>NULL</code></p>
1978 <h4 class="discussion">Discussion</h4>
1979 <p class="discussion">This function is optimized for retrieving a single destination and should
1980 be used instead of <a href="#cupsGetDests"><code>cupsGetDests</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> when you either
1981 know the name of the destination or want to print to the default destination.
1982 If <code>NULL</code> is returned, the destination does not exist or there is no
1983 default destination.<br>
1984 <br>
1985 If &quot;http&quot; is <code>CUPS_HTTP_DEFAULT</code>, the connection to the default print
1986 server will be used.<br>
1987 <br>
1988 If &quot;name&quot; is <code>NULL</code>, the default printer for the current user will be
1989 returned.<br>
1990 <br>
1991 The returned destination must be freed using <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> with a
1992 &quot;num_dests&quot; value of 1.
1993
1994 </p>
1995 <h3 class="function"><a id="cupsGetOption">cupsGetOption</a></h3>
1996 <p class="description">Get an option value.</p>
1997 <p class="code">
1998 const char *cupsGetOption (<br>
1999 &#160;&#160;&#160;&#160;const char *name,<br>
2000 &#160;&#160;&#160;&#160;int num_options,<br>
2001 &#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br>
2002 );</p>
2003 <h4 class="parameters">Parameters</h4>
2004 <dl>
2005 <dt>name</dt>
2006 <dd class="description">Name of option</dd>
2007 <dt>num_options</dt>
2008 <dd class="description">Number of options</dd>
2009 <dt>options</dt>
2010 <dd class="description">Options</dd>
2011 </dl>
2012 <h4 class="returnvalue">Return Value</h4>
2013 <p class="description">Option value or <code>NULL</code></p>
2014 <h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsGetPassword2">cupsGetPassword2</a></h3>
2015 <p class="description">Get a password from the user using the advanced
2016 password callback.</p>
2017 <p class="code">
2018 const char *cupsGetPassword2 (<br>
2019 &#160;&#160;&#160;&#160;const char *prompt,<br>
2020 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
2021 &#160;&#160;&#160;&#160;const char *method,<br>
2022 &#160;&#160;&#160;&#160;const char *resource<br>
2023 );</p>
2024 <h4 class="parameters">Parameters</h4>
2025 <dl>
2026 <dt>prompt</dt>
2027 <dd class="description">Prompt string</dd>
2028 <dt>http</dt>
2029 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
2030 <dt>method</dt>
2031 <dd class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</dd>
2032 <dt>resource</dt>
2033 <dd class="description">Resource path</dd>
2034 </dl>
2035 <h4 class="returnvalue">Return Value</h4>
2036 <p class="description">Password</p>
2037 <h4 class="discussion">Discussion</h4>
2038 <p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the
2039 user does not provide a password.<br>
2040 <br>
2041 Note: The current password callback function is tracked separately for each
2042 thread in a program. Multi-threaded programs that override the setting via
2043 the <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a> or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> functions need to
2044 do so in each thread for the same function to be used.
2045
2046 </p>
2047 <h3 class="function"><a id="cupsLangDefault">cupsLangDefault</a></h3>
2048 <p class="description">Return the default language.</p>
2049 <p class="code">
2050 <a href="#cups_lang_t">cups_lang_t</a> *cupsLangDefault (void);</p>
2051 <h4 class="returnvalue">Return Value</h4>
2052 <p class="description">Language data</p>
2053 <h3 class="function"><a id="cupsLangEncoding">cupsLangEncoding</a></h3>
2054 <p class="description">Return the character encoding (us-ascii, etc.)
2055 for the given language.</p>
2056 <p class="code">
2057 const char *cupsLangEncoding (<br>
2058 &#160;&#160;&#160;&#160;<a href="#cups_lang_t">cups_lang_t</a> *lang<br>
2059 );</p>
2060 <h4 class="parameters">Parameters</h4>
2061 <dl>
2062 <dt>lang</dt>
2063 <dd class="description">Language data</dd>
2064 </dl>
2065 <h4 class="returnvalue">Return Value</h4>
2066 <p class="description">Character encoding</p>
2067 <h3 class="function"><a id="cupsLangFlush">cupsLangFlush</a></h3>
2068 <p class="description">Language data</p>
2069 <p class="code">
2070 void cupsLangFlush (void);</p>
2071 <h4 class="returnvalue">Return Value</h4>
2072 <p class="description">Flush all language data out of the cache.</p>
2073 <h3 class="function"><a id="cupsLangFree">cupsLangFree</a></h3>
2074 <p class="description">Then free the language structure itself...</p>
2075 <p class="code">
2076 void cupsLangFree (<br>
2077 &#160;&#160;&#160;&#160;<a href="#cups_lang_t">cups_lang_t</a> *lang<br>
2078 );</p>
2079 <h4 class="parameters">Parameters</h4>
2080 <dl>
2081 <dt>lang</dt>
2082 <dd class="description">Language to free</dd>
2083 </dl>
2084 <h4 class="returnvalue">Return Value</h4>
2085 <p class="description">Free language data.</p>
2086 <p class="discussion">This does not actually free anything; use <a href="#cupsLangFlush"><code>cupsLangFlush</code></a> for that.</p>
2087 <h3 class="function"><a id="cupsLangGet">cupsLangGet</a></h3>
2088 <p class="description">Get a language.</p>
2089 <p class="code">
2090 <a href="#cups_lang_t">cups_lang_t</a> *cupsLangGet (<br>
2091 &#160;&#160;&#160;&#160;const char *language<br>
2092 );</p>
2093 <h4 class="parameters">Parameters</h4>
2094 <dl>
2095 <dt>language</dt>
2096 <dd class="description">Language or locale</dd>
2097 </dl>
2098 <h4 class="returnvalue">Return Value</h4>
2099 <p class="description">Language data</p>
2100 <h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></h3>
2101 <p class="description">Get the localized string for a destination media
2102 size.</p>
2103 <p class="code">
2104 const char *cupsLocalizeDestMedia (<br>
2105 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
2106 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
2107 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
2108 &#160;&#160;&#160;&#160;unsigned flags,<br>
2109 &#160;&#160;&#160;&#160;<a href="#cups_size_t">cups_size_t</a> *size<br>
2110 );</p>
2111 <h4 class="parameters">Parameters</h4>
2112 <dl>
2113 <dt>http</dt>
2114 <dd class="description">Connection to destination</dd>
2115 <dt>dest</dt>
2116 <dd class="description">Destination</dd>
2117 <dt>dinfo</dt>
2118 <dd class="description">Destination information</dd>
2119 <dt>flags</dt>
2120 <dd class="description">Media flags</dd>
2121 <dt>size</dt>
2122 <dd class="description">Media size</dd>
2123 </dl>
2124 <h4 class="returnvalue">Return Value</h4>
2125 <p class="description">Localized string</p>
2126 <h4 class="discussion">Discussion</h4>
2127 <p class="discussion">The returned string is stored in the destination information and will become
2128 invalid if the destination information is deleted.
2129
2130 </p>
2131 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsLocalizeDestOption">cupsLocalizeDestOption</a></h3>
2132 <p class="description">Get the localized string for a destination
2133 option.</p>
2134 <p class="code">
2135 const char *cupsLocalizeDestOption (<br>
2136 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
2137 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
2138 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
2139 &#160;&#160;&#160;&#160;const char *option<br>
2140 );</p>
2141 <h4 class="parameters">Parameters</h4>
2142 <dl>
2143 <dt>http</dt>
2144 <dd class="description">Connection to destination</dd>
2145 <dt>dest</dt>
2146 <dd class="description">Destination</dd>
2147 <dt>dinfo</dt>
2148 <dd class="description">Destination information</dd>
2149 <dt>option</dt>
2150 <dd class="description">Option to localize</dd>
2151 </dl>
2152 <h4 class="returnvalue">Return Value</h4>
2153 <p class="description">Localized string</p>
2154 <h4 class="discussion">Discussion</h4>
2155 <p class="discussion">The returned string is stored in the destination information and will become
2156 invalid if the destination information is deleted.
2157
2158 </p>
2159 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsLocalizeDestValue">cupsLocalizeDestValue</a></h3>
2160 <p class="description">Get the localized string for a destination
2161 option+value pair.</p>
2162 <p class="code">
2163 const char *cupsLocalizeDestValue (<br>
2164 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
2165 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
2166 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
2167 &#160;&#160;&#160;&#160;const char *option,<br>
2168 &#160;&#160;&#160;&#160;const char *value<br>
2169 );</p>
2170 <h4 class="parameters">Parameters</h4>
2171 <dl>
2172 <dt>http</dt>
2173 <dd class="description">Connection to destination</dd>
2174 <dt>dest</dt>
2175 <dd class="description">Destination</dd>
2176 <dt>dinfo</dt>
2177 <dd class="description">Destination information</dd>
2178 <dt>option</dt>
2179 <dd class="description">Option to localize</dd>
2180 <dt>value</dt>
2181 <dd class="description">Value to localize</dd>
2182 </dl>
2183 <h4 class="returnvalue">Return Value</h4>
2184 <p class="description">Localized string</p>
2185 <h4 class="discussion">Discussion</h4>
2186 <p class="discussion">The returned string is stored in the destination information and will become
2187 invalid if the destination information is deleted.
2188
2189 </p>
2190 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="cupsMakeServerCredentials">cupsMakeServerCredentials</a></h3>
2191 <p class="description">Make a self-signed certificate and private key pair.</p>
2192 <p class="code">
2193 int cupsMakeServerCredentials (<br>
2194 &#160;&#160;&#160;&#160;const char *path,<br>
2195 &#160;&#160;&#160;&#160;const char *common_name,<br>
2196 &#160;&#160;&#160;&#160;int num_alt_names,<br>
2197 &#160;&#160;&#160;&#160;const char **alt_names,<br>
2198 &#160;&#160;&#160;&#160;time_t expiration_date<br>
2199 );</p>
2200 <h4 class="parameters">Parameters</h4>
2201 <dl>
2202 <dt>path</dt>
2203 <dd class="description">Keychain path or <code>NULL</code> for default</dd>
2204 <dt>common_name</dt>
2205 <dd class="description">Common name</dd>
2206 <dt>num_alt_names</dt>
2207 <dd class="description">Number of subject alternate names</dd>
2208 <dt>alt_names</dt>
2209 <dd class="description">Subject Alternate Names</dd>
2210 <dt>expiration_date</dt>
2211 <dd class="description">Expiration date</dd>
2212 </dl>
2213 <h4 class="returnvalue">Return Value</h4>
2214 <p class="description">1 on success, 0 on failure</p>
2215 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsNotifySubject">cupsNotifySubject</a></h3>
2216 <p class="description">Return the subject for the given notification message.</p>
2217 <p class="code">
2218 char *cupsNotifySubject (<br>
2219 &#160;&#160;&#160;&#160;<a href="#cups_lang_t">cups_lang_t</a> *lang,<br>
2220 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *event<br>
2221 );</p>
2222 <h4 class="parameters">Parameters</h4>
2223 <dl>
2224 <dt>lang</dt>
2225 <dd class="description">Language data</dd>
2226 <dt>event</dt>
2227 <dd class="description">Event data</dd>
2228 </dl>
2229 <h4 class="returnvalue">Return Value</h4>
2230 <p class="description">Subject string or <code>NULL</code></p>
2231 <h4 class="discussion">Discussion</h4>
2232 <p class="discussion">The returned string must be freed by the caller using <code>free</code>.
2233
2234 </p>
2235 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsNotifyText">cupsNotifyText</a></h3>
2236 <p class="description">Return the text for the given notification message.</p>
2237 <p class="code">
2238 char *cupsNotifyText (<br>
2239 &#160;&#160;&#160;&#160;<a href="#cups_lang_t">cups_lang_t</a> *lang,<br>
2240 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *event<br>
2241 );</p>
2242 <h4 class="parameters">Parameters</h4>
2243 <dl>
2244 <dt>lang</dt>
2245 <dd class="description">Language data</dd>
2246 <dt>event</dt>
2247 <dd class="description">Event data</dd>
2248 </dl>
2249 <h4 class="returnvalue">Return Value</h4>
2250 <p class="description">Message text or <code>NULL</code></p>
2251 <h4 class="discussion">Discussion</h4>
2252 <p class="discussion">The returned string must be freed by the caller using <code>free</code>.
2253
2254 </p>
2255 <h3 class="function"><a id="cupsParseOptions">cupsParseOptions</a></h3>
2256 <p class="description">Parse options from a command-line argument.</p>
2257 <p class="code">
2258 int cupsParseOptions (<br>
2259 &#160;&#160;&#160;&#160;const char *arg,<br>
2260 &#160;&#160;&#160;&#160;int num_options,<br>
2261 &#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **options<br>
2262 );</p>
2263 <h4 class="parameters">Parameters</h4>
2264 <dl>
2265 <dt>arg</dt>
2266 <dd class="description">Argument to parse</dd>
2267 <dt>num_options</dt>
2268 <dd class="description">Number of options</dd>
2269 <dt>options</dt>
2270 <dd class="description">Options found</dd>
2271 </dl>
2272 <h4 class="returnvalue">Return Value</h4>
2273 <p class="description">Number of options found</p>
2274 <h4 class="discussion">Discussion</h4>
2275 <p class="discussion">This function converts space-delimited name/value pairs according
2276 to the PAPI text option ABNF specification. Collection values
2277 (&quot;name={a=... b=... c=...}&quot;) are stored with the curley brackets
2278 intact - use <code>cupsParseOptions</code> on the value to extract the
2279 collection attributes.</p>
2280 <h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsRemoveDest">cupsRemoveDest</a></h3>
2281 <p class="description">Remove a destination from the destination list.</p>
2282 <p class="code">
2283 int cupsRemoveDest (<br>
2284 &#160;&#160;&#160;&#160;const char *name,<br>
2285 &#160;&#160;&#160;&#160;const char *instance,<br>
2286 &#160;&#160;&#160;&#160;int num_dests,<br>
2287 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> **dests<br>
2288 );</p>
2289 <h4 class="parameters">Parameters</h4>
2290 <dl>
2291 <dt>name</dt>
2292 <dd class="description">Destination name</dd>
2293 <dt>instance</dt>
2294 <dd class="description">Instance name or <code>NULL</code></dd>
2295 <dt>num_dests</dt>
2296 <dd class="description">Number of destinations</dd>
2297 <dt>dests</dt>
2298 <dd class="description">Destinations</dd>
2299 </dl>
2300 <h4 class="returnvalue">Return Value</h4>
2301 <p class="description">New number of destinations</p>
2302 <h4 class="discussion">Discussion</h4>
2303 <p class="discussion">Removing a destination/instance does not delete the class or printer
2304 queue, merely the lpoptions for that destination/instance. Use the
2305 <a href="#cupsSetDests"><code>cupsSetDests</code></a> or <a href="#cupsSetDests2"><code>cupsSetDests2</code></a> functions to save the new
2306 options for the user.
2307
2308 </p>
2309 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsRemoveOption">cupsRemoveOption</a></h3>
2310 <p class="description">Remove an option from an option array.</p>
2311 <p class="code">
2312 int cupsRemoveOption (<br>
2313 &#160;&#160;&#160;&#160;const char *name,<br>
2314 &#160;&#160;&#160;&#160;int num_options,<br>
2315 &#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **options<br>
2316 );</p>
2317 <h4 class="parameters">Parameters</h4>
2318 <dl>
2319 <dt>name</dt>
2320 <dd class="description">Option name</dd>
2321 <dt>num_options</dt>
2322 <dd class="description">Current number of options</dd>
2323 <dt>options</dt>
2324 <dd class="description">Options</dd>
2325 </dl>
2326 <h4 class="returnvalue">Return Value</h4>
2327 <p class="description">New number of options</p>
2328 <h3 class="function"><a id="cupsServer">cupsServer</a></h3>
2329 <p class="description">Return the hostname/address of the current server.</p>
2330 <p class="code">
2331 const char *cupsServer (void);</p>
2332 <h4 class="returnvalue">Return Value</h4>
2333 <p class="description">Server name</p>
2334 <h4 class="discussion">Discussion</h4>
2335 <p class="discussion">The default server comes from the CUPS_SERVER environment variable, then the
2336 ~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not
2337 set, the default is the local system - either &quot;localhost&quot; or a domain socket
2338 path.<br>
2339 <br>
2340 The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6
2341 address, or a domain socket pathname.<br>
2342 <br>
2343 Note: The current server is tracked separately for each thread in a program.
2344 Multi-threaded programs that override the server via the
2345 <a href="#cupsSetServer"><code>cupsSetServer</code></a> function need to do so in each thread for the same
2346 server to be used.</p>
2347 <h3 class="function"><a id="cupsSetClientCertCB">cupsSetClientCertCB</a></h3>
2348 <p class="description">Pointer to library globals</p>
2349 <p class="code">
2350 void cupsSetClientCertCB (<br>
2351 &#160;&#160;&#160;&#160;<a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a> cb,<br>
2352 &#160;&#160;&#160;&#160;void *user_data<br>
2353 );</p>
2354 <h4 class="parameters">Parameters</h4>
2355 <dl>
2356 <dt>cb</dt>
2357 <dd class="description">Callback function</dd>
2358 <dt>user_data</dt>
2359 <dd class="description">User data pointer</dd>
2360 </dl>
2361 <h4 class="returnvalue">Return Value</h4>
2362 <p class="description">Set the client certificate callback.</p>
2363 <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
2364 <br>
2365 Note: The current certificate callback is tracked separately for each thread
2366 in a program. Multi-threaded programs that override the callback need to do
2367 so in each thread for the same callback to be used.
2368
2369 </p>
2370 <h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetCredentials">cupsSetCredentials</a></h3>
2371 <p class="description">Set the default credentials to be used for SSL/TLS
2372 connections.</p>
2373 <p class="code">
2374 int cupsSetCredentials (<br>
2375 &#160;&#160;&#160;&#160;cups_array_t *credentials<br>
2376 );</p>
2377 <h4 class="parameters">Parameters</h4>
2378 <dl>
2379 <dt>credentials</dt>
2380 <dd class="description">Array of credentials</dd>
2381 </dl>
2382 <h4 class="returnvalue">Return Value</h4>
2383 <p class="description">Status of call (0 = success)</p>
2384 <h4 class="discussion">Discussion</h4>
2385 <p class="discussion">Note: The default credentials are tracked separately for each thread in a
2386 program. Multi-threaded programs that override the setting need to do so in
2387 each thread for the same setting to be used.
2388
2389 </p>
2390 <h3 class="function"><a id="cupsSetDefaultDest">cupsSetDefaultDest</a></h3>
2391 <p class="description">Remove the destination from the array...</p>
2392 <p class="code">
2393 void cupsSetDefaultDest (<br>
2394 &#160;&#160;&#160;&#160;const char *name,<br>
2395 &#160;&#160;&#160;&#160;const char *instance,<br>
2396 &#160;&#160;&#160;&#160;int num_dests,<br>
2397 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dests<br>
2398 );</p>
2399 <h4 class="parameters">Parameters</h4>
2400 <dl>
2401 <dt>name</dt>
2402 <dd class="description">Destination name</dd>
2403 <dt>instance</dt>
2404 <dd class="description">Instance name or <code>NULL</code></dd>
2405 <dt>num_dests</dt>
2406 <dd class="description">Number of destinations</dd>
2407 <dt>dests</dt>
2408 <dd class="description">Destinations</dd>
2409 </dl>
2410 <h4 class="returnvalue">Return Value</h4>
2411 <p class="description">Set the default destination.</p>
2412 <p class="discussion"></p>
2413 <h3 class="function"><a id="cupsSetDests">cupsSetDests</a></h3>
2414 <p class="description">Loop through the array and set the &quot;is_default&quot; flag for the matching
2415 destination...</p>
2416 <p class="code">
2417 void cupsSetDests (<br>
2418 &#160;&#160;&#160;&#160;int num_dests,<br>
2419 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dests<br>
2420 );</p>
2421 <h4 class="parameters">Parameters</h4>
2422 <dl>
2423 <dt>num_dests</dt>
2424 <dd class="description">Number of destinations</dd>
2425 <dt>dests</dt>
2426 <dd class="description">Destinations</dd>
2427 </dl>
2428 <h4 class="returnvalue">Return Value</h4>
2429 <p class="description">Save the list of destinations for the default server.</p>
2430 <p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run
2431 as root and ~/.cups/lpoptions when run as a normal user.</p>
2432 <h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsSetDests2">cupsSetDests2</a></h3>
2433 <p class="description">Save the list of destinations for the specified server.</p>
2434 <p class="code">
2435 int cupsSetDests2 (<br>
2436 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
2437 &#160;&#160;&#160;&#160;int num_dests,<br>
2438 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dests<br>
2439 );</p>
2440 <h4 class="parameters">Parameters</h4>
2441 <dl>
2442 <dt>http</dt>
2443 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
2444 <dt>num_dests</dt>
2445 <dd class="description">Number of destinations</dd>
2446 <dt>dests</dt>
2447 <dd class="description">Destinations</dd>
2448 </dl>
2449 <h4 class="returnvalue">Return Value</h4>
2450 <p class="description">0 on success, -1 on error</p>
2451 <h4 class="discussion">Discussion</h4>
2452 <p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run
2453 as root and ~/.cups/lpoptions when run as a normal user.
2454
2455 </p>
2456 <h3 class="function"><a id="cupsSetEncryption">cupsSetEncryption</a></h3>
2457 <p class="description">Pointer to library globals</p>
2458 <p class="code">
2459 void cupsSetEncryption (<br>
2460 &#160;&#160;&#160;&#160;<a href="#http_encryption_t">http_encryption_t</a> e<br>
2461 );</p>
2462 <h4 class="parameters">Parameters</h4>
2463 <dl>
2464 <dt>e</dt>
2465 <dd class="description">New encryption preference</dd>
2466 </dl>
2467 <h4 class="returnvalue">Return Value</h4>
2468 <p class="description">Set the encryption preference.</p>
2469 <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
2470 environment variable, then the ~/.cups/client.conf file, and finally the
2471 /etc/cups/client.conf file. If not set, the default is
2472 <code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
2473 <br>
2474 Note: The current encryption setting is tracked separately for each thread
2475 in a program. Multi-threaded programs that override the setting need to do
2476 so in each thread for the same setting to be used.</p>
2477 <h3 class="function"><a id="cupsSetPasswordCB">cupsSetPasswordCB</a></h3>
2478 <p class="description">Pointer to library globals</p>
2479 <p class="code">
2480 void cupsSetPasswordCB (<br>
2481 &#160;&#160;&#160;&#160;<a href="#cups_password_cb_t">cups_password_cb_t</a> cb<br>
2482 );</p>
2483 <h4 class="parameters">Parameters</h4>
2484 <dl>
2485 <dt>cb</dt>
2486 <dd class="description">Callback function</dd>
2487 </dl>
2488 <h4 class="returnvalue">Return Value</h4>
2489 <p class="description">Set the password callback for CUPS.</p>
2490 <p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which
2491 reads the password from the console. Programs should call either this
2492 function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered
2493 by a program per thread.<br>
2494 <br>
2495 Note: The current password callback is tracked separately for each thread
2496 in a program. Multi-threaded programs that override the callback need to do
2497 so in each thread for the same callback to be used.
2498
2499 </p>
2500 <h3 class="function"><a id="cupsSetPasswordCB2">cupsSetPasswordCB2</a></h3>
2501 <p class="description">Pointer to library globals</p>
2502 <p class="code">
2503 void cupsSetPasswordCB2 (<br>
2504 &#160;&#160;&#160;&#160;<a href="#cups_password_cb2_t">cups_password_cb2_t</a> cb,<br>
2505 &#160;&#160;&#160;&#160;void *user_data<br>
2506 );</p>
2507 <h4 class="parameters">Parameters</h4>
2508 <dl>
2509 <dt>cb</dt>
2510 <dd class="description">Callback function</dd>
2511 <dt>user_data</dt>
2512 <dd class="description">User data pointer</dd>
2513 </dl>
2514 <h4 class="returnvalue">Return Value</h4>
2515 <p class="description">Set the advanced password callback for CUPS.</p>
2516 <p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which
2517 reads the password from the console. Programs should call either this
2518 function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered
2519 by a program per thread.<br>
2520 <br>
2521 Note: The current password callback is tracked separately for each thread
2522 in a program. Multi-threaded programs that override the callback need to do
2523 so in each thread for the same callback to be used.
2524
2525 </p>
2526 <h3 class="function"><a id="cupsSetServer">cupsSetServer</a></h3>
2527 <p class="description">Pointer to library globals</p>
2528 <p class="code">
2529 void cupsSetServer (<br>
2530 &#160;&#160;&#160;&#160;const char *server<br>
2531 );</p>
2532 <h4 class="parameters">Parameters</h4>
2533 <dl>
2534 <dt>server</dt>
2535 <dd class="description">Server name</dd>
2536 </dl>
2537 <h4 class="returnvalue">Return Value</h4>
2538 <p class="description">Set the default server name and port.</p>
2539 <p class="discussion">The &quot;server&quot; string can be a fully-qualified hostname, a numeric
2540 IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP
2541 addresses can be optionally followed by a colon and port number to override
2542 the default port 631, e.g. &quot;hostname:8631&quot;. Pass <code>NULL</code> to restore the
2543 default server name and port.<br>
2544 <br>
2545 Note: The current server is tracked separately for each thread in a program.
2546 Multi-threaded programs that override the server need to do so in each
2547 thread for the same server to be used.</p>
2548 <h3 class="function"><a id="cupsSetServerCertCB">cupsSetServerCertCB</a></h3>
2549 <p class="description">Pointer to library globals</p>
2550 <p class="code">
2551 void cupsSetServerCertCB (<br>
2552 &#160;&#160;&#160;&#160;<a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a> cb,<br>
2553 &#160;&#160;&#160;&#160;void *user_data<br>
2554 );</p>
2555 <h4 class="parameters">Parameters</h4>
2556 <dl>
2557 <dt>cb</dt>
2558 <dd class="description">Callback function</dd>
2559 <dt>user_data</dt>
2560 <dd class="description">User data pointer</dd>
2561 </dl>
2562 <h4 class="returnvalue">Return Value</h4>
2563 <p class="description">Set the server certificate callback.</p>
2564 <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
2565 <br>
2566 Note: The current credentials callback is tracked separately for each thread
2567 in a program. Multi-threaded programs that override the callback need to do
2568 so in each thread for the same callback to be used.
2569
2570 </p>
2571 <h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsSetServerCredentials">cupsSetServerCredentials</a></h3>
2572 <p class="description">Set the default server credentials.</p>
2573 <p class="code">
2574 int cupsSetServerCredentials (<br>
2575 &#160;&#160;&#160;&#160;const char *path,<br>
2576 &#160;&#160;&#160;&#160;const char *common_name,<br>
2577 &#160;&#160;&#160;&#160;int auto_create<br>
2578 );</p>
2579 <h4 class="parameters">Parameters</h4>
2580 <dl>
2581 <dt>path</dt>
2582 <dd class="description">Keychain path or <code>NULL</code> for default</dd>
2583 <dt>common_name</dt>
2584 <dd class="description">Default common name for server</dd>
2585 <dt>auto_create</dt>
2586 <dd class="description">1 = automatically create self-signed certificates</dd>
2587 </dl>
2588 <h4 class="returnvalue">Return Value</h4>
2589 <p class="description">1 on success, 0 on failure</p>
2590 <h4 class="discussion">Discussion</h4>
2591 <p class="discussion">Note: The server credentials are used by all threads in the running process.
2592 This function is threadsafe.
2593
2594 </p>
2595 <h3 class="function"><a id="cupsSetUser">cupsSetUser</a></h3>
2596 <p class="description">Pointer to library globals</p>
2597 <p class="code">
2598 void cupsSetUser (<br>
2599 &#160;&#160;&#160;&#160;const char *user<br>
2600 );</p>
2601 <h4 class="parameters">Parameters</h4>
2602 <dl>
2603 <dt>user</dt>
2604 <dd class="description">User name</dd>
2605 </dl>
2606 <h4 class="returnvalue">Return Value</h4>
2607 <p class="description">Set the default user name.</p>
2608 <p class="discussion">Pass <code>NULL</code> to restore the default user name.<br>
2609 <br>
2610 Note: The current user name is tracked separately for each thread in a
2611 program. Multi-threaded programs that override the user name need to do so
2612 in each thread for the same user name to be used.</p>
2613 <h3 class="function"><a id="cupsSetUserAgent">cupsSetUserAgent</a></h3>
2614 <p class="description">Pointer to library globals</p>
2615 <p class="code">
2616 void cupsSetUserAgent (<br>
2617 &#160;&#160;&#160;&#160;const char *user_agent<br>
2618 );</p>
2619 <h4 class="parameters">Parameters</h4>
2620 <dl>
2621 <dt>user_agent</dt>
2622 <dd class="description">User-Agent string or <code>NULL</code></dd>
2623 </dl>
2624 <h4 class="returnvalue">Return Value</h4>
2625 <p class="description">Set the default HTTP User-Agent string.</p>
2626 <p class="discussion">Setting the string to NULL forces the default value containing the CUPS
2627 version, IPP version, and operating system version and architecture.
2628
2629 </p>
2630 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsStartDestDocument">cupsStartDestDocument</a></h3>
2631 <p class="description">Start a new document.</p>
2632 <p class="code">
2633 http_status_t cupsStartDestDocument (<br>
2634 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
2635 &#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
2636 &#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *info,<br>
2637 &#160;&#160;&#160;&#160;int job_id,<br>
2638 &#160;&#160;&#160;&#160;const char *docname,<br>
2639 &#160;&#160;&#160;&#160;const char *format,<br>
2640 &#160;&#160;&#160;&#160;int num_options,<br>
2641 &#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options,<br>
2642 &#160;&#160;&#160;&#160;int last_document<br>
2643 );</p>
2644 <h4 class="parameters">Parameters</h4>
2645 <dl>
2646 <dt>http</dt>
2647 <dd class="description">Connection to destination</dd>
2648 <dt>dest</dt>
2649 <dd class="description">Destination</dd>
2650 <dt>info</dt>
2651 <dd class="description">Destination information</dd>
2652 <dt>job_id</dt>
2653 <dd class="description">Job ID</dd>
2654 <dt>docname</dt>
2655 <dd class="description">Document name</dd>
2656 <dt>format</dt>
2657 <dd class="description">Document format</dd>
2658 <dt>num_options</dt>
2659 <dd class="description">Number of document options</dd>
2660 <dt>options</dt>
2661 <dd class="description">Document options</dd>
2662 <dt>last_document</dt>
2663 <dd class="description">1 if this is the last document</dd>
2664 </dl>
2665 <h4 class="returnvalue">Return Value</h4>
2666 <p class="description">Status of document creation</p>
2667 <h4 class="discussion">Discussion</h4>
2668 <p class="discussion">&quot;job_id&quot; is the job ID returned by cupsCreateDestJob. &quot;docname&quot; is the name
2669 of the document/file being printed, &quot;format&quot; is the MIME media type for the
2670 document (see CUPS_FORMAT_xxx constants), and &quot;num_options&quot; and &quot;options&quot;
2671 are the options do be applied to the document. &quot;last_document&quot; should be 1
2672 if this is the last document to be submitted in the job. Returns
2673 <code>HTTP_CONTINUE</code> on success.
2674
2675 </p>
2676 <h3 class="function"><a id="cupsUser">cupsUser</a></h3>
2677 <p class="description">Return the current user's name.</p>
2678 <p class="code">
2679 const char *cupsUser (void);</p>
2680 <h4 class="returnvalue">Return Value</h4>
2681 <p class="description">User name</p>
2682 <h4 class="discussion">Discussion</h4>
2683 <p class="discussion">Note: The current user name is tracked separately for each thread in a
2684 program. Multi-threaded programs that override the user name with the
2685 <a href="#cupsSetUser"><code>cupsSetUser</code></a> function need to do so in each thread for the same user
2686 name to be used.</p>
2687 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsUserAgent">cupsUserAgent</a></h3>
2688 <p class="description">Return the default HTTP User-Agent string.</p>
2689 <p class="code">
2690 const char *cupsUserAgent (void);</p>
2691 <h4 class="returnvalue">Return Value</h4>
2692 <p class="description">User-Agent string</p>
2693 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAcceptConnection">httpAcceptConnection</a></h3>
2694 <p class="description">Accept a new HTTP client connection from the
2695 specified listening socket.</p>
2696 <p class="code">
2697 <a href="#http_t">http_t</a> *httpAcceptConnection (<br>
2698 &#160;&#160;&#160;&#160;int fd,<br>
2699 &#160;&#160;&#160;&#160;int blocking<br>
2700 );</p>
2701 <h4 class="parameters">Parameters</h4>
2702 <dl>
2703 <dt>fd</dt>
2704 <dd class="description">Listen socket file descriptor</dd>
2705 <dt>blocking</dt>
2706 <dd class="description">1 if the connection should be
2707 blocking, 0 otherwise</dd>
2708 </dl>
2709 <h4 class="returnvalue">Return Value</h4>
2710 <p class="description">HTTP connection or <code>NULL</code></p>
2711 <h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpAddCredential">httpAddCredential</a></h3>
2712 <p class="description">Allocates and adds a single credential to an array.</p>
2713 <p class="code">
2714 int httpAddCredential (<br>
2715 &#160;&#160;&#160;&#160;cups_array_t *credentials,<br>
2716 &#160;&#160;&#160;&#160;const void *data,<br>
2717 &#160;&#160;&#160;&#160;size_t datalen<br>
2718 );</p>
2719 <h4 class="parameters">Parameters</h4>
2720 <dl>
2721 <dt>credentials</dt>
2722 <dd class="description">Credentials array</dd>
2723 <dt>data</dt>
2724 <dd class="description">PEM-encoded X.509 data</dd>
2725 <dt>datalen</dt>
2726 <dd class="description">Length of data</dd>
2727 </dl>
2728 <h4 class="returnvalue">Return Value</h4>
2729 <p class="description">0 on success, -1 on error</p>
2730 <h4 class="discussion">Discussion</h4>
2731 <p class="discussion">Use <code>cupsArrayNew(NULL, NULL)</code> to create a credentials array.
2732
2733 </p>
2734 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrAny">httpAddrAny</a></h3>
2735 <p class="description">Check for the &quot;any&quot; address.</p>
2736 <p class="code">
2737 int httpAddrAny (<br>
2738 &#160;&#160;&#160;&#160;const <a href="#http_addr_t">http_addr_t</a> *addr<br>
2739 );</p>
2740 <h4 class="parameters">Parameters</h4>
2741 <dl>
2742 <dt>addr</dt>
2743 <dd class="description">Address to check</dd>
2744 </dl>
2745 <h4 class="returnvalue">Return Value</h4>
2746 <p class="description">1 if &quot;any&quot;, 0 otherwise</p>
2747 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpAddrClose">httpAddrClose</a></h3>
2748 <p class="description">Close a socket created by <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> or
2749 <a href="#httpAddrListen"><code>httpAddrListen</code></a>.</p>
2750 <p class="code">
2751 int httpAddrClose (<br>
2752 &#160;&#160;&#160;&#160;<a href="#http_addr_t">http_addr_t</a> *addr,<br>
2753 &#160;&#160;&#160;&#160;int fd<br>
2754 );</p>
2755 <h4 class="parameters">Parameters</h4>
2756 <dl>
2757 <dt>addr</dt>
2758 <dd class="description">Listen address or <code>NULL</code></dd>
2759 <dt>fd</dt>
2760 <dd class="description">Socket file descriptor</dd>
2761 </dl>
2762 <h4 class="returnvalue">Return Value</h4>
2763 <p class="description">0 on success, -1 on failure</p>
2764 <h4 class="discussion">Discussion</h4>
2765 <p class="discussion">Pass <code>NULL</code> for sockets created with <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> and the
2766 listen address for sockets created with <a href="#httpAddrListen"><code>httpAddrListen</code></a>. This will
2767 ensure that domain sockets are removed when closed.
2768
2769 </p>
2770 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrConnect2">httpAddrConnect2</a></h3>
2771 <p class="description">Connect to any of the addresses in the list with a
2772 timeout and optional cancel.</p>
2773 <p class="code">
2774 <a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrConnect2 (<br>
2775 &#160;&#160;&#160;&#160;<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist,<br>
2776 &#160;&#160;&#160;&#160;int *sock,<br>
2777 &#160;&#160;&#160;&#160;int msec,<br>
2778 &#160;&#160;&#160;&#160;int *cancel<br>
2779 );</p>
2780 <h4 class="parameters">Parameters</h4>
2781 <dl>
2782 <dt>addrlist</dt>
2783 <dd class="description">List of potential addresses</dd>
2784 <dt>sock</dt>
2785 <dd class="description">Socket</dd>
2786 <dt>msec</dt>
2787 <dd class="description">Timeout in milliseconds</dd>
2788 <dt>cancel</dt>
2789 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
2790 </dl>
2791 <h4 class="returnvalue">Return Value</h4>
2792 <p class="description">Connected address or NULL on failure</p>
2793 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrCopyList">httpAddrCopyList</a></h3>
2794 <p class="description">Copy an address list.</p>
2795 <p class="code">
2796 <a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrCopyList (<br>
2797 &#160;&#160;&#160;&#160;<a href="#http_addrlist_t">http_addrlist_t</a> *src<br>
2798 );</p>
2799 <h4 class="parameters">Parameters</h4>
2800 <dl>
2801 <dt>src</dt>
2802 <dd class="description">Source address list</dd>
2803 </dl>
2804 <h4 class="returnvalue">Return Value</h4>
2805 <p class="description">New address list or <code>NULL</code> on error</p>
2806 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrEqual">httpAddrEqual</a></h3>
2807 <p class="description">Compare two addresses.</p>
2808 <p class="code">
2809 int httpAddrEqual (<br>
2810 &#160;&#160;&#160;&#160;const <a href="#http_addr_t">http_addr_t</a> *addr1,<br>
2811 &#160;&#160;&#160;&#160;const <a href="#http_addr_t">http_addr_t</a> *addr2<br>
2812 );</p>
2813 <h4 class="parameters">Parameters</h4>
2814 <dl>
2815 <dt>addr1</dt>
2816 <dd class="description">First address</dd>
2817 <dt>addr2</dt>
2818 <dd class="description">Second address</dd>
2819 </dl>
2820 <h4 class="returnvalue">Return Value</h4>
2821 <p class="description">1 if equal, 0 if not</p>
2822 <h3 class="function"><a id="httpAddrFamily">httpAddrFamily</a></h3>
2823 <p class="description">Get the address family of an address.</p>
2824 <p class="code">
2825 int httpAddrFamily (<br>
2826 &#160;&#160;&#160;&#160;<a href="#http_addr_t">http_addr_t</a> *addr<br>
2827 );</p>
2828 <h4 class="parameters">Parameters</h4>
2829 <dl>
2830 <dt>addr</dt>
2831 <dd class="description">Address</dd>
2832 </dl>
2833 <h4 class="returnvalue">Return Value</h4>
2834 <p class="description">Address family</p>
2835 <h3 class="function"><a id="httpAddrFreeList">httpAddrFreeList</a></h3>
2836 <p class="description">Current list entry</p>
2837 <p class="code">
2838 void httpAddrFreeList (<br>
2839 &#160;&#160;&#160;&#160;<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist<br>
2840 );</p>
2841 <h4 class="parameters">Parameters</h4>
2842 <dl>
2843 <dt>addrlist</dt>
2844 <dd class="description">Address list to free</dd>
2845 </dl>
2846 <h4 class="returnvalue">Return Value</h4>
2847 <p class="description">Free an address list.</p>
2848 <p class="discussion"></p>
2849 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrGetList">httpAddrGetList</a></h3>
2850 <p class="description">Get a list of addresses for a hostname.</p>
2851 <p class="code">
2852 <a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrGetList (<br>
2853 &#160;&#160;&#160;&#160;const char *hostname,<br>
2854 &#160;&#160;&#160;&#160;int family,<br>
2855 &#160;&#160;&#160;&#160;const char *service<br>
2856 );</p>
2857 <h4 class="parameters">Parameters</h4>
2858 <dl>
2859 <dt>hostname</dt>
2860 <dd class="description">Hostname, IP address, or NULL for passive listen address</dd>
2861 <dt>family</dt>
2862 <dd class="description">Address family or AF_UNSPEC</dd>
2863 <dt>service</dt>
2864 <dd class="description">Service name or port number</dd>
2865 </dl>
2866 <h4 class="returnvalue">Return Value</h4>
2867 <p class="description">List of addresses or NULL</p>
2868 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLength">httpAddrLength</a></h3>
2869 <p class="description">Return the length of the address in bytes.</p>
2870 <p class="code">
2871 int httpAddrLength (<br>
2872 &#160;&#160;&#160;&#160;const <a href="#http_addr_t">http_addr_t</a> *addr<br>
2873 );</p>
2874 <h4 class="parameters">Parameters</h4>
2875 <dl>
2876 <dt>addr</dt>
2877 <dd class="description">Address</dd>
2878 </dl>
2879 <h4 class="returnvalue">Return Value</h4>
2880 <p class="description">Length in bytes</p>
2881 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrListen">httpAddrListen</a></h3>
2882 <p class="description">Create a listening socket bound to the specified
2883 address and port.</p>
2884 <p class="code">
2885 int httpAddrListen (<br>
2886 &#160;&#160;&#160;&#160;<a href="#http_addr_t">http_addr_t</a> *addr,<br>
2887 &#160;&#160;&#160;&#160;int port<br>
2888 );</p>
2889 <h4 class="parameters">Parameters</h4>
2890 <dl>
2891 <dt>addr</dt>
2892 <dd class="description">Address to bind to</dd>
2893 <dt>port</dt>
2894 <dd class="description">Port number to bind to</dd>
2895 </dl>
2896 <h4 class="returnvalue">Return Value</h4>
2897 <p class="description">Socket or -1 on error</p>
2898 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLocalhost">httpAddrLocalhost</a></h3>
2899 <p class="description">Check for the local loopback address.</p>
2900 <p class="code">
2901 int httpAddrLocalhost (<br>
2902 &#160;&#160;&#160;&#160;const <a href="#http_addr_t">http_addr_t</a> *addr<br>
2903 );</p>
2904 <h4 class="parameters">Parameters</h4>
2905 <dl>
2906 <dt>addr</dt>
2907 <dd class="description">Address to check</dd>
2908 </dl>
2909 <h4 class="returnvalue">Return Value</h4>
2910 <p class="description">1 if local host, 0 otherwise</p>
2911 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLookup">httpAddrLookup</a></h3>
2912 <p class="description">Lookup the hostname associated with the address.</p>
2913 <p class="code">
2914 char *httpAddrLookup (<br>
2915 &#160;&#160;&#160;&#160;const <a href="#http_addr_t">http_addr_t</a> *addr,<br>
2916 &#160;&#160;&#160;&#160;char *name,<br>
2917 &#160;&#160;&#160;&#160;int namelen<br>
2918 );</p>
2919 <h4 class="parameters">Parameters</h4>
2920 <dl>
2921 <dt>addr</dt>
2922 <dd class="description">Address to lookup</dd>
2923 <dt>name</dt>
2924 <dd class="description">Host name buffer</dd>
2925 <dt>namelen</dt>
2926 <dd class="description">Size of name buffer</dd>
2927 </dl>
2928 <h4 class="returnvalue">Return Value</h4>
2929 <p class="description">Host name</p>
2930 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrPort">httpAddrPort</a></h3>
2931 <p class="description">Get the port number associated with an address.</p>
2932 <p class="code">
2933 int httpAddrPort (<br>
2934 &#160;&#160;&#160;&#160;<a href="#http_addr_t">http_addr_t</a> *addr<br>
2935 );</p>
2936 <h4 class="parameters">Parameters</h4>
2937 <dl>
2938 <dt>addr</dt>
2939 <dd class="description">Address</dd>
2940 </dl>
2941 <h4 class="returnvalue">Return Value</h4>
2942 <p class="description">Port number</p>
2943 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrString">httpAddrString</a></h3>
2944 <p class="description">Convert an address to a numeric string.</p>
2945 <p class="code">
2946 char *httpAddrString (<br>
2947 &#160;&#160;&#160;&#160;const <a href="#http_addr_t">http_addr_t</a> *addr,<br>
2948 &#160;&#160;&#160;&#160;char *s,<br>
2949 &#160;&#160;&#160;&#160;int slen<br>
2950 );</p>
2951 <h4 class="parameters">Parameters</h4>
2952 <dl>
2953 <dt>addr</dt>
2954 <dd class="description">Address to convert</dd>
2955 <dt>s</dt>
2956 <dd class="description">String buffer</dd>
2957 <dt>slen</dt>
2958 <dd class="description">Length of string</dd>
2959 </dl>
2960 <h4 class="returnvalue">Return Value</h4>
2961 <p class="description">Numeric address string</p>
2962 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAssembleURI">httpAssembleURI</a></h3>
2963 <p class="description">Assemble a uniform resource identifier from its
2964 components.</p>
2965 <p class="code">
2966 <a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURI (<br>
2967 &#160;&#160;&#160;&#160;<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding,<br>
2968 &#160;&#160;&#160;&#160;char *uri,<br>
2969 &#160;&#160;&#160;&#160;int urilen,<br>
2970 &#160;&#160;&#160;&#160;const char *scheme,<br>
2971 &#160;&#160;&#160;&#160;const char *username,<br>
2972 &#160;&#160;&#160;&#160;const char *host,<br>
2973 &#160;&#160;&#160;&#160;int port,<br>
2974 &#160;&#160;&#160;&#160;const char *resource<br>
2975 );</p>
2976 <h4 class="parameters">Parameters</h4>
2977 <dl>
2978 <dt>encoding</dt>
2979 <dd class="description">Encoding flags</dd>
2980 <dt>uri</dt>
2981 <dd class="description">URI buffer</dd>
2982 <dt>urilen</dt>
2983 <dd class="description">Size of URI buffer</dd>
2984 <dt>scheme</dt>
2985 <dd class="description">Scheme name</dd>
2986 <dt>username</dt>
2987 <dd class="description">Username</dd>
2988 <dt>host</dt>
2989 <dd class="description">Hostname or address</dd>
2990 <dt>port</dt>
2991 <dd class="description">Port number</dd>
2992 <dt>resource</dt>
2993 <dd class="description">Resource</dd>
2994 </dl>
2995 <h4 class="returnvalue">Return Value</h4>
2996 <p class="description">URI status</p>
2997 <h4 class="discussion">Discussion</h4>
2998 <p class="discussion">This function escapes reserved characters in the URI depending on the
2999 value of the &quot;encoding&quot; argument. You should use this function in
3000 place of traditional string functions whenever you need to create a
3001 URI string.
3002
3003 </p>
3004 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAssembleURIf">httpAssembleURIf</a></h3>
3005 <p class="description">Assemble a uniform resource identifier from its
3006 components with a formatted resource.</p>
3007 <p class="code">
3008 <a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURIf (<br>
3009 &#160;&#160;&#160;&#160;<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding,<br>
3010 &#160;&#160;&#160;&#160;char *uri,<br>
3011 &#160;&#160;&#160;&#160;int urilen,<br>
3012 &#160;&#160;&#160;&#160;const char *scheme,<br>
3013 &#160;&#160;&#160;&#160;const char *username,<br>
3014 &#160;&#160;&#160;&#160;const char *host,<br>
3015 &#160;&#160;&#160;&#160;int port,<br>
3016 &#160;&#160;&#160;&#160;const char *resourcef,<br>
3017 &#160;&#160;&#160;&#160;...<br>
3018 );</p>
3019 <h4 class="parameters">Parameters</h4>
3020 <dl>
3021 <dt>encoding</dt>
3022 <dd class="description">Encoding flags</dd>
3023 <dt>uri</dt>
3024 <dd class="description">URI buffer</dd>
3025 <dt>urilen</dt>
3026 <dd class="description">Size of URI buffer</dd>
3027 <dt>scheme</dt>
3028 <dd class="description">Scheme name</dd>
3029 <dt>username</dt>
3030 <dd class="description">Username</dd>
3031 <dt>host</dt>
3032 <dd class="description">Hostname or address</dd>
3033 <dt>port</dt>
3034 <dd class="description">Port number</dd>
3035 <dt>resourcef</dt>
3036 <dd class="description">Printf-style resource</dd>
3037 <dt>...</dt>
3038 <dd class="description">Additional arguments as needed</dd>
3039 </dl>
3040 <h4 class="returnvalue">Return Value</h4>
3041 <p class="description">URI status</p>
3042 <h4 class="discussion">Discussion</h4>
3043 <p class="discussion">This function creates a formatted version of the resource string
3044 argument &quot;resourcef&quot; and escapes reserved characters in the URI
3045 depending on the value of the &quot;encoding&quot; argument. You should use
3046 this function in place of traditional string functions whenever
3047 you need to create a URI string.
3048
3049 </p>
3050 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAssembleUUID">httpAssembleUUID</a></h3>
3051 <p class="description">Assemble a name-based UUID URN conforming to RFC 4122.</p>
3052 <p class="code">
3053 char *httpAssembleUUID (<br>
3054 &#160;&#160;&#160;&#160;const char *server,<br>
3055 &#160;&#160;&#160;&#160;int port,<br>
3056 &#160;&#160;&#160;&#160;const char *name,<br>
3057 &#160;&#160;&#160;&#160;int number,<br>
3058 &#160;&#160;&#160;&#160;char *buffer,<br>
3059 &#160;&#160;&#160;&#160;size_t bufsize<br>
3060 );</p>
3061 <h4 class="parameters">Parameters</h4>
3062 <dl>
3063 <dt>server</dt>
3064 <dd class="description">Server name</dd>
3065 <dt>port</dt>
3066 <dd class="description">Port number</dd>
3067 <dt>name</dt>
3068 <dd class="description">Object name or NULL</dd>
3069 <dt>number</dt>
3070 <dd class="description">Object number or 0</dd>
3071 <dt>buffer</dt>
3072 <dd class="description">String buffer</dd>
3073 <dt>bufsize</dt>
3074 <dd class="description">Size of buffer</dd>
3075 </dl>
3076 <h4 class="returnvalue">Return Value</h4>
3077 <p class="description">UUID string</p>
3078 <h4 class="discussion">Discussion</h4>
3079 <p class="discussion">This function creates a unique 128-bit identifying number using the server
3080 name, port number, random data, and optionally an object name and/or object
3081 number. The result is formatted as a UUID URN as defined in RFC 4122.<br>
3082 <br>
3083 The buffer needs to be at least 46 bytes in size.
3084
3085 </p>
3086 <h3 class="function"><a id="httpBlocking">httpBlocking</a></h3>
3087 <p class="description">Credential data</p>
3088 <p class="code">
3089 void httpBlocking (<br>
3090 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3091 &#160;&#160;&#160;&#160;int b<br>
3092 );</p>
3093 <h4 class="parameters">Parameters</h4>
3094 <dl>
3095 <dt>http</dt>
3096 <dd class="description">HTTP connection</dd>
3097 <dt>b</dt>
3098 <dd class="description">1 = blocking, 0 = non-blocking</dd>
3099 </dl>
3100 <h4 class="returnvalue">Return Value</h4>
3101 <p class="description">Set blocking/non-blocking behavior on a connection.</p>
3102 <h3 class="function"><a id="httpCheck">httpCheck</a></h3>
3103 <p class="description">Check to see if there is a pending response from the server.</p>
3104 <p class="code">
3105 int httpCheck (<br>
3106 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3107 );</p>
3108 <h4 class="parameters">Parameters</h4>
3109 <dl>
3110 <dt>http</dt>
3111 <dd class="description">HTTP connection</dd>
3112 </dl>
3113 <h4 class="returnvalue">Return Value</h4>
3114 <p class="description">0 = no data, 1 = data available</p>
3115 <h3 class="function"><a id="httpClearCookie">httpClearCookie</a></h3>
3116 <p class="description">HTTP connection</p>
3117 <p class="code">
3118 void httpClearCookie (<br>
3119 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3120 );</p>
3121 <h4 class="parameters">Parameters</h4>
3122 <dl>
3123 <dt>http</dt>
3124 <dd class="description">HTTP connection</dd>
3125 </dl>
3126 <h4 class="returnvalue">Return Value</h4>
3127 <p class="description">Clear the cookie value(s).</p>
3128 <p class="discussion"></p>
3129 <h3 class="function"><a id="httpClearFields">httpClearFields</a></h3>
3130 <p class="description">HTTP connection</p>
3131 <p class="code">
3132 void httpClearFields (<br>
3133 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3134 );</p>
3135 <h4 class="parameters">Parameters</h4>
3136 <dl>
3137 <dt>http</dt>
3138 <dd class="description">HTTP connection</dd>
3139 </dl>
3140 <h4 class="returnvalue">Return Value</h4>
3141 <p class="description">Clear HTTP request fields.</p>
3142 <h3 class="function"><a id="httpClose">httpClose</a></h3>
3143 <p class="description">HTTP connection</p>
3144 <p class="code">
3145 void httpClose (<br>
3146 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3147 );</p>
3148 <h4 class="parameters">Parameters</h4>
3149 <dl>
3150 <dt>http</dt>
3151 <dd class="description">HTTP connection</dd>
3152 </dl>
3153 <h4 class="returnvalue">Return Value</h4>
3154 <p class="description">Close an HTTP connection.</p>
3155 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpCompareCredentials">httpCompareCredentials</a></h3>
3156 <p class="description">Compare two sets of X.509 credentials.</p>
3157 <p class="code">
3158 int httpCompareCredentials (<br>
3159 &#160;&#160;&#160;&#160;cups_array_t *cred1,<br>
3160 &#160;&#160;&#160;&#160;cups_array_t *cred2<br>
3161 );</p>
3162 <h4 class="parameters">Parameters</h4>
3163 <dl>
3164 <dt>cred1</dt>
3165 <dd class="description">First set of X.509 credentials</dd>
3166 <dt>cred2</dt>
3167 <dd class="description">Second set of X.509 credentials</dd>
3168 </dl>
3169 <h4 class="returnvalue">Return Value</h4>
3170 <p class="description">1 if they match, 0 if they do not</p>
3171 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpConnect2">httpConnect2</a></h3>
3172 <p class="description">Connect to a HTTP server.</p>
3173 <p class="code">
3174 <a href="#http_t">http_t</a> *httpConnect2 (<br>
3175 &#160;&#160;&#160;&#160;const char *host,<br>
3176 &#160;&#160;&#160;&#160;int port,<br>
3177 &#160;&#160;&#160;&#160;<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist,<br>
3178 &#160;&#160;&#160;&#160;int family,<br>
3179 &#160;&#160;&#160;&#160;<a href="#http_encryption_t">http_encryption_t</a> encryption,<br>
3180 &#160;&#160;&#160;&#160;int blocking,<br>
3181 &#160;&#160;&#160;&#160;int msec,<br>
3182 &#160;&#160;&#160;&#160;int *cancel<br>
3183 );</p>
3184 <h4 class="parameters">Parameters</h4>
3185 <dl>
3186 <dt>host</dt>
3187 <dd class="description">Host to connect to</dd>
3188 <dt>port</dt>
3189 <dd class="description">Port number</dd>
3190 <dt>addrlist</dt>
3191 <dd class="description">List of addresses or NULL to lookup</dd>
3192 <dt>family</dt>
3193 <dd class="description">Address family to use or <code>AF_UNSPEC</code> for any</dd>
3194 <dt>encryption</dt>
3195 <dd class="description">Type of encryption to use</dd>
3196 <dt>blocking</dt>
3197 <dd class="description">1 for blocking connection, 0 for non-blocking</dd>
3198 <dt>msec</dt>
3199 <dd class="description">Connection timeout in milliseconds, 0 means don't connect</dd>
3200 <dt>cancel</dt>
3201 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
3202 </dl>
3203 <h4 class="returnvalue">Return Value</h4>
3204 <p class="description">New HTTP connection</p>
3205 <h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpCopyCredentials">httpCopyCredentials</a></h3>
3206 <p class="description">Copy the credentials associated with the peer in
3207 an encrypted connection.</p>
3208 <p class="code">
3209 int httpCopyCredentials (<br>
3210 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3211 &#160;&#160;&#160;&#160;cups_array_t **credentials<br>
3212 );</p>
3213 <h4 class="parameters">Parameters</h4>
3214 <dl>
3215 <dt>http</dt>
3216 <dd class="description">Connection to server</dd>
3217 <dt>credentials</dt>
3218 <dd class="description">Array of credentials</dd>
3219 </dl>
3220 <h4 class="returnvalue">Return Value</h4>
3221 <p class="description">Status of call (0 = success)</p>
3222 <h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></h3>
3223 <p class="description">Return whether the credentials are valid for the given name.</p>
3224 <p class="code">
3225 int httpCredentialsAreValidForName (<br>
3226 &#160;&#160;&#160;&#160;cups_array_t *credentials,<br>
3227 &#160;&#160;&#160;&#160;const char *common_name<br>
3228 );</p>
3229 <h4 class="parameters">Parameters</h4>
3230 <dl>
3231 <dt>credentials</dt>
3232 <dd class="description">Credentials</dd>
3233 <dt>common_name</dt>
3234 <dd class="description">Name to check</dd>
3235 </dl>
3236 <h4 class="returnvalue">Return Value</h4>
3237 <p class="description">1 if valid, 0 otherwise</p>
3238 <h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></h3>
3239 <p class="description">Return the expiration date of the credentials.</p>
3240 <p class="code">
3241 time_t httpCredentialsGetExpiration (<br>
3242 &#160;&#160;&#160;&#160;cups_array_t *credentials<br>
3243 );</p>
3244 <h4 class="parameters">Parameters</h4>
3245 <dl>
3246 <dt>credentials</dt>
3247 <dd class="description">Credentials</dd>
3248 </dl>
3249 <h4 class="returnvalue">Return Value</h4>
3250 <p class="description">Expiration date of credentials</p>
3251 <h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsGetTrust">httpCredentialsGetTrust</a></h3>
3252 <p class="description">Return the trust of credentials.</p>
3253 <p class="code">
3254 <a href="#http_trust_t">http_trust_t</a> httpCredentialsGetTrust (<br>
3255 &#160;&#160;&#160;&#160;cups_array_t *credentials,<br>
3256 &#160;&#160;&#160;&#160;const char *common_name<br>
3257 );</p>
3258 <h4 class="parameters">Parameters</h4>
3259 <dl>
3260 <dt>credentials</dt>
3261 <dd class="description">Credentials</dd>
3262 <dt>common_name</dt>
3263 <dd class="description">Common name for trust lookup</dd>
3264 </dl>
3265 <h4 class="returnvalue">Return Value</h4>
3266 <p class="description">Level of trust</p>
3267 <h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsString">httpCredentialsString</a></h3>
3268 <p class="description">Return a string representing the credentials.</p>
3269 <p class="code">
3270 size_t httpCredentialsString (<br>
3271 &#160;&#160;&#160;&#160;cups_array_t *credentials,<br>
3272 &#160;&#160;&#160;&#160;char *buffer,<br>
3273 &#160;&#160;&#160;&#160;size_t bufsize<br>
3274 );</p>
3275 <h4 class="parameters">Parameters</h4>
3276 <dl>
3277 <dt>credentials</dt>
3278 <dd class="description">Credentials</dd>
3279 <dt>buffer</dt>
3280 <dd class="description">Buffer or <code>NULL</code></dd>
3281 <dt>bufsize</dt>
3282 <dd class="description">Size of buffer</dd>
3283 </dl>
3284 <h4 class="returnvalue">Return Value</h4>
3285 <p class="description">Total size of credentials string</p>
3286 <h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="httpDecode64_2">httpDecode64_2</a></h3>
3287 <p class="description">Base64-decode a string.</p>
3288 <p class="code">
3289 char *httpDecode64_2 (<br>
3290 &#160;&#160;&#160;&#160;char *out,<br>
3291 &#160;&#160;&#160;&#160;int *outlen,<br>
3292 &#160;&#160;&#160;&#160;const char *in<br>
3293 );</p>
3294 <h4 class="parameters">Parameters</h4>
3295 <dl>
3296 <dt>out</dt>
3297 <dd class="description">String to write to</dd>
3298 <dt>outlen</dt>
3299 <dd class="description">Size of output string</dd>
3300 <dt>in</dt>
3301 <dd class="description">String to read from</dd>
3302 </dl>
3303 <h4 class="returnvalue">Return Value</h4>
3304 <p class="description">Decoded string</p>
3305 <h3 class="function"><a id="httpDelete">httpDelete</a></h3>
3306 <p class="description">Send a DELETE request to the server.</p>
3307 <p class="code">
3308 int httpDelete (<br>
3309 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3310 &#160;&#160;&#160;&#160;const char *uri<br>
3311 );</p>
3312 <h4 class="parameters">Parameters</h4>
3313 <dl>
3314 <dt>http</dt>
3315 <dd class="description">HTTP connection</dd>
3316 <dt>uri</dt>
3317 <dd class="description">URI to delete</dd>
3318 </dl>
3319 <h4 class="returnvalue">Return Value</h4>
3320 <p class="description">Status of call (0 = success)</p>
3321 <h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="httpEncode64_2">httpEncode64_2</a></h3>
3322 <p class="description">Base64-encode a string.</p>
3323 <p class="code">
3324 char *httpEncode64_2 (<br>
3325 &#160;&#160;&#160;&#160;char *out,<br>
3326 &#160;&#160;&#160;&#160;int outlen,<br>
3327 &#160;&#160;&#160;&#160;const char *in,<br>
3328 &#160;&#160;&#160;&#160;int inlen<br>
3329 );</p>
3330 <h4 class="parameters">Parameters</h4>
3331 <dl>
3332 <dt>out</dt>
3333 <dd class="description">String to write to</dd>
3334 <dt>outlen</dt>
3335 <dd class="description">Size of output string</dd>
3336 <dt>in</dt>
3337 <dd class="description">String to read from</dd>
3338 <dt>inlen</dt>
3339 <dd class="description">Size of input string</dd>
3340 </dl>
3341 <h4 class="returnvalue">Return Value</h4>
3342 <p class="description">Encoded string</p>
3343 <h3 class="function"><a id="httpEncryption">httpEncryption</a></h3>
3344 <p class="description">Set the required encryption on the link.</p>
3345 <p class="code">
3346 int httpEncryption (<br>
3347 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3348 &#160;&#160;&#160;&#160;<a href="#http_encryption_t">http_encryption_t</a> e<br>
3349 );</p>
3350 <h4 class="parameters">Parameters</h4>
3351 <dl>
3352 <dt>http</dt>
3353 <dd class="description">HTTP connection</dd>
3354 <dt>e</dt>
3355 <dd class="description">New encryption preference</dd>
3356 </dl>
3357 <h4 class="returnvalue">Return Value</h4>
3358 <p class="description">-1 on error, 0 on success</p>
3359 <h3 class="function"><a id="httpError">httpError</a></h3>
3360 <p class="description">Get the last error on a connection.</p>
3361 <p class="code">
3362 int httpError (<br>
3363 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3364 );</p>
3365 <h4 class="parameters">Parameters</h4>
3366 <dl>
3367 <dt>http</dt>
3368 <dd class="description">HTTP connection</dd>
3369 </dl>
3370 <h4 class="returnvalue">Return Value</h4>
3371 <p class="description">Error code (errno) value</p>
3372 <h3 class="function"><a id="httpFieldValue">httpFieldValue</a></h3>
3373 <p class="description">Return the HTTP field enumeration value for a field
3374 name.</p>
3375 <p class="code">
3376 <a href="#http_field_t">http_field_t</a> httpFieldValue (<br>
3377 &#160;&#160;&#160;&#160;const char *name<br>
3378 );</p>
3379 <h4 class="parameters">Parameters</h4>
3380 <dl>
3381 <dt>name</dt>
3382 <dd class="description">String name</dd>
3383 </dl>
3384 <h4 class="returnvalue">Return Value</h4>
3385 <p class="description">Field index</p>
3386 <h3 class="function"><a id="httpFlush">httpFlush</a></h3>
3387 <p class="description">Looping var</p>
3388 <p class="code">
3389 void httpFlush (<br>
3390 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3391 );</p>
3392 <h4 class="parameters">Parameters</h4>
3393 <dl>
3394 <dt>http</dt>
3395 <dd class="description">HTTP connection</dd>
3396 </dl>
3397 <h4 class="returnvalue">Return Value</h4>
3398 <p class="description">Flush data from a HTTP connection.</p>
3399 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpFlushWrite">httpFlushWrite</a></h3>
3400 <p class="description">Flush data in write buffer.</p>
3401 <p class="code">
3402 int httpFlushWrite (<br>
3403 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3404 );</p>
3405 <h4 class="parameters">Parameters</h4>
3406 <dl>
3407 <dt>http</dt>
3408 <dd class="description">HTTP connection</dd>
3409 </dl>
3410 <h4 class="returnvalue">Return Value</h4>
3411 <p class="description">Bytes written or -1 on error</p>
3412 <h3 class="function"><a id="httpFreeCredentials">httpFreeCredentials</a></h3>
3413 <p class="description">Bytes written</p>
3414 <p class="code">
3415 void httpFreeCredentials (<br>
3416 &#160;&#160;&#160;&#160;cups_array_t *credentials<br>
3417 );</p>
3418 <h4 class="parameters">Parameters</h4>
3419 <dl>
3420 <dt>credentials</dt>
3421 <dd class="description">Array of credentials</dd>
3422 </dl>
3423 <h4 class="returnvalue">Return Value</h4>
3424 <p class="description">Free an array of credentials.</p>
3425 <h3 class="function"><a id="httpGet">httpGet</a></h3>
3426 <p class="description">Send a GET request to the server.</p>
3427 <p class="code">
3428 int httpGet (<br>
3429 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3430 &#160;&#160;&#160;&#160;const char *uri<br>
3431 );</p>
3432 <h4 class="parameters">Parameters</h4>
3433 <dl>
3434 <dt>http</dt>
3435 <dd class="description">HTTP connection</dd>
3436 <dt>uri</dt>
3437 <dd class="description">URI to get</dd>
3438 </dl>
3439 <h4 class="returnvalue">Return Value</h4>
3440 <p class="description">Status of call (0 = success)</p>
3441 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetActivity">httpGetActivity</a></h3>
3442 <p class="description">Get the most recent activity for a connection.</p>
3443 <p class="code">
3444 time_t httpGetActivity (<br>
3445 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3446 );</p>
3447 <h4 class="parameters">Parameters</h4>
3448 <dl>
3449 <dt>http</dt>
3450 <dd class="description">HTTP connection</dd>
3451 </dl>
3452 <h4 class="returnvalue">Return Value</h4>
3453 <p class="description">Time of last read or write</p>
3454 <h4 class="discussion">Discussion</h4>
3455 <p class="discussion">The return value is the UNIX time of the last read or write.
3456
3457 </p>
3458 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetAddress">httpGetAddress</a></h3>
3459 <p class="description">Get the address of the connected peer of a connection.</p>
3460 <p class="code">
3461 <a href="#http_addr_t">http_addr_t</a> *httpGetAddress (<br>
3462 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3463 );</p>
3464 <h4 class="parameters">Parameters</h4>
3465 <dl>
3466 <dt>http</dt>
3467 <dd class="description">HTTP connection</dd>
3468 </dl>
3469 <h4 class="returnvalue">Return Value</h4>
3470 <p class="description">Connected address or <code>NULL</code></p>
3471 <h4 class="discussion">Discussion</h4>
3472 <p class="discussion">Returns <code>NULL</code> if the socket is currently unconnected.
3473
3474 </p>
3475 <h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="httpGetAuthString">httpGetAuthString</a></h3>
3476 <p class="description">Get the current authorization string.</p>
3477 <p class="code">
3478 char *httpGetAuthString (<br>
3479 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3480 );</p>
3481 <h4 class="parameters">Parameters</h4>
3482 <dl>
3483 <dt>http</dt>
3484 <dd class="description">HTTP connection</dd>
3485 </dl>
3486 <h4 class="returnvalue">Return Value</h4>
3487 <p class="description">Authorization string</p>
3488 <h4 class="discussion">Discussion</h4>
3489 <p class="discussion">The authorization string is set by cupsDoAuthentication() and
3490 httpSetAuthString(). Use httpGetAuthString() to retrieve the
3491 string to use with httpSetField() for the HTTP_FIELD_AUTHORIZATION
3492 value.
3493
3494 </p>
3495 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetBlocking">httpGetBlocking</a></h3>
3496 <p class="description">Get the blocking/non-block state of a connection.</p>
3497 <p class="code">
3498 int httpGetBlocking (<br>
3499 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3500 );</p>
3501 <h4 class="parameters">Parameters</h4>
3502 <dl>
3503 <dt>http</dt>
3504 <dd class="description">HTTP connection</dd>
3505 </dl>
3506 <h4 class="returnvalue">Return Value</h4>
3507 <p class="description">1 if blocking, 0 if non-blocking</p>
3508 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpGetContentEncoding">httpGetContentEncoding</a></h3>
3509 <p class="description">Get a common content encoding, if any, between
3510 the client and server.</p>
3511 <p class="code">
3512 const char *httpGetContentEncoding (<br>
3513 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3514 );</p>
3515 <h4 class="parameters">Parameters</h4>
3516 <dl>
3517 <dt>http</dt>
3518 <dd class="description">HTTP connection</dd>
3519 </dl>
3520 <h4 class="returnvalue">Return Value</h4>
3521 <p class="description">Content-Coding value or
3522 <code>NULL</code> for the identity
3523 coding.</p>
3524 <h4 class="discussion">Discussion</h4>
3525 <p class="discussion">This function uses the value of the Accepts-Encoding HTTP header and must be
3526 called after receiving a response from the server or a request from the
3527 client. The value returned can be use in subsequent requests (for clients)
3528 or in the response (for servers) in order to compress the content stream.
3529
3530 </p>
3531 <h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpGetCookie">httpGetCookie</a></h3>
3532 <p class="description">Get any cookie data from the response.</p>
3533 <p class="code">
3534 const char *httpGetCookie (<br>
3535 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3536 );</p>
3537 <h4 class="parameters">Parameters</h4>
3538 <dl>
3539 <dt>http</dt>
3540 <dd class="description">HTTP connection</dd>
3541 </dl>
3542 <h4 class="returnvalue">Return Value</h4>
3543 <p class="description">Cookie data or NULL</p>
3544 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetDateString2">httpGetDateString2</a></h3>
3545 <p class="description">Get a formatted date/time string from a time value.</p>
3546 <p class="code">
3547 const char *httpGetDateString2 (<br>
3548 &#160;&#160;&#160;&#160;time_t t,<br>
3549 &#160;&#160;&#160;&#160;char *s,<br>
3550 &#160;&#160;&#160;&#160;int slen<br>
3551 );</p>
3552 <h4 class="parameters">Parameters</h4>
3553 <dl>
3554 <dt>t</dt>
3555 <dd class="description">UNIX time</dd>
3556 <dt>s</dt>
3557 <dd class="description">String buffer</dd>
3558 <dt>slen</dt>
3559 <dd class="description">Size of string buffer</dd>
3560 </dl>
3561 <h4 class="returnvalue">Return Value</h4>
3562 <p class="description">Date/time string</p>
3563 <h3 class="function"><a id="httpGetDateTime">httpGetDateTime</a></h3>
3564 <p class="description">Get a time value from a formatted date/time string.</p>
3565 <p class="code">
3566 time_t httpGetDateTime (<br>
3567 &#160;&#160;&#160;&#160;const char *s<br>
3568 );</p>
3569 <h4 class="parameters">Parameters</h4>
3570 <dl>
3571 <dt>s</dt>
3572 <dd class="description">Date/time string</dd>
3573 </dl>
3574 <h4 class="returnvalue">Return Value</h4>
3575 <p class="description">UNIX time</p>
3576 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetEncryption">httpGetEncryption</a></h3>
3577 <p class="description">Get the current encryption mode of a connection.</p>
3578 <p class="code">
3579 <a href="#http_encryption_t">http_encryption_t</a> httpGetEncryption (<br>
3580 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3581 );</p>
3582 <h4 class="parameters">Parameters</h4>
3583 <dl>
3584 <dt>http</dt>
3585 <dd class="description">HTTP connection</dd>
3586 </dl>
3587 <h4 class="returnvalue">Return Value</h4>
3588 <p class="description">Current encryption mode</p>
3589 <h4 class="discussion">Discussion</h4>
3590 <p class="discussion">This function returns the encryption mode for the connection. Use the
3591 <a href="#httpIsEncrypted"><code>httpIsEncrypted</code></a> function to determine whether a TLS session has
3592 been established.
3593
3594 </p>
3595 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpGetExpect">httpGetExpect</a></h3>
3596 <p class="description">Get the value of the Expect header, if any.</p>
3597 <p class="code">
3598 http_status_t httpGetExpect (<br>
3599 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3600 );</p>
3601 <h4 class="parameters">Parameters</h4>
3602 <dl>
3603 <dt>http</dt>
3604 <dd class="description">HTTP connection</dd>
3605 </dl>
3606 <h4 class="returnvalue">Return Value</h4>
3607 <p class="description">Expect: status, if any</p>
3608 <h4 class="discussion">Discussion</h4>
3609 <p class="discussion">Returns <code>HTTP_STATUS_NONE</code> if there is no Expect header, otherwise
3610 returns the expected HTTP status code, typically <code>HTTP_STATUS_CONTINUE</code>.
3611
3612 </p>
3613 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetFd">httpGetFd</a></h3>
3614 <p class="description">Get the file descriptor associated with a connection.</p>
3615 <p class="code">
3616 int httpGetFd (<br>
3617 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3618 );</p>
3619 <h4 class="parameters">Parameters</h4>
3620 <dl>
3621 <dt>http</dt>
3622 <dd class="description">HTTP connection</dd>
3623 </dl>
3624 <h4 class="returnvalue">Return Value</h4>
3625 <p class="description">File descriptor or -1 if none</p>
3626 <h3 class="function"><a id="httpGetField">httpGetField</a></h3>
3627 <p class="description">Get a field value from a request/response.</p>
3628 <p class="code">
3629 const char *httpGetField (<br>
3630 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3631 &#160;&#160;&#160;&#160;<a href="#http_field_t">http_field_t</a> field<br>
3632 );</p>
3633 <h4 class="parameters">Parameters</h4>
3634 <dl>
3635 <dt>http</dt>
3636 <dd class="description">HTTP connection</dd>
3637 <dt>field</dt>
3638 <dd class="description">Field to get</dd>
3639 </dl>
3640 <h4 class="returnvalue">Return Value</h4>
3641 <p class="description">Field value</p>
3642 <h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="httpGetHostByName">httpGetHostByName</a></h3>
3643 <p class="description">Lookup a hostname or IPv4 address, and return
3644 address records for the specified name.</p>
3645 <p class="code">
3646 struct hostent *httpGetHostByName (<br>
3647 &#160;&#160;&#160;&#160;const char *name<br>
3648 );</p>
3649 <h4 class="parameters">Parameters</h4>
3650 <dl>
3651 <dt>name</dt>
3652 <dd class="description">Hostname or IP address</dd>
3653 </dl>
3654 <h4 class="returnvalue">Return Value</h4>
3655 <p class="description">Host entry</p>
3656 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetHostname">httpGetHostname</a></h3>
3657 <p class="description">Get the FQDN for the connection or local system.</p>
3658 <p class="code">
3659 const char *httpGetHostname (<br>
3660 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3661 &#160;&#160;&#160;&#160;char *s,<br>
3662 &#160;&#160;&#160;&#160;int slen<br>
3663 );</p>
3664 <h4 class="parameters">Parameters</h4>
3665 <dl>
3666 <dt>http</dt>
3667 <dd class="description">HTTP connection or NULL</dd>
3668 <dt>s</dt>
3669 <dd class="description">String buffer for name</dd>
3670 <dt>slen</dt>
3671 <dd class="description">Size of buffer</dd>
3672 </dl>
3673 <h4 class="returnvalue">Return Value</h4>
3674 <p class="description">FQDN for connection or system</p>
3675 <h4 class="discussion">Discussion</h4>
3676 <p class="discussion">When &quot;http&quot; points to a connected socket, return the hostname or
3677 address that was used in the call to httpConnect() or httpConnectEncrypt(),
3678 or the address of the client for the connection from httpAcceptConnection().
3679 Otherwise, return the FQDN for the local system using both gethostname()
3680 and gethostbyname() to get the local hostname with domain.
3681
3682 </p>
3683 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetKeepAlive">httpGetKeepAlive</a></h3>
3684 <p class="description">Get the current Keep-Alive state of the connection.</p>
3685 <p class="code">
3686 <a href="#http_keepalive_t">http_keepalive_t</a> httpGetKeepAlive (<br>
3687 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3688 );</p>
3689 <h4 class="parameters">Parameters</h4>
3690 <dl>
3691 <dt>http</dt>
3692 <dd class="description">HTTP connection</dd>
3693 </dl>
3694 <h4 class="returnvalue">Return Value</h4>
3695 <p class="description">Keep-Alive state</p>
3696 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetLength2">httpGetLength2</a></h3>
3697 <p class="description">Get the amount of data remaining from the
3698 content-length or transfer-encoding fields.</p>
3699 <p class="code">
3700 off_t httpGetLength2 (<br>
3701 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3702 );</p>
3703 <h4 class="parameters">Parameters</h4>
3704 <dl>
3705 <dt>http</dt>
3706 <dd class="description">HTTP connection</dd>
3707 </dl>
3708 <h4 class="returnvalue">Return Value</h4>
3709 <p class="description">Content length</p>
3710 <h4 class="discussion">Discussion</h4>
3711 <p class="discussion">This function returns the complete content length, even for
3712 content larger than 2^31 - 1.
3713
3714 </p>
3715 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetPending">httpGetPending</a></h3>
3716 <p class="description">Get the number of bytes that are buffered for writing.</p>
3717 <p class="code">
3718 size_t httpGetPending (<br>
3719 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3720 );</p>
3721 <h4 class="parameters">Parameters</h4>
3722 <dl>
3723 <dt>http</dt>
3724 <dd class="description">HTTP connection</dd>
3725 </dl>
3726 <h4 class="returnvalue">Return Value</h4>
3727 <p class="description">Number of bytes buffered</p>
3728 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetReady">httpGetReady</a></h3>
3729 <p class="description">Get the number of bytes that can be read without blocking.</p>
3730 <p class="code">
3731 size_t httpGetReady (<br>
3732 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3733 );</p>
3734 <h4 class="parameters">Parameters</h4>
3735 <dl>
3736 <dt>http</dt>
3737 <dd class="description">HTTP connection</dd>
3738 </dl>
3739 <h4 class="returnvalue">Return Value</h4>
3740 <p class="description">Number of bytes available</p>
3741 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetRemaining">httpGetRemaining</a></h3>
3742 <p class="description">Get the number of remaining bytes in the message
3743 body or current chunk.</p>
3744 <p class="code">
3745 size_t httpGetRemaining (<br>
3746 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3747 );</p>
3748 <h4 class="parameters">Parameters</h4>
3749 <dl>
3750 <dt>http</dt>
3751 <dd class="description">HTTP connection</dd>
3752 </dl>
3753 <h4 class="returnvalue">Return Value</h4>
3754 <p class="description">Remaining bytes</p>
3755 <h4 class="discussion">Discussion</h4>
3756 <p class="discussion">The <a href="#httpIsChunked"><code>httpIsChunked</code></a> function can be used to determine whether the
3757 message body is chunked or fixed-length.
3758
3759 </p>
3760 <h3 class="function"><a id="httpGetState">httpGetState</a></h3>
3761 <p class="description">Get the current state of the HTTP request.</p>
3762 <p class="code">
3763 <a href="#http_state_t">http_state_t</a> httpGetState (<br>
3764 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3765 );</p>
3766 <h4 class="parameters">Parameters</h4>
3767 <dl>
3768 <dt>http</dt>
3769 <dd class="description">HTTP connection</dd>
3770 </dl>
3771 <h4 class="returnvalue">Return Value</h4>
3772 <p class="description">HTTP state</p>
3773 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetStatus">httpGetStatus</a></h3>
3774 <p class="description">Get the status of the last HTTP request.</p>
3775 <p class="code">
3776 http_status_t httpGetStatus (<br>
3777 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3778 );</p>
3779 <h4 class="parameters">Parameters</h4>
3780 <dl>
3781 <dt>http</dt>
3782 <dd class="description">HTTP connection</dd>
3783 </dl>
3784 <h4 class="returnvalue">Return Value</h4>
3785 <p class="description">HTTP status</p>
3786 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetSubField2">httpGetSubField2</a></h3>
3787 <p class="description">Get a sub-field value.</p>
3788 <p class="code">
3789 char *httpGetSubField2 (<br>
3790 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3791 &#160;&#160;&#160;&#160;<a href="#http_field_t">http_field_t</a> field,<br>
3792 &#160;&#160;&#160;&#160;const char *name,<br>
3793 &#160;&#160;&#160;&#160;char *value,<br>
3794 &#160;&#160;&#160;&#160;int valuelen<br>
3795 );</p>
3796 <h4 class="parameters">Parameters</h4>
3797 <dl>
3798 <dt>http</dt>
3799 <dd class="description">HTTP connection</dd>
3800 <dt>field</dt>
3801 <dd class="description">Field index</dd>
3802 <dt>name</dt>
3803 <dd class="description">Name of sub-field</dd>
3804 <dt>value</dt>
3805 <dd class="description">Value string</dd>
3806 <dt>valuelen</dt>
3807 <dd class="description">Size of value buffer</dd>
3808 </dl>
3809 <h4 class="returnvalue">Return Value</h4>
3810 <p class="description">Value or NULL</p>
3811 <h3 class="function"><a id="httpGetVersion">httpGetVersion</a></h3>
3812 <p class="description">Get the HTTP version at the other end.</p>
3813 <p class="code">
3814 <a href="#http_version_t">http_version_t</a> httpGetVersion (<br>
3815 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3816 );</p>
3817 <h4 class="parameters">Parameters</h4>
3818 <dl>
3819 <dt>http</dt>
3820 <dd class="description">HTTP connection</dd>
3821 </dl>
3822 <h4 class="returnvalue">Return Value</h4>
3823 <p class="description">Version number</p>
3824 <h3 class="function"><a id="httpGets">httpGets</a></h3>
3825 <p class="description">Get a line of text from a HTTP connection.</p>
3826 <p class="code">
3827 char *httpGets (<br>
3828 &#160;&#160;&#160;&#160;char *line,<br>
3829 &#160;&#160;&#160;&#160;int length,<br>
3830 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3831 );</p>
3832 <h4 class="parameters">Parameters</h4>
3833 <dl>
3834 <dt>line</dt>
3835 <dd class="description">Line to read into</dd>
3836 <dt>length</dt>
3837 <dd class="description">Max length of buffer</dd>
3838 <dt>http</dt>
3839 <dd class="description">HTTP connection</dd>
3840 </dl>
3841 <h4 class="returnvalue">Return Value</h4>
3842 <p class="description">Line or NULL</p>
3843 <h3 class="function"><a id="httpHead">httpHead</a></h3>
3844 <p class="description">Send a HEAD request to the server.</p>
3845 <p class="code">
3846 int httpHead (<br>
3847 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3848 &#160;&#160;&#160;&#160;const char *uri<br>
3849 );</p>
3850 <h4 class="parameters">Parameters</h4>
3851 <dl>
3852 <dt>http</dt>
3853 <dd class="description">HTTP connection</dd>
3854 <dt>uri</dt>
3855 <dd class="description">URI for head</dd>
3856 </dl>
3857 <h4 class="returnvalue">Return Value</h4>
3858 <p class="description">Status of call (0 = success)</p>
3859 <h3 class="function"><a id="httpInitialize">httpInitialize</a></h3>
3860 <p class="description">URI for head</p>
3861 <p class="code">
3862 void httpInitialize (void);</p>
3863 <h4 class="returnvalue">Return Value</h4>
3864 <p class="description">Initialize the HTTP interface library and set the
3865 default HTTP proxy (if any).</p>
3866 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpIsChunked">httpIsChunked</a></h3>
3867 <p class="description">Report whether a message body is chunked.</p>
3868 <p class="code">
3869 int httpIsChunked (<br>
3870 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3871 );</p>
3872 <h4 class="parameters">Parameters</h4>
3873 <dl>
3874 <dt>http</dt>
3875 <dd class="description">HTTP connection</dd>
3876 </dl>
3877 <h4 class="returnvalue">Return Value</h4>
3878 <p class="description">1 if chunked, 0 if not</p>
3879 <h4 class="discussion">Discussion</h4>
3880 <p class="discussion">This function returns non-zero if the message body is composed of
3881 variable-length chunks.
3882
3883 </p>
3884 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpIsEncrypted">httpIsEncrypted</a></h3>
3885 <p class="description">Report whether a connection is encrypted.</p>
3886 <p class="code">
3887 int httpIsEncrypted (<br>
3888 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
3889 );</p>
3890 <h4 class="parameters">Parameters</h4>
3891 <dl>
3892 <dt>http</dt>
3893 <dd class="description">HTTP connection</dd>
3894 </dl>
3895 <h4 class="returnvalue">Return Value</h4>
3896 <p class="description">1 if encrypted, 0 if not</p>
3897 <h4 class="discussion">Discussion</h4>
3898 <p class="discussion">This function returns non-zero if the connection is currently encrypted.
3899
3900 </p>
3901 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpLoadCredentials">httpLoadCredentials</a></h3>
3902 <p class="description">Load X.509 credentials from a keychain file.</p>
3903 <p class="code">
3904 int httpLoadCredentials (<br>
3905 &#160;&#160;&#160;&#160;const char *path,<br>
3906 &#160;&#160;&#160;&#160;cups_array_t **credentials,<br>
3907 &#160;&#160;&#160;&#160;const char *common_name<br>
3908 );</p>
3909 <h4 class="parameters">Parameters</h4>
3910 <dl>
3911 <dt>path</dt>
3912 <dd class="description">Keychain path or <code>NULL</code> for default</dd>
3913 <dt>credentials</dt>
3914 <dd class="description">Credentials</dd>
3915 <dt>common_name</dt>
3916 <dd class="description">Common name for credentials</dd>
3917 </dl>
3918 <h4 class="returnvalue">Return Value</h4>
3919 <p class="description">0 on success, -1 on error</p>
3920 <h3 class="function"><a id="httpOptions">httpOptions</a></h3>
3921 <p class="description">Send an OPTIONS request to the server.</p>
3922 <p class="code">
3923 int httpOptions (<br>
3924 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3925 &#160;&#160;&#160;&#160;const char *uri<br>
3926 );</p>
3927 <h4 class="parameters">Parameters</h4>
3928 <dl>
3929 <dt>http</dt>
3930 <dd class="description">HTTP connection</dd>
3931 <dt>uri</dt>
3932 <dd class="description">URI for options</dd>
3933 </dl>
3934 <h4 class="returnvalue">Return Value</h4>
3935 <p class="description">Status of call (0 = success)</p>
3936 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpPeek">httpPeek</a></h3>
3937 <p class="description">Peek at data from a HTTP connection.</p>
3938 <p class="code">
3939 ssize_t httpPeek (<br>
3940 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3941 &#160;&#160;&#160;&#160;char *buffer,<br>
3942 &#160;&#160;&#160;&#160;size_t length<br>
3943 );</p>
3944 <h4 class="parameters">Parameters</h4>
3945 <dl>
3946 <dt>http</dt>
3947 <dd class="description">HTTP connection</dd>
3948 <dt>buffer</dt>
3949 <dd class="description">Buffer for data</dd>
3950 <dt>length</dt>
3951 <dd class="description">Maximum number of bytes</dd>
3952 </dl>
3953 <h4 class="returnvalue">Return Value</h4>
3954 <p class="description">Number of bytes copied</p>
3955 <h4 class="discussion">Discussion</h4>
3956 <p class="discussion">This function copies available data from the given HTTP connection, reading
3957 a buffer as needed. The data is still available for reading using
3958 <a href="#httpRead"><code>httpRead</code></a> or <a href="#httpRead2"><code>httpRead2</code></a>.<br>
3959 <br>
3960 For non-blocking connections the usual timeouts apply.
3961
3962 </p>
3963 <h3 class="function"><a id="httpPost">httpPost</a></h3>
3964 <p class="description">Send a POST request to the server.</p>
3965 <p class="code">
3966 int httpPost (<br>
3967 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3968 &#160;&#160;&#160;&#160;const char *uri<br>
3969 );</p>
3970 <h4 class="parameters">Parameters</h4>
3971 <dl>
3972 <dt>http</dt>
3973 <dd class="description">HTTP connection</dd>
3974 <dt>uri</dt>
3975 <dd class="description">URI for post</dd>
3976 </dl>
3977 <h4 class="returnvalue">Return Value</h4>
3978 <p class="description">Status of call (0 = success)</p>
3979 <h3 class="function"><a id="httpPut">httpPut</a></h3>
3980 <p class="description">Send a PUT request to the server.</p>
3981 <p class="code">
3982 int httpPut (<br>
3983 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3984 &#160;&#160;&#160;&#160;const char *uri<br>
3985 );</p>
3986 <h4 class="parameters">Parameters</h4>
3987 <dl>
3988 <dt>http</dt>
3989 <dd class="description">HTTP connection</dd>
3990 <dt>uri</dt>
3991 <dd class="description">URI to put</dd>
3992 </dl>
3993 <h4 class="returnvalue">Return Value</h4>
3994 <p class="description">Status of call (0 = success)</p>
3995 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpRead2">httpRead2</a></h3>
3996 <p class="description">Read data from a HTTP connection.</p>
3997 <p class="code">
3998 ssize_t httpRead2 (<br>
3999 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4000 &#160;&#160;&#160;&#160;char *buffer,<br>
4001 &#160;&#160;&#160;&#160;size_t length<br>
4002 );</p>
4003 <h4 class="parameters">Parameters</h4>
4004 <dl>
4005 <dt>http</dt>
4006 <dd class="description">HTTP connection</dd>
4007 <dt>buffer</dt>
4008 <dd class="description">Buffer for data</dd>
4009 <dt>length</dt>
4010 <dd class="description">Maximum number of bytes</dd>
4011 </dl>
4012 <h4 class="returnvalue">Return Value</h4>
4013 <p class="description">Number of bytes read</p>
4014 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpReadRequest">httpReadRequest</a></h3>
4015 <p class="description">Read a HTTP request from a connection.</p>
4016 <p class="code">
4017 <a href="#http_state_t">http_state_t</a> httpReadRequest (<br>
4018 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4019 &#160;&#160;&#160;&#160;char *uri,<br>
4020 &#160;&#160;&#160;&#160;size_t urilen<br>
4021 );</p>
4022 <h4 class="parameters">Parameters</h4>
4023 <dl>
4024 <dt>http</dt>
4025 <dd class="description">HTTP connection</dd>
4026 <dt>uri</dt>
4027 <dd class="description">URI buffer</dd>
4028 <dt>urilen</dt>
4029 <dd class="description">Size of URI buffer</dd>
4030 </dl>
4031 <h4 class="returnvalue">Return Value</h4>
4032 <p class="description">New state of connection</p>
4033 <h3 class="function"><a id="httpReconnect2">httpReconnect2</a></h3>
4034 <p class="description">Reconnect to a HTTP server with timeout and optional
4035 cancel.</p>
4036 <p class="code">
4037 int httpReconnect2 (<br>
4038 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4039 &#160;&#160;&#160;&#160;int msec,<br>
4040 &#160;&#160;&#160;&#160;int *cancel<br>
4041 );</p>
4042 <h4 class="parameters">Parameters</h4>
4043 <dl>
4044 <dt>http</dt>
4045 <dd class="description">HTTP connection</dd>
4046 <dt>msec</dt>
4047 <dd class="description">Timeout in milliseconds</dd>
4048 <dt>cancel</dt>
4049 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
4050 </dl>
4051 <h4 class="returnvalue">Return Value</h4>
4052 <p class="description">0 on success, non-zero on failure</p>
4053 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpResolveHostname">httpResolveHostname</a></h3>
4054 <p class="description">Resolve the hostname of the HTTP connection
4055 address.</p>
4056 <p class="code">
4057 const char *httpResolveHostname (<br>
4058 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4059 &#160;&#160;&#160;&#160;char *buffer,<br>
4060 &#160;&#160;&#160;&#160;size_t bufsize<br>
4061 );</p>
4062 <h4 class="parameters">Parameters</h4>
4063 <dl>
4064 <dt>http</dt>
4065 <dd class="description">HTTP connection</dd>
4066 <dt>buffer</dt>
4067 <dd class="description">Hostname buffer</dd>
4068 <dt>bufsize</dt>
4069 <dd class="description">Size of buffer</dd>
4070 </dl>
4071 <h4 class="returnvalue">Return Value</h4>
4072 <p class="description">Resolved hostname or <code>NULL</code></p>
4073 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpSaveCredentials">httpSaveCredentials</a></h3>
4074 <p class="description">Save X.509 credentials to a keychain file.</p>
4075 <p class="code">
4076 int httpSaveCredentials (<br>
4077 &#160;&#160;&#160;&#160;const char *path,<br>
4078 &#160;&#160;&#160;&#160;cups_array_t *credentials,<br>
4079 &#160;&#160;&#160;&#160;const char *common_name<br>
4080 );</p>
4081 <h4 class="parameters">Parameters</h4>
4082 <dl>
4083 <dt>path</dt>
4084 <dd class="description">Keychain path or <code>NULL</code> for default</dd>
4085 <dt>credentials</dt>
4086 <dd class="description">Credentials</dd>
4087 <dt>common_name</dt>
4088 <dd class="description">Common name for credentials</dd>
4089 </dl>
4090 <h4 class="returnvalue">Return Value</h4>
4091 <p class="description">-1 on error, 0 on success</p>
4092 <h3 class="function"><a id="httpSeparate">httpSeparate</a></h3>
4093 <p class="description">+ 400 year days</p>
4094 <p class="code">
4095 void httpSeparate (<br>
4096 &#160;&#160;&#160;&#160;const char *uri,<br>
4097 &#160;&#160;&#160;&#160;char *scheme,<br>
4098 &#160;&#160;&#160;&#160;char *username,<br>
4099 &#160;&#160;&#160;&#160;char *host,<br>
4100 &#160;&#160;&#160;&#160;int *port,<br>
4101 &#160;&#160;&#160;&#160;char *resource<br>
4102 );</p>
4103 <h4 class="parameters">Parameters</h4>
4104 <dl>
4105 <dt>uri</dt>
4106 <dd class="description">Universal Resource Identifier</dd>
4107 <dt>scheme</dt>
4108 <dd class="description">Scheme [32] (http, https, etc.)</dd>
4109 <dt>username</dt>
4110 <dd class="description">Username [1024]</dd>
4111 <dt>host</dt>
4112 <dd class="description">Hostname [1024]</dd>
4113 <dt>port</dt>
4114 <dd class="description">Port number to use</dd>
4115 <dt>resource</dt>
4116 <dd class="description">Resource/filename [1024]</dd>
4117 </dl>
4118 <h4 class="returnvalue">Return Value</h4>
4119 <p class="description">Separate a Universal Resource Identifier into its
4120 components.</p>
4121 <p class="discussion">This function is deprecated; use the httpSeparateURI() function instead.
4122
4123 </p>
4124 <h3 class="function"><a id="httpSeparate2">httpSeparate2</a></h3>
4125 <p class="description">Resource/filename [1024]</p>
4126 <p class="code">
4127 void httpSeparate2 (<br>
4128 &#160;&#160;&#160;&#160;const char *uri,<br>
4129 &#160;&#160;&#160;&#160;char *scheme,<br>
4130 &#160;&#160;&#160;&#160;int schemelen,<br>
4131 &#160;&#160;&#160;&#160;char *username,<br>
4132 &#160;&#160;&#160;&#160;int usernamelen,<br>
4133 &#160;&#160;&#160;&#160;char *host,<br>
4134 &#160;&#160;&#160;&#160;int hostlen,<br>
4135 &#160;&#160;&#160;&#160;int *port,<br>
4136 &#160;&#160;&#160;&#160;char *resource,<br>
4137 &#160;&#160;&#160;&#160;int resourcelen<br>
4138 );</p>
4139 <h4 class="parameters">Parameters</h4>
4140 <dl>
4141 <dt>uri</dt>
4142 <dd class="description">Universal Resource Identifier</dd>
4143 <dt>scheme</dt>
4144 <dd class="description">Scheme (http, https, etc.)</dd>
4145 <dt>schemelen</dt>
4146 <dd class="description">Size of scheme buffer</dd>
4147 <dt>username</dt>
4148 <dd class="description">Username</dd>
4149 <dt>usernamelen</dt>
4150 <dd class="description">Size of username buffer</dd>
4151 <dt>host</dt>
4152 <dd class="description">Hostname</dd>
4153 <dt>hostlen</dt>
4154 <dd class="description">Size of hostname buffer</dd>
4155 <dt>port</dt>
4156 <dd class="description">Port number to use</dd>
4157 <dt>resource</dt>
4158 <dd class="description">Resource/filename</dd>
4159 <dt>resourcelen</dt>
4160 <dd class="description">Size of resource buffer</dd>
4161 </dl>
4162 <h4 class="returnvalue">Return Value</h4>
4163 <p class="description">Separate a Universal Resource Identifier into its
4164 components.</p>
4165 <p class="discussion">This function is deprecated; use the httpSeparateURI() function instead.
4166
4167
4168 </p>
4169 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSeparateURI">httpSeparateURI</a></h3>
4170 <p class="description">Separate a Universal Resource Identifier into its
4171 components.</p>
4172 <p class="code">
4173 <a href="#http_uri_status_t">http_uri_status_t</a> httpSeparateURI (<br>
4174 &#160;&#160;&#160;&#160;<a href="#http_uri_coding_t">http_uri_coding_t</a> decoding,<br>
4175 &#160;&#160;&#160;&#160;const char *uri,<br>
4176 &#160;&#160;&#160;&#160;char *scheme,<br>
4177 &#160;&#160;&#160;&#160;int schemelen,<br>
4178 &#160;&#160;&#160;&#160;char *username,<br>
4179 &#160;&#160;&#160;&#160;int usernamelen,<br>
4180 &#160;&#160;&#160;&#160;char *host,<br>
4181 &#160;&#160;&#160;&#160;int hostlen,<br>
4182 &#160;&#160;&#160;&#160;int *port,<br>
4183 &#160;&#160;&#160;&#160;char *resource,<br>
4184 &#160;&#160;&#160;&#160;int resourcelen<br>
4185 );</p>
4186 <h4 class="parameters">Parameters</h4>
4187 <dl>
4188 <dt>decoding</dt>
4189 <dd class="description">Decoding flags</dd>
4190 <dt>uri</dt>
4191 <dd class="description">Universal Resource Identifier</dd>
4192 <dt>scheme</dt>
4193 <dd class="description">Scheme (http, https, etc.)</dd>
4194 <dt>schemelen</dt>
4195 <dd class="description">Size of scheme buffer</dd>
4196 <dt>username</dt>
4197 <dd class="description">Username</dd>
4198 <dt>usernamelen</dt>
4199 <dd class="description">Size of username buffer</dd>
4200 <dt>host</dt>
4201 <dd class="description">Hostname</dd>
4202 <dt>hostlen</dt>
4203 <dd class="description">Size of hostname buffer</dd>
4204 <dt>port</dt>
4205 <dd class="description">Port number to use</dd>
4206 <dt>resource</dt>
4207 <dd class="description">Resource/filename</dd>
4208 <dt>resourcelen</dt>
4209 <dd class="description">Size of resource buffer</dd>
4210 </dl>
4211 <h4 class="returnvalue">Return Value</h4>
4212 <p class="description">Result of separation</p>
4213 <h3 class="function"><a id="httpSetAuthString">httpSetAuthString</a></h3>
4214 <p class="description">Always do encryption via SSL.</p>
4215 <p class="code">
4216 void httpSetAuthString (<br>
4217 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4218 &#160;&#160;&#160;&#160;const char *scheme,<br>
4219 &#160;&#160;&#160;&#160;const char *data<br>
4220 );</p>
4221 <h4 class="parameters">Parameters</h4>
4222 <dl>
4223 <dt>http</dt>
4224 <dd class="description">HTTP connection</dd>
4225 <dt>scheme</dt>
4226 <dd class="description">Auth scheme (NULL to clear it)</dd>
4227 <dt>data</dt>
4228 <dd class="description">Auth data (NULL for none)</dd>
4229 </dl>
4230 <h4 class="returnvalue">Return Value</h4>
4231 <p class="description">Set the current authorization string.</p>
4232 <p class="discussion">This function just stores a copy of the current authorization string in
4233 the HTTP connection object. You must still call httpSetField() to set
4234 HTTP_FIELD_AUTHORIZATION prior to issuing a HTTP request using httpGet(),
4235 httpHead(), httpOptions(), httpPost, or httpPut().
4236
4237 </p>
4238 <h3 class="function"><a id="httpSetCookie">httpSetCookie</a></h3>
4239 <p class="description">Array of credentials</p>
4240 <p class="code">
4241 void httpSetCookie (<br>
4242 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4243 &#160;&#160;&#160;&#160;const char *cookie<br>
4244 );</p>
4245 <h4 class="parameters">Parameters</h4>
4246 <dl>
4247 <dt>http</dt>
4248 <dd class="description">Connection</dd>
4249 <dt>cookie</dt>
4250 <dd class="description">Cookie string</dd>
4251 </dl>
4252 <h4 class="returnvalue">Return Value</h4>
4253 <p class="description">Set the cookie value(s).</p>
4254 <p class="discussion"></p>
4255 <h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpSetCredentials">httpSetCredentials</a></h3>
4256 <p class="description">Set the credentials associated with an encrypted
4257 connection.</p>
4258 <p class="code">
4259 int httpSetCredentials (<br>
4260 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4261 &#160;&#160;&#160;&#160;cups_array_t *credentials<br>
4262 );</p>
4263 <h4 class="parameters">Parameters</h4>
4264 <dl>
4265 <dt>http</dt>
4266 <dd class="description">HTTP connection</dd>
4267 <dt>credentials</dt>
4268 <dd class="description">Array of credentials</dd>
4269 </dl>
4270 <h4 class="returnvalue">Return Value</h4>
4271 <p class="description">Status of call (0 = success)</p>
4272 <h3 class="function"><a id="httpSetDefaultField">httpSetDefaultField</a></h3>
4273 <p class="description">Cookie string</p>
4274 <p class="code">
4275 void httpSetDefaultField (<br>
4276 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4277 &#160;&#160;&#160;&#160;<a href="#http_field_t">http_field_t</a> field,<br>
4278 &#160;&#160;&#160;&#160;const char *value<br>
4279 );</p>
4280 <h4 class="parameters">Parameters</h4>
4281 <dl>
4282 <dt>http</dt>
4283 <dd class="description">HTTP connection</dd>
4284 <dt>field</dt>
4285 <dd class="description">Field index</dd>
4286 <dt>value</dt>
4287 <dd class="description">Value</dd>
4288 </dl>
4289 <h4 class="returnvalue">Return Value</h4>
4290 <p class="description">Set the default value of an HTTP header.</p>
4291 <p class="discussion">Currently only <code>HTTP_FIELD_ACCEPT_ENCODING</code>, <code>HTTP_FIELD_SERVER</code>,
4292 and <code>HTTP_FIELD_USER_AGENT</code> can be set.
4293
4294 </p>
4295 <h3 class="function"><a id="httpSetExpect">httpSetExpect</a></h3>
4296 <p class="description">Value</p>
4297 <p class="code">
4298 void httpSetExpect (<br>
4299 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4300 &#160;&#160;&#160;&#160;http_status_t expect<br>
4301 );</p>
4302 <h4 class="parameters">Parameters</h4>
4303 <dl>
4304 <dt>http</dt>
4305 <dd class="description">HTTP connection</dd>
4306 <dt>expect</dt>
4307 <dd class="description">HTTP status to expect
4308 (<code>HTTP_STATUS_CONTINUE</code>)</dd>
4309 </dl>
4310 <h4 class="returnvalue">Return Value</h4>
4311 <p class="description">Set the Expect: header in a request.</p>
4312 <p class="discussion">Currently only <code>HTTP_STATUS_CONTINUE</code> is supported for the &quot;expect&quot;
4313 argument.
4314
4315 </p>
4316 <h3 class="function"><a id="httpSetField">httpSetField</a></h3>
4317 <p class="description">HTTP status to expect
4318 (<code>HTTP_STATUS_CONTINUE</code>)</p>
4319 <p class="code">
4320 void httpSetField (<br>
4321 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4322 &#160;&#160;&#160;&#160;<a href="#http_field_t">http_field_t</a> field,<br>
4323 &#160;&#160;&#160;&#160;const char *value<br>
4324 );</p>
4325 <h4 class="parameters">Parameters</h4>
4326 <dl>
4327 <dt>http</dt>
4328 <dd class="description">HTTP connection</dd>
4329 <dt>field</dt>
4330 <dd class="description">Field index</dd>
4331 <dt>value</dt>
4332 <dd class="description">Value</dd>
4333 </dl>
4334 <h4 class="returnvalue">Return Value</h4>
4335 <p class="description">Set the value of an HTTP header.</p>
4336 <h3 class="function"><a id="httpSetKeepAlive">httpSetKeepAlive</a></h3>
4337 <p class="description">Check for a trailing dot on the hostname...</p>
4338 <p class="code">
4339 void httpSetKeepAlive (<br>
4340 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4341 &#160;&#160;&#160;&#160;<a href="#http_keepalive_t">http_keepalive_t</a> keep_alive<br>
4342 );</p>
4343 <h4 class="parameters">Parameters</h4>
4344 <dl>
4345 <dt>http</dt>
4346 <dd class="description">HTTP connection</dd>
4347 <dt>keep_alive</dt>
4348 <dd class="description">New Keep-Alive value</dd>
4349 </dl>
4350 <h4 class="returnvalue">Return Value</h4>
4351 <p class="description">Set the current Keep-Alive state of a connection.</p>
4352 <p class="discussion"></p>
4353 <h3 class="function"><a id="httpSetLength">httpSetLength</a></h3>
4354 <p class="description">New Keep-Alive value</p>
4355 <p class="code">
4356 void httpSetLength (<br>
4357 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4358 &#160;&#160;&#160;&#160;size_t length<br>
4359 );</p>
4360 <h4 class="parameters">Parameters</h4>
4361 <dl>
4362 <dt>http</dt>
4363 <dd class="description">HTTP connection</dd>
4364 <dt>length</dt>
4365 <dd class="description">Length (0 for chunked)</dd>
4366 </dl>
4367 <h4 class="returnvalue">Return Value</h4>
4368 <p class="description">Set the content-length and content-encoding.</p>
4369 <p class="discussion"></p>
4370 <h3 class="function"><a id="httpSetTimeout">httpSetTimeout</a></h3>
4371 <p class="description">Length (0 for chunked)</p>
4372 <p class="code">
4373 void httpSetTimeout (<br>
4374 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4375 &#160;&#160;&#160;&#160;double timeout,<br>
4376 &#160;&#160;&#160;&#160;<a href="#http_timeout_cb_t">http_timeout_cb_t</a> cb,<br>
4377 &#160;&#160;&#160;&#160;void *user_data<br>
4378 );</p>
4379 <h4 class="parameters">Parameters</h4>
4380 <dl>
4381 <dt>http</dt>
4382 <dd class="description">HTTP connection</dd>
4383 <dt>timeout</dt>
4384 <dd class="description">Number of seconds for timeout,
4385 must be greater than 0</dd>
4386 <dt>cb</dt>
4387 <dd class="description">Callback function or NULL</dd>
4388 <dt>user_data</dt>
4389 <dd class="description">User data pointer</dd>
4390 </dl>
4391 <h4 class="returnvalue">Return Value</h4>
4392 <p class="description">Set read/write timeouts and an optional callback.</p>
4393 <p class="discussion">The optional timeout callback receives both the HTTP connection and a user
4394 data pointer and must return 1 to continue or 0 to error (time) out.
4395
4396 </p>
4397 <h3 class="function"><a id="httpShutdown">httpShutdown</a></h3>
4398 <p class="description">User data pointer</p>
4399 <p class="code">
4400 void httpShutdown (<br>
4401 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
4402 );</p>
4403 <h4 class="parameters">Parameters</h4>
4404 <dl>
4405 <dt>http</dt>
4406 <dd class="description">HTTP connection</dd>
4407 </dl>
4408 <h4 class="returnvalue">Return Value</h4>
4409 <p class="description">Shutdown one side of an HTTP connection.</p>
4410 <p class="discussion"></p>
4411 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpStateString">httpStateString</a></h3>
4412 <p class="description">Return the string describing a HTTP state value.</p>
4413 <p class="code">
4414 const char *httpStateString (<br>
4415 &#160;&#160;&#160;&#160;<a href="#http_state_t">http_state_t</a> state<br>
4416 );</p>
4417 <h4 class="parameters">Parameters</h4>
4418 <dl>
4419 <dt>state</dt>
4420 <dd class="description">HTTP state value</dd>
4421 </dl>
4422 <h4 class="returnvalue">Return Value</h4>
4423 <p class="description">State string</p>
4424 <h3 class="function"><a id="httpStatus">httpStatus</a></h3>
4425 <p class="description">Return a short string describing a HTTP status code.</p>
4426 <p class="code">
4427 const char *httpStatus (<br>
4428 &#160;&#160;&#160;&#160;http_status_t status<br>
4429 );</p>
4430 <h4 class="parameters">Parameters</h4>
4431 <dl>
4432 <dt>status</dt>
4433 <dd class="description">HTTP status code</dd>
4434 </dl>
4435 <h4 class="returnvalue">Return Value</h4>
4436 <p class="description">Localized status string</p>
4437 <h4 class="discussion">Discussion</h4>
4438 <p class="discussion">The returned string is localized to the current POSIX locale and is based
4439 on the status strings defined in RFC 2616.</p>
4440 <h3 class="function"><a id="httpTrace">httpTrace</a></h3>
4441 <p class="description">Send an TRACE request to the server.</p>
4442 <p class="code">
4443 int httpTrace (<br>
4444 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4445 &#160;&#160;&#160;&#160;const char *uri<br>
4446 );</p>
4447 <h4 class="parameters">Parameters</h4>
4448 <dl>
4449 <dt>http</dt>
4450 <dd class="description">HTTP connection</dd>
4451 <dt>uri</dt>
4452 <dd class="description">URI for trace</dd>
4453 </dl>
4454 <h4 class="returnvalue">Return Value</h4>
4455 <p class="description">Status of call (0 = success)</p>
4456 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpURIStatusString">httpURIStatusString</a></h3>
4457 <p class="description">Return a string describing a URI status code.</p>
4458 <p class="code">
4459 const char *httpURIStatusString (<br>
4460 &#160;&#160;&#160;&#160;<a href="#http_uri_status_t">http_uri_status_t</a> status<br>
4461 );</p>
4462 <h4 class="parameters">Parameters</h4>
4463 <dl>
4464 <dt>status</dt>
4465 <dd class="description">URI status code</dd>
4466 </dl>
4467 <h4 class="returnvalue">Return Value</h4>
4468 <p class="description">Localized status string</p>
4469 <h3 class="function"><a id="httpUpdate">httpUpdate</a></h3>
4470 <p class="description">Update the current HTTP state for incoming data.</p>
4471 <p class="code">
4472 http_status_t httpUpdate (<br>
4473 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
4474 );</p>
4475 <h4 class="parameters">Parameters</h4>
4476 <dl>
4477 <dt>http</dt>
4478 <dd class="description">HTTP connection</dd>
4479 </dl>
4480 <h4 class="returnvalue">Return Value</h4>
4481 <p class="description">HTTP status</p>
4482 <h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpWait">httpWait</a></h3>
4483 <p class="description">Wait for data available on a connection.</p>
4484 <p class="code">
4485 int httpWait (<br>
4486 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4487 &#160;&#160;&#160;&#160;int msec<br>
4488 );</p>
4489 <h4 class="parameters">Parameters</h4>
4490 <dl>
4491 <dt>http</dt>
4492 <dd class="description">HTTP connection</dd>
4493 <dt>msec</dt>
4494 <dd class="description">Milliseconds to wait</dd>
4495 </dl>
4496 <h4 class="returnvalue">Return Value</h4>
4497 <p class="description">1 if data is available, 0 otherwise</p>
4498 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpWrite2">httpWrite2</a></h3>
4499 <p class="description">Write data to a HTTP connection.</p>
4500 <p class="code">
4501 ssize_t httpWrite2 (<br>
4502 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4503 &#160;&#160;&#160;&#160;const char *buffer,<br>
4504 &#160;&#160;&#160;&#160;size_t length<br>
4505 );</p>
4506 <h4 class="parameters">Parameters</h4>
4507 <dl>
4508 <dt>http</dt>
4509 <dd class="description">HTTP connection</dd>
4510 <dt>buffer</dt>
4511 <dd class="description">Buffer for data</dd>
4512 <dt>length</dt>
4513 <dd class="description">Number of bytes to write</dd>
4514 </dl>
4515 <h4 class="returnvalue">Return Value</h4>
4516 <p class="description">Number of bytes written</p>
4517 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpWriteResponse">httpWriteResponse</a></h3>
4518 <p class="description">Write a HTTP response to a client connection.</p>
4519 <p class="code">
4520 int httpWriteResponse (<br>
4521 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4522 &#160;&#160;&#160;&#160;http_status_t status<br>
4523 );</p>
4524 <h4 class="parameters">Parameters</h4>
4525 <dl>
4526 <dt>http</dt>
4527 <dd class="description">HTTP connection</dd>
4528 <dt>status</dt>
4529 <dd class="description">Status code</dd>
4530 </dl>
4531 <h4 class="returnvalue">Return Value</h4>
4532 <p class="description">0 on success, -1 on error</p>
4533 <h3 class="function"><a id="ippAddBoolean">ippAddBoolean</a></h3>
4534 <p class="description">Add a boolean attribute to an IPP message.</p>
4535 <p class="code">
4536 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBoolean (<br>
4537 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4538 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
4539 &#160;&#160;&#160;&#160;const char *name,<br>
4540 &#160;&#160;&#160;&#160;char value<br>
4541 );</p>
4542 <h4 class="parameters">Parameters</h4>
4543 <dl>
4544 <dt>ipp</dt>
4545 <dd class="description">IPP message</dd>
4546 <dt>group</dt>
4547 <dd class="description">IPP group</dd>
4548 <dt>name</dt>
4549 <dd class="description">Name of attribute</dd>
4550 <dt>value</dt>
4551 <dd class="description">Value of attribute</dd>
4552 </dl>
4553 <h4 class="returnvalue">Return Value</h4>
4554 <p class="description">New attribute</p>
4555 <h4 class="discussion">Discussion</h4>
4556 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4557 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>
4558 <br>
4559 The <code>group</code> parameter specifies the IPP attribute group tag: none
4560 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4561 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4562 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4563 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4564 <h3 class="function"><a id="ippAddBooleans">ippAddBooleans</a></h3>
4565 <p class="description">Add an array of boolean values.</p>
4566 <p class="code">
4567 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBooleans (<br>
4568 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4569 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
4570 &#160;&#160;&#160;&#160;const char *name,<br>
4571 &#160;&#160;&#160;&#160;int num_values,<br>
4572 &#160;&#160;&#160;&#160;const char *values<br>
4573 );</p>
4574 <h4 class="parameters">Parameters</h4>
4575 <dl>
4576 <dt>ipp</dt>
4577 <dd class="description">IPP message</dd>
4578 <dt>group</dt>
4579 <dd class="description">IPP group</dd>
4580 <dt>name</dt>
4581 <dd class="description">Name of attribute</dd>
4582 <dt>num_values</dt>
4583 <dd class="description">Number of values</dd>
4584 <dt>values</dt>
4585 <dd class="description">Values</dd>
4586 </dl>
4587 <h4 class="returnvalue">Return Value</h4>
4588 <p class="description">New attribute</p>
4589 <h4 class="discussion">Discussion</h4>
4590 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4591 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>
4592 <br>
4593 The <code>group</code> parameter specifies the IPP attribute group tag: none
4594 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4595 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4596 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4597 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4598 <h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippAddCollection">ippAddCollection</a></h3>
4599 <p class="description">Add a collection value.</p>
4600 <p class="code">
4601 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollection (<br>
4602 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4603 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
4604 &#160;&#160;&#160;&#160;const char *name,<br>
4605 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *value<br>
4606 );</p>
4607 <h4 class="parameters">Parameters</h4>
4608 <dl>
4609 <dt>ipp</dt>
4610 <dd class="description">IPP message</dd>
4611 <dt>group</dt>
4612 <dd class="description">IPP group</dd>
4613 <dt>name</dt>
4614 <dd class="description">Name of attribute</dd>
4615 <dt>value</dt>
4616 <dd class="description">Value</dd>
4617 </dl>
4618 <h4 class="returnvalue">Return Value</h4>
4619 <p class="description">New attribute</p>
4620 <h4 class="discussion">Discussion</h4>
4621 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4622 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>
4623 <br>
4624 The <code>group</code> parameter specifies the IPP attribute group tag: none
4625 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4626 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4627 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4628 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
4629
4630 </p>
4631 <h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippAddCollections">ippAddCollections</a></h3>
4632 <p class="description">Add an array of collection values.</p>
4633 <p class="code">
4634 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollections (<br>
4635 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4636 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
4637 &#160;&#160;&#160;&#160;const char *name,<br>
4638 &#160;&#160;&#160;&#160;int num_values,<br>
4639 &#160;&#160;&#160;&#160;const <a href="#ipp_t">ipp_t</a> **values<br>
4640 );</p>
4641 <h4 class="parameters">Parameters</h4>
4642 <dl>
4643 <dt>ipp</dt>
4644 <dd class="description">IPP message</dd>
4645 <dt>group</dt>
4646 <dd class="description">IPP group</dd>
4647 <dt>name</dt>
4648 <dd class="description">Name of attribute</dd>
4649 <dt>num_values</dt>
4650 <dd class="description">Number of values</dd>
4651 <dt>values</dt>
4652 <dd class="description">Values</dd>
4653 </dl>
4654 <h4 class="returnvalue">Return Value</h4>
4655 <p class="description">New attribute</p>
4656 <h4 class="discussion">Discussion</h4>
4657 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4658 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>
4659 <br>
4660 The <code>group</code> parameter specifies the IPP attribute group tag: none
4661 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4662 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4663 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4664 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
4665
4666 </p>
4667 <h3 class="function"><a id="ippAddDate">ippAddDate</a></h3>
4668 <p class="description">Add a date attribute to an IPP message.</p>
4669 <p class="code">
4670 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddDate (<br>
4671 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4672 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
4673 &#160;&#160;&#160;&#160;const char *name,<br>
4674 &#160;&#160;&#160;&#160;const <a href="#ipp_uchar_t">ipp_uchar_t</a> *value<br>
4675 );</p>
4676 <h4 class="parameters">Parameters</h4>
4677 <dl>
4678 <dt>ipp</dt>
4679 <dd class="description">IPP message</dd>
4680 <dt>group</dt>
4681 <dd class="description">IPP group</dd>
4682 <dt>name</dt>
4683 <dd class="description">Name of attribute</dd>
4684 <dt>value</dt>
4685 <dd class="description">Value</dd>
4686 </dl>
4687 <h4 class="returnvalue">Return Value</h4>
4688 <p class="description">New attribute</p>
4689 <h4 class="discussion">Discussion</h4>
4690 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4691 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>
4692 <br>
4693 The <code>group</code> parameter specifies the IPP attribute group tag: none
4694 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4695 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4696 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4697 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4698 <h3 class="function"><a id="ippAddInteger">ippAddInteger</a></h3>
4699 <p class="description">Add a integer attribute to an IPP message.</p>
4700 <p class="code">
4701 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddInteger (<br>
4702 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4703 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
4704 &#160;&#160;&#160;&#160;ipp_tag_t value_tag,<br>
4705 &#160;&#160;&#160;&#160;const char *name,<br>
4706 &#160;&#160;&#160;&#160;int value<br>
4707 );</p>
4708 <h4 class="parameters">Parameters</h4>
4709 <dl>
4710 <dt>ipp</dt>
4711 <dd class="description">IPP message</dd>
4712 <dt>group</dt>
4713 <dd class="description">IPP group</dd>
4714 <dt>value_tag</dt>
4715 <dd class="description">Type of attribute</dd>
4716 <dt>name</dt>
4717 <dd class="description">Name of attribute</dd>
4718 <dt>value</dt>
4719 <dd class="description">Value of attribute</dd>
4720 </dl>
4721 <h4 class="returnvalue">Return Value</h4>
4722 <p class="description">New attribute</p>
4723 <h4 class="discussion">Discussion</h4>
4724 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4725 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>
4726 <br>
4727 The <code>group</code> parameter specifies the IPP attribute group tag: none
4728 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4729 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4730 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4731 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4732 <br>
4733 Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
4734 (<code>IPP_TAG_INTEGER</code>).</p>
4735 <h3 class="function"><a id="ippAddIntegers">ippAddIntegers</a></h3>
4736 <p class="description">Add an array of integer values.</p>
4737 <p class="code">
4738 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddIntegers (<br>
4739 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4740 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
4741 &#160;&#160;&#160;&#160;ipp_tag_t value_tag,<br>
4742 &#160;&#160;&#160;&#160;const char *name,<br>
4743 &#160;&#160;&#160;&#160;int num_values,<br>
4744 &#160;&#160;&#160;&#160;const int *values<br>
4745 );</p>
4746 <h4 class="parameters">Parameters</h4>
4747 <dl>
4748 <dt>ipp</dt>
4749 <dd class="description">IPP message</dd>
4750 <dt>group</dt>
4751 <dd class="description">IPP group</dd>
4752 <dt>value_tag</dt>
4753 <dd class="description">Type of attribute</dd>
4754 <dt>name</dt>
4755 <dd class="description">Name of attribute</dd>
4756 <dt>num_values</dt>
4757 <dd class="description">Number of values</dd>
4758 <dt>values</dt>
4759 <dd class="description">Values</dd>
4760 </dl>
4761 <h4 class="returnvalue">Return Value</h4>
4762 <p class="description">New attribute</p>
4763 <h4 class="discussion">Discussion</h4>
4764 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4765 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>
4766 <br>
4767 The <code>group</code> parameter specifies the IPP attribute group tag: none
4768 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4769 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4770 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4771 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4772 <br>
4773 Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
4774 (<code>IPP_TAG_INTEGER</code>).</p>
4775 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippAddOctetString">ippAddOctetString</a></h3>
4776 <p class="description">Add an octetString value to an IPP message.</p>
4777 <p class="code">
4778 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOctetString (<br>
4779 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4780 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
4781 &#160;&#160;&#160;&#160;const char *name,<br>
4782 &#160;&#160;&#160;&#160;const void *data,<br>
4783 &#160;&#160;&#160;&#160;int datalen<br>
4784 );</p>
4785 <h4 class="parameters">Parameters</h4>
4786 <dl>
4787 <dt>ipp</dt>
4788 <dd class="description">IPP message</dd>
4789 <dt>group</dt>
4790 <dd class="description">IPP group</dd>
4791 <dt>name</dt>
4792 <dd class="description">Name of attribute</dd>
4793 <dt>data</dt>
4794 <dd class="description">octetString data</dd>
4795 <dt>datalen</dt>
4796 <dd class="description">Length of data in bytes</dd>
4797 </dl>
4798 <h4 class="returnvalue">Return Value</h4>
4799 <p class="description">New attribute</p>
4800 <h4 class="discussion">Discussion</h4>
4801 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4802 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>
4803 <br>
4804 The <code>group</code> parameter specifies the IPP attribute group tag: none
4805 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4806 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4807 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4808 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
4809
4810 </p>
4811 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippAddOutOfBand">ippAddOutOfBand</a></h3>
4812 <p class="description">Add an out-of-band value to an IPP message.</p>
4813 <p class="code">
4814 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOutOfBand (<br>
4815 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4816 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
4817 &#160;&#160;&#160;&#160;ipp_tag_t value_tag,<br>
4818 &#160;&#160;&#160;&#160;const char *name<br>
4819 );</p>
4820 <h4 class="parameters">Parameters</h4>
4821 <dl>
4822 <dt>ipp</dt>
4823 <dd class="description">IPP message</dd>
4824 <dt>group</dt>
4825 <dd class="description">IPP group</dd>
4826 <dt>value_tag</dt>
4827 <dd class="description">Type of attribute</dd>
4828 <dt>name</dt>
4829 <dd class="description">Name of attribute</dd>
4830 </dl>
4831 <h4 class="returnvalue">Return Value</h4>
4832 <p class="description">New attribute</p>
4833 <h4 class="discussion">Discussion</h4>
4834 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4835 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>
4836 <br>
4837 The <code>group</code> parameter specifies the IPP attribute group tag: none
4838 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4839 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4840 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4841 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4842 <br>
4843 Supported out-of-band values include unsupported-value
4844 (<code>IPP_TAG_UNSUPPORTED_VALUE</code>), default (<code>IPP_TAG_DEFAULT</code>), unknown
4845 (<code>IPP_TAG_UNKNOWN</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable
4846 (<code>IPP_TAG_NOTSETTABLE</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), and
4847 admin-define (<code>IPP_TAG_ADMINDEFINE</code>).
4848
4849 </p>
4850 <h3 class="function"><a id="ippAddRange">ippAddRange</a></h3>
4851 <p class="description">Add a range of values to an IPP message.</p>
4852 <p class="code">
4853 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRange (<br>
4854 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4855 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
4856 &#160;&#160;&#160;&#160;const char *name,<br>
4857 &#160;&#160;&#160;&#160;int lower,<br>
4858 &#160;&#160;&#160;&#160;int upper<br>
4859 );</p>
4860 <h4 class="parameters">Parameters</h4>
4861 <dl>
4862 <dt>ipp</dt>
4863 <dd class="description">IPP message</dd>
4864 <dt>group</dt>
4865 <dd class="description">IPP group</dd>
4866 <dt>name</dt>
4867 <dd class="description">Name of attribute</dd>
4868 <dt>lower</dt>
4869 <dd class="description">Lower value</dd>
4870 <dt>upper</dt>
4871 <dd class="description">Upper value</dd>
4872 </dl>
4873 <h4 class="returnvalue">Return Value</h4>
4874 <p class="description">New attribute</p>
4875 <h4 class="discussion">Discussion</h4>
4876 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4877 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>
4878 <br>
4879 The <code>group</code> parameter specifies the IPP attribute group tag: none
4880 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4881 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4882 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4883 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4884 <br>
4885 The <code>lower</code> parameter must be less than or equal to the <code>upper</code> parameter.</p>
4886 <h3 class="function"><a id="ippAddRanges">ippAddRanges</a></h3>
4887 <p class="description">Add ranges of values to an IPP message.</p>
4888 <p class="code">
4889 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRanges (<br>
4890 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4891 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
4892 &#160;&#160;&#160;&#160;const char *name,<br>
4893 &#160;&#160;&#160;&#160;int num_values,<br>
4894 &#160;&#160;&#160;&#160;const int *lower,<br>
4895 &#160;&#160;&#160;&#160;const int *upper<br>
4896 );</p>
4897 <h4 class="parameters">Parameters</h4>
4898 <dl>
4899 <dt>ipp</dt>
4900 <dd class="description">IPP message</dd>
4901 <dt>group</dt>
4902 <dd class="description">IPP group</dd>
4903 <dt>name</dt>
4904 <dd class="description">Name of attribute</dd>
4905 <dt>num_values</dt>
4906 <dd class="description">Number of values</dd>
4907 <dt>lower</dt>
4908 <dd class="description">Lower values</dd>
4909 <dt>upper</dt>
4910 <dd class="description">Upper values</dd>
4911 </dl>
4912 <h4 class="returnvalue">Return Value</h4>
4913 <p class="description">New attribute</p>
4914 <h4 class="discussion">Discussion</h4>
4915 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4916 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>
4917 <br>
4918 The <code>group</code> parameter specifies the IPP attribute group tag: none
4919 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4920 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4921 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4922 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4923 <h3 class="function"><a id="ippAddResolution">ippAddResolution</a></h3>
4924 <p class="description">Add a resolution value to an IPP message.</p>
4925 <p class="code">
4926 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolution (<br>
4927 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4928 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
4929 &#160;&#160;&#160;&#160;const char *name,<br>
4930 &#160;&#160;&#160;&#160;<a href="#ipp_res_t">ipp_res_t</a> units,<br>
4931 &#160;&#160;&#160;&#160;int xres,<br>
4932 &#160;&#160;&#160;&#160;int yres<br>
4933 );</p>
4934 <h4 class="parameters">Parameters</h4>
4935 <dl>
4936 <dt>ipp</dt>
4937 <dd class="description">IPP message</dd>
4938 <dt>group</dt>
4939 <dd class="description">IPP group</dd>
4940 <dt>name</dt>
4941 <dd class="description">Name of attribute</dd>
4942 <dt>units</dt>
4943 <dd class="description">Units for resolution</dd>
4944 <dt>xres</dt>
4945 <dd class="description">X resolution</dd>
4946 <dt>yres</dt>
4947 <dd class="description">Y resolution</dd>
4948 </dl>
4949 <h4 class="returnvalue">Return Value</h4>
4950 <p class="description">New attribute</p>
4951 <h4 class="discussion">Discussion</h4>
4952 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4953 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>
4954 <br>
4955 The <code>group</code> parameter specifies the IPP attribute group tag: none
4956 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4957 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4958 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4959 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4960 <h3 class="function"><a id="ippAddResolutions">ippAddResolutions</a></h3>
4961 <p class="description">Add resolution values to an IPP message.</p>
4962 <p class="code">
4963 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolutions (<br>
4964 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4965 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
4966 &#160;&#160;&#160;&#160;const char *name,<br>
4967 &#160;&#160;&#160;&#160;int num_values,<br>
4968 &#160;&#160;&#160;&#160;<a href="#ipp_res_t">ipp_res_t</a> units,<br>
4969 &#160;&#160;&#160;&#160;const int *xres,<br>
4970 &#160;&#160;&#160;&#160;const int *yres<br>
4971 );</p>
4972 <h4 class="parameters">Parameters</h4>
4973 <dl>
4974 <dt>ipp</dt>
4975 <dd class="description">IPP message</dd>
4976 <dt>group</dt>
4977 <dd class="description">IPP group</dd>
4978 <dt>name</dt>
4979 <dd class="description">Name of attribute</dd>
4980 <dt>num_values</dt>
4981 <dd class="description">Number of values</dd>
4982 <dt>units</dt>
4983 <dd class="description">Units for resolution</dd>
4984 <dt>xres</dt>
4985 <dd class="description">X resolutions</dd>
4986 <dt>yres</dt>
4987 <dd class="description">Y resolutions</dd>
4988 </dl>
4989 <h4 class="returnvalue">Return Value</h4>
4990 <p class="description">New attribute</p>
4991 <h4 class="discussion">Discussion</h4>
4992 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4993 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>
4994 <br>
4995 The <code>group</code> parameter specifies the IPP attribute group tag: none
4996 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4997 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4998 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4999 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
5000 <h3 class="function"><a id="ippAddSeparator">ippAddSeparator</a></h3>
5001 <p class="description">Add a group separator to an IPP message.</p>
5002 <p class="code">
5003 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddSeparator (<br>
5004 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
5005 );</p>
5006 <h4 class="parameters">Parameters</h4>
5007 <dl>
5008 <dt>ipp</dt>
5009 <dd class="description">IPP message</dd>
5010 </dl>
5011 <h4 class="returnvalue">Return Value</h4>
5012 <p class="description">New attribute</p>
5013 <h4 class="discussion">Discussion</h4>
5014 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5015 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>
5016 <h3 class="function"><a id="ippAddString">ippAddString</a></h3>
5017 <p class="description">Add a language-encoded string to an IPP message.</p>
5018 <p class="code">
5019 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddString (<br>
5020 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5021 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
5022 &#160;&#160;&#160;&#160;ipp_tag_t value_tag,<br>
5023 &#160;&#160;&#160;&#160;const char *name,<br>
5024 &#160;&#160;&#160;&#160;const char *language,<br>
5025 &#160;&#160;&#160;&#160;const char *value<br>
5026 );</p>
5027 <h4 class="parameters">Parameters</h4>
5028 <dl>
5029 <dt>ipp</dt>
5030 <dd class="description">IPP message</dd>
5031 <dt>group</dt>
5032 <dd class="description">IPP group</dd>
5033 <dt>value_tag</dt>
5034 <dd class="description">Type of attribute</dd>
5035 <dt>name</dt>
5036 <dd class="description">Name of attribute</dd>
5037 <dt>language</dt>
5038 <dd class="description">Language code</dd>
5039 <dt>value</dt>
5040 <dd class="description">Value</dd>
5041 </dl>
5042 <h4 class="returnvalue">Return Value</h4>
5043 <p class="description">New attribute</p>
5044 <h4 class="discussion">Discussion</h4>
5045 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5046 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>
5047 <br>
5048 The <code>group</code> parameter specifies the IPP attribute group tag: none
5049 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
5050 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
5051 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
5052 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
5053 <br>
5054 Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
5055 (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
5056 (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
5057 (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
5058 (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
5059 (<code>IPP_TAG_URISCHEME</code>).<br>
5060 <br>
5061 The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
5062 textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
5063 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippAddStringf">ippAddStringf</a></h3>
5064 <p class="description">Add a formatted string to an IPP message.</p>
5065 <p class="code">
5066 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStringf (<br>
5067 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5068 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
5069 &#160;&#160;&#160;&#160;ipp_tag_t value_tag,<br>
5070 &#160;&#160;&#160;&#160;const char *name,<br>
5071 &#160;&#160;&#160;&#160;const char *language,<br>
5072 &#160;&#160;&#160;&#160;const char *format,<br>
5073 &#160;&#160;&#160;&#160;...<br>
5074 );</p>
5075 <h4 class="parameters">Parameters</h4>
5076 <dl>
5077 <dt>ipp</dt>
5078 <dd class="description">IPP message</dd>
5079 <dt>group</dt>
5080 <dd class="description">IPP group</dd>
5081 <dt>value_tag</dt>
5082 <dd class="description">Type of attribute</dd>
5083 <dt>name</dt>
5084 <dd class="description">Name of attribute</dd>
5085 <dt>language</dt>
5086 <dd class="description">Language code (<code>NULL</code> for default)</dd>
5087 <dt>format</dt>
5088 <dd class="description">Printf-style format string</dd>
5089 <dt>...</dt>
5090 <dd class="description">Additional arguments as needed</dd>
5091 </dl>
5092 <h4 class="returnvalue">Return Value</h4>
5093 <p class="description">New attribute</p>
5094 <h4 class="discussion">Discussion</h4>
5095 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5096 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>
5097 <br>
5098 The <code>group</code> parameter specifies the IPP attribute group tag: none
5099 (<code>IPP_TAG_ZERO</code>, for member attributes), document
5100 (<code>IPP_TAG_DOCUMENT</code>), event notification
5101 (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
5102 printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
5103 or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
5104 <br>
5105 Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
5106 (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
5107 (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
5108 (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
5109 (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
5110 (<code>IPP_TAG_URISCHEME</code>).<br>
5111 <br>
5112 The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
5113 and textWithLanguage string values and must be <code>NULL</code> for all other
5114 string values.<br>
5115 <br>
5116 The <code>format</code> parameter uses formatting characters compatible with the
5117 printf family of standard functions. Additional arguments follow it as
5118 needed. The formatted string is truncated as needed to the maximum length of
5119 the corresponding value type.
5120
5121 </p>
5122 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippAddStringfv">ippAddStringfv</a></h3>
5123 <p class="description">Add a formatted string to an IPP message.</p>
5124 <p class="code">
5125 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStringfv (<br>
5126 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5127 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
5128 &#160;&#160;&#160;&#160;ipp_tag_t value_tag,<br>
5129 &#160;&#160;&#160;&#160;const char *name,<br>
5130 &#160;&#160;&#160;&#160;const char *language,<br>
5131 &#160;&#160;&#160;&#160;const char *format,<br>
5132 &#160;&#160;&#160;&#160;va_list ap<br>
5133 );</p>
5134 <h4 class="parameters">Parameters</h4>
5135 <dl>
5136 <dt>ipp</dt>
5137 <dd class="description">IPP message</dd>
5138 <dt>group</dt>
5139 <dd class="description">IPP group</dd>
5140 <dt>value_tag</dt>
5141 <dd class="description">Type of attribute</dd>
5142 <dt>name</dt>
5143 <dd class="description">Name of attribute</dd>
5144 <dt>language</dt>
5145 <dd class="description">Language code (<code>NULL</code> for default)</dd>
5146 <dt>format</dt>
5147 <dd class="description">Printf-style format string</dd>
5148 <dt>ap</dt>
5149 <dd class="description">Additional arguments</dd>
5150 </dl>
5151 <h4 class="returnvalue">Return Value</h4>
5152 <p class="description">New attribute</p>
5153 <h4 class="discussion">Discussion</h4>
5154 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5155 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>
5156 <br>
5157 The <code>group</code> parameter specifies the IPP attribute group tag: none
5158 (<code>IPP_TAG_ZERO</code>, for member attributes), document
5159 (<code>IPP_TAG_DOCUMENT</code>), event notification
5160 (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
5161 printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
5162 or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
5163 <br>
5164 Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
5165 (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
5166 (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
5167 (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
5168 (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
5169 (<code>IPP_TAG_URISCHEME</code>).<br>
5170 <br>
5171 The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
5172 and textWithLanguage string values and must be <code>NULL</code> for all other
5173 string values.<br>
5174 <br>
5175 The <code>format</code> parameter uses formatting characters compatible with the
5176 printf family of standard functions. Additional arguments are passed in the
5177 stdarg pointer <code>ap</code>. The formatted string is truncated as needed to the
5178 maximum length of the corresponding value type.
5179
5180 </p>
5181 <h3 class="function"><a id="ippAddStrings">ippAddStrings</a></h3>
5182 <p class="description">Add language-encoded strings to an IPP message.</p>
5183 <p class="code">
5184 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStrings (<br>
5185 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5186 &#160;&#160;&#160;&#160;ipp_tag_t group,<br>
5187 &#160;&#160;&#160;&#160;ipp_tag_t value_tag,<br>
5188 &#160;&#160;&#160;&#160;const char *name,<br>
5189 &#160;&#160;&#160;&#160;int num_values,<br>
5190 &#160;&#160;&#160;&#160;const char *language,<br>
5191 &#160;&#160;&#160;&#160;const char *const *values<br>
5192 );</p>
5193 <h4 class="parameters">Parameters</h4>
5194 <dl>
5195 <dt>ipp</dt>
5196 <dd class="description">IPP message</dd>
5197 <dt>group</dt>
5198 <dd class="description">IPP group</dd>
5199 <dt>value_tag</dt>
5200 <dd class="description">Type of attribute</dd>
5201 <dt>name</dt>
5202 <dd class="description">Name of attribute</dd>
5203 <dt>num_values</dt>
5204 <dd class="description">Number of values</dd>
5205 <dt>language</dt>
5206 <dd class="description">Language code (<code>NULL</code> for default)</dd>
5207 <dt>values</dt>
5208 <dd class="description">Values</dd>
5209 </dl>
5210 <h4 class="returnvalue">Return Value</h4>
5211 <p class="description">New attribute</p>
5212 <h4 class="discussion">Discussion</h4>
5213 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5214 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>
5215 <br>
5216 The <code>group</code> parameter specifies the IPP attribute group tag: none
5217 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
5218 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
5219 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
5220 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
5221 <br>
5222 Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
5223 (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
5224 (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
5225 (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
5226 (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
5227 (<code>IPP_TAG_URISCHEME</code>).<br>
5228 <br>
5229 The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
5230 textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
5231 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippAttributeString">ippAttributeString</a></h3>
5232 <p class="description">Convert the attribute's value to a string.</p>
5233 <p class="code">
5234 size_t ippAttributeString (<br>
5235 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
5236 &#160;&#160;&#160;&#160;char *buffer,<br>
5237 &#160;&#160;&#160;&#160;size_t bufsize<br>
5238 );</p>
5239 <h4 class="parameters">Parameters</h4>
5240 <dl>
5241 <dt>attr</dt>
5242 <dd class="description">Attribute</dd>
5243 <dt>buffer</dt>
5244 <dd class="description">String buffer or NULL</dd>
5245 <dt>bufsize</dt>
5246 <dd class="description">Size of string buffer</dd>
5247 </dl>
5248 <h4 class="returnvalue">Return Value</h4>
5249 <p class="description">Number of bytes less nul</p>
5250 <h4 class="discussion">Discussion</h4>
5251 <p class="discussion">Returns the number of bytes that would be written, not including the
5252 trailing nul. The buffer pointer can be NULL to get the required length,
5253 just like (v)snprintf.
5254
5255 </p>
5256 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippContainsInteger">ippContainsInteger</a></h3>
5257 <p class="description">Determine whether an attribute contains the
5258 specified value or is within the list of ranges.</p>
5259 <p class="code">
5260 int ippContainsInteger (<br>
5261 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
5262 &#160;&#160;&#160;&#160;int value<br>
5263 );</p>
5264 <h4 class="parameters">Parameters</h4>
5265 <dl>
5266 <dt>attr</dt>
5267 <dd class="description">Attribute</dd>
5268 <dt>value</dt>
5269 <dd class="description">Integer/enum value</dd>
5270 </dl>
5271 <h4 class="returnvalue">Return Value</h4>
5272 <p class="description">1 on a match, 0 on no match</p>
5273 <h4 class="discussion">Discussion</h4>
5274 <p class="discussion">Returns non-zero when the attribute contains either a matching integer or
5275 enum value, or the value falls within one of the rangeOfInteger values for
5276 the attribute.
5277
5278 </p>
5279 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippContainsString">ippContainsString</a></h3>
5280 <p class="description">Determine whether an attribute contains the
5281 specified string value.</p>
5282 <p class="code">
5283 int ippContainsString (<br>
5284 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
5285 &#160;&#160;&#160;&#160;const char *value<br>
5286 );</p>
5287 <h4 class="parameters">Parameters</h4>
5288 <dl>
5289 <dt>attr</dt>
5290 <dd class="description">Attribute</dd>
5291 <dt>value</dt>
5292 <dd class="description">String value</dd>
5293 </dl>
5294 <h4 class="returnvalue">Return Value</h4>
5295 <p class="description">1 on a match, 0 on no match</p>
5296 <h4 class="discussion">Discussion</h4>
5297 <p class="discussion">Returns non-zero when the attribute contains a matching charset, keyword,
5298 language, mimeMediaType, name, text, URI, or URI scheme value.
5299
5300 </p>
5301 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippCopyAttribute">ippCopyAttribute</a></h3>
5302 <p class="description">Copy an attribute.</p>
5303 <p class="code">
5304 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippCopyAttribute (<br>
5305 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *dst,<br>
5306 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *srcattr,<br>
5307 &#160;&#160;&#160;&#160;int quickcopy<br>
5308 );</p>
5309 <h4 class="parameters">Parameters</h4>
5310 <dl>
5311 <dt>dst</dt>
5312 <dd class="description">Destination IPP message</dd>
5313 <dt>srcattr</dt>
5314 <dd class="description">Attribute to copy</dd>
5315 <dt>quickcopy</dt>
5316 <dd class="description">1 for a referenced copy, 0 for normal</dd>
5317 </dl>
5318 <h4 class="returnvalue">Return Value</h4>
5319 <p class="description">New attribute</p>
5320 <h4 class="discussion">Discussion</h4>
5321 <p class="discussion">The specified attribute, <code>attr</code>, is copied to the destination IPP message.
5322 When <code>quickcopy</code> is non-zero, a &quot;shallow&quot; reference copy of the attribute is
5323 created - this should only be done as long as the original source IPP message will
5324 not be freed for the life of the destination.
5325
5326 </p>
5327 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippCopyAttributes">ippCopyAttributes</a></h3>
5328 <p class="description">Copy attributes from one IPP message to another.</p>
5329 <p class="code">
5330 int ippCopyAttributes (<br>
5331 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *dst,<br>
5332 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *src,<br>
5333 &#160;&#160;&#160;&#160;int quickcopy,<br>
5334 &#160;&#160;&#160;&#160;<a href="#ipp_copycb_t">ipp_copycb_t</a> cb,<br>
5335 &#160;&#160;&#160;&#160;void *context<br>
5336 );</p>
5337 <h4 class="parameters">Parameters</h4>
5338 <dl>
5339 <dt>dst</dt>
5340 <dd class="description">Destination IPP message</dd>
5341 <dt>src</dt>
5342 <dd class="description">Source IPP message</dd>
5343 <dt>quickcopy</dt>
5344 <dd class="description">1 for a referenced copy, 0 for normal</dd>
5345 <dt>cb</dt>
5346 <dd class="description">Copy callback or <code>NULL</code> for none</dd>
5347 <dt>context</dt>
5348 <dd class="description">Context pointer</dd>
5349 </dl>
5350 <h4 class="returnvalue">Return Value</h4>
5351 <p class="description">1 on success, 0 on error</p>
5352 <h4 class="discussion">Discussion</h4>
5353 <p class="discussion">Zero or more attributes are copied from the source IPP message, <code>src</code>, to the
5354 destination IPP message, <code>dst</code>. When <code>quickcopy</code> is non-zero, a &quot;shallow&quot;
5355 reference copy of the attribute is created - this should only be done as long as the
5356 original source IPP message will not be freed for the life of the destination.<br>
5357 <br>
5358 The <code>cb</code> and <code>context</code> parameters provide a generic way to &quot;filter&quot; the
5359 attributes that are copied - the function must return 1 to copy the attribute or
5360 0 to skip it. The function may also choose to do a partial copy of the source attribute
5361 itself.
5362
5363 </p>
5364 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippCreateRequestedArray">ippCreateRequestedArray</a></h3>
5365 <p class="description">Create a CUPS array of attribute names from the
5366 given requested-attributes attribute.</p>
5367 <p class="code">
5368 cups_array_t *ippCreateRequestedArray (<br>
5369 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *request<br>
5370 );</p>
5371 <h4 class="parameters">Parameters</h4>
5372 <dl>
5373 <dt>request</dt>
5374 <dd class="description">IPP request</dd>
5375 </dl>
5376 <h4 class="returnvalue">Return Value</h4>
5377 <p class="description">CUPS array or <code>NULL</code> if all</p>
5378 <h4 class="discussion">Discussion</h4>
5379 <p class="discussion">This function creates a (sorted) CUPS array of attribute names matching the
5380 list of &quot;requested-attribute&quot; values supplied in an IPP request. All IANA-
5381 registered values are supported in addition to the CUPS IPP extension
5382 attributes.<br>
5383 <br>
5384 The <code>request</code> parameter specifies the request message that was read from
5385 the client.
5386
5387 <code>NULL</code> is returned if all attributes should be returned. Otherwise, the
5388 result is a sorted array of attribute names, where <code>cupsArrayFind(array,
5389 "attribute-name")</code> will return a non-NULL pointer. The array must be freed
5390 using the <code>cupsArrayDelete</code> function.
5391
5392 </p>
5393 <h3 class="function"><a id="ippDateToTime">ippDateToTime</a></h3>
5394 <p class="description">Convert from RFC 1903 Date/Time format to UNIX time
5395 in seconds.</p>
5396 <p class="code">
5397 time_t ippDateToTime (<br>
5398 &#160;&#160;&#160;&#160;const <a href="#ipp_uchar_t">ipp_uchar_t</a> *date<br>
5399 );</p>
5400 <h4 class="parameters">Parameters</h4>
5401 <dl>
5402 <dt>date</dt>
5403 <dd class="description">RFC 1903 date info</dd>
5404 </dl>
5405 <h4 class="returnvalue">Return Value</h4>
5406 <p class="description">UNIX time value</p>
5407 <h3 class="function"><a id="ippDelete">ippDelete</a></h3>
5408 <p class="description">RFC-1903 date/time format is:</p>
5409 <p class="code">
5410 void ippDelete (<br>
5411 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
5412 );</p>
5413 <h4 class="parameters">Parameters</h4>
5414 <dl>
5415 <dt>ipp</dt>
5416 <dd class="description">IPP message</dd>
5417 </dl>
5418 <h4 class="returnvalue">Return Value</h4>
5419 <p class="description">Delete an IPP message.</p>
5420 <h4 class="discussion">Discussion</h4>
5421 <p class="discussion">Byte(s) Description
5422 ------- -----------
5423 0-1 Year (0 to 65535)
5424 2 Month (1 to 12)
5425 3 Day (1 to 31)
5426 4 Hours (0 to 23)
5427 5 Minutes (0 to 59)
5428 6 Seconds (0 to 60, 60 = &quot;leap second&quot;)
5429 7 Deciseconds (0 to 9)
5430 8 +/- UTC
5431 9 UTC hours (0 to 11)
5432 10 UTC minutes (0 to 59)</p>
5433 <h3 class="function"><a id="ippDeleteAttribute">ippDeleteAttribute</a></h3>
5434 <p class="description">Next attribute</p>
5435 <p class="code">
5436 void ippDeleteAttribute (<br>
5437 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5438 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
5439 );</p>
5440 <h4 class="parameters">Parameters</h4>
5441 <dl>
5442 <dt>ipp</dt>
5443 <dd class="description">IPP message</dd>
5444 <dt>attr</dt>
5445 <dd class="description">Attribute to delete</dd>
5446 </dl>
5447 <h4 class="returnvalue">Return Value</h4>
5448 <p class="description">Delete a single attribute in an IPP message.</p>
5449 <p class="discussion"></p>
5450 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippDeleteValues">ippDeleteValues</a></h3>
5451 <p class="description">Delete values in an attribute.</p>
5452 <p class="code">
5453 int ippDeleteValues (<br>
5454 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5455 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
5456 &#160;&#160;&#160;&#160;int element,<br>
5457 &#160;&#160;&#160;&#160;int count<br>
5458 );</p>
5459 <h4 class="parameters">Parameters</h4>
5460 <dl>
5461 <dt>ipp</dt>
5462 <dd class="description">IPP message</dd>
5463 <dt>attr</dt>
5464 <dd class="description">Attribute</dd>
5465 <dt>element</dt>
5466 <dd class="description">Index of first value to delete (0-based)</dd>
5467 <dt>count</dt>
5468 <dd class="description">Number of values to delete</dd>
5469 </dl>
5470 <h4 class="returnvalue">Return Value</h4>
5471 <p class="description">1 on success, 0 on failure</p>
5472 <h4 class="discussion">Discussion</h4>
5473 <p class="discussion">The <code>element</code> parameter specifies the first value to delete, starting at
5474 0. It must be less than the number of values returned by <a href="#ippGetCount"><code>ippGetCount</code></a>.<br>
5475 <br>
5476 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5477 <br>
5478 Deleting all values in an attribute deletes the attribute.
5479
5480 </p>
5481 <h3 class="function"><a id="ippEnumString">ippEnumString</a></h3>
5482 <p class="description">Return a string corresponding to the enum value.</p>
5483 <p class="code">
5484 const char *ippEnumString (<br>
5485 &#160;&#160;&#160;&#160;const char *attrname,<br>
5486 &#160;&#160;&#160;&#160;int enumvalue<br>
5487 );</p>
5488 <h4 class="parameters">Parameters</h4>
5489 <dl>
5490 <dt>attrname</dt>
5491 <dd class="description">Attribute name</dd>
5492 <dt>enumvalue</dt>
5493 <dd class="description">Enum value</dd>
5494 </dl>
5495 <h4 class="returnvalue">Return Value</h4>
5496 <p class="description">Enum string</p>
5497 <h3 class="function"><a id="ippEnumValue">ippEnumValue</a></h3>
5498 <p class="description">Return the value associated with a given enum string.</p>
5499 <p class="code">
5500 int ippEnumValue (<br>
5501 &#160;&#160;&#160;&#160;const char *attrname,<br>
5502 &#160;&#160;&#160;&#160;const char *enumstring<br>
5503 );</p>
5504 <h4 class="parameters">Parameters</h4>
5505 <dl>
5506 <dt>attrname</dt>
5507 <dd class="description">Attribute name</dd>
5508 <dt>enumstring</dt>
5509 <dd class="description">Enum string</dd>
5510 </dl>
5511 <h4 class="returnvalue">Return Value</h4>
5512 <p class="description">Enum value or -1 if unknown</p>
5513 <h3 class="function"><a id="ippErrorString">ippErrorString</a></h3>
5514 <p class="description">Return a name for the given status code.</p>
5515 <p class="code">
5516 const char *ippErrorString (<br>
5517 &#160;&#160;&#160;&#160;ipp_status_t error<br>
5518 );</p>
5519 <h4 class="parameters">Parameters</h4>
5520 <dl>
5521 <dt>error</dt>
5522 <dd class="description">Error status</dd>
5523 </dl>
5524 <h4 class="returnvalue">Return Value</h4>
5525 <p class="description">Text string</p>
5526 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippErrorValue">ippErrorValue</a></h3>
5527 <p class="description">Return a status code for the given name.</p>
5528 <p class="code">
5529 ipp_status_t ippErrorValue (<br>
5530 &#160;&#160;&#160;&#160;const char *name<br>
5531 );</p>
5532 <h4 class="parameters">Parameters</h4>
5533 <dl>
5534 <dt>name</dt>
5535 <dd class="description">Name</dd>
5536 </dl>
5537 <h4 class="returnvalue">Return Value</h4>
5538 <p class="description">IPP status code</p>
5539 <h3 class="function"><a id="ippFindAttribute">ippFindAttribute</a></h3>
5540 <p class="description">Find a named attribute in a request.</p>
5541 <p class="code">
5542 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindAttribute (<br>
5543 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5544 &#160;&#160;&#160;&#160;const char *name,<br>
5545 &#160;&#160;&#160;&#160;ipp_tag_t type<br>
5546 );</p>
5547 <h4 class="parameters">Parameters</h4>
5548 <dl>
5549 <dt>ipp</dt>
5550 <dd class="description">IPP message</dd>
5551 <dt>name</dt>
5552 <dd class="description">Name of attribute</dd>
5553 <dt>type</dt>
5554 <dd class="description">Type of attribute</dd>
5555 </dl>
5556 <h4 class="returnvalue">Return Value</h4>
5557 <p class="description">Matching attribute</p>
5558 <h4 class="discussion">Discussion</h4>
5559 <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
5560 of attribute and member names separated by slashes, for example
5561 &quot;media-col/media-size&quot;.</p>
5562 <h3 class="function"><a id="ippFindNextAttribute">ippFindNextAttribute</a></h3>
5563 <p class="description">Find the next named attribute in a request.</p>
5564 <p class="code">
5565 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindNextAttribute (<br>
5566 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5567 &#160;&#160;&#160;&#160;const char *name,<br>
5568 &#160;&#160;&#160;&#160;ipp_tag_t type<br>
5569 );</p>
5570 <h4 class="parameters">Parameters</h4>
5571 <dl>
5572 <dt>ipp</dt>
5573 <dd class="description">IPP message</dd>
5574 <dt>name</dt>
5575 <dd class="description">Name of attribute</dd>
5576 <dt>type</dt>
5577 <dd class="description">Type of attribute</dd>
5578 </dl>
5579 <h4 class="returnvalue">Return Value</h4>
5580 <p class="description">Matching attribute</p>
5581 <h4 class="discussion">Discussion</h4>
5582 <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
5583 of attribute and member names separated by slashes, for example
5584 &quot;media-col/media-size&quot;.</p>
5585 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippFirstAttribute">ippFirstAttribute</a></h3>
5586 <p class="description">Return the first attribute in the message.</p>
5587 <p class="code">
5588 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFirstAttribute (<br>
5589 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
5590 );</p>
5591 <h4 class="parameters">Parameters</h4>
5592 <dl>
5593 <dt>ipp</dt>
5594 <dd class="description">IPP message</dd>
5595 </dl>
5596 <h4 class="returnvalue">Return Value</h4>
5597 <p class="description">First attribute or <code>NULL</code> if none</p>
5598 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetBoolean">ippGetBoolean</a></h3>
5599 <p class="description">Get a boolean value for an attribute.</p>
5600 <p class="code">
5601 int ippGetBoolean (<br>
5602 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
5603 &#160;&#160;&#160;&#160;int element<br>
5604 );</p>
5605 <h4 class="parameters">Parameters</h4>
5606 <dl>
5607 <dt>attr</dt>
5608 <dd class="description">IPP attribute</dd>
5609 <dt>element</dt>
5610 <dd class="description">Value number (0-based)</dd>
5611 </dl>
5612 <h4 class="returnvalue">Return Value</h4>
5613 <p class="description">Boolean value or 0 on error</p>
5614 <h4 class="discussion">Discussion</h4>
5615 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
5616 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
5617
5618 </p>
5619 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetCollection">ippGetCollection</a></h3>
5620 <p class="description">Get a collection value for an attribute.</p>
5621 <p class="code">
5622 <a href="#ipp_t">ipp_t</a> *ippGetCollection (<br>
5623 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
5624 &#160;&#160;&#160;&#160;int element<br>
5625 );</p>
5626 <h4 class="parameters">Parameters</h4>
5627 <dl>
5628 <dt>attr</dt>
5629 <dd class="description">IPP attribute</dd>
5630 <dt>element</dt>
5631 <dd class="description">Value number (0-based)</dd>
5632 </dl>
5633 <h4 class="returnvalue">Return Value</h4>
5634 <p class="description">Collection value or <code>NULL</code> on error</p>
5635 <h4 class="discussion">Discussion</h4>
5636 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
5637 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
5638
5639 </p>
5640 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetCount">ippGetCount</a></h3>
5641 <p class="description">Get the number of values in an attribute.</p>
5642 <p class="code">
5643 int ippGetCount (<br>
5644 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
5645 );</p>
5646 <h4 class="parameters">Parameters</h4>
5647 <dl>
5648 <dt>attr</dt>
5649 <dd class="description">IPP attribute</dd>
5650 </dl>
5651 <h4 class="returnvalue">Return Value</h4>
5652 <p class="description">Number of values or 0 on error</p>
5653 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetDate">ippGetDate</a></h3>
5654 <p class="description">Get a date value for an attribute.</p>
5655 <p class="code">
5656 const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippGetDate (<br>
5657 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
5658 &#160;&#160;&#160;&#160;int element<br>
5659 );</p>
5660 <h4 class="parameters">Parameters</h4>
5661 <dl>
5662 <dt>attr</dt>
5663 <dd class="description">IPP attribute</dd>
5664 <dt>element</dt>
5665 <dd class="description">Value number (0-based)</dd>
5666 </dl>
5667 <h4 class="returnvalue">Return Value</h4>
5668 <p class="description">Date value or <code>NULL</code></p>
5669 <h4 class="discussion">Discussion</h4>
5670 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
5671 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
5672
5673 </p>
5674 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetGroupTag">ippGetGroupTag</a></h3>
5675 <p class="description">Get the group associated with an attribute.</p>
5676 <p class="code">
5677 ipp_tag_t ippGetGroupTag (<br>
5678 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
5679 );</p>
5680 <h4 class="parameters">Parameters</h4>
5681 <dl>
5682 <dt>attr</dt>
5683 <dd class="description">IPP attribute</dd>
5684 </dl>
5685 <h4 class="returnvalue">Return Value</h4>
5686 <p class="description">Group tag or <code>IPP_TAG_ZERO</code> on error</p>
5687 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetInteger">ippGetInteger</a></h3>
5688 <p class="description">Get the integer/enum value for an attribute.</p>
5689 <p class="code">
5690 int ippGetInteger (<br>
5691 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
5692 &#160;&#160;&#160;&#160;int element<br>
5693 );</p>
5694 <h4 class="parameters">Parameters</h4>
5695 <dl>
5696 <dt>attr</dt>
5697 <dd class="description">IPP attribute</dd>
5698 <dt>element</dt>
5699 <dd class="description">Value number (0-based)</dd>
5700 </dl>
5701 <h4 class="returnvalue">Return Value</h4>
5702 <p class="description">Value or 0 on error</p>
5703 <h4 class="discussion">Discussion</h4>
5704 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
5705 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
5706
5707 </p>
5708 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetName">ippGetName</a></h3>
5709 <p class="description">Get the attribute name.</p>
5710 <p class="code">
5711 const char *ippGetName (<br>
5712 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
5713 );</p>
5714 <h4 class="parameters">Parameters</h4>
5715 <dl>
5716 <dt>attr</dt>
5717 <dd class="description">IPP attribute</dd>
5718 </dl>
5719 <h4 class="returnvalue">Return Value</h4>
5720 <p class="description">Attribute name or <code>NULL</code> for separators</p>
5721 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippGetOctetString">ippGetOctetString</a></h3>
5722 <p class="description">Get an octetString value from an IPP attribute.</p>
5723 <p class="code">
5724 void *ippGetOctetString (<br>
5725 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
5726 &#160;&#160;&#160;&#160;int element,<br>
5727 &#160;&#160;&#160;&#160;int *datalen<br>
5728 );</p>
5729 <h4 class="parameters">Parameters</h4>
5730 <dl>
5731 <dt>attr</dt>
5732 <dd class="description">IPP attribute</dd>
5733 <dt>element</dt>
5734 <dd class="description">Value number (0-based)</dd>
5735 <dt>datalen</dt>
5736 <dd class="description">Length of octetString data</dd>
5737 </dl>
5738 <h4 class="returnvalue">Return Value</h4>
5739 <p class="description">Pointer to octetString data</p>
5740 <h4 class="discussion">Discussion</h4>
5741 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
5742 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
5743
5744 </p>
5745 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetOperation">ippGetOperation</a></h3>
5746 <p class="description">Get the operation ID in an IPP message.</p>
5747 <p class="code">
5748 ipp_op_t ippGetOperation (<br>
5749 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
5750 );</p>
5751 <h4 class="parameters">Parameters</h4>
5752 <dl>
5753 <dt>ipp</dt>
5754 <dd class="description">IPP request message</dd>
5755 </dl>
5756 <h4 class="returnvalue">Return Value</h4>
5757 <p class="description">Operation ID or 0 on error</p>
5758 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetRange">ippGetRange</a></h3>
5759 <p class="description">Get a rangeOfInteger value from an attribute.</p>
5760 <p class="code">
5761 int ippGetRange (<br>
5762 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
5763 &#160;&#160;&#160;&#160;int element,<br>
5764 &#160;&#160;&#160;&#160;int *uppervalue<br>
5765 );</p>
5766 <h4 class="parameters">Parameters</h4>
5767 <dl>
5768 <dt>attr</dt>
5769 <dd class="description">IPP attribute</dd>
5770 <dt>element</dt>
5771 <dd class="description">Value number (0-based)</dd>
5772 <dt>uppervalue</dt>
5773 <dd class="description">Upper value of range</dd>
5774 </dl>
5775 <h4 class="returnvalue">Return Value</h4>
5776 <p class="description">Lower value of range or 0</p>
5777 <h4 class="discussion">Discussion</h4>
5778 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
5779 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
5780
5781 </p>
5782 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetRequestId">ippGetRequestId</a></h3>
5783 <p class="description">Get the request ID from an IPP message.</p>
5784 <p class="code">
5785 int ippGetRequestId (<br>
5786 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
5787 );</p>
5788 <h4 class="parameters">Parameters</h4>
5789 <dl>
5790 <dt>ipp</dt>
5791 <dd class="description">IPP message</dd>
5792 </dl>
5793 <h4 class="returnvalue">Return Value</h4>
5794 <p class="description">Request ID or 0 on error</p>
5795 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetResolution">ippGetResolution</a></h3>
5796 <p class="description">Get a resolution value for an attribute.</p>
5797 <p class="code">
5798 int ippGetResolution (<br>
5799 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
5800 &#160;&#160;&#160;&#160;int element,<br>
5801 &#160;&#160;&#160;&#160;int *yres,<br>
5802 &#160;&#160;&#160;&#160;<a href="#ipp_res_t">ipp_res_t</a> *units<br>
5803 );</p>
5804 <h4 class="parameters">Parameters</h4>
5805 <dl>
5806 <dt>attr</dt>
5807 <dd class="description">IPP attribute</dd>
5808 <dt>element</dt>
5809 <dd class="description">Value number (0-based)</dd>
5810 <dt>yres</dt>
5811 <dd class="description">Vertical/feed resolution</dd>
5812 <dt>units</dt>
5813 <dd class="description">Units for resolution</dd>
5814 </dl>
5815 <h4 class="returnvalue">Return Value</h4>
5816 <p class="description">Horizontal/cross feed resolution or 0</p>
5817 <h4 class="discussion">Discussion</h4>
5818 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
5819 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
5820
5821 </p>
5822 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetState">ippGetState</a></h3>
5823 <p class="description">Get the IPP message state.</p>
5824 <p class="code">
5825 <a href="#ipp_state_t">ipp_state_t</a> ippGetState (<br>
5826 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
5827 );</p>
5828 <h4 class="parameters">Parameters</h4>
5829 <dl>
5830 <dt>ipp</dt>
5831 <dd class="description">IPP message</dd>
5832 </dl>
5833 <h4 class="returnvalue">Return Value</h4>
5834 <p class="description">IPP message state value</p>
5835 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetStatusCode">ippGetStatusCode</a></h3>
5836 <p class="description">Get the status code from an IPP response or event message.</p>
5837 <p class="code">
5838 ipp_status_t ippGetStatusCode (<br>
5839 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
5840 );</p>
5841 <h4 class="parameters">Parameters</h4>
5842 <dl>
5843 <dt>ipp</dt>
5844 <dd class="description">IPP response or event message</dd>
5845 </dl>
5846 <h4 class="returnvalue">Return Value</h4>
5847 <p class="description">Status code in IPP message</p>
5848 <h3 class="function"><a id="ippGetString">ippGetString</a></h3>
5849 <p class="description">Return the value...</p>
5850 <p class="code">
5851 const char *ippGetString (<br>
5852 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
5853 &#160;&#160;&#160;&#160;int element,<br>
5854 &#160;&#160;&#160;&#160;const char **language<br>
5855 );</p>
5856 <h4 class="parameters">Parameters</h4>
5857 <dl>
5858 <dt>attr</dt>
5859 <dd class="description">IPP attribute</dd>
5860 <dt>element</dt>
5861 <dd class="description">Value number (0-based)</dd>
5862 <dt>language</dt>
5863 <dd class="description">Language code (<code>NULL</code> for don't care)</dd>
5864 </dl>
5865 <h4 class="returnvalue">Return Value</h4>
5866 <p class="description">Get the string and optionally the language code for an attribute.</p>
5867 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
5868 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
5869
5870 </p>
5871 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetValueTag">ippGetValueTag</a></h3>
5872 <p class="description">Get the value tag for an attribute.</p>
5873 <p class="code">
5874 ipp_tag_t ippGetValueTag (<br>
5875 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
5876 );</p>
5877 <h4 class="parameters">Parameters</h4>
5878 <dl>
5879 <dt>attr</dt>
5880 <dd class="description">IPP attribute</dd>
5881 </dl>
5882 <h4 class="returnvalue">Return Value</h4>
5883 <p class="description">Value tag or <code>IPP_TAG_ZERO</code> on error</p>
5884 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetVersion">ippGetVersion</a></h3>
5885 <p class="description">Get the major and minor version number from an IPP message.</p>
5886 <p class="code">
5887 int ippGetVersion (<br>
5888 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5889 &#160;&#160;&#160;&#160;int *minor<br>
5890 );</p>
5891 <h4 class="parameters">Parameters</h4>
5892 <dl>
5893 <dt>ipp</dt>
5894 <dd class="description">IPP message</dd>
5895 <dt>minor</dt>
5896 <dd class="description">Minor version number or <code>NULL</code></dd>
5897 </dl>
5898 <h4 class="returnvalue">Return Value</h4>
5899 <p class="description">Major version number or 0 on error</p>
5900 <h3 class="function"><a id="ippLength">ippLength</a></h3>
5901 <p class="description">Compute the length of an IPP message.</p>
5902 <p class="code">
5903 size_t ippLength (<br>
5904 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
5905 );</p>
5906 <h4 class="parameters">Parameters</h4>
5907 <dl>
5908 <dt>ipp</dt>
5909 <dd class="description">IPP message</dd>
5910 </dl>
5911 <h4 class="returnvalue">Return Value</h4>
5912 <p class="description">Size of IPP message</p>
5913 <h3 class="function"><a id="ippNew">ippNew</a></h3>
5914 <p class="description">Allocate a new IPP message.</p>
5915 <p class="code">
5916 <a href="#ipp_t">ipp_t</a> *ippNew (void);</p>
5917 <h4 class="returnvalue">Return Value</h4>
5918 <p class="description">New IPP message</p>
5919 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippNewRequest">ippNewRequest</a></h3>
5920 <p class="description">Allocate a new IPP request message.</p>
5921 <p class="code">
5922 <a href="#ipp_t">ipp_t</a> *ippNewRequest (<br>
5923 &#160;&#160;&#160;&#160;ipp_op_t op<br>
5924 );</p>
5925 <h4 class="parameters">Parameters</h4>
5926 <dl>
5927 <dt>op</dt>
5928 <dd class="description">Operation code</dd>
5929 </dl>
5930 <h4 class="returnvalue">Return Value</h4>
5931 <p class="description">IPP request message</p>
5932 <h4 class="discussion">Discussion</h4>
5933 <p class="discussion">The new request message is initialized with the attributes-charset and
5934 attributes-natural-language attributes added. The
5935 attributes-natural-language value is derived from the current locale.
5936
5937 </p>
5938 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippNewResponse">ippNewResponse</a></h3>
5939 <p class="description">Allocate a new IPP response message.</p>
5940 <p class="code">
5941 <a href="#ipp_t">ipp_t</a> *ippNewResponse (<br>
5942 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *request<br>
5943 );</p>
5944 <h4 class="parameters">Parameters</h4>
5945 <dl>
5946 <dt>request</dt>
5947 <dd class="description">IPP request message</dd>
5948 </dl>
5949 <h4 class="returnvalue">Return Value</h4>
5950 <p class="description">IPP response message</p>
5951 <h4 class="discussion">Discussion</h4>
5952 <p class="discussion">The new response message is initialized with the same version-number,
5953 request-id, attributes-charset, and attributes-natural-language as the
5954 provided request message. If the attributes-charset or
5955 attributes-natural-language attributes are missing from the request,
5956 &quot;utf-8&quot; and a value derived from the current locale are substituted,
5957 respectively.
5958
5959 </p>
5960 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippNextAttribute">ippNextAttribute</a></h3>
5961 <p class="description">Return the next attribute in the message.</p>
5962 <p class="code">
5963 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippNextAttribute (<br>
5964 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
5965 );</p>
5966 <h4 class="parameters">Parameters</h4>
5967 <dl>
5968 <dt>ipp</dt>
5969 <dd class="description">IPP message</dd>
5970 </dl>
5971 <h4 class="returnvalue">Return Value</h4>
5972 <p class="description">Next attribute or <code>NULL</code> if none</p>
5973 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippOpString">ippOpString</a></h3>
5974 <p class="description">Return a name for the given operation id.</p>
5975 <p class="code">
5976 const char *ippOpString (<br>
5977 &#160;&#160;&#160;&#160;ipp_op_t op<br>
5978 );</p>
5979 <h4 class="parameters">Parameters</h4>
5980 <dl>
5981 <dt>op</dt>
5982 <dd class="description">Operation ID</dd>
5983 </dl>
5984 <h4 class="returnvalue">Return Value</h4>
5985 <p class="description">Name</p>
5986 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippOpValue">ippOpValue</a></h3>
5987 <p class="description">Return an operation id for the given name.</p>
5988 <p class="code">
5989 ipp_op_t ippOpValue (<br>
5990 &#160;&#160;&#160;&#160;const char *name<br>
5991 );</p>
5992 <h4 class="parameters">Parameters</h4>
5993 <dl>
5994 <dt>name</dt>
5995 <dd class="description">Textual name</dd>
5996 </dl>
5997 <h4 class="returnvalue">Return Value</h4>
5998 <p class="description">Operation ID</p>
5999 <h3 class="function"><a id="ippPort">ippPort</a></h3>
6000 <p class="description">Return the default IPP port number.</p>
6001 <p class="code">
6002 int ippPort (void);</p>
6003 <h4 class="returnvalue">Return Value</h4>
6004 <p class="description">Port number</p>
6005 <h3 class="function"><a id="ippRead">ippRead</a></h3>
6006 <p class="description">Read data for an IPP message from a HTTP connection.</p>
6007 <p class="code">
6008 <a href="#ipp_state_t">ipp_state_t</a> ippRead (<br>
6009 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
6010 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
6011 );</p>
6012 <h4 class="parameters">Parameters</h4>
6013 <dl>
6014 <dt>http</dt>
6015 <dd class="description">HTTP connection</dd>
6016 <dt>ipp</dt>
6017 <dd class="description">IPP data</dd>
6018 </dl>
6019 <h4 class="returnvalue">Return Value</h4>
6020 <p class="description">Current state</p>
6021 <h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippReadFile">ippReadFile</a></h3>
6022 <p class="description">Read data for an IPP message from a file.</p>
6023 <p class="code">
6024 <a href="#ipp_state_t">ipp_state_t</a> ippReadFile (<br>
6025 &#160;&#160;&#160;&#160;int fd,<br>
6026 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
6027 );</p>
6028 <h4 class="parameters">Parameters</h4>
6029 <dl>
6030 <dt>fd</dt>
6031 <dd class="description">HTTP data</dd>
6032 <dt>ipp</dt>
6033 <dd class="description">IPP data</dd>
6034 </dl>
6035 <h4 class="returnvalue">Return Value</h4>
6036 <p class="description">Current state</p>
6037 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippReadIO">ippReadIO</a></h3>
6038 <p class="description">Read data for an IPP message.</p>
6039 <p class="code">
6040 <a href="#ipp_state_t">ipp_state_t</a> ippReadIO (<br>
6041 &#160;&#160;&#160;&#160;void *src,<br>
6042 &#160;&#160;&#160;&#160;<a href="#ipp_iocb_t">ipp_iocb_t</a> cb,<br>
6043 &#160;&#160;&#160;&#160;int blocking,<br>
6044 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *parent,<br>
6045 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
6046 );</p>
6047 <h4 class="parameters">Parameters</h4>
6048 <dl>
6049 <dt>src</dt>
6050 <dd class="description">Data source</dd>
6051 <dt>cb</dt>
6052 <dd class="description">Read callback function</dd>
6053 <dt>blocking</dt>
6054 <dd class="description">Use blocking IO?</dd>
6055 <dt>parent</dt>
6056 <dd class="description">Parent request, if any</dd>
6057 <dt>ipp</dt>
6058 <dd class="description">IPP data</dd>
6059 </dl>
6060 <h4 class="returnvalue">Return Value</h4>
6061 <p class="description">Current state</p>
6062 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetBoolean">ippSetBoolean</a></h3>
6063 <p class="description">Set a boolean value in an attribute.</p>
6064 <p class="code">
6065 int ippSetBoolean (<br>
6066 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6067 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
6068 &#160;&#160;&#160;&#160;int element,<br>
6069 &#160;&#160;&#160;&#160;int boolvalue<br>
6070 );</p>
6071 <h4 class="parameters">Parameters</h4>
6072 <dl>
6073 <dt>ipp</dt>
6074 <dd class="description">IPP message</dd>
6075 <dt>attr</dt>
6076 <dd class="description">IPP attribute</dd>
6077 <dt>element</dt>
6078 <dd class="description">Value number (0-based)</dd>
6079 <dt>boolvalue</dt>
6080 <dd class="description">Boolean value</dd>
6081 </dl>
6082 <h4 class="returnvalue">Return Value</h4>
6083 <p class="description">1 on success, 0 on failure</p>
6084 <h4 class="discussion">Discussion</h4>
6085 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6086 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>
6087 <br>
6088 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
6089 <br>
6090 The <code>element</code> parameter specifies which value to set from 0 to
6091 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
6092
6093 </p>
6094 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetCollection">ippSetCollection</a></h3>
6095 <p class="description">Set a collection value in an attribute.</p>
6096 <p class="code">
6097 int ippSetCollection (<br>
6098 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6099 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
6100 &#160;&#160;&#160;&#160;int element,<br>
6101 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *colvalue<br>
6102 );</p>
6103 <h4 class="parameters">Parameters</h4>
6104 <dl>
6105 <dt>ipp</dt>
6106 <dd class="description">IPP message</dd>
6107 <dt>attr</dt>
6108 <dd class="description">IPP attribute</dd>
6109 <dt>element</dt>
6110 <dd class="description">Value number (0-based)</dd>
6111 <dt>colvalue</dt>
6112 <dd class="description">Collection value</dd>
6113 </dl>
6114 <h4 class="returnvalue">Return Value</h4>
6115 <p class="description">1 on success, 0 on failure</p>
6116 <h4 class="discussion">Discussion</h4>
6117 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6118 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>
6119 <br>
6120 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
6121 <br>
6122 The <code>element</code> parameter specifies which value to set from 0 to
6123 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
6124
6125 </p>
6126 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetDate">ippSetDate</a></h3>
6127 <p class="description">Set a date value in an attribute.</p>
6128 <p class="code">
6129 int ippSetDate (<br>
6130 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6131 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
6132 &#160;&#160;&#160;&#160;int element,<br>
6133 &#160;&#160;&#160;&#160;const <a href="#ipp_uchar_t">ipp_uchar_t</a> *datevalue<br>
6134 );</p>
6135 <h4 class="parameters">Parameters</h4>
6136 <dl>
6137 <dt>ipp</dt>
6138 <dd class="description">IPP message</dd>
6139 <dt>attr</dt>
6140 <dd class="description">IPP attribute</dd>
6141 <dt>element</dt>
6142 <dd class="description">Value number (0-based)</dd>
6143 <dt>datevalue</dt>
6144 <dd class="description">Date value</dd>
6145 </dl>
6146 <h4 class="returnvalue">Return Value</h4>
6147 <p class="description">1 on success, 0 on failure</p>
6148 <h4 class="discussion">Discussion</h4>
6149 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6150 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>
6151 <br>
6152 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
6153 <br>
6154 The <code>element</code> parameter specifies which value to set from 0 to
6155 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
6156
6157 </p>
6158 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetGroupTag">ippSetGroupTag</a></h3>
6159 <p class="description">Set the group tag of an attribute.</p>
6160 <p class="code">
6161 int ippSetGroupTag (<br>
6162 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6163 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
6164 &#160;&#160;&#160;&#160;ipp_tag_t group_tag<br>
6165 );</p>
6166 <h4 class="parameters">Parameters</h4>
6167 <dl>
6168 <dt>ipp</dt>
6169 <dd class="description">IPP message</dd>
6170 <dt>attr</dt>
6171 <dd class="description">Attribute</dd>
6172 <dt>group_tag</dt>
6173 <dd class="description">Group tag</dd>
6174 </dl>
6175 <h4 class="returnvalue">Return Value</h4>
6176 <p class="description">1 on success, 0 on failure</p>
6177 <h4 class="discussion">Discussion</h4>
6178 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6179 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>
6180 <br>
6181 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
6182 <br>
6183 The <code>group</code> parameter specifies the IPP attribute group tag: none
6184 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
6185 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
6186 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
6187 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
6188
6189 </p>
6190 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetInteger">ippSetInteger</a></h3>
6191 <p class="description">Set an integer or enum value in an attribute.</p>
6192 <p class="code">
6193 int ippSetInteger (<br>
6194 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6195 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
6196 &#160;&#160;&#160;&#160;int element,<br>
6197 &#160;&#160;&#160;&#160;int intvalue<br>
6198 );</p>
6199 <h4 class="parameters">Parameters</h4>
6200 <dl>
6201 <dt>ipp</dt>
6202 <dd class="description">IPP message</dd>
6203 <dt>attr</dt>
6204 <dd class="description">IPP attribute</dd>
6205 <dt>element</dt>
6206 <dd class="description">Value number (0-based)</dd>
6207 <dt>intvalue</dt>
6208 <dd class="description">Integer/enum value</dd>
6209 </dl>
6210 <h4 class="returnvalue">Return Value</h4>
6211 <p class="description">1 on success, 0 on failure</p>
6212 <h4 class="discussion">Discussion</h4>
6213 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6214 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>
6215 <br>
6216 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
6217 <br>
6218 The <code>element</code> parameter specifies which value to set from 0 to
6219 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
6220
6221 </p>
6222 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetName">ippSetName</a></h3>
6223 <p class="description">Set the name of an attribute.</p>
6224 <p class="code">
6225 int ippSetName (<br>
6226 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6227 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
6228 &#160;&#160;&#160;&#160;const char *name<br>
6229 );</p>
6230 <h4 class="parameters">Parameters</h4>
6231 <dl>
6232 <dt>ipp</dt>
6233 <dd class="description">IPP message</dd>
6234 <dt>attr</dt>
6235 <dd class="description">IPP attribute</dd>
6236 <dt>name</dt>
6237 <dd class="description">Attribute name</dd>
6238 </dl>
6239 <h4 class="returnvalue">Return Value</h4>
6240 <p class="description">1 on success, 0 on failure</p>
6241 <h4 class="discussion">Discussion</h4>
6242 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6243 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>
6244 <br>
6245 The <code>attr</code> parameter may be modified as a result of setting the value.
6246
6247 </p>
6248 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetOctetString">ippSetOctetString</a></h3>
6249 <p class="description">Set an octetString value in an IPP attribute.</p>
6250 <p class="code">
6251 int ippSetOctetString (<br>
6252 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6253 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
6254 &#160;&#160;&#160;&#160;int element,<br>
6255 &#160;&#160;&#160;&#160;const void *data,<br>
6256 &#160;&#160;&#160;&#160;int datalen<br>
6257 );</p>
6258 <h4 class="parameters">Parameters</h4>
6259 <dl>
6260 <dt>ipp</dt>
6261 <dd class="description">IPP message</dd>
6262 <dt>attr</dt>
6263 <dd class="description">IPP attribute</dd>
6264 <dt>element</dt>
6265 <dd class="description">Value number (0-based)</dd>
6266 <dt>data</dt>
6267 <dd class="description">Pointer to octetString data</dd>
6268 <dt>datalen</dt>
6269 <dd class="description">Length of octetString data</dd>
6270 </dl>
6271 <h4 class="returnvalue">Return Value</h4>
6272 <p class="description">1 on success, 0 on failure</p>
6273 <h4 class="discussion">Discussion</h4>
6274 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6275 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>
6276 <br>
6277 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
6278 <br>
6279 The <code>element</code> parameter specifies which value to set from 0 to
6280 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
6281
6282 </p>
6283 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetOperation">ippSetOperation</a></h3>
6284 <p class="description">Set the operation ID in an IPP request message.</p>
6285 <p class="code">
6286 int ippSetOperation (<br>
6287 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6288 &#160;&#160;&#160;&#160;ipp_op_t op<br>
6289 );</p>
6290 <h4 class="parameters">Parameters</h4>
6291 <dl>
6292 <dt>ipp</dt>
6293 <dd class="description">IPP request message</dd>
6294 <dt>op</dt>
6295 <dd class="description">Operation ID</dd>
6296 </dl>
6297 <h4 class="returnvalue">Return Value</h4>
6298 <p class="description">1 on success, 0 on failure</p>
6299 <h4 class="discussion">Discussion</h4>
6300 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6301 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
6302
6303 </p>
6304 <h3 class="function"><a id="ippSetPort">ippSetPort</a></h3>
6305 <p class="description">Pointer to library globals</p>
6306 <p class="code">
6307 void ippSetPort (<br>
6308 &#160;&#160;&#160;&#160;int p<br>
6309 );</p>
6310 <h4 class="parameters">Parameters</h4>
6311 <dl>
6312 <dt>p</dt>
6313 <dd class="description">Port number to use</dd>
6314 </dl>
6315 <h4 class="returnvalue">Return Value</h4>
6316 <p class="description">Set the default port number.</p>
6317 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetRange">ippSetRange</a></h3>
6318 <p class="description">Set a rangeOfInteger value in an attribute.</p>
6319 <p class="code">
6320 int ippSetRange (<br>
6321 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6322 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
6323 &#160;&#160;&#160;&#160;int element,<br>
6324 &#160;&#160;&#160;&#160;int lowervalue,<br>
6325 &#160;&#160;&#160;&#160;int uppervalue<br>
6326 );</p>
6327 <h4 class="parameters">Parameters</h4>
6328 <dl>
6329 <dt>ipp</dt>
6330 <dd class="description">IPP message</dd>
6331 <dt>attr</dt>
6332 <dd class="description">IPP attribute</dd>
6333 <dt>element</dt>
6334 <dd class="description">Value number (0-based)</dd>
6335 <dt>lowervalue</dt>
6336 <dd class="description">Lower bound for range</dd>
6337 <dt>uppervalue</dt>
6338 <dd class="description">Upper bound for range</dd>
6339 </dl>
6340 <h4 class="returnvalue">Return Value</h4>
6341 <p class="description">1 on success, 0 on failure</p>
6342 <h4 class="discussion">Discussion</h4>
6343 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6344 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>
6345 <br>
6346 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
6347 <br>
6348 The <code>element</code> parameter specifies which value to set from 0 to
6349 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
6350
6351 </p>
6352 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetRequestId">ippSetRequestId</a></h3>
6353 <p class="description">Set the request ID in an IPP message.</p>
6354 <p class="code">
6355 int ippSetRequestId (<br>
6356 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6357 &#160;&#160;&#160;&#160;int request_id<br>
6358 );</p>
6359 <h4 class="parameters">Parameters</h4>
6360 <dl>
6361 <dt>ipp</dt>
6362 <dd class="description">IPP message</dd>
6363 <dt>request_id</dt>
6364 <dd class="description">Request ID</dd>
6365 </dl>
6366 <h4 class="returnvalue">Return Value</h4>
6367 <p class="description">1 on success, 0 on failure</p>
6368 <h4 class="discussion">Discussion</h4>
6369 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6370 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>
6371 <br>
6372 The <code>request_id</code> parameter must be greater than 0.
6373
6374 </p>
6375 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetResolution">ippSetResolution</a></h3>
6376 <p class="description">Set a resolution value in an attribute.</p>
6377 <p class="code">
6378 int ippSetResolution (<br>
6379 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6380 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
6381 &#160;&#160;&#160;&#160;int element,<br>
6382 &#160;&#160;&#160;&#160;<a href="#ipp_res_t">ipp_res_t</a> unitsvalue,<br>
6383 &#160;&#160;&#160;&#160;int xresvalue,<br>
6384 &#160;&#160;&#160;&#160;int yresvalue<br>
6385 );</p>
6386 <h4 class="parameters">Parameters</h4>
6387 <dl>
6388 <dt>ipp</dt>
6389 <dd class="description">IPP message</dd>
6390 <dt>attr</dt>
6391 <dd class="description">IPP attribute</dd>
6392 <dt>element</dt>
6393 <dd class="description">Value number (0-based)</dd>
6394 <dt>unitsvalue</dt>
6395 <dd class="description">Resolution units</dd>
6396 <dt>xresvalue</dt>
6397 <dd class="description">Horizontal/cross feed resolution</dd>
6398 <dt>yresvalue</dt>
6399 <dd class="description">Vertical/feed resolution</dd>
6400 </dl>
6401 <h4 class="returnvalue">Return Value</h4>
6402 <p class="description">1 on success, 0 on failure</p>
6403 <h4 class="discussion">Discussion</h4>
6404 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6405 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>
6406 <br>
6407 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
6408 <br>
6409 The <code>element</code> parameter specifies which value to set from 0 to
6410 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
6411
6412 </p>
6413 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetState">ippSetState</a></h3>
6414 <p class="description">Set the current state of the IPP message.</p>
6415 <p class="code">
6416 int ippSetState (<br>
6417 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6418 &#160;&#160;&#160;&#160;<a href="#ipp_state_t">ipp_state_t</a> state<br>
6419 );</p>
6420 <h4 class="parameters">Parameters</h4>
6421 <dl>
6422 <dt>ipp</dt>
6423 <dd class="description">IPP message</dd>
6424 <dt>state</dt>
6425 <dd class="description">IPP state value</dd>
6426 </dl>
6427 <h4 class="returnvalue">Return Value</h4>
6428 <p class="description">1 on success, 0 on failure</p>
6429 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetStatusCode">ippSetStatusCode</a></h3>
6430 <p class="description">Set the status code in an IPP response or event message.</p>
6431 <p class="code">
6432 int ippSetStatusCode (<br>
6433 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6434 &#160;&#160;&#160;&#160;ipp_status_t status<br>
6435 );</p>
6436 <h4 class="parameters">Parameters</h4>
6437 <dl>
6438 <dt>ipp</dt>
6439 <dd class="description">IPP response or event message</dd>
6440 <dt>status</dt>
6441 <dd class="description">Status code</dd>
6442 </dl>
6443 <h4 class="returnvalue">Return Value</h4>
6444 <p class="description">1 on success, 0 on failure</p>
6445 <h4 class="discussion">Discussion</h4>
6446 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6447 the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
6448
6449 </p>
6450 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetString">ippSetString</a></h3>
6451 <p class="description">Set a string value in an attribute.</p>
6452 <p class="code">
6453 int ippSetString (<br>
6454 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6455 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
6456 &#160;&#160;&#160;&#160;int element,<br>
6457 &#160;&#160;&#160;&#160;const char *strvalue<br>
6458 );</p>
6459 <h4 class="parameters">Parameters</h4>
6460 <dl>
6461 <dt>ipp</dt>
6462 <dd class="description">IPP message</dd>
6463 <dt>attr</dt>
6464 <dd class="description">IPP attribute</dd>
6465 <dt>element</dt>
6466 <dd class="description">Value number (0-based)</dd>
6467 <dt>strvalue</dt>
6468 <dd class="description">String value</dd>
6469 </dl>
6470 <h4 class="returnvalue">Return Value</h4>
6471 <p class="description">1 on success, 0 on failure</p>
6472 <h4 class="discussion">Discussion</h4>
6473 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6474 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>
6475 <br>
6476 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
6477 <br>
6478 The <code>element</code> parameter specifies which value to set from 0 to
6479 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
6480
6481 </p>
6482 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetStringf">ippSetStringf</a></h3>
6483 <p class="description">Set a formatted string value of an attribute.</p>
6484 <p class="code">
6485 int ippSetStringf (<br>
6486 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6487 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
6488 &#160;&#160;&#160;&#160;int element,<br>
6489 &#160;&#160;&#160;&#160;const char *format,<br>
6490 &#160;&#160;&#160;&#160;...<br>
6491 );</p>
6492 <h4 class="parameters">Parameters</h4>
6493 <dl>
6494 <dt>ipp</dt>
6495 <dd class="description">IPP message</dd>
6496 <dt>attr</dt>
6497 <dd class="description">IPP attribute</dd>
6498 <dt>element</dt>
6499 <dd class="description">Value number (0-based)</dd>
6500 <dt>format</dt>
6501 <dd class="description">Printf-style format string</dd>
6502 <dt>...</dt>
6503 <dd class="description">Additional arguments as needed</dd>
6504 </dl>
6505 <h4 class="returnvalue">Return Value</h4>
6506 <p class="description">1 on success, 0 on failure</p>
6507 <h4 class="discussion">Discussion</h4>
6508 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6509 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>
6510 <br>
6511 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
6512 <br>
6513 The <code>element</code> parameter specifies which value to set from 0 to
6514 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.<br>
6515 <br>
6516 The <code>format</code> parameter uses formatting characters compatible with the
6517 printf family of standard functions. Additional arguments follow it as
6518 needed. The formatted string is truncated as needed to the maximum length of
6519 the corresponding value type.
6520
6521 </p>
6522 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetStringfv">ippSetStringfv</a></h3>
6523 <p class="description">Set a formatted string value of an attribute.</p>
6524 <p class="code">
6525 int ippSetStringfv (<br>
6526 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6527 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
6528 &#160;&#160;&#160;&#160;int element,<br>
6529 &#160;&#160;&#160;&#160;const char *format,<br>
6530 &#160;&#160;&#160;&#160;va_list ap<br>
6531 );</p>
6532 <h4 class="parameters">Parameters</h4>
6533 <dl>
6534 <dt>ipp</dt>
6535 <dd class="description">IPP message</dd>
6536 <dt>attr</dt>
6537 <dd class="description">IPP attribute</dd>
6538 <dt>element</dt>
6539 <dd class="description">Value number (0-based)</dd>
6540 <dt>format</dt>
6541 <dd class="description">Printf-style format string</dd>
6542 <dt>ap</dt>
6543 <dd class="description">Pointer to additional arguments</dd>
6544 </dl>
6545 <h4 class="returnvalue">Return Value</h4>
6546 <p class="description">1 on success, 0 on failure</p>
6547 <h4 class="discussion">Discussion</h4>
6548 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6549 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>
6550 <br>
6551 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
6552 <br>
6553 The <code>element</code> parameter specifies which value to set from 0 to
6554 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.<br>
6555 <br>
6556 The <code>format</code> parameter uses formatting characters compatible with the
6557 printf family of standard functions. Additional arguments follow it as
6558 needed. The formatted string is truncated as needed to the maximum length of
6559 the corresponding value type.
6560
6561 </p>
6562 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetValueTag">ippSetValueTag</a></h3>
6563 <p class="description">Set the value tag of an attribute.</p>
6564 <p class="code">
6565 int ippSetValueTag (<br>
6566 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6567 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
6568 &#160;&#160;&#160;&#160;ipp_tag_t value_tag<br>
6569 );</p>
6570 <h4 class="parameters">Parameters</h4>
6571 <dl>
6572 <dt>ipp</dt>
6573 <dd class="description">IPP message</dd>
6574 <dt>attr</dt>
6575 <dd class="description">IPP attribute</dd>
6576 <dt>value_tag</dt>
6577 <dd class="description">Value tag</dd>
6578 </dl>
6579 <h4 class="returnvalue">Return Value</h4>
6580 <p class="description">1 on success, 0 on failure</p>
6581 <h4 class="discussion">Discussion</h4>
6582 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6583 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>
6584 <br>
6585 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
6586 <br>
6587 Integer (<code>IPP_TAG_INTEGER</code>) values can be promoted to rangeOfInteger
6588 (<code>IPP_TAG_RANGE</code>) values, the various string tags can be promoted to name
6589 (<code>IPP_TAG_NAME</code>) or nameWithLanguage (<code>IPP_TAG_NAMELANG</code>) values, text
6590 (<code>IPP_TAG_TEXT</code>) values can be promoted to textWithLanguage
6591 (<code>IPP_TAG_TEXTLANG</code>) values, and all values can be demoted to the various
6592 out-of-band value tags such as no-value (<code>IPP_TAG_NOVALUE</code>). All other changes
6593 will be rejected.<br>
6594 <br>
6595 Promoting a string attribute to nameWithLanguage or textWithLanguage adds the language
6596 code in the &quot;attributes-natural-language&quot; attribute or, if not present, the language
6597 code for the current locale.
6598
6599 </p>
6600 <h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetVersion">ippSetVersion</a></h3>
6601 <p class="description">Set the version number in an IPP message.</p>
6602 <p class="code">
6603 int ippSetVersion (<br>
6604 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6605 &#160;&#160;&#160;&#160;int major,<br>
6606 &#160;&#160;&#160;&#160;int minor<br>
6607 );</p>
6608 <h4 class="parameters">Parameters</h4>
6609 <dl>
6610 <dt>ipp</dt>
6611 <dd class="description">IPP message</dd>
6612 <dt>major</dt>
6613 <dd class="description">Major version number (major.minor)</dd>
6614 <dt>minor</dt>
6615 <dd class="description">Minor version number (major.minor)</dd>
6616 </dl>
6617 <h4 class="returnvalue">Return Value</h4>
6618 <p class="description">1 on success, 0 on failure</p>
6619 <h4 class="discussion">Discussion</h4>
6620 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6621 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>
6622 <br>
6623 The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2.
6624
6625 </p>
6626 <h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="ippStateString">ippStateString</a></h3>
6627 <p class="description">Return the name corresponding to a state value.</p>
6628 <p class="code">
6629 const char *ippStateString (<br>
6630 &#160;&#160;&#160;&#160;<a href="#ipp_state_t">ipp_state_t</a> state<br>
6631 );</p>
6632 <h4 class="parameters">Parameters</h4>
6633 <dl>
6634 <dt>state</dt>
6635 <dd class="description">State value</dd>
6636 </dl>
6637 <h4 class="returnvalue">Return Value</h4>
6638 <p class="description">State name</p>
6639 <h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="ippTagString">ippTagString</a></h3>
6640 <p class="description">Return the tag name corresponding to a tag value.</p>
6641 <p class="code">
6642 const char *ippTagString (<br>
6643 &#160;&#160;&#160;&#160;ipp_tag_t tag<br>
6644 );</p>
6645 <h4 class="parameters">Parameters</h4>
6646 <dl>
6647 <dt>tag</dt>
6648 <dd class="description">Tag value</dd>
6649 </dl>
6650 <h4 class="returnvalue">Return Value</h4>
6651 <p class="description">Tag name</p>
6652 <h4 class="discussion">Discussion</h4>
6653 <p class="discussion">The returned names are defined in RFC 2911 and 3382.
6654
6655 </p>
6656 <h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="ippTagValue">ippTagValue</a></h3>
6657 <p class="description">Return the tag value corresponding to a tag name.</p>
6658 <p class="code">
6659 ipp_tag_t ippTagValue (<br>
6660 &#160;&#160;&#160;&#160;const char *name<br>
6661 );</p>
6662 <h4 class="parameters">Parameters</h4>
6663 <dl>
6664 <dt>name</dt>
6665 <dd class="description">Tag name</dd>
6666 </dl>
6667 <h4 class="returnvalue">Return Value</h4>
6668 <p class="description">Tag value</p>
6669 <h4 class="discussion">Discussion</h4>
6670 <p class="discussion">The tag names are defined in RFC 2911 and 3382.
6671
6672 </p>
6673 <h3 class="function"><a id="ippTimeToDate">ippTimeToDate</a></h3>
6674 <p class="description">Convert from UNIX time to RFC 1903 format.</p>
6675 <p class="code">
6676 const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippTimeToDate (<br>
6677 &#160;&#160;&#160;&#160;time_t t<br>
6678 );</p>
6679 <h4 class="parameters">Parameters</h4>
6680 <dl>
6681 <dt>t</dt>
6682 <dd class="description">UNIX time value</dd>
6683 </dl>
6684 <h4 class="returnvalue">Return Value</h4>
6685 <p class="description">RFC-1903 date/time data</p>
6686 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippValidateAttribute">ippValidateAttribute</a></h3>
6687 <p class="description">Validate the contents of an attribute.</p>
6688 <p class="code">
6689 int ippValidateAttribute (<br>
6690 &#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
6691 );</p>
6692 <h4 class="parameters">Parameters</h4>
6693 <dl>
6694 <dt>attr</dt>
6695 <dd class="description">Attribute</dd>
6696 </dl>
6697 <h4 class="returnvalue">Return Value</h4>
6698 <p class="description">1 if valid, 0 otherwise</p>
6699 <h4 class="discussion">Discussion</h4>
6700 <p class="discussion">This function validates the contents of an attribute based on the name and
6701 value tag. 1 is returned if the attribute is valid, 0 otherwise. On
6702 failure, cupsLastErrorString() is set to a human-readable message.
6703
6704 </p>
6705 <h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippValidateAttributes">ippValidateAttributes</a></h3>
6706 <p class="description">Validate all attributes in an IPP message.</p>
6707 <p class="code">
6708 int ippValidateAttributes (<br>
6709 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
6710 );</p>
6711 <h4 class="parameters">Parameters</h4>
6712 <dl>
6713 <dt>ipp</dt>
6714 <dd class="description">IPP message</dd>
6715 </dl>
6716 <h4 class="returnvalue">Return Value</h4>
6717 <p class="description">1 if valid, 0 otherwise</p>
6718 <h4 class="discussion">Discussion</h4>
6719 <p class="discussion">This function validates the contents of the IPP message, including each
6720 attribute. Like <a href="#ippValidateAttribute"><code>ippValidateAttribute</code></a>, cupsLastErrorString() is set
6721 to a human-readable message on failure.
6722
6723 </p>
6724 <h3 class="function"><a id="ippWrite">ippWrite</a></h3>
6725 <p class="description">Write data for an IPP message to a HTTP connection.</p>
6726 <p class="code">
6727 <a href="#ipp_state_t">ipp_state_t</a> ippWrite (<br>
6728 &#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
6729 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
6730 );</p>
6731 <h4 class="parameters">Parameters</h4>
6732 <dl>
6733 <dt>http</dt>
6734 <dd class="description">HTTP connection</dd>
6735 <dt>ipp</dt>
6736 <dd class="description">IPP data</dd>
6737 </dl>
6738 <h4 class="returnvalue">Return Value</h4>
6739 <p class="description">Current state</p>
6740 <h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippWriteFile">ippWriteFile</a></h3>
6741 <p class="description">Write data for an IPP message to a file.</p>
6742 <p class="code">
6743 <a href="#ipp_state_t">ipp_state_t</a> ippWriteFile (<br>
6744 &#160;&#160;&#160;&#160;int fd,<br>
6745 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
6746 );</p>
6747 <h4 class="parameters">Parameters</h4>
6748 <dl>
6749 <dt>fd</dt>
6750 <dd class="description">HTTP data</dd>
6751 <dt>ipp</dt>
6752 <dd class="description">IPP data</dd>
6753 </dl>
6754 <h4 class="returnvalue">Return Value</h4>
6755 <p class="description">Current state</p>
6756 <h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippWriteIO">ippWriteIO</a></h3>
6757 <p class="description">Write data for an IPP message.</p>
6758 <p class="code">
6759 <a href="#ipp_state_t">ipp_state_t</a> ippWriteIO (<br>
6760 &#160;&#160;&#160;&#160;void *dst,<br>
6761 &#160;&#160;&#160;&#160;<a href="#ipp_iocb_t">ipp_iocb_t</a> cb,<br>
6762 &#160;&#160;&#160;&#160;int blocking,<br>
6763 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *parent,<br>
6764 &#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
6765 );</p>
6766 <h4 class="parameters">Parameters</h4>
6767 <dl>
6768 <dt>dst</dt>
6769 <dd class="description">Destination</dd>
6770 <dt>cb</dt>
6771 <dd class="description">Write callback function</dd>
6772 <dt>blocking</dt>
6773 <dd class="description">Use blocking IO?</dd>
6774 <dt>parent</dt>
6775 <dd class="description">Parent IPP message</dd>
6776 <dt>ipp</dt>
6777 <dd class="description">IPP data</dd>
6778 </dl>
6779 <h4 class="returnvalue">Return Value</h4>
6780 <p class="description">Current state</p>
6781 <h2 class="title"><a id="TYPES">Data Types</a></h2>
6782 <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>
6783 <p class="description">Client credentials callback
6784 </p>
6785 <p class="code">
6786 typedef int(*)(http_t *http, void *tls, cups_array_t *distinguished_names, void *user_data)cups_client_cert_cb_t;
6787 </p>
6788 <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>
6789 <p class="description">Destination enumeration callback
6790 </p>
6791 <p class="code">
6792 typedef int(*)(void *user_data, unsigned flags, <a href="#cups_dest_t">cups_dest_t</a> *dest)cups_dest_cb_t;
6793 </p>
6794 <h3 class="typedef"><a id="cups_dest_t">cups_dest_t</a></h3>
6795 <p class="description">Destination</p>
6796 <p class="code">
6797 typedef struct <a href="#cups_dest_s">cups_dest_s</a> cups_dest_t;
6798 </p>
6799 <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>
6800 <p class="description">Destination capability and status
6801 information </p>
6802 <p class="code">
6803 typedef struct _cups_dinfo_s cups_dinfo_t;
6804 </p>
6805 <h3 class="typedef"><a id="cups_job_t">cups_job_t</a></h3>
6806 <p class="description">Job</p>
6807 <p class="code">
6808 typedef struct <a href="#cups_job_s">cups_job_s</a> cups_job_t;
6809 </p>
6810 <h3 class="typedef"><a id="cups_lang_t">cups_lang_t</a></h3>
6811 <p class="description">Language Cache Structure</p>
6812 <p class="code">
6813 typedef struct <a href="#cups_lang_s">cups_lang_s</a> cups_lang_t;
6814 </p>
6815 <h3 class="typedef"><a id="cups_option_t">cups_option_t</a></h3>
6816 <p class="description">Printer Options</p>
6817 <p class="code">
6818 typedef struct <a href="#cups_option_s">cups_option_s</a> cups_option_t;
6819 </p>
6820 <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>
6821 <p class="description">New password callback
6822 </p>
6823 <p class="code">
6824 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;
6825 </p>
6826 <h3 class="typedef"><a id="cups_ptype_t">cups_ptype_t</a></h3>
6827 <p class="description">Printer type/capability bits</p>
6828 <p class="code">
6829 typedef unsigned cups_ptype_t;
6830 </p>
6831 <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>
6832 <p class="description">Server credentials callback
6833 </p>
6834 <p class="code">
6835 typedef int(*)(http_t *http, void *tls, cups_array_t *certs, void *user_data)cups_server_cert_cb_t;
6836 </p>
6837 <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>
6838 <p class="description">Media Size </p>
6839 <p class="code">
6840 typedef struct <a href="#cups_size_s">cups_size_s</a> cups_size_t;
6841 </p>
6842 <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>
6843 <p class="description">Socket address union, which
6844 makes using IPv6 and other
6845 address types easier and
6846 more portable. </p>
6847 <p class="code">
6848 typedef union _http_addr_u / http_addr_t;
6849 </p>
6850 <h3 class="typedef"><a id="http_encoding_t">http_encoding_t</a></h3>
6851 <p class="description">HTTP transfer encoding values</p>
6852 <p class="code">
6853 typedef enum <a href="#http_encoding_e">http_encoding_e</a> http_encoding_t;
6854 </p>
6855 <h3 class="typedef"><a id="http_encryption_t">http_encryption_t</a></h3>
6856 <p class="description">HTTP encryption values</p>
6857 <p class="code">
6858 typedef enum <a href="#http_encryption_e">http_encryption_e</a> http_encryption_t;
6859 </p>
6860 <h3 class="typedef"><a id="http_field_t">http_field_t</a></h3>
6861 <p class="description">HTTP field names</p>
6862 <p class="code">
6863 typedef enum <a href="#http_field_e">http_field_e</a> http_field_t;
6864 </p>
6865 <h3 class="typedef"><a id="http_keepalive_t">http_keepalive_t</a></h3>
6866 <p class="description">HTTP keep-alive values</p>
6867 <p class="code">
6868 typedef enum <a href="#http_keepalive_e">http_keepalive_e</a> http_keepalive_t;
6869 </p>
6870 <h3 class="typedef"><a id="http_state_t">http_state_t</a></h3>
6871 <p class="description">HTTP state values; states
6872 are server-oriented...</p>
6873 <p class="code">
6874 typedef enum <a href="#http_state_e">http_state_e</a> http_state_t;
6875 </p>
6876 <h3 class="typedef"><a id="http_t">http_t</a></h3>
6877 <p class="description">HTTP connection type</p>
6878 <p class="code">
6879 typedef struct _http_s http_t;
6880 </p>
6881 <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>
6882 <p class="description">HTTP timeout callback </p>
6883 <p class="code">
6884 typedef int(*)(http_t *http, void *user_data)http_timeout_cb_t;
6885 </p>
6886 <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>
6887 <p class="description">Level of trust for credentials </p>
6888 <p class="code">
6889 typedef enum <a href="#http_trust_e">http_trust_e</a> http_trust_t;
6890 </p>
6891 <h3 class="typedef"><a id="http_uri_coding_t">http_uri_coding_t</a></h3>
6892 <p class="description">URI en/decode flags</p>
6893 <p class="code">
6894 typedef enum <a href="#http_uri_coding_e">http_uri_coding_e</a> http_uri_coding_t;
6895 </p>
6896 <h3 class="typedef"><a id="http_uri_status_t"><span class="info">&#160;CUPS 1.2&#160;</span>http_uri_status_t</a></h3>
6897 <p class="description">URI separation status </p>
6898 <p class="code">
6899 typedef enum <a href="#http_uri_status_e">http_uri_status_e</a> http_uri_status_t;
6900 </p>
6901 <h3 class="typedef"><a id="ipp_attribute_t">ipp_attribute_t</a></h3>
6902 <p class="description">IPP attribute</p>
6903 <p class="code">
6904 typedef struct _ipp_attribute_s ipp_attribute_t;
6905 </p>
6906 <h3 class="typedef"><a id="ipp_copycb_t">ipp_copycb_t</a></h3>
6907 <p class="description">The following structures are PRIVATE starting with CUPS 1.6/macOS 10.8.
6908 Please use the new accessor functions available in CUPS 1.6 and later, as
6909 these definitions will be moved to a private header file in a future release.</p>
6910 <p class="code">
6911 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;
6912 </p>
6913 <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>
6914 <p class="description">IPP IO Callback Function </p>
6915 <p class="code">
6916 typedef ssize_t(*)(void *context, <a href="#ipp_uchar_t">ipp_uchar_t</a> *buffer, size_t bytes) ipp_iocb_t;
6917 </p>
6918 <h3 class="typedef"><a id="ipp_orient_t">ipp_orient_t</a></h3>
6919 <p class="description">Orientation values</p>
6920 <p class="code">
6921 typedef enum <a href="#ipp_orient_e">ipp_orient_e</a> ipp_orient_t;
6922 </p>
6923 <h3 class="typedef"><a id="ipp_pstate_t">ipp_pstate_t</a></h3>
6924 <p class="description">Printer states</p>
6925 <p class="code">
6926 typedef enum <a href="#ipp_pstate_e">ipp_pstate_e</a> ipp_pstate_t;
6927 </p>
6928 <h3 class="typedef"><a id="ipp_quality_t">ipp_quality_t</a></h3>
6929 <p class="description">Qualities</p>
6930 <p class="code">
6931 typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t;
6932 </p>
6933 <h3 class="typedef"><a id="ipp_res_t">ipp_res_t</a></h3>
6934 <p class="description">Resolution units</p>
6935 <p class="code">
6936 typedef enum <a href="#ipp_res_e">ipp_res_e</a> ipp_res_t;
6937 </p>
6938 <h3 class="typedef"><a id="ipp_state_t">ipp_state_t</a></h3>
6939 <p class="description">IPP states</p>
6940 <p class="code">
6941 typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t;
6942 </p>
6943 <h3 class="typedef"><a id="ipp_t">ipp_t</a></h3>
6944 <p class="description">IPP request/response data</p>
6945 <p class="code">
6946 typedef struct _ipp_s ipp_t;
6947 </p>
6948 <h3 class="typedef"><a id="ipp_uchar_t">ipp_uchar_t</a></h3>
6949 <p class="description">Unsigned 8-bit integer/character</p>
6950 <p class="code">
6951 typedef unsigned char ipp_uchar_t;
6952 </p>
6953 <h2 class="title"><a id="STRUCTURES">Structures</a></h2>
6954 <h3 class="struct"><a id="cups_dest_s">cups_dest_s</a></h3>
6955 <p class="description">Destination</p>
6956 <p class="code">struct cups_dest_s {<br>
6957 &#160;&#160;&#160;&#160;char *name, *instance;<br>
6958 &#160;&#160;&#160;&#160;int is_default;<br>
6959 &#160;&#160;&#160;&#160;int num_options;<br>
6960 &#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options;<br>
6961 };</p>
6962 <h4 class="members">Members</h4>
6963 <dl>
6964 <dt>instance </dt>
6965 <dd class="description">Local instance name or NULL</dd>
6966 <dt>is_default </dt>
6967 <dd class="description">Is this printer the default?</dd>
6968 <dt>num_options </dt>
6969 <dd class="description">Number of options</dd>
6970 <dt>options </dt>
6971 <dd class="description">Options</dd>
6972 </dl>
6973 <h3 class="struct"><a id="cups_job_s">cups_job_s</a></h3>
6974 <p class="description">Job</p>
6975 <p class="code">struct cups_job_s {<br>
6976 &#160;&#160;&#160;&#160;time_t completed_time;<br>
6977 &#160;&#160;&#160;&#160;time_t creation_time;<br>
6978 &#160;&#160;&#160;&#160;char *dest;<br>
6979 &#160;&#160;&#160;&#160;char *format;<br>
6980 &#160;&#160;&#160;&#160;int id;<br>
6981 &#160;&#160;&#160;&#160;int priority;<br>
6982 &#160;&#160;&#160;&#160;time_t processing_time;<br>
6983 &#160;&#160;&#160;&#160;int size;<br>
6984 &#160;&#160;&#160;&#160;ipp_jstate_t state;<br>
6985 &#160;&#160;&#160;&#160;char *title;<br>
6986 &#160;&#160;&#160;&#160;char *user;<br>
6987 };</p>
6988 <h4 class="members">Members</h4>
6989 <dl>
6990 <dt>completed_time </dt>
6991 <dd class="description">Time the job was completed</dd>
6992 <dt>creation_time </dt>
6993 <dd class="description">Time the job was created</dd>
6994 <dt>dest </dt>
6995 <dd class="description">Printer or class name</dd>
6996 <dt>format </dt>
6997 <dd class="description">Document format</dd>
6998 <dt>id </dt>
6999 <dd class="description">The job ID</dd>
7000 <dt>priority </dt>
7001 <dd class="description">Priority (1-100)</dd>
7002 <dt>processing_time </dt>
7003 <dd class="description">Time the job was processed</dd>
7004 <dt>size </dt>
7005 <dd class="description">Size in kilobytes</dd>
7006 <dt>state </dt>
7007 <dd class="description">Job state</dd>
7008 <dt>title </dt>
7009 <dd class="description">Title/job name</dd>
7010 <dt>user </dt>
7011 <dd class="description">User that submitted the job</dd>
7012 </dl>
7013 <h3 class="struct"><a id="cups_lang_s">cups_lang_s</a></h3>
7014 <p class="description">Language Cache Structure</p>
7015 <p class="code">struct cups_lang_s {<br>
7016 &#160;&#160;&#160;&#160;<a href="#cups_encoding_t">cups_encoding_t</a> encoding;<br>
7017 &#160;&#160;&#160;&#160;char language[16];<br>
7018 &#160;&#160;&#160;&#160;struct <a href="#cups_lang_s">cups_lang_s</a> *next;<br>
7019 &#160;&#160;&#160;&#160;int used;<br>
7020 };</p>
7021 <h4 class="members">Members</h4>
7022 <dl>
7023 <dt>encoding </dt>
7024 <dd class="description">Text encoding</dd>
7025 <dt>language[16] </dt>
7026 <dd class="description">Language/locale name</dd>
7027 <dt>next </dt>
7028 <dd class="description">Next language in cache</dd>
7029 <dt>used </dt>
7030 <dd class="description">Number of times this entry has been used.</dd>
7031 </dl>
7032 <h3 class="struct"><a id="cups_option_s">cups_option_s</a></h3>
7033 <p class="description">Printer Options</p>
7034 <p class="code">struct cups_option_s {<br>
7035 &#160;&#160;&#160;&#160;char *name;<br>
7036 &#160;&#160;&#160;&#160;char *value;<br>
7037 };</p>
7038 <h4 class="members">Members</h4>
7039 <dl>
7040 <dt>name </dt>
7041 <dd class="description">Name of option</dd>
7042 <dt>value </dt>
7043 <dd class="description">Value of option</dd>
7044 </dl>
7045 <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>
7046 <p class="description">Media Size </p>
7047 <p class="code">struct cups_size_s {<br>
7048 &#160;&#160;&#160;&#160;char media[128];<br>
7049 &#160;&#160;&#160;&#160;int width, length, bottom, left, right, top;<br>
7050 };</p>
7051 <h4 class="members">Members</h4>
7052 <dl>
7053 <dt>media[128] </dt>
7054 <dd class="description">Media name to use</dd>
7055 <dt>top </dt>
7056 <dd class="description">Top margin in hundredths of
7057 millimeters</dd>
7058 </dl>
7059 <h2 class="title"><a id="ENUMERATIONS">Constants</a></h2>
7060 <h3 class="enumeration"><a id="cups_ptype_e">cups_ptype_e</a></h3>
7061 <p class="description">Printer type/capability bit
7062 constants</p>
7063 <h4 class="constants">Constants</h4>
7064 <dl>
7065 <dt>CUPS_PRINTER_AUTHENTICATED <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
7066 <dd class="description">Printer requires authentication
7067 </dd>
7068 <dt>CUPS_PRINTER_BIND </dt>
7069 <dd class="description">Can bind output</dd>
7070 <dt>CUPS_PRINTER_BW </dt>
7071 <dd class="description">Can do B&amp;W printing</dd>
7072 <dt>CUPS_PRINTER_CLASS </dt>
7073 <dd class="description">Printer class</dd>
7074 <dt>CUPS_PRINTER_COLLATE </dt>
7075 <dd class="description">Can quickly collate copies</dd>
7076 <dt>CUPS_PRINTER_COLOR </dt>
7077 <dd class="description">Can do color printing</dd>
7078 <dt>CUPS_PRINTER_COMMANDS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
7079 <dd class="description">Printer supports maintenance commands
7080 </dd>
7081 <dt>CUPS_PRINTER_COPIES </dt>
7082 <dd class="description">Can do copies in hardware</dd>
7083 <dt>CUPS_PRINTER_COVER </dt>
7084 <dd class="description">Can cover output</dd>
7085 <dt>CUPS_PRINTER_DEFAULT </dt>
7086 <dd class="description">Default printer on network</dd>
7087 <dt>CUPS_PRINTER_DISCOVERED <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
7088 <dd class="description">Printer was discovered </dd>
7089 <dt>CUPS_PRINTER_DUPLEX </dt>
7090 <dd class="description">Can do two-sided printing</dd>
7091 <dt>CUPS_PRINTER_FAX </dt>
7092 <dd class="description">Fax queue</dd>
7093 <dt>CUPS_PRINTER_LARGE </dt>
7094 <dd class="description">Can print on D/E/A1/A0-size media</dd>
7095 <dt>CUPS_PRINTER_LOCAL </dt>
7096 <dd class="description">Local printer or class</dd>
7097 <dt>CUPS_PRINTER_MEDIUM </dt>
7098 <dd class="description">Can print on Tabloid/B/C/A3/A2-size media</dd>
7099 <dt>CUPS_PRINTER_NOT_SHARED <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
7100 <dd class="description">Printer is not shared
7101 </dd>
7102 <dt>CUPS_PRINTER_PUNCH </dt>
7103 <dd class="description">Can punch output</dd>
7104 <dt>CUPS_PRINTER_REJECTING </dt>
7105 <dd class="description">Printer is rejecting jobs</dd>
7106 <dt>CUPS_PRINTER_REMOTE </dt>
7107 <dd class="description">Remote printer or class</dd>
7108 <dt>CUPS_PRINTER_SMALL </dt>
7109 <dd class="description">Can print on Letter/Legal/A4-size media</dd>
7110 <dt>CUPS_PRINTER_SORT </dt>
7111 <dd class="description">Can sort output</dd>
7112 <dt>CUPS_PRINTER_STAPLE </dt>
7113 <dd class="description">Can staple output</dd>
7114 <dt>CUPS_PRINTER_VARIABLE </dt>
7115 <dd class="description">Can print on rolls and custom-size media</dd>
7116 </dl>
7117 <h3 class="enumeration"><a id="http_encoding_e">http_encoding_e</a></h3>
7118 <p class="description">HTTP transfer encoding values</p>
7119 <h4 class="constants">Constants</h4>
7120 <dl>
7121 <dt>HTTP_ENCODING_CHUNKED </dt>
7122 <dd class="description">Data is chunked</dd>
7123 <dt>HTTP_ENCODING_FIELDS </dt>
7124 <dd class="description">Sending HTTP fields</dd>
7125 <dt>HTTP_ENCODING_LENGTH </dt>
7126 <dd class="description">Data is sent with Content-Length</dd>
7127 </dl>
7128 <h3 class="enumeration"><a id="http_encryption_e">http_encryption_e</a></h3>
7129 <p class="description">HTTP encryption values</p>
7130 <h4 class="constants">Constants</h4>
7131 <dl>
7132 <dt>HTTP_ENCRYPTION_ALWAYS </dt>
7133 <dd class="description">Always encrypt (SSL)</dd>
7134 <dt>HTTP_ENCRYPTION_IF_REQUESTED </dt>
7135 <dd class="description">Encrypt if requested (TLS upgrade)</dd>
7136 <dt>HTTP_ENCRYPTION_NEVER </dt>
7137 <dd class="description">Never encrypt</dd>
7138 <dt>HTTP_ENCRYPTION_REQUIRED </dt>
7139 <dd class="description">Encryption is required (TLS upgrade)</dd>
7140 </dl>
7141 <h3 class="enumeration"><a id="http_field_e">http_field_e</a></h3>
7142 <p class="description">HTTP field names</p>
7143 <h4 class="constants">Constants</h4>
7144 <dl>
7145 <dt>HTTP_FIELD_ACCEPT_ENCODING <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></dt>
7146 <dd class="description">Accepting-Encoding field </dd>
7147 <dt>HTTP_FIELD_ACCEPT_LANGUAGE </dt>
7148 <dd class="description">Accept-Language field</dd>
7149 <dt>HTTP_FIELD_ACCEPT_RANGES </dt>
7150 <dd class="description">Accept-Ranges field</dd>
7151 <dt>HTTP_FIELD_ALLOW <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></dt>
7152 <dd class="description">Allow field </dd>
7153 <dt>HTTP_FIELD_AUTHORIZATION </dt>
7154 <dd class="description">Authorization field</dd>
7155 <dt>HTTP_FIELD_CONNECTION </dt>
7156 <dd class="description">Connection field</dd>
7157 <dt>HTTP_FIELD_CONTENT_ENCODING </dt>
7158 <dd class="description">Content-Encoding field</dd>
7159 <dt>HTTP_FIELD_CONTENT_LANGUAGE </dt>
7160 <dd class="description">Content-Language field</dd>
7161 <dt>HTTP_FIELD_CONTENT_LENGTH </dt>
7162 <dd class="description">Content-Length field</dd>
7163 <dt>HTTP_FIELD_CONTENT_LOCATION </dt>
7164 <dd class="description">Content-Location field</dd>
7165 <dt>HTTP_FIELD_CONTENT_MD5 </dt>
7166 <dd class="description">Content-MD5 field</dd>
7167 <dt>HTTP_FIELD_CONTENT_RANGE </dt>
7168 <dd class="description">Content-Range field</dd>
7169 <dt>HTTP_FIELD_CONTENT_TYPE </dt>
7170 <dd class="description">Content-Type field</dd>
7171 <dt>HTTP_FIELD_CONTENT_VERSION </dt>
7172 <dd class="description">Content-Version field</dd>
7173 <dt>HTTP_FIELD_DATE </dt>
7174 <dd class="description">Date field</dd>
7175 <dt>HTTP_FIELD_HOST </dt>
7176 <dd class="description">Host field</dd>
7177 <dt>HTTP_FIELD_IF_MODIFIED_SINCE </dt>
7178 <dd class="description">If-Modified-Since field</dd>
7179 <dt>HTTP_FIELD_IF_UNMODIFIED_SINCE </dt>
7180 <dd class="description">If-Unmodified-Since field</dd>
7181 <dt>HTTP_FIELD_KEEP_ALIVE </dt>
7182 <dd class="description">Keep-Alive field</dd>
7183 <dt>HTTP_FIELD_LAST_MODIFIED </dt>
7184 <dd class="description">Last-Modified field</dd>
7185 <dt>HTTP_FIELD_LINK </dt>
7186 <dd class="description">Link field</dd>
7187 <dt>HTTP_FIELD_LOCATION </dt>
7188 <dd class="description">Location field</dd>
7189 <dt>HTTP_FIELD_MAX </dt>
7190 <dd class="description">Maximum field index</dd>
7191 <dt>HTTP_FIELD_RANGE </dt>
7192 <dd class="description">Range field</dd>
7193 <dt>HTTP_FIELD_REFERER </dt>
7194 <dd class="description">Referer field</dd>
7195 <dt>HTTP_FIELD_RETRY_AFTER </dt>
7196 <dd class="description">Retry-After field</dd>
7197 <dt>HTTP_FIELD_SERVER <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></dt>
7198 <dd class="description">Server field </dd>
7199 <dt>HTTP_FIELD_TRANSFER_ENCODING </dt>
7200 <dd class="description">Transfer-Encoding field</dd>
7201 <dt>HTTP_FIELD_UNKNOWN </dt>
7202 <dd class="description">Unknown field</dd>
7203 <dt>HTTP_FIELD_UPGRADE </dt>
7204 <dd class="description">Upgrade field</dd>
7205 <dt>HTTP_FIELD_USER_AGENT </dt>
7206 <dd class="description">User-Agent field</dd>
7207 <dt>HTTP_FIELD_WWW_AUTHENTICATE </dt>
7208 <dd class="description">WWW-Authenticate field</dd>
7209 </dl>
7210 <h3 class="enumeration"><a id="http_keepalive_e">http_keepalive_e</a></h3>
7211 <p class="description">HTTP keep-alive values</p>
7212 <h4 class="constants">Constants</h4>
7213 <dl>
7214 <dt>HTTP_KEEPALIVE_OFF </dt>
7215 <dd class="description">No keep alive support</dd>
7216 <dt>HTTP_KEEPALIVE_ON </dt>
7217 <dd class="description">Use keep alive</dd>
7218 </dl>
7219 <h3 class="enumeration"><a id="http_state_e">http_state_e</a></h3>
7220 <p class="description">HTTP state values; states
7221 are server-oriented...</p>
7222 <h4 class="constants">Constants</h4>
7223 <dl>
7224 <dt>HTTP_STATE_CONNECT </dt>
7225 <dd class="description">CONNECT command, waiting for blank line</dd>
7226 <dt>HTTP_STATE_DELETE </dt>
7227 <dd class="description">DELETE command, waiting for blank line</dd>
7228 <dt>HTTP_STATE_ERROR </dt>
7229 <dd class="description">Error on socket</dd>
7230 <dt>HTTP_STATE_GET </dt>
7231 <dd class="description">GET command, waiting for blank line</dd>
7232 <dt>HTTP_STATE_GET_SEND </dt>
7233 <dd class="description">GET command, sending data</dd>
7234 <dt>HTTP_STATE_HEAD </dt>
7235 <dd class="description">HEAD command, waiting for blank line</dd>
7236 <dt>HTTP_STATE_OPTIONS </dt>
7237 <dd class="description">OPTIONS command, waiting for blank line</dd>
7238 <dt>HTTP_STATE_POST </dt>
7239 <dd class="description">POST command, waiting for blank line</dd>
7240 <dt>HTTP_STATE_POST_RECV </dt>
7241 <dd class="description">POST command, receiving data</dd>
7242 <dt>HTTP_STATE_POST_SEND </dt>
7243 <dd class="description">POST command, sending data</dd>
7244 <dt>HTTP_STATE_PUT </dt>
7245 <dd class="description">PUT command, waiting for blank line</dd>
7246 <dt>HTTP_STATE_PUT_RECV </dt>
7247 <dd class="description">PUT command, receiving data</dd>
7248 <dt>HTTP_STATE_STATUS </dt>
7249 <dd class="description">Command complete, sending status</dd>
7250 <dt>HTTP_STATE_TRACE </dt>
7251 <dd class="description">TRACE command, waiting for blank line</dd>
7252 <dt>HTTP_STATE_UNKNOWN_METHOD <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></dt>
7253 <dd class="description">Unknown request method, waiting for blank line </dd>
7254 <dt>HTTP_STATE_UNKNOWN_VERSION <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></dt>
7255 <dd class="description">Unknown request method, waiting for blank line </dd>
7256 <dt>HTTP_STATE_WAITING </dt>
7257 <dd class="description">Waiting for command</dd>
7258 </dl>
7259 <h3 class="enumeration"><a id="http_status_e">http_status_e</a></h3>
7260 <p class="description">HTTP status codes</p>
7261 <h4 class="constants">Constants</h4>
7262 <dl>
7263 <dt>HTTP_STATUS_ACCEPTED </dt>
7264 <dd class="description">DELETE command was successful</dd>
7265 <dt>HTTP_STATUS_BAD_GATEWAY </dt>
7266 <dd class="description">Bad gateway</dd>
7267 <dt>HTTP_STATUS_BAD_REQUEST </dt>
7268 <dd class="description">Bad request</dd>
7269 <dt>HTTP_STATUS_CONFLICT </dt>
7270 <dd class="description">Request is self-conflicting</dd>
7271 <dt>HTTP_STATUS_CONTINUE </dt>
7272 <dd class="description">Everything OK, keep going...</dd>
7273 <dt>HTTP_STATUS_CREATED </dt>
7274 <dd class="description">PUT command was successful</dd>
7275 <dt>HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED <span class="info">&#160;CUPS 1.4&#160;</span></dt>
7276 <dd class="description">User canceled authorization </dd>
7277 <dt>HTTP_STATUS_CUPS_PKI_ERROR <span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span></dt>
7278 <dd class="description">Error negotiating a secure connection </dd>
7279 <dt>HTTP_STATUS_ERROR </dt>
7280 <dd class="description">An error response from httpXxxx()</dd>
7281 <dt>HTTP_STATUS_EXPECTATION_FAILED </dt>
7282 <dd class="description">The expectation given in an Expect header field was not met</dd>
7283 <dt>HTTP_STATUS_FORBIDDEN </dt>
7284 <dd class="description">Forbidden to access this URI</dd>
7285 <dt>HTTP_STATUS_GATEWAY_TIMEOUT </dt>
7286 <dd class="description">Gateway connection timed out</dd>
7287 <dt>HTTP_STATUS_GONE </dt>
7288 <dd class="description">Server has gone away</dd>
7289 <dt>HTTP_STATUS_LENGTH_REQUIRED </dt>
7290 <dd class="description">A content length or encoding is required</dd>
7291 <dt>HTTP_STATUS_METHOD_NOT_ALLOWED </dt>
7292 <dd class="description">Method is not allowed</dd>
7293 <dt>HTTP_STATUS_MOVED_PERMANENTLY </dt>
7294 <dd class="description">Document has moved permanently</dd>
7295 <dt>HTTP_STATUS_MOVED_TEMPORARILY </dt>
7296 <dd class="description">Document has moved temporarily</dd>
7297 <dt>HTTP_STATUS_MULTIPLE_CHOICES </dt>
7298 <dd class="description">Multiple files match request</dd>
7299 <dt>HTTP_STATUS_NONE <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></dt>
7300 <dd class="description">No Expect value </dd>
7301 <dt>HTTP_STATUS_NOT_ACCEPTABLE </dt>
7302 <dd class="description">Not Acceptable</dd>
7303 <dt>HTTP_STATUS_NOT_AUTHORITATIVE </dt>
7304 <dd class="description">Information isn't authoritative</dd>
7305 <dt>HTTP_STATUS_NOT_FOUND </dt>
7306 <dd class="description">URI was not found</dd>
7307 <dt>HTTP_STATUS_NOT_IMPLEMENTED </dt>
7308 <dd class="description">Feature not implemented</dd>
7309 <dt>HTTP_STATUS_NOT_MODIFIED </dt>
7310 <dd class="description">File not modified</dd>
7311 <dt>HTTP_STATUS_NOT_SUPPORTED </dt>
7312 <dd class="description">HTTP version not supported</dd>
7313 <dt>HTTP_STATUS_NO_CONTENT </dt>
7314 <dd class="description">Successful command, no new data</dd>
7315 <dt>HTTP_STATUS_OK </dt>
7316 <dd class="description">OPTIONS/GET/HEAD/POST/TRACE command was successful</dd>
7317 <dt>HTTP_STATUS_PARTIAL_CONTENT </dt>
7318 <dd class="description">Only a partial file was received/sent</dd>
7319 <dt>HTTP_STATUS_PAYMENT_REQUIRED </dt>
7320 <dd class="description">Payment required</dd>
7321 <dt>HTTP_STATUS_PRECONDITION </dt>
7322 <dd class="description">Precondition failed</dd>
7323 <dt>HTTP_STATUS_PROXY_AUTHENTICATION </dt>
7324 <dd class="description">Proxy Authentication is Required</dd>
7325 <dt>HTTP_STATUS_REQUESTED_RANGE </dt>
7326 <dd class="description">The requested range is not satisfiable</dd>
7327 <dt>HTTP_STATUS_REQUEST_TIMEOUT </dt>
7328 <dd class="description">Request timed out</dd>
7329 <dt>HTTP_STATUS_REQUEST_TOO_LARGE </dt>
7330 <dd class="description">Request entity too large</dd>
7331 <dt>HTTP_STATUS_RESET_CONTENT </dt>
7332 <dd class="description">Content was reset/recreated</dd>
7333 <dt>HTTP_STATUS_SEE_OTHER </dt>
7334 <dd class="description">See this other link...</dd>
7335 <dt>HTTP_STATUS_SERVER_ERROR </dt>
7336 <dd class="description">Internal server error</dd>
7337 <dt>HTTP_STATUS_SERVICE_UNAVAILABLE </dt>
7338 <dd class="description">Service is unavailable</dd>
7339 <dt>HTTP_STATUS_SWITCHING_PROTOCOLS </dt>
7340 <dd class="description">HTTP upgrade to TLS/SSL</dd>
7341 <dt>HTTP_STATUS_UNAUTHORIZED </dt>
7342 <dd class="description">Unauthorized to access host</dd>
7343 <dt>HTTP_STATUS_UNSUPPORTED_MEDIATYPE </dt>
7344 <dd class="description">The requested media type is unsupported</dd>
7345 <dt>HTTP_STATUS_UPGRADE_REQUIRED </dt>
7346 <dd class="description">Upgrade to SSL/TLS required</dd>
7347 <dt>HTTP_STATUS_URI_TOO_LONG </dt>
7348 <dd class="description">URI too long</dd>
7349 <dt>HTTP_STATUS_USE_PROXY </dt>
7350 <dd class="description">Must use a proxy to access this URI</dd>
7351 </dl>
7352 <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>
7353 <p class="description">Level of trust for credentials </p>
7354 <h4 class="constants">Constants</h4>
7355 <dl>
7356 <dt>HTTP_TRUST_CHANGED </dt>
7357 <dd class="description">Credentials have changed</dd>
7358 <dt>HTTP_TRUST_EXPIRED </dt>
7359 <dd class="description">Credentials are expired</dd>
7360 <dt>HTTP_TRUST_INVALID </dt>
7361 <dd class="description">Credentials are invalid</dd>
7362 <dt>HTTP_TRUST_OK </dt>
7363 <dd class="description">Credentials are OK/trusted</dd>
7364 <dt>HTTP_TRUST_RENEWED </dt>
7365 <dd class="description">Credentials have been renewed</dd>
7366 <dt>HTTP_TRUST_UNKNOWN </dt>
7367 <dd class="description">Credentials are unknown/new</dd>
7368 </dl>
7369 <h3 class="enumeration"><a id="http_uri_coding_e">http_uri_coding_e</a></h3>
7370 <p class="description">URI en/decode flags</p>
7371 <h4 class="constants">Constants</h4>
7372 <dl>
7373 <dt>HTTP_URI_CODING_ALL </dt>
7374 <dd class="description">En/decode everything</dd>
7375 <dt>HTTP_URI_CODING_HOSTNAME </dt>
7376 <dd class="description">En/decode the hostname portion</dd>
7377 <dt>HTTP_URI_CODING_MOST </dt>
7378 <dd class="description">En/decode all but the query</dd>
7379 <dt>HTTP_URI_CODING_NONE </dt>
7380 <dd class="description">Don't en/decode anything</dd>
7381 <dt>HTTP_URI_CODING_QUERY </dt>
7382 <dd class="description">En/decode the query portion</dd>
7383 <dt>HTTP_URI_CODING_RESOURCE </dt>
7384 <dd class="description">En/decode the resource portion</dd>
7385 <dt>HTTP_URI_CODING_RFC6874 </dt>
7386 <dd class="description">Use RFC 6874 address format</dd>
7387 <dt>HTTP_URI_CODING_USERNAME </dt>
7388 <dd class="description">En/decode the username portion</dd>
7389 </dl>
7390 <h3 class="enumeration"><a id="http_uri_status_e"><span class="info">&#160;CUPS 1.2&#160;</span>http_uri_status_e</a></h3>
7391 <p class="description">URI separation status </p>
7392 <h4 class="constants">Constants</h4>
7393 <dl>
7394 <dt>HTTP_URI_STATUS_BAD_ARGUMENTS </dt>
7395 <dd class="description">Bad arguments to function (error)</dd>
7396 <dt>HTTP_URI_STATUS_BAD_HOSTNAME </dt>
7397 <dd class="description">Bad hostname in URI (error)</dd>
7398 <dt>HTTP_URI_STATUS_BAD_PORT </dt>
7399 <dd class="description">Bad port number in URI (error)</dd>
7400 <dt>HTTP_URI_STATUS_BAD_RESOURCE </dt>
7401 <dd class="description">Bad resource in URI (error)</dd>
7402 <dt>HTTP_URI_STATUS_BAD_SCHEME </dt>
7403 <dd class="description">Bad scheme in URI (error)</dd>
7404 <dt>HTTP_URI_STATUS_BAD_URI </dt>
7405 <dd class="description">Bad/empty URI (error)</dd>
7406 <dt>HTTP_URI_STATUS_BAD_USERNAME </dt>
7407 <dd class="description">Bad username in URI (error)</dd>
7408 <dt>HTTP_URI_STATUS_MISSING_RESOURCE </dt>
7409 <dd class="description">Missing resource in URI (warning)</dd>
7410 <dt>HTTP_URI_STATUS_MISSING_SCHEME </dt>
7411 <dd class="description">Missing scheme in URI (warning)</dd>
7412 <dt>HTTP_URI_STATUS_OK </dt>
7413 <dd class="description">URI decoded OK</dd>
7414 <dt>HTTP_URI_STATUS_OVERFLOW </dt>
7415 <dd class="description">URI buffer for httpAssembleURI is too small</dd>
7416 <dt>HTTP_URI_STATUS_UNKNOWN_SCHEME </dt>
7417 <dd class="description">Unknown scheme in URI (warning)</dd>
7418 </dl>
7419 <h3 class="enumeration"><a id="ipp_finishings_e">ipp_finishings_e</a></h3>
7420 <p class="description">Finishings values</p>
7421 <h4 class="constants">Constants</h4>
7422 <dl>
7423 <dt>IPP_FINISHINGS_BALE </dt>
7424 <dd class="description">Bale (any type)</dd>
7425 <dt>IPP_FINISHINGS_BIND </dt>
7426 <dd class="description">Bind</dd>
7427 <dt>IPP_FINISHINGS_BIND_BOTTOM </dt>
7428 <dd class="description">Bind on bottom</dd>
7429 <dt>IPP_FINISHINGS_BIND_LEFT </dt>
7430 <dd class="description">Bind on left</dd>
7431 <dt>IPP_FINISHINGS_BIND_RIGHT </dt>
7432 <dd class="description">Bind on right</dd>
7433 <dt>IPP_FINISHINGS_BIND_TOP </dt>
7434 <dd class="description">Bind on top</dd>
7435 <dt>IPP_FINISHINGS_BOOKLET_MAKER </dt>
7436 <dd class="description">Fold to make booklet</dd>
7437 <dt>IPP_FINISHINGS_COAT </dt>
7438 <dd class="description">Apply protective liquid or powder coating</dd>
7439 <dt>IPP_FINISHINGS_COVER </dt>
7440 <dd class="description">Add cover</dd>
7441 <dt>IPP_FINISHINGS_EDGE_STITCH </dt>
7442 <dd class="description">Stitch along any side</dd>
7443 <dt>IPP_FINISHINGS_EDGE_STITCH_BOTTOM </dt>
7444 <dd class="description">Stitch along bottom edge</dd>
7445 <dt>IPP_FINISHINGS_EDGE_STITCH_LEFT </dt>
7446 <dd class="description">Stitch along left side</dd>
7447 <dt>IPP_FINISHINGS_EDGE_STITCH_RIGHT </dt>
7448 <dd class="description">Stitch along right side</dd>
7449 <dt>IPP_FINISHINGS_EDGE_STITCH_TOP </dt>
7450 <dd class="description">Stitch along top edge</dd>
7451 <dt>IPP_FINISHINGS_FOLD </dt>
7452 <dd class="description">Fold (any type)</dd>
7453 <dt>IPP_FINISHINGS_FOLD_ACCORDIAN </dt>
7454 <dd class="description">Accordian-fold the paper vertically into four sections</dd>
7455 <dt>IPP_FINISHINGS_FOLD_DOUBLE_GATE </dt>
7456 <dd class="description">Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically</dd>
7457 <dt>IPP_FINISHINGS_FOLD_ENGINEERING_Z </dt>
7458 <dd class="description">Fold the paper vertically into two small sections and one larger, forming an elongated Z</dd>
7459 <dt>IPP_FINISHINGS_FOLD_GATE </dt>
7460 <dd class="description">Fold the top and bottom quarters of the paper towards the midline</dd>
7461 <dt>IPP_FINISHINGS_FOLD_HALF </dt>
7462 <dd class="description">Fold the paper in half vertically</dd>
7463 <dt>IPP_FINISHINGS_FOLD_HALF_Z </dt>
7464 <dd class="description">Fold the paper in half horizontally, then Z-fold the paper vertically</dd>
7465 <dt>IPP_FINISHINGS_FOLD_LEFT_GATE </dt>
7466 <dd class="description">Fold the top quarter of the paper towards the midline</dd>
7467 <dt>IPP_FINISHINGS_FOLD_LETTER </dt>
7468 <dd class="description">Fold the paper into three sections vertically; sometimes also known as a C fold</dd>
7469 <dt>IPP_FINISHINGS_FOLD_PARALLEL </dt>
7470 <dd class="description">Fold the paper in half vertically two times, yielding four sections</dd>
7471 <dt>IPP_FINISHINGS_FOLD_POSTER </dt>
7472 <dd class="description">Fold the paper in half horizontally and vertically; sometimes also called a cross fold</dd>
7473 <dt>IPP_FINISHINGS_FOLD_RIGHT_GATE </dt>
7474 <dd class="description">Fold the bottom quarter of the paper towards the midline</dd>
7475 <dt>IPP_FINISHINGS_FOLD_Z </dt>
7476 <dd class="description">Fold the paper vertically into three sections, forming a Z</dd>
7477 <dt>IPP_FINISHINGS_JOG_OFFSET </dt>
7478 <dd class="description">Offset for binding (any type)</dd>
7479 <dt>IPP_FINISHINGS_LAMINATE </dt>
7480 <dd class="description">Apply protective (solid) material</dd>
7481 <dt>IPP_FINISHINGS_NONE </dt>
7482 <dd class="description">No finishing</dd>
7483 <dt>IPP_FINISHINGS_PUNCH </dt>
7484 <dd class="description">Punch (any location/count)</dd>
7485 <dt>IPP_FINISHINGS_PUNCH_BOTTOM_LEFT </dt>
7486 <dd class="description">Punch 1 hole bottom left</dd>
7487 <dt>IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT </dt>
7488 <dd class="description">Punch 1 hole bottom right</dd>
7489 <dt>IPP_FINISHINGS_PUNCH_DUAL_BOTTOM </dt>
7490 <dd class="description">Punch 2 holes bottom edge</dd>
7491 <dt>IPP_FINISHINGS_PUNCH_DUAL_LEFT </dt>
7492 <dd class="description">Punch 2 holes left side</dd>
7493 <dt>IPP_FINISHINGS_PUNCH_DUAL_RIGHT </dt>
7494 <dd class="description">Punch 2 holes right side</dd>
7495 <dt>IPP_FINISHINGS_PUNCH_DUAL_TOP </dt>
7496 <dd class="description">Punch 2 holes top edge</dd>
7497 <dt>IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM </dt>
7498 <dd class="description">Pucnh multiple holes bottom edge</dd>
7499 <dt>IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT </dt>
7500 <dd class="description">Pucnh multiple holes left side</dd>
7501 <dt>IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT </dt>
7502 <dd class="description">Pucnh multiple holes right side</dd>
7503 <dt>IPP_FINISHINGS_PUNCH_MULTIPLE_TOP </dt>
7504 <dd class="description">Pucnh multiple holes top edge</dd>
7505 <dt>IPP_FINISHINGS_PUNCH_QUAD_BOTTOM </dt>
7506 <dd class="description">Punch 4 holes bottom edge</dd>
7507 <dt>IPP_FINISHINGS_PUNCH_QUAD_LEFT </dt>
7508 <dd class="description">Punch 4 holes left side</dd>
7509 <dt>IPP_FINISHINGS_PUNCH_QUAD_RIGHT </dt>
7510 <dd class="description">Punch 4 holes right side</dd>
7511 <dt>IPP_FINISHINGS_PUNCH_QUAD_TOP </dt>
7512 <dd class="description">Punch 4 holes top edge</dd>
7513 <dt>IPP_FINISHINGS_PUNCH_TOP_LEFT </dt>
7514 <dd class="description">Punch 1 hole top left</dd>
7515 <dt>IPP_FINISHINGS_PUNCH_TOP_RIGHT </dt>
7516 <dd class="description">Punch 1 hole top right</dd>
7517 <dt>IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM </dt>
7518 <dd class="description">Punch 3 holes bottom edge</dd>
7519 <dt>IPP_FINISHINGS_PUNCH_TRIPLE_LEFT </dt>
7520 <dd class="description">Punch 3 holes left side</dd>
7521 <dt>IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT </dt>
7522 <dd class="description">Punch 3 holes right side</dd>
7523 <dt>IPP_FINISHINGS_PUNCH_TRIPLE_TOP </dt>
7524 <dd class="description">Punch 3 holes top edge</dd>
7525 <dt>IPP_FINISHINGS_SADDLE_STITCH </dt>
7526 <dd class="description">Staple interior</dd>
7527 <dt>IPP_FINISHINGS_STAPLE </dt>
7528 <dd class="description">Staple (any location/method)</dd>
7529 <dt>IPP_FINISHINGS_STAPLE_BOTTOM_LEFT </dt>
7530 <dd class="description">Staple bottom left corner</dd>
7531 <dt>IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT </dt>
7532 <dd class="description">Staple bottom right corner</dd>
7533 <dt>IPP_FINISHINGS_STAPLE_DUAL_BOTTOM </dt>
7534 <dd class="description">Two staples on bottom</dd>
7535 <dt>IPP_FINISHINGS_STAPLE_DUAL_LEFT </dt>
7536 <dd class="description">Two staples on left</dd>
7537 <dt>IPP_FINISHINGS_STAPLE_DUAL_RIGHT </dt>
7538 <dd class="description">Two staples on right</dd>
7539 <dt>IPP_FINISHINGS_STAPLE_DUAL_TOP </dt>
7540 <dd class="description">Two staples on top</dd>
7541 <dt>IPP_FINISHINGS_STAPLE_TOP_LEFT </dt>
7542 <dd class="description">Staple top left corner</dd>
7543 <dt>IPP_FINISHINGS_STAPLE_TOP_RIGHT </dt>
7544 <dd class="description">Staple top right corner</dd>
7545 <dt>IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM </dt>
7546 <dd class="description">Three staples on bottom</dd>
7547 <dt>IPP_FINISHINGS_STAPLE_TRIPLE_LEFT </dt>
7548 <dd class="description">Three staples on left</dd>
7549 <dt>IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT </dt>
7550 <dd class="description">Three staples on right</dd>
7551 <dt>IPP_FINISHINGS_STAPLE_TRIPLE_TOP </dt>
7552 <dd class="description">Three staples on top</dd>
7553 <dt>IPP_FINISHINGS_TRIM </dt>
7554 <dd class="description">Trim (any type)</dd>
7555 <dt>IPP_FINISHINGS_TRIM_AFTER_COPIES </dt>
7556 <dd class="description">Trim output after each copy</dd>
7557 <dt>IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS </dt>
7558 <dd class="description">Trim output after each document</dd>
7559 <dt>IPP_FINISHINGS_TRIM_AFTER_JOB </dt>
7560 <dd class="description">Trim output after job</dd>
7561 <dt>IPP_FINISHINGS_TRIM_AFTER_PAGES </dt>
7562 <dd class="description">Trim output after each page</dd>
7563 </dl>
7564 <h3 class="enumeration"><a id="ipp_jstate_e">ipp_jstate_e</a></h3>
7565 <p class="description">Job states</p>
7566 <h4 class="constants">Constants</h4>
7567 <dl>
7568 <dt>IPP_JSTATE_ABORTED </dt>
7569 <dd class="description">Job has aborted due to error</dd>
7570 <dt>IPP_JSTATE_CANCELED </dt>
7571 <dd class="description">Job has been canceled</dd>
7572 <dt>IPP_JSTATE_COMPLETED </dt>
7573 <dd class="description">Job has completed successfully</dd>
7574 <dt>IPP_JSTATE_HELD </dt>
7575 <dd class="description">Job is held for printing</dd>
7576 <dt>IPP_JSTATE_PENDING </dt>
7577 <dd class="description">Job is waiting to be printed</dd>
7578 <dt>IPP_JSTATE_PROCESSING </dt>
7579 <dd class="description">Job is currently printing</dd>
7580 <dt>IPP_JSTATE_STOPPED </dt>
7581 <dd class="description">Job has been stopped</dd>
7582 </dl>
7583 <h3 class="enumeration"><a id="ipp_op_e">ipp_op_e</a></h3>
7584 <p class="description">IPP operations</p>
7585 <h4 class="constants">Constants</h4>
7586 <dl>
7587 <dt>IPP_OP_CANCEL_CURRENT_JOB </dt>
7588 <dd class="description">Cancel-Current-Job: Cancel the current job</dd>
7589 <dt>IPP_OP_CANCEL_JOB </dt>
7590 <dd class="description">Cancel-Job: Cancel a job</dd>
7591 <dt>IPP_OP_CANCEL_JOBS </dt>
7592 <dd class="description">Cancel-Jobs: Cancel all jobs (administrative)</dd>
7593 <dt>IPP_OP_CANCEL_MY_JOBS </dt>
7594 <dd class="description">Cancel-My-Jobs: Cancel a user's jobs</dd>
7595 <dt>IPP_OP_CANCEL_SUBSCRIPTION <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
7596 <dd class="description">Cancel-Subscription: Cancel a subscription </dd>
7597 <dt>IPP_OP_CLOSE_JOB </dt>
7598 <dd class="description">Close-Job: Close a job and start printing</dd>
7599 <dt>IPP_OP_CREATE_JOB </dt>
7600 <dd class="description">Create-Job: Create an empty print job</dd>
7601 <dt>IPP_OP_CREATE_JOB_SUBSCRIPTIONS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
7602 <dd class="description">Create-Job-Subscriptions: Create one of more job subscriptions </dd>
7603 <dt>IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
7604 <dd class="description">Create-Printer-Subscriptions: Create one or more printer subscriptions </dd>
7605 <dt>IPP_OP_CUPS_ADD_MODIFY_CLASS </dt>
7606 <dd class="description">CUPS-Add-Modify-Class: Add or modify a class</dd>
7607 <dt>IPP_OP_CUPS_ADD_MODIFY_PRINTER </dt>
7608 <dd class="description">CUPS-Add-Modify-Printer: Add or modify a printer</dd>
7609 <dt>IPP_OP_CUPS_AUTHENTICATE_JOB <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
7610 <dd class="description">CUPS-Authenticate-Job: Authenticate a job </dd>
7611 <dt>IPP_OP_CUPS_CREATE_LOCAL_PRINTER <span class="info">&#160;CUPS 2.2&#160;</span></dt>
7612 <dd class="description">CUPS-Create-Local-Printer: Create a local (temporary) printer </dd>
7613 <dt>IPP_OP_CUPS_DELETE_CLASS </dt>
7614 <dd class="description">CUPS-Delete-Class: Delete a class</dd>
7615 <dt>IPP_OP_CUPS_DELETE_PRINTER </dt>
7616 <dd class="description">CUPS-Delete-Printer: Delete a printer</dd>
7617 <dt>IPP_OP_CUPS_GET_DEFAULT </dt>
7618 <dd class="description">CUPS-Get-Default: Get the default printer</dd>
7619 <dt>IPP_OP_CUPS_GET_DEVICES <span class="info">&#160;DEPRECATED&#160;</span></dt>
7620 <dd class="description">CUPS-Get-Devices: Get a list of supported devices </dd>
7621 <dt>IPP_OP_CUPS_GET_DOCUMENT <span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span></dt>
7622 <dd class="description">CUPS-Get-Document: Get a document file </dd>
7623 <dt>IPP_OP_CUPS_GET_PPD <span class="info">&#160;DEPRECATED&#160;</span></dt>
7624 <dd class="description">CUPS-Get-PPD: Get a PPD file </dd>
7625 <dt>IPP_OP_CUPS_GET_PPDS <span class="info">&#160;DEPRECATED&#160;</span></dt>
7626 <dd class="description">CUPS-Get-PPDs: Get a list of supported drivers </dd>
7627 <dt>IPP_OP_CUPS_GET_PRINTERS </dt>
7628 <dd class="description">CUPS-Get-Printers: Get a list of printers and/or classes</dd>
7629 <dt>IPP_OP_CUPS_INVALID </dt>
7630 <dd class="description">Invalid operation name for <a href="#ippOpValue"><code>ippOpValue</code></a></dd>
7631 <dt>IPP_OP_CUPS_MOVE_JOB </dt>
7632 <dd class="description">CUPS-Move-Job: Move a job to a different printer</dd>
7633 <dt>IPP_OP_CUPS_SET_DEFAULT </dt>
7634 <dd class="description">CUPS-Set-Default: Set the default printer</dd>
7635 <dt>IPP_OP_DISABLE_PRINTER </dt>
7636 <dd class="description">Disable-Printer: Reject new jobs for a printer</dd>
7637 <dt>IPP_OP_ENABLE_PRINTER </dt>
7638 <dd class="description">Enable-Printer: Accept new jobs for a printer</dd>
7639 <dt>IPP_OP_GET_JOBS </dt>
7640 <dd class="description">Get-Jobs: Get a list of jobs</dd>
7641 <dt>IPP_OP_GET_JOB_ATTRIBUTES </dt>
7642 <dd class="description">Get-Job-Attribute: Get information about a job</dd>
7643 <dt>IPP_OP_GET_NOTIFICATIONS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
7644 <dd class="description">Get-Notifications: Get notification events </dd>
7645 <dt>IPP_OP_GET_PRINTER_ATTRIBUTES </dt>
7646 <dd class="description">Get-Printer-Attributes: Get information about a printer</dd>
7647 <dt>IPP_OP_GET_PRINTER_SUPPORTED_VALUES </dt>
7648 <dd class="description">Get-Printer-Supported-Values: Get supported values</dd>
7649 <dt>IPP_OP_GET_SUBSCRIPTIONS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
7650 <dd class="description">Get-Subscriptions: Get list of subscriptions </dd>
7651 <dt>IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
7652 <dd class="description">Get-Subscription-Attributes: Get subscription information </dd>
7653 <dt>IPP_OP_HOLD_JOB </dt>
7654 <dd class="description">Hold-Job: Hold a job for printing</dd>
7655 <dt>IPP_OP_HOLD_NEW_JOBS </dt>
7656 <dd class="description">Hold-New-Jobs: Hold new jobs</dd>
7657 <dt>IPP_OP_IDENTIFY_PRINTER </dt>
7658 <dd class="description">Identify-Printer: Make the printer beep, flash, or display a message for identification</dd>
7659 <dt>IPP_OP_PAUSE_PRINTER </dt>
7660 <dd class="description">Pause-Printer: Stop a printer</dd>
7661 <dt>IPP_OP_PAUSE_PRINTER_AFTER_CURRENT_JOB </dt>
7662 <dd class="description">Pause-Printer-After-Current-Job: Stop printer after the current job</dd>
7663 <dt>IPP_OP_PRINT_JOB </dt>
7664 <dd class="description">Print-Job: Print a single file</dd>
7665 <dt>IPP_OP_PROMOTE_JOB </dt>
7666 <dd class="description">Promote-Job: Promote a job to print sooner</dd>
7667 <dt>IPP_OP_RELEASE_HELD_NEW_JOBS </dt>
7668 <dd class="description">Release-Held-New-Jobs: Release new jobs that were previously held</dd>
7669 <dt>IPP_OP_RELEASE_JOB </dt>
7670 <dd class="description">Release-Job: Release a job for printing</dd>
7671 <dt>IPP_OP_RENEW_SUBSCRIPTION <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
7672 <dd class="description">Renew-Subscription: Renew a printer subscription </dd>
7673 <dt>IPP_OP_RESTART_JOB <span class="info">&#160;DEPRECATED&#160;</span></dt>
7674 <dd class="description">Restart-Job: Reprint a job </dd>
7675 <dt>IPP_OP_RESUME_JOB </dt>
7676 <dd class="description">Resume-Job: Resume the current job</dd>
7677 <dt>IPP_OP_RESUME_PRINTER </dt>
7678 <dd class="description">Resume-Printer: Start a printer</dd>
7679 <dt>IPP_OP_SCHEDULE_JOB_AFTER </dt>
7680 <dd class="description">Schedule-Job-After: Schedule a job to print after another</dd>
7681 <dt>IPP_OP_SEND_DOCUMENT </dt>
7682 <dd class="description">Send-Document: Add a file to a job</dd>
7683 <dt>IPP_OP_SET_JOB_ATTRIBUTES </dt>
7684 <dd class="description">Set-Job-Attributes: Set job values</dd>
7685 <dt>IPP_OP_SET_PRINTER_ATTRIBUTES </dt>
7686 <dd class="description">Set-Printer-Attributes: Set printer values</dd>
7687 <dt>IPP_OP_SUSPEND_CURRENT_JOB </dt>
7688 <dd class="description">Suspend-Current-Job: Suspend the current job</dd>
7689 <dt>IPP_OP_VALIDATE_JOB </dt>
7690 <dd class="description">Validate-Job: Validate job values prior to submission</dd>
7691 </dl>
7692 <h3 class="enumeration"><a id="ipp_orient_e">ipp_orient_e</a></h3>
7693 <p class="description">Orientation values</p>
7694 <h4 class="constants">Constants</h4>
7695 <dl>
7696 <dt>IPP_ORIENT_LANDSCAPE </dt>
7697 <dd class="description">90 degrees counter-clockwise</dd>
7698 <dt>IPP_ORIENT_NONE </dt>
7699 <dd class="description">No rotation</dd>
7700 <dt>IPP_ORIENT_PORTRAIT </dt>
7701 <dd class="description">No rotation</dd>
7702 <dt>IPP_ORIENT_REVERSE_LANDSCAPE </dt>
7703 <dd class="description">90 degrees clockwise</dd>
7704 <dt>IPP_ORIENT_REVERSE_PORTRAIT </dt>
7705 <dd class="description">180 degrees</dd>
7706 </dl>
7707 <h3 class="enumeration"><a id="ipp_pstate_e">ipp_pstate_e</a></h3>
7708 <p class="description">Printer states</p>
7709 <h4 class="constants">Constants</h4>
7710 <dl>
7711 <dt>IPP_PSTATE_IDLE </dt>
7712 <dd class="description">Printer is idle</dd>
7713 <dt>IPP_PSTATE_PROCESSING </dt>
7714 <dd class="description">Printer is working</dd>
7715 <dt>IPP_PSTATE_STOPPED </dt>
7716 <dd class="description">Printer is stopped</dd>
7717 </dl>
7718 <h3 class="enumeration"><a id="ipp_quality_e">ipp_quality_e</a></h3>
7719 <p class="description">Qualities</p>
7720 <h4 class="constants">Constants</h4>
7721 <dl>
7722 <dt>IPP_QUALITY_DRAFT </dt>
7723 <dd class="description">Draft quality</dd>
7724 <dt>IPP_QUALITY_HIGH </dt>
7725 <dd class="description">High quality</dd>
7726 <dt>IPP_QUALITY_NORMAL </dt>
7727 <dd class="description">Normal quality</dd>
7728 </dl>
7729 <h3 class="enumeration"><a id="ipp_res_e">ipp_res_e</a></h3>
7730 <p class="description">Resolution units</p>
7731 <h4 class="constants">Constants</h4>
7732 <dl>
7733 <dt>IPP_RES_PER_CM </dt>
7734 <dd class="description">Pixels per centimeter</dd>
7735 <dt>IPP_RES_PER_INCH </dt>
7736 <dd class="description">Pixels per inch</dd>
7737 </dl>
7738 <h3 class="enumeration"><a id="ipp_state_e">ipp_state_e</a></h3>
7739 <p class="description">IPP states</p>
7740 <h4 class="constants">Constants</h4>
7741 <dl>
7742 <dt>IPP_STATE_ATTRIBUTE </dt>
7743 <dd class="description">One or more attributes need to be sent/received</dd>
7744 <dt>IPP_STATE_DATA </dt>
7745 <dd class="description">IPP request data needs to be sent/received</dd>
7746 <dt>IPP_STATE_ERROR </dt>
7747 <dd class="description">An error occurred</dd>
7748 <dt>IPP_STATE_HEADER </dt>
7749 <dd class="description">The request header needs to be sent/received</dd>
7750 <dt>IPP_STATE_IDLE </dt>
7751 <dd class="description">Nothing is happening/request completed</dd>
7752 </dl>
7753 <h3 class="enumeration"><a id="ipp_status_e">ipp_status_e</a></h3>
7754 <p class="description">IPP status codes</p>
7755 <h4 class="constants">Constants</h4>
7756 <dl>
7757 <dt>IPP_STATUS_CUPS_INVALID </dt>
7758 <dd class="description">Invalid status name for <a href="#ippErrorValue"><code>ippErrorValue</code></a></dd>
7759 <dt>IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED </dt>
7760 <dd class="description">client-error-account-authorization-failed</dd>
7761 <dt>IPP_STATUS_ERROR_ACCOUNT_CLOSED </dt>
7762 <dd class="description">client-error-account-closed</dd>
7763 <dt>IPP_STATUS_ERROR_ACCOUNT_INFO_NEEDED </dt>
7764 <dd class="description">client-error-account-info-needed</dd>
7765 <dt>IPP_STATUS_ERROR_ACCOUNT_LIMIT_REACHED </dt>
7766 <dd class="description">client-error-account-limit-reached</dd>
7767 <dt>IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE </dt>
7768 <dd class="description">client-error-attributes-not-settable</dd>
7769 <dt>IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES </dt>
7770 <dd class="description">client-error-attributes-or-values-not-supported</dd>
7771 <dt>IPP_STATUS_ERROR_BAD_REQUEST </dt>
7772 <dd class="description">client-error-bad-request</dd>
7773 <dt>IPP_STATUS_ERROR_BUSY </dt>
7774 <dd class="description">server-error-busy</dd>
7775 <dt>IPP_STATUS_ERROR_CHARSET </dt>
7776 <dd class="description">client-error-charset-not-supported</dd>
7777 <dt>IPP_STATUS_ERROR_COMPRESSION_ERROR </dt>
7778 <dd class="description">client-error-compression-error</dd>
7779 <dt>IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED </dt>
7780 <dd class="description">client-error-compression-not-supported</dd>
7781 <dt>IPP_STATUS_ERROR_CONFLICTING </dt>
7782 <dd class="description">client-error-conflicting-attributes</dd>
7783 <dt>IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED <span class="info">&#160;DEPRECATED&#160;</span></dt>
7784 <dd class="description">cups-error-account-authorization-failed </dd>
7785 <dt>IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED </dt>
7786 <dd class="description">cups-error-account-closed @deprecate@</dd>
7787 <dt>IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED <span class="info">&#160;DEPRECATED&#160;</span></dt>
7788 <dd class="description">cups-error-account-info-needed </dd>
7789 <dt>IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED <span class="info">&#160;DEPRECATED&#160;</span></dt>
7790 <dd class="description">cups-error-account-limit-reached </dd>
7791 <dt>IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED <span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span></dt>
7792 <dd class="description">cups-authentication-canceled - Authentication canceled by user </dd>
7793 <dt>IPP_STATUS_ERROR_CUPS_PKI <span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span></dt>
7794 <dd class="description">cups-pki-error - Error negotiating a secure connection </dd>
7795 <dt>IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED <span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span></dt>
7796 <dd class="description">cups-upgrade-required - TLS upgrade required </dd>
7797 <dt>IPP_STATUS_ERROR_DEVICE </dt>
7798 <dd class="description">server-error-device-error</dd>
7799 <dt>IPP_STATUS_ERROR_DOCUMENT_ACCESS </dt>
7800 <dd class="description">client-error-document-access-error</dd>
7801 <dt>IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR </dt>
7802 <dd class="description">client-error-document-format-error</dd>
7803 <dt>IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED </dt>
7804 <dd class="description">client-error-document-format-not-supported</dd>
7805 <dt>IPP_STATUS_ERROR_DOCUMENT_PASSWORD </dt>
7806 <dd class="description">client-error-document-password-error</dd>
7807 <dt>IPP_STATUS_ERROR_DOCUMENT_PERMISSION </dt>
7808 <dd class="description">client-error-document-permission-error</dd>
7809 <dt>IPP_STATUS_ERROR_DOCUMENT_SECURITY </dt>
7810 <dd class="description">client-error-document-security-error</dd>
7811 <dt>IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE </dt>
7812 <dd class="description">client-error-document-unprintable-error</dd>
7813 <dt>IPP_STATUS_ERROR_FORBIDDEN </dt>
7814 <dd class="description">client-error-forbidden</dd>
7815 <dt>IPP_STATUS_ERROR_GONE </dt>
7816 <dd class="description">client-error-gone</dd>
7817 <dt>IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS </dt>
7818 <dd class="description">client-error-ignored-all-subscriptions</dd>
7819 <dt>IPP_STATUS_ERROR_INTERNAL </dt>
7820 <dd class="description">server-error-internal-error</dd>
7821 <dt>IPP_STATUS_ERROR_JOB_CANCELED </dt>
7822 <dd class="description">server-error-job-canceled</dd>
7823 <dt>IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED </dt>
7824 <dd class="description">server-error-multiple-document-jobs-not-supported</dd>
7825 <dt>IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS </dt>
7826 <dd class="description">server-error-not-accepting-jobs</dd>
7827 <dt>IPP_STATUS_ERROR_NOT_AUTHENTICATED </dt>
7828 <dd class="description">client-error-not-authenticated</dd>
7829 <dt>IPP_STATUS_ERROR_NOT_AUTHORIZED </dt>
7830 <dd class="description">client-error-not-authorized</dd>
7831 <dt>IPP_STATUS_ERROR_NOT_FETCHABLE </dt>
7832 <dd class="description">client-error-not-fetchable</dd>
7833 <dt>IPP_STATUS_ERROR_NOT_FOUND </dt>
7834 <dd class="description">client-error-not-found</dd>
7835 <dt>IPP_STATUS_ERROR_NOT_POSSIBLE </dt>
7836 <dd class="description">client-error-not-possible</dd>
7837 <dt>IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED </dt>
7838 <dd class="description">server-error-operation-not-supported</dd>
7839 <dt>IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED </dt>
7840 <dd class="description">server-error-printer-is-deactivated</dd>
7841 <dt>IPP_STATUS_ERROR_REQUEST_ENTITY </dt>
7842 <dd class="description">client-error-request-entity-too-large</dd>
7843 <dt>IPP_STATUS_ERROR_REQUEST_VALUE </dt>
7844 <dd class="description">client-error-request-value-too-long</dd>
7845 <dt>IPP_STATUS_ERROR_SERVICE_UNAVAILABLE </dt>
7846 <dd class="description">server-error-service-unavailable</dd>
7847 <dt>IPP_STATUS_ERROR_TEMPORARY </dt>
7848 <dd class="description">server-error-temporary-error</dd>
7849 <dt>IPP_STATUS_ERROR_TIMEOUT </dt>
7850 <dd class="description">client-error-timeout</dd>
7851 <dt>IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS </dt>
7852 <dd class="description">server-error-too-many-documents</dd>
7853 <dt>IPP_STATUS_ERROR_TOO_MANY_JOBS </dt>
7854 <dd class="description">server-error-too-many-jobs</dd>
7855 <dt>IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS </dt>
7856 <dd class="description">client-error-too-many-subscriptions</dd>
7857 <dt>IPP_STATUS_ERROR_URI_SCHEME </dt>
7858 <dd class="description">client-error-uri-scheme-not-supported</dd>
7859 <dt>IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED </dt>
7860 <dd class="description">server-error-version-not-supported</dd>
7861 <dt>IPP_STATUS_OK </dt>
7862 <dd class="description">successful-ok</dd>
7863 <dt>IPP_STATUS_OK_CONFLICTING </dt>
7864 <dd class="description">successful-ok-conflicting-attributes</dd>
7865 <dt>IPP_STATUS_OK_EVENTS_COMPLETE </dt>
7866 <dd class="description">successful-ok-events-complete</dd>
7867 <dt>IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED </dt>
7868 <dd class="description">successful-ok-ignored-or-substituted-attributes</dd>
7869 <dt>IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS </dt>
7870 <dd class="description">successful-ok-ignored-subscriptions</dd>
7871 <dt>IPP_STATUS_OK_TOO_MANY_EVENTS </dt>
7872 <dd class="description">successful-ok-too-many-events</dd>
7873 </dl>
7874 <h3 class="enumeration"><a id="ipp_tag_e">ipp_tag_e</a></h3>
7875 <p class="description">Format tags for attributes</p>
7876 <h4 class="constants">Constants</h4>
7877 <dl>
7878 <dt>IPP_TAG_ADMINDEFINE </dt>
7879 <dd class="description">Admin-defined value</dd>
7880 <dt>IPP_TAG_BOOLEAN </dt>
7881 <dd class="description">Boolean value</dd>
7882 <dt>IPP_TAG_CHARSET </dt>
7883 <dd class="description">Character set value</dd>
7884 <dt>IPP_TAG_CUPS_INVALID </dt>
7885 <dd class="description">Invalid tag name for <a href="#ippTagValue"><code>ippTagValue</code></a></dd>
7886 <dt>IPP_TAG_DATE </dt>
7887 <dd class="description">Date/time value</dd>
7888 <dt>IPP_TAG_DEFAULT </dt>
7889 <dd class="description">Default value</dd>
7890 <dt>IPP_TAG_DELETEATTR </dt>
7891 <dd class="description">Delete-attribute value</dd>
7892 <dt>IPP_TAG_END </dt>
7893 <dd class="description">End-of-attributes</dd>
7894 <dt>IPP_TAG_ENUM </dt>
7895 <dd class="description">Enumeration value</dd>
7896 <dt>IPP_TAG_EVENT_NOTIFICATION </dt>
7897 <dd class="description">Event group</dd>
7898 <dt>IPP_TAG_INTEGER </dt>
7899 <dd class="description">Integer value</dd>
7900 <dt>IPP_TAG_JOB </dt>
7901 <dd class="description">Job group</dd>
7902 <dt>IPP_TAG_KEYWORD </dt>
7903 <dd class="description">Keyword value</dd>
7904 <dt>IPP_TAG_LANGUAGE </dt>
7905 <dd class="description">Language value</dd>
7906 <dt>IPP_TAG_MIMETYPE </dt>
7907 <dd class="description">MIME media type value</dd>
7908 <dt>IPP_TAG_NAME </dt>
7909 <dd class="description">Name value</dd>
7910 <dt>IPP_TAG_NAMELANG </dt>
7911 <dd class="description">Name-with-language value</dd>
7912 <dt>IPP_TAG_NOTSETTABLE </dt>
7913 <dd class="description">Not-settable value</dd>
7914 <dt>IPP_TAG_NOVALUE </dt>
7915 <dd class="description">No-value value</dd>
7916 <dt>IPP_TAG_OPERATION </dt>
7917 <dd class="description">Operation group</dd>
7918 <dt>IPP_TAG_PRINTER </dt>
7919 <dd class="description">Printer group</dd>
7920 <dt>IPP_TAG_RANGE </dt>
7921 <dd class="description">Range value</dd>
7922 <dt>IPP_TAG_RESOLUTION </dt>
7923 <dd class="description">Resolution value</dd>
7924 <dt>IPP_TAG_STRING </dt>
7925 <dd class="description">Octet string value</dd>
7926 <dt>IPP_TAG_SUBSCRIPTION </dt>
7927 <dd class="description">Subscription group</dd>
7928 <dt>IPP_TAG_TEXT </dt>
7929 <dd class="description">Text value</dd>
7930 <dt>IPP_TAG_TEXTLANG </dt>
7931 <dd class="description">Text-with-language value</dd>
7932 <dt>IPP_TAG_UNKNOWN </dt>
7933 <dd class="description">Unknown value</dd>
7934 <dt>IPP_TAG_UNSUPPORTED_GROUP </dt>
7935 <dd class="description">Unsupported attributes group</dd>
7936 <dt>IPP_TAG_UNSUPPORTED_VALUE </dt>
7937 <dd class="description">Unsupported value</dd>
7938 <dt>IPP_TAG_URI </dt>
7939 <dd class="description">URI value</dd>
7940 <dt>IPP_TAG_URISCHEME </dt>
7941 <dd class="description">URI scheme value</dd>
7942 <dt>IPP_TAG_ZERO </dt>
7943 <dd class="description">Zero tag - used for separators</dd>
7944 </dl>
7945 </div>
7946 </body>
7947 </html>