]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/cupspm.html
Save work on documentation.
[thirdparty/cups.git] / doc / help / cupspm.html
CommitLineData
798d6e29
MS
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">
9c44e2cb 10 <meta name="copyright" content="Copyright &#xa9; 2007-2017 by Apple Inc. All Rights Reserved.">
798d6e29
MS
11 <meta name="version" content="2.2.4">
12 <style type="text/css"><!--
13body, p, h1, h2, h3, h4 {
14 font-family: sans-serif;
15}
16div.body h1 {
17 font-size: 250%;
18 font-weight: bold;
19 margin: 0;
20}
21div.body h2 {
22 font-size: 250%;
23 margin-top: 1.5em;
24}
25div.body h3 {
26 font-size: 150%;
27 margin-bottom: 0.5em;
28 margin-top: 1.5em;
29}
30div.body h4 {
31 font-size: 110%;
32 margin-bottom: 0.5em;
33 margin-top: 1.5em;
34}
35div.body h5 {
36 font-size: 100%;
37 margin-bottom: 0.5em;
38 margin-top: 1.5em;
39}
40div.contents {
41 background: #e8e8e8;
42 border: solid thin black;
43 padding: 10px;
44}
45div.contents h1 {
46 font-size: 110%;
47}
48div.contents h2 {
49 font-size: 100%;
50}
51div.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}
9c44e2cb
MS
90h1, h2, h3, h4, h5, h6 {
91 page-break-inside: avoid;
92}
798d6e29
MS
93blockquote {
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}
99p 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}
108p.code, pre, ul.code li {
109 padding: 10px;
110}
111p code, li code {
112 padding: 2px 5px;
113}
114a:link, a:visited {
115 text-decoration: none;
116}
117span.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}
126h3 span.info, h4 span.info {
98d88c8d
MS
127 border-top-left-radius: 10px;
128 border-top-right-radius: 10px;
798d6e29 129 float: right;
98d88c8d 130 padding: 3px 6px;
798d6e29
MS
131}
132ul.code, ul.contents, ul.subcontents {
133 list-style-type: none;
134 margin: 0;
135 padding-left: 0;
136}
137ul.code li {
138 margin: 0;
139}
140ul.contents > li {
141 margin-top: 1em;
142}
143ul.contents li ul.code, ul.contents li ul.subcontents {
144 padding-left: 2em;
145}
98d88c8d
MS
146table.list {
147 border-collapse: collapse;
148 width: 100%;
798d6e29 149}
98d88c8d
MS
150table.list tr:nth-child(even) {
151 background: rgba(127,127,127,0.1);]n}
152table.list th {
153 border-right: 2px solid gray;
154 font-family: monospace;
155 padding: 5px 10px 5px 2px;
156 text-align: right;
157 vertical-align: top;
798d6e29 158}
98d88c8d
MS
159table.list td {
160 padding: 5px 2px 5px 10px;
161 text-align: left;
162 vertical-align: top;
163 width: 80%;
798d6e29
MS
164}
165h1.title {
166}
167h2.title {
168 border-bottom: solid 2px black;
169}
170h3.title {
171 border-bottom: solid 2px black;
172}
173--></style>
174 </head>
175 <body>
176 <h1 class="title">CUPS Programming Manual</h1>
177 <p>Michael R Sweet</p>
9c44e2cb 178 <p>Copyright &#xa9; 2007-2017 by Apple Inc. All Rights Reserved.</p>
798d6e29
MS
179 <div class="contents">
180 <h2 class="title">Contents</h2>
181 <ul class="contents">
53af7f21
MS
182 <li><a href="#introduction">Introduction</a><ul class="subcontents">
183 <li><a href="#guidelines">Guidelines</a></li>
184 <li><a href="#terms-used-in-this-document">Terms Used in This Document</a></li>
185 <li><a href="#compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></li>
798d6e29 186 </ul></li>
53af7f21
MS
187 <li><a href="#working-with-destinations">Working with Destinations</a><ul class="subcontents">
188 <li><a href="#finding-available-destinations">Finding Available Destinations</a></li>
189 <li><a href="#basic-destination-information">Basic Destination Information</a></li>
190 <li><a href="#detailed-destination-information">Detailed Destination Information</a></li>
191 <li><a href="#submitting-a-print-job">Submitting a Print Job</a></li>
798d6e29
MS
192 </ul></li>
193 <li><a href="#FUNCTIONS">Functions</a><ul class="subcontents">
194 <li><a href="#cupsAddDest">cupsAddDest</a></li>
53af7f21 195 <li><a href="#cupsAddIntegerOption">cupsAddIntegerOption</a></li>
798d6e29 196 <li><a href="#cupsAddOption">cupsAddOption</a></li>
798d6e29 197 <li><a href="#cupsCancelDestJob">cupsCancelDestJob</a></li>
798d6e29
MS
198 <li><a href="#cupsCheckDestSupported">cupsCheckDestSupported</a></li>
199 <li><a href="#cupsCloseDestJob">cupsCloseDestJob</a></li>
200 <li><a href="#cupsConnectDest">cupsConnectDest</a></li>
798d6e29
MS
201 <li><a href="#cupsCopyDest">cupsCopyDest</a></li>
202 <li><a href="#cupsCopyDestConflicts">cupsCopyDestConflicts</a></li>
203 <li><a href="#cupsCopyDestInfo">cupsCopyDestInfo</a></li>
204 <li><a href="#cupsCreateDestJob">cupsCreateDestJob</a></li>
798d6e29
MS
205 <li><a href="#cupsDoAuthentication">cupsDoAuthentication</a></li>
206 <li><a href="#cupsEncodeOptions">cupsEncodeOptions</a></li>
207 <li><a href="#cupsEncodeOptions2">cupsEncodeOptions2</a></li>
208 <li><a href="#cupsEncryption">cupsEncryption</a></li>
209 <li><a href="#cupsEnumDests">cupsEnumDests</a></li>
798d6e29
MS
210 <li><a href="#cupsFindDestDefault">cupsFindDestDefault</a></li>
211 <li><a href="#cupsFindDestReady">cupsFindDestReady</a></li>
212 <li><a href="#cupsFindDestSupported">cupsFindDestSupported</a></li>
213 <li><a href="#cupsFinishDestDocument">cupsFinishDestDocument</a></li>
798d6e29
MS
214 <li><a href="#cupsFreeDestInfo">cupsFreeDestInfo</a></li>
215 <li><a href="#cupsFreeDests">cupsFreeDests</a></li>
216 <li><a href="#cupsFreeJobs">cupsFreeJobs</a></li>
217 <li><a href="#cupsFreeOptions">cupsFreeOptions</a></li>
798d6e29
MS
218 <li><a href="#cupsGetDest">cupsGetDest</a></li>
219 <li><a href="#cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></li>
220 <li><a href="#cupsGetDestMediaByName">cupsGetDestMediaByName</a></li>
221 <li><a href="#cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></li>
222 <li><a href="#cupsGetDestMediaCount">cupsGetDestMediaCount</a></li>
223 <li><a href="#cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></li>
224 <li><a href="#cupsGetDestWithURI">cupsGetDestWithURI</a></li>
98d88c8d 225 <li><a href="#cupsGetDests2">cupsGetDests2</a></li>
53af7f21 226 <li><a href="#cupsGetIntegerOption">cupsGetIntegerOption</a></li>
798d6e29
MS
227 <li><a href="#cupsGetJobs2">cupsGetJobs2</a></li>
228 <li><a href="#cupsGetNamedDest">cupsGetNamedDest</a></li>
229 <li><a href="#cupsGetOption">cupsGetOption</a></li>
798d6e29 230 <li><a href="#cupsGetPassword2">cupsGetPassword2</a></li>
798d6e29
MS
231 <li><a href="#cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></li>
232 <li><a href="#cupsLocalizeDestOption">cupsLocalizeDestOption</a></li>
233 <li><a href="#cupsLocalizeDestValue">cupsLocalizeDestValue</a></li>
234 <li><a href="#cupsMakeServerCredentials">cupsMakeServerCredentials</a></li>
798d6e29 235 <li><a href="#cupsParseOptions">cupsParseOptions</a></li>
798d6e29
MS
236 <li><a href="#cupsRemoveDest">cupsRemoveDest</a></li>
237 <li><a href="#cupsRemoveOption">cupsRemoveOption</a></li>
238 <li><a href="#cupsServer">cupsServer</a></li>
239 <li><a href="#cupsSetClientCertCB">cupsSetClientCertCB</a></li>
240 <li><a href="#cupsSetCredentials">cupsSetCredentials</a></li>
241 <li><a href="#cupsSetDefaultDest">cupsSetDefaultDest</a></li>
798d6e29
MS
242 <li><a href="#cupsSetDests2">cupsSetDests2</a></li>
243 <li><a href="#cupsSetEncryption">cupsSetEncryption</a></li>
798d6e29
MS
244 <li><a href="#cupsSetPasswordCB2">cupsSetPasswordCB2</a></li>
245 <li><a href="#cupsSetServer">cupsSetServer</a></li>
246 <li><a href="#cupsSetServerCertCB">cupsSetServerCertCB</a></li>
247 <li><a href="#cupsSetServerCredentials">cupsSetServerCredentials</a></li>
248 <li><a href="#cupsSetUser">cupsSetUser</a></li>
249 <li><a href="#cupsSetUserAgent">cupsSetUserAgent</a></li>
250 <li><a href="#cupsStartDestDocument">cupsStartDestDocument</a></li>
798d6e29
MS
251 <li><a href="#cupsUser">cupsUser</a></li>
252 <li><a href="#cupsUserAgent">cupsUserAgent</a></li>
253 <li><a href="#httpAcceptConnection">httpAcceptConnection</a></li>
254 <li><a href="#httpAddCredential">httpAddCredential</a></li>
255 <li><a href="#httpAddrAny">httpAddrAny</a></li>
256 <li><a href="#httpAddrClose">httpAddrClose</a></li>
798d6e29
MS
257 <li><a href="#httpAddrConnect2">httpAddrConnect2</a></li>
258 <li><a href="#httpAddrCopyList">httpAddrCopyList</a></li>
259 <li><a href="#httpAddrEqual">httpAddrEqual</a></li>
260 <li><a href="#httpAddrFamily">httpAddrFamily</a></li>
261 <li><a href="#httpAddrFreeList">httpAddrFreeList</a></li>
262 <li><a href="#httpAddrGetList">httpAddrGetList</a></li>
263 <li><a href="#httpAddrLength">httpAddrLength</a></li>
264 <li><a href="#httpAddrListen">httpAddrListen</a></li>
265 <li><a href="#httpAddrLocalhost">httpAddrLocalhost</a></li>
266 <li><a href="#httpAddrLookup">httpAddrLookup</a></li>
267 <li><a href="#httpAddrPort">httpAddrPort</a></li>
268 <li><a href="#httpAddrString">httpAddrString</a></li>
269 <li><a href="#httpAssembleURI">httpAssembleURI</a></li>
270 <li><a href="#httpAssembleURIf">httpAssembleURIf</a></li>
271 <li><a href="#httpAssembleUUID">httpAssembleUUID</a></li>
272 <li><a href="#httpBlocking">httpBlocking</a></li>
273 <li><a href="#httpCheck">httpCheck</a></li>
274 <li><a href="#httpClearCookie">httpClearCookie</a></li>
275 <li><a href="#httpClearFields">httpClearFields</a></li>
276 <li><a href="#httpClose">httpClose</a></li>
277 <li><a href="#httpCompareCredentials">httpCompareCredentials</a></li>
798d6e29 278 <li><a href="#httpConnect2">httpConnect2</a></li>
798d6e29
MS
279 <li><a href="#httpCopyCredentials">httpCopyCredentials</a></li>
280 <li><a href="#httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></li>
281 <li><a href="#httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></li>
282 <li><a href="#httpCredentialsGetTrust">httpCredentialsGetTrust</a></li>
283 <li><a href="#httpCredentialsString">httpCredentialsString</a></li>
798d6e29
MS
284 <li><a href="#httpDecode64_2">httpDecode64_2</a></li>
285 <li><a href="#httpDelete">httpDelete</a></li>
798d6e29
MS
286 <li><a href="#httpEncode64_2">httpEncode64_2</a></li>
287 <li><a href="#httpEncryption">httpEncryption</a></li>
288 <li><a href="#httpError">httpError</a></li>
289 <li><a href="#httpFieldValue">httpFieldValue</a></li>
290 <li><a href="#httpFlush">httpFlush</a></li>
291 <li><a href="#httpFlushWrite">httpFlushWrite</a></li>
292 <li><a href="#httpFreeCredentials">httpFreeCredentials</a></li>
293 <li><a href="#httpGet">httpGet</a></li>
294 <li><a href="#httpGetActivity">httpGetActivity</a></li>
295 <li><a href="#httpGetAddress">httpGetAddress</a></li>
296 <li><a href="#httpGetAuthString">httpGetAuthString</a></li>
297 <li><a href="#httpGetBlocking">httpGetBlocking</a></li>
298 <li><a href="#httpGetContentEncoding">httpGetContentEncoding</a></li>
299 <li><a href="#httpGetCookie">httpGetCookie</a></li>
798d6e29
MS
300 <li><a href="#httpGetDateString2">httpGetDateString2</a></li>
301 <li><a href="#httpGetDateTime">httpGetDateTime</a></li>
302 <li><a href="#httpGetEncryption">httpGetEncryption</a></li>
303 <li><a href="#httpGetExpect">httpGetExpect</a></li>
304 <li><a href="#httpGetFd">httpGetFd</a></li>
305 <li><a href="#httpGetField">httpGetField</a></li>
306 <li><a href="#httpGetHostByName">httpGetHostByName</a></li>
307 <li><a href="#httpGetHostname">httpGetHostname</a></li>
308 <li><a href="#httpGetKeepAlive">httpGetKeepAlive</a></li>
798d6e29
MS
309 <li><a href="#httpGetLength2">httpGetLength2</a></li>
310 <li><a href="#httpGetPending">httpGetPending</a></li>
311 <li><a href="#httpGetReady">httpGetReady</a></li>
312 <li><a href="#httpGetRemaining">httpGetRemaining</a></li>
313 <li><a href="#httpGetState">httpGetState</a></li>
314 <li><a href="#httpGetStatus">httpGetStatus</a></li>
798d6e29
MS
315 <li><a href="#httpGetSubField2">httpGetSubField2</a></li>
316 <li><a href="#httpGetVersion">httpGetVersion</a></li>
317 <li><a href="#httpGets">httpGets</a></li>
318 <li><a href="#httpHead">httpHead</a></li>
319 <li><a href="#httpInitialize">httpInitialize</a></li>
320 <li><a href="#httpIsChunked">httpIsChunked</a></li>
321 <li><a href="#httpIsEncrypted">httpIsEncrypted</a></li>
322 <li><a href="#httpLoadCredentials">httpLoadCredentials</a></li>
323 <li><a href="#httpOptions">httpOptions</a></li>
324 <li><a href="#httpPeek">httpPeek</a></li>
325 <li><a href="#httpPost">httpPost</a></li>
326 <li><a href="#httpPut">httpPut</a></li>
798d6e29
MS
327 <li><a href="#httpRead2">httpRead2</a></li>
328 <li><a href="#httpReadRequest">httpReadRequest</a></li>
798d6e29
MS
329 <li><a href="#httpReconnect2">httpReconnect2</a></li>
330 <li><a href="#httpResolveHostname">httpResolveHostname</a></li>
331 <li><a href="#httpSaveCredentials">httpSaveCredentials</a></li>
798d6e29
MS
332 <li><a href="#httpSeparateURI">httpSeparateURI</a></li>
333 <li><a href="#httpSetAuthString">httpSetAuthString</a></li>
334 <li><a href="#httpSetCookie">httpSetCookie</a></li>
335 <li><a href="#httpSetCredentials">httpSetCredentials</a></li>
336 <li><a href="#httpSetDefaultField">httpSetDefaultField</a></li>
337 <li><a href="#httpSetExpect">httpSetExpect</a></li>
338 <li><a href="#httpSetField">httpSetField</a></li>
339 <li><a href="#httpSetKeepAlive">httpSetKeepAlive</a></li>
340 <li><a href="#httpSetLength">httpSetLength</a></li>
341 <li><a href="#httpSetTimeout">httpSetTimeout</a></li>
342 <li><a href="#httpShutdown">httpShutdown</a></li>
343 <li><a href="#httpStateString">httpStateString</a></li>
344 <li><a href="#httpStatus">httpStatus</a></li>
345 <li><a href="#httpTrace">httpTrace</a></li>
346 <li><a href="#httpURIStatusString">httpURIStatusString</a></li>
347 <li><a href="#httpUpdate">httpUpdate</a></li>
348 <li><a href="#httpWait">httpWait</a></li>
798d6e29
MS
349 <li><a href="#httpWrite2">httpWrite2</a></li>
350 <li><a href="#httpWriteResponse">httpWriteResponse</a></li>
351 <li><a href="#ippAddBoolean">ippAddBoolean</a></li>
352 <li><a href="#ippAddBooleans">ippAddBooleans</a></li>
353 <li><a href="#ippAddCollection">ippAddCollection</a></li>
354 <li><a href="#ippAddCollections">ippAddCollections</a></li>
355 <li><a href="#ippAddDate">ippAddDate</a></li>
356 <li><a href="#ippAddInteger">ippAddInteger</a></li>
357 <li><a href="#ippAddIntegers">ippAddIntegers</a></li>
358 <li><a href="#ippAddOctetString">ippAddOctetString</a></li>
359 <li><a href="#ippAddOutOfBand">ippAddOutOfBand</a></li>
360 <li><a href="#ippAddRange">ippAddRange</a></li>
361 <li><a href="#ippAddRanges">ippAddRanges</a></li>
362 <li><a href="#ippAddResolution">ippAddResolution</a></li>
363 <li><a href="#ippAddResolutions">ippAddResolutions</a></li>
364 <li><a href="#ippAddSeparator">ippAddSeparator</a></li>
365 <li><a href="#ippAddString">ippAddString</a></li>
366 <li><a href="#ippAddStringf">ippAddStringf</a></li>
367 <li><a href="#ippAddStringfv">ippAddStringfv</a></li>
368 <li><a href="#ippAddStrings">ippAddStrings</a></li>
369 <li><a href="#ippAttributeString">ippAttributeString</a></li>
370 <li><a href="#ippContainsInteger">ippContainsInteger</a></li>
371 <li><a href="#ippContainsString">ippContainsString</a></li>
372 <li><a href="#ippCopyAttribute">ippCopyAttribute</a></li>
373 <li><a href="#ippCopyAttributes">ippCopyAttributes</a></li>
374 <li><a href="#ippCreateRequestedArray">ippCreateRequestedArray</a></li>
375 <li><a href="#ippDateToTime">ippDateToTime</a></li>
376 <li><a href="#ippDelete">ippDelete</a></li>
377 <li><a href="#ippDeleteAttribute">ippDeleteAttribute</a></li>
378 <li><a href="#ippDeleteValues">ippDeleteValues</a></li>
379 <li><a href="#ippEnumString">ippEnumString</a></li>
380 <li><a href="#ippEnumValue">ippEnumValue</a></li>
381 <li><a href="#ippErrorString">ippErrorString</a></li>
382 <li><a href="#ippErrorValue">ippErrorValue</a></li>
383 <li><a href="#ippFindAttribute">ippFindAttribute</a></li>
384 <li><a href="#ippFindNextAttribute">ippFindNextAttribute</a></li>
385 <li><a href="#ippFirstAttribute">ippFirstAttribute</a></li>
386 <li><a href="#ippGetBoolean">ippGetBoolean</a></li>
387 <li><a href="#ippGetCollection">ippGetCollection</a></li>
388 <li><a href="#ippGetCount">ippGetCount</a></li>
389 <li><a href="#ippGetDate">ippGetDate</a></li>
390 <li><a href="#ippGetGroupTag">ippGetGroupTag</a></li>
391 <li><a href="#ippGetInteger">ippGetInteger</a></li>
392 <li><a href="#ippGetName">ippGetName</a></li>
393 <li><a href="#ippGetOctetString">ippGetOctetString</a></li>
394 <li><a href="#ippGetOperation">ippGetOperation</a></li>
395 <li><a href="#ippGetRange">ippGetRange</a></li>
396 <li><a href="#ippGetRequestId">ippGetRequestId</a></li>
397 <li><a href="#ippGetResolution">ippGetResolution</a></li>
398 <li><a href="#ippGetState">ippGetState</a></li>
399 <li><a href="#ippGetStatusCode">ippGetStatusCode</a></li>
400 <li><a href="#ippGetString">ippGetString</a></li>
401 <li><a href="#ippGetValueTag">ippGetValueTag</a></li>
402 <li><a href="#ippGetVersion">ippGetVersion</a></li>
403 <li><a href="#ippLength">ippLength</a></li>
404 <li><a href="#ippNew">ippNew</a></li>
405 <li><a href="#ippNewRequest">ippNewRequest</a></li>
406 <li><a href="#ippNewResponse">ippNewResponse</a></li>
407 <li><a href="#ippNextAttribute">ippNextAttribute</a></li>
408 <li><a href="#ippOpString">ippOpString</a></li>
409 <li><a href="#ippOpValue">ippOpValue</a></li>
410 <li><a href="#ippPort">ippPort</a></li>
411 <li><a href="#ippRead">ippRead</a></li>
412 <li><a href="#ippReadFile">ippReadFile</a></li>
413 <li><a href="#ippReadIO">ippReadIO</a></li>
414 <li><a href="#ippSetBoolean">ippSetBoolean</a></li>
415 <li><a href="#ippSetCollection">ippSetCollection</a></li>
416 <li><a href="#ippSetDate">ippSetDate</a></li>
417 <li><a href="#ippSetGroupTag">ippSetGroupTag</a></li>
418 <li><a href="#ippSetInteger">ippSetInteger</a></li>
419 <li><a href="#ippSetName">ippSetName</a></li>
420 <li><a href="#ippSetOctetString">ippSetOctetString</a></li>
421 <li><a href="#ippSetOperation">ippSetOperation</a></li>
422 <li><a href="#ippSetPort">ippSetPort</a></li>
423 <li><a href="#ippSetRange">ippSetRange</a></li>
424 <li><a href="#ippSetRequestId">ippSetRequestId</a></li>
425 <li><a href="#ippSetResolution">ippSetResolution</a></li>
426 <li><a href="#ippSetState">ippSetState</a></li>
427 <li><a href="#ippSetStatusCode">ippSetStatusCode</a></li>
428 <li><a href="#ippSetString">ippSetString</a></li>
429 <li><a href="#ippSetStringf">ippSetStringf</a></li>
430 <li><a href="#ippSetStringfv">ippSetStringfv</a></li>
431 <li><a href="#ippSetValueTag">ippSetValueTag</a></li>
432 <li><a href="#ippSetVersion">ippSetVersion</a></li>
433 <li><a href="#ippStateString">ippStateString</a></li>
434 <li><a href="#ippTagString">ippTagString</a></li>
435 <li><a href="#ippTagValue">ippTagValue</a></li>
436 <li><a href="#ippTimeToDate">ippTimeToDate</a></li>
437 <li><a href="#ippValidateAttribute">ippValidateAttribute</a></li>
438 <li><a href="#ippValidateAttributes">ippValidateAttributes</a></li>
439 <li><a href="#ippWrite">ippWrite</a></li>
440 <li><a href="#ippWriteFile">ippWriteFile</a></li>
441 <li><a href="#ippWriteIO">ippWriteIO</a></li>
798d6e29
MS
442 </ul></li>
443 <li><a href="#TYPES">Data Types</a><ul class="subcontents">
798d6e29 444 <li><a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a></li>
798d6e29
MS
445 <li><a href="#cups_dest_cb_t">cups_dest_cb_t</a></li>
446 <li><a href="#cups_dest_t">cups_dest_t</a></li>
447 <li><a href="#cups_dinfo_t">cups_dinfo_t</a></li>
798d6e29 448 <li><a href="#cups_job_t">cups_job_t</a></li>
798d6e29
MS
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>
798d6e29
MS
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>
798d6e29 454 <li><a href="#http_addr_t">http_addr_t</a></li>
798d6e29
MS
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>
798d6e29
MS
465 <li><a href="#ipp_attribute_t">ipp_attribute_t</a></li>
466 <li><a href="#ipp_copycb_t">ipp_copycb_t</a></li>
798d6e29 467 <li><a href="#ipp_iocb_t">ipp_iocb_t</a></li>
798d6e29
MS
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>
798d6e29
MS
474 </ul></li>
475 <li><a href="#STRUCTURES">Structures</a><ul class="subcontents">
798d6e29
MS
476 <li><a href="#cups_dest_s">cups_dest_s</a></li>
477 <li><a href="#cups_job_s">cups_job_s</a></li>
798d6e29
MS
478 <li><a href="#cups_option_s">cups_option_s</a></li>
479 <li><a href="#cups_size_s">cups_size_s</a></li>
798d6e29 480 </ul></li>
798d6e29 481 <li><a href="#ENUMERATIONS">Enumerations</a><ul class="subcontents">
798d6e29 482 <li><a href="#cups_ptype_e">cups_ptype_e</a></li>
798d6e29
MS
483 <li><a href="#http_encoding_e">http_encoding_e</a></li>
484 <li><a href="#http_encryption_e">http_encryption_e</a></li>
485 <li><a href="#http_field_e">http_field_e</a></li>
486 <li><a href="#http_keepalive_e">http_keepalive_e</a></li>
487 <li><a href="#http_state_e">http_state_e</a></li>
488 <li><a href="#http_status_e">http_status_e</a></li>
489 <li><a href="#http_trust_e">http_trust_e</a></li>
490 <li><a href="#http_uri_coding_e">http_uri_coding_e</a></li>
491 <li><a href="#http_uri_status_e">http_uri_status_e</a></li>
798d6e29 492 <li><a href="#ipp_finishings_e">ipp_finishings_e</a></li>
798d6e29
MS
493 <li><a href="#ipp_jstate_e">ipp_jstate_e</a></li>
494 <li><a href="#ipp_op_e">ipp_op_e</a></li>
495 <li><a href="#ipp_orient_e">ipp_orient_e</a></li>
496 <li><a href="#ipp_pstate_e">ipp_pstate_e</a></li>
497 <li><a href="#ipp_quality_e">ipp_quality_e</a></li>
498 <li><a href="#ipp_res_e">ipp_res_e</a></li>
499 <li><a href="#ipp_state_e">ipp_state_e</a></li>
500 <li><a href="#ipp_status_e">ipp_status_e</a></li>
501 <li><a href="#ipp_tag_e">ipp_tag_e</a></li>
502 </ul></li>
503 </ul>
504 </div>
505 <div class="body">
506 <blockquote>
507 <p>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>
508</blockquote>
53af7f21 509 <h2><a id="introduction">Introduction</a></h2>
798d6e29
MS
510 <p>CUPS provides the &quot;cups&quot; library to talk to the different parts of CUPS and with Internet Printing Protocol (IPP) printers. The &quot;cups&quot; library functions are accessed by including the <code>&lt;cups/cups.h&gt;</code> header.</p>
511 <p>CUPS is based on the Internet Printing Protocol (&quot;IPP&quot;), which allows clients (applications) to communicate with a server (the scheduler, printers, etc.) to get a list of destinations, send print jobs, and so forth. You identify which server you want to communicate with using a pointer to the opaque structure <code>http_t</code>. The <code>CUPS_HTTP_DEFAULT</code> constant can be used when you want to talk to the CUPS scheduler.</p>
53af7f21 512 <h3><a id="guidelines">Guidelines</a></h3>
798d6e29
MS
513 <p>When writing software that uses the &quot;cups&quot; library:</p>
514 <ul>
515 <li>Do not use undocumented or deprecated APIs,</li>
516 <li>Do not rely on pre-configured printers,</li>
517 <li>Do not assume that printers support specific features or formats, and</li>
518 <li>Do not rely on implementation details (PPDs, etc.)</li>
519</ul>
520 <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>
521 <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>
53af7f21 522 <h3><a id="terms-used-in-this-document">Terms Used in This Document</a></h3>
9c44e2cb 523 <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>
53af7f21 524 <h3><a id="compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></h3>
798d6e29
MS
525 <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>
526 <p>The following simple program lists the available destinations:</p>
527 <pre><code>#include &lt;stdio.h&gt;
528#include &lt;cups/cups.h&gt;
529
530int print_dest(void *user_data, unsigned flags, cups_dest_t *dest)
531{
532 if (dest-&gt;instance)
533 printf(&quot;%s/%s\n&quot;, dest-&gt;name, dest-&gt;instance);
534 else
535 puts(dest-&gt;name);
536
537 return (1);
538}
539
540int main(void)
541{
542 cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, 0, 0, print_dest, NULL);
543
544 return (0);
545}
546</code></pre>
53af7f21 547 <h4><a id="compiling-with-xcode">Compiling with Xcode</a></h4>
9c44e2cb
MS
548 <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>
549 <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>
798d6e29 550 <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>
53af7f21 551 <h4><a id="compiling-with-gcc">Compiling with GCC</a></h4>
798d6e29
MS
552 <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>
553 <pre><code>gcc -o simple `cups-config --cflags` simple.c `cups-config --libs`
554./simple
555</code></pre>
9c44e2cb 556 <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>
53af7f21 557 <h2><a id="working-with-destinations">Working with Destinations</a></h2>
9c44e2cb 558 <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>
798d6e29 559 <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>
53af7f21 560 <h3><a id="finding-available-destinations">Finding Available Destinations</a></h3>
798d6e29
MS
561 <p>The <code>cupsEnumDests</code> function finds all of the available destinations:</p>
562 <pre><code> int
563 cupsEnumDests(unsigned flags, int msec, int *cancel,
564 cups_ptype_t type, cups_ptype_t mask,
565 cups_dest_cb_t cb, void *user_data)
566</code></pre>
567 <p>The <code>flags</code> argument specifies enumeration options, which at present must be <code>CUPS_DEST_FLAGS_NONE</code>.</p>
568 <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>
569 <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>
53af7f21 570 <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>
798d6e29
MS
571 <ul>
572 <li><code>CUPS_PRINTER_CLASS</code>: A collection of destinations.</li>
573 <li><code>CUPS_PRINTER_FAX</code>: A facsimile device.</li>
53af7f21
MS
574 <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>
575 <li><code>CUPS_PRINTER_REMOTE</code>: A remote (shared) printer or class.</li>
576 <li><code>CUPS_PRINTER_DISCOVERED</code>: An available network printer or class.</li>
798d6e29
MS
577 <li><code>CUPS_PRINTER_BW</code>: Can do B&amp;W printing.</li>
578 <li><code>CUPS_PRINTER_COLOR</code>: Can do color printing.</li>
579 <li><code>CUPS_PRINTER_DUPLEX</code>: Can do two-sided printing.</li>
580 <li><code>CUPS_PRINTER_STAPLE</code>: Can staple output.</li>
581 <li><code>CUPS_PRINTER_COLLATE</code>: Can quickly collate copies.</li>
582 <li><code>CUPS_PRINTER_PUNCH</code>: Can punch output.</li>
583 <li><code>CUPS_PRINTER_COVER</code>: Can cover output.</li>
584 <li><code>CUPS_PRINTER_BIND</code>: Can bind output.</li>
585 <li><code>CUPS_PRINTER_SORT</code>: Can sort output (mailboxes, etc.)</li>
586 <li><code>CUPS_PRINTER_SMALL</code>: Can print on Letter/Legal/A4-size media.</li>
587 <li><code>CUPS_PRINTER_MEDIUM</code>: Can print on Tabloid/B/C/A3/A2-size media.</li>
588 <li><code>CUPS_PRINTER_LARGE</code>: Can print on D/E/A1/A0-size media.</li>
589 <li><code>CUPS_PRINTER_VARIABLE</code>: Can print on rolls and custom-size media.</li>
590</ul>
591 <p>The <code>cb</code> argument specifies a function to call for every destination that is found:</p>
592 <pre><code>typedef int (*cups_dest_cb_t)(void *user_data,
593 unsigned flags,
594 cups_dest_t *dest);
595</code></pre>
9c44e2cb 596 <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>
798d6e29
MS
597 <ul>
598 <li><code>CUPS_DEST_FLAGS_MORE</code>: There are more destinations coming.</li>
599 <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>
600 <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>
601</ul>
602 <p>The callback function returns 0 to stop enumeration or 1 to continue.</p>
718ee2ff
MS
603 <blockquote>
604 <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>
605</blockquote>
798d6e29
MS
606 <p>The following example shows how to use <code>cupsEnumDests</code> to get a filtered array of destinations:</p>
607 <pre><code>typedef struct
608{
609 int num_dests;
610 cups_dest_t *dests;
611} my_user_data_t;
612
613int
614my_dest_cb(my_user_data_t *user_data, unsigned flags,
615 cups_dest_t *dest)
616{
617 if (flags &amp; CUPS_DEST_FLAGS_REMOVED)
618 {
619 /*
620 * Remove destination from array...
621 */
622
623 user_data-&gt;num_dests =
624 cupsRemoveDest(dest-&gt;name, dest-&gt;instance,
625 user_data-&gt;num_dests,
626 &amp;(user_data-&gt;dests));
627 }
628 else
629 {
630 /*
631 * Add destination to array...
632 */
633
634 user_data-&gt;num_dests =
635 cupsCopyDest(dest, user_data-&gt;num_dests,
636 &amp;(user_data-&gt;dests));
637 }
638
639 return (1);
640}
641
642int
643my_get_dests(cups_ptype_t type, cups_ptype_t mask,
644 cups_dest_t **dests)
645{
646 my_user_data_t user_data = { 0, NULL };
647
648 if (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, type,
649 mask, (cups_dest_cb_t)my_dest_cb,
650 &amp;user_data))
651 {
652 /*
653 * An error occurred, free all of the destinations and
654 * return...
655 */
656
657 cupsFreeDests(user_data.num_dests, user_dasta.dests);
658
659 *dests = NULL;
660
661 return (0);
662 }
663
664 /*
665 * Return the destination array...
666 */
667
668 *dests = user_data.dests;
669
670 return (user_data.num_dests);
671}
672</code></pre>
53af7f21 673 <h3><a id="basic-destination-information">Basic Destination Information</a></h3>
798d6e29
MS
674 <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>
675 <ul>
676 <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>
677 <li>&quot;printer-info&quot;: The human-readable description of the destination such as &quot;My Laser Printer&quot;.</li>
678 <li>&quot;printer-is-accepting-jobs&quot;: &quot;true&quot; if the destination is accepting new jobs, &quot;false&quot; otherwise.</li>
679 <li>&quot;printer-is-shared&quot;: &quot;true&quot; if the destination is being shared with other computers, &quot;false&quot; otherwise.</li>
680 <li>&quot;printer-location&quot;: The human-readable location of the destination such as &quot;Lab 4&quot;.</li>
681 <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>
682 <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>
683 <li>&quot;printer-state-change-time&quot;: The UNIX time when the destination entered the current state.</li>
684 <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>
685 <li>&quot;printer-type&quot;: The <code>cups_ptype_t</code> value associated with the destination.</li>
53af7f21 686 <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>
798d6e29
MS
687</ul>
688 <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>
689 <pre><code>const char *model = cupsGetOption(&quot;printer-make-and-model&quot;,
690 dest-&gt;num_options,
691 dest-&gt;options);
692</code></pre>
53af7f21 693 <h3><a id="detailed-destination-information">Detailed Destination Information</a></h3>
798d6e29
MS
694 <p>Once a destination has been chosen, the <code>cupsCopyDestInfo</code> function can be used to gather detailed information about the destination:</p>
695 <pre><code>cups_dinfo_t *
696cupsCopyDestInfo(http_t *http, cups_dest_t *dest);
697</code></pre>
698 <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>
699 <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>
53af7f21 700 <h4><a id="getting-supported-options-and-values">Getting Supported Options and Values</a></h4>
798d6e29
MS
701 <p>The <code>cupsCheckDestSupported</code> function can be used to test whether a particular option or option and value is supported:</p>
702 <pre><code>int
703cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
704 cups_dinfo_t *info,
705 const char *option,
706 const char *value);
707</code></pre>
708 <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>
709 <ul>
710 <li><code>CUPS_COPIES</code>: Controls the number of copies that are produced.</li>
711 <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>
712 <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>
713 <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>
714 <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>
715 <li><code>CUPS_NUMBER_UP</code>: Controls the number of document pages that are placed on each media side.</li>
716 <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>
9c44e2cb 717 <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>
798d6e29
MS
718 <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>
719 <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>
720</ul>
721 <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>
722 <p>The <code>cupsFindDestSupported</code> function returns the IPP attribute containing the supported values for a given option:</p>
723 <pre><code> ipp_attribute_t *
724 cupsFindDestSupported(http_t *http, cups_dest_t *dest,
725 cups_dinfo_t *dinfo,
726 const char *option);
727</code></pre>
728 <p>For example, the following code prints the supported finishing processes for a destination, if any, to the standard output:</p>
729 <pre><code>cups_dinfo_t *info = cupsCopyDestInfo(CUPS_HTTP_DEFAULT,
730 dest);
731
732if (cupsCheckDestSupported(CUPS_HTTP_DEFAULT, dest, info,
733 CUPS_FINISHINGS, NULL))
734{
735 ipp_attribute_t *finishings =
736 cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
737 CUPS_FINISHINGS);
738 int i, count = ippGetCount(finishings);
739
740 puts(&quot;finishings supported:&quot;);
741 for (i = 0; i &lt; count; i ++)
742 printf(&quot; %d\n&quot;, ippGetInteger(finishings, i));
743}
744else
745 puts(&quot;finishings not supported.&quot;);
746</code></pre>
747 <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>
748 <pre><code>ipp_attribute_t *attrs =
749 cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
750 &quot;job-creation-attributes&quot;);
751int i, count = ippGetCount(attrs);
752
753for (i = 0; i &lt; count; i ++)
754 puts(ippGetString(attrs, i, NULL));
755</code></pre>
53af7f21 756 <h4><a id="getting-default-values">Getting Default Values</a></h4>
798d6e29
MS
757 <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>
758 <pre><code>ipp_attribute_t *
759cupsFindDestDefault(http_t *http, cups_dest_t *dest,
760 cups_dinfo_t *dinfo,
761 const char *option);
762</code></pre>
763 <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>
764 <pre><code>const char *def_value =
765 cupsGetOption(CUPS_FINISHINGS, dest-&gt;num_options,
766 dest-&gt;options);
767ipp_attribute_t *def_attr =
768 cupsFindDestDefault(CUPS_HTTP_DEFAULT, dest, info,
769 CUPS_FINISHINGS);
770
771if (def_value != NULL)
772{
773 printf(&quot;Default finishings: %s\n&quot;, def_value);
774}
775else
776{
777 int i, count = ippGetCount(def_attr);
778
779 printf(&quot;Default finishings: %d&quot;,
780 ippGetInteger(def_attr, 0));
781 for (i = 1; i &lt; count; i ++)
782 printf(&quot;,%d&quot;, ippGetInteger(def_attr, i));
783 putchar('\n');
784}
785</code></pre>
53af7f21 786 <h4><a id="getting-ready-loaded-values">Getting Ready (Loaded) Values</a></h4>
798d6e29
MS
787 <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>
788 <p>The <code>cupsFindDestReady</code> function finds the IPP attribute containing the ready values for a given option:</p>
789 <pre><code>ipp_attribute_t *
790cupsFindDestReady(http_t *http, cups_dest_t *dest,
791 cups_dinfo_t *dinfo, const char *option);
792</code></pre>
793 <p>For example, the following code lists the ready finishing processes:</p>
794 <pre><code>ipp_attribute_t *ready_finishings =
795 cupsFindDestReady(CUPS_HTTP_DEFAULT, dest, info,
796 CUPS_FINISHINGS);
797
798if (ready_finishings != NULL)
799{
800 int i, count = ippGetCount(ready_finishings);
801
802 puts(&quot;finishings ready:&quot;);
803 for (i = 0; i &lt; count; i ++)
804 printf(&quot; %d\n&quot;, ippGetInteger(ready_finishings, i));
805}
806else
807 puts(&quot;no finishings are ready.&quot;);
808</code></pre>
53af7f21 809 <h4><a id="media-size-options">Media Size Options</a></h4>
798d6e29
MS
810 <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>
811 <pre><code>typedef struct cups_size_s
812{
813 char media[128];
814 int width, length;
815 int bottom, left, right, top;
816} cups_size_t;
817</code></pre>
818 <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>
819 <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>
820 <pre><code>int
821cupsGetDestMediaByName(http_t *http, cups_dest_t *dest,
822 cups_dinfo_t *dinfo,
823 const char *media,
824 unsigned flags, cups_size_t *size);
825
826int
827cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest,
828 cups_dinfo_t *dinfo,
829 int width, int length,
830 unsigned flags, cups_size_t *size);
831</code></pre>
832 <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>
833 <ul>
834 <li><code>CUPS_MEDIA_FLAGS_DEFAULT</code>: Find the closest size supported by the printer.</li>
835 <li><code>CUPS_MEDIA_FLAGS_BORDERLESS</code>: Find a borderless size.</li>
836 <li><code>CUPS_MEDIA_FLAGS_DUPLEX</code>: Find a size compatible with two-sided printing.</li>
837 <li><code>CUPS_MEDIA_FLAGS_EXACT</code>: Find an exact match for the size.</li>
838 <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>
839</ul>
840 <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>
841 <p>For example, the following code prints the margins for two-sided printing on US Letter media:</p>
842 <pre><code>cups_size_t size;
843
844if (cupsGetDestMediaByName(CUPS_HTTP_DEFAULT, dest, info,
845 CUPS_MEDIA_LETTER,
846 CUPS_MEDIA_FLAGS_DUPLEX, &amp;size))
847{
848 puts(&quot;Margins for duplex US Letter:&quot;);
849 printf(&quot; Bottom: %.2fin\n&quot;, size.bottom / 2540.0);
850 printf(&quot; Left: %.2fin\n&quot;, size.left / 2540.0);
851 printf(&quot; Right: %.2fin\n&quot;, size.right / 2540.0);
852 printf(&quot; Top: %.2fin\n&quot;, size.top / 2540.0);
853}
854else
855 puts(&quot;Margins for duplex US Letter are not available.&quot;);
856</code></pre>
857 <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>
858 <pre><code>int
859cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest,
860 cups_dinfo_t *dinfo, int n,
861 unsigned flags, cups_size_t *size);
862
863int
864cupsGetDestMediaCount(http_t *http, cups_dest_t *dest,
865 cups_dinfo_t *dinfo, unsigned flags);
866</code></pre>
867 <p>For example, the following code prints the list of ready media and corresponding margins:</p>
868 <pre><code>cups_size_t size;
869int i;
870int count = cupsGetDestMediaCount(CUPS_HTTP_DEFAULT,
871 dest, info,
872 CUPS_MEDIA_FLAGS_READY);
873
874for (i = 0; i &lt; count; i ++)
875{
876 if (cupsGetDestMediaByIndex(CUPS_HTTP_DEFAULT, dest, info,
877 i, CUPS_MEDIA_FLAGS_READY,
878 &amp;size))
879 {
880 printf(&quot;%s:\n&quot;, size.name);
881 printf(&quot; Width: %.2fin\n&quot;, size.width / 2540.0);
882 printf(&quot; Length: %.2fin\n&quot;, size.length / 2540.0);
883 printf(&quot; Bottom: %.2fin\n&quot;, size.bottom / 2540.0);
884 printf(&quot; Left: %.2fin\n&quot;, size.left / 2540.0);
885 printf(&quot; Right: %.2fin\n&quot;, size.right / 2540.0);
886 printf(&quot; Top: %.2fin\n&quot;, size.top / 2540.0);
887 }
888}
889</code></pre>
890 <p>Finally, the <code>cupsGetDestMediaDefault</code> function returns the default media size:</p>
891 <pre><code>int
892cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
893 cups_dinfo_t *dinfo, unsigned flags,
894 cups_size_t *size);
895</code></pre>
53af7f21 896 <h4><a id="localizing-options-and-values">Localizing Options and Values</a></h4>
798d6e29
MS
897 <p>CUPS provides three functions to get localized versions of options and values: <code>cupsLocalizeDestMedia</code>, <code>cupsLocalizeDestOption</code>, and <code>cupsLocalizeDestValue</code>:</p>
898 <pre><code>const char *
899cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest,
900 cups_dinfo_t *info, unsigned flags,
901 cups_size_t *size);
902
903const char *
904cupsLocalizeDestOption(http_t *http, cups_dest_t *dest,
905 cups_dinfo_t *info,
906 const char *option);
907
908const char *
909cupsLocalizeDestValue(http_t *http, cups_dest_t *dest,
910 cups_dinfo_t *info,
911 const char *option, const char *value);
912</code></pre>
53af7f21 913 <h3><a id="submitting-a-print-job">Submitting a Print Job</a></h3>
798d6e29
MS
914 <p>Once you are ready to submit a print job, you create a job using the <code>cupsCreateDestJob</code> function:</p>
915 <pre><code>ipp_status_t
916cupsCreateDestJob(http_t *http, cups_dest_t *dest,
917 cups_dinfo_t *info, int *job_id,
918 const char *title, int num_options,
919 cups_option_t *options);
920</code></pre>
921 <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>
922 <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>
923 <p>For example, the following code creates a new job that will print 42 copies of a two-sided US Letter document:</p>
924 <pre><code>int job_id = 0;
925int num_options = 0;
926cups_option_t *options = NULL;
927
928num_options = cupsAddOption(CUPS_COPIES, &quot;42&quot;,
929 num_options, &amp;options);
930num_options = cupsAddOption(CUPS_MEDIA, CUPS_MEDIA_LETTER,
931 num_options, &amp;options);
932num_options = cupsAddOption(CUPS_SIDES,
933 CUPS_SIDES_TWO_SIDED_PORTRAIT,
934 num_options, &amp;options);
935
936if (cupsCreateDestJob(CUPS_HTTP_DEFAULT, dest, info,
937 &amp;job_id, &quot;My Document&quot;, num_options,
938 options) == IPP_STATUS_OK)
939 printf(&quot;Created job: %d\n&quot;, job_id);
940else
941 printf(&quot;Unable to create job: %s\n&quot;,
942 cupsLastErrorString());
943</code></pre>
944 <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>
945 <pre><code>http_status_t
946cupsStartDestDocument(http_t *http, cups_dest_t *dest,
947 cups_dinfo_t *info, int job_id,
948 const char *docname,
949 const char *format,
950 int num_options,
951 cups_option_t *options,
952 int last_document);
953
954http_status_t
955cupsWriteRequestData(http_t *http, const char *buffer,
956 size_t length);
957
958ipp_status_t
959cupsFinishDestDocument(http_t *http, cups_dest_t *dest,
960 cups_dinfo_t *info);
961</code></pre>
962 <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>
963 <ul>
964 <li><code>CUPS_FORMAT_JPEG</code>: &quot;image/jpeg&quot;</li>
965 <li><code>CUPS_FORMAT_PDF</code>: &quot;application/pdf&quot;</li>
966 <li><code>CUPS_FORMAT_POSTSCRIPT</code>: &quot;application/postscript&quot;</li>
967 <li><code>CUPS_FORMAT_TEXT</code>: &quot;text/plain&quot;</li>
968</ul>
969 <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>
970 <p>For example, the following code submits a PDF file to the job that was just created:</p>
971 <pre><code>FILE *fp = fopen(&quot;filename.pdf&quot;, &quot;rb&quot;);
972size_t bytes;
973char buffer[65536];
974
975if (cupsStartDestDocument(CUPS_HTTP_DEFAULT, dest, info,
976 job_id, &quot;filename.pdf&quot;, 0, NULL,
977 1) == HTTP_STATUS_CONTINUE)
978{
979 while ((bytes = fread(buffer, 1, sizeof(buffer), fp)) &gt; 0)
980 if (cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer,
981 bytes) != HTTP_STATUS_CONTINUE)
982 break;
983
984 if (cupsFinishDestDocument(CUPS_HTTP_DEFAULT, dest,
985 info) == IPP_STATUS_OK)
986 puts(&quot;Document send succeeded.&quot;);
987 else
988 printf(&quot;Document send failed: %s\n&quot;,
989 cupsLastErrorString());
990}
991
992fclose(fp);
993</code></pre>
994 <h2 class="title"><a id="FUNCTIONS">Functions</a></h2>
995<h3 class="function"><a id="cupsAddDest">cupsAddDest</a></h3>
996 <p class="description">Add a destination to the list of destinations.</p>
997<p class="code">
98d88c8d
MS
998int cupsAddDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
999<h4 class="parameters">Parameters</h4>
1000<table class="list"><tbody>
1001<tr><th>name</th>
1002 <td class="description">Destination name</td></tr>
1003<tr><th>instance</th>
1004 <td class="description">Instance name or <code>NULL</code> for none/primary</td></tr>
1005<tr><th>num_dests</th>
1006 <td class="description">Number of destinations</td></tr>
1007<tr><th>dests</th>
1008 <td class="description">Destinations</td></tr>
1009</tbody></table>
798d6e29
MS
1010<h4 class="returnvalue">Return Value</h4>
1011 <p class="description">New number of destinations</p>
1012<h4 class="discussion">Discussion</h4>
1013 <p class="discussion">This function cannot be used to add a new class or printer queue,
1014it only adds a new container of saved options for the named
1015destination or instance.<br>
1016<br>
1017If the named destination already exists, the destination list is
1018returned unchanged. Adding a new instance of a destination creates
1019a copy of that destination's options.<br>
1020<br>
1021Use the <a href="#cupsSaveDests"><code>cupsSaveDests</code></a> function to save the updated list of
1022destinations to the user's lpoptions file.</p>
98d88c8d 1023<h3 class="function"><span class="info">&#160;CUPS 2.2.4/macOS 10.13&#160;</span><a id="cupsAddIntegerOption">cupsAddIntegerOption</a></h3>
53af7f21 1024 <p class="description">Add an integer option to an option array.</p>
798d6e29 1025<p class="code">
98d88c8d
MS
1026int cupsAddIntegerOption(const char *name, int value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
1027<h4 class="parameters">Parameters</h4>
1028<table class="list"><tbody>
1029<tr><th>name</th>
1030 <td class="description">Name of option</td></tr>
1031<tr><th>value</th>
1032 <td class="description">Value of option</td></tr>
1033<tr><th>num_options</th>
1034 <td class="description">Number of options</td></tr>
1035<tr><th>options</th>
1036 <td class="description">Pointer to options</td></tr>
1037</tbody></table>
798d6e29
MS
1038<h4 class="returnvalue">Return Value</h4>
1039 <p class="description">Number of options</p>
1040<h4 class="discussion">Discussion</h4>
1041 <p class="discussion">New option arrays can be initialized simply by passing 0 for the
53af7f21 1042&quot;num_options&quot; parameter.
798d6e29
MS
1043
1044</p>
53af7f21
MS
1045<h3 class="function"><a id="cupsAddOption">cupsAddOption</a></h3>
1046 <p class="description">Add an option to an option array.</p>
798d6e29 1047<p class="code">
98d88c8d
MS
1048int cupsAddOption(const char *name, const char *value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
1049<h4 class="parameters">Parameters</h4>
1050<table class="list"><tbody>
1051<tr><th>name</th>
1052 <td class="description">Name of option</td></tr>
1053<tr><th>value</th>
1054 <td class="description">Value of option</td></tr>
1055<tr><th>num_options</th>
1056 <td class="description">Number of options</td></tr>
1057<tr><th>options</th>
1058 <td class="description">Pointer to options</td></tr>
1059</tbody></table>
798d6e29 1060<h4 class="returnvalue">Return Value</h4>
53af7f21 1061 <p class="description">Number of options</p>
798d6e29 1062<h4 class="discussion">Discussion</h4>
53af7f21
MS
1063 <p class="discussion">New option arrays can be initialized simply by passing 0 for the
1064&quot;num_options&quot; parameter.</p>
98d88c8d 1065<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCancelDestJob">cupsCancelDestJob</a></h3>
798d6e29 1066 <p class="description">Cancel a job on a destination.</p>
98d88c8d
MS
1067<p class="code">
1068ipp_status_t cupsCancelDestJob(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, int job_id);</p>
1069<h4 class="parameters">Parameters</h4>
1070<table class="list"><tbody>
1071<tr><th>http</th>
1072 <td class="description">Connection to destination</td></tr>
1073<tr><th>dest</th>
1074 <td class="description">Destination</td></tr>
1075<tr><th>job_id</th>
1076 <td class="description">Job ID</td></tr>
1077</tbody></table>
1078<h4 class="returnvalue">Return Value</h4>
1079 <p class="description">Status of cancel operation</p>
1080<h4 class="discussion">Discussion</h4>
798d6e29
MS
1081 <p class="discussion">The &quot;job_id&quot; is the number returned by cupsCreateDestJob.<br>
1082<br>
1083Returns <code>IPP_STATUS_OK</code> on success and
98d88c8d 1084<code>IPP_STATUS_ERROR_NOT_AUTHORIZED</code> or
798d6e29
MS
1085<code>IPP_STATUS_ERROR_FORBIDDEN</code> on failure.
1086
798d6e29
MS
1087</p>
1088<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCheckDestSupported">cupsCheckDestSupported</a></h3>
1089 <p class="description">Check that the option and value are supported
1090by the destination.</p>
1091<p class="code">
98d88c8d
MS
1092int cupsCheckDestSupported(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option, const char *value);</p>
1093<h4 class="parameters">Parameters</h4>
1094<table class="list"><tbody>
1095<tr><th>http</th>
1096 <td class="description">Connection to destination</td></tr>
1097<tr><th>dest</th>
1098 <td class="description">Destination</td></tr>
1099<tr><th>dinfo</th>
1100 <td class="description">Destination information</td></tr>
1101<tr><th>option</th>
1102 <td class="description">Option</td></tr>
1103<tr><th>value</th>
1104 <td class="description">Value</td></tr>
1105</tbody></table>
798d6e29
MS
1106<h4 class="returnvalue">Return Value</h4>
1107 <p class="description">1 if supported, 0 otherwise</p>
1108<h4 class="discussion">Discussion</h4>
1109 <p class="discussion">Returns 1 if supported, 0 otherwise.
1110
1111</p>
1112<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCloseDestJob">cupsCloseDestJob</a></h3>
1113 <p class="description">Close a job and start printing.</p>
1114<p class="code">
98d88c8d
MS
1115ipp_status_t cupsCloseDestJob(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info, int job_id);</p>
1116<h4 class="parameters">Parameters</h4>
1117<table class="list"><tbody>
1118<tr><th>http</th>
1119 <td class="description">Connection to destination</td></tr>
1120<tr><th>dest</th>
1121 <td class="description">Destination</td></tr>
1122<tr><th>info</th>
1123 <td class="description">Destination information</td></tr>
1124<tr><th>job_id</th>
1125 <td class="description">Job ID</td></tr>
1126</tbody></table>
798d6e29
MS
1127<h4 class="returnvalue">Return Value</h4>
1128 <p class="description">IPP status code</p>
1129<h4 class="discussion">Discussion</h4>
1130 <p class="discussion">Use when the last call to cupsStartDocument passed 0 for &quot;last_document&quot;.
1131&quot;job_id&quot; is the job ID returned by cupsCreateDestJob. Returns <code>IPP_STATUS_OK</code>
1132on success.
1133
1134</p>
1135<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsConnectDest">cupsConnectDest</a></h3>
98d88c8d
MS
1136 <p class="description">Open a conection to the destination.</p>
1137<p class="code">
1138<a href="#http_t">http_t</a> *cupsConnectDest(<a href="#cups_dest_t">cups_dest_t</a> *dest, unsigned flags, int msec, int *cancel, char *resource, size_t resourcesize, <a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb, void *user_data);</p>
1139<h4 class="parameters">Parameters</h4>
1140<table class="list"><tbody>
1141<tr><th>dest</th>
1142 <td class="description">Destination</td></tr>
1143<tr><th>flags</th>
1144 <td class="description">Connection flags</td></tr>
1145<tr><th>msec</th>
1146 <td class="description">Timeout in milliseconds</td></tr>
1147<tr><th>cancel</th>
1148 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
1149<tr><th>resource</th>
1150 <td class="description">Resource buffer</td></tr>
1151<tr><th>resourcesize</th>
1152 <td class="description">Size of resource buffer</td></tr>
1153<tr><th>cb</th>
1154 <td class="description">Callback function</td></tr>
1155<tr><th>user_data</th>
1156 <td class="description">User data pointer</td></tr>
1157</tbody></table>
1158<h4 class="returnvalue">Return Value</h4>
1159 <p class="description">Connection to destination or <code>NULL</code></p>
1160<h4 class="discussion">Discussion</h4>
1161 <p class="discussion">Connect to the destination, returning a new <code>http_t</code> connection object
1162and optionally the resource path to use for the destination. These calls
1163will block until a connection is made, the timeout expires, the integer
1164pointed to by &quot;cancel&quot; is non-zero, or the callback function (or block)
1165returns 0. The caller is responsible for calling <a href="#httpClose"><code>httpClose</code></a> on the
1166returned connection.
798d6e29
MS
1167
1168</p>
53af7f21
MS
1169<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDest">cupsCopyDest</a></h3>
1170 <p class="description">Copy a destination.</p>
798d6e29 1171<p class="code">
98d88c8d
MS
1172int cupsCopyDest(<a href="#cups_dest_t">cups_dest_t</a> *dest, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
1173<h4 class="parameters">Parameters</h4>
1174<table class="list"><tbody>
1175<tr><th>dest</th>
1176 <td class="description">Destination to copy</td></tr>
1177<tr><th>num_dests</th>
1178 <td class="description">Number of destinations</td></tr>
1179<tr><th>dests</th>
1180 <td class="description">Destination array</td></tr>
1181</tbody></table>
798d6e29
MS
1182<h4 class="returnvalue">Return Value</h4>
1183 <p class="description">New number of destinations</p>
1184<h4 class="discussion">Discussion</h4>
1185 <p class="discussion">Make a copy of the destination to an array of destinations (or just a single
1186copy) - for use with the cupsEnumDests* functions. The caller is responsible
1187for calling cupsFreeDests() on the returned object(s).
1188
1189</p>
1190<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDestConflicts">cupsCopyDestConflicts</a></h3>
1191 <p class="description">Get conflicts and resolutions for a new
1192option/value pair.</p>
1193<p class="code">
98d88c8d
MS
1194int cupsCopyDestConflicts(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, int num_options, <a href="#cups_option_t">cups_option_t</a> *options, const char *new_option, const char *new_value, int *num_conflicts, <a href="#cups_option_t">cups_option_t</a> **conflicts, int *num_resolved, <a href="#cups_option_t">cups_option_t</a> **resolved);</p>
1195<h4 class="parameters">Parameters</h4>
1196<table class="list"><tbody>
1197<tr><th>http</th>
1198 <td class="description">Connection to destination</td></tr>
1199<tr><th>dest</th>
1200 <td class="description">Destination</td></tr>
1201<tr><th>dinfo</th>
1202 <td class="description">Destination information</td></tr>
1203<tr><th>num_options</th>
1204 <td class="description">Number of current options</td></tr>
1205<tr><th>options</th>
1206 <td class="description">Current options</td></tr>
1207<tr><th>new_option</th>
1208 <td class="description">New option</td></tr>
1209<tr><th>new_value</th>
1210 <td class="description">New value</td></tr>
1211<tr><th>num_conflicts</th>
1212 <td class="description">Number of conflicting options</td></tr>
1213<tr><th>conflicts</th>
1214 <td class="description">Conflicting options</td></tr>
1215<tr><th>num_resolved</th>
1216 <td class="description">Number of options to resolve</td></tr>
1217<tr><th>resolved</th>
1218 <td class="description">Resolved options</td></tr>
1219</tbody></table>
798d6e29
MS
1220<h4 class="returnvalue">Return Value</h4>
1221 <p class="description">1 if there is a conflict, 0 if none, -1 on error</p>
1222<h4 class="discussion">Discussion</h4>
1223 <p class="discussion">&quot;num_options&quot; and &quot;options&quot; represent the currently selected options by the
1224user. &quot;new_option&quot; and &quot;new_value&quot; are the setting the user has just
1225changed.<br>
1226<br>
1227Returns 1 if there is a conflict, 0 if there are no conflicts, and -1 if
1228there was an unrecoverable error such as a resolver loop.<br>
1229<br>
1230If &quot;num_conflicts&quot; and &quot;conflicts&quot; are not <code>NULL</code>, they are set to
1231contain the list of conflicting option/value pairs. Similarly, if
1232&quot;num_resolved&quot; and &quot;resolved&quot; are not <code>NULL</code> they will be set to the
1233list of changes needed to resolve the conflict.<br>
1234<br>
1235If cupsCopyDestConflicts returns 1 but &quot;num_resolved&quot; and &quot;resolved&quot; are set
1236to 0 and <code>NULL</code>, respectively, then the conflict cannot be resolved.
1237
1238</p>
1239<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDestInfo">cupsCopyDestInfo</a></h3>
1240 <p class="description">Get the supported values/capabilities for the
1241destination.</p>
1242<p class="code">
98d88c8d 1243<a href="#cups_dinfo_t">cups_dinfo_t</a> *cupsCopyDestInfo(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest);</p>
798d6e29 1244<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1245<table class="list"><tbody>
1246<tr><th>http</th>
1247 <td class="description">Connection to destination</td></tr>
1248<tr><th>dest</th>
1249 <td class="description">Destination</td></tr>
1250</tbody></table>
798d6e29
MS
1251<h4 class="returnvalue">Return Value</h4>
1252 <p class="description">Destination information</p>
1253<h4 class="discussion">Discussion</h4>
1254 <p class="discussion">The caller is responsible for calling <a href="#cupsFreeDestInfo"><code>cupsFreeDestInfo</code></a> on the return
1255value. <code>NULL</code> is returned on error.
1256
1257</p>
1258<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCreateDestJob">cupsCreateDestJob</a></h3>
1259 <p class="description">Create a job on a destination.</p>
1260<p class="code">
98d88c8d
MS
1261ipp_status_t cupsCreateDestJob(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info, int *job_id, const char *title, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
1262<h4 class="parameters">Parameters</h4>
1263<table class="list"><tbody>
1264<tr><th>http</th>
1265 <td class="description">Connection to destination</td></tr>
1266<tr><th>dest</th>
1267 <td class="description">Destination</td></tr>
1268<tr><th>info</th>
1269 <td class="description">Destination information</td></tr>
1270<tr><th>job_id</th>
1271 <td class="description">Job ID or 0 on error</td></tr>
1272<tr><th>title</th>
1273 <td class="description">Job name</td></tr>
1274<tr><th>num_options</th>
1275 <td class="description">Number of job options</td></tr>
1276<tr><th>options</th>
1277 <td class="description">Job options</td></tr>
1278</tbody></table>
798d6e29
MS
1279<h4 class="returnvalue">Return Value</h4>
1280 <p class="description">IPP status code</p>
1281<h4 class="discussion">Discussion</h4>
1282 <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success, saving the job ID
1283in the variable pointed to by &quot;job_id&quot;.
1284
1285</p>
798d6e29
MS
1286<h3 class="function"><span class="info">&#160;CUPS 1.1.20/macOS 10.4&#160;</span><a id="cupsDoAuthentication">cupsDoAuthentication</a></h3>
1287 <p class="description">Authenticate a request.</p>
1288<p class="code">
98d88c8d
MS
1289int cupsDoAuthentication(<a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p>
1290<h4 class="parameters">Parameters</h4>
1291<table class="list"><tbody>
1292<tr><th>http</th>
1293 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
1294<tr><th>method</th>
1295 <td class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</td></tr>
1296<tr><th>resource</th>
1297 <td class="description">Resource path</td></tr>
1298</tbody></table>
798d6e29
MS
1299<h4 class="returnvalue">Return Value</h4>
1300 <p class="description">0 on success, -1 on error</p>
1301<h4 class="discussion">Discussion</h4>
1302 <p class="discussion">This function should be called in response to a <code>HTTP_STATUS_UNAUTHORIZED</code>
1303status, prior to resubmitting your request.
1304
1305</p>
1306<h3 class="function"><a id="cupsEncodeOptions">cupsEncodeOptions</a></h3>
53af7f21 1307 <p class="description">Encode printer options into IPP attributes.</p>
98d88c8d
MS
1308<p class="code">
1309void cupsEncodeOptions(<a href="#ipp_t">ipp_t</a> *ipp, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
1310<h4 class="parameters">Parameters</h4>
1311<table class="list"><tbody>
1312<tr><th>ipp</th>
1313 <td class="description">Request to add to</td></tr>
1314<tr><th>num_options</th>
1315 <td class="description">Number of options</td></tr>
1316<tr><th>options</th>
1317 <td class="description">Options</td></tr>
1318</tbody></table>
1319<h4 class="discussion">Discussion</h4>
798d6e29 1320 <p class="discussion">This function adds operation, job, and then subscription attributes,
98d88c8d
MS
1321in that order. Use the <a href="#cupsEncodeOptions2"><code>cupsEncodeOptions2</code></a> function to add attributes
1322for a single group.</p>
1323<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsEncodeOptions2">cupsEncodeOptions2</a></h3>
53af7f21 1324 <p class="description">Encode printer options into IPP attributes for a group.</p>
98d88c8d
MS
1325<p class="code">
1326void cupsEncodeOptions2(<a href="#ipp_t">ipp_t</a> *ipp, int num_options, <a href="#cups_option_t">cups_option_t</a> *options, ipp_tag_t group_tag);</p>
1327<h4 class="parameters">Parameters</h4>
1328<table class="list"><tbody>
1329<tr><th>ipp</th>
1330 <td class="description">Request to add to</td></tr>
1331<tr><th>num_options</th>
1332 <td class="description">Number of options</td></tr>
1333<tr><th>options</th>
1334 <td class="description">Options</td></tr>
1335<tr><th>group_tag</th>
1336 <td class="description">Group to encode</td></tr>
1337</tbody></table>
1338<h4 class="discussion">Discussion</h4>
798d6e29 1339 <p class="discussion">This function only adds attributes for a single group. Call this
98d88c8d 1340function multiple times for each group, or use <a href="#cupsEncodeOptions"><code>cupsEncodeOptions</code></a>
798d6e29
MS
1341to add the standard groups.
1342
1343</p>
1344<h3 class="function"><a id="cupsEncryption">cupsEncryption</a></h3>
1345 <p class="description">Get the current encryption settings.</p>
1346<p class="code">
98d88c8d 1347<a href="#http_encryption_t">http_encryption_t</a> cupsEncryption(void);</p>
798d6e29
MS
1348<h4 class="returnvalue">Return Value</h4>
1349 <p class="description">Encryption settings</p>
1350<h4 class="discussion">Discussion</h4>
1351 <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
1352environment variable, then the ~/.cups/client.conf file, and finally the
1353/etc/cups/client.conf file. If not set, the default is
1354<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
1355<br>
1356Note: The current encryption setting is tracked separately for each thread
1357in a program. Multi-threaded programs that override the setting via the
1358<a href="#cupsSetEncryption"><code>cupsSetEncryption</code></a> function need to do so in each thread for the same
1359setting to be used.</p>
1360<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsEnumDests">cupsEnumDests</a></h3>
1361 <p class="description">Enumerate available destinations with a callback function.</p>
1362<p class="code">
98d88c8d
MS
1363int cupsEnumDests(unsigned flags, int msec, int *cancel, <a href="#cups_ptype_t">cups_ptype_t</a> type, <a href="#cups_ptype_t">cups_ptype_t</a> mask, <a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb, void *user_data);</p>
1364<h4 class="parameters">Parameters</h4>
1365<table class="list"><tbody>
1366<tr><th>flags</th>
1367 <td class="description">Enumeration flags</td></tr>
1368<tr><th>msec</th>
1369 <td class="description">Timeout in milliseconds, -1 for indefinite</td></tr>
1370<tr><th>cancel</th>
1371 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
1372<tr><th>type</th>
1373 <td class="description">Printer type bits</td></tr>
1374<tr><th>mask</th>
1375 <td class="description">Mask for printer type bits</td></tr>
1376<tr><th>cb</th>
1377 <td class="description">Callback function</td></tr>
1378<tr><th>user_data</th>
1379 <td class="description">User data</td></tr>
1380</tbody></table>
798d6e29
MS
1381<h4 class="returnvalue">Return Value</h4>
1382 <p class="description">1 on success, 0 on failure</p>
1383<h4 class="discussion">Discussion</h4>
53af7f21
MS
1384 <p class="discussion">Destinations are enumerated from one or more sources. The callback function
1385receives the <code>user_data</code> pointer and the destination pointer which can
1386be used as input to the <a href="#cupsCopyDest"><code>cupsCopyDest</code></a> function. The function must
1387return 1 to continue enumeration or 0 to stop.<br>
798d6e29 1388<br>
53af7f21
MS
1389The <code>type</code> and <code>mask</code> arguments allow the caller to filter the
1390destinations that are enumerated. Passing 0 for both will enumerate all
1391printers. The constant <code>CUPS_PRINTER_DISCOVERED</code> is used to filter on
1392destinations that are available but have not yet been added locally.<br>
798d6e29
MS
1393<br>
1394Enumeration happens on the current thread and does not return until all
718ee2ff
MS
1395destinations have been enumerated or the callback function returns 0.<br>
1396<br>
1397Note: The callback function will likely receive multiple updates for the same
1398destinations - it is up to the caller to suppress any duplicate destinations.
798d6e29
MS
1399
1400</p>
798d6e29
MS
1401<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestDefault">cupsFindDestDefault</a></h3>
1402 <p class="description">Find the default value(s) for the given option.</p>
1403<p class="code">
98d88c8d
MS
1404<a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestDefault(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option);</p>
1405<h4 class="parameters">Parameters</h4>
1406<table class="list"><tbody>
1407<tr><th>http</th>
1408 <td class="description">Connection to destination</td></tr>
1409<tr><th>dest</th>
1410 <td class="description">Destination</td></tr>
1411<tr><th>dinfo</th>
1412 <td class="description">Destination information</td></tr>
1413<tr><th>option</th>
1414 <td class="description">Option/attribute name</td></tr>
1415</tbody></table>
798d6e29
MS
1416<h4 class="returnvalue">Return Value</h4>
1417 <p class="description">Default attribute or <code>NULL</code> for none</p>
1418<h4 class="discussion">Discussion</h4>
1419 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1420<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1421<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1422<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1423functions to inspect the default value(s) as needed.
1424
1425</p>
1426<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestReady">cupsFindDestReady</a></h3>
1427 <p class="description">Find the default value(s) for the given option.</p>
1428<p class="code">
98d88c8d
MS
1429<a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestReady(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option);</p>
1430<h4 class="parameters">Parameters</h4>
1431<table class="list"><tbody>
1432<tr><th>http</th>
1433 <td class="description">Connection to destination</td></tr>
1434<tr><th>dest</th>
1435 <td class="description">Destination</td></tr>
1436<tr><th>dinfo</th>
1437 <td class="description">Destination information</td></tr>
1438<tr><th>option</th>
1439 <td class="description">Option/attribute name</td></tr>
1440</tbody></table>
798d6e29
MS
1441<h4 class="returnvalue">Return Value</h4>
1442 <p class="description">Default attribute or <code>NULL</code> for none</p>
1443<h4 class="discussion">Discussion</h4>
1444 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1445<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1446<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1447<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1448functions to inspect the default value(s) as needed.
1449
1450</p>
1451<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestSupported">cupsFindDestSupported</a></h3>
1452 <p class="description">Find the default value(s) for the given option.</p>
1453<p class="code">
98d88c8d
MS
1454<a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestSupported(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option);</p>
1455<h4 class="parameters">Parameters</h4>
1456<table class="list"><tbody>
1457<tr><th>http</th>
1458 <td class="description">Connection to destination</td></tr>
1459<tr><th>dest</th>
1460 <td class="description">Destination</td></tr>
1461<tr><th>dinfo</th>
1462 <td class="description">Destination information</td></tr>
1463<tr><th>option</th>
1464 <td class="description">Option/attribute name</td></tr>
1465</tbody></table>
798d6e29
MS
1466<h4 class="returnvalue">Return Value</h4>
1467 <p class="description">Default attribute or <code>NULL</code> for none</p>
1468<h4 class="discussion">Discussion</h4>
1469 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1470<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1471<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1472<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1473functions to inspect the default value(s) as needed.
1474
1475</p>
1476<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsFinishDestDocument">cupsFinishDestDocument</a></h3>
1477 <p class="description">Finish the current document.</p>
1478<p class="code">
98d88c8d
MS
1479ipp_status_t cupsFinishDestDocument(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info);</p>
1480<h4 class="parameters">Parameters</h4>
1481<table class="list"><tbody>
1482<tr><th>http</th>
1483 <td class="description">Connection to destination</td></tr>
1484<tr><th>dest</th>
1485 <td class="description">Destination</td></tr>
1486<tr><th>info</th>
1487 <td class="description">Destination information</td></tr>
1488</tbody></table>
798d6e29
MS
1489<h4 class="returnvalue">Return Value</h4>
1490 <p class="description">Status of document submission</p>
1491<h4 class="discussion">Discussion</h4>
1492 <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success.
1493
798d6e29 1494</p>
98d88c8d 1495<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsFreeDestInfo">cupsFreeDestInfo</a></h3>
53af7f21
MS
1496 <p class="description">Free destination information obtained using
1497<a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a>.</p>
798d6e29 1498<p class="code">
98d88c8d 1499void cupsFreeDestInfo(<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo);</p>
798d6e29 1500<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1501<table class="list"><tbody>
1502<tr><th>dinfo</th>
1503 <td class="description">Destination information</td></tr>
1504</tbody></table>
1505<h3 class="function"><a id="cupsFreeDests">cupsFreeDests</a></h3>
53af7f21 1506 <p class="description">Free the memory used by the list of destinations.</p>
798d6e29 1507<p class="code">
98d88c8d 1508void cupsFreeDests(int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
798d6e29 1509<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1510<table class="list"><tbody>
1511<tr><th>num_dests</th>
1512 <td class="description">Number of destinations</td></tr>
1513<tr><th>dests</th>
1514 <td class="description">Destinations</td></tr>
1515</tbody></table>
1516<h3 class="function"><a id="cupsFreeJobs">cupsFreeJobs</a></h3>
53af7f21 1517 <p class="description">Free memory used by job data.</p>
798d6e29 1518<p class="code">
98d88c8d 1519void cupsFreeJobs(int num_jobs, <a href="#cups_job_t">cups_job_t</a> *jobs);</p>
798d6e29 1520<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1521<table class="list"><tbody>
1522<tr><th>num_jobs</th>
1523 <td class="description">Number of jobs</td></tr>
1524<tr><th>jobs</th>
1525 <td class="description">Jobs</td></tr>
1526</tbody></table>
1527<h3 class="function"><a id="cupsFreeOptions">cupsFreeOptions</a></h3>
53af7f21 1528 <p class="description">Free all memory used by options.</p>
98d88c8d
MS
1529<p class="code">
1530void cupsFreeOptions(int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
1531<h4 class="parameters">Parameters</h4>
1532<table class="list"><tbody>
1533<tr><th>num_options</th>
1534 <td class="description">Number of options</td></tr>
1535<tr><th>options</th>
1536 <td class="description">Pointer to options</td></tr>
1537</tbody></table>
798d6e29
MS
1538<h3 class="function"><a id="cupsGetDest">cupsGetDest</a></h3>
1539 <p class="description">Get the named destination from the list.</p>
1540<p class="code">
98d88c8d
MS
1541<a href="#cups_dest_t">cups_dest_t</a> *cupsGetDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
1542<h4 class="parameters">Parameters</h4>
1543<table class="list"><tbody>
1544<tr><th>name</th>
1545 <td class="description">Destination name or <code>NULL</code> for the default destination</td></tr>
1546<tr><th>instance</th>
1547 <td class="description">Instance name or <code>NULL</code></td></tr>
1548<tr><th>num_dests</th>
1549 <td class="description">Number of destinations</td></tr>
1550<tr><th>dests</th>
1551 <td class="description">Destinations</td></tr>
1552</tbody></table>
798d6e29
MS
1553<h4 class="returnvalue">Return Value</h4>
1554 <p class="description">Destination pointer or <code>NULL</code></p>
1555<h4 class="discussion">Discussion</h4>
98d88c8d 1556 <p class="discussion">Use the <a href="#cupsEnumDests"><code>cupsEnumDests</code></a> or <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> functions to get a
798d6e29
MS
1557list of supported destinations for the current user.</p>
1558<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></h3>
1559 <p class="description">Get a media name, dimension, and margins for a
1560specific size.</p>
1561<p class="code">
98d88c8d
MS
1562int cupsGetDestMediaByIndex(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, int n, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p>
1563<h4 class="parameters">Parameters</h4>
1564<table class="list"><tbody>
1565<tr><th>http</th>
1566 <td class="description">Connection to destination</td></tr>
1567<tr><th>dest</th>
1568 <td class="description">Destination</td></tr>
1569<tr><th>dinfo</th>
1570 <td class="description">Destination information</td></tr>
1571<tr><th>n</th>
1572 <td class="description">Media size number (0-based)</td></tr>
1573<tr><th>flags</th>
1574 <td class="description">Media flags</td></tr>
1575<tr><th>size</th>
1576 <td class="description">Media size information</td></tr>
1577</tbody></table>
798d6e29
MS
1578<h4 class="returnvalue">Return Value</h4>
1579 <p class="description">1 on success, 0 on failure</p>
1580<h4 class="discussion">Discussion</h4>
1581 <p class="discussion">The <code>flags</code> parameter determines which set of media are indexed. For
1582example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will get the Nth
1583borderless size supported by the printer.
1584
1585</p>
1586<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsGetDestMediaByName">cupsGetDestMediaByName</a></h3>
1587 <p class="description">Get media names, dimensions, and margins.</p>
1588<p class="code">
98d88c8d
MS
1589int cupsGetDestMediaByName(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *media, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p>
1590<h4 class="parameters">Parameters</h4>
1591<table class="list"><tbody>
1592<tr><th>http</th>
1593 <td class="description">Connection to destination</td></tr>
1594<tr><th>dest</th>
1595 <td class="description">Destination</td></tr>
1596<tr><th>dinfo</th>
1597 <td class="description">Destination information</td></tr>
1598<tr><th>media</th>
1599 <td class="description">Media name</td></tr>
1600<tr><th>flags</th>
1601 <td class="description">Media matching flags</td></tr>
1602<tr><th>size</th>
1603 <td class="description">Media size information</td></tr>
1604</tbody></table>
798d6e29
MS
1605<h4 class="returnvalue">Return Value</h4>
1606 <p class="description">1 on match, 0 on failure</p>
1607<h4 class="discussion">Discussion</h4>
1608 <p class="discussion">The &quot;media&quot; string is a PWG media name. &quot;Flags&quot; provides some matching
1609guidance (multiple flags can be combined):<br>
1610<br>
1611CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
1612CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
1613CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
1614CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
1615CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
1616size amongst the &quot;ready&quot; media.<br>
1617<br>
1618The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
1619<br>
1620Returns 1 when there is a match and 0 if there is not a match.
1621
1622</p>
1623<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></h3>
1624 <p class="description">Get media names, dimensions, and margins.</p>
1625<p class="code">
98d88c8d
MS
1626int cupsGetDestMediaBySize(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, int width, int length, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p>
1627<h4 class="parameters">Parameters</h4>
1628<table class="list"><tbody>
1629<tr><th>http</th>
1630 <td class="description">Connection to destination</td></tr>
1631<tr><th>dest</th>
1632 <td class="description">Destination</td></tr>
1633<tr><th>dinfo</th>
1634 <td class="description">Destination information</td></tr>
1635<tr><th>width</th>
1636 <td class="description">Media width in hundredths of
1637of millimeters</td></tr>
1638<tr><th>length</th>
1639 <td class="description">Media length in hundredths of
1640of millimeters</td></tr>
1641<tr><th>flags</th>
1642 <td class="description">Media matching flags</td></tr>
1643<tr><th>size</th>
1644 <td class="description">Media size information</td></tr>
1645</tbody></table>
798d6e29
MS
1646<h4 class="returnvalue">Return Value</h4>
1647 <p class="description">1 on match, 0 on failure</p>
1648<h4 class="discussion">Discussion</h4>
1649 <p class="discussion">&quot;Width&quot; and &quot;length&quot; are the dimensions in hundredths of millimeters.
1650&quot;Flags&quot; provides some matching guidance (multiple flags can be combined):<br>
1651<br>
1652CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
1653CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
1654CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
1655CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
1656CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
1657size amongst the &quot;ready&quot; media.<br>
1658<br>
1659The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
1660<br>
1661Returns 1 when there is a match and 0 if there is not a match.
1662
1663</p>
1664<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaCount">cupsGetDestMediaCount</a></h3>
1665 <p class="description">Get the number of sizes supported by a
1666destination.</p>
1667<p class="code">
98d88c8d
MS
1668int cupsGetDestMediaCount(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags);</p>
1669<h4 class="parameters">Parameters</h4>
1670<table class="list"><tbody>
1671<tr><th>http</th>
1672 <td class="description">Connection to destination</td></tr>
1673<tr><th>dest</th>
1674 <td class="description">Destination</td></tr>
1675<tr><th>dinfo</th>
1676 <td class="description">Destination information</td></tr>
1677<tr><th>flags</th>
1678 <td class="description">Media flags</td></tr>
1679</tbody></table>
798d6e29
MS
1680<h4 class="returnvalue">Return Value</h4>
1681 <p class="description">Number of sizes</p>
1682<h4 class="discussion">Discussion</h4>
1683 <p class="discussion">The <code>flags</code> parameter determines the set of media sizes that are
1684counted. For example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return
1685the number of borderless sizes.
1686
1687</p>
1688<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></h3>
1689 <p class="description">Get the default size for a destination.</p>
1690<p class="code">
98d88c8d
MS
1691int cupsGetDestMediaDefault(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p>
1692<h4 class="parameters">Parameters</h4>
1693<table class="list"><tbody>
1694<tr><th>http</th>
1695 <td class="description">Connection to destination</td></tr>
1696<tr><th>dest</th>
1697 <td class="description">Destination</td></tr>
1698<tr><th>dinfo</th>
1699 <td class="description">Destination information</td></tr>
1700<tr><th>flags</th>
1701 <td class="description">Media flags</td></tr>
1702<tr><th>size</th>
1703 <td class="description">Media size information</td></tr>
1704</tbody></table>
798d6e29
MS
1705<h4 class="returnvalue">Return Value</h4>
1706 <p class="description">1 on success, 0 on failure</p>
1707<h4 class="discussion">Discussion</h4>
1708 <p class="discussion">The <code>flags</code> parameter determines which default size is returned. For
1709example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the default
1710borderless size, typically US Letter or A4, but sometimes 4x6 photo media.
1711
1712</p>
1713<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsGetDestWithURI">cupsGetDestWithURI</a></h3>
1714 <p class="description">Get a destination associated with a URI.</p>
1715<p class="code">
98d88c8d 1716<a href="#cups_dest_t">cups_dest_t</a> *cupsGetDestWithURI(const char *name, const char *uri);</p>
798d6e29 1717<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1718<table class="list"><tbody>
1719<tr><th>name</th>
1720 <td class="description">Desired printer name or <code>NULL</code></td></tr>
1721<tr><th>uri</th>
1722 <td class="description">URI for the printer</td></tr>
1723</tbody></table>
798d6e29
MS
1724<h4 class="returnvalue">Return Value</h4>
1725 <p class="description">Destination or <code>NULL</code></p>
1726<h4 class="discussion">Discussion</h4>
1727 <p class="discussion">&quot;name&quot; is the desired name for the printer. If <code>NULL</code>, a name will be
1728created using the URI.<br>
1729<br>
1730&quot;uri&quot; is the &quot;ipp&quot; or &quot;ipps&quot; URI for the printer.
1731
1732</p>
98d88c8d
MS
1733<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetDests2">cupsGetDests2</a></h3>
1734 <p class="description">Get the list of destinations from the specified server.</p>
1735<p class="code">
1736int cupsGetDests2(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
1737<h4 class="parameters">Parameters</h4>
1738<table class="list"><tbody>
1739<tr><th>http</th>
1740 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
1741<tr><th>dests</th>
1742 <td class="description">Destinations</td></tr>
1743</tbody></table>
1744<h4 class="returnvalue">Return Value</h4>
1745 <p class="description">Number of destinations</p>
1746<h4 class="discussion">Discussion</h4>
1747 <p class="discussion">Starting with CUPS 1.2, the returned list of destinations include the
1748&quot;printer-info&quot;, &quot;printer-is-accepting-jobs&quot;, &quot;printer-is-shared&quot;,
1749&quot;printer-make-and-model&quot;, &quot;printer-state&quot;, &quot;printer-state-change-time&quot;,
1750&quot;printer-state-reasons&quot;, &quot;printer-type&quot;, and &quot;printer-uri-supported&quot;
1751attributes as options.<br>
1752<br>
1753CUPS 1.4 adds the &quot;marker-change-time&quot;, &quot;marker-colors&quot;,
1754&quot;marker-high-levels&quot;, &quot;marker-levels&quot;, &quot;marker-low-levels&quot;, &quot;marker-message&quot;,
1755&quot;marker-names&quot;, &quot;marker-types&quot;, and &quot;printer-commands&quot; attributes as options.<br>
1756<br>
1757CUPS 2.2 adds accessible IPP printers to the list of destinations that can
1758be used. The &quot;printer-uri-supported&quot; option will be present for those IPP
1759printers that have been recently used.<br>
1760<br>
1761Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and
1762the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination.
1763
1764</p>
1765<h3 class="function"><span class="info">&#160;CUPS 2.2.4/macOS 10.13&#160;</span><a id="cupsGetIntegerOption">cupsGetIntegerOption</a></h3>
53af7f21 1766 <p class="description">Get an integer option value.</p>
798d6e29 1767<p class="code">
98d88c8d
MS
1768int cupsGetIntegerOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
1769<h4 class="parameters">Parameters</h4>
1770<table class="list"><tbody>
1771<tr><th>name</th>
1772 <td class="description">Name of option</td></tr>
1773<tr><th>num_options</th>
1774 <td class="description">Number of options</td></tr>
1775<tr><th>options</th>
1776 <td class="description">Options</td></tr>
1777</tbody></table>
798d6e29 1778<h4 class="returnvalue">Return Value</h4>
53af7f21 1779 <p class="description">Option value or <code>INT_MIN</code></p>
798d6e29 1780<h4 class="discussion">Discussion</h4>
53af7f21
MS
1781 <p class="discussion">INT_MIN is returned when the option does not exist, is not an integer, or
1782exceeds the range of values for the &quot;int&quot; type.
1783
1784</p>
798d6e29
MS
1785<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetJobs2">cupsGetJobs2</a></h3>
1786 <p class="description">Get the jobs from the specified server.</p>
1787<p class="code">
98d88c8d
MS
1788int cupsGetJobs2(<a href="#http_t">http_t</a> *http, <a href="#cups_job_t">cups_job_t</a> **jobs, const char *name, int myjobs, int whichjobs);</p>
1789<h4 class="parameters">Parameters</h4>
1790<table class="list"><tbody>
1791<tr><th>http</th>
1792 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
1793<tr><th>jobs</th>
1794 <td class="description">Job data</td></tr>
1795<tr><th>name</th>
1796 <td class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</td></tr>
1797<tr><th>myjobs</th>
1798 <td class="description">0 = all users, 1 = mine</td></tr>
1799<tr><th>whichjobs</th>
1800 <td class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></td></tr>
1801</tbody></table>
798d6e29
MS
1802<h4 class="returnvalue">Return Value</h4>
1803 <p class="description">Number of jobs</p>
1804<h4 class="discussion">Discussion</h4>
1805 <p class="discussion">A &quot;whichjobs&quot; value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless
1806of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are
1807pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns
1808jobs that are stopped, canceled, aborted, or completed.
1809
1810</p>
1811<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsGetNamedDest">cupsGetNamedDest</a></h3>
1812 <p class="description">Get options for the named destination.</p>
1813<p class="code">
98d88c8d
MS
1814<a href="#cups_dest_t">cups_dest_t</a> *cupsGetNamedDest(<a href="#http_t">http_t</a> *http, const char *name, const char *instance);</p>
1815<h4 class="parameters">Parameters</h4>
1816<table class="list"><tbody>
1817<tr><th>http</th>
1818 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
1819<tr><th>name</th>
1820 <td class="description">Destination name or <code>NULL</code> for the default destination</td></tr>
1821<tr><th>instance</th>
1822 <td class="description">Instance name or <code>NULL</code></td></tr>
1823</tbody></table>
798d6e29
MS
1824<h4 class="returnvalue">Return Value</h4>
1825 <p class="description">Destination or <code>NULL</code></p>
1826<h4 class="discussion">Discussion</h4>
1827 <p class="discussion">This function is optimized for retrieving a single destination and should
98d88c8d
MS
1828be used instead of <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> when you
1829either know the name of the destination or want to print to the default
1830destination. If <code>NULL</code> is returned, the destination does not exist or
1831there is no default destination.<br>
798d6e29
MS
1832<br>
1833If &quot;http&quot; is <code>CUPS_HTTP_DEFAULT</code>, the connection to the default print
1834server will be used.<br>
1835<br>
1836If &quot;name&quot; is <code>NULL</code>, the default printer for the current user will be
1837returned.<br>
1838<br>
1839The returned destination must be freed using <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> with a
1840&quot;num_dests&quot; value of 1.
1841
1842</p>
1843<h3 class="function"><a id="cupsGetOption">cupsGetOption</a></h3>
1844 <p class="description">Get an option value.</p>
1845<p class="code">
98d88c8d
MS
1846const char *cupsGetOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
1847<h4 class="parameters">Parameters</h4>
1848<table class="list"><tbody>
1849<tr><th>name</th>
1850 <td class="description">Name of option</td></tr>
1851<tr><th>num_options</th>
1852 <td class="description">Number of options</td></tr>
1853<tr><th>options</th>
1854 <td class="description">Options</td></tr>
1855</tbody></table>
798d6e29
MS
1856<h4 class="returnvalue">Return Value</h4>
1857 <p class="description">Option value or <code>NULL</code></p>
798d6e29 1858<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsGetPassword2">cupsGetPassword2</a></h3>
98d88c8d 1859 <p class="description">Get a password from the user using the current
798d6e29
MS
1860password callback.</p>
1861<p class="code">
98d88c8d
MS
1862const char *cupsGetPassword2(const char *prompt, <a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p>
1863<h4 class="parameters">Parameters</h4>
1864<table class="list"><tbody>
1865<tr><th>prompt</th>
1866 <td class="description">Prompt string</td></tr>
1867<tr><th>http</th>
1868 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
1869<tr><th>method</th>
1870 <td class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</td></tr>
1871<tr><th>resource</th>
1872 <td class="description">Resource path</td></tr>
1873</tbody></table>
798d6e29
MS
1874<h4 class="returnvalue">Return Value</h4>
1875 <p class="description">Password</p>
1876<h4 class="discussion">Discussion</h4>
1877 <p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the
1878user does not provide a password.<br>
1879<br>
1880Note: The current password callback function is tracked separately for each
1881thread in a program. Multi-threaded programs that override the setting via
98d88c8d
MS
1882the <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> function need to do so in each thread for the
1883same function to be used.
798d6e29 1884
798d6e29 1885</p>
798d6e29
MS
1886<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></h3>
1887 <p class="description">Get the localized string for a destination media
1888size.</p>
1889<p class="code">
98d88c8d
MS
1890const char *cupsLocalizeDestMedia(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p>
1891<h4 class="parameters">Parameters</h4>
1892<table class="list"><tbody>
1893<tr><th>http</th>
1894 <td class="description">Connection to destination</td></tr>
1895<tr><th>dest</th>
1896 <td class="description">Destination</td></tr>
1897<tr><th>dinfo</th>
1898 <td class="description">Destination information</td></tr>
1899<tr><th>flags</th>
1900 <td class="description">Media flags</td></tr>
1901<tr><th>size</th>
1902 <td class="description">Media size</td></tr>
1903</tbody></table>
798d6e29
MS
1904<h4 class="returnvalue">Return Value</h4>
1905 <p class="description">Localized string</p>
1906<h4 class="discussion">Discussion</h4>
1907 <p class="discussion">The returned string is stored in the destination information and will become
1908invalid if the destination information is deleted.
1909
1910</p>
1911<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsLocalizeDestOption">cupsLocalizeDestOption</a></h3>
1912 <p class="description">Get the localized string for a destination
1913option.</p>
1914<p class="code">
98d88c8d
MS
1915const char *cupsLocalizeDestOption(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option);</p>
1916<h4 class="parameters">Parameters</h4>
1917<table class="list"><tbody>
1918<tr><th>http</th>
1919 <td class="description">Connection to destination</td></tr>
1920<tr><th>dest</th>
1921 <td class="description">Destination</td></tr>
1922<tr><th>dinfo</th>
1923 <td class="description">Destination information</td></tr>
1924<tr><th>option</th>
1925 <td class="description">Option to localize</td></tr>
1926</tbody></table>
798d6e29
MS
1927<h4 class="returnvalue">Return Value</h4>
1928 <p class="description">Localized string</p>
1929<h4 class="discussion">Discussion</h4>
1930 <p class="discussion">The returned string is stored in the destination information and will become
1931invalid if the destination information is deleted.
1932
1933</p>
1934<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsLocalizeDestValue">cupsLocalizeDestValue</a></h3>
1935 <p class="description">Get the localized string for a destination
1936option+value pair.</p>
1937<p class="code">
98d88c8d
MS
1938const char *cupsLocalizeDestValue(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option, const char *value);</p>
1939<h4 class="parameters">Parameters</h4>
1940<table class="list"><tbody>
1941<tr><th>http</th>
1942 <td class="description">Connection to destination</td></tr>
1943<tr><th>dest</th>
1944 <td class="description">Destination</td></tr>
1945<tr><th>dinfo</th>
1946 <td class="description">Destination information</td></tr>
1947<tr><th>option</th>
1948 <td class="description">Option to localize</td></tr>
1949<tr><th>value</th>
1950 <td class="description">Value to localize</td></tr>
1951</tbody></table>
798d6e29
MS
1952<h4 class="returnvalue">Return Value</h4>
1953 <p class="description">Localized string</p>
1954<h4 class="discussion">Discussion</h4>
1955 <p class="discussion">The returned string is stored in the destination information and will become
1956invalid if the destination information is deleted.
1957
1958</p>
1959<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="cupsMakeServerCredentials">cupsMakeServerCredentials</a></h3>
1960 <p class="description">Make a self-signed certificate and private key pair.</p>
1961<p class="code">
98d88c8d
MS
1962int cupsMakeServerCredentials(const char *path, const char *common_name, int num_alt_names, const char **alt_names, time_t expiration_date);</p>
1963<h4 class="parameters">Parameters</h4>
1964<table class="list"><tbody>
1965<tr><th>path</th>
1966 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
1967<tr><th>common_name</th>
1968 <td class="description">Common name</td></tr>
1969<tr><th>num_alt_names</th>
1970 <td class="description">Number of subject alternate names</td></tr>
1971<tr><th>alt_names</th>
1972 <td class="description">Subject Alternate Names</td></tr>
1973<tr><th>expiration_date</th>
1974 <td class="description">Expiration date</td></tr>
1975</tbody></table>
798d6e29
MS
1976<h4 class="returnvalue">Return Value</h4>
1977 <p class="description">1 on success, 0 on failure</p>
798d6e29
MS
1978<h3 class="function"><a id="cupsParseOptions">cupsParseOptions</a></h3>
1979 <p class="description">Parse options from a command-line argument.</p>
1980<p class="code">
98d88c8d
MS
1981int cupsParseOptions(const char *arg, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
1982<h4 class="parameters">Parameters</h4>
1983<table class="list"><tbody>
1984<tr><th>arg</th>
1985 <td class="description">Argument to parse</td></tr>
1986<tr><th>num_options</th>
1987 <td class="description">Number of options</td></tr>
1988<tr><th>options</th>
1989 <td class="description">Options found</td></tr>
1990</tbody></table>
798d6e29
MS
1991<h4 class="returnvalue">Return Value</h4>
1992 <p class="description">Number of options found</p>
1993<h4 class="discussion">Discussion</h4>
1994 <p class="discussion">This function converts space-delimited name/value pairs according
1995to the PAPI text option ABNF specification. Collection values
1996(&quot;name={a=... b=... c=...}&quot;) are stored with the curley brackets
1997intact - use <code>cupsParseOptions</code> on the value to extract the
1998collection attributes.</p>
798d6e29
MS
1999<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsRemoveDest">cupsRemoveDest</a></h3>
2000 <p class="description">Remove a destination from the destination list.</p>
2001<p class="code">
98d88c8d
MS
2002int cupsRemoveDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
2003<h4 class="parameters">Parameters</h4>
2004<table class="list"><tbody>
2005<tr><th>name</th>
2006 <td class="description">Destination name</td></tr>
2007<tr><th>instance</th>
2008 <td class="description">Instance name or <code>NULL</code></td></tr>
2009<tr><th>num_dests</th>
2010 <td class="description">Number of destinations</td></tr>
2011<tr><th>dests</th>
2012 <td class="description">Destinations</td></tr>
2013</tbody></table>
798d6e29
MS
2014<h4 class="returnvalue">Return Value</h4>
2015 <p class="description">New number of destinations</p>
2016<h4 class="discussion">Discussion</h4>
2017 <p class="discussion">Removing a destination/instance does not delete the class or printer
2018queue, merely the lpoptions for that destination/instance. Use the
2019<a href="#cupsSetDests"><code>cupsSetDests</code></a> or <a href="#cupsSetDests2"><code>cupsSetDests2</code></a> functions to save the new
2020options for the user.
2021
2022</p>
2023<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsRemoveOption">cupsRemoveOption</a></h3>
2024 <p class="description">Remove an option from an option array.</p>
2025<p class="code">
98d88c8d
MS
2026int cupsRemoveOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
2027<h4 class="parameters">Parameters</h4>
2028<table class="list"><tbody>
2029<tr><th>name</th>
2030 <td class="description">Option name</td></tr>
2031<tr><th>num_options</th>
2032 <td class="description">Current number of options</td></tr>
2033<tr><th>options</th>
2034 <td class="description">Options</td></tr>
2035</tbody></table>
798d6e29
MS
2036<h4 class="returnvalue">Return Value</h4>
2037 <p class="description">New number of options</p>
2038<h3 class="function"><a id="cupsServer">cupsServer</a></h3>
2039 <p class="description">Return the hostname/address of the current server.</p>
2040<p class="code">
98d88c8d 2041const char *cupsServer(void);</p>
798d6e29
MS
2042<h4 class="returnvalue">Return Value</h4>
2043 <p class="description">Server name</p>
2044<h4 class="discussion">Discussion</h4>
2045 <p class="discussion">The default server comes from the CUPS_SERVER environment variable, then the
2046~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not
2047set, the default is the local system - either &quot;localhost&quot; or a domain socket
2048path.<br>
2049<br>
2050The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6
2051address, or a domain socket pathname.<br>
2052<br>
2053Note: The current server is tracked separately for each thread in a program.
2054Multi-threaded programs that override the server via the
2055<a href="#cupsSetServer"><code>cupsSetServer</code></a> function need to do so in each thread for the same
2056server to be used.</p>
98d88c8d
MS
2057<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetClientCertCB">cupsSetClientCertCB</a></h3>
2058 <p class="description">Set the client certificate callback.</p>
798d6e29 2059<p class="code">
98d88c8d 2060void cupsSetClientCertCB(<a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a> cb, void *user_data);</p>
798d6e29 2061<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2062<table class="list"><tbody>
2063<tr><th>cb</th>
2064 <td class="description">Callback function</td></tr>
2065<tr><th>user_data</th>
2066 <td class="description">User data pointer</td></tr>
2067</tbody></table>
2068<h4 class="discussion">Discussion</h4>
798d6e29
MS
2069 <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
2070<br>
2071Note: The current certificate callback is tracked separately for each thread
2072in a program. Multi-threaded programs that override the callback need to do
2073so in each thread for the same callback to be used.
2074
2075</p>
2076<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetCredentials">cupsSetCredentials</a></h3>
2077 <p class="description">Set the default credentials to be used for SSL/TLS
2078connections.</p>
2079<p class="code">
98d88c8d 2080int cupsSetCredentials(cups_array_t *credentials);</p>
798d6e29 2081<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2082<table class="list"><tbody>
2083<tr><th>credentials</th>
2084 <td class="description">Array of credentials</td></tr>
2085</tbody></table>
798d6e29
MS
2086<h4 class="returnvalue">Return Value</h4>
2087 <p class="description">Status of call (0 = success)</p>
2088<h4 class="discussion">Discussion</h4>
2089 <p class="discussion">Note: The default credentials are tracked separately for each thread in a
2090program. Multi-threaded programs that override the setting need to do so in
2091each thread for the same setting to be used.
2092
2093</p>
98d88c8d 2094<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsSetDefaultDest">cupsSetDefaultDest</a></h3>
53af7f21 2095 <p class="description">Set the default destination.</p>
98d88c8d
MS
2096<p class="code">
2097void cupsSetDefaultDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
2098<h4 class="parameters">Parameters</h4>
2099<table class="list"><tbody>
2100<tr><th>name</th>
2101 <td class="description">Destination name</td></tr>
2102<tr><th>instance</th>
2103 <td class="description">Instance name or <code>NULL</code></td></tr>
2104<tr><th>num_dests</th>
2105 <td class="description">Number of destinations</td></tr>
2106<tr><th>dests</th>
2107 <td class="description">Destinations</td></tr>
2108</tbody></table>
798d6e29
MS
2109<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsSetDests2">cupsSetDests2</a></h3>
2110 <p class="description">Save the list of destinations for the specified server.</p>
2111<p class="code">
98d88c8d
MS
2112int cupsSetDests2(<a href="#http_t">http_t</a> *http, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
2113<h4 class="parameters">Parameters</h4>
2114<table class="list"><tbody>
2115<tr><th>http</th>
2116 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
2117<tr><th>num_dests</th>
2118 <td class="description">Number of destinations</td></tr>
2119<tr><th>dests</th>
2120 <td class="description">Destinations</td></tr>
2121</tbody></table>
798d6e29
MS
2122<h4 class="returnvalue">Return Value</h4>
2123 <p class="description">0 on success, -1 on error</p>
2124<h4 class="discussion">Discussion</h4>
2125 <p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run
2126as root and ~/.cups/lpoptions when run as a normal user.
2127
2128</p>
2129<h3 class="function"><a id="cupsSetEncryption">cupsSetEncryption</a></h3>
98d88c8d 2130 <p class="description">Set the encryption preference.</p>
798d6e29 2131<p class="code">
98d88c8d 2132void cupsSetEncryption(<a href="#http_encryption_t">http_encryption_t</a> e);</p>
798d6e29 2133<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2134<table class="list"><tbody>
2135<tr><th>e</th>
2136 <td class="description">New encryption preference</td></tr>
2137</tbody></table>
2138<h4 class="discussion">Discussion</h4>
798d6e29
MS
2139 <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
2140environment variable, then the ~/.cups/client.conf file, and finally the
2141/etc/cups/client.conf file. If not set, the default is
2142<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
2143<br>
2144Note: The current encryption setting is tracked separately for each thread
2145in a program. Multi-threaded programs that override the setting need to do
2146so in each thread for the same setting to be used.</p>
98d88c8d
MS
2147<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsSetPasswordCB2">cupsSetPasswordCB2</a></h3>
2148 <p class="description">Set the advanced password callback for CUPS.</p>
798d6e29 2149<p class="code">
98d88c8d 2150void cupsSetPasswordCB2(<a href="#cups_password_cb2_t">cups_password_cb2_t</a> cb, void *user_data);</p>
798d6e29 2151<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2152<table class="list"><tbody>
2153<tr><th>cb</th>
2154 <td class="description">Callback function</td></tr>
2155<tr><th>user_data</th>
2156 <td class="description">User data pointer</td></tr>
2157</tbody></table>
2158<h4 class="discussion">Discussion</h4>
798d6e29
MS
2159 <p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which
2160reads the password from the console. Programs should call either this
2161function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered
2162by a program per thread.<br>
2163<br>
2164Note: The current password callback is tracked separately for each thread
2165in a program. Multi-threaded programs that override the callback need to do
2166so in each thread for the same callback to be used.
2167
2168</p>
2169<h3 class="function"><a id="cupsSetServer">cupsSetServer</a></h3>
98d88c8d 2170 <p class="description">Set the default server name and port.</p>
798d6e29 2171<p class="code">
98d88c8d 2172void cupsSetServer(const char *server);</p>
798d6e29 2173<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2174<table class="list"><tbody>
2175<tr><th>server</th>
2176 <td class="description">Server name</td></tr>
2177</tbody></table>
2178<h4 class="discussion">Discussion</h4>
798d6e29
MS
2179 <p class="discussion">The &quot;server&quot; string can be a fully-qualified hostname, a numeric
2180IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP
2181addresses can be optionally followed by a colon and port number to override
2182the default port 631, e.g. &quot;hostname:8631&quot;. Pass <code>NULL</code> to restore the
2183default server name and port.<br>
2184<br>
2185Note: The current server is tracked separately for each thread in a program.
2186Multi-threaded programs that override the server need to do so in each
2187thread for the same server to be used.</p>
98d88c8d
MS
2188<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetServerCertCB">cupsSetServerCertCB</a></h3>
2189 <p class="description">Set the server certificate callback.</p>
798d6e29 2190<p class="code">
98d88c8d 2191void cupsSetServerCertCB(<a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a> cb, void *user_data);</p>
798d6e29 2192<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2193<table class="list"><tbody>
2194<tr><th>cb</th>
2195 <td class="description">Callback function</td></tr>
2196<tr><th>user_data</th>
2197 <td class="description">User data pointer</td></tr>
2198</tbody></table>
2199<h4 class="discussion">Discussion</h4>
798d6e29
MS
2200 <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
2201<br>
2202Note: The current credentials callback is tracked separately for each thread
2203in a program. Multi-threaded programs that override the callback need to do
2204so in each thread for the same callback to be used.
2205
2206</p>
2207<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsSetServerCredentials">cupsSetServerCredentials</a></h3>
2208 <p class="description">Set the default server credentials.</p>
2209<p class="code">
98d88c8d
MS
2210int cupsSetServerCredentials(const char *path, const char *common_name, int auto_create);</p>
2211<h4 class="parameters">Parameters</h4>
2212<table class="list"><tbody>
2213<tr><th>path</th>
2214 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
2215<tr><th>common_name</th>
2216 <td class="description">Default common name for server</td></tr>
2217<tr><th>auto_create</th>
2218 <td class="description">1 = automatically create self-signed certificates</td></tr>
2219</tbody></table>
798d6e29
MS
2220<h4 class="returnvalue">Return Value</h4>
2221 <p class="description">1 on success, 0 on failure</p>
2222<h4 class="discussion">Discussion</h4>
2223 <p class="discussion">Note: The server credentials are used by all threads in the running process.
2224This function is threadsafe.
2225
2226</p>
2227<h3 class="function"><a id="cupsSetUser">cupsSetUser</a></h3>
98d88c8d 2228 <p class="description">Set the default user name.</p>
798d6e29 2229<p class="code">
98d88c8d 2230void cupsSetUser(const char *user);</p>
798d6e29 2231<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2232<table class="list"><tbody>
2233<tr><th>user</th>
2234 <td class="description">User name</td></tr>
2235</tbody></table>
2236<h4 class="discussion">Discussion</h4>
798d6e29
MS
2237 <p class="discussion">Pass <code>NULL</code> to restore the default user name.<br>
2238<br>
2239Note: The current user name is tracked separately for each thread in a
2240program. Multi-threaded programs that override the user name need to do so
2241in each thread for the same user name to be used.</p>
98d88c8d
MS
2242<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsSetUserAgent">cupsSetUserAgent</a></h3>
2243 <p class="description">Set the default HTTP User-Agent string.</p>
798d6e29 2244<p class="code">
98d88c8d 2245void cupsSetUserAgent(const char *user_agent);</p>
798d6e29 2246<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2247<table class="list"><tbody>
2248<tr><th>user_agent</th>
2249 <td class="description">User-Agent string or <code>NULL</code></td></tr>
2250</tbody></table>
2251<h4 class="discussion">Discussion</h4>
798d6e29
MS
2252 <p class="discussion">Setting the string to NULL forces the default value containing the CUPS
2253version, IPP version, and operating system version and architecture.
2254
2255</p>
2256<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsStartDestDocument">cupsStartDestDocument</a></h3>
2257 <p class="description">Start a new document.</p>
2258<p class="code">
98d88c8d
MS
2259http_status_t cupsStartDestDocument(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info, int job_id, const char *docname, const char *format, int num_options, <a href="#cups_option_t">cups_option_t</a> *options, int last_document);</p>
2260<h4 class="parameters">Parameters</h4>
2261<table class="list"><tbody>
2262<tr><th>http</th>
2263 <td class="description">Connection to destination</td></tr>
2264<tr><th>dest</th>
2265 <td class="description">Destination</td></tr>
2266<tr><th>info</th>
2267 <td class="description">Destination information</td></tr>
2268<tr><th>job_id</th>
2269 <td class="description">Job ID</td></tr>
2270<tr><th>docname</th>
2271 <td class="description">Document name</td></tr>
2272<tr><th>format</th>
2273 <td class="description">Document format</td></tr>
2274<tr><th>num_options</th>
2275 <td class="description">Number of document options</td></tr>
2276<tr><th>options</th>
2277 <td class="description">Document options</td></tr>
2278<tr><th>last_document</th>
2279 <td class="description">1 if this is the last document</td></tr>
2280</tbody></table>
798d6e29
MS
2281<h4 class="returnvalue">Return Value</h4>
2282 <p class="description">Status of document creation</p>
2283<h4 class="discussion">Discussion</h4>
2284 <p class="discussion">&quot;job_id&quot; is the job ID returned by cupsCreateDestJob. &quot;docname&quot; is the name
2285of the document/file being printed, &quot;format&quot; is the MIME media type for the
2286document (see CUPS_FORMAT_xxx constants), and &quot;num_options&quot; and &quot;options&quot;
2287are the options do be applied to the document. &quot;last_document&quot; should be 1
2288if this is the last document to be submitted in the job. Returns
2289<code>HTTP_CONTINUE</code> on success.
2290
798d6e29
MS
2291</p>
2292<h3 class="function"><a id="cupsUser">cupsUser</a></h3>
2293 <p class="description">Return the current user's name.</p>
2294<p class="code">
98d88c8d 2295const char *cupsUser(void);</p>
798d6e29
MS
2296<h4 class="returnvalue">Return Value</h4>
2297 <p class="description">User name</p>
2298<h4 class="discussion">Discussion</h4>
2299 <p class="discussion">Note: The current user name is tracked separately for each thread in a
2300program. Multi-threaded programs that override the user name with the
2301<a href="#cupsSetUser"><code>cupsSetUser</code></a> function need to do so in each thread for the same user
2302name to be used.</p>
2303<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsUserAgent">cupsUserAgent</a></h3>
2304 <p class="description">Return the default HTTP User-Agent string.</p>
2305<p class="code">
98d88c8d 2306const char *cupsUserAgent(void);</p>
798d6e29
MS
2307<h4 class="returnvalue">Return Value</h4>
2308 <p class="description">User-Agent string</p>
2309<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAcceptConnection">httpAcceptConnection</a></h3>
2310 <p class="description">Accept a new HTTP client connection from the
2311specified listening socket.</p>
2312<p class="code">
98d88c8d 2313<a href="#http_t">http_t</a> *httpAcceptConnection(int fd, int blocking);</p>
798d6e29 2314<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2315<table class="list"><tbody>
2316<tr><th>fd</th>
2317 <td class="description">Listen socket file descriptor</td></tr>
2318<tr><th>blocking</th>
2319 <td class="description">1 if the connection should be
2320blocking, 0 otherwise</td></tr>
2321</tbody></table>
798d6e29
MS
2322<h4 class="returnvalue">Return Value</h4>
2323 <p class="description">HTTP connection or <code>NULL</code></p>
2324<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpAddCredential">httpAddCredential</a></h3>
2325 <p class="description">Allocates and adds a single credential to an array.</p>
2326<p class="code">
98d88c8d
MS
2327int httpAddCredential(cups_array_t *credentials, const void *data, size_t datalen);</p>
2328<h4 class="parameters">Parameters</h4>
2329<table class="list"><tbody>
2330<tr><th>credentials</th>
2331 <td class="description">Credentials array</td></tr>
2332<tr><th>data</th>
2333 <td class="description">PEM-encoded X.509 data</td></tr>
2334<tr><th>datalen</th>
2335 <td class="description">Length of data</td></tr>
2336</tbody></table>
798d6e29
MS
2337<h4 class="returnvalue">Return Value</h4>
2338 <p class="description">0 on success, -1 on error</p>
2339<h4 class="discussion">Discussion</h4>
2340 <p class="discussion">Use <code>cupsArrayNew(NULL, NULL)</code> to create a credentials array.
2341
2342</p>
2343<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrAny">httpAddrAny</a></h3>
2344 <p class="description">Check for the &quot;any&quot; address.</p>
2345<p class="code">
98d88c8d 2346int httpAddrAny(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2347<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2348<table class="list"><tbody>
2349<tr><th>addr</th>
2350 <td class="description">Address to check</td></tr>
2351</tbody></table>
798d6e29
MS
2352<h4 class="returnvalue">Return Value</h4>
2353 <p class="description">1 if &quot;any&quot;, 0 otherwise</p>
2354<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpAddrClose">httpAddrClose</a></h3>
2355 <p class="description">Close a socket created by <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> or
2356<a href="#httpAddrListen"><code>httpAddrListen</code></a>.</p>
2357<p class="code">
98d88c8d 2358int httpAddrClose(<a href="#http_addr_t">http_addr_t</a> *addr, int fd);</p>
798d6e29 2359<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2360<table class="list"><tbody>
2361<tr><th>addr</th>
2362 <td class="description">Listen address or <code>NULL</code></td></tr>
2363<tr><th>fd</th>
2364 <td class="description">Socket file descriptor</td></tr>
2365</tbody></table>
798d6e29
MS
2366<h4 class="returnvalue">Return Value</h4>
2367 <p class="description">0 on success, -1 on failure</p>
2368<h4 class="discussion">Discussion</h4>
98d88c8d
MS
2369 <p class="discussion">Pass <code>NULL</code> for sockets created with <a href="#httpAddrConnect2"><code>httpAddrConnect2</code></a> and the
2370listen address for sockets created with <a href="#httpAddrListen"><code>httpAddrListen</code></a>. This function
2371ensures that domain sockets are removed when closed.
798d6e29
MS
2372
2373</p>
798d6e29
MS
2374<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrConnect2">httpAddrConnect2</a></h3>
2375 <p class="description">Connect to any of the addresses in the list with a
2376timeout and optional cancel.</p>
2377<p class="code">
98d88c8d
MS
2378<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrConnect2(<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist, int *sock, int msec, int *cancel);</p>
2379<h4 class="parameters">Parameters</h4>
2380<table class="list"><tbody>
2381<tr><th>addrlist</th>
2382 <td class="description">List of potential addresses</td></tr>
2383<tr><th>sock</th>
2384 <td class="description">Socket</td></tr>
2385<tr><th>msec</th>
2386 <td class="description">Timeout in milliseconds</td></tr>
2387<tr><th>cancel</th>
2388 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
2389</tbody></table>
798d6e29
MS
2390<h4 class="returnvalue">Return Value</h4>
2391 <p class="description">Connected address or NULL on failure</p>
2392<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrCopyList">httpAddrCopyList</a></h3>
2393 <p class="description">Copy an address list.</p>
2394<p class="code">
98d88c8d 2395<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrCopyList(<a href="#http_addrlist_t">http_addrlist_t</a> *src);</p>
798d6e29 2396<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2397<table class="list"><tbody>
2398<tr><th>src</th>
2399 <td class="description">Source address list</td></tr>
2400</tbody></table>
798d6e29
MS
2401<h4 class="returnvalue">Return Value</h4>
2402 <p class="description">New address list or <code>NULL</code> on error</p>
2403<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrEqual">httpAddrEqual</a></h3>
2404 <p class="description">Compare two addresses.</p>
2405<p class="code">
98d88c8d 2406int httpAddrEqual(const <a href="#http_addr_t">http_addr_t</a> *addr1, const <a href="#http_addr_t">http_addr_t</a> *addr2);</p>
798d6e29 2407<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2408<table class="list"><tbody>
2409<tr><th>addr1</th>
2410 <td class="description">First address</td></tr>
2411<tr><th>addr2</th>
2412 <td class="description">Second address</td></tr>
2413</tbody></table>
798d6e29
MS
2414<h4 class="returnvalue">Return Value</h4>
2415 <p class="description">1 if equal, 0 if not</p>
2416<h3 class="function"><a id="httpAddrFamily">httpAddrFamily</a></h3>
2417 <p class="description">Get the address family of an address.</p>
2418<p class="code">
98d88c8d 2419int httpAddrFamily(<a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2420<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2421<table class="list"><tbody>
2422<tr><th>addr</th>
2423 <td class="description">Address</td></tr>
2424</tbody></table>
798d6e29
MS
2425<h4 class="returnvalue">Return Value</h4>
2426 <p class="description">Address family</p>
98d88c8d
MS
2427<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrFreeList">httpAddrFreeList</a></h3>
2428 <p class="description">Free an address list.</p>
798d6e29 2429<p class="code">
98d88c8d 2430void httpAddrFreeList(<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist);</p>
798d6e29 2431<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2432<table class="list"><tbody>
2433<tr><th>addrlist</th>
2434 <td class="description">Address list to free</td></tr>
2435</tbody></table>
798d6e29
MS
2436<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrGetList">httpAddrGetList</a></h3>
2437 <p class="description">Get a list of addresses for a hostname.</p>
2438<p class="code">
98d88c8d
MS
2439<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrGetList(const char *hostname, int family, const char *service);</p>
2440<h4 class="parameters">Parameters</h4>
2441<table class="list"><tbody>
2442<tr><th>hostname</th>
2443 <td class="description">Hostname, IP address, or NULL for passive listen address</td></tr>
2444<tr><th>family</th>
2445 <td class="description">Address family or AF_UNSPEC</td></tr>
2446<tr><th>service</th>
2447 <td class="description">Service name or port number</td></tr>
2448</tbody></table>
798d6e29
MS
2449<h4 class="returnvalue">Return Value</h4>
2450 <p class="description">List of addresses or NULL</p>
2451<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLength">httpAddrLength</a></h3>
2452 <p class="description">Return the length of the address in bytes.</p>
2453<p class="code">
98d88c8d 2454int httpAddrLength(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2455<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2456<table class="list"><tbody>
2457<tr><th>addr</th>
2458 <td class="description">Address</td></tr>
2459</tbody></table>
798d6e29
MS
2460<h4 class="returnvalue">Return Value</h4>
2461 <p class="description">Length in bytes</p>
2462<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrListen">httpAddrListen</a></h3>
2463 <p class="description">Create a listening socket bound to the specified
2464address and port.</p>
2465<p class="code">
98d88c8d 2466int httpAddrListen(<a href="#http_addr_t">http_addr_t</a> *addr, int port);</p>
798d6e29 2467<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2468<table class="list"><tbody>
2469<tr><th>addr</th>
2470 <td class="description">Address to bind to</td></tr>
2471<tr><th>port</th>
2472 <td class="description">Port number to bind to</td></tr>
2473</tbody></table>
798d6e29
MS
2474<h4 class="returnvalue">Return Value</h4>
2475 <p class="description">Socket or -1 on error</p>
2476<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLocalhost">httpAddrLocalhost</a></h3>
2477 <p class="description">Check for the local loopback address.</p>
2478<p class="code">
98d88c8d 2479int httpAddrLocalhost(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2480<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2481<table class="list"><tbody>
2482<tr><th>addr</th>
2483 <td class="description">Address to check</td></tr>
2484</tbody></table>
798d6e29
MS
2485<h4 class="returnvalue">Return Value</h4>
2486 <p class="description">1 if local host, 0 otherwise</p>
2487<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLookup">httpAddrLookup</a></h3>
2488 <p class="description">Lookup the hostname associated with the address.</p>
2489<p class="code">
98d88c8d
MS
2490char *httpAddrLookup(const <a href="#http_addr_t">http_addr_t</a> *addr, char *name, int namelen);</p>
2491<h4 class="parameters">Parameters</h4>
2492<table class="list"><tbody>
2493<tr><th>addr</th>
2494 <td class="description">Address to lookup</td></tr>
2495<tr><th>name</th>
2496 <td class="description">Host name buffer</td></tr>
2497<tr><th>namelen</th>
2498 <td class="description">Size of name buffer</td></tr>
2499</tbody></table>
798d6e29
MS
2500<h4 class="returnvalue">Return Value</h4>
2501 <p class="description">Host name</p>
2502<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrPort">httpAddrPort</a></h3>
2503 <p class="description">Get the port number associated with an address.</p>
2504<p class="code">
98d88c8d 2505int httpAddrPort(<a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2506<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2507<table class="list"><tbody>
2508<tr><th>addr</th>
2509 <td class="description">Address</td></tr>
2510</tbody></table>
798d6e29
MS
2511<h4 class="returnvalue">Return Value</h4>
2512 <p class="description">Port number</p>
2513<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrString">httpAddrString</a></h3>
2514 <p class="description">Convert an address to a numeric string.</p>
2515<p class="code">
98d88c8d
MS
2516char *httpAddrString(const <a href="#http_addr_t">http_addr_t</a> *addr, char *s, int slen);</p>
2517<h4 class="parameters">Parameters</h4>
2518<table class="list"><tbody>
2519<tr><th>addr</th>
2520 <td class="description">Address to convert</td></tr>
2521<tr><th>s</th>
2522 <td class="description">String buffer</td></tr>
2523<tr><th>slen</th>
2524 <td class="description">Length of string</td></tr>
2525</tbody></table>
798d6e29
MS
2526<h4 class="returnvalue">Return Value</h4>
2527 <p class="description">Numeric address string</p>
2528<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAssembleURI">httpAssembleURI</a></h3>
2529 <p class="description">Assemble a uniform resource identifier from its
2530components.</p>
2531<p class="code">
98d88c8d
MS
2532<a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURI(<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding, char *uri, int urilen, const char *scheme, const char *username, const char *host, int port, const char *resource);</p>
2533<h4 class="parameters">Parameters</h4>
2534<table class="list"><tbody>
2535<tr><th>encoding</th>
2536 <td class="description">Encoding flags</td></tr>
2537<tr><th>uri</th>
2538 <td class="description">URI buffer</td></tr>
2539<tr><th>urilen</th>
2540 <td class="description">Size of URI buffer</td></tr>
2541<tr><th>scheme</th>
2542 <td class="description">Scheme name</td></tr>
2543<tr><th>username</th>
2544 <td class="description">Username</td></tr>
2545<tr><th>host</th>
2546 <td class="description">Hostname or address</td></tr>
2547<tr><th>port</th>
2548 <td class="description">Port number</td></tr>
2549<tr><th>resource</th>
2550 <td class="description">Resource</td></tr>
2551</tbody></table>
798d6e29
MS
2552<h4 class="returnvalue">Return Value</h4>
2553 <p class="description">URI status</p>
2554<h4 class="discussion">Discussion</h4>
2555 <p class="discussion">This function escapes reserved characters in the URI depending on the
2556value of the &quot;encoding&quot; argument. You should use this function in
2557place of traditional string functions whenever you need to create a
2558URI string.
2559
2560</p>
2561<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAssembleURIf">httpAssembleURIf</a></h3>
2562 <p class="description">Assemble a uniform resource identifier from its
2563components with a formatted resource.</p>
2564<p class="code">
98d88c8d
MS
2565<a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURIf(<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding, char *uri, int urilen, const char *scheme, const char *username, const char *host, int port, const char *resourcef, ...);</p>
2566<h4 class="parameters">Parameters</h4>
2567<table class="list"><tbody>
2568<tr><th>encoding</th>
2569 <td class="description">Encoding flags</td></tr>
2570<tr><th>uri</th>
2571 <td class="description">URI buffer</td></tr>
2572<tr><th>urilen</th>
2573 <td class="description">Size of URI buffer</td></tr>
2574<tr><th>scheme</th>
2575 <td class="description">Scheme name</td></tr>
2576<tr><th>username</th>
2577 <td class="description">Username</td></tr>
2578<tr><th>host</th>
2579 <td class="description">Hostname or address</td></tr>
2580<tr><th>port</th>
2581 <td class="description">Port number</td></tr>
2582<tr><th>resourcef</th>
2583 <td class="description">Printf-style resource</td></tr>
2584<tr><th>...</th>
2585 <td class="description">Additional arguments as needed</td></tr>
2586</tbody></table>
798d6e29
MS
2587<h4 class="returnvalue">Return Value</h4>
2588 <p class="description">URI status</p>
2589<h4 class="discussion">Discussion</h4>
2590 <p class="discussion">This function creates a formatted version of the resource string
2591argument &quot;resourcef&quot; and escapes reserved characters in the URI
2592depending on the value of the &quot;encoding&quot; argument. You should use
2593this function in place of traditional string functions whenever
2594you need to create a URI string.
2595
2596</p>
2597<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAssembleUUID">httpAssembleUUID</a></h3>
2598 <p class="description">Assemble a name-based UUID URN conforming to RFC 4122.</p>
2599<p class="code">
98d88c8d
MS
2600char *httpAssembleUUID(const char *server, int port, const char *name, int number, char *buffer, size_t bufsize);</p>
2601<h4 class="parameters">Parameters</h4>
2602<table class="list"><tbody>
2603<tr><th>server</th>
2604 <td class="description">Server name</td></tr>
2605<tr><th>port</th>
2606 <td class="description">Port number</td></tr>
2607<tr><th>name</th>
2608 <td class="description">Object name or NULL</td></tr>
2609<tr><th>number</th>
2610 <td class="description">Object number or 0</td></tr>
2611<tr><th>buffer</th>
2612 <td class="description">String buffer</td></tr>
2613<tr><th>bufsize</th>
2614 <td class="description">Size of buffer</td></tr>
2615</tbody></table>
798d6e29
MS
2616<h4 class="returnvalue">Return Value</h4>
2617 <p class="description">UUID string</p>
2618<h4 class="discussion">Discussion</h4>
2619 <p class="discussion">This function creates a unique 128-bit identifying number using the server
2620name, port number, random data, and optionally an object name and/or object
2621number. The result is formatted as a UUID URN as defined in RFC 4122.<br>
2622<br>
2623The buffer needs to be at least 46 bytes in size.
2624
2625</p>
2626<h3 class="function"><a id="httpBlocking">httpBlocking</a></h3>
98d88c8d 2627 <p class="description">Set blocking/non-blocking behavior on a connection.</p>
798d6e29 2628<p class="code">
98d88c8d 2629void httpBlocking(<a href="#http_t">http_t</a> *http, int b);</p>
798d6e29 2630<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2631<table class="list"><tbody>
2632<tr><th>http</th>
2633 <td class="description">HTTP connection</td></tr>
2634<tr><th>b</th>
2635 <td class="description">1 = blocking, 0 = non-blocking</td></tr>
2636</tbody></table>
798d6e29
MS
2637<h3 class="function"><a id="httpCheck">httpCheck</a></h3>
2638 <p class="description">Check to see if there is a pending response from the server.</p>
2639<p class="code">
98d88c8d 2640int httpCheck(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2641<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2642<table class="list"><tbody>
2643<tr><th>http</th>
2644 <td class="description">HTTP connection</td></tr>
2645</tbody></table>
798d6e29
MS
2646<h4 class="returnvalue">Return Value</h4>
2647 <p class="description">0 = no data, 1 = data available</p>
98d88c8d
MS
2648<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpClearCookie">httpClearCookie</a></h3>
2649 <p class="description">Clear the cookie value(s).</p>
798d6e29 2650<p class="code">
98d88c8d 2651void httpClearCookie(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2652<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2653<table class="list"><tbody>
2654<tr><th>http</th>
2655 <td class="description">HTTP connection</td></tr>
2656</tbody></table>
798d6e29 2657<h3 class="function"><a id="httpClearFields">httpClearFields</a></h3>
98d88c8d 2658 <p class="description">Clear HTTP request fields.</p>
798d6e29 2659<p class="code">
98d88c8d 2660void httpClearFields(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2661<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2662<table class="list"><tbody>
2663<tr><th>http</th>
2664 <td class="description">HTTP connection</td></tr>
2665</tbody></table>
798d6e29 2666<h3 class="function"><a id="httpClose">httpClose</a></h3>
98d88c8d 2667 <p class="description">Close an HTTP connection.</p>
798d6e29 2668<p class="code">
98d88c8d 2669void httpClose(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2670<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2671<table class="list"><tbody>
2672<tr><th>http</th>
2673 <td class="description">HTTP connection</td></tr>
2674</tbody></table>
798d6e29
MS
2675<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpCompareCredentials">httpCompareCredentials</a></h3>
2676 <p class="description">Compare two sets of X.509 credentials.</p>
2677<p class="code">
98d88c8d 2678int httpCompareCredentials(cups_array_t *cred1, cups_array_t *cred2);</p>
798d6e29 2679<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2680<table class="list"><tbody>
2681<tr><th>cred1</th>
2682 <td class="description">First set of X.509 credentials</td></tr>
2683<tr><th>cred2</th>
2684 <td class="description">Second set of X.509 credentials</td></tr>
2685</tbody></table>
53af7f21
MS
2686<h4 class="returnvalue">Return Value</h4>
2687 <p class="description">1 if they match, 0 if they do not</p>
798d6e29
MS
2688<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpConnect2">httpConnect2</a></h3>
2689 <p class="description">Connect to a HTTP server.</p>
2690<p class="code">
98d88c8d
MS
2691<a href="#http_t">http_t</a> *httpConnect2(const char *host, int port, <a href="#http_addrlist_t">http_addrlist_t</a> *addrlist, int family, <a href="#http_encryption_t">http_encryption_t</a> encryption, int blocking, int msec, int *cancel);</p>
2692<h4 class="parameters">Parameters</h4>
2693<table class="list"><tbody>
2694<tr><th>host</th>
2695 <td class="description">Host to connect to</td></tr>
2696<tr><th>port</th>
2697 <td class="description">Port number</td></tr>
2698<tr><th>addrlist</th>
2699 <td class="description">List of addresses or NULL to lookup</td></tr>
2700<tr><th>family</th>
2701 <td class="description">Address family to use or <code>AF_UNSPEC</code> for any</td></tr>
2702<tr><th>encryption</th>
2703 <td class="description">Type of encryption to use</td></tr>
2704<tr><th>blocking</th>
2705 <td class="description">1 for blocking connection, 0 for non-blocking</td></tr>
2706<tr><th>msec</th>
2707 <td class="description">Connection timeout in milliseconds, 0 means don't connect</td></tr>
2708<tr><th>cancel</th>
2709 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
2710</tbody></table>
798d6e29
MS
2711<h4 class="returnvalue">Return Value</h4>
2712 <p class="description">New HTTP connection</p>
798d6e29
MS
2713<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpCopyCredentials">httpCopyCredentials</a></h3>
2714 <p class="description">Copy the credentials associated with the peer in
2715an encrypted connection.</p>
2716<p class="code">
98d88c8d 2717int httpCopyCredentials(<a href="#http_t">http_t</a> *http, cups_array_t **credentials);</p>
798d6e29 2718<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2719<table class="list"><tbody>
2720<tr><th>http</th>
2721 <td class="description">Connection to server</td></tr>
2722<tr><th>credentials</th>
2723 <td class="description">Array of credentials</td></tr>
2724</tbody></table>
798d6e29
MS
2725<h4 class="returnvalue">Return Value</h4>
2726 <p class="description">Status of call (0 = success)</p>
2727<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></h3>
2728 <p class="description">Return whether the credentials are valid for the given name.</p>
2729<p class="code">
98d88c8d 2730int httpCredentialsAreValidForName(cups_array_t *credentials, const char *common_name);</p>
798d6e29 2731<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2732<table class="list"><tbody>
2733<tr><th>credentials</th>
2734 <td class="description">Credentials</td></tr>
2735<tr><th>common_name</th>
2736 <td class="description">Name to check</td></tr>
2737</tbody></table>
798d6e29
MS
2738<h4 class="returnvalue">Return Value</h4>
2739 <p class="description">1 if valid, 0 otherwise</p>
2740<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></h3>
2741 <p class="description">Return the expiration date of the credentials.</p>
2742<p class="code">
98d88c8d 2743time_t httpCredentialsGetExpiration(cups_array_t *credentials);</p>
798d6e29 2744<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2745<table class="list"><tbody>
2746<tr><th>credentials</th>
2747 <td class="description">Credentials</td></tr>
2748</tbody></table>
798d6e29
MS
2749<h4 class="returnvalue">Return Value</h4>
2750 <p class="description">Expiration date of credentials</p>
2751<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsGetTrust">httpCredentialsGetTrust</a></h3>
2752 <p class="description">Return the trust of credentials.</p>
2753<p class="code">
98d88c8d 2754<a href="#http_trust_t">http_trust_t</a> httpCredentialsGetTrust(cups_array_t *credentials, const char *common_name);</p>
798d6e29 2755<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2756<table class="list"><tbody>
2757<tr><th>credentials</th>
2758 <td class="description">Credentials</td></tr>
2759<tr><th>common_name</th>
2760 <td class="description">Common name for trust lookup</td></tr>
2761</tbody></table>
798d6e29
MS
2762<h4 class="returnvalue">Return Value</h4>
2763 <p class="description">Level of trust</p>
2764<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsString">httpCredentialsString</a></h3>
2765 <p class="description">Return a string representing the credentials.</p>
2766<p class="code">
98d88c8d
MS
2767size_t httpCredentialsString(cups_array_t *credentials, char *buffer, size_t bufsize);</p>
2768<h4 class="parameters">Parameters</h4>
2769<table class="list"><tbody>
2770<tr><th>credentials</th>
2771 <td class="description">Credentials</td></tr>
2772<tr><th>buffer</th>
2773 <td class="description">Buffer or <code>NULL</code></td></tr>
2774<tr><th>bufsize</th>
2775 <td class="description">Size of buffer</td></tr>
2776</tbody></table>
798d6e29
MS
2777<h4 class="returnvalue">Return Value</h4>
2778 <p class="description">Total size of credentials string</p>
798d6e29
MS
2779<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="httpDecode64_2">httpDecode64_2</a></h3>
2780 <p class="description">Base64-decode a string.</p>
2781<p class="code">
98d88c8d
MS
2782char *httpDecode64_2(char *out, int *outlen, const char *in);</p>
2783<h4 class="parameters">Parameters</h4>
2784<table class="list"><tbody>
2785<tr><th>out</th>
2786 <td class="description">String to write to</td></tr>
2787<tr><th>outlen</th>
2788 <td class="description">Size of output string</td></tr>
2789<tr><th>in</th>
2790 <td class="description">String to read from</td></tr>
2791</tbody></table>
798d6e29
MS
2792<h4 class="returnvalue">Return Value</h4>
2793 <p class="description">Decoded string</p>
98d88c8d
MS
2794<h4 class="discussion">Discussion</h4>
2795 <p class="discussion">The caller must initialize &quot;outlen&quot; to the maximum size of the decoded
2796string before calling @httpDecode64_2@. On return &quot;outlen&quot; contains the
2797decoded length of the string.
2798
2799</p>
798d6e29
MS
2800<h3 class="function"><a id="httpDelete">httpDelete</a></h3>
2801 <p class="description">Send a DELETE request to the server.</p>
2802<p class="code">
98d88c8d 2803int httpDelete(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 2804<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2805<table class="list"><tbody>
2806<tr><th>http</th>
2807 <td class="description">HTTP connection</td></tr>
2808<tr><th>uri</th>
2809 <td class="description">URI to delete</td></tr>
2810</tbody></table>
798d6e29
MS
2811<h4 class="returnvalue">Return Value</h4>
2812 <p class="description">Status of call (0 = success)</p>
798d6e29
MS
2813<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="httpEncode64_2">httpEncode64_2</a></h3>
2814 <p class="description">Base64-encode a string.</p>
2815<p class="code">
98d88c8d
MS
2816char *httpEncode64_2(char *out, int outlen, const char *in, int inlen);</p>
2817<h4 class="parameters">Parameters</h4>
2818<table class="list"><tbody>
2819<tr><th>out</th>
2820 <td class="description">String to write to</td></tr>
2821<tr><th>outlen</th>
2822 <td class="description">Maximum size of output string</td></tr>
2823<tr><th>in</th>
2824 <td class="description">String to read from</td></tr>
2825<tr><th>inlen</th>
2826 <td class="description">Size of input string</td></tr>
2827</tbody></table>
798d6e29
MS
2828<h4 class="returnvalue">Return Value</h4>
2829 <p class="description">Encoded string</p>
2830<h3 class="function"><a id="httpEncryption">httpEncryption</a></h3>
2831 <p class="description">Set the required encryption on the link.</p>
2832<p class="code">
98d88c8d 2833int httpEncryption(<a href="#http_t">http_t</a> *http, <a href="#http_encryption_t">http_encryption_t</a> e);</p>
798d6e29 2834<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2835<table class="list"><tbody>
2836<tr><th>http</th>
2837 <td class="description">HTTP connection</td></tr>
2838<tr><th>e</th>
2839 <td class="description">New encryption preference</td></tr>
2840</tbody></table>
798d6e29
MS
2841<h4 class="returnvalue">Return Value</h4>
2842 <p class="description">-1 on error, 0 on success</p>
2843<h3 class="function"><a id="httpError">httpError</a></h3>
2844 <p class="description">Get the last error on a connection.</p>
2845<p class="code">
98d88c8d 2846int httpError(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2847<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2848<table class="list"><tbody>
2849<tr><th>http</th>
2850 <td class="description">HTTP connection</td></tr>
2851</tbody></table>
798d6e29
MS
2852<h4 class="returnvalue">Return Value</h4>
2853 <p class="description">Error code (errno) value</p>
2854<h3 class="function"><a id="httpFieldValue">httpFieldValue</a></h3>
2855 <p class="description">Return the HTTP field enumeration value for a field
2856name.</p>
2857<p class="code">
98d88c8d 2858<a href="#http_field_t">http_field_t</a> httpFieldValue(const char *name);</p>
798d6e29 2859<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2860<table class="list"><tbody>
2861<tr><th>name</th>
2862 <td class="description">String name</td></tr>
2863</tbody></table>
798d6e29
MS
2864<h4 class="returnvalue">Return Value</h4>
2865 <p class="description">Field index</p>
2866<h3 class="function"><a id="httpFlush">httpFlush</a></h3>
98d88c8d 2867 <p class="description">Flush data from a HTTP connection.</p>
798d6e29 2868<p class="code">
98d88c8d 2869void httpFlush(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2870<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2871<table class="list"><tbody>
2872<tr><th>http</th>
2873 <td class="description">HTTP connection</td></tr>
2874</tbody></table>
798d6e29
MS
2875<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpFlushWrite">httpFlushWrite</a></h3>
2876 <p class="description">Flush data in write buffer.</p>
2877<p class="code">
98d88c8d 2878int httpFlushWrite(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2879<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2880<table class="list"><tbody>
2881<tr><th>http</th>
2882 <td class="description">HTTP connection</td></tr>
2883</tbody></table>
798d6e29
MS
2884<h4 class="returnvalue">Return Value</h4>
2885 <p class="description">Bytes written or -1 on error</p>
2886<h3 class="function"><a id="httpFreeCredentials">httpFreeCredentials</a></h3>
98d88c8d 2887 <p class="description">Free an array of credentials.</p>
798d6e29 2888<p class="code">
98d88c8d 2889void httpFreeCredentials(cups_array_t *credentials);</p>
798d6e29 2890<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2891<table class="list"><tbody>
2892<tr><th>credentials</th>
2893 <td class="description">Array of credentials</td></tr>
2894</tbody></table>
798d6e29
MS
2895<h3 class="function"><a id="httpGet">httpGet</a></h3>
2896 <p class="description">Send a GET request to the server.</p>
2897<p class="code">
98d88c8d 2898int httpGet(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 2899<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2900<table class="list"><tbody>
2901<tr><th>http</th>
2902 <td class="description">HTTP connection</td></tr>
2903<tr><th>uri</th>
2904 <td class="description">URI to get</td></tr>
2905</tbody></table>
798d6e29
MS
2906<h4 class="returnvalue">Return Value</h4>
2907 <p class="description">Status of call (0 = success)</p>
2908<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetActivity">httpGetActivity</a></h3>
2909 <p class="description">Get the most recent activity for a connection.</p>
2910<p class="code">
98d88c8d 2911time_t httpGetActivity(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2912<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2913<table class="list"><tbody>
2914<tr><th>http</th>
2915 <td class="description">HTTP connection</td></tr>
2916</tbody></table>
798d6e29
MS
2917<h4 class="returnvalue">Return Value</h4>
2918 <p class="description">Time of last read or write</p>
2919<h4 class="discussion">Discussion</h4>
2920 <p class="discussion">The return value is the UNIX time of the last read or write.
2921
2922</p>
2923<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetAddress">httpGetAddress</a></h3>
2924 <p class="description">Get the address of the connected peer of a connection.</p>
2925<p class="code">
98d88c8d 2926<a href="#http_addr_t">http_addr_t</a> *httpGetAddress(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2927<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2928<table class="list"><tbody>
2929<tr><th>http</th>
2930 <td class="description">HTTP connection</td></tr>
2931</tbody></table>
798d6e29
MS
2932<h4 class="returnvalue">Return Value</h4>
2933 <p class="description">Connected address or <code>NULL</code></p>
2934<h4 class="discussion">Discussion</h4>
2935 <p class="discussion">Returns <code>NULL</code> if the socket is currently unconnected.
2936
2937</p>
2938<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="httpGetAuthString">httpGetAuthString</a></h3>
2939 <p class="description">Get the current authorization string.</p>
2940<p class="code">
98d88c8d 2941char *httpGetAuthString(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2942<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2943<table class="list"><tbody>
2944<tr><th>http</th>
2945 <td class="description">HTTP connection</td></tr>
2946</tbody></table>
798d6e29
MS
2947<h4 class="returnvalue">Return Value</h4>
2948 <p class="description">Authorization string</p>
2949<h4 class="discussion">Discussion</h4>
2950 <p class="discussion">The authorization string is set by cupsDoAuthentication() and
2951httpSetAuthString(). Use httpGetAuthString() to retrieve the
2952string to use with httpSetField() for the HTTP_FIELD_AUTHORIZATION
2953value.
2954
2955</p>
2956<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetBlocking">httpGetBlocking</a></h3>
2957 <p class="description">Get the blocking/non-block state of a connection.</p>
2958<p class="code">
98d88c8d 2959int httpGetBlocking(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2960<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2961<table class="list"><tbody>
2962<tr><th>http</th>
2963 <td class="description">HTTP connection</td></tr>
2964</tbody></table>
798d6e29
MS
2965<h4 class="returnvalue">Return Value</h4>
2966 <p class="description">1 if blocking, 0 if non-blocking</p>
2967<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpGetContentEncoding">httpGetContentEncoding</a></h3>
2968 <p class="description">Get a common content encoding, if any, between
2969the client and server.</p>
2970<p class="code">
98d88c8d 2971const char *httpGetContentEncoding(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2972<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2973<table class="list"><tbody>
2974<tr><th>http</th>
2975 <td class="description">HTTP connection</td></tr>
2976</tbody></table>
798d6e29
MS
2977<h4 class="returnvalue">Return Value</h4>
2978 <p class="description">Content-Coding value or
2979<code>NULL</code> for the identity
2980coding.</p>
2981<h4 class="discussion">Discussion</h4>
2982 <p class="discussion">This function uses the value of the Accepts-Encoding HTTP header and must be
2983called after receiving a response from the server or a request from the
2984client. The value returned can be use in subsequent requests (for clients)
2985or in the response (for servers) in order to compress the content stream.
2986
2987</p>
2988<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpGetCookie">httpGetCookie</a></h3>
2989 <p class="description">Get any cookie data from the response.</p>
2990<p class="code">
98d88c8d 2991const char *httpGetCookie(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2992<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2993<table class="list"><tbody>
2994<tr><th>http</th>
2995 <td class="description">HTTP connection</td></tr>
2996</tbody></table>
798d6e29
MS
2997<h4 class="returnvalue">Return Value</h4>
2998 <p class="description">Cookie data or NULL</p>
798d6e29
MS
2999<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetDateString2">httpGetDateString2</a></h3>
3000 <p class="description">Get a formatted date/time string from a time value.</p>
3001<p class="code">
98d88c8d
MS
3002const char *httpGetDateString2(time_t t, char *s, int slen);</p>
3003<h4 class="parameters">Parameters</h4>
3004<table class="list"><tbody>
3005<tr><th>t</th>
3006 <td class="description">UNIX time</td></tr>
3007<tr><th>s</th>
3008 <td class="description">String buffer</td></tr>
3009<tr><th>slen</th>
3010 <td class="description">Size of string buffer</td></tr>
3011</tbody></table>
798d6e29
MS
3012<h4 class="returnvalue">Return Value</h4>
3013 <p class="description">Date/time string</p>
3014<h3 class="function"><a id="httpGetDateTime">httpGetDateTime</a></h3>
3015 <p class="description">Get a time value from a formatted date/time string.</p>
3016<p class="code">
98d88c8d 3017time_t httpGetDateTime(const char *s);</p>
798d6e29 3018<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3019<table class="list"><tbody>
3020<tr><th>s</th>
3021 <td class="description">Date/time string</td></tr>
3022</tbody></table>
798d6e29
MS
3023<h4 class="returnvalue">Return Value</h4>
3024 <p class="description">UNIX time</p>
3025<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetEncryption">httpGetEncryption</a></h3>
3026 <p class="description">Get the current encryption mode of a connection.</p>
3027<p class="code">
98d88c8d 3028<a href="#http_encryption_t">http_encryption_t</a> httpGetEncryption(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3029<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3030<table class="list"><tbody>
3031<tr><th>http</th>
3032 <td class="description">HTTP connection</td></tr>
3033</tbody></table>
798d6e29
MS
3034<h4 class="returnvalue">Return Value</h4>
3035 <p class="description">Current encryption mode</p>
3036<h4 class="discussion">Discussion</h4>
3037 <p class="discussion">This function returns the encryption mode for the connection. Use the
3038<a href="#httpIsEncrypted"><code>httpIsEncrypted</code></a> function to determine whether a TLS session has
3039been established.
3040
3041</p>
3042<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpGetExpect">httpGetExpect</a></h3>
3043 <p class="description">Get the value of the Expect header, if any.</p>
3044<p class="code">
98d88c8d 3045http_status_t httpGetExpect(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3046<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3047<table class="list"><tbody>
3048<tr><th>http</th>
3049 <td class="description">HTTP connection</td></tr>
3050</tbody></table>
798d6e29
MS
3051<h4 class="returnvalue">Return Value</h4>
3052 <p class="description">Expect: status, if any</p>
3053<h4 class="discussion">Discussion</h4>
3054 <p class="discussion">Returns <code>HTTP_STATUS_NONE</code> if there is no Expect header, otherwise
3055returns the expected HTTP status code, typically <code>HTTP_STATUS_CONTINUE</code>.
3056
3057</p>
3058<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetFd">httpGetFd</a></h3>
3059 <p class="description">Get the file descriptor associated with a connection.</p>
3060<p class="code">
98d88c8d 3061int httpGetFd(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3062<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3063<table class="list"><tbody>
3064<tr><th>http</th>
3065 <td class="description">HTTP connection</td></tr>
3066</tbody></table>
798d6e29
MS
3067<h4 class="returnvalue">Return Value</h4>
3068 <p class="description">File descriptor or -1 if none</p>
3069<h3 class="function"><a id="httpGetField">httpGetField</a></h3>
3070 <p class="description">Get a field value from a request/response.</p>
3071<p class="code">
98d88c8d 3072const char *httpGetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field);</p>
798d6e29 3073<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3074<table class="list"><tbody>
3075<tr><th>http</th>
3076 <td class="description">HTTP connection</td></tr>
3077<tr><th>field</th>
3078 <td class="description">Field to get</td></tr>
3079</tbody></table>
798d6e29
MS
3080<h4 class="returnvalue">Return Value</h4>
3081 <p class="description">Field value</p>
3082<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="httpGetHostByName">httpGetHostByName</a></h3>
3083 <p class="description">Lookup a hostname or IPv4 address, and return
3084address records for the specified name.</p>
3085<p class="code">
98d88c8d 3086struct hostent *httpGetHostByName(const char *name);</p>
798d6e29 3087<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3088<table class="list"><tbody>
3089<tr><th>name</th>
3090 <td class="description">Hostname or IP address</td></tr>
3091</tbody></table>
798d6e29
MS
3092<h4 class="returnvalue">Return Value</h4>
3093 <p class="description">Host entry</p>
3094<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetHostname">httpGetHostname</a></h3>
3095 <p class="description">Get the FQDN for the connection or local system.</p>
3096<p class="code">
98d88c8d
MS
3097const char *httpGetHostname(<a href="#http_t">http_t</a> *http, char *s, int slen);</p>
3098<h4 class="parameters">Parameters</h4>
3099<table class="list"><tbody>
3100<tr><th>http</th>
3101 <td class="description">HTTP connection or NULL</td></tr>
3102<tr><th>s</th>
3103 <td class="description">String buffer for name</td></tr>
3104<tr><th>slen</th>
3105 <td class="description">Size of buffer</td></tr>
3106</tbody></table>
798d6e29
MS
3107<h4 class="returnvalue">Return Value</h4>
3108 <p class="description">FQDN for connection or system</p>
3109<h4 class="discussion">Discussion</h4>
3110 <p class="discussion">When &quot;http&quot; points to a connected socket, return the hostname or
3111address that was used in the call to httpConnect() or httpConnectEncrypt(),
3112or the address of the client for the connection from httpAcceptConnection().
3113Otherwise, return the FQDN for the local system using both gethostname()
3114and gethostbyname() to get the local hostname with domain.
3115
3116</p>
3117<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetKeepAlive">httpGetKeepAlive</a></h3>
3118 <p class="description">Get the current Keep-Alive state of the connection.</p>
3119<p class="code">
98d88c8d 3120<a href="#http_keepalive_t">http_keepalive_t</a> httpGetKeepAlive(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3121<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3122<table class="list"><tbody>
3123<tr><th>http</th>
3124 <td class="description">HTTP connection</td></tr>
3125</tbody></table>
798d6e29
MS
3126<h4 class="returnvalue">Return Value</h4>
3127 <p class="description">Keep-Alive state</p>
798d6e29
MS
3128<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetLength2">httpGetLength2</a></h3>
3129 <p class="description">Get the amount of data remaining from the
3130content-length or transfer-encoding fields.</p>
3131<p class="code">
98d88c8d 3132off_t httpGetLength2(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3133<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3134<table class="list"><tbody>
3135<tr><th>http</th>
3136 <td class="description">HTTP connection</td></tr>
3137</tbody></table>
798d6e29
MS
3138<h4 class="returnvalue">Return Value</h4>
3139 <p class="description">Content length</p>
3140<h4 class="discussion">Discussion</h4>
3141 <p class="discussion">This function returns the complete content length, even for
3142content larger than 2^31 - 1.
3143
3144</p>
3145<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetPending">httpGetPending</a></h3>
3146 <p class="description">Get the number of bytes that are buffered for writing.</p>
3147<p class="code">
98d88c8d 3148size_t httpGetPending(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3149<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3150<table class="list"><tbody>
3151<tr><th>http</th>
3152 <td class="description">HTTP connection</td></tr>
3153</tbody></table>
798d6e29
MS
3154<h4 class="returnvalue">Return Value</h4>
3155 <p class="description">Number of bytes buffered</p>
3156<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetReady">httpGetReady</a></h3>
3157 <p class="description">Get the number of bytes that can be read without blocking.</p>
3158<p class="code">
98d88c8d 3159size_t httpGetReady(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3160<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3161<table class="list"><tbody>
3162<tr><th>http</th>
3163 <td class="description">HTTP connection</td></tr>
3164</tbody></table>
798d6e29
MS
3165<h4 class="returnvalue">Return Value</h4>
3166 <p class="description">Number of bytes available</p>
3167<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetRemaining">httpGetRemaining</a></h3>
3168 <p class="description">Get the number of remaining bytes in the message
3169body or current chunk.</p>
3170<p class="code">
98d88c8d 3171size_t httpGetRemaining(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3172<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3173<table class="list"><tbody>
3174<tr><th>http</th>
3175 <td class="description">HTTP connection</td></tr>
3176</tbody></table>
798d6e29
MS
3177<h4 class="returnvalue">Return Value</h4>
3178 <p class="description">Remaining bytes</p>
3179<h4 class="discussion">Discussion</h4>
3180 <p class="discussion">The <a href="#httpIsChunked"><code>httpIsChunked</code></a> function can be used to determine whether the
3181message body is chunked or fixed-length.
3182
3183</p>
3184<h3 class="function"><a id="httpGetState">httpGetState</a></h3>
3185 <p class="description">Get the current state of the HTTP request.</p>
3186<p class="code">
98d88c8d 3187<a href="#http_state_t">http_state_t</a> httpGetState(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3188<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3189<table class="list"><tbody>
3190<tr><th>http</th>
3191 <td class="description">HTTP connection</td></tr>
3192</tbody></table>
798d6e29
MS
3193<h4 class="returnvalue">Return Value</h4>
3194 <p class="description">HTTP state</p>
3195<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetStatus">httpGetStatus</a></h3>
3196 <p class="description">Get the status of the last HTTP request.</p>
3197<p class="code">
98d88c8d 3198http_status_t httpGetStatus(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3199<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3200<table class="list"><tbody>
3201<tr><th>http</th>
3202 <td class="description">HTTP connection</td></tr>
3203</tbody></table>
798d6e29
MS
3204<h4 class="returnvalue">Return Value</h4>
3205 <p class="description">HTTP status</p>
798d6e29
MS
3206<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetSubField2">httpGetSubField2</a></h3>
3207 <p class="description">Get a sub-field value.</p>
3208<p class="code">
98d88c8d
MS
3209char *httpGetSubField2(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *name, char *value, int valuelen);</p>
3210<h4 class="parameters">Parameters</h4>
3211<table class="list"><tbody>
3212<tr><th>http</th>
3213 <td class="description">HTTP connection</td></tr>
3214<tr><th>field</th>
3215 <td class="description">Field index</td></tr>
3216<tr><th>name</th>
3217 <td class="description">Name of sub-field</td></tr>
3218<tr><th>value</th>
3219 <td class="description">Value string</td></tr>
3220<tr><th>valuelen</th>
3221 <td class="description">Size of value buffer</td></tr>
3222</tbody></table>
798d6e29
MS
3223<h4 class="returnvalue">Return Value</h4>
3224 <p class="description">Value or NULL</p>
3225<h3 class="function"><a id="httpGetVersion">httpGetVersion</a></h3>
3226 <p class="description">Get the HTTP version at the other end.</p>
3227<p class="code">
98d88c8d 3228<a href="#http_version_t">http_version_t</a> httpGetVersion(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3229<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3230<table class="list"><tbody>
3231<tr><th>http</th>
3232 <td class="description">HTTP connection</td></tr>
3233</tbody></table>
798d6e29
MS
3234<h4 class="returnvalue">Return Value</h4>
3235 <p class="description">Version number</p>
3236<h3 class="function"><a id="httpGets">httpGets</a></h3>
3237 <p class="description">Get a line of text from a HTTP connection.</p>
3238<p class="code">
98d88c8d
MS
3239char *httpGets(char *line, int length, <a href="#http_t">http_t</a> *http);</p>
3240<h4 class="parameters">Parameters</h4>
3241<table class="list"><tbody>
3242<tr><th>line</th>
3243 <td class="description">Line to read into</td></tr>
3244<tr><th>length</th>
3245 <td class="description">Max length of buffer</td></tr>
3246<tr><th>http</th>
3247 <td class="description">HTTP connection</td></tr>
3248</tbody></table>
798d6e29
MS
3249<h4 class="returnvalue">Return Value</h4>
3250 <p class="description">Line or NULL</p>
3251<h3 class="function"><a id="httpHead">httpHead</a></h3>
3252 <p class="description">Send a HEAD request to the server.</p>
3253<p class="code">
98d88c8d 3254int httpHead(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3255<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3256<table class="list"><tbody>
3257<tr><th>http</th>
3258 <td class="description">HTTP connection</td></tr>
3259<tr><th>uri</th>
3260 <td class="description">URI for head</td></tr>
3261</tbody></table>
798d6e29
MS
3262<h4 class="returnvalue">Return Value</h4>
3263 <p class="description">Status of call (0 = success)</p>
3264<h3 class="function"><a id="httpInitialize">httpInitialize</a></h3>
53af7f21
MS
3265 <p class="description">Initialize the HTTP interface library and set the
3266default HTTP proxy (if any).</p>
98d88c8d
MS
3267<p class="code">
3268void httpInitialize(void);</p>
798d6e29
MS
3269<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpIsChunked">httpIsChunked</a></h3>
3270 <p class="description">Report whether a message body is chunked.</p>
3271<p class="code">
98d88c8d 3272int httpIsChunked(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3273<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3274<table class="list"><tbody>
3275<tr><th>http</th>
3276 <td class="description">HTTP connection</td></tr>
3277</tbody></table>
798d6e29
MS
3278<h4 class="returnvalue">Return Value</h4>
3279 <p class="description">1 if chunked, 0 if not</p>
3280<h4 class="discussion">Discussion</h4>
3281 <p class="discussion">This function returns non-zero if the message body is composed of
3282variable-length chunks.
3283
3284</p>
3285<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpIsEncrypted">httpIsEncrypted</a></h3>
3286 <p class="description">Report whether a connection is encrypted.</p>
3287<p class="code">
98d88c8d 3288int httpIsEncrypted(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3289<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3290<table class="list"><tbody>
3291<tr><th>http</th>
3292 <td class="description">HTTP connection</td></tr>
3293</tbody></table>
798d6e29
MS
3294<h4 class="returnvalue">Return Value</h4>
3295 <p class="description">1 if encrypted, 0 if not</p>
3296<h4 class="discussion">Discussion</h4>
3297 <p class="discussion">This function returns non-zero if the connection is currently encrypted.
3298
3299</p>
3300<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpLoadCredentials">httpLoadCredentials</a></h3>
3301 <p class="description">Load X.509 credentials from a keychain file.</p>
3302<p class="code">
98d88c8d
MS
3303int httpLoadCredentials(const char *path, cups_array_t **credentials, const char *common_name);</p>
3304<h4 class="parameters">Parameters</h4>
3305<table class="list"><tbody>
3306<tr><th>path</th>
3307 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
3308<tr><th>credentials</th>
3309 <td class="description">Credentials</td></tr>
3310<tr><th>common_name</th>
3311 <td class="description">Common name for credentials</td></tr>
3312</tbody></table>
798d6e29
MS
3313<h4 class="returnvalue">Return Value</h4>
3314 <p class="description">0 on success, -1 on error</p>
3315<h3 class="function"><a id="httpOptions">httpOptions</a></h3>
3316 <p class="description">Send an OPTIONS request to the server.</p>
3317<p class="code">
98d88c8d 3318int httpOptions(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3319<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3320<table class="list"><tbody>
3321<tr><th>http</th>
3322 <td class="description">HTTP connection</td></tr>
3323<tr><th>uri</th>
3324 <td class="description">URI for options</td></tr>
3325</tbody></table>
798d6e29
MS
3326<h4 class="returnvalue">Return Value</h4>
3327 <p class="description">Status of call (0 = success)</p>
3328<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpPeek">httpPeek</a></h3>
3329 <p class="description">Peek at data from a HTTP connection.</p>
3330<p class="code">
98d88c8d
MS
3331ssize_t httpPeek(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p>
3332<h4 class="parameters">Parameters</h4>
3333<table class="list"><tbody>
3334<tr><th>http</th>
3335 <td class="description">HTTP connection</td></tr>
3336<tr><th>buffer</th>
3337 <td class="description">Buffer for data</td></tr>
3338<tr><th>length</th>
3339 <td class="description">Maximum number of bytes</td></tr>
3340</tbody></table>
798d6e29
MS
3341<h4 class="returnvalue">Return Value</h4>
3342 <p class="description">Number of bytes copied</p>
3343<h4 class="discussion">Discussion</h4>
3344 <p class="discussion">This function copies available data from the given HTTP connection, reading
3345a buffer as needed. The data is still available for reading using
3346<a href="#httpRead"><code>httpRead</code></a> or <a href="#httpRead2"><code>httpRead2</code></a>.<br>
3347<br>
3348For non-blocking connections the usual timeouts apply.
3349
3350</p>
3351<h3 class="function"><a id="httpPost">httpPost</a></h3>
3352 <p class="description">Send a POST request to the server.</p>
3353<p class="code">
98d88c8d 3354int httpPost(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3355<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3356<table class="list"><tbody>
3357<tr><th>http</th>
3358 <td class="description">HTTP connection</td></tr>
3359<tr><th>uri</th>
3360 <td class="description">URI for post</td></tr>
3361</tbody></table>
798d6e29
MS
3362<h4 class="returnvalue">Return Value</h4>
3363 <p class="description">Status of call (0 = success)</p>
3364<h3 class="function"><a id="httpPut">httpPut</a></h3>
3365 <p class="description">Send a PUT request to the server.</p>
3366<p class="code">
98d88c8d 3367int httpPut(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3368<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3369<table class="list"><tbody>
3370<tr><th>http</th>
3371 <td class="description">HTTP connection</td></tr>
3372<tr><th>uri</th>
3373 <td class="description">URI to put</td></tr>
3374</tbody></table>
798d6e29
MS
3375<h4 class="returnvalue">Return Value</h4>
3376 <p class="description">Status of call (0 = success)</p>
798d6e29
MS
3377<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpRead2">httpRead2</a></h3>
3378 <p class="description">Read data from a HTTP connection.</p>
3379<p class="code">
98d88c8d
MS
3380ssize_t httpRead2(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p>
3381<h4 class="parameters">Parameters</h4>
3382<table class="list"><tbody>
3383<tr><th>http</th>
3384 <td class="description">HTTP connection</td></tr>
3385<tr><th>buffer</th>
3386 <td class="description">Buffer for data</td></tr>
3387<tr><th>length</th>
3388 <td class="description">Maximum number of bytes</td></tr>
3389</tbody></table>
798d6e29
MS
3390<h4 class="returnvalue">Return Value</h4>
3391 <p class="description">Number of bytes read</p>
3392<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpReadRequest">httpReadRequest</a></h3>
3393 <p class="description">Read a HTTP request from a connection.</p>
3394<p class="code">
98d88c8d
MS
3395<a href="#http_state_t">http_state_t</a> httpReadRequest(<a href="#http_t">http_t</a> *http, char *uri, size_t urilen);</p>
3396<h4 class="parameters">Parameters</h4>
3397<table class="list"><tbody>
3398<tr><th>http</th>
3399 <td class="description">HTTP connection</td></tr>
3400<tr><th>uri</th>
3401 <td class="description">URI buffer</td></tr>
3402<tr><th>urilen</th>
3403 <td class="description">Size of URI buffer</td></tr>
3404</tbody></table>
798d6e29
MS
3405<h4 class="returnvalue">Return Value</h4>
3406 <p class="description">New state of connection</p>
798d6e29
MS
3407<h3 class="function"><a id="httpReconnect2">httpReconnect2</a></h3>
3408 <p class="description">Reconnect to a HTTP server with timeout and optional
3409cancel.</p>
3410<p class="code">
98d88c8d
MS
3411int httpReconnect2(<a href="#http_t">http_t</a> *http, int msec, int *cancel);</p>
3412<h4 class="parameters">Parameters</h4>
3413<table class="list"><tbody>
3414<tr><th>http</th>
3415 <td class="description">HTTP connection</td></tr>
3416<tr><th>msec</th>
3417 <td class="description">Timeout in milliseconds</td></tr>
3418<tr><th>cancel</th>
3419 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
3420</tbody></table>
798d6e29
MS
3421<h4 class="returnvalue">Return Value</h4>
3422 <p class="description">0 on success, non-zero on failure</p>
3423<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpResolveHostname">httpResolveHostname</a></h3>
3424 <p class="description">Resolve the hostname of the HTTP connection
3425address.</p>
3426<p class="code">
98d88c8d
MS
3427const char *httpResolveHostname(<a href="#http_t">http_t</a> *http, char *buffer, size_t bufsize);</p>
3428<h4 class="parameters">Parameters</h4>
3429<table class="list"><tbody>
3430<tr><th>http</th>
3431 <td class="description">HTTP connection</td></tr>
3432<tr><th>buffer</th>
3433 <td class="description">Hostname buffer</td></tr>
3434<tr><th>bufsize</th>
3435 <td class="description">Size of buffer</td></tr>
3436</tbody></table>
798d6e29
MS
3437<h4 class="returnvalue">Return Value</h4>
3438 <p class="description">Resolved hostname or <code>NULL</code></p>
3439<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpSaveCredentials">httpSaveCredentials</a></h3>
3440 <p class="description">Save X.509 credentials to a keychain file.</p>
3441<p class="code">
98d88c8d
MS
3442int httpSaveCredentials(const char *path, cups_array_t *credentials, const char *common_name);</p>
3443<h4 class="parameters">Parameters</h4>
3444<table class="list"><tbody>
3445<tr><th>path</th>
3446 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
3447<tr><th>credentials</th>
3448 <td class="description">Credentials</td></tr>
3449<tr><th>common_name</th>
3450 <td class="description">Common name for credentials</td></tr>
3451</tbody></table>
798d6e29
MS
3452<h4 class="returnvalue">Return Value</h4>
3453 <p class="description">-1 on error, 0 on success</p>
798d6e29
MS
3454<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSeparateURI">httpSeparateURI</a></h3>
3455 <p class="description">Separate a Universal Resource Identifier into its
3456components.</p>
3457<p class="code">
98d88c8d
MS
3458<a href="#http_uri_status_t">http_uri_status_t</a> httpSeparateURI(<a href="#http_uri_coding_t">http_uri_coding_t</a> decoding, const char *uri, char *scheme, int schemelen, char *username, int usernamelen, char *host, int hostlen, int *port, char *resource, int resourcelen);</p>
3459<h4 class="parameters">Parameters</h4>
3460<table class="list"><tbody>
3461<tr><th>decoding</th>
3462 <td class="description">Decoding flags</td></tr>
3463<tr><th>uri</th>
3464 <td class="description">Universal Resource Identifier</td></tr>
3465<tr><th>scheme</th>
3466 <td class="description">Scheme (http, https, etc.)</td></tr>
3467<tr><th>schemelen</th>
3468 <td class="description">Size of scheme buffer</td></tr>
3469<tr><th>username</th>
3470 <td class="description">Username</td></tr>
3471<tr><th>usernamelen</th>
3472 <td class="description">Size of username buffer</td></tr>
3473<tr><th>host</th>
3474 <td class="description">Hostname</td></tr>
3475<tr><th>hostlen</th>
3476 <td class="description">Size of hostname buffer</td></tr>
3477<tr><th>port</th>
3478 <td class="description">Port number to use</td></tr>
3479<tr><th>resource</th>
3480 <td class="description">Resource/filename</td></tr>
3481<tr><th>resourcelen</th>
3482 <td class="description">Size of resource buffer</td></tr>
3483</tbody></table>
798d6e29
MS
3484<h4 class="returnvalue">Return Value</h4>
3485 <p class="description">Result of separation</p>
98d88c8d 3486<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="httpSetAuthString">httpSetAuthString</a></h3>
53af7f21 3487 <p class="description">Set the current authorization string.</p>
98d88c8d
MS
3488<p class="code">
3489void httpSetAuthString(<a href="#http_t">http_t</a> *http, const char *scheme, const char *data);</p>
3490<h4 class="parameters">Parameters</h4>
3491<table class="list"><tbody>
3492<tr><th>http</th>
3493 <td class="description">HTTP connection</td></tr>
3494<tr><th>scheme</th>
3495 <td class="description">Auth scheme (NULL to clear it)</td></tr>
3496<tr><th>data</th>
3497 <td class="description">Auth data (NULL for none)</td></tr>
3498</tbody></table>
3499<h4 class="discussion">Discussion</h4>
798d6e29
MS
3500 <p class="discussion">This function just stores a copy of the current authorization string in
3501the HTTP connection object. You must still call httpSetField() to set
3502HTTP_FIELD_AUTHORIZATION prior to issuing a HTTP request using httpGet(),
3503httpHead(), httpOptions(), httpPost, or httpPut().
3504
3505</p>
98d88c8d
MS
3506<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpSetCookie">httpSetCookie</a></h3>
3507 <p class="description">Set the cookie value(s).</p>
798d6e29 3508<p class="code">
98d88c8d 3509void httpSetCookie(<a href="#http_t">http_t</a> *http, const char *cookie);</p>
798d6e29 3510<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3511<table class="list"><tbody>
3512<tr><th>http</th>
3513 <td class="description">Connection</td></tr>
3514<tr><th>cookie</th>
3515 <td class="description">Cookie string</td></tr>
3516</tbody></table>
798d6e29
MS
3517<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpSetCredentials">httpSetCredentials</a></h3>
3518 <p class="description">Set the credentials associated with an encrypted
3519connection.</p>
3520<p class="code">
98d88c8d 3521int httpSetCredentials(<a href="#http_t">http_t</a> *http, cups_array_t *credentials);</p>
798d6e29 3522<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3523<table class="list"><tbody>
3524<tr><th>http</th>
3525 <td class="description">HTTP connection</td></tr>
3526<tr><th>credentials</th>
3527 <td class="description">Array of credentials</td></tr>
3528</tbody></table>
798d6e29
MS
3529<h4 class="returnvalue">Return Value</h4>
3530 <p class="description">Status of call (0 = success)</p>
98d88c8d 3531<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpSetDefaultField">httpSetDefaultField</a></h3>
53af7f21 3532 <p class="description">Set the default value of an HTTP header.</p>
98d88c8d
MS
3533<p class="code">
3534void httpSetDefaultField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p>
3535<h4 class="parameters">Parameters</h4>
3536<table class="list"><tbody>
3537<tr><th>http</th>
3538 <td class="description">HTTP connection</td></tr>
3539<tr><th>field</th>
3540 <td class="description">Field index</td></tr>
3541<tr><th>value</th>
3542 <td class="description">Value</td></tr>
3543</tbody></table>
3544<h4 class="discussion">Discussion</h4>
798d6e29
MS
3545 <p class="discussion">Currently only <code>HTTP_FIELD_ACCEPT_ENCODING</code>, <code>HTTP_FIELD_SERVER</code>,
3546and <code>HTTP_FIELD_USER_AGENT</code> can be set.
3547
3548</p>
98d88c8d
MS
3549<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSetExpect">httpSetExpect</a></h3>
3550 <p class="description">Set the Expect: header in a request.</p>
798d6e29 3551<p class="code">
98d88c8d 3552void httpSetExpect(<a href="#http_t">http_t</a> *http, http_status_t expect);</p>
798d6e29 3553<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3554<table class="list"><tbody>
3555<tr><th>http</th>
3556 <td class="description">HTTP connection</td></tr>
3557<tr><th>expect</th>
3558 <td class="description">HTTP status to expect
3559(<code>HTTP_STATUS_CONTINUE</code>)</td></tr>
3560</tbody></table>
3561<h4 class="discussion">Discussion</h4>
798d6e29
MS
3562 <p class="discussion">Currently only <code>HTTP_STATUS_CONTINUE</code> is supported for the &quot;expect&quot;
3563argument.
3564
3565</p>
3566<h3 class="function"><a id="httpSetField">httpSetField</a></h3>
53af7f21 3567 <p class="description">Set the value of an HTTP header.</p>
798d6e29 3568<p class="code">
98d88c8d
MS
3569void httpSetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p>
3570<h4 class="parameters">Parameters</h4>
3571<table class="list"><tbody>
3572<tr><th>http</th>
3573 <td class="description">HTTP connection</td></tr>
3574<tr><th>field</th>
3575 <td class="description">Field index</td></tr>
3576<tr><th>value</th>
3577 <td class="description">Value</td></tr>
3578</tbody></table>
3579<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpSetKeepAlive">httpSetKeepAlive</a></h3>
53af7f21 3580 <p class="description">Set the current Keep-Alive state of a connection.</p>
98d88c8d
MS
3581<p class="code">
3582void httpSetKeepAlive(<a href="#http_t">http_t</a> *http, <a href="#http_keepalive_t">http_keepalive_t</a> keep_alive);</p>
3583<h4 class="parameters">Parameters</h4>
3584<table class="list"><tbody>
3585<tr><th>http</th>
3586 <td class="description">HTTP connection</td></tr>
3587<tr><th>keep_alive</th>
3588 <td class="description">New Keep-Alive value</td></tr>
3589</tbody></table>
3590<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSetLength">httpSetLength</a></h3>
53af7f21 3591 <p class="description">Set the content-length and content-encoding.</p>
98d88c8d
MS
3592<p class="code">
3593void httpSetLength(<a href="#http_t">http_t</a> *http, size_t length);</p>
3594<h4 class="parameters">Parameters</h4>
3595<table class="list"><tbody>
3596<tr><th>http</th>
3597 <td class="description">HTTP connection</td></tr>
3598<tr><th>length</th>
3599 <td class="description">Length (0 for chunked)</td></tr>
3600</tbody></table>
3601<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpSetTimeout">httpSetTimeout</a></h3>
53af7f21 3602 <p class="description">Set read/write timeouts and an optional callback.</p>
98d88c8d
MS
3603<p class="code">
3604void httpSetTimeout(<a href="#http_t">http_t</a> *http, double timeout, <a href="#http_timeout_cb_t">http_timeout_cb_t</a> cb, void *user_data);</p>
3605<h4 class="parameters">Parameters</h4>
3606<table class="list"><tbody>
3607<tr><th>http</th>
3608 <td class="description">HTTP connection</td></tr>
3609<tr><th>timeout</th>
3610 <td class="description">Number of seconds for timeout,
3611must be greater than 0</td></tr>
3612<tr><th>cb</th>
3613 <td class="description">Callback function or NULL</td></tr>
3614<tr><th>user_data</th>
3615 <td class="description">User data pointer</td></tr>
3616</tbody></table>
3617<h4 class="discussion">Discussion</h4>
798d6e29
MS
3618 <p class="discussion">The optional timeout callback receives both the HTTP connection and a user
3619data pointer and must return 1 to continue or 0 to error (time) out.
3620
3621</p>
98d88c8d
MS
3622<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpShutdown">httpShutdown</a></h3>
3623 <p class="description">Shutdown one side of an HTTP connection.</p>
798d6e29 3624<p class="code">
98d88c8d 3625void httpShutdown(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3626<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3627<table class="list"><tbody>
3628<tr><th>http</th>
3629 <td class="description">HTTP connection</td></tr>
3630</tbody></table>
798d6e29
MS
3631<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpStateString">httpStateString</a></h3>
3632 <p class="description">Return the string describing a HTTP state value.</p>
3633<p class="code">
98d88c8d 3634const char *httpStateString(<a href="#http_state_t">http_state_t</a> state);</p>
798d6e29 3635<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3636<table class="list"><tbody>
3637<tr><th>state</th>
3638 <td class="description">HTTP state value</td></tr>
3639</tbody></table>
798d6e29
MS
3640<h4 class="returnvalue">Return Value</h4>
3641 <p class="description">State string</p>
3642<h3 class="function"><a id="httpStatus">httpStatus</a></h3>
3643 <p class="description">Return a short string describing a HTTP status code.</p>
3644<p class="code">
98d88c8d 3645const char *httpStatus(http_status_t status);</p>
798d6e29 3646<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3647<table class="list"><tbody>
3648<tr><th>status</th>
3649 <td class="description">HTTP status code</td></tr>
3650</tbody></table>
798d6e29
MS
3651<h4 class="returnvalue">Return Value</h4>
3652 <p class="description">Localized status string</p>
3653<h4 class="discussion">Discussion</h4>
3654 <p class="discussion">The returned string is localized to the current POSIX locale and is based
3655on the status strings defined in RFC 2616.</p>
3656<h3 class="function"><a id="httpTrace">httpTrace</a></h3>
3657 <p class="description">Send an TRACE request to the server.</p>
3658<p class="code">
98d88c8d 3659int httpTrace(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3660<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3661<table class="list"><tbody>
3662<tr><th>http</th>
3663 <td class="description">HTTP connection</td></tr>
3664<tr><th>uri</th>
3665 <td class="description">URI for trace</td></tr>
3666</tbody></table>
798d6e29
MS
3667<h4 class="returnvalue">Return Value</h4>
3668 <p class="description">Status of call (0 = success)</p>
3669<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpURIStatusString">httpURIStatusString</a></h3>
3670 <p class="description">Return a string describing a URI status code.</p>
3671<p class="code">
98d88c8d 3672const char *httpURIStatusString(<a href="#http_uri_status_t">http_uri_status_t</a> status);</p>
798d6e29 3673<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3674<table class="list"><tbody>
3675<tr><th>status</th>
3676 <td class="description">URI status code</td></tr>
3677</tbody></table>
798d6e29
MS
3678<h4 class="returnvalue">Return Value</h4>
3679 <p class="description">Localized status string</p>
3680<h3 class="function"><a id="httpUpdate">httpUpdate</a></h3>
3681 <p class="description">Update the current HTTP state for incoming data.</p>
3682<p class="code">
98d88c8d 3683http_status_t httpUpdate(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3684<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3685<table class="list"><tbody>
3686<tr><th>http</th>
3687 <td class="description">HTTP connection</td></tr>
3688</tbody></table>
798d6e29
MS
3689<h4 class="returnvalue">Return Value</h4>
3690 <p class="description">HTTP status</p>
3691<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpWait">httpWait</a></h3>
3692 <p class="description">Wait for data available on a connection.</p>
3693<p class="code">
98d88c8d 3694int httpWait(<a href="#http_t">http_t</a> *http, int msec);</p>
798d6e29 3695<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3696<table class="list"><tbody>
3697<tr><th>http</th>
3698 <td class="description">HTTP connection</td></tr>
3699<tr><th>msec</th>
3700 <td class="description">Milliseconds to wait</td></tr>
3701</tbody></table>
798d6e29
MS
3702<h4 class="returnvalue">Return Value</h4>
3703 <p class="description">1 if data is available, 0 otherwise</p>
798d6e29
MS
3704<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpWrite2">httpWrite2</a></h3>
3705 <p class="description">Write data to a HTTP connection.</p>
3706<p class="code">
98d88c8d
MS
3707ssize_t httpWrite2(<a href="#http_t">http_t</a> *http, const char *buffer, size_t length);</p>
3708<h4 class="parameters">Parameters</h4>
3709<table class="list"><tbody>
3710<tr><th>http</th>
3711 <td class="description">HTTP connection</td></tr>
3712<tr><th>buffer</th>
3713 <td class="description">Buffer for data</td></tr>
3714<tr><th>length</th>
3715 <td class="description">Number of bytes to write</td></tr>
3716</tbody></table>
798d6e29
MS
3717<h4 class="returnvalue">Return Value</h4>
3718 <p class="description">Number of bytes written</p>
3719<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpWriteResponse">httpWriteResponse</a></h3>
3720 <p class="description">Write a HTTP response to a client connection.</p>
3721<p class="code">
98d88c8d 3722int httpWriteResponse(<a href="#http_t">http_t</a> *http, http_status_t status);</p>
798d6e29 3723<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3724<table class="list"><tbody>
3725<tr><th>http</th>
3726 <td class="description">HTTP connection</td></tr>
3727<tr><th>status</th>
3728 <td class="description">Status code</td></tr>
3729</tbody></table>
798d6e29
MS
3730<h4 class="returnvalue">Return Value</h4>
3731 <p class="description">0 on success, -1 on error</p>
3732<h3 class="function"><a id="ippAddBoolean">ippAddBoolean</a></h3>
3733 <p class="description">Add a boolean attribute to an IPP message.</p>
3734<p class="code">
98d88c8d
MS
3735<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBoolean(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, char value);</p>
3736<h4 class="parameters">Parameters</h4>
3737<table class="list"><tbody>
3738<tr><th>ipp</th>
3739 <td class="description">IPP message</td></tr>
3740<tr><th>group</th>
3741 <td class="description">IPP group</td></tr>
3742<tr><th>name</th>
3743 <td class="description">Name of attribute</td></tr>
3744<tr><th>value</th>
3745 <td class="description">Value of attribute</td></tr>
3746</tbody></table>
798d6e29
MS
3747<h4 class="returnvalue">Return Value</h4>
3748 <p class="description">New attribute</p>
3749<h4 class="discussion">Discussion</h4>
3750 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3751the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3752<br>
3753The <code>group</code> parameter specifies the IPP attribute group tag: none
3754(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3755event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3756(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3757(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
3758<h3 class="function"><a id="ippAddBooleans">ippAddBooleans</a></h3>
3759 <p class="description">Add an array of boolean values.</p>
3760<p class="code">
98d88c8d
MS
3761<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBooleans(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int num_values, const char *values);</p>
3762<h4 class="parameters">Parameters</h4>
3763<table class="list"><tbody>
3764<tr><th>ipp</th>
3765 <td class="description">IPP message</td></tr>
3766<tr><th>group</th>
3767 <td class="description">IPP group</td></tr>
3768<tr><th>name</th>
3769 <td class="description">Name of attribute</td></tr>
3770<tr><th>num_values</th>
3771 <td class="description">Number of values</td></tr>
3772<tr><th>values</th>
3773 <td class="description">Values</td></tr>
3774</tbody></table>
798d6e29
MS
3775<h4 class="returnvalue">Return Value</h4>
3776 <p class="description">New attribute</p>
3777<h4 class="discussion">Discussion</h4>
3778 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3779the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3780<br>
3781The <code>group</code> parameter specifies the IPP attribute group tag: none
3782(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3783event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3784(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3785(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
3786<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippAddCollection">ippAddCollection</a></h3>
3787 <p class="description">Add a collection value.</p>
3788<p class="code">
98d88c8d
MS
3789<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollection(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, <a href="#ipp_t">ipp_t</a> *value);</p>
3790<h4 class="parameters">Parameters</h4>
3791<table class="list"><tbody>
3792<tr><th>ipp</th>
3793 <td class="description">IPP message</td></tr>
3794<tr><th>group</th>
3795 <td class="description">IPP group</td></tr>
3796<tr><th>name</th>
3797 <td class="description">Name of attribute</td></tr>
3798<tr><th>value</th>
3799 <td class="description">Value</td></tr>
3800</tbody></table>
798d6e29
MS
3801<h4 class="returnvalue">Return Value</h4>
3802 <p class="description">New attribute</p>
3803<h4 class="discussion">Discussion</h4>
3804 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3805the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3806<br>
3807The <code>group</code> parameter specifies the IPP attribute group tag: none
3808(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3809event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3810(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3811(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
3812
3813</p>
3814<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippAddCollections">ippAddCollections</a></h3>
3815 <p class="description">Add an array of collection values.</p>
3816<p class="code">
98d88c8d
MS
3817<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollections(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int num_values, const <a href="#ipp_t">ipp_t</a> **values);</p>
3818<h4 class="parameters">Parameters</h4>
3819<table class="list"><tbody>
3820<tr><th>ipp</th>
3821 <td class="description">IPP message</td></tr>
3822<tr><th>group</th>
3823 <td class="description">IPP group</td></tr>
3824<tr><th>name</th>
3825 <td class="description">Name of attribute</td></tr>
3826<tr><th>num_values</th>
3827 <td class="description">Number of values</td></tr>
3828<tr><th>values</th>
3829 <td class="description">Values</td></tr>
3830</tbody></table>
798d6e29
MS
3831<h4 class="returnvalue">Return Value</h4>
3832 <p class="description">New attribute</p>
3833<h4 class="discussion">Discussion</h4>
3834 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3835the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3836<br>
3837The <code>group</code> parameter specifies the IPP attribute group tag: none
3838(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3839event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3840(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3841(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
3842
3843</p>
3844<h3 class="function"><a id="ippAddDate">ippAddDate</a></h3>
3845 <p class="description">Add a date attribute to an IPP message.</p>
3846<p class="code">
98d88c8d
MS
3847<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddDate(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, const <a href="#ipp_uchar_t">ipp_uchar_t</a> *value);</p>
3848<h4 class="parameters">Parameters</h4>
3849<table class="list"><tbody>
3850<tr><th>ipp</th>
3851 <td class="description">IPP message</td></tr>
3852<tr><th>group</th>
3853 <td class="description">IPP group</td></tr>
3854<tr><th>name</th>
3855 <td class="description">Name of attribute</td></tr>
3856<tr><th>value</th>
3857 <td class="description">Value</td></tr>
3858</tbody></table>
798d6e29
MS
3859<h4 class="returnvalue">Return Value</h4>
3860 <p class="description">New attribute</p>
3861<h4 class="discussion">Discussion</h4>
3862 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3863the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3864<br>
3865The <code>group</code> parameter specifies the IPP attribute group tag: none
3866(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3867event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3868(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3869(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
3870<h3 class="function"><a id="ippAddInteger">ippAddInteger</a></h3>
3871 <p class="description">Add a integer attribute to an IPP message.</p>
3872<p class="code">
98d88c8d
MS
3873<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddInteger(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, int value);</p>
3874<h4 class="parameters">Parameters</h4>
3875<table class="list"><tbody>
3876<tr><th>ipp</th>
3877 <td class="description">IPP message</td></tr>
3878<tr><th>group</th>
3879 <td class="description">IPP group</td></tr>
3880<tr><th>value_tag</th>
3881 <td class="description">Type of attribute</td></tr>
3882<tr><th>name</th>
3883 <td class="description">Name of attribute</td></tr>
3884<tr><th>value</th>
3885 <td class="description">Value of attribute</td></tr>
3886</tbody></table>
798d6e29
MS
3887<h4 class="returnvalue">Return Value</h4>
3888 <p class="description">New attribute</p>
3889<h4 class="discussion">Discussion</h4>
3890 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3891the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3892<br>
3893The <code>group</code> parameter specifies the IPP attribute group tag: none
3894(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3895event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3896(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3897(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
3898<br>
3899Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
3900(<code>IPP_TAG_INTEGER</code>).</p>
3901<h3 class="function"><a id="ippAddIntegers">ippAddIntegers</a></h3>
3902 <p class="description">Add an array of integer values.</p>
3903<p class="code">
98d88c8d
MS
3904<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddIntegers(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, int num_values, const int *values);</p>
3905<h4 class="parameters">Parameters</h4>
3906<table class="list"><tbody>
3907<tr><th>ipp</th>
3908 <td class="description">IPP message</td></tr>
3909<tr><th>group</th>
3910 <td class="description">IPP group</td></tr>
3911<tr><th>value_tag</th>
3912 <td class="description">Type of attribute</td></tr>
3913<tr><th>name</th>
3914 <td class="description">Name of attribute</td></tr>
3915<tr><th>num_values</th>
3916 <td class="description">Number of values</td></tr>
3917<tr><th>values</th>
3918 <td class="description">Values</td></tr>
3919</tbody></table>
798d6e29
MS
3920<h4 class="returnvalue">Return Value</h4>
3921 <p class="description">New attribute</p>
3922<h4 class="discussion">Discussion</h4>
3923 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3924the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3925<br>
3926The <code>group</code> parameter specifies the IPP attribute group tag: none
3927(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3928event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3929(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3930(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
3931<br>
3932Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
3933(<code>IPP_TAG_INTEGER</code>).</p>
3934<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippAddOctetString">ippAddOctetString</a></h3>
3935 <p class="description">Add an octetString value to an IPP message.</p>
3936<p class="code">
98d88c8d
MS
3937<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOctetString(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, const void *data, int datalen);</p>
3938<h4 class="parameters">Parameters</h4>
3939<table class="list"><tbody>
3940<tr><th>ipp</th>
3941 <td class="description">IPP message</td></tr>
3942<tr><th>group</th>
3943 <td class="description">IPP group</td></tr>
3944<tr><th>name</th>
3945 <td class="description">Name of attribute</td></tr>
3946<tr><th>data</th>
3947 <td class="description">octetString data</td></tr>
3948<tr><th>datalen</th>
3949 <td class="description">Length of data in bytes</td></tr>
3950</tbody></table>
798d6e29
MS
3951<h4 class="returnvalue">Return Value</h4>
3952 <p class="description">New attribute</p>
3953<h4 class="discussion">Discussion</h4>
3954 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3955the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3956<br>
3957The <code>group</code> parameter specifies the IPP attribute group tag: none
3958(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3959event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3960(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3961(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
3962
3963</p>
3964<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippAddOutOfBand">ippAddOutOfBand</a></h3>
3965 <p class="description">Add an out-of-band value to an IPP message.</p>
3966<p class="code">
98d88c8d
MS
3967<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOutOfBand(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name);</p>
3968<h4 class="parameters">Parameters</h4>
3969<table class="list"><tbody>
3970<tr><th>ipp</th>
3971 <td class="description">IPP message</td></tr>
3972<tr><th>group</th>
3973 <td class="description">IPP group</td></tr>
3974<tr><th>value_tag</th>
3975 <td class="description">Type of attribute</td></tr>
3976<tr><th>name</th>
3977 <td class="description">Name of attribute</td></tr>
3978</tbody></table>
798d6e29
MS
3979<h4 class="returnvalue">Return Value</h4>
3980 <p class="description">New attribute</p>
3981<h4 class="discussion">Discussion</h4>
3982 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3983the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3984<br>
3985The <code>group</code> parameter specifies the IPP attribute group tag: none
3986(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3987event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3988(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3989(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
3990<br>
3991Supported out-of-band values include unsupported-value
3992(<code>IPP_TAG_UNSUPPORTED_VALUE</code>), default (<code>IPP_TAG_DEFAULT</code>), unknown
3993(<code>IPP_TAG_UNKNOWN</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable
3994(<code>IPP_TAG_NOTSETTABLE</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), and
3995admin-define (<code>IPP_TAG_ADMINDEFINE</code>).
3996
3997</p>
3998<h3 class="function"><a id="ippAddRange">ippAddRange</a></h3>
3999 <p class="description">Add a range of values to an IPP message.</p>
4000<p class="code">
98d88c8d
MS
4001<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRange(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int lower, int upper);</p>
4002<h4 class="parameters">Parameters</h4>
4003<table class="list"><tbody>
4004<tr><th>ipp</th>
4005 <td class="description">IPP message</td></tr>
4006<tr><th>group</th>
4007 <td class="description">IPP group</td></tr>
4008<tr><th>name</th>
4009 <td class="description">Name of attribute</td></tr>
4010<tr><th>lower</th>
4011 <td class="description">Lower value</td></tr>
4012<tr><th>upper</th>
4013 <td class="description">Upper value</td></tr>
4014</tbody></table>
798d6e29
MS
4015<h4 class="returnvalue">Return Value</h4>
4016 <p class="description">New attribute</p>
4017<h4 class="discussion">Discussion</h4>
4018 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4019the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4020<br>
4021The <code>group</code> parameter specifies the IPP attribute group tag: none
4022(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4023event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4024(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4025(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4026<br>
4027The <code>lower</code> parameter must be less than or equal to the <code>upper</code> parameter.</p>
4028<h3 class="function"><a id="ippAddRanges">ippAddRanges</a></h3>
4029 <p class="description">Add ranges of values to an IPP message.</p>
4030<p class="code">
98d88c8d
MS
4031<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRanges(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int num_values, const int *lower, const int *upper);</p>
4032<h4 class="parameters">Parameters</h4>
4033<table class="list"><tbody>
4034<tr><th>ipp</th>
4035 <td class="description">IPP message</td></tr>
4036<tr><th>group</th>
4037 <td class="description">IPP group</td></tr>
4038<tr><th>name</th>
4039 <td class="description">Name of attribute</td></tr>
4040<tr><th>num_values</th>
4041 <td class="description">Number of values</td></tr>
4042<tr><th>lower</th>
4043 <td class="description">Lower values</td></tr>
4044<tr><th>upper</th>
4045 <td class="description">Upper values</td></tr>
4046</tbody></table>
798d6e29
MS
4047<h4 class="returnvalue">Return Value</h4>
4048 <p class="description">New attribute</p>
4049<h4 class="discussion">Discussion</h4>
4050 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4051the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4052<br>
4053The <code>group</code> parameter specifies the IPP attribute group tag: none
4054(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4055event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4056(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4057(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4058<h3 class="function"><a id="ippAddResolution">ippAddResolution</a></h3>
4059 <p class="description">Add a resolution value to an IPP message.</p>
4060<p class="code">
98d88c8d
MS
4061<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolution(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, <a href="#ipp_res_t">ipp_res_t</a> units, int xres, int yres);</p>
4062<h4 class="parameters">Parameters</h4>
4063<table class="list"><tbody>
4064<tr><th>ipp</th>
4065 <td class="description">IPP message</td></tr>
4066<tr><th>group</th>
4067 <td class="description">IPP group</td></tr>
4068<tr><th>name</th>
4069 <td class="description">Name of attribute</td></tr>
4070<tr><th>units</th>
4071 <td class="description">Units for resolution</td></tr>
4072<tr><th>xres</th>
4073 <td class="description">X resolution</td></tr>
4074<tr><th>yres</th>
4075 <td class="description">Y resolution</td></tr>
4076</tbody></table>
798d6e29
MS
4077<h4 class="returnvalue">Return Value</h4>
4078 <p class="description">New attribute</p>
4079<h4 class="discussion">Discussion</h4>
4080 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4081the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4082<br>
4083The <code>group</code> parameter specifies the IPP attribute group tag: none
4084(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4085event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4086(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4087(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4088<h3 class="function"><a id="ippAddResolutions">ippAddResolutions</a></h3>
4089 <p class="description">Add resolution values to an IPP message.</p>
4090<p class="code">
98d88c8d
MS
4091<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolutions(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int num_values, <a href="#ipp_res_t">ipp_res_t</a> units, const int *xres, const int *yres);</p>
4092<h4 class="parameters">Parameters</h4>
4093<table class="list"><tbody>
4094<tr><th>ipp</th>
4095 <td class="description">IPP message</td></tr>
4096<tr><th>group</th>
4097 <td class="description">IPP group</td></tr>
4098<tr><th>name</th>
4099 <td class="description">Name of attribute</td></tr>
4100<tr><th>num_values</th>
4101 <td class="description">Number of values</td></tr>
4102<tr><th>units</th>
4103 <td class="description">Units for resolution</td></tr>
4104<tr><th>xres</th>
4105 <td class="description">X resolutions</td></tr>
4106<tr><th>yres</th>
4107 <td class="description">Y resolutions</td></tr>
4108</tbody></table>
798d6e29
MS
4109<h4 class="returnvalue">Return Value</h4>
4110 <p class="description">New attribute</p>
4111<h4 class="discussion">Discussion</h4>
4112 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4113the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4114<br>
4115The <code>group</code> parameter specifies the IPP attribute group tag: none
4116(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4117event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4118(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4119(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4120<h3 class="function"><a id="ippAddSeparator">ippAddSeparator</a></h3>
4121 <p class="description">Add a group separator to an IPP message.</p>
4122<p class="code">
98d88c8d 4123<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddSeparator(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4124<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4125<table class="list"><tbody>
4126<tr><th>ipp</th>
4127 <td class="description">IPP message</td></tr>
4128</tbody></table>
798d6e29
MS
4129<h4 class="returnvalue">Return Value</h4>
4130 <p class="description">New attribute</p>
4131<h4 class="discussion">Discussion</h4>
4132 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4133the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.</p>
4134<h3 class="function"><a id="ippAddString">ippAddString</a></h3>
4135 <p class="description">Add a language-encoded string to an IPP message.</p>
4136<p class="code">
98d88c8d
MS
4137<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddString(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, const char *language, const char *value);</p>
4138<h4 class="parameters">Parameters</h4>
4139<table class="list"><tbody>
4140<tr><th>ipp</th>
4141 <td class="description">IPP message</td></tr>
4142<tr><th>group</th>
4143 <td class="description">IPP group</td></tr>
4144<tr><th>value_tag</th>
4145 <td class="description">Type of attribute</td></tr>
4146<tr><th>name</th>
4147 <td class="description">Name of attribute</td></tr>
4148<tr><th>language</th>
4149 <td class="description">Language code</td></tr>
4150<tr><th>value</th>
4151 <td class="description">Value</td></tr>
4152</tbody></table>
798d6e29
MS
4153<h4 class="returnvalue">Return Value</h4>
4154 <p class="description">New attribute</p>
4155<h4 class="discussion">Discussion</h4>
4156 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4157the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4158<br>
4159The <code>group</code> parameter specifies the IPP attribute group tag: none
4160(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4161event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4162(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4163(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4164<br>
4165Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4166(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4167(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4168(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4169(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4170(<code>IPP_TAG_URISCHEME</code>).<br>
4171<br>
4172The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
4173textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
4174<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippAddStringf">ippAddStringf</a></h3>
4175 <p class="description">Add a formatted string to an IPP message.</p>
4176<p class="code">
98d88c8d
MS
4177<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStringf(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, const char *language, const char *format, ...);</p>
4178<h4 class="parameters">Parameters</h4>
4179<table class="list"><tbody>
4180<tr><th>ipp</th>
4181 <td class="description">IPP message</td></tr>
4182<tr><th>group</th>
4183 <td class="description">IPP group</td></tr>
4184<tr><th>value_tag</th>
4185 <td class="description">Type of attribute</td></tr>
4186<tr><th>name</th>
4187 <td class="description">Name of attribute</td></tr>
4188<tr><th>language</th>
4189 <td class="description">Language code (<code>NULL</code> for default)</td></tr>
4190<tr><th>format</th>
4191 <td class="description">Printf-style format string</td></tr>
4192<tr><th>...</th>
4193 <td class="description">Additional arguments as needed</td></tr>
4194</tbody></table>
798d6e29
MS
4195<h4 class="returnvalue">Return Value</h4>
4196 <p class="description">New attribute</p>
4197<h4 class="discussion">Discussion</h4>
4198 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4199the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4200<br>
4201The <code>group</code> parameter specifies the IPP attribute group tag: none
4202(<code>IPP_TAG_ZERO</code>, for member attributes), document
4203(<code>IPP_TAG_DOCUMENT</code>), event notification
4204(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
4205printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
4206or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4207<br>
4208Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4209(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4210(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4211(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4212(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4213(<code>IPP_TAG_URISCHEME</code>).<br>
4214<br>
4215The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
4216and textWithLanguage string values and must be <code>NULL</code> for all other
4217string values.<br>
4218<br>
4219The <code>format</code> parameter uses formatting characters compatible with the
4220printf family of standard functions. Additional arguments follow it as
4221needed. The formatted string is truncated as needed to the maximum length of
4222the corresponding value type.
4223
4224</p>
4225<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippAddStringfv">ippAddStringfv</a></h3>
4226 <p class="description">Add a formatted string to an IPP message.</p>
4227<p class="code">
98d88c8d
MS
4228<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStringfv(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, const char *language, const char *format, va_list ap);</p>
4229<h4 class="parameters">Parameters</h4>
4230<table class="list"><tbody>
4231<tr><th>ipp</th>
4232 <td class="description">IPP message</td></tr>
4233<tr><th>group</th>
4234 <td class="description">IPP group</td></tr>
4235<tr><th>value_tag</th>
4236 <td class="description">Type of attribute</td></tr>
4237<tr><th>name</th>
4238 <td class="description">Name of attribute</td></tr>
4239<tr><th>language</th>
4240 <td class="description">Language code (<code>NULL</code> for default)</td></tr>
4241<tr><th>format</th>
4242 <td class="description">Printf-style format string</td></tr>
4243<tr><th>ap</th>
4244 <td class="description">Additional arguments</td></tr>
4245</tbody></table>
798d6e29
MS
4246<h4 class="returnvalue">Return Value</h4>
4247 <p class="description">New attribute</p>
4248<h4 class="discussion">Discussion</h4>
4249 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4250the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4251<br>
4252The <code>group</code> parameter specifies the IPP attribute group tag: none
4253(<code>IPP_TAG_ZERO</code>, for member attributes), document
4254(<code>IPP_TAG_DOCUMENT</code>), event notification
4255(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
4256printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
4257or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4258<br>
4259Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4260(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4261(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4262(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4263(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4264(<code>IPP_TAG_URISCHEME</code>).<br>
4265<br>
4266The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
4267and textWithLanguage string values and must be <code>NULL</code> for all other
4268string values.<br>
4269<br>
4270The <code>format</code> parameter uses formatting characters compatible with the
4271printf family of standard functions. Additional arguments are passed in the
4272stdarg pointer <code>ap</code>. The formatted string is truncated as needed to the
4273maximum length of the corresponding value type.
4274
4275</p>
4276<h3 class="function"><a id="ippAddStrings">ippAddStrings</a></h3>
4277 <p class="description">Add language-encoded strings to an IPP message.</p>
4278<p class="code">
98d88c8d
MS
4279<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStrings(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, int num_values, const char *language, const char *const *values);</p>
4280<h4 class="parameters">Parameters</h4>
4281<table class="list"><tbody>
4282<tr><th>ipp</th>
4283 <td class="description">IPP message</td></tr>
4284<tr><th>group</th>
4285 <td class="description">IPP group</td></tr>
4286<tr><th>value_tag</th>
4287 <td class="description">Type of attribute</td></tr>
4288<tr><th>name</th>
4289 <td class="description">Name of attribute</td></tr>
4290<tr><th>num_values</th>
4291 <td class="description">Number of values</td></tr>
4292<tr><th>language</th>
4293 <td class="description">Language code (<code>NULL</code> for default)</td></tr>
4294<tr><th>values</th>
4295 <td class="description">Values</td></tr>
4296</tbody></table>
798d6e29
MS
4297<h4 class="returnvalue">Return Value</h4>
4298 <p class="description">New attribute</p>
4299<h4 class="discussion">Discussion</h4>
4300 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4301the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4302<br>
4303The <code>group</code> parameter specifies the IPP attribute group tag: none
4304(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4305event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4306(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4307(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4308<br>
4309Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4310(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4311(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4312(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4313(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4314(<code>IPP_TAG_URISCHEME</code>).<br>
4315<br>
4316The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
4317textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
4318<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippAttributeString">ippAttributeString</a></h3>
4319 <p class="description">Convert the attribute's value to a string.</p>
4320<p class="code">
98d88c8d
MS
4321size_t ippAttributeString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, char *buffer, size_t bufsize);</p>
4322<h4 class="parameters">Parameters</h4>
4323<table class="list"><tbody>
4324<tr><th>attr</th>
4325 <td class="description">Attribute</td></tr>
4326<tr><th>buffer</th>
4327 <td class="description">String buffer or NULL</td></tr>
4328<tr><th>bufsize</th>
4329 <td class="description">Size of string buffer</td></tr>
4330</tbody></table>
798d6e29
MS
4331<h4 class="returnvalue">Return Value</h4>
4332 <p class="description">Number of bytes less nul</p>
4333<h4 class="discussion">Discussion</h4>
4334 <p class="discussion">Returns the number of bytes that would be written, not including the
4335trailing nul. The buffer pointer can be NULL to get the required length,
4336just like (v)snprintf.
4337
4338</p>
4339<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippContainsInteger">ippContainsInteger</a></h3>
4340 <p class="description">Determine whether an attribute contains the
4341specified value or is within the list of ranges.</p>
4342<p class="code">
98d88c8d 4343int ippContainsInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int value);</p>
798d6e29 4344<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4345<table class="list"><tbody>
4346<tr><th>attr</th>
4347 <td class="description">Attribute</td></tr>
4348<tr><th>value</th>
4349 <td class="description">Integer/enum value</td></tr>
4350</tbody></table>
798d6e29
MS
4351<h4 class="returnvalue">Return Value</h4>
4352 <p class="description">1 on a match, 0 on no match</p>
4353<h4 class="discussion">Discussion</h4>
4354 <p class="discussion">Returns non-zero when the attribute contains either a matching integer or
4355enum value, or the value falls within one of the rangeOfInteger values for
4356the attribute.
4357
4358</p>
4359<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippContainsString">ippContainsString</a></h3>
4360 <p class="description">Determine whether an attribute contains the
4361specified string value.</p>
4362<p class="code">
98d88c8d 4363int ippContainsString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, const char *value);</p>
798d6e29 4364<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4365<table class="list"><tbody>
4366<tr><th>attr</th>
4367 <td class="description">Attribute</td></tr>
4368<tr><th>value</th>
4369 <td class="description">String value</td></tr>
4370</tbody></table>
798d6e29
MS
4371<h4 class="returnvalue">Return Value</h4>
4372 <p class="description">1 on a match, 0 on no match</p>
4373<h4 class="discussion">Discussion</h4>
4374 <p class="discussion">Returns non-zero when the attribute contains a matching charset, keyword,
4375language, mimeMediaType, name, text, URI, or URI scheme value.
4376
4377</p>
4378<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippCopyAttribute">ippCopyAttribute</a></h3>
4379 <p class="description">Copy an attribute.</p>
4380<p class="code">
98d88c8d
MS
4381<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippCopyAttribute(<a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_attribute_t">ipp_attribute_t</a> *srcattr, int quickcopy);</p>
4382<h4 class="parameters">Parameters</h4>
4383<table class="list"><tbody>
4384<tr><th>dst</th>
4385 <td class="description">Destination IPP message</td></tr>
4386<tr><th>srcattr</th>
4387 <td class="description">Attribute to copy</td></tr>
4388<tr><th>quickcopy</th>
4389 <td class="description">1 for a referenced copy, 0 for normal</td></tr>
4390</tbody></table>
798d6e29
MS
4391<h4 class="returnvalue">Return Value</h4>
4392 <p class="description">New attribute</p>
4393<h4 class="discussion">Discussion</h4>
4394 <p class="discussion">The specified attribute, <code>attr</code>, is copied to the destination IPP message.
4395When <code>quickcopy</code> is non-zero, a &quot;shallow&quot; reference copy of the attribute is
4396created - this should only be done as long as the original source IPP message will
4397not be freed for the life of the destination.
4398
4399</p>
4400<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippCopyAttributes">ippCopyAttributes</a></h3>
4401 <p class="description">Copy attributes from one IPP message to another.</p>
4402<p class="code">
98d88c8d
MS
4403int ippCopyAttributes(<a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_t">ipp_t</a> *src, int quickcopy, <a href="#ipp_copycb_t">ipp_copycb_t</a> cb, void *context);</p>
4404<h4 class="parameters">Parameters</h4>
4405<table class="list"><tbody>
4406<tr><th>dst</th>
4407 <td class="description">Destination IPP message</td></tr>
4408<tr><th>src</th>
4409 <td class="description">Source IPP message</td></tr>
4410<tr><th>quickcopy</th>
4411 <td class="description">1 for a referenced copy, 0 for normal</td></tr>
4412<tr><th>cb</th>
4413 <td class="description">Copy callback or <code>NULL</code> for none</td></tr>
4414<tr><th>context</th>
4415 <td class="description">Context pointer</td></tr>
4416</tbody></table>
798d6e29
MS
4417<h4 class="returnvalue">Return Value</h4>
4418 <p class="description">1 on success, 0 on error</p>
4419<h4 class="discussion">Discussion</h4>
4420 <p class="discussion">Zero or more attributes are copied from the source IPP message, <code>src</code>, to the
4421destination IPP message, <code>dst</code>. When <code>quickcopy</code> is non-zero, a &quot;shallow&quot;
4422reference copy of the attribute is created - this should only be done as long as the
4423original source IPP message will not be freed for the life of the destination.<br>
4424<br>
4425The <code>cb</code> and <code>context</code> parameters provide a generic way to &quot;filter&quot; the
4426attributes that are copied - the function must return 1 to copy the attribute or
44270 to skip it. The function may also choose to do a partial copy of the source attribute
4428itself.
4429
4430</p>
4431<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippCreateRequestedArray">ippCreateRequestedArray</a></h3>
4432 <p class="description">Create a CUPS array of attribute names from the
4433given requested-attributes attribute.</p>
4434<p class="code">
98d88c8d 4435cups_array_t *ippCreateRequestedArray(<a href="#ipp_t">ipp_t</a> *request);</p>
798d6e29 4436<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4437<table class="list"><tbody>
4438<tr><th>request</th>
4439 <td class="description">IPP request</td></tr>
4440</tbody></table>
798d6e29
MS
4441<h4 class="returnvalue">Return Value</h4>
4442 <p class="description">CUPS array or <code>NULL</code> if all</p>
4443<h4 class="discussion">Discussion</h4>
4444 <p class="discussion">This function creates a (sorted) CUPS array of attribute names matching the
4445list of &quot;requested-attribute&quot; values supplied in an IPP request. All IANA-
4446registered values are supported in addition to the CUPS IPP extension
4447attributes.<br>
4448<br>
4449The <code>request</code> parameter specifies the request message that was read from
4450the client.
4451
4452<code>NULL</code> is returned if all attributes should be returned. Otherwise, the
4453result is a sorted array of attribute names, where <code>cupsArrayFind(array,
4454"attribute-name")</code> will return a non-NULL pointer. The array must be freed
4455using the <code>cupsArrayDelete</code> function.
4456
4457</p>
4458<h3 class="function"><a id="ippDateToTime">ippDateToTime</a></h3>
4459 <p class="description">Convert from RFC 1903 Date/Time format to UNIX time
4460in seconds.</p>
4461<p class="code">
98d88c8d 4462time_t ippDateToTime(const <a href="#ipp_uchar_t">ipp_uchar_t</a> *date);</p>
798d6e29 4463<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4464<table class="list"><tbody>
4465<tr><th>date</th>
4466 <td class="description">RFC 1903 date info</td></tr>
4467</tbody></table>
798d6e29
MS
4468<h4 class="returnvalue">Return Value</h4>
4469 <p class="description">UNIX time value</p>
4470<h3 class="function"><a id="ippDelete">ippDelete</a></h3>
98d88c8d 4471 <p class="description">Delete an IPP message.</p>
798d6e29 4472<p class="code">
98d88c8d 4473void ippDelete(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4474<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4475<table class="list"><tbody>
4476<tr><th>ipp</th>
4477 <td class="description">IPP message</td></tr>
4478</tbody></table>
4479<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippDeleteAttribute">ippDeleteAttribute</a></h3>
53af7f21 4480 <p class="description">Delete a single attribute in an IPP message.</p>
98d88c8d
MS
4481<p class="code">
4482void ippDeleteAttribute(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
4483<h4 class="parameters">Parameters</h4>
4484<table class="list"><tbody>
4485<tr><th>ipp</th>
4486 <td class="description">IPP message</td></tr>
4487<tr><th>attr</th>
4488 <td class="description">Attribute to delete</td></tr>
4489</tbody></table>
798d6e29
MS
4490<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippDeleteValues">ippDeleteValues</a></h3>
4491 <p class="description">Delete values in an attribute.</p>
4492<p class="code">
98d88c8d
MS
4493int ippDeleteValues(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int count);</p>
4494<h4 class="parameters">Parameters</h4>
4495<table class="list"><tbody>
4496<tr><th>ipp</th>
4497 <td class="description">IPP message</td></tr>
4498<tr><th>attr</th>
4499 <td class="description">Attribute</td></tr>
4500<tr><th>element</th>
4501 <td class="description">Index of first value to delete (0-based)</td></tr>
4502<tr><th>count</th>
4503 <td class="description">Number of values to delete</td></tr>
4504</tbody></table>
798d6e29
MS
4505<h4 class="returnvalue">Return Value</h4>
4506 <p class="description">1 on success, 0 on failure</p>
4507<h4 class="discussion">Discussion</h4>
4508 <p class="discussion">The <code>element</code> parameter specifies the first value to delete, starting at
45090. It must be less than the number of values returned by <a href="#ippGetCount"><code>ippGetCount</code></a>.<br>
4510<br>
4511The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4512<br>
4513Deleting all values in an attribute deletes the attribute.
4514
4515</p>
4516<h3 class="function"><a id="ippEnumString">ippEnumString</a></h3>
4517 <p class="description">Return a string corresponding to the enum value.</p>
4518<p class="code">
98d88c8d 4519const char *ippEnumString(const char *attrname, int enumvalue);</p>
798d6e29 4520<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4521<table class="list"><tbody>
4522<tr><th>attrname</th>
4523 <td class="description">Attribute name</td></tr>
4524<tr><th>enumvalue</th>
4525 <td class="description">Enum value</td></tr>
4526</tbody></table>
798d6e29
MS
4527<h4 class="returnvalue">Return Value</h4>
4528 <p class="description">Enum string</p>
4529<h3 class="function"><a id="ippEnumValue">ippEnumValue</a></h3>
4530 <p class="description">Return the value associated with a given enum string.</p>
4531<p class="code">
98d88c8d 4532int ippEnumValue(const char *attrname, const char *enumstring);</p>
798d6e29 4533<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4534<table class="list"><tbody>
4535<tr><th>attrname</th>
4536 <td class="description">Attribute name</td></tr>
4537<tr><th>enumstring</th>
4538 <td class="description">Enum string</td></tr>
4539</tbody></table>
798d6e29
MS
4540<h4 class="returnvalue">Return Value</h4>
4541 <p class="description">Enum value or -1 if unknown</p>
4542<h3 class="function"><a id="ippErrorString">ippErrorString</a></h3>
4543 <p class="description">Return a name for the given status code.</p>
4544<p class="code">
98d88c8d 4545const char *ippErrorString(ipp_status_t error);</p>
798d6e29 4546<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4547<table class="list"><tbody>
4548<tr><th>error</th>
4549 <td class="description">Error status</td></tr>
4550</tbody></table>
798d6e29
MS
4551<h4 class="returnvalue">Return Value</h4>
4552 <p class="description">Text string</p>
4553<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippErrorValue">ippErrorValue</a></h3>
4554 <p class="description">Return a status code for the given name.</p>
4555<p class="code">
98d88c8d 4556ipp_status_t ippErrorValue(const char *name);</p>
798d6e29 4557<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4558<table class="list"><tbody>
4559<tr><th>name</th>
4560 <td class="description">Name</td></tr>
4561</tbody></table>
798d6e29
MS
4562<h4 class="returnvalue">Return Value</h4>
4563 <p class="description">IPP status code</p>
4564<h3 class="function"><a id="ippFindAttribute">ippFindAttribute</a></h3>
4565 <p class="description">Find a named attribute in a request.</p>
4566<p class="code">
98d88c8d
MS
4567<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindAttribute(<a href="#ipp_t">ipp_t</a> *ipp, const char *name, ipp_tag_t type);</p>
4568<h4 class="parameters">Parameters</h4>
4569<table class="list"><tbody>
4570<tr><th>ipp</th>
4571 <td class="description">IPP message</td></tr>
4572<tr><th>name</th>
4573 <td class="description">Name of attribute</td></tr>
4574<tr><th>type</th>
4575 <td class="description">Type of attribute</td></tr>
4576</tbody></table>
798d6e29
MS
4577<h4 class="returnvalue">Return Value</h4>
4578 <p class="description">Matching attribute</p>
4579<h4 class="discussion">Discussion</h4>
4580 <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
4581of attribute and member names separated by slashes, for example
4582&quot;media-col/media-size&quot;.</p>
4583<h3 class="function"><a id="ippFindNextAttribute">ippFindNextAttribute</a></h3>
4584 <p class="description">Find the next named attribute in a request.</p>
4585<p class="code">
98d88c8d
MS
4586<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindNextAttribute(<a href="#ipp_t">ipp_t</a> *ipp, const char *name, ipp_tag_t type);</p>
4587<h4 class="parameters">Parameters</h4>
4588<table class="list"><tbody>
4589<tr><th>ipp</th>
4590 <td class="description">IPP message</td></tr>
4591<tr><th>name</th>
4592 <td class="description">Name of attribute</td></tr>
4593<tr><th>type</th>
4594 <td class="description">Type of attribute</td></tr>
4595</tbody></table>
798d6e29
MS
4596<h4 class="returnvalue">Return Value</h4>
4597 <p class="description">Matching attribute</p>
4598<h4 class="discussion">Discussion</h4>
4599 <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
4600of attribute and member names separated by slashes, for example
4601&quot;media-col/media-size&quot;.</p>
4602<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippFirstAttribute">ippFirstAttribute</a></h3>
4603 <p class="description">Return the first attribute in the message.</p>
4604<p class="code">
98d88c8d 4605<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFirstAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4606<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4607<table class="list"><tbody>
4608<tr><th>ipp</th>
4609 <td class="description">IPP message</td></tr>
4610</tbody></table>
798d6e29
MS
4611<h4 class="returnvalue">Return Value</h4>
4612 <p class="description">First attribute or <code>NULL</code> if none</p>
4613<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetBoolean">ippGetBoolean</a></h3>
4614 <p class="description">Get a boolean value for an attribute.</p>
4615<p class="code">
98d88c8d 4616int ippGetBoolean(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
798d6e29 4617<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4618<table class="list"><tbody>
4619<tr><th>attr</th>
4620 <td class="description">IPP attribute</td></tr>
4621<tr><th>element</th>
4622 <td class="description">Value number (0-based)</td></tr>
4623</tbody></table>
798d6e29
MS
4624<h4 class="returnvalue">Return Value</h4>
4625 <p class="description">Boolean value or 0 on error</p>
4626<h4 class="discussion">Discussion</h4>
4627 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4628<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
4629
4630</p>
4631<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetCollection">ippGetCollection</a></h3>
4632 <p class="description">Get a collection value for an attribute.</p>
4633<p class="code">
98d88c8d 4634<a href="#ipp_t">ipp_t</a> *ippGetCollection(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
798d6e29 4635<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4636<table class="list"><tbody>
4637<tr><th>attr</th>
4638 <td class="description">IPP attribute</td></tr>
4639<tr><th>element</th>
4640 <td class="description">Value number (0-based)</td></tr>
4641</tbody></table>
798d6e29
MS
4642<h4 class="returnvalue">Return Value</h4>
4643 <p class="description">Collection value or <code>NULL</code> on error</p>
4644<h4 class="discussion">Discussion</h4>
4645 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4646<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
4647
4648</p>
4649<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetCount">ippGetCount</a></h3>
4650 <p class="description">Get the number of values in an attribute.</p>
4651<p class="code">
98d88c8d 4652int ippGetCount(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 4653<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4654<table class="list"><tbody>
4655<tr><th>attr</th>
4656 <td class="description">IPP attribute</td></tr>
4657</tbody></table>
798d6e29
MS
4658<h4 class="returnvalue">Return Value</h4>
4659 <p class="description">Number of values or 0 on error</p>
4660<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetDate">ippGetDate</a></h3>
4661 <p class="description">Get a date value for an attribute.</p>
4662<p class="code">
98d88c8d 4663const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippGetDate(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
798d6e29 4664<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4665<table class="list"><tbody>
4666<tr><th>attr</th>
4667 <td class="description">IPP attribute</td></tr>
4668<tr><th>element</th>
4669 <td class="description">Value number (0-based)</td></tr>
4670</tbody></table>
798d6e29
MS
4671<h4 class="returnvalue">Return Value</h4>
4672 <p class="description">Date value or <code>NULL</code></p>
4673<h4 class="discussion">Discussion</h4>
4674 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4675<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
4676
4677</p>
4678<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetGroupTag">ippGetGroupTag</a></h3>
4679 <p class="description">Get the group associated with an attribute.</p>
4680<p class="code">
98d88c8d 4681ipp_tag_t ippGetGroupTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 4682<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4683<table class="list"><tbody>
4684<tr><th>attr</th>
4685 <td class="description">IPP attribute</td></tr>
4686</tbody></table>
798d6e29
MS
4687<h4 class="returnvalue">Return Value</h4>
4688 <p class="description">Group tag or <code>IPP_TAG_ZERO</code> on error</p>
4689<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetInteger">ippGetInteger</a></h3>
4690 <p class="description">Get the integer/enum value for an attribute.</p>
4691<p class="code">
98d88c8d 4692int ippGetInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
798d6e29 4693<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4694<table class="list"><tbody>
4695<tr><th>attr</th>
4696 <td class="description">IPP attribute</td></tr>
4697<tr><th>element</th>
4698 <td class="description">Value number (0-based)</td></tr>
4699</tbody></table>
798d6e29
MS
4700<h4 class="returnvalue">Return Value</h4>
4701 <p class="description">Value or 0 on error</p>
4702<h4 class="discussion">Discussion</h4>
4703 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4704<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
4705
4706</p>
4707<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetName">ippGetName</a></h3>
4708 <p class="description">Get the attribute name.</p>
4709<p class="code">
98d88c8d 4710const char *ippGetName(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 4711<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4712<table class="list"><tbody>
4713<tr><th>attr</th>
4714 <td class="description">IPP attribute</td></tr>
4715</tbody></table>
798d6e29
MS
4716<h4 class="returnvalue">Return Value</h4>
4717 <p class="description">Attribute name or <code>NULL</code> for separators</p>
4718<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippGetOctetString">ippGetOctetString</a></h3>
4719 <p class="description">Get an octetString value from an IPP attribute.</p>
4720<p class="code">
98d88c8d
MS
4721void *ippGetOctetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *datalen);</p>
4722<h4 class="parameters">Parameters</h4>
4723<table class="list"><tbody>
4724<tr><th>attr</th>
4725 <td class="description">IPP attribute</td></tr>
4726<tr><th>element</th>
4727 <td class="description">Value number (0-based)</td></tr>
4728<tr><th>datalen</th>
4729 <td class="description">Length of octetString data</td></tr>
4730</tbody></table>
798d6e29
MS
4731<h4 class="returnvalue">Return Value</h4>
4732 <p class="description">Pointer to octetString data</p>
4733<h4 class="discussion">Discussion</h4>
4734 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4735<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
4736
4737</p>
4738<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetOperation">ippGetOperation</a></h3>
4739 <p class="description">Get the operation ID in an IPP message.</p>
4740<p class="code">
98d88c8d 4741ipp_op_t ippGetOperation(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4742<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4743<table class="list"><tbody>
4744<tr><th>ipp</th>
4745 <td class="description">IPP request message</td></tr>
4746</tbody></table>
798d6e29
MS
4747<h4 class="returnvalue">Return Value</h4>
4748 <p class="description">Operation ID or 0 on error</p>
4749<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetRange">ippGetRange</a></h3>
4750 <p class="description">Get a rangeOfInteger value from an attribute.</p>
4751<p class="code">
98d88c8d
MS
4752int ippGetRange(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *uppervalue);</p>
4753<h4 class="parameters">Parameters</h4>
4754<table class="list"><tbody>
4755<tr><th>attr</th>
4756 <td class="description">IPP attribute</td></tr>
4757<tr><th>element</th>
4758 <td class="description">Value number (0-based)</td></tr>
4759<tr><th>uppervalue</th>
4760 <td class="description">Upper value of range</td></tr>
4761</tbody></table>
798d6e29
MS
4762<h4 class="returnvalue">Return Value</h4>
4763 <p class="description">Lower value of range or 0</p>
4764<h4 class="discussion">Discussion</h4>
4765 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4766<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
4767
4768</p>
4769<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetRequestId">ippGetRequestId</a></h3>
4770 <p class="description">Get the request ID from an IPP message.</p>
4771<p class="code">
98d88c8d 4772int ippGetRequestId(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4773<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4774<table class="list"><tbody>
4775<tr><th>ipp</th>
4776 <td class="description">IPP message</td></tr>
4777</tbody></table>
798d6e29
MS
4778<h4 class="returnvalue">Return Value</h4>
4779 <p class="description">Request ID or 0 on error</p>
4780<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetResolution">ippGetResolution</a></h3>
4781 <p class="description">Get a resolution value for an attribute.</p>
4782<p class="code">
98d88c8d
MS
4783int ippGetResolution(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *yres, <a href="#ipp_res_t">ipp_res_t</a> *units);</p>
4784<h4 class="parameters">Parameters</h4>
4785<table class="list"><tbody>
4786<tr><th>attr</th>
4787 <td class="description">IPP attribute</td></tr>
4788<tr><th>element</th>
4789 <td class="description">Value number (0-based)</td></tr>
4790<tr><th>yres</th>
4791 <td class="description">Vertical/feed resolution</td></tr>
4792<tr><th>units</th>
4793 <td class="description">Units for resolution</td></tr>
4794</tbody></table>
798d6e29
MS
4795<h4 class="returnvalue">Return Value</h4>
4796 <p class="description">Horizontal/cross feed resolution or 0</p>
4797<h4 class="discussion">Discussion</h4>
4798 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4799<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
4800
4801</p>
4802<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetState">ippGetState</a></h3>
4803 <p class="description">Get the IPP message state.</p>
4804<p class="code">
98d88c8d 4805<a href="#ipp_state_t">ipp_state_t</a> ippGetState(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4806<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4807<table class="list"><tbody>
4808<tr><th>ipp</th>
4809 <td class="description">IPP message</td></tr>
4810</tbody></table>
798d6e29
MS
4811<h4 class="returnvalue">Return Value</h4>
4812 <p class="description">IPP message state value</p>
4813<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetStatusCode">ippGetStatusCode</a></h3>
4814 <p class="description">Get the status code from an IPP response or event message.</p>
4815<p class="code">
98d88c8d 4816ipp_status_t ippGetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4817<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4818<table class="list"><tbody>
4819<tr><th>ipp</th>
4820 <td class="description">IPP response or event message</td></tr>
4821</tbody></table>
798d6e29
MS
4822<h4 class="returnvalue">Return Value</h4>
4823 <p class="description">Status code in IPP message</p>
4824<h3 class="function"><a id="ippGetString">ippGetString</a></h3>
98d88c8d
MS
4825 <p class="description"></p>
4826<p class="code">
4827const char *ippGetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, const char **language);</p>
4828<h4 class="parameters">Parameters</h4>
4829<table class="list"><tbody>
4830<tr><th>attr</th>
4831 <td class="description">IPP attribute</td></tr>
4832<tr><th>element</th>
4833 <td class="description">Value number (0-based)</td></tr>
4834<tr><th>language</th>
4835 <td class="description">Language code (<code>NULL</code> for don't care)</td></tr>
4836</tbody></table>
798d6e29
MS
4837<h4 class="returnvalue">Return Value</h4>
4838 <p class="description">Get the string and optionally the language code for an attribute.</p>
4839 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4840<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
4841
4842</p>
4843<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetValueTag">ippGetValueTag</a></h3>
4844 <p class="description">Get the value tag for an attribute.</p>
4845<p class="code">
98d88c8d 4846ipp_tag_t ippGetValueTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 4847<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4848<table class="list"><tbody>
4849<tr><th>attr</th>
4850 <td class="description">IPP attribute</td></tr>
4851</tbody></table>
798d6e29
MS
4852<h4 class="returnvalue">Return Value</h4>
4853 <p class="description">Value tag or <code>IPP_TAG_ZERO</code> on error</p>
4854<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetVersion">ippGetVersion</a></h3>
4855 <p class="description">Get the major and minor version number from an IPP message.</p>
4856<p class="code">
98d88c8d 4857int ippGetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int *minor);</p>
798d6e29 4858<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4859<table class="list"><tbody>
4860<tr><th>ipp</th>
4861 <td class="description">IPP message</td></tr>
4862<tr><th>minor</th>
4863 <td class="description">Minor version number or <code>NULL</code></td></tr>
4864</tbody></table>
798d6e29
MS
4865<h4 class="returnvalue">Return Value</h4>
4866 <p class="description">Major version number or 0 on error</p>
4867<h3 class="function"><a id="ippLength">ippLength</a></h3>
4868 <p class="description">Compute the length of an IPP message.</p>
4869<p class="code">
98d88c8d 4870size_t ippLength(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4871<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4872<table class="list"><tbody>
4873<tr><th>ipp</th>
4874 <td class="description">IPP message</td></tr>
4875</tbody></table>
798d6e29
MS
4876<h4 class="returnvalue">Return Value</h4>
4877 <p class="description">Size of IPP message</p>
4878<h3 class="function"><a id="ippNew">ippNew</a></h3>
4879 <p class="description">Allocate a new IPP message.</p>
4880<p class="code">
98d88c8d 4881<a href="#ipp_t">ipp_t</a> *ippNew(void);</p>
798d6e29
MS
4882<h4 class="returnvalue">Return Value</h4>
4883 <p class="description">New IPP message</p>
4884<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippNewRequest">ippNewRequest</a></h3>
4885 <p class="description">Allocate a new IPP request message.</p>
4886<p class="code">
98d88c8d 4887<a href="#ipp_t">ipp_t</a> *ippNewRequest(ipp_op_t op);</p>
798d6e29 4888<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4889<table class="list"><tbody>
4890<tr><th>op</th>
4891 <td class="description">Operation code</td></tr>
4892</tbody></table>
798d6e29
MS
4893<h4 class="returnvalue">Return Value</h4>
4894 <p class="description">IPP request message</p>
4895<h4 class="discussion">Discussion</h4>
4896 <p class="discussion">The new request message is initialized with the attributes-charset and
4897attributes-natural-language attributes added. The
4898attributes-natural-language value is derived from the current locale.
4899
4900</p>
4901<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippNewResponse">ippNewResponse</a></h3>
4902 <p class="description">Allocate a new IPP response message.</p>
4903<p class="code">
98d88c8d 4904<a href="#ipp_t">ipp_t</a> *ippNewResponse(<a href="#ipp_t">ipp_t</a> *request);</p>
798d6e29 4905<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4906<table class="list"><tbody>
4907<tr><th>request</th>
4908 <td class="description">IPP request message</td></tr>
4909</tbody></table>
798d6e29
MS
4910<h4 class="returnvalue">Return Value</h4>
4911 <p class="description">IPP response message</p>
4912<h4 class="discussion">Discussion</h4>
4913 <p class="discussion">The new response message is initialized with the same version-number,
4914request-id, attributes-charset, and attributes-natural-language as the
4915provided request message. If the attributes-charset or
4916attributes-natural-language attributes are missing from the request,
4917&quot;utf-8&quot; and a value derived from the current locale are substituted,
4918respectively.
4919
4920</p>
4921<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippNextAttribute">ippNextAttribute</a></h3>
4922 <p class="description">Return the next attribute in the message.</p>
4923<p class="code">
98d88c8d 4924<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippNextAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4925<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4926<table class="list"><tbody>
4927<tr><th>ipp</th>
4928 <td class="description">IPP message</td></tr>
4929</tbody></table>
798d6e29
MS
4930<h4 class="returnvalue">Return Value</h4>
4931 <p class="description">Next attribute or <code>NULL</code> if none</p>
4932<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippOpString">ippOpString</a></h3>
4933 <p class="description">Return a name for the given operation id.</p>
4934<p class="code">
98d88c8d 4935const char *ippOpString(ipp_op_t op);</p>
798d6e29 4936<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4937<table class="list"><tbody>
4938<tr><th>op</th>
4939 <td class="description">Operation ID</td></tr>
4940</tbody></table>
798d6e29
MS
4941<h4 class="returnvalue">Return Value</h4>
4942 <p class="description">Name</p>
4943<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippOpValue">ippOpValue</a></h3>
4944 <p class="description">Return an operation id for the given name.</p>
4945<p class="code">
98d88c8d 4946ipp_op_t ippOpValue(const char *name);</p>
798d6e29 4947<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4948<table class="list"><tbody>
4949<tr><th>name</th>
4950 <td class="description">Textual name</td></tr>
4951</tbody></table>
798d6e29
MS
4952<h4 class="returnvalue">Return Value</h4>
4953 <p class="description">Operation ID</p>
4954<h3 class="function"><a id="ippPort">ippPort</a></h3>
4955 <p class="description">Return the default IPP port number.</p>
4956<p class="code">
98d88c8d 4957int ippPort(void);</p>
798d6e29
MS
4958<h4 class="returnvalue">Return Value</h4>
4959 <p class="description">Port number</p>
4960<h3 class="function"><a id="ippRead">ippRead</a></h3>
4961 <p class="description">Read data for an IPP message from a HTTP connection.</p>
4962<p class="code">
98d88c8d 4963<a href="#ipp_state_t">ipp_state_t</a> ippRead(<a href="#http_t">http_t</a> *http, <a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4964<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4965<table class="list"><tbody>
4966<tr><th>http</th>
4967 <td class="description">HTTP connection</td></tr>
4968<tr><th>ipp</th>
4969 <td class="description">IPP data</td></tr>
4970</tbody></table>
798d6e29
MS
4971<h4 class="returnvalue">Return Value</h4>
4972 <p class="description">Current state</p>
4973<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippReadFile">ippReadFile</a></h3>
4974 <p class="description">Read data for an IPP message from a file.</p>
4975<p class="code">
98d88c8d 4976<a href="#ipp_state_t">ipp_state_t</a> ippReadFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4977<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4978<table class="list"><tbody>
4979<tr><th>fd</th>
4980 <td class="description">HTTP data</td></tr>
4981<tr><th>ipp</th>
4982 <td class="description">IPP data</td></tr>
4983</tbody></table>
798d6e29
MS
4984<h4 class="returnvalue">Return Value</h4>
4985 <p class="description">Current state</p>
4986<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippReadIO">ippReadIO</a></h3>
4987 <p class="description">Read data for an IPP message.</p>
4988<p class="code">
98d88c8d
MS
4989<a href="#ipp_state_t">ipp_state_t</a> ippReadIO(void *src, <a href="#ipp_iocb_t">ipp_iocb_t</a> cb, int blocking, <a href="#ipp_t">ipp_t</a> *parent, <a href="#ipp_t">ipp_t</a> *ipp);</p>
4990<h4 class="parameters">Parameters</h4>
4991<table class="list"><tbody>
4992<tr><th>src</th>
4993 <td class="description">Data source</td></tr>
4994<tr><th>cb</th>
4995 <td class="description">Read callback function</td></tr>
4996<tr><th>blocking</th>
4997 <td class="description">Use blocking IO?</td></tr>
4998<tr><th>parent</th>
4999 <td class="description">Parent request, if any</td></tr>
5000<tr><th>ipp</th>
5001 <td class="description">IPP data</td></tr>
5002</tbody></table>
798d6e29
MS
5003<h4 class="returnvalue">Return Value</h4>
5004 <p class="description">Current state</p>
5005<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetBoolean">ippSetBoolean</a></h3>
5006 <p class="description">Set a boolean value in an attribute.</p>
5007<p class="code">
98d88c8d
MS
5008int ippSetBoolean(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int boolvalue);</p>
5009<h4 class="parameters">Parameters</h4>
5010<table class="list"><tbody>
5011<tr><th>ipp</th>
5012 <td class="description">IPP message</td></tr>
5013<tr><th>attr</th>
5014 <td class="description">IPP attribute</td></tr>
5015<tr><th>element</th>
5016 <td class="description">Value number (0-based)</td></tr>
5017<tr><th>boolvalue</th>
5018 <td class="description">Boolean value</td></tr>
5019</tbody></table>
798d6e29
MS
5020<h4 class="returnvalue">Return Value</h4>
5021 <p class="description">1 on success, 0 on failure</p>
5022<h4 class="discussion">Discussion</h4>
5023 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5024the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5025<br>
5026The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5027<br>
5028The <code>element</code> parameter specifies which value to set from 0 to
5029<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
5030
5031</p>
5032<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetCollection">ippSetCollection</a></h3>
5033 <p class="description">Set a collection value in an attribute.</p>
5034<p class="code">
98d88c8d
MS
5035int ippSetCollection(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, <a href="#ipp_t">ipp_t</a> *colvalue);</p>
5036<h4 class="parameters">Parameters</h4>
5037<table class="list"><tbody>
5038<tr><th>ipp</th>
5039 <td class="description">IPP message</td></tr>
5040<tr><th>attr</th>
5041 <td class="description">IPP attribute</td></tr>
5042<tr><th>element</th>
5043 <td class="description">Value number (0-based)</td></tr>
5044<tr><th>colvalue</th>
5045 <td class="description">Collection value</td></tr>
5046</tbody></table>
798d6e29
MS
5047<h4 class="returnvalue">Return Value</h4>
5048 <p class="description">1 on success, 0 on failure</p>
5049<h4 class="discussion">Discussion</h4>
5050 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5051the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5052<br>
5053The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5054<br>
5055The <code>element</code> parameter specifies which value to set from 0 to
5056<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
5057
5058</p>
5059<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetDate">ippSetDate</a></h3>
5060 <p class="description">Set a date value in an attribute.</p>
5061<p class="code">
98d88c8d
MS
5062int ippSetDate(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const <a href="#ipp_uchar_t">ipp_uchar_t</a> *datevalue);</p>
5063<h4 class="parameters">Parameters</h4>
5064<table class="list"><tbody>
5065<tr><th>ipp</th>
5066 <td class="description">IPP message</td></tr>
5067<tr><th>attr</th>
5068 <td class="description">IPP attribute</td></tr>
5069<tr><th>element</th>
5070 <td class="description">Value number (0-based)</td></tr>
5071<tr><th>datevalue</th>
5072 <td class="description">Date value</td></tr>
5073</tbody></table>
798d6e29
MS
5074<h4 class="returnvalue">Return Value</h4>
5075 <p class="description">1 on success, 0 on failure</p>
5076<h4 class="discussion">Discussion</h4>
5077 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5078the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5079<br>
5080The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5081<br>
5082The <code>element</code> parameter specifies which value to set from 0 to
5083<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
5084
5085</p>
5086<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetGroupTag">ippSetGroupTag</a></h3>
5087 <p class="description">Set the group tag of an attribute.</p>
5088<p class="code">
98d88c8d
MS
5089int ippSetGroupTag(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, ipp_tag_t group_tag);</p>
5090<h4 class="parameters">Parameters</h4>
5091<table class="list"><tbody>
5092<tr><th>ipp</th>
5093 <td class="description">IPP message</td></tr>
5094<tr><th>attr</th>
5095 <td class="description">Attribute</td></tr>
5096<tr><th>group_tag</th>
5097 <td class="description">Group tag</td></tr>
5098</tbody></table>
798d6e29
MS
5099<h4 class="returnvalue">Return Value</h4>
5100 <p class="description">1 on success, 0 on failure</p>
5101<h4 class="discussion">Discussion</h4>
5102 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5103the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5104<br>
5105The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5106<br>
5107The <code>group</code> parameter specifies the IPP attribute group tag: none
5108(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
5109event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
5110(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
5111(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
5112
5113</p>
5114<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetInteger">ippSetInteger</a></h3>
5115 <p class="description">Set an integer or enum value in an attribute.</p>
5116<p class="code">
98d88c8d
MS
5117int ippSetInteger(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int intvalue);</p>
5118<h4 class="parameters">Parameters</h4>
5119<table class="list"><tbody>
5120<tr><th>ipp</th>
5121 <td class="description">IPP message</td></tr>
5122<tr><th>attr</th>
5123 <td class="description">IPP attribute</td></tr>
5124<tr><th>element</th>
5125 <td class="description">Value number (0-based)</td></tr>
5126<tr><th>intvalue</th>
5127 <td class="description">Integer/enum value</td></tr>
5128</tbody></table>
798d6e29
MS
5129<h4 class="returnvalue">Return Value</h4>
5130 <p class="description">1 on success, 0 on failure</p>
5131<h4 class="discussion">Discussion</h4>
5132 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5133the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5134<br>
5135The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5136<br>
5137The <code>element</code> parameter specifies which value to set from 0 to
5138<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
5139
5140</p>
5141<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetName">ippSetName</a></h3>
5142 <p class="description">Set the name of an attribute.</p>
5143<p class="code">
98d88c8d
MS
5144int ippSetName(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, const char *name);</p>
5145<h4 class="parameters">Parameters</h4>
5146<table class="list"><tbody>
5147<tr><th>ipp</th>
5148 <td class="description">IPP message</td></tr>
5149<tr><th>attr</th>
5150 <td class="description">IPP attribute</td></tr>
5151<tr><th>name</th>
5152 <td class="description">Attribute name</td></tr>
5153</tbody></table>
798d6e29
MS
5154<h4 class="returnvalue">Return Value</h4>
5155 <p class="description">1 on success, 0 on failure</p>
5156<h4 class="discussion">Discussion</h4>
5157 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5158the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5159<br>
5160The <code>attr</code> parameter may be modified as a result of setting the value.
5161
5162</p>
5163<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetOctetString">ippSetOctetString</a></h3>
5164 <p class="description">Set an octetString value in an IPP attribute.</p>
5165<p class="code">
98d88c8d
MS
5166int ippSetOctetString(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const void *data, int datalen);</p>
5167<h4 class="parameters">Parameters</h4>
5168<table class="list"><tbody>
5169<tr><th>ipp</th>
5170 <td class="description">IPP message</td></tr>
5171<tr><th>attr</th>
5172 <td class="description">IPP attribute</td></tr>
5173<tr><th>element</th>
5174 <td class="description">Value number (0-based)</td></tr>
5175<tr><th>data</th>
5176 <td class="description">Pointer to octetString data</td></tr>
5177<tr><th>datalen</th>
5178 <td class="description">Length of octetString data</td></tr>
5179</tbody></table>
798d6e29
MS
5180<h4 class="returnvalue">Return Value</h4>
5181 <p class="description">1 on success, 0 on failure</p>
5182<h4 class="discussion">Discussion</h4>
5183 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5184the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5185<br>
5186The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5187<br>
5188The <code>element</code> parameter specifies which value to set from 0 to
5189<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
5190
5191</p>
5192<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetOperation">ippSetOperation</a></h3>
5193 <p class="description">Set the operation ID in an IPP request message.</p>
5194<p class="code">
98d88c8d 5195int ippSetOperation(<a href="#ipp_t">ipp_t</a> *ipp, ipp_op_t op);</p>
798d6e29 5196<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5197<table class="list"><tbody>
5198<tr><th>ipp</th>
5199 <td class="description">IPP request message</td></tr>
5200<tr><th>op</th>
5201 <td class="description">Operation ID</td></tr>
5202</tbody></table>
798d6e29
MS
5203<h4 class="returnvalue">Return Value</h4>
5204 <p class="description">1 on success, 0 on failure</p>
5205<h4 class="discussion">Discussion</h4>
5206 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5207the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
5208
5209</p>
5210<h3 class="function"><a id="ippSetPort">ippSetPort</a></h3>
98d88c8d 5211 <p class="description">Set the default port number.</p>
798d6e29 5212<p class="code">
98d88c8d 5213void ippSetPort(int p);</p>
798d6e29 5214<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5215<table class="list"><tbody>
5216<tr><th>p</th>
5217 <td class="description">Port number to use</td></tr>
5218</tbody></table>
798d6e29
MS
5219<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetRange">ippSetRange</a></h3>
5220 <p class="description">Set a rangeOfInteger value in an attribute.</p>
5221<p class="code">
98d88c8d
MS
5222int ippSetRange(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int lowervalue, int uppervalue);</p>
5223<h4 class="parameters">Parameters</h4>
5224<table class="list"><tbody>
5225<tr><th>ipp</th>
5226 <td class="description">IPP message</td></tr>
5227<tr><th>attr</th>
5228 <td class="description">IPP attribute</td></tr>
5229<tr><th>element</th>
5230 <td class="description">Value number (0-based)</td></tr>
5231<tr><th>lowervalue</th>
5232 <td class="description">Lower bound for range</td></tr>
5233<tr><th>uppervalue</th>
5234 <td class="description">Upper bound for range</td></tr>
5235</tbody></table>
798d6e29
MS
5236<h4 class="returnvalue">Return Value</h4>
5237 <p class="description">1 on success, 0 on failure</p>
5238<h4 class="discussion">Discussion</h4>
5239 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5240the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5241<br>
5242The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5243<br>
5244The <code>element</code> parameter specifies which value to set from 0 to
5245<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
5246
5247</p>
5248<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetRequestId">ippSetRequestId</a></h3>
5249 <p class="description">Set the request ID in an IPP message.</p>
5250<p class="code">
98d88c8d 5251int ippSetRequestId(<a href="#ipp_t">ipp_t</a> *ipp, int request_id);</p>
798d6e29 5252<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5253<table class="list"><tbody>
5254<tr><th>ipp</th>
5255 <td class="description">IPP message</td></tr>
5256<tr><th>request_id</th>
5257 <td class="description">Request ID</td></tr>
5258</tbody></table>
798d6e29
MS
5259<h4 class="returnvalue">Return Value</h4>
5260 <p class="description">1 on success, 0 on failure</p>
5261<h4 class="discussion">Discussion</h4>
5262 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5263the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5264<br>
5265The <code>request_id</code> parameter must be greater than 0.
5266
5267</p>
5268<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetResolution">ippSetResolution</a></h3>
5269 <p class="description">Set a resolution value in an attribute.</p>
5270<p class="code">
98d88c8d
MS
5271int ippSetResolution(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, <a href="#ipp_res_t">ipp_res_t</a> unitsvalue, int xresvalue, int yresvalue);</p>
5272<h4 class="parameters">Parameters</h4>
5273<table class="list"><tbody>
5274<tr><th>ipp</th>
5275 <td class="description">IPP message</td></tr>
5276<tr><th>attr</th>
5277 <td class="description">IPP attribute</td></tr>
5278<tr><th>element</th>
5279 <td class="description">Value number (0-based)</td></tr>
5280<tr><th>unitsvalue</th>
5281 <td class="description">Resolution units</td></tr>
5282<tr><th>xresvalue</th>
5283 <td class="description">Horizontal/cross feed resolution</td></tr>
5284<tr><th>yresvalue</th>
5285 <td class="description">Vertical/feed resolution</td></tr>
5286</tbody></table>
798d6e29
MS
5287<h4 class="returnvalue">Return Value</h4>
5288 <p class="description">1 on success, 0 on failure</p>
5289<h4 class="discussion">Discussion</h4>
5290 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5291the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5292<br>
5293The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5294<br>
5295The <code>element</code> parameter specifies which value to set from 0 to
5296<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
5297
5298</p>
5299<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetState">ippSetState</a></h3>
5300 <p class="description">Set the current state of the IPP message.</p>
5301<p class="code">
98d88c8d 5302int ippSetState(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_state_t">ipp_state_t</a> state);</p>
798d6e29 5303<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5304<table class="list"><tbody>
5305<tr><th>ipp</th>
5306 <td class="description">IPP message</td></tr>
5307<tr><th>state</th>
5308 <td class="description">IPP state value</td></tr>
5309</tbody></table>
798d6e29
MS
5310<h4 class="returnvalue">Return Value</h4>
5311 <p class="description">1 on success, 0 on failure</p>
5312<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetStatusCode">ippSetStatusCode</a></h3>
5313 <p class="description">Set the status code in an IPP response or event message.</p>
5314<p class="code">
98d88c8d 5315int ippSetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp, ipp_status_t status);</p>
798d6e29 5316<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5317<table class="list"><tbody>
5318<tr><th>ipp</th>
5319 <td class="description">IPP response or event message</td></tr>
5320<tr><th>status</th>
5321 <td class="description">Status code</td></tr>
5322</tbody></table>
798d6e29
MS
5323<h4 class="returnvalue">Return Value</h4>
5324 <p class="description">1 on success, 0 on failure</p>
5325<h4 class="discussion">Discussion</h4>
5326 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5327the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
5328
5329</p>
5330<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetString">ippSetString</a></h3>
5331 <p class="description">Set a string value in an attribute.</p>
5332<p class="code">
98d88c8d
MS
5333int ippSetString(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const char *strvalue);</p>
5334<h4 class="parameters">Parameters</h4>
5335<table class="list"><tbody>
5336<tr><th>ipp</th>
5337 <td class="description">IPP message</td></tr>
5338<tr><th>attr</th>
5339 <td class="description">IPP attribute</td></tr>
5340<tr><th>element</th>
5341 <td class="description">Value number (0-based)</td></tr>
5342<tr><th>strvalue</th>
5343 <td class="description">String value</td></tr>
5344</tbody></table>
798d6e29
MS
5345<h4 class="returnvalue">Return Value</h4>
5346 <p class="description">1 on success, 0 on failure</p>
5347<h4 class="discussion">Discussion</h4>
5348 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5349the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5350<br>
5351The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5352<br>
5353The <code>element</code> parameter specifies which value to set from 0 to
5354<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
5355
5356</p>
5357<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetStringf">ippSetStringf</a></h3>
5358 <p class="description">Set a formatted string value of an attribute.</p>
5359<p class="code">
98d88c8d
MS
5360int ippSetStringf(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const char *format, ...);</p>
5361<h4 class="parameters">Parameters</h4>
5362<table class="list"><tbody>
5363<tr><th>ipp</th>
5364 <td class="description">IPP message</td></tr>
5365<tr><th>attr</th>
5366 <td class="description">IPP attribute</td></tr>
5367<tr><th>element</th>
5368 <td class="description">Value number (0-based)</td></tr>
5369<tr><th>format</th>
5370 <td class="description">Printf-style format string</td></tr>
5371<tr><th>...</th>
5372 <td class="description">Additional arguments as needed</td></tr>
5373</tbody></table>
798d6e29
MS
5374<h4 class="returnvalue">Return Value</h4>
5375 <p class="description">1 on success, 0 on failure</p>
5376<h4 class="discussion">Discussion</h4>
5377 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5378the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5379<br>
5380The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5381<br>
5382The <code>element</code> parameter specifies which value to set from 0 to
5383<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.<br>
5384<br>
5385The <code>format</code> parameter uses formatting characters compatible with the
5386printf family of standard functions. Additional arguments follow it as
5387needed. The formatted string is truncated as needed to the maximum length of
5388the corresponding value type.
5389
5390</p>
5391<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetStringfv">ippSetStringfv</a></h3>
5392 <p class="description">Set a formatted string value of an attribute.</p>
5393<p class="code">
98d88c8d
MS
5394int ippSetStringfv(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const char *format, va_list ap);</p>
5395<h4 class="parameters">Parameters</h4>
5396<table class="list"><tbody>
5397<tr><th>ipp</th>
5398 <td class="description">IPP message</td></tr>
5399<tr><th>attr</th>
5400 <td class="description">IPP attribute</td></tr>
5401<tr><th>element</th>
5402 <td class="description">Value number (0-based)</td></tr>
5403<tr><th>format</th>
5404 <td class="description">Printf-style format string</td></tr>
5405<tr><th>ap</th>
5406 <td class="description">Pointer to additional arguments</td></tr>
5407</tbody></table>
798d6e29
MS
5408<h4 class="returnvalue">Return Value</h4>
5409 <p class="description">1 on success, 0 on failure</p>
5410<h4 class="discussion">Discussion</h4>
5411 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5412the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5413<br>
5414The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5415<br>
5416The <code>element</code> parameter specifies which value to set from 0 to
5417<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.<br>
5418<br>
5419The <code>format</code> parameter uses formatting characters compatible with the
5420printf family of standard functions. Additional arguments follow it as
5421needed. The formatted string is truncated as needed to the maximum length of
5422the corresponding value type.
5423
5424</p>
5425<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetValueTag">ippSetValueTag</a></h3>
5426 <p class="description">Set the value tag of an attribute.</p>
5427<p class="code">
98d88c8d
MS
5428int ippSetValueTag(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, ipp_tag_t value_tag);</p>
5429<h4 class="parameters">Parameters</h4>
5430<table class="list"><tbody>
5431<tr><th>ipp</th>
5432 <td class="description">IPP message</td></tr>
5433<tr><th>attr</th>
5434 <td class="description">IPP attribute</td></tr>
5435<tr><th>value_tag</th>
5436 <td class="description">Value tag</td></tr>
5437</tbody></table>
798d6e29
MS
5438<h4 class="returnvalue">Return Value</h4>
5439 <p class="description">1 on success, 0 on failure</p>
5440<h4 class="discussion">Discussion</h4>
5441 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5442the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5443<br>
5444The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5445<br>
5446Integer (<code>IPP_TAG_INTEGER</code>) values can be promoted to rangeOfInteger
5447(<code>IPP_TAG_RANGE</code>) values, the various string tags can be promoted to name
5448(<code>IPP_TAG_NAME</code>) or nameWithLanguage (<code>IPP_TAG_NAMELANG</code>) values, text
5449(<code>IPP_TAG_TEXT</code>) values can be promoted to textWithLanguage
5450(<code>IPP_TAG_TEXTLANG</code>) values, and all values can be demoted to the various
5451out-of-band value tags such as no-value (<code>IPP_TAG_NOVALUE</code>). All other changes
5452will be rejected.<br>
5453<br>
5454Promoting a string attribute to nameWithLanguage or textWithLanguage adds the language
5455code in the &quot;attributes-natural-language&quot; attribute or, if not present, the language
5456code for the current locale.
5457
5458</p>
5459<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetVersion">ippSetVersion</a></h3>
5460 <p class="description">Set the version number in an IPP message.</p>
5461<p class="code">
98d88c8d
MS
5462int ippSetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int major, int minor);</p>
5463<h4 class="parameters">Parameters</h4>
5464<table class="list"><tbody>
5465<tr><th>ipp</th>
5466 <td class="description">IPP message</td></tr>
5467<tr><th>major</th>
5468 <td class="description">Major version number (major.minor)</td></tr>
5469<tr><th>minor</th>
5470 <td class="description">Minor version number (major.minor)</td></tr>
5471</tbody></table>
798d6e29
MS
5472<h4 class="returnvalue">Return Value</h4>
5473 <p class="description">1 on success, 0 on failure</p>
5474<h4 class="discussion">Discussion</h4>
5475 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5476the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5477<br>
5478The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2.
5479
5480</p>
5481<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="ippStateString">ippStateString</a></h3>
5482 <p class="description">Return the name corresponding to a state value.</p>
5483<p class="code">
98d88c8d 5484const char *ippStateString(<a href="#ipp_state_t">ipp_state_t</a> state);</p>
798d6e29 5485<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5486<table class="list"><tbody>
5487<tr><th>state</th>
5488 <td class="description">State value</td></tr>
5489</tbody></table>
798d6e29
MS
5490<h4 class="returnvalue">Return Value</h4>
5491 <p class="description">State name</p>
5492<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="ippTagString">ippTagString</a></h3>
5493 <p class="description">Return the tag name corresponding to a tag value.</p>
5494<p class="code">
98d88c8d 5495const char *ippTagString(ipp_tag_t tag);</p>
798d6e29 5496<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5497<table class="list"><tbody>
5498<tr><th>tag</th>
5499 <td class="description">Tag value</td></tr>
5500</tbody></table>
798d6e29
MS
5501<h4 class="returnvalue">Return Value</h4>
5502 <p class="description">Tag name</p>
5503<h4 class="discussion">Discussion</h4>
5504 <p class="discussion">The returned names are defined in RFC 2911 and 3382.
5505
5506</p>
5507<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="ippTagValue">ippTagValue</a></h3>
5508 <p class="description">Return the tag value corresponding to a tag name.</p>
5509<p class="code">
98d88c8d 5510ipp_tag_t ippTagValue(const char *name);</p>
798d6e29 5511<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5512<table class="list"><tbody>
5513<tr><th>name</th>
5514 <td class="description">Tag name</td></tr>
5515</tbody></table>
798d6e29
MS
5516<h4 class="returnvalue">Return Value</h4>
5517 <p class="description">Tag value</p>
5518<h4 class="discussion">Discussion</h4>
5519 <p class="discussion">The tag names are defined in RFC 2911 and 3382.
5520
5521</p>
5522<h3 class="function"><a id="ippTimeToDate">ippTimeToDate</a></h3>
5523 <p class="description">Convert from UNIX time to RFC 1903 format.</p>
5524<p class="code">
98d88c8d 5525const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippTimeToDate(time_t t);</p>
798d6e29 5526<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5527<table class="list"><tbody>
5528<tr><th>t</th>
5529 <td class="description">UNIX time value</td></tr>
5530</tbody></table>
798d6e29
MS
5531<h4 class="returnvalue">Return Value</h4>
5532 <p class="description">RFC-1903 date/time data</p>
5533<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippValidateAttribute">ippValidateAttribute</a></h3>
5534 <p class="description">Validate the contents of an attribute.</p>
5535<p class="code">
98d88c8d 5536int ippValidateAttribute(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 5537<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5538<table class="list"><tbody>
5539<tr><th>attr</th>
5540 <td class="description">Attribute</td></tr>
5541</tbody></table>
798d6e29
MS
5542<h4 class="returnvalue">Return Value</h4>
5543 <p class="description">1 if valid, 0 otherwise</p>
5544<h4 class="discussion">Discussion</h4>
5545 <p class="discussion">This function validates the contents of an attribute based on the name and
5546value tag. 1 is returned if the attribute is valid, 0 otherwise. On
5547failure, cupsLastErrorString() is set to a human-readable message.
5548
5549</p>
5550<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippValidateAttributes">ippValidateAttributes</a></h3>
5551 <p class="description">Validate all attributes in an IPP message.</p>
5552<p class="code">
98d88c8d 5553int ippValidateAttributes(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5554<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5555<table class="list"><tbody>
5556<tr><th>ipp</th>
5557 <td class="description">IPP message</td></tr>
5558</tbody></table>
798d6e29
MS
5559<h4 class="returnvalue">Return Value</h4>
5560 <p class="description">1 if valid, 0 otherwise</p>
5561<h4 class="discussion">Discussion</h4>
5562 <p class="discussion">This function validates the contents of the IPP message, including each
5563attribute. Like <a href="#ippValidateAttribute"><code>ippValidateAttribute</code></a>, cupsLastErrorString() is set
5564to a human-readable message on failure.
5565
5566</p>
5567<h3 class="function"><a id="ippWrite">ippWrite</a></h3>
5568 <p class="description">Write data for an IPP message to a HTTP connection.</p>
5569<p class="code">
98d88c8d 5570<a href="#ipp_state_t">ipp_state_t</a> ippWrite(<a href="#http_t">http_t</a> *http, <a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5571<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5572<table class="list"><tbody>
5573<tr><th>http</th>
5574 <td class="description">HTTP connection</td></tr>
5575<tr><th>ipp</th>
5576 <td class="description">IPP data</td></tr>
5577</tbody></table>
798d6e29
MS
5578<h4 class="returnvalue">Return Value</h4>
5579 <p class="description">Current state</p>
5580<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippWriteFile">ippWriteFile</a></h3>
5581 <p class="description">Write data for an IPP message to a file.</p>
5582<p class="code">
98d88c8d 5583<a href="#ipp_state_t">ipp_state_t</a> ippWriteFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5584<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5585<table class="list"><tbody>
5586<tr><th>fd</th>
5587 <td class="description">HTTP data</td></tr>
5588<tr><th>ipp</th>
5589 <td class="description">IPP data</td></tr>
5590</tbody></table>
798d6e29
MS
5591<h4 class="returnvalue">Return Value</h4>
5592 <p class="description">Current state</p>
5593<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippWriteIO">ippWriteIO</a></h3>
5594 <p class="description">Write data for an IPP message.</p>
5595<p class="code">
98d88c8d
MS
5596<a href="#ipp_state_t">ipp_state_t</a> ippWriteIO(void *dst, <a href="#ipp_iocb_t">ipp_iocb_t</a> cb, int blocking, <a href="#ipp_t">ipp_t</a> *parent, <a href="#ipp_t">ipp_t</a> *ipp);</p>
5597<h4 class="parameters">Parameters</h4>
5598<table class="list"><tbody>
5599<tr><th>dst</th>
5600 <td class="description">Destination</td></tr>
5601<tr><th>cb</th>
5602 <td class="description">Write callback function</td></tr>
5603<tr><th>blocking</th>
5604 <td class="description">Use blocking IO?</td></tr>
5605<tr><th>parent</th>
5606 <td class="description">Parent IPP message</td></tr>
5607<tr><th>ipp</th>
5608 <td class="description">IPP data</td></tr>
5609</tbody></table>
798d6e29
MS
5610<h4 class="returnvalue">Return Value</h4>
5611 <p class="description">Current state</p>
798d6e29 5612 <h2 class="title"><a id="TYPES">Data Types</a></h2>
798d6e29
MS
5613 <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>
5614 <p class="description">Client credentials callback
5615</p>
5616 <p class="code">
53af7f21 5617typedef int(*)(http_t *http, void *tls, cups_array_t *distinguished_names, void *user_data)cups_client_cert_cb_t;
798d6e29
MS
5618</p>
5619 <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>
5620 <p class="description">Destination enumeration callback
5621</p>
5622 <p class="code">
5623typedef int(*)(void *user_data, unsigned flags, <a href="#cups_dest_t">cups_dest_t</a> *dest)cups_dest_cb_t;
5624</p>
5625 <h3 class="typedef"><a id="cups_dest_t">cups_dest_t</a></h3>
5626 <p class="description">Destination</p>
5627 <p class="code">
5628typedef struct <a href="#cups_dest_s">cups_dest_s</a> cups_dest_t;
5629</p>
5630 <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>
5631 <p class="description">Destination capability and status
5632information </p>
5633 <p class="code">
5634typedef struct _cups_dinfo_s cups_dinfo_t;
798d6e29
MS
5635</p>
5636 <h3 class="typedef"><a id="cups_job_t">cups_job_t</a></h3>
5637 <p class="description">Job</p>
5638 <p class="code">
5639typedef struct <a href="#cups_job_s">cups_job_s</a> cups_job_t;
798d6e29
MS
5640</p>
5641 <h3 class="typedef"><a id="cups_option_t">cups_option_t</a></h3>
5642 <p class="description">Printer Options</p>
5643 <p class="code">
5644typedef struct <a href="#cups_option_s">cups_option_s</a> cups_option_t;
5645</p>
5646 <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>
5647 <p class="description">New password callback
5648</p>
5649 <p class="code">
5650typedef 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;
798d6e29
MS
5651</p>
5652 <h3 class="typedef"><a id="cups_ptype_t">cups_ptype_t</a></h3>
5653 <p class="description">Printer type/capability bits</p>
5654 <p class="code">
5655typedef unsigned cups_ptype_t;
5656</p>
5657 <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>
5658 <p class="description">Server credentials callback
5659</p>
5660 <p class="code">
53af7f21 5661typedef int(*)(http_t *http, void *tls, cups_array_t *certs, void *user_data)cups_server_cert_cb_t;
798d6e29
MS
5662</p>
5663 <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>
5664 <p class="description">Media Size </p>
5665 <p class="code">
5666typedef struct <a href="#cups_size_s">cups_size_s</a> cups_size_t;
798d6e29
MS
5667</p>
5668 <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>
5669 <p class="description">Socket address union, which
5670makes using IPv6 and other
5671address types easier and
5672more portable. </p>
5673 <p class="code">
5674typedef union _http_addr_u / http_addr_t;
798d6e29
MS
5675</p>
5676 <h3 class="typedef"><a id="http_encoding_t">http_encoding_t</a></h3>
5677 <p class="description">HTTP transfer encoding values</p>
5678 <p class="code">
5679typedef enum <a href="#http_encoding_e">http_encoding_e</a> http_encoding_t;
5680</p>
5681 <h3 class="typedef"><a id="http_encryption_t">http_encryption_t</a></h3>
5682 <p class="description">HTTP encryption values</p>
5683 <p class="code">
5684typedef enum <a href="#http_encryption_e">http_encryption_e</a> http_encryption_t;
5685</p>
5686 <h3 class="typedef"><a id="http_field_t">http_field_t</a></h3>
5687 <p class="description">HTTP field names</p>
5688 <p class="code">
5689typedef enum <a href="#http_field_e">http_field_e</a> http_field_t;
5690</p>
5691 <h3 class="typedef"><a id="http_keepalive_t">http_keepalive_t</a></h3>
5692 <p class="description">HTTP keep-alive values</p>
5693 <p class="code">
5694typedef enum <a href="#http_keepalive_e">http_keepalive_e</a> http_keepalive_t;
5695</p>
5696 <h3 class="typedef"><a id="http_state_t">http_state_t</a></h3>
5697 <p class="description">HTTP state values; states
5698are server-oriented...</p>
5699 <p class="code">
5700typedef enum <a href="#http_state_e">http_state_e</a> http_state_t;
5701</p>
5702 <h3 class="typedef"><a id="http_t">http_t</a></h3>
5703 <p class="description">HTTP connection type</p>
5704 <p class="code">
5705typedef struct _http_s http_t;
5706</p>
5707 <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>
5708 <p class="description">HTTP timeout callback </p>
5709 <p class="code">
5710typedef int(*)(http_t *http, void *user_data)http_timeout_cb_t;
5711</p>
5712 <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>
5713 <p class="description">Level of trust for credentials </p>
5714 <p class="code">
5715typedef enum <a href="#http_trust_e">http_trust_e</a> http_trust_t;
5716</p>
5717 <h3 class="typedef"><a id="http_uri_coding_t">http_uri_coding_t</a></h3>
5718 <p class="description">URI en/decode flags</p>
5719 <p class="code">
5720typedef enum <a href="#http_uri_coding_e">http_uri_coding_e</a> http_uri_coding_t;
5721</p>
5722 <h3 class="typedef"><a id="http_uri_status_t"><span class="info">&#160;CUPS 1.2&#160;</span>http_uri_status_t</a></h3>
5723 <p class="description">URI separation status </p>
5724 <p class="code">
5725typedef enum <a href="#http_uri_status_e">http_uri_status_e</a> http_uri_status_t;
798d6e29
MS
5726</p>
5727 <h3 class="typedef"><a id="ipp_attribute_t">ipp_attribute_t</a></h3>
5728 <p class="description">IPP attribute</p>
5729 <p class="code">
5730typedef struct _ipp_attribute_s ipp_attribute_t;
5731</p>
5732 <h3 class="typedef"><a id="ipp_copycb_t">ipp_copycb_t</a></h3>
5733 <p class="description">The following structures are PRIVATE starting with CUPS 1.6/macOS 10.8.
5734Please use the new accessor functions available in CUPS 1.6 and later, as
5735these definitions will be moved to a private header file in a future release.</p>
5736 <p class="code">
5737typedef int(*)(void *context, <a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr)ipp_copycb_t;
798d6e29
MS
5738</p>
5739 <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>
5740 <p class="description">IPP IO Callback Function </p>
5741 <p class="code">
98d88c8d 5742typedef ssize_t(*)(void *context, ipp_uchar_t *buffer, size_t bytes) ipp_iocb_t;
798d6e29
MS
5743</p>
5744 <h3 class="typedef"><a id="ipp_orient_t">ipp_orient_t</a></h3>
5745 <p class="description">Orientation values</p>
5746 <p class="code">
5747typedef enum <a href="#ipp_orient_e">ipp_orient_e</a> ipp_orient_t;
5748</p>
5749 <h3 class="typedef"><a id="ipp_pstate_t">ipp_pstate_t</a></h3>
5750 <p class="description">Printer states</p>
5751 <p class="code">
5752typedef enum <a href="#ipp_pstate_e">ipp_pstate_e</a> ipp_pstate_t;
5753</p>
5754 <h3 class="typedef"><a id="ipp_quality_t">ipp_quality_t</a></h3>
5755 <p class="description">Qualities</p>
5756 <p class="code">
5757typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t;
5758</p>
5759 <h3 class="typedef"><a id="ipp_res_t">ipp_res_t</a></h3>
5760 <p class="description">Resolution units</p>
5761 <p class="code">
5762typedef enum <a href="#ipp_res_e">ipp_res_e</a> ipp_res_t;
5763</p>
5764 <h3 class="typedef"><a id="ipp_state_t">ipp_state_t</a></h3>
5765 <p class="description">IPP states</p>
5766 <p class="code">
5767typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t;
5768</p>
5769 <h3 class="typedef"><a id="ipp_t">ipp_t</a></h3>
5770 <p class="description">IPP request/response data</p>
5771 <p class="code">
5772typedef struct _ipp_s ipp_t;
798d6e29
MS
5773</p>
5774 <h2 class="title"><a id="STRUCTURES">Structures</a></h2>
798d6e29
MS
5775<h3 class="struct"><a id="cups_dest_s">cups_dest_s</a></h3>
5776 <p class="description">Destination</p>
5777<p class="code">struct cups_dest_s {<br>
5778&#160;&#160;&#160;&#160;char *name, *instance;<br>
5779&#160;&#160;&#160;&#160;int is_default;<br>
5780&#160;&#160;&#160;&#160;int num_options;<br>
5781&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options;<br>
5782};</p>
5783<h4 class="members">Members</h4>
98d88c8d
MS
5784<table class="list"><tbody>
5785<tr><th>instance </th>
5786 <td class="description">Local instance name or NULL</td></tr>
5787<tr><th>is_default </th>
5788 <td class="description">Is this printer the default?</td></tr>
5789<tr><th>num_options </th>
5790 <td class="description">Number of options</td></tr>
5791<tr><th>options </th>
5792 <td class="description">Options</td></tr>
5793</tbody></table>
798d6e29
MS
5794<h3 class="struct"><a id="cups_job_s">cups_job_s</a></h3>
5795 <p class="description">Job</p>
5796<p class="code">struct cups_job_s {<br>
5797&#160;&#160;&#160;&#160;time_t completed_time;<br>
5798&#160;&#160;&#160;&#160;time_t creation_time;<br>
5799&#160;&#160;&#160;&#160;char *dest;<br>
5800&#160;&#160;&#160;&#160;char *format;<br>
5801&#160;&#160;&#160;&#160;int id;<br>
5802&#160;&#160;&#160;&#160;int priority;<br>
5803&#160;&#160;&#160;&#160;time_t processing_time;<br>
5804&#160;&#160;&#160;&#160;int size;<br>
5805&#160;&#160;&#160;&#160;ipp_jstate_t state;<br>
5806&#160;&#160;&#160;&#160;char *title;<br>
5807&#160;&#160;&#160;&#160;char *user;<br>
5808};</p>
5809<h4 class="members">Members</h4>
98d88c8d
MS
5810<table class="list"><tbody>
5811<tr><th>completed_time </th>
5812 <td class="description">Time the job was completed</td></tr>
5813<tr><th>creation_time </th>
5814 <td class="description">Time the job was created</td></tr>
5815<tr><th>dest </th>
5816 <td class="description">Printer or class name</td></tr>
5817<tr><th>format </th>
5818 <td class="description">Document format</td></tr>
5819<tr><th>id </th>
5820 <td class="description">The job ID</td></tr>
5821<tr><th>priority </th>
5822 <td class="description">Priority (1-100)</td></tr>
5823<tr><th>processing_time </th>
5824 <td class="description">Time the job was processed</td></tr>
5825<tr><th>size </th>
5826 <td class="description">Size in kilobytes</td></tr>
5827<tr><th>state </th>
5828 <td class="description">Job state</td></tr>
5829<tr><th>title </th>
5830 <td class="description">Title/job name</td></tr>
5831<tr><th>user </th>
5832 <td class="description">User that submitted the job</td></tr>
5833</tbody></table>
798d6e29
MS
5834<h3 class="struct"><a id="cups_option_s">cups_option_s</a></h3>
5835 <p class="description">Printer Options</p>
5836<p class="code">struct cups_option_s {<br>
5837&#160;&#160;&#160;&#160;char *name;<br>
5838&#160;&#160;&#160;&#160;char *value;<br>
5839};</p>
5840<h4 class="members">Members</h4>
98d88c8d
MS
5841<table class="list"><tbody>
5842<tr><th>name </th>
5843 <td class="description">Name of option</td></tr>
5844<tr><th>value </th>
5845 <td class="description">Value of option</td></tr>
5846</tbody></table>
798d6e29
MS
5847<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>
5848 <p class="description">Media Size </p>
5849<p class="code">struct cups_size_s {<br>
5850&#160;&#160;&#160;&#160;char media[128];<br>
5851&#160;&#160;&#160;&#160;int width, length, bottom, left, right, top;<br>
5852};</p>
5853<h4 class="members">Members</h4>
98d88c8d
MS
5854<table class="list"><tbody>
5855<tr><th>media[128] </th>
5856 <td class="description">Media name to use</td></tr>
5857<tr><th>top </th>
5858 <td class="description">Top margin in hundredths of
5859millimeters</td></tr>
5860</tbody></table>
798d6e29 5861 <h2 class="title"><a id="ENUMERATIONS">Constants</a></h2>
798d6e29
MS
5862 <h3 class="enumeration"><a id="cups_ptype_e">cups_ptype_e</a></h3>
5863 <p class="description">Printer type/capability bit
5864constants</p>
5865 <h4 class="constants">Constants</h4>
98d88c8d
MS
5866 <table class="list"><tbody>
5867 <tr><th>CUPS_PRINTER_AUTHENTICATED <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Printer requires authentication
5868</td></tr>
5869 <tr><th>CUPS_PRINTER_BIND </th> <td class="description">Can bind output</td></tr>
5870 <tr><th>CUPS_PRINTER_BW </th> <td class="description">Can do B&amp;W printing</td></tr>
5871 <tr><th>CUPS_PRINTER_CLASS </th> <td class="description">Printer class</td></tr>
5872 <tr><th>CUPS_PRINTER_COLLATE </th> <td class="description">Can quickly collate copies</td></tr>
5873 <tr><th>CUPS_PRINTER_COLOR </th> <td class="description">Can do color printing</td></tr>
5874 <tr><th>CUPS_PRINTER_COMMANDS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Printer supports maintenance commands
5875</td></tr>
5876 <tr><th>CUPS_PRINTER_COPIES </th> <td class="description">Can do copies in hardware</td></tr>
5877 <tr><th>CUPS_PRINTER_COVER </th> <td class="description">Can cover output</td></tr>
5878 <tr><th>CUPS_PRINTER_DEFAULT </th> <td class="description">Default printer on network</td></tr>
5879 <tr><th>CUPS_PRINTER_DISCOVERED <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Printer was discovered </td></tr>
5880 <tr><th>CUPS_PRINTER_DUPLEX </th> <td class="description">Can do two-sided printing</td></tr>
5881 <tr><th>CUPS_PRINTER_FAX </th> <td class="description">Fax queue</td></tr>
5882 <tr><th>CUPS_PRINTER_LARGE </th> <td class="description">Can print on D/E/A1/A0-size media</td></tr>
5883 <tr><th>CUPS_PRINTER_LOCAL </th> <td class="description">Local printer or class</td></tr>
5884 <tr><th>CUPS_PRINTER_MEDIUM </th> <td class="description">Can print on Tabloid/B/C/A3/A2-size media</td></tr>
5885 <tr><th>CUPS_PRINTER_NOT_SHARED <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Printer is not shared
5886</td></tr>
5887 <tr><th>CUPS_PRINTER_PUNCH </th> <td class="description">Can punch output</td></tr>
5888 <tr><th>CUPS_PRINTER_REJECTING </th> <td class="description">Printer is rejecting jobs</td></tr>
5889 <tr><th>CUPS_PRINTER_REMOTE </th> <td class="description">Remote printer or class</td></tr>
5890 <tr><th>CUPS_PRINTER_SMALL </th> <td class="description">Can print on Letter/Legal/A4-size media</td></tr>
5891 <tr><th>CUPS_PRINTER_SORT </th> <td class="description">Can sort output</td></tr>
5892 <tr><th>CUPS_PRINTER_STAPLE </th> <td class="description">Can staple output</td></tr>
5893 <tr><th>CUPS_PRINTER_VARIABLE </th> <td class="description">Can print on rolls and custom-size media</td></tr>
5894</tbody></table>
798d6e29
MS
5895 <h3 class="enumeration"><a id="http_encoding_e">http_encoding_e</a></h3>
5896 <p class="description">HTTP transfer encoding values</p>
5897 <h4 class="constants">Constants</h4>
98d88c8d
MS
5898 <table class="list"><tbody>
5899 <tr><th>HTTP_ENCODING_CHUNKED </th> <td class="description">Data is chunked</td></tr>
5900 <tr><th>HTTP_ENCODING_FIELDS </th> <td class="description">Sending HTTP fields</td></tr>
5901 <tr><th>HTTP_ENCODING_LENGTH </th> <td class="description">Data is sent with Content-Length</td></tr>
5902</tbody></table>
798d6e29
MS
5903 <h3 class="enumeration"><a id="http_encryption_e">http_encryption_e</a></h3>
5904 <p class="description">HTTP encryption values</p>
5905 <h4 class="constants">Constants</h4>
98d88c8d
MS
5906 <table class="list"><tbody>
5907 <tr><th>HTTP_ENCRYPTION_ALWAYS </th> <td class="description">Always encrypt (SSL)</td></tr>
5908 <tr><th>HTTP_ENCRYPTION_IF_REQUESTED </th> <td class="description">Encrypt if requested (TLS upgrade)</td></tr>
5909 <tr><th>HTTP_ENCRYPTION_NEVER </th> <td class="description">Never encrypt</td></tr>
5910 <tr><th>HTTP_ENCRYPTION_REQUIRED </th> <td class="description">Encryption is required (TLS upgrade)</td></tr>
5911</tbody></table>
798d6e29
MS
5912 <h3 class="enumeration"><a id="http_field_e">http_field_e</a></h3>
5913 <p class="description">HTTP field names</p>
5914 <h4 class="constants">Constants</h4>
98d88c8d
MS
5915 <table class="list"><tbody>
5916 <tr><th>HTTP_FIELD_ACCEPT_ENCODING <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></th> <td class="description">Accepting-Encoding field </td></tr>
5917 <tr><th>HTTP_FIELD_ACCEPT_LANGUAGE </th> <td class="description">Accept-Language field</td></tr>
5918 <tr><th>HTTP_FIELD_ACCEPT_RANGES </th> <td class="description">Accept-Ranges field</td></tr>
5919 <tr><th>HTTP_FIELD_ALLOW <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></th> <td class="description">Allow field </td></tr>
5920 <tr><th>HTTP_FIELD_AUTHORIZATION </th> <td class="description">Authorization field</td></tr>
5921 <tr><th>HTTP_FIELD_CONNECTION </th> <td class="description">Connection field</td></tr>
5922 <tr><th>HTTP_FIELD_CONTENT_ENCODING </th> <td class="description">Content-Encoding field</td></tr>
5923 <tr><th>HTTP_FIELD_CONTENT_LANGUAGE </th> <td class="description">Content-Language field</td></tr>
5924 <tr><th>HTTP_FIELD_CONTENT_LENGTH </th> <td class="description">Content-Length field</td></tr>
5925 <tr><th>HTTP_FIELD_CONTENT_LOCATION </th> <td class="description">Content-Location field</td></tr>
5926 <tr><th>HTTP_FIELD_CONTENT_MD5 </th> <td class="description">Content-MD5 field</td></tr>
5927 <tr><th>HTTP_FIELD_CONTENT_RANGE </th> <td class="description">Content-Range field</td></tr>
5928 <tr><th>HTTP_FIELD_CONTENT_TYPE </th> <td class="description">Content-Type field</td></tr>
5929 <tr><th>HTTP_FIELD_CONTENT_VERSION </th> <td class="description">Content-Version field</td></tr>
5930 <tr><th>HTTP_FIELD_DATE </th> <td class="description">Date field</td></tr>
5931 <tr><th>HTTP_FIELD_HOST </th> <td class="description">Host field</td></tr>
5932 <tr><th>HTTP_FIELD_IF_MODIFIED_SINCE </th> <td class="description">If-Modified-Since field</td></tr>
5933 <tr><th>HTTP_FIELD_IF_UNMODIFIED_SINCE </th> <td class="description">If-Unmodified-Since field</td></tr>
5934 <tr><th>HTTP_FIELD_KEEP_ALIVE </th> <td class="description">Keep-Alive field</td></tr>
5935 <tr><th>HTTP_FIELD_LAST_MODIFIED </th> <td class="description">Last-Modified field</td></tr>
5936 <tr><th>HTTP_FIELD_LINK </th> <td class="description">Link field</td></tr>
5937 <tr><th>HTTP_FIELD_LOCATION </th> <td class="description">Location field</td></tr>
5938 <tr><th>HTTP_FIELD_MAX </th> <td class="description">Maximum field index</td></tr>
5939 <tr><th>HTTP_FIELD_RANGE </th> <td class="description">Range field</td></tr>
5940 <tr><th>HTTP_FIELD_REFERER </th> <td class="description">Referer field</td></tr>
5941 <tr><th>HTTP_FIELD_RETRY_AFTER </th> <td class="description">Retry-After field</td></tr>
5942 <tr><th>HTTP_FIELD_SERVER <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></th> <td class="description">Server field </td></tr>
5943 <tr><th>HTTP_FIELD_TRANSFER_ENCODING </th> <td class="description">Transfer-Encoding field</td></tr>
5944 <tr><th>HTTP_FIELD_UNKNOWN </th> <td class="description">Unknown field</td></tr>
5945 <tr><th>HTTP_FIELD_UPGRADE </th> <td class="description">Upgrade field</td></tr>
5946 <tr><th>HTTP_FIELD_USER_AGENT </th> <td class="description">User-Agent field</td></tr>
5947 <tr><th>HTTP_FIELD_WWW_AUTHENTICATE </th> <td class="description">WWW-Authenticate field</td></tr>
5948</tbody></table>
798d6e29
MS
5949 <h3 class="enumeration"><a id="http_keepalive_e">http_keepalive_e</a></h3>
5950 <p class="description">HTTP keep-alive values</p>
5951 <h4 class="constants">Constants</h4>
98d88c8d
MS
5952 <table class="list"><tbody>
5953 <tr><th>HTTP_KEEPALIVE_OFF </th> <td class="description">No keep alive support</td></tr>
5954 <tr><th>HTTP_KEEPALIVE_ON </th> <td class="description">Use keep alive</td></tr>
5955</tbody></table>
798d6e29
MS
5956 <h3 class="enumeration"><a id="http_state_e">http_state_e</a></h3>
5957 <p class="description">HTTP state values; states
5958are server-oriented...</p>
5959 <h4 class="constants">Constants</h4>
98d88c8d
MS
5960 <table class="list"><tbody>
5961 <tr><th>HTTP_STATE_CONNECT </th> <td class="description">CONNECT command, waiting for blank line</td></tr>
5962 <tr><th>HTTP_STATE_DELETE </th> <td class="description">DELETE command, waiting for blank line</td></tr>
5963 <tr><th>HTTP_STATE_ERROR </th> <td class="description">Error on socket</td></tr>
5964 <tr><th>HTTP_STATE_GET </th> <td class="description">GET command, waiting for blank line</td></tr>
5965 <tr><th>HTTP_STATE_GET_SEND </th> <td class="description">GET command, sending data</td></tr>
5966 <tr><th>HTTP_STATE_HEAD </th> <td class="description">HEAD command, waiting for blank line</td></tr>
5967 <tr><th>HTTP_STATE_OPTIONS </th> <td class="description">OPTIONS command, waiting for blank line</td></tr>
5968 <tr><th>HTTP_STATE_POST </th> <td class="description">POST command, waiting for blank line</td></tr>
5969 <tr><th>HTTP_STATE_POST_RECV </th> <td class="description">POST command, receiving data</td></tr>
5970 <tr><th>HTTP_STATE_POST_SEND </th> <td class="description">POST command, sending data</td></tr>
5971 <tr><th>HTTP_STATE_PUT </th> <td class="description">PUT command, waiting for blank line</td></tr>
5972 <tr><th>HTTP_STATE_PUT_RECV </th> <td class="description">PUT command, receiving data</td></tr>
5973 <tr><th>HTTP_STATE_STATUS </th> <td class="description">Command complete, sending status</td></tr>
5974 <tr><th>HTTP_STATE_TRACE </th> <td class="description">TRACE command, waiting for blank line</td></tr>
5975 <tr><th>HTTP_STATE_UNKNOWN_METHOD <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></th> <td class="description">Unknown request method, waiting for blank line </td></tr>
5976 <tr><th>HTTP_STATE_UNKNOWN_VERSION <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></th> <td class="description">Unknown request method, waiting for blank line </td></tr>
5977 <tr><th>HTTP_STATE_WAITING </th> <td class="description">Waiting for command</td></tr>
5978</tbody></table>
798d6e29
MS
5979 <h3 class="enumeration"><a id="http_status_e">http_status_e</a></h3>
5980 <p class="description">HTTP status codes</p>
5981 <h4 class="constants">Constants</h4>
98d88c8d
MS
5982 <table class="list"><tbody>
5983 <tr><th>HTTP_STATUS_ACCEPTED </th> <td class="description">DELETE command was successful</td></tr>
5984 <tr><th>HTTP_STATUS_BAD_GATEWAY </th> <td class="description">Bad gateway</td></tr>
5985 <tr><th>HTTP_STATUS_BAD_REQUEST </th> <td class="description">Bad request</td></tr>
5986 <tr><th>HTTP_STATUS_CONFLICT </th> <td class="description">Request is self-conflicting</td></tr>
5987 <tr><th>HTTP_STATUS_CONTINUE </th> <td class="description">Everything OK, keep going...</td></tr>
5988 <tr><th>HTTP_STATUS_CREATED </th> <td class="description">PUT command was successful</td></tr>
5989 <tr><th>HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED <span class="info">&#160;CUPS 1.4&#160;</span></th> <td class="description">User canceled authorization </td></tr>
5990 <tr><th>HTTP_STATUS_CUPS_PKI_ERROR <span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span></th> <td class="description">Error negotiating a secure connection </td></tr>
5991 <tr><th>HTTP_STATUS_ERROR </th> <td class="description">An error response from httpXxxx()</td></tr>
5992 <tr><th>HTTP_STATUS_EXPECTATION_FAILED </th> <td class="description">The expectation given in an Expect header field was not met</td></tr>
5993 <tr><th>HTTP_STATUS_FORBIDDEN </th> <td class="description">Forbidden to access this URI</td></tr>
5994 <tr><th>HTTP_STATUS_GATEWAY_TIMEOUT </th> <td class="description">Gateway connection timed out</td></tr>
5995 <tr><th>HTTP_STATUS_GONE </th> <td class="description">Server has gone away</td></tr>
5996 <tr><th>HTTP_STATUS_LENGTH_REQUIRED </th> <td class="description">A content length or encoding is required</td></tr>
5997 <tr><th>HTTP_STATUS_METHOD_NOT_ALLOWED </th> <td class="description">Method is not allowed</td></tr>
5998 <tr><th>HTTP_STATUS_MOVED_PERMANENTLY </th> <td class="description">Document has moved permanently</td></tr>
5999 <tr><th>HTTP_STATUS_MOVED_TEMPORARILY </th> <td class="description">Document has moved temporarily</td></tr>
6000 <tr><th>HTTP_STATUS_MULTIPLE_CHOICES </th> <td class="description">Multiple files match request</td></tr>
6001 <tr><th>HTTP_STATUS_NONE <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></th> <td class="description">No Expect value </td></tr>
6002 <tr><th>HTTP_STATUS_NOT_ACCEPTABLE </th> <td class="description">Not Acceptable</td></tr>
6003 <tr><th>HTTP_STATUS_NOT_AUTHORITATIVE </th> <td class="description">Information isn't authoritative</td></tr>
6004 <tr><th>HTTP_STATUS_NOT_FOUND </th> <td class="description">URI was not found</td></tr>
6005 <tr><th>HTTP_STATUS_NOT_IMPLEMENTED </th> <td class="description">Feature not implemented</td></tr>
6006 <tr><th>HTTP_STATUS_NOT_MODIFIED </th> <td class="description">File not modified</td></tr>
6007 <tr><th>HTTP_STATUS_NOT_SUPPORTED </th> <td class="description">HTTP version not supported</td></tr>
6008 <tr><th>HTTP_STATUS_NO_CONTENT </th> <td class="description">Successful command, no new data</td></tr>
6009 <tr><th>HTTP_STATUS_OK </th> <td class="description">OPTIONS/GET/HEAD/POST/TRACE command was successful</td></tr>
6010 <tr><th>HTTP_STATUS_PARTIAL_CONTENT </th> <td class="description">Only a partial file was received/sent</td></tr>
6011 <tr><th>HTTP_STATUS_PAYMENT_REQUIRED </th> <td class="description">Payment required</td></tr>
6012 <tr><th>HTTP_STATUS_PRECONDITION </th> <td class="description">Precondition failed</td></tr>
6013 <tr><th>HTTP_STATUS_PROXY_AUTHENTICATION </th> <td class="description">Proxy Authentication is Required</td></tr>
6014 <tr><th>HTTP_STATUS_REQUESTED_RANGE </th> <td class="description">The requested range is not satisfiable</td></tr>
6015 <tr><th>HTTP_STATUS_REQUEST_TIMEOUT </th> <td class="description">Request timed out</td></tr>
6016 <tr><th>HTTP_STATUS_REQUEST_TOO_LARGE </th> <td class="description">Request entity too large</td></tr>
6017 <tr><th>HTTP_STATUS_RESET_CONTENT </th> <td class="description">Content was reset/recreated</td></tr>
6018 <tr><th>HTTP_STATUS_SEE_OTHER </th> <td class="description">See this other link...</td></tr>
6019 <tr><th>HTTP_STATUS_SERVER_ERROR </th> <td class="description">Internal server error</td></tr>
6020 <tr><th>HTTP_STATUS_SERVICE_UNAVAILABLE </th> <td class="description">Service is unavailable</td></tr>
6021 <tr><th>HTTP_STATUS_SWITCHING_PROTOCOLS </th> <td class="description">HTTP upgrade to TLS/SSL</td></tr>
6022 <tr><th>HTTP_STATUS_UNAUTHORIZED </th> <td class="description">Unauthorized to access host</td></tr>
6023 <tr><th>HTTP_STATUS_UNSUPPORTED_MEDIATYPE </th> <td class="description">The requested media type is unsupported</td></tr>
6024 <tr><th>HTTP_STATUS_UPGRADE_REQUIRED </th> <td class="description">Upgrade to SSL/TLS required</td></tr>
6025 <tr><th>HTTP_STATUS_URI_TOO_LONG </th> <td class="description">URI too long</td></tr>
6026 <tr><th>HTTP_STATUS_USE_PROXY </th> <td class="description">Must use a proxy to access this URI</td></tr>
6027</tbody></table>
798d6e29
MS
6028 <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>
6029 <p class="description">Level of trust for credentials </p>
6030 <h4 class="constants">Constants</h4>
98d88c8d
MS
6031 <table class="list"><tbody>
6032 <tr><th>HTTP_TRUST_CHANGED </th> <td class="description">Credentials have changed</td></tr>
6033 <tr><th>HTTP_TRUST_EXPIRED </th> <td class="description">Credentials are expired</td></tr>
6034 <tr><th>HTTP_TRUST_INVALID </th> <td class="description">Credentials are invalid</td></tr>
6035 <tr><th>HTTP_TRUST_OK </th> <td class="description">Credentials are OK/trusted</td></tr>
6036 <tr><th>HTTP_TRUST_RENEWED </th> <td class="description">Credentials have been renewed</td></tr>
6037 <tr><th>HTTP_TRUST_UNKNOWN </th> <td class="description">Credentials are unknown/new</td></tr>
6038</tbody></table>
798d6e29
MS
6039 <h3 class="enumeration"><a id="http_uri_coding_e">http_uri_coding_e</a></h3>
6040 <p class="description">URI en/decode flags</p>
6041 <h4 class="constants">Constants</h4>
98d88c8d
MS
6042 <table class="list"><tbody>
6043 <tr><th>HTTP_URI_CODING_ALL </th> <td class="description">En/decode everything</td></tr>
6044 <tr><th>HTTP_URI_CODING_HOSTNAME </th> <td class="description">En/decode the hostname portion</td></tr>
6045 <tr><th>HTTP_URI_CODING_MOST </th> <td class="description">En/decode all but the query</td></tr>
6046 <tr><th>HTTP_URI_CODING_NONE </th> <td class="description">Don't en/decode anything</td></tr>
6047 <tr><th>HTTP_URI_CODING_QUERY </th> <td class="description">En/decode the query portion</td></tr>
6048 <tr><th>HTTP_URI_CODING_RESOURCE </th> <td class="description">En/decode the resource portion</td></tr>
6049 <tr><th>HTTP_URI_CODING_RFC6874 </th> <td class="description">Use RFC 6874 address format</td></tr>
6050 <tr><th>HTTP_URI_CODING_USERNAME </th> <td class="description">En/decode the username portion</td></tr>
6051</tbody></table>
798d6e29
MS
6052 <h3 class="enumeration"><a id="http_uri_status_e"><span class="info">&#160;CUPS 1.2&#160;</span>http_uri_status_e</a></h3>
6053 <p class="description">URI separation status </p>
6054 <h4 class="constants">Constants</h4>
98d88c8d
MS
6055 <table class="list"><tbody>
6056 <tr><th>HTTP_URI_STATUS_BAD_ARGUMENTS </th> <td class="description">Bad arguments to function (error)</td></tr>
6057 <tr><th>HTTP_URI_STATUS_BAD_HOSTNAME </th> <td class="description">Bad hostname in URI (error)</td></tr>
6058 <tr><th>HTTP_URI_STATUS_BAD_PORT </th> <td class="description">Bad port number in URI (error)</td></tr>
6059 <tr><th>HTTP_URI_STATUS_BAD_RESOURCE </th> <td class="description">Bad resource in URI (error)</td></tr>
6060 <tr><th>HTTP_URI_STATUS_BAD_SCHEME </th> <td class="description">Bad scheme in URI (error)</td></tr>
6061 <tr><th>HTTP_URI_STATUS_BAD_URI </th> <td class="description">Bad/empty URI (error)</td></tr>
6062 <tr><th>HTTP_URI_STATUS_BAD_USERNAME </th> <td class="description">Bad username in URI (error)</td></tr>
6063 <tr><th>HTTP_URI_STATUS_MISSING_RESOURCE </th> <td class="description">Missing resource in URI (warning)</td></tr>
6064 <tr><th>HTTP_URI_STATUS_MISSING_SCHEME </th> <td class="description">Missing scheme in URI (warning)</td></tr>
6065 <tr><th>HTTP_URI_STATUS_OK </th> <td class="description">URI decoded OK</td></tr>
6066 <tr><th>HTTP_URI_STATUS_OVERFLOW </th> <td class="description">URI buffer for httpAssembleURI is too small</td></tr>
6067 <tr><th>HTTP_URI_STATUS_UNKNOWN_SCHEME </th> <td class="description">Unknown scheme in URI (warning)</td></tr>
6068</tbody></table>
798d6e29 6069 <h3 class="enumeration"><a id="ipp_finishings_e">ipp_finishings_e</a></h3>
718ee2ff 6070 <p class="description">Finishings values</p>
798d6e29 6071 <h4 class="constants">Constants</h4>
98d88c8d
MS
6072 <table class="list"><tbody>
6073 <tr><th>IPP_FINISHINGS_BALE </th> <td class="description">Bale (any type)</td></tr>
6074 <tr><th>IPP_FINISHINGS_BIND </th> <td class="description">Bind</td></tr>
6075 <tr><th>IPP_FINISHINGS_BIND_BOTTOM </th> <td class="description">Bind on bottom</td></tr>
6076 <tr><th>IPP_FINISHINGS_BIND_LEFT </th> <td class="description">Bind on left</td></tr>
6077 <tr><th>IPP_FINISHINGS_BIND_RIGHT </th> <td class="description">Bind on right</td></tr>
6078 <tr><th>IPP_FINISHINGS_BIND_TOP </th> <td class="description">Bind on top</td></tr>
6079 <tr><th>IPP_FINISHINGS_BOOKLET_MAKER </th> <td class="description">Fold to make booklet</td></tr>
6080 <tr><th>IPP_FINISHINGS_COAT </th> <td class="description">Apply protective liquid or powder coating</td></tr>
6081 <tr><th>IPP_FINISHINGS_COVER </th> <td class="description">Add cover</td></tr>
6082 <tr><th>IPP_FINISHINGS_EDGE_STITCH </th> <td class="description">Stitch along any side</td></tr>
6083 <tr><th>IPP_FINISHINGS_EDGE_STITCH_BOTTOM </th> <td class="description">Stitch along bottom edge</td></tr>
6084 <tr><th>IPP_FINISHINGS_EDGE_STITCH_LEFT </th> <td class="description">Stitch along left side</td></tr>
6085 <tr><th>IPP_FINISHINGS_EDGE_STITCH_RIGHT </th> <td class="description">Stitch along right side</td></tr>
6086 <tr><th>IPP_FINISHINGS_EDGE_STITCH_TOP </th> <td class="description">Stitch along top edge</td></tr>
6087 <tr><th>IPP_FINISHINGS_FOLD </th> <td class="description">Fold (any type)</td></tr>
6088 <tr><th>IPP_FINISHINGS_FOLD_ACCORDIAN </th> <td class="description">Accordian-fold the paper vertically into four sections</td></tr>
6089 <tr><th>IPP_FINISHINGS_FOLD_DOUBLE_GATE </th> <td class="description">Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically</td></tr>
6090 <tr><th>IPP_FINISHINGS_FOLD_ENGINEERING_Z </th> <td class="description">Fold the paper vertically into two small sections and one larger, forming an elongated Z</td></tr>
6091 <tr><th>IPP_FINISHINGS_FOLD_GATE </th> <td class="description">Fold the top and bottom quarters of the paper towards the midline</td></tr>
6092 <tr><th>IPP_FINISHINGS_FOLD_HALF </th> <td class="description">Fold the paper in half vertically</td></tr>
6093 <tr><th>IPP_FINISHINGS_FOLD_HALF_Z </th> <td class="description">Fold the paper in half horizontally, then Z-fold the paper vertically</td></tr>
6094 <tr><th>IPP_FINISHINGS_FOLD_LEFT_GATE </th> <td class="description">Fold the top quarter of the paper towards the midline</td></tr>
6095 <tr><th>IPP_FINISHINGS_FOLD_LETTER </th> <td class="description">Fold the paper into three sections vertically; sometimes also known as a C fold</td></tr>
6096 <tr><th>IPP_FINISHINGS_FOLD_PARALLEL </th> <td class="description">Fold the paper in half vertically two times, yielding four sections</td></tr>
6097 <tr><th>IPP_FINISHINGS_FOLD_POSTER </th> <td class="description">Fold the paper in half horizontally and vertically; sometimes also called a cross fold</td></tr>
6098 <tr><th>IPP_FINISHINGS_FOLD_RIGHT_GATE </th> <td class="description">Fold the bottom quarter of the paper towards the midline</td></tr>
6099 <tr><th>IPP_FINISHINGS_FOLD_Z </th> <td class="description">Fold the paper vertically into three sections, forming a Z</td></tr>
6100 <tr><th>IPP_FINISHINGS_JOG_OFFSET </th> <td class="description">Offset for binding (any type)</td></tr>
6101 <tr><th>IPP_FINISHINGS_LAMINATE </th> <td class="description">Apply protective (solid) material</td></tr>
6102 <tr><th>IPP_FINISHINGS_NONE </th> <td class="description">No finishing</td></tr>
6103 <tr><th>IPP_FINISHINGS_PUNCH </th> <td class="description">Punch (any location/count)</td></tr>
6104 <tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_LEFT </th> <td class="description">Punch 1 hole bottom left</td></tr>
6105 <tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT </th> <td class="description">Punch 1 hole bottom right</td></tr>
6106 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_BOTTOM </th> <td class="description">Punch 2 holes bottom edge</td></tr>
6107 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_LEFT </th> <td class="description">Punch 2 holes left side</td></tr>
6108 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_RIGHT </th> <td class="description">Punch 2 holes right side</td></tr>
6109 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_TOP </th> <td class="description">Punch 2 holes top edge</td></tr>
6110 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM </th> <td class="description">Pucnh multiple holes bottom edge</td></tr>
6111 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT </th> <td class="description">Pucnh multiple holes left side</td></tr>
6112 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT </th> <td class="description">Pucnh multiple holes right side</td></tr>
6113 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_TOP </th> <td class="description">Pucnh multiple holes top edge</td></tr>
6114 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_BOTTOM </th> <td class="description">Punch 4 holes bottom edge</td></tr>
6115 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_LEFT </th> <td class="description">Punch 4 holes left side</td></tr>
6116 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_RIGHT </th> <td class="description">Punch 4 holes right side</td></tr>
6117 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_TOP </th> <td class="description">Punch 4 holes top edge</td></tr>
6118 <tr><th>IPP_FINISHINGS_PUNCH_TOP_LEFT </th> <td class="description">Punch 1 hole top left</td></tr>
6119 <tr><th>IPP_FINISHINGS_PUNCH_TOP_RIGHT </th> <td class="description">Punch 1 hole top right</td></tr>
6120 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM </th> <td class="description">Punch 3 holes bottom edge</td></tr>
6121 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_LEFT </th> <td class="description">Punch 3 holes left side</td></tr>
6122 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT </th> <td class="description">Punch 3 holes right side</td></tr>
6123 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_TOP </th> <td class="description">Punch 3 holes top edge</td></tr>
6124 <tr><th>IPP_FINISHINGS_SADDLE_STITCH </th> <td class="description">Staple interior</td></tr>
6125 <tr><th>IPP_FINISHINGS_STAPLE </th> <td class="description">Staple (any location/method)</td></tr>
6126 <tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_LEFT </th> <td class="description">Staple bottom left corner</td></tr>
6127 <tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT </th> <td class="description">Staple bottom right corner</td></tr>
6128 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_BOTTOM </th> <td class="description">Two staples on bottom</td></tr>
6129 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_LEFT </th> <td class="description">Two staples on left</td></tr>
6130 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_RIGHT </th> <td class="description">Two staples on right</td></tr>
6131 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_TOP </th> <td class="description">Two staples on top</td></tr>
6132 <tr><th>IPP_FINISHINGS_STAPLE_TOP_LEFT </th> <td class="description">Staple top left corner</td></tr>
6133 <tr><th>IPP_FINISHINGS_STAPLE_TOP_RIGHT </th> <td class="description">Staple top right corner</td></tr>
6134 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM </th> <td class="description">Three staples on bottom</td></tr>
6135 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_LEFT </th> <td class="description">Three staples on left</td></tr>
6136 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT </th> <td class="description">Three staples on right</td></tr>
6137 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_TOP </th> <td class="description">Three staples on top</td></tr>
6138 <tr><th>IPP_FINISHINGS_TRIM </th> <td class="description">Trim (any type)</td></tr>
6139 <tr><th>IPP_FINISHINGS_TRIM_AFTER_COPIES </th> <td class="description">Trim output after each copy</td></tr>
6140 <tr><th>IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS </th> <td class="description">Trim output after each document</td></tr>
6141 <tr><th>IPP_FINISHINGS_TRIM_AFTER_JOB </th> <td class="description">Trim output after job</td></tr>
6142 <tr><th>IPP_FINISHINGS_TRIM_AFTER_PAGES </th> <td class="description">Trim output after each page</td></tr>
6143</tbody></table>
798d6e29
MS
6144 <h3 class="enumeration"><a id="ipp_jstate_e">ipp_jstate_e</a></h3>
6145 <p class="description">Job states</p>
6146 <h4 class="constants">Constants</h4>
98d88c8d
MS
6147 <table class="list"><tbody>
6148 <tr><th>IPP_JSTATE_ABORTED </th> <td class="description">Job has aborted due to error</td></tr>
6149 <tr><th>IPP_JSTATE_CANCELED </th> <td class="description">Job has been canceled</td></tr>
6150 <tr><th>IPP_JSTATE_COMPLETED </th> <td class="description">Job has completed successfully</td></tr>
6151 <tr><th>IPP_JSTATE_HELD </th> <td class="description">Job is held for printing</td></tr>
6152 <tr><th>IPP_JSTATE_PENDING </th> <td class="description">Job is waiting to be printed</td></tr>
6153 <tr><th>IPP_JSTATE_PROCESSING </th> <td class="description">Job is currently printing</td></tr>
6154 <tr><th>IPP_JSTATE_STOPPED </th> <td class="description">Job has been stopped</td></tr>
6155</tbody></table>
798d6e29
MS
6156 <h3 class="enumeration"><a id="ipp_op_e">ipp_op_e</a></h3>
6157 <p class="description">IPP operations</p>
6158 <h4 class="constants">Constants</h4>
98d88c8d
MS
6159 <table class="list"><tbody>
6160 <tr><th>IPP_OP_CANCEL_CURRENT_JOB </th> <td class="description">Cancel-Current-Job: Cancel the current job</td></tr>
6161 <tr><th>IPP_OP_CANCEL_JOB </th> <td class="description">Cancel-Job: Cancel a job</td></tr>
6162 <tr><th>IPP_OP_CANCEL_JOBS </th> <td class="description">Cancel-Jobs: Cancel all jobs (administrative)</td></tr>
6163 <tr><th>IPP_OP_CANCEL_MY_JOBS </th> <td class="description">Cancel-My-Jobs: Cancel a user's jobs</td></tr>
6164 <tr><th>IPP_OP_CANCEL_SUBSCRIPTION <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Cancel-Subscription: Cancel a subscription </td></tr>
6165 <tr><th>IPP_OP_CLOSE_JOB </th> <td class="description">Close-Job: Close a job and start printing</td></tr>
6166 <tr><th>IPP_OP_CREATE_JOB </th> <td class="description">Create-Job: Create an empty print job</td></tr>
6167 <tr><th>IPP_OP_CREATE_JOB_SUBSCRIPTIONS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Create-Job-Subscriptions: Create one of more job subscriptions </td></tr>
6168 <tr><th>IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Create-Printer-Subscriptions: Create one or more printer subscriptions </td></tr>
6169 <tr><th>IPP_OP_CUPS_ADD_MODIFY_CLASS </th> <td class="description">CUPS-Add-Modify-Class: Add or modify a class</td></tr>
6170 <tr><th>IPP_OP_CUPS_ADD_MODIFY_PRINTER </th> <td class="description">CUPS-Add-Modify-Printer: Add or modify a printer</td></tr>
6171 <tr><th>IPP_OP_CUPS_AUTHENTICATE_JOB <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">CUPS-Authenticate-Job: Authenticate a job </td></tr>
6172 <tr><th>IPP_OP_CUPS_CREATE_LOCAL_PRINTER <span class="info">&#160;CUPS 2.2&#160;</span></th> <td class="description">CUPS-Create-Local-Printer: Create a local (temporary) printer </td></tr>
6173 <tr><th>IPP_OP_CUPS_DELETE_CLASS </th> <td class="description">CUPS-Delete-Class: Delete a class</td></tr>
6174 <tr><th>IPP_OP_CUPS_DELETE_PRINTER </th> <td class="description">CUPS-Delete-Printer: Delete a printer</td></tr>
6175 <tr><th>IPP_OP_CUPS_GET_DEFAULT </th> <td class="description">CUPS-Get-Default: Get the default printer</td></tr>
6176 <tr><th>IPP_OP_CUPS_GET_DEVICES <span class="info">&#160;DEPRECATED&#160;</span></th> <td class="description">CUPS-Get-Devices: Get a list of supported devices </td></tr>
6177 <tr><th>IPP_OP_CUPS_GET_DOCUMENT <span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span></th> <td class="description">CUPS-Get-Document: Get a document file </td></tr>
6178 <tr><th>IPP_OP_CUPS_GET_PPD <span class="info">&#160;DEPRECATED&#160;</span></th> <td class="description">CUPS-Get-PPD: Get a PPD file </td></tr>
6179 <tr><th>IPP_OP_CUPS_GET_PPDS <span class="info">&#160;DEPRECATED&#160;</span></th> <td class="description">CUPS-Get-PPDs: Get a list of supported drivers </td></tr>
6180 <tr><th>IPP_OP_CUPS_GET_PRINTERS </th> <td class="description">CUPS-Get-Printers: Get a list of printers and/or classes</td></tr>
6181 <tr><th>IPP_OP_CUPS_INVALID </th> <td class="description">Invalid operation name for <a href="#ippOpValue"><code>ippOpValue</code></a></td></tr>
6182 <tr><th>IPP_OP_CUPS_MOVE_JOB </th> <td class="description">CUPS-Move-Job: Move a job to a different printer</td></tr>
6183 <tr><th>IPP_OP_CUPS_SET_DEFAULT </th> <td class="description">CUPS-Set-Default: Set the default printer</td></tr>
6184 <tr><th>IPP_OP_DISABLE_PRINTER </th> <td class="description">Disable-Printer: Reject new jobs for a printer</td></tr>
6185 <tr><th>IPP_OP_ENABLE_PRINTER </th> <td class="description">Enable-Printer: Accept new jobs for a printer</td></tr>
6186 <tr><th>IPP_OP_GET_JOBS </th> <td class="description">Get-Jobs: Get a list of jobs</td></tr>
6187 <tr><th>IPP_OP_GET_JOB_ATTRIBUTES </th> <td class="description">Get-Job-Attribute: Get information about a job</td></tr>
6188 <tr><th>IPP_OP_GET_NOTIFICATIONS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Get-Notifications: Get notification events </td></tr>
6189 <tr><th>IPP_OP_GET_PRINTER_ATTRIBUTES </th> <td class="description">Get-Printer-Attributes: Get information about a printer</td></tr>
6190 <tr><th>IPP_OP_GET_PRINTER_SUPPORTED_VALUES </th> <td class="description">Get-Printer-Supported-Values: Get supported values</td></tr>
6191 <tr><th>IPP_OP_GET_SUBSCRIPTIONS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Get-Subscriptions: Get list of subscriptions </td></tr>
6192 <tr><th>IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Get-Subscription-Attributes: Get subscription information </td></tr>
6193 <tr><th>IPP_OP_HOLD_JOB </th> <td class="description">Hold-Job: Hold a job for printing</td></tr>
6194 <tr><th>IPP_OP_HOLD_NEW_JOBS </th> <td class="description">Hold-New-Jobs: Hold new jobs</td></tr>
6195 <tr><th>IPP_OP_IDENTIFY_PRINTER </th> <td class="description">Identify-Printer: Make the printer beep, flash, or display a message for identification</td></tr>
6196 <tr><th>IPP_OP_PAUSE_PRINTER </th> <td class="description">Pause-Printer: Stop a printer</td></tr>
6197 <tr><th>IPP_OP_PAUSE_PRINTER_AFTER_CURRENT_JOB </th> <td class="description">Pause-Printer-After-Current-Job: Stop printer after the current job</td></tr>
6198 <tr><th>IPP_OP_PRINT_JOB </th> <td class="description">Print-Job: Print a single file</td></tr>
6199 <tr><th>IPP_OP_PROMOTE_JOB </th> <td class="description">Promote-Job: Promote a job to print sooner</td></tr>
6200 <tr><th>IPP_OP_RELEASE_HELD_NEW_JOBS </th> <td class="description">Release-Held-New-Jobs: Release new jobs that were previously held</td></tr>
6201 <tr><th>IPP_OP_RELEASE_JOB </th> <td class="description">Release-Job: Release a job for printing</td></tr>
6202 <tr><th>IPP_OP_RENEW_SUBSCRIPTION <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Renew-Subscription: Renew a printer subscription </td></tr>
6203 <tr><th>IPP_OP_RESTART_JOB <span class="info">&#160;DEPRECATED&#160;</span></th> <td class="description">Restart-Job: Reprint a job </td></tr>
6204 <tr><th>IPP_OP_RESUME_JOB </th> <td class="description">Resume-Job: Resume the current job</td></tr>
6205 <tr><th>IPP_OP_RESUME_PRINTER </th> <td class="description">Resume-Printer: Start a printer</td></tr>
6206 <tr><th>IPP_OP_SCHEDULE_JOB_AFTER </th> <td class="description">Schedule-Job-After: Schedule a job to print after another</td></tr>
6207 <tr><th>IPP_OP_SEND_DOCUMENT </th> <td class="description">Send-Document: Add a file to a job</td></tr>
6208 <tr><th>IPP_OP_SET_JOB_ATTRIBUTES </th> <td class="description">Set-Job-Attributes: Set job values</td></tr>
6209 <tr><th>IPP_OP_SET_PRINTER_ATTRIBUTES </th> <td class="description">Set-Printer-Attributes: Set printer values</td></tr>
6210 <tr><th>IPP_OP_SUSPEND_CURRENT_JOB </th> <td class="description">Suspend-Current-Job: Suspend the current job</td></tr>
6211 <tr><th>IPP_OP_VALIDATE_JOB </th> <td class="description">Validate-Job: Validate job values prior to submission</td></tr>
6212</tbody></table>
798d6e29
MS
6213 <h3 class="enumeration"><a id="ipp_orient_e">ipp_orient_e</a></h3>
6214 <p class="description">Orientation values</p>
6215 <h4 class="constants">Constants</h4>
98d88c8d
MS
6216 <table class="list"><tbody>
6217 <tr><th>IPP_ORIENT_LANDSCAPE </th> <td class="description">90 degrees counter-clockwise</td></tr>
6218 <tr><th>IPP_ORIENT_NONE </th> <td class="description">No rotation</td></tr>
6219 <tr><th>IPP_ORIENT_PORTRAIT </th> <td class="description">No rotation</td></tr>
6220 <tr><th>IPP_ORIENT_REVERSE_LANDSCAPE </th> <td class="description">90 degrees clockwise</td></tr>
6221 <tr><th>IPP_ORIENT_REVERSE_PORTRAIT </th> <td class="description">180 degrees</td></tr>
6222</tbody></table>
798d6e29
MS
6223 <h3 class="enumeration"><a id="ipp_pstate_e">ipp_pstate_e</a></h3>
6224 <p class="description">Printer states</p>
6225 <h4 class="constants">Constants</h4>
98d88c8d
MS
6226 <table class="list"><tbody>
6227 <tr><th>IPP_PSTATE_IDLE </th> <td class="description">Printer is idle</td></tr>
6228 <tr><th>IPP_PSTATE_PROCESSING </th> <td class="description">Printer is working</td></tr>
6229 <tr><th>IPP_PSTATE_STOPPED </th> <td class="description">Printer is stopped</td></tr>
6230</tbody></table>
798d6e29
MS
6231 <h3 class="enumeration"><a id="ipp_quality_e">ipp_quality_e</a></h3>
6232 <p class="description">Qualities</p>
6233 <h4 class="constants">Constants</h4>
98d88c8d
MS
6234 <table class="list"><tbody>
6235 <tr><th>IPP_QUALITY_DRAFT </th> <td class="description">Draft quality</td></tr>
6236 <tr><th>IPP_QUALITY_HIGH </th> <td class="description">High quality</td></tr>
6237 <tr><th>IPP_QUALITY_NORMAL </th> <td class="description">Normal quality</td></tr>
6238</tbody></table>
798d6e29
MS
6239 <h3 class="enumeration"><a id="ipp_res_e">ipp_res_e</a></h3>
6240 <p class="description">Resolution units</p>
6241 <h4 class="constants">Constants</h4>
98d88c8d
MS
6242 <table class="list"><tbody>
6243 <tr><th>IPP_RES_PER_CM </th> <td class="description">Pixels per centimeter</td></tr>
6244 <tr><th>IPP_RES_PER_INCH </th> <td class="description">Pixels per inch</td></tr>
6245</tbody></table>
798d6e29
MS
6246 <h3 class="enumeration"><a id="ipp_state_e">ipp_state_e</a></h3>
6247 <p class="description">IPP states</p>
6248 <h4 class="constants">Constants</h4>
98d88c8d
MS
6249 <table class="list"><tbody>
6250 <tr><th>IPP_STATE_ATTRIBUTE </th> <td class="description">One or more attributes need to be sent/received</td></tr>
6251 <tr><th>IPP_STATE_DATA </th> <td class="description">IPP request data needs to be sent/received</td></tr>
6252 <tr><th>IPP_STATE_ERROR </th> <td class="description">An error occurred</td></tr>
6253 <tr><th>IPP_STATE_HEADER </th> <td class="description">The request header needs to be sent/received</td></tr>
6254 <tr><th>IPP_STATE_IDLE </th> <td class="description">Nothing is happening/request completed</td></tr>
6255</tbody></table>
798d6e29
MS
6256 <h3 class="enumeration"><a id="ipp_status_e">ipp_status_e</a></h3>
6257 <p class="description">IPP status codes</p>
6258 <h4 class="constants">Constants</h4>
98d88c8d
MS
6259 <table class="list"><tbody>
6260 <tr><th>IPP_STATUS_CUPS_INVALID </th> <td class="description">Invalid status name for <a href="#ippErrorValue"><code>ippErrorValue</code></a></td></tr>
6261 <tr><th>IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED </th> <td class="description">client-error-account-authorization-failed</td></tr>
6262 <tr><th>IPP_STATUS_ERROR_ACCOUNT_CLOSED </th> <td class="description">client-error-account-closed</td></tr>
6263 <tr><th>IPP_STATUS_ERROR_ACCOUNT_INFO_NEEDED </th> <td class="description">client-error-account-info-needed</td></tr>
6264 <tr><th>IPP_STATUS_ERROR_ACCOUNT_LIMIT_REACHED </th> <td class="description">client-error-account-limit-reached</td></tr>
6265 <tr><th>IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE </th> <td class="description">client-error-attributes-not-settable</td></tr>
6266 <tr><th>IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES </th> <td class="description">client-error-attributes-or-values-not-supported</td></tr>
6267 <tr><th>IPP_STATUS_ERROR_BAD_REQUEST </th> <td class="description">client-error-bad-request</td></tr>
6268 <tr><th>IPP_STATUS_ERROR_BUSY </th> <td class="description">server-error-busy</td></tr>
6269 <tr><th>IPP_STATUS_ERROR_CHARSET </th> <td class="description">client-error-charset-not-supported</td></tr>
6270 <tr><th>IPP_STATUS_ERROR_COMPRESSION_ERROR </th> <td class="description">client-error-compression-error</td></tr>
6271 <tr><th>IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED </th> <td class="description">client-error-compression-not-supported</td></tr>
6272 <tr><th>IPP_STATUS_ERROR_CONFLICTING </th> <td class="description">client-error-conflicting-attributes</td></tr>
6273 <tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED <span class="info">&#160;DEPRECATED&#160;</span></th> <td class="description">cups-error-account-authorization-failed </td></tr>
6274 <tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED </th> <td class="description">cups-error-account-closed @deprecate@</td></tr>
6275 <tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED <span class="info">&#160;DEPRECATED&#160;</span></th> <td class="description">cups-error-account-info-needed </td></tr>
6276 <tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED <span class="info">&#160;DEPRECATED&#160;</span></th> <td class="description">cups-error-account-limit-reached </td></tr>
6277 <tr><th>IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED <span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span></th> <td class="description">cups-authentication-canceled - Authentication canceled by user </td></tr>
6278 <tr><th>IPP_STATUS_ERROR_CUPS_PKI <span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span></th> <td class="description">cups-pki-error - Error negotiating a secure connection </td></tr>
6279 <tr><th>IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED <span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span></th> <td class="description">cups-upgrade-required - TLS upgrade required </td></tr>
6280 <tr><th>IPP_STATUS_ERROR_DEVICE </th> <td class="description">server-error-device-error</td></tr>
6281 <tr><th>IPP_STATUS_ERROR_DOCUMENT_ACCESS </th> <td class="description">client-error-document-access-error</td></tr>
6282 <tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR </th> <td class="description">client-error-document-format-error</td></tr>
6283 <tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED </th> <td class="description">client-error-document-format-not-supported</td></tr>
6284 <tr><th>IPP_STATUS_ERROR_DOCUMENT_PASSWORD </th> <td class="description">client-error-document-password-error</td></tr>
6285 <tr><th>IPP_STATUS_ERROR_DOCUMENT_PERMISSION </th> <td class="description">client-error-document-permission-error</td></tr>
6286 <tr><th>IPP_STATUS_ERROR_DOCUMENT_SECURITY </th> <td class="description">client-error-document-security-error</td></tr>
6287 <tr><th>IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE </th> <td class="description">client-error-document-unprintable-error</td></tr>
6288 <tr><th>IPP_STATUS_ERROR_FORBIDDEN </th> <td class="description">client-error-forbidden</td></tr>
6289 <tr><th>IPP_STATUS_ERROR_GONE </th> <td class="description">client-error-gone</td></tr>
6290 <tr><th>IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS </th> <td class="description">client-error-ignored-all-subscriptions</td></tr>
6291 <tr><th>IPP_STATUS_ERROR_INTERNAL </th> <td class="description">server-error-internal-error</td></tr>
6292 <tr><th>IPP_STATUS_ERROR_JOB_CANCELED </th> <td class="description">server-error-job-canceled</td></tr>
6293 <tr><th>IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED </th> <td class="description">server-error-multiple-document-jobs-not-supported</td></tr>
6294 <tr><th>IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS </th> <td class="description">server-error-not-accepting-jobs</td></tr>
6295 <tr><th>IPP_STATUS_ERROR_NOT_AUTHENTICATED </th> <td class="description">client-error-not-authenticated</td></tr>
6296 <tr><th>IPP_STATUS_ERROR_NOT_AUTHORIZED </th> <td class="description">client-error-not-authorized</td></tr>
6297 <tr><th>IPP_STATUS_ERROR_NOT_FETCHABLE </th> <td class="description">client-error-not-fetchable</td></tr>
6298 <tr><th>IPP_STATUS_ERROR_NOT_FOUND </th> <td class="description">client-error-not-found</td></tr>
6299 <tr><th>IPP_STATUS_ERROR_NOT_POSSIBLE </th> <td class="description">client-error-not-possible</td></tr>
6300 <tr><th>IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED </th> <td class="description">server-error-operation-not-supported</td></tr>
6301 <tr><th>IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED </th> <td class="description">server-error-printer-is-deactivated</td></tr>
6302 <tr><th>IPP_STATUS_ERROR_REQUEST_ENTITY </th> <td class="description">client-error-request-entity-too-large</td></tr>
6303 <tr><th>IPP_STATUS_ERROR_REQUEST_VALUE </th> <td class="description">client-error-request-value-too-long</td></tr>
6304 <tr><th>IPP_STATUS_ERROR_SERVICE_UNAVAILABLE </th> <td class="description">server-error-service-unavailable</td></tr>
6305 <tr><th>IPP_STATUS_ERROR_TEMPORARY </th> <td class="description">server-error-temporary-error</td></tr>
6306 <tr><th>IPP_STATUS_ERROR_TIMEOUT </th> <td class="description">client-error-timeout</td></tr>
6307 <tr><th>IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS </th> <td class="description">server-error-too-many-documents</td></tr>
6308 <tr><th>IPP_STATUS_ERROR_TOO_MANY_JOBS </th> <td class="description">server-error-too-many-jobs</td></tr>
6309 <tr><th>IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS </th> <td class="description">client-error-too-many-subscriptions</td></tr>
6310 <tr><th>IPP_STATUS_ERROR_URI_SCHEME </th> <td class="description">client-error-uri-scheme-not-supported</td></tr>
6311 <tr><th>IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED </th> <td class="description">server-error-version-not-supported</td></tr>
6312 <tr><th>IPP_STATUS_OK </th> <td class="description">successful-ok</td></tr>
6313 <tr><th>IPP_STATUS_OK_CONFLICTING </th> <td class="description">successful-ok-conflicting-attributes</td></tr>
6314 <tr><th>IPP_STATUS_OK_EVENTS_COMPLETE </th> <td class="description">successful-ok-events-complete</td></tr>
6315 <tr><th>IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED </th> <td class="description">successful-ok-ignored-or-substituted-attributes</td></tr>
6316 <tr><th>IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS </th> <td class="description">successful-ok-ignored-subscriptions</td></tr>
6317 <tr><th>IPP_STATUS_OK_TOO_MANY_EVENTS </th> <td class="description">successful-ok-too-many-events</td></tr>
6318</tbody></table>
798d6e29
MS
6319 <h3 class="enumeration"><a id="ipp_tag_e">ipp_tag_e</a></h3>
6320 <p class="description">Format tags for attributes</p>
6321 <h4 class="constants">Constants</h4>
98d88c8d
MS
6322 <table class="list"><tbody>
6323 <tr><th>IPP_TAG_ADMINDEFINE </th> <td class="description">Admin-defined value</td></tr>
6324 <tr><th>IPP_TAG_BOOLEAN </th> <td class="description">Boolean value</td></tr>
6325 <tr><th>IPP_TAG_CHARSET </th> <td class="description">Character set value</td></tr>
6326 <tr><th>IPP_TAG_CUPS_INVALID </th> <td class="description">Invalid tag name for <a href="#ippTagValue"><code>ippTagValue</code></a></td></tr>
6327 <tr><th>IPP_TAG_DATE </th> <td class="description">Date/time value</td></tr>
6328 <tr><th>IPP_TAG_DEFAULT </th> <td class="description">Default value</td></tr>
6329 <tr><th>IPP_TAG_DELETEATTR </th> <td class="description">Delete-attribute value</td></tr>
6330 <tr><th>IPP_TAG_END </th> <td class="description">End-of-attributes</td></tr>
6331 <tr><th>IPP_TAG_ENUM </th> <td class="description">Enumeration value</td></tr>
6332 <tr><th>IPP_TAG_EVENT_NOTIFICATION </th> <td class="description">Event group</td></tr>
6333 <tr><th>IPP_TAG_INTEGER </th> <td class="description">Integer value</td></tr>
6334 <tr><th>IPP_TAG_JOB </th> <td class="description">Job group</td></tr>
6335 <tr><th>IPP_TAG_KEYWORD </th> <td class="description">Keyword value</td></tr>
6336 <tr><th>IPP_TAG_LANGUAGE </th> <td class="description">Language value</td></tr>
6337 <tr><th>IPP_TAG_MIMETYPE </th> <td class="description">MIME media type value</td></tr>
6338 <tr><th>IPP_TAG_NAME </th> <td class="description">Name value</td></tr>
6339 <tr><th>IPP_TAG_NAMELANG </th> <td class="description">Name-with-language value</td></tr>
6340 <tr><th>IPP_TAG_NOTSETTABLE </th> <td class="description">Not-settable value</td></tr>
6341 <tr><th>IPP_TAG_NOVALUE </th> <td class="description">No-value value</td></tr>
6342 <tr><th>IPP_TAG_OPERATION </th> <td class="description">Operation group</td></tr>
6343 <tr><th>IPP_TAG_PRINTER </th> <td class="description">Printer group</td></tr>
6344 <tr><th>IPP_TAG_RANGE </th> <td class="description">Range value</td></tr>
6345 <tr><th>IPP_TAG_RESOLUTION </th> <td class="description">Resolution value</td></tr>
6346 <tr><th>IPP_TAG_STRING </th> <td class="description">Octet string value</td></tr>
6347 <tr><th>IPP_TAG_SUBSCRIPTION </th> <td class="description">Subscription group</td></tr>
6348 <tr><th>IPP_TAG_TEXT </th> <td class="description">Text value</td></tr>
6349 <tr><th>IPP_TAG_TEXTLANG </th> <td class="description">Text-with-language value</td></tr>
6350 <tr><th>IPP_TAG_UNKNOWN </th> <td class="description">Unknown value</td></tr>
6351 <tr><th>IPP_TAG_UNSUPPORTED_GROUP </th> <td class="description">Unsupported attributes group</td></tr>
6352 <tr><th>IPP_TAG_UNSUPPORTED_VALUE </th> <td class="description">Unsupported value</td></tr>
6353 <tr><th>IPP_TAG_URI </th> <td class="description">URI value</td></tr>
6354 <tr><th>IPP_TAG_URISCHEME </th> <td class="description">URI scheme value</td></tr>
6355 <tr><th>IPP_TAG_ZERO </th> <td class="description">Zero tag - used for separators</td></tr>
6356</tbody></table>
798d6e29
MS
6357 </div>
6358 </body>
6359</html>