]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/cupspm.html
Mirror validation changes from 2.2 branch.
[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">
ddf2ec73
MS
10 <meta name="copyright" content="Copyright &#xa9; 2007-2018 by Apple Inc. All Rights Reserved.">
11 <meta name="version" content="2.3.0">
798d6e29
MS
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;
798d6e29
MS
163}
164h1.title {
165}
166h2.title {
167 border-bottom: solid 2px black;
168}
169h3.title {
170 border-bottom: solid 2px black;
171}
172--></style>
173 </head>
174 <body>
175 <h1 class="title">CUPS Programming Manual</h1>
176 <p>Michael R Sweet</p>
ddf2ec73 177 <p>Copyright &#xa9; 2007-2018 by Apple Inc. All Rights Reserved.</p>
798d6e29
MS
178 <div class="contents">
179 <h2 class="title">Contents</h2>
180 <ul class="contents">
53af7f21
MS
181 <li><a href="#introduction">Introduction</a><ul class="subcontents">
182 <li><a href="#guidelines">Guidelines</a></li>
183 <li><a href="#terms-used-in-this-document">Terms Used in This Document</a></li>
184 <li><a href="#compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></li>
798d6e29 185 </ul></li>
53af7f21
MS
186 <li><a href="#working-with-destinations">Working with Destinations</a><ul class="subcontents">
187 <li><a href="#finding-available-destinations">Finding Available Destinations</a></li>
188 <li><a href="#basic-destination-information">Basic Destination Information</a></li>
189 <li><a href="#detailed-destination-information">Detailed Destination Information</a></li>
190 <li><a href="#submitting-a-print-job">Submitting a Print Job</a></li>
798d6e29 191 </ul></li>
b0fb2d75
MS
192 <li><a href="#sending-ipp-requests">Sending IPP Requests</a><ul class="subcontents">
193 <li><a href="#connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</a></li>
194 <li><a href="#creating-an-ipp-request">Creating an IPP Request</a></li>
195 <li><a href="#sending-the-ipp-request">Sending the IPP Request</a></li>
196 <li><a href="#processing-the-ipp-response">Processing the IPP Response</a></li>
197 <li><a href="#authentication">Authentication</a></li>
198 </ul></li>
798d6e29
MS
199 <li><a href="#FUNCTIONS">Functions</a><ul class="subcontents">
200 <li><a href="#cupsAddDest">cupsAddDest</a></li>
63b75fbe 201 <li><a href="#cupsAddDestMediaOptions">cupsAddDestMediaOptions</a></li>
53af7f21 202 <li><a href="#cupsAddIntegerOption">cupsAddIntegerOption</a></li>
798d6e29 203 <li><a href="#cupsAddOption">cupsAddOption</a></li>
798d6e29 204 <li><a href="#cupsCancelDestJob">cupsCancelDestJob</a></li>
798d6e29
MS
205 <li><a href="#cupsCheckDestSupported">cupsCheckDestSupported</a></li>
206 <li><a href="#cupsCloseDestJob">cupsCloseDestJob</a></li>
207 <li><a href="#cupsConnectDest">cupsConnectDest</a></li>
798d6e29
MS
208 <li><a href="#cupsCopyDest">cupsCopyDest</a></li>
209 <li><a href="#cupsCopyDestConflicts">cupsCopyDestConflicts</a></li>
210 <li><a href="#cupsCopyDestInfo">cupsCopyDestInfo</a></li>
211 <li><a href="#cupsCreateDestJob">cupsCreateDestJob</a></li>
798d6e29 212 <li><a href="#cupsDoAuthentication">cupsDoAuthentication</a></li>
ddf2ec73 213 <li><a href="#cupsEncodeOption">cupsEncodeOption</a></li>
798d6e29
MS
214 <li><a href="#cupsEncodeOptions">cupsEncodeOptions</a></li>
215 <li><a href="#cupsEncodeOptions2">cupsEncodeOptions2</a></li>
216 <li><a href="#cupsEncryption">cupsEncryption</a></li>
217 <li><a href="#cupsEnumDests">cupsEnumDests</a></li>
798d6e29
MS
218 <li><a href="#cupsFindDestDefault">cupsFindDestDefault</a></li>
219 <li><a href="#cupsFindDestReady">cupsFindDestReady</a></li>
220 <li><a href="#cupsFindDestSupported">cupsFindDestSupported</a></li>
221 <li><a href="#cupsFinishDestDocument">cupsFinishDestDocument</a></li>
798d6e29
MS
222 <li><a href="#cupsFreeDestInfo">cupsFreeDestInfo</a></li>
223 <li><a href="#cupsFreeDests">cupsFreeDests</a></li>
224 <li><a href="#cupsFreeJobs">cupsFreeJobs</a></li>
225 <li><a href="#cupsFreeOptions">cupsFreeOptions</a></li>
798d6e29
MS
226 <li><a href="#cupsGetDest">cupsGetDest</a></li>
227 <li><a href="#cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></li>
228 <li><a href="#cupsGetDestMediaByName">cupsGetDestMediaByName</a></li>
229 <li><a href="#cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></li>
230 <li><a href="#cupsGetDestMediaCount">cupsGetDestMediaCount</a></li>
231 <li><a href="#cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></li>
232 <li><a href="#cupsGetDestWithURI">cupsGetDestWithURI</a></li>
98d88c8d 233 <li><a href="#cupsGetDests2">cupsGetDests2</a></li>
53af7f21 234 <li><a href="#cupsGetIntegerOption">cupsGetIntegerOption</a></li>
798d6e29
MS
235 <li><a href="#cupsGetJobs2">cupsGetJobs2</a></li>
236 <li><a href="#cupsGetNamedDest">cupsGetNamedDest</a></li>
237 <li><a href="#cupsGetOption">cupsGetOption</a></li>
798d6e29 238 <li><a href="#cupsGetPassword2">cupsGetPassword2</a></li>
798d6e29
MS
239 <li><a href="#cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></li>
240 <li><a href="#cupsLocalizeDestOption">cupsLocalizeDestOption</a></li>
241 <li><a href="#cupsLocalizeDestValue">cupsLocalizeDestValue</a></li>
242 <li><a href="#cupsMakeServerCredentials">cupsMakeServerCredentials</a></li>
798d6e29 243 <li><a href="#cupsParseOptions">cupsParseOptions</a></li>
798d6e29
MS
244 <li><a href="#cupsRemoveDest">cupsRemoveDest</a></li>
245 <li><a href="#cupsRemoveOption">cupsRemoveOption</a></li>
246 <li><a href="#cupsServer">cupsServer</a></li>
247 <li><a href="#cupsSetClientCertCB">cupsSetClientCertCB</a></li>
248 <li><a href="#cupsSetCredentials">cupsSetCredentials</a></li>
249 <li><a href="#cupsSetDefaultDest">cupsSetDefaultDest</a></li>
798d6e29
MS
250 <li><a href="#cupsSetDests2">cupsSetDests2</a></li>
251 <li><a href="#cupsSetEncryption">cupsSetEncryption</a></li>
798d6e29
MS
252 <li><a href="#cupsSetPasswordCB2">cupsSetPasswordCB2</a></li>
253 <li><a href="#cupsSetServer">cupsSetServer</a></li>
254 <li><a href="#cupsSetServerCertCB">cupsSetServerCertCB</a></li>
255 <li><a href="#cupsSetServerCredentials">cupsSetServerCredentials</a></li>
256 <li><a href="#cupsSetUser">cupsSetUser</a></li>
257 <li><a href="#cupsSetUserAgent">cupsSetUserAgent</a></li>
258 <li><a href="#cupsStartDestDocument">cupsStartDestDocument</a></li>
798d6e29
MS
259 <li><a href="#cupsUser">cupsUser</a></li>
260 <li><a href="#cupsUserAgent">cupsUserAgent</a></li>
261 <li><a href="#httpAcceptConnection">httpAcceptConnection</a></li>
262 <li><a href="#httpAddCredential">httpAddCredential</a></li>
263 <li><a href="#httpAddrAny">httpAddrAny</a></li>
264 <li><a href="#httpAddrClose">httpAddrClose</a></li>
798d6e29
MS
265 <li><a href="#httpAddrConnect2">httpAddrConnect2</a></li>
266 <li><a href="#httpAddrCopyList">httpAddrCopyList</a></li>
267 <li><a href="#httpAddrEqual">httpAddrEqual</a></li>
268 <li><a href="#httpAddrFamily">httpAddrFamily</a></li>
269 <li><a href="#httpAddrFreeList">httpAddrFreeList</a></li>
270 <li><a href="#httpAddrGetList">httpAddrGetList</a></li>
271 <li><a href="#httpAddrLength">httpAddrLength</a></li>
272 <li><a href="#httpAddrListen">httpAddrListen</a></li>
273 <li><a href="#httpAddrLocalhost">httpAddrLocalhost</a></li>
274 <li><a href="#httpAddrLookup">httpAddrLookup</a></li>
275 <li><a href="#httpAddrPort">httpAddrPort</a></li>
276 <li><a href="#httpAddrString">httpAddrString</a></li>
277 <li><a href="#httpAssembleURI">httpAssembleURI</a></li>
278 <li><a href="#httpAssembleURIf">httpAssembleURIf</a></li>
279 <li><a href="#httpAssembleUUID">httpAssembleUUID</a></li>
280 <li><a href="#httpBlocking">httpBlocking</a></li>
281 <li><a href="#httpCheck">httpCheck</a></li>
282 <li><a href="#httpClearCookie">httpClearCookie</a></li>
283 <li><a href="#httpClearFields">httpClearFields</a></li>
284 <li><a href="#httpClose">httpClose</a></li>
285 <li><a href="#httpCompareCredentials">httpCompareCredentials</a></li>
798d6e29 286 <li><a href="#httpConnect2">httpConnect2</a></li>
798d6e29
MS
287 <li><a href="#httpCopyCredentials">httpCopyCredentials</a></li>
288 <li><a href="#httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></li>
289 <li><a href="#httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></li>
290 <li><a href="#httpCredentialsGetTrust">httpCredentialsGetTrust</a></li>
291 <li><a href="#httpCredentialsString">httpCredentialsString</a></li>
798d6e29
MS
292 <li><a href="#httpDecode64_2">httpDecode64_2</a></li>
293 <li><a href="#httpDelete">httpDelete</a></li>
798d6e29
MS
294 <li><a href="#httpEncode64_2">httpEncode64_2</a></li>
295 <li><a href="#httpEncryption">httpEncryption</a></li>
296 <li><a href="#httpError">httpError</a></li>
297 <li><a href="#httpFieldValue">httpFieldValue</a></li>
298 <li><a href="#httpFlush">httpFlush</a></li>
299 <li><a href="#httpFlushWrite">httpFlushWrite</a></li>
300 <li><a href="#httpFreeCredentials">httpFreeCredentials</a></li>
301 <li><a href="#httpGet">httpGet</a></li>
302 <li><a href="#httpGetActivity">httpGetActivity</a></li>
303 <li><a href="#httpGetAddress">httpGetAddress</a></li>
304 <li><a href="#httpGetAuthString">httpGetAuthString</a></li>
305 <li><a href="#httpGetBlocking">httpGetBlocking</a></li>
306 <li><a href="#httpGetContentEncoding">httpGetContentEncoding</a></li>
307 <li><a href="#httpGetCookie">httpGetCookie</a></li>
798d6e29
MS
308 <li><a href="#httpGetDateString2">httpGetDateString2</a></li>
309 <li><a href="#httpGetDateTime">httpGetDateTime</a></li>
310 <li><a href="#httpGetEncryption">httpGetEncryption</a></li>
311 <li><a href="#httpGetExpect">httpGetExpect</a></li>
312 <li><a href="#httpGetFd">httpGetFd</a></li>
313 <li><a href="#httpGetField">httpGetField</a></li>
798d6e29
MS
314 <li><a href="#httpGetHostname">httpGetHostname</a></li>
315 <li><a href="#httpGetKeepAlive">httpGetKeepAlive</a></li>
798d6e29
MS
316 <li><a href="#httpGetLength2">httpGetLength2</a></li>
317 <li><a href="#httpGetPending">httpGetPending</a></li>
318 <li><a href="#httpGetReady">httpGetReady</a></li>
319 <li><a href="#httpGetRemaining">httpGetRemaining</a></li>
320 <li><a href="#httpGetState">httpGetState</a></li>
321 <li><a href="#httpGetStatus">httpGetStatus</a></li>
798d6e29
MS
322 <li><a href="#httpGetSubField2">httpGetSubField2</a></li>
323 <li><a href="#httpGetVersion">httpGetVersion</a></li>
324 <li><a href="#httpGets">httpGets</a></li>
325 <li><a href="#httpHead">httpHead</a></li>
326 <li><a href="#httpInitialize">httpInitialize</a></li>
327 <li><a href="#httpIsChunked">httpIsChunked</a></li>
328 <li><a href="#httpIsEncrypted">httpIsEncrypted</a></li>
329 <li><a href="#httpLoadCredentials">httpLoadCredentials</a></li>
330 <li><a href="#httpOptions">httpOptions</a></li>
331 <li><a href="#httpPeek">httpPeek</a></li>
332 <li><a href="#httpPost">httpPost</a></li>
333 <li><a href="#httpPut">httpPut</a></li>
798d6e29
MS
334 <li><a href="#httpRead2">httpRead2</a></li>
335 <li><a href="#httpReadRequest">httpReadRequest</a></li>
798d6e29
MS
336 <li><a href="#httpReconnect2">httpReconnect2</a></li>
337 <li><a href="#httpResolveHostname">httpResolveHostname</a></li>
338 <li><a href="#httpSaveCredentials">httpSaveCredentials</a></li>
798d6e29
MS
339 <li><a href="#httpSeparateURI">httpSeparateURI</a></li>
340 <li><a href="#httpSetAuthString">httpSetAuthString</a></li>
341 <li><a href="#httpSetCookie">httpSetCookie</a></li>
342 <li><a href="#httpSetCredentials">httpSetCredentials</a></li>
343 <li><a href="#httpSetDefaultField">httpSetDefaultField</a></li>
344 <li><a href="#httpSetExpect">httpSetExpect</a></li>
345 <li><a href="#httpSetField">httpSetField</a></li>
346 <li><a href="#httpSetKeepAlive">httpSetKeepAlive</a></li>
347 <li><a href="#httpSetLength">httpSetLength</a></li>
348 <li><a href="#httpSetTimeout">httpSetTimeout</a></li>
349 <li><a href="#httpShutdown">httpShutdown</a></li>
350 <li><a href="#httpStateString">httpStateString</a></li>
351 <li><a href="#httpStatus">httpStatus</a></li>
798d6e29
MS
352 <li><a href="#httpURIStatusString">httpURIStatusString</a></li>
353 <li><a href="#httpUpdate">httpUpdate</a></li>
354 <li><a href="#httpWait">httpWait</a></li>
798d6e29
MS
355 <li><a href="#httpWrite2">httpWrite2</a></li>
356 <li><a href="#httpWriteResponse">httpWriteResponse</a></li>
357 <li><a href="#ippAddBoolean">ippAddBoolean</a></li>
358 <li><a href="#ippAddBooleans">ippAddBooleans</a></li>
359 <li><a href="#ippAddCollection">ippAddCollection</a></li>
360 <li><a href="#ippAddCollections">ippAddCollections</a></li>
361 <li><a href="#ippAddDate">ippAddDate</a></li>
362 <li><a href="#ippAddInteger">ippAddInteger</a></li>
363 <li><a href="#ippAddIntegers">ippAddIntegers</a></li>
364 <li><a href="#ippAddOctetString">ippAddOctetString</a></li>
365 <li><a href="#ippAddOutOfBand">ippAddOutOfBand</a></li>
366 <li><a href="#ippAddRange">ippAddRange</a></li>
367 <li><a href="#ippAddRanges">ippAddRanges</a></li>
368 <li><a href="#ippAddResolution">ippAddResolution</a></li>
369 <li><a href="#ippAddResolutions">ippAddResolutions</a></li>
370 <li><a href="#ippAddSeparator">ippAddSeparator</a></li>
371 <li><a href="#ippAddString">ippAddString</a></li>
372 <li><a href="#ippAddStringf">ippAddStringf</a></li>
373 <li><a href="#ippAddStringfv">ippAddStringfv</a></li>
374 <li><a href="#ippAddStrings">ippAddStrings</a></li>
375 <li><a href="#ippAttributeString">ippAttributeString</a></li>
376 <li><a href="#ippContainsInteger">ippContainsInteger</a></li>
377 <li><a href="#ippContainsString">ippContainsString</a></li>
378 <li><a href="#ippCopyAttribute">ippCopyAttribute</a></li>
379 <li><a href="#ippCopyAttributes">ippCopyAttributes</a></li>
380 <li><a href="#ippCreateRequestedArray">ippCreateRequestedArray</a></li>
381 <li><a href="#ippDateToTime">ippDateToTime</a></li>
382 <li><a href="#ippDelete">ippDelete</a></li>
383 <li><a href="#ippDeleteAttribute">ippDeleteAttribute</a></li>
384 <li><a href="#ippDeleteValues">ippDeleteValues</a></li>
385 <li><a href="#ippEnumString">ippEnumString</a></li>
386 <li><a href="#ippEnumValue">ippEnumValue</a></li>
387 <li><a href="#ippErrorString">ippErrorString</a></li>
388 <li><a href="#ippErrorValue">ippErrorValue</a></li>
389 <li><a href="#ippFindAttribute">ippFindAttribute</a></li>
390 <li><a href="#ippFindNextAttribute">ippFindNextAttribute</a></li>
391 <li><a href="#ippFirstAttribute">ippFirstAttribute</a></li>
392 <li><a href="#ippGetBoolean">ippGetBoolean</a></li>
393 <li><a href="#ippGetCollection">ippGetCollection</a></li>
394 <li><a href="#ippGetCount">ippGetCount</a></li>
395 <li><a href="#ippGetDate">ippGetDate</a></li>
396 <li><a href="#ippGetGroupTag">ippGetGroupTag</a></li>
397 <li><a href="#ippGetInteger">ippGetInteger</a></li>
398 <li><a href="#ippGetName">ippGetName</a></li>
399 <li><a href="#ippGetOctetString">ippGetOctetString</a></li>
400 <li><a href="#ippGetOperation">ippGetOperation</a></li>
401 <li><a href="#ippGetRange">ippGetRange</a></li>
402 <li><a href="#ippGetRequestId">ippGetRequestId</a></li>
403 <li><a href="#ippGetResolution">ippGetResolution</a></li>
404 <li><a href="#ippGetState">ippGetState</a></li>
405 <li><a href="#ippGetStatusCode">ippGetStatusCode</a></li>
406 <li><a href="#ippGetString">ippGetString</a></li>
407 <li><a href="#ippGetValueTag">ippGetValueTag</a></li>
408 <li><a href="#ippGetVersion">ippGetVersion</a></li>
409 <li><a href="#ippLength">ippLength</a></li>
410 <li><a href="#ippNew">ippNew</a></li>
411 <li><a href="#ippNewRequest">ippNewRequest</a></li>
412 <li><a href="#ippNewResponse">ippNewResponse</a></li>
413 <li><a href="#ippNextAttribute">ippNextAttribute</a></li>
414 <li><a href="#ippOpString">ippOpString</a></li>
415 <li><a href="#ippOpValue">ippOpValue</a></li>
416 <li><a href="#ippPort">ippPort</a></li>
417 <li><a href="#ippRead">ippRead</a></li>
418 <li><a href="#ippReadFile">ippReadFile</a></li>
419 <li><a href="#ippReadIO">ippReadIO</a></li>
420 <li><a href="#ippSetBoolean">ippSetBoolean</a></li>
421 <li><a href="#ippSetCollection">ippSetCollection</a></li>
422 <li><a href="#ippSetDate">ippSetDate</a></li>
423 <li><a href="#ippSetGroupTag">ippSetGroupTag</a></li>
424 <li><a href="#ippSetInteger">ippSetInteger</a></li>
425 <li><a href="#ippSetName">ippSetName</a></li>
426 <li><a href="#ippSetOctetString">ippSetOctetString</a></li>
427 <li><a href="#ippSetOperation">ippSetOperation</a></li>
428 <li><a href="#ippSetPort">ippSetPort</a></li>
429 <li><a href="#ippSetRange">ippSetRange</a></li>
430 <li><a href="#ippSetRequestId">ippSetRequestId</a></li>
431 <li><a href="#ippSetResolution">ippSetResolution</a></li>
432 <li><a href="#ippSetState">ippSetState</a></li>
433 <li><a href="#ippSetStatusCode">ippSetStatusCode</a></li>
434 <li><a href="#ippSetString">ippSetString</a></li>
435 <li><a href="#ippSetStringf">ippSetStringf</a></li>
436 <li><a href="#ippSetStringfv">ippSetStringfv</a></li>
437 <li><a href="#ippSetValueTag">ippSetValueTag</a></li>
438 <li><a href="#ippSetVersion">ippSetVersion</a></li>
439 <li><a href="#ippStateString">ippStateString</a></li>
440 <li><a href="#ippTagString">ippTagString</a></li>
441 <li><a href="#ippTagValue">ippTagValue</a></li>
442 <li><a href="#ippTimeToDate">ippTimeToDate</a></li>
443 <li><a href="#ippValidateAttribute">ippValidateAttribute</a></li>
444 <li><a href="#ippValidateAttributes">ippValidateAttributes</a></li>
445 <li><a href="#ippWrite">ippWrite</a></li>
446 <li><a href="#ippWriteFile">ippWriteFile</a></li>
447 <li><a href="#ippWriteIO">ippWriteIO</a></li>
798d6e29
MS
448 </ul></li>
449 <li><a href="#TYPES">Data Types</a><ul class="subcontents">
798d6e29 450 <li><a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a></li>
798d6e29
MS
451 <li><a href="#cups_dest_cb_t">cups_dest_cb_t</a></li>
452 <li><a href="#cups_dest_t">cups_dest_t</a></li>
453 <li><a href="#cups_dinfo_t">cups_dinfo_t</a></li>
798d6e29 454 <li><a href="#cups_job_t">cups_job_t</a></li>
798d6e29
MS
455 <li><a href="#cups_option_t">cups_option_t</a></li>
456 <li><a href="#cups_password_cb2_t">cups_password_cb2_t</a></li>
798d6e29
MS
457 <li><a href="#cups_ptype_t">cups_ptype_t</a></li>
458 <li><a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a></li>
459 <li><a href="#cups_size_t">cups_size_t</a></li>
798d6e29 460 <li><a href="#http_addr_t">http_addr_t</a></li>
798d6e29
MS
461 <li><a href="#http_encoding_t">http_encoding_t</a></li>
462 <li><a href="#http_encryption_t">http_encryption_t</a></li>
463 <li><a href="#http_field_t">http_field_t</a></li>
464 <li><a href="#http_keepalive_t">http_keepalive_t</a></li>
465 <li><a href="#http_state_t">http_state_t</a></li>
466 <li><a href="#http_t">http_t</a></li>
467 <li><a href="#http_timeout_cb_t">http_timeout_cb_t</a></li>
468 <li><a href="#http_trust_t">http_trust_t</a></li>
469 <li><a href="#http_uri_coding_t">http_uri_coding_t</a></li>
470 <li><a href="#http_uri_status_t">http_uri_status_t</a></li>
798d6e29
MS
471 <li><a href="#ipp_attribute_t">ipp_attribute_t</a></li>
472 <li><a href="#ipp_copycb_t">ipp_copycb_t</a></li>
798d6e29 473 <li><a href="#ipp_iocb_t">ipp_iocb_t</a></li>
798d6e29
MS
474 <li><a href="#ipp_orient_t">ipp_orient_t</a></li>
475 <li><a href="#ipp_pstate_t">ipp_pstate_t</a></li>
476 <li><a href="#ipp_quality_t">ipp_quality_t</a></li>
477 <li><a href="#ipp_res_t">ipp_res_t</a></li>
478 <li><a href="#ipp_state_t">ipp_state_t</a></li>
479 <li><a href="#ipp_t">ipp_t</a></li>
798d6e29
MS
480 </ul></li>
481 <li><a href="#STRUCTURES">Structures</a><ul class="subcontents">
798d6e29
MS
482 <li><a href="#cups_dest_s">cups_dest_s</a></li>
483 <li><a href="#cups_job_s">cups_job_s</a></li>
798d6e29
MS
484 <li><a href="#cups_option_s">cups_option_s</a></li>
485 <li><a href="#cups_size_s">cups_size_s</a></li>
798d6e29 486 </ul></li>
798d6e29 487 <li><a href="#ENUMERATIONS">Enumerations</a><ul class="subcontents">
798d6e29 488 <li><a href="#cups_ptype_e">cups_ptype_e</a></li>
798d6e29
MS
489 <li><a href="#http_encoding_e">http_encoding_e</a></li>
490 <li><a href="#http_encryption_e">http_encryption_e</a></li>
491 <li><a href="#http_field_e">http_field_e</a></li>
492 <li><a href="#http_keepalive_e">http_keepalive_e</a></li>
493 <li><a href="#http_state_e">http_state_e</a></li>
494 <li><a href="#http_status_e">http_status_e</a></li>
495 <li><a href="#http_trust_e">http_trust_e</a></li>
496 <li><a href="#http_uri_coding_e">http_uri_coding_e</a></li>
497 <li><a href="#http_uri_status_e">http_uri_status_e</a></li>
798d6e29 498 <li><a href="#ipp_finishings_e">ipp_finishings_e</a></li>
798d6e29
MS
499 <li><a href="#ipp_jstate_e">ipp_jstate_e</a></li>
500 <li><a href="#ipp_op_e">ipp_op_e</a></li>
501 <li><a href="#ipp_orient_e">ipp_orient_e</a></li>
502 <li><a href="#ipp_pstate_e">ipp_pstate_e</a></li>
503 <li><a href="#ipp_quality_e">ipp_quality_e</a></li>
504 <li><a href="#ipp_res_e">ipp_res_e</a></li>
505 <li><a href="#ipp_state_e">ipp_state_e</a></li>
506 <li><a href="#ipp_status_e">ipp_status_e</a></li>
507 <li><a href="#ipp_tag_e">ipp_tag_e</a></li>
508 </ul></li>
509 </ul>
510 </div>
511 <div class="body">
512 <blockquote>
1da024d1 513 <p>Please <a href="https://github.com/apple/cups/issues">file issues on Github</a> to provide feedback on this document.</p>
798d6e29 514</blockquote>
53af7f21 515 <h2><a id="introduction">Introduction</a></h2>
798d6e29
MS
516 <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>
517 <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 518 <h3><a id="guidelines">Guidelines</a></h3>
798d6e29
MS
519 <p>When writing software that uses the &quot;cups&quot; library:</p>
520 <ul>
521 <li>Do not use undocumented or deprecated APIs,</li>
522 <li>Do not rely on pre-configured printers,</li>
523 <li>Do not assume that printers support specific features or formats, and</li>
524 <li>Do not rely on implementation details (PPDs, etc.)</li>
525</ul>
526 <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>
527 <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 528 <h3><a id="terms-used-in-this-document">Terms Used in This Document</a></h3>
9c44e2cb 529 <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 530 <h3><a id="compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></h3>
798d6e29
MS
531 <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>
532 <p>The following simple program lists the available destinations:</p>
533 <pre><code>#include &lt;stdio.h&gt;
534#include &lt;cups/cups.h&gt;
535
536int print_dest(void *user_data, unsigned flags, cups_dest_t *dest)
537{
538 if (dest-&gt;instance)
539 printf(&quot;%s/%s\n&quot;, dest-&gt;name, dest-&gt;instance);
540 else
541 puts(dest-&gt;name);
542
543 return (1);
544}
545
546int main(void)
547{
548 cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, 0, 0, print_dest, NULL);
549
550 return (0);
551}
552</code></pre>
53af7f21 553 <h4><a id="compiling-with-xcode">Compiling with Xcode</a></h4>
9c44e2cb
MS
554 <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>
555 <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 556 <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 557 <h4><a id="compiling-with-gcc">Compiling with GCC</a></h4>
798d6e29
MS
558 <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>
559 <pre><code>gcc -o simple `cups-config --cflags` simple.c `cups-config --libs`
560./simple
561</code></pre>
9c44e2cb 562 <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 563 <h2><a id="working-with-destinations">Working with Destinations</a></h2>
9c44e2cb 564 <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 565 <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 566 <h3><a id="finding-available-destinations">Finding Available Destinations</a></h3>
798d6e29
MS
567 <p>The <code>cupsEnumDests</code> function finds all of the available destinations:</p>
568 <pre><code> int
569 cupsEnumDests(unsigned flags, int msec, int *cancel,
570 cups_ptype_t type, cups_ptype_t mask,
571 cups_dest_cb_t cb, void *user_data)
572</code></pre>
573 <p>The <code>flags</code> argument specifies enumeration options, which at present must be <code>CUPS_DEST_FLAGS_NONE</code>.</p>
574 <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>
575 <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 576 <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
577 <ul>
578 <li><code>CUPS_PRINTER_CLASS</code>: A collection of destinations.</li>
579 <li><code>CUPS_PRINTER_FAX</code>: A facsimile device.</li>
53af7f21
MS
580 <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>
581 <li><code>CUPS_PRINTER_REMOTE</code>: A remote (shared) printer or class.</li>
582 <li><code>CUPS_PRINTER_DISCOVERED</code>: An available network printer or class.</li>
798d6e29
MS
583 <li><code>CUPS_PRINTER_BW</code>: Can do B&amp;W printing.</li>
584 <li><code>CUPS_PRINTER_COLOR</code>: Can do color printing.</li>
585 <li><code>CUPS_PRINTER_DUPLEX</code>: Can do two-sided printing.</li>
586 <li><code>CUPS_PRINTER_STAPLE</code>: Can staple output.</li>
587 <li><code>CUPS_PRINTER_COLLATE</code>: Can quickly collate copies.</li>
588 <li><code>CUPS_PRINTER_PUNCH</code>: Can punch output.</li>
589 <li><code>CUPS_PRINTER_COVER</code>: Can cover output.</li>
590 <li><code>CUPS_PRINTER_BIND</code>: Can bind output.</li>
591 <li><code>CUPS_PRINTER_SORT</code>: Can sort output (mailboxes, etc.)</li>
592 <li><code>CUPS_PRINTER_SMALL</code>: Can print on Letter/Legal/A4-size media.</li>
593 <li><code>CUPS_PRINTER_MEDIUM</code>: Can print on Tabloid/B/C/A3/A2-size media.</li>
594 <li><code>CUPS_PRINTER_LARGE</code>: Can print on D/E/A1/A0-size media.</li>
595 <li><code>CUPS_PRINTER_VARIABLE</code>: Can print on rolls and custom-size media.</li>
596</ul>
597 <p>The <code>cb</code> argument specifies a function to call for every destination that is found:</p>
598 <pre><code>typedef int (*cups_dest_cb_t)(void *user_data,
599 unsigned flags,
600 cups_dest_t *dest);
601</code></pre>
9c44e2cb 602 <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
603 <ul>
604 <li><code>CUPS_DEST_FLAGS_MORE</code>: There are more destinations coming.</li>
605 <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>
606 <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>
607</ul>
608 <p>The callback function returns 0 to stop enumeration or 1 to continue.</p>
718ee2ff
MS
609 <blockquote>
610 <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>
611</blockquote>
798d6e29
MS
612 <p>The following example shows how to use <code>cupsEnumDests</code> to get a filtered array of destinations:</p>
613 <pre><code>typedef struct
614{
615 int num_dests;
616 cups_dest_t *dests;
617} my_user_data_t;
618
619int
620my_dest_cb(my_user_data_t *user_data, unsigned flags,
621 cups_dest_t *dest)
622{
623 if (flags &amp; CUPS_DEST_FLAGS_REMOVED)
624 {
625 /*
626 * Remove destination from array...
627 */
628
629 user_data-&gt;num_dests =
630 cupsRemoveDest(dest-&gt;name, dest-&gt;instance,
631 user_data-&gt;num_dests,
632 &amp;(user_data-&gt;dests));
633 }
634 else
635 {
636 /*
637 * Add destination to array...
638 */
639
640 user_data-&gt;num_dests =
641 cupsCopyDest(dest, user_data-&gt;num_dests,
642 &amp;(user_data-&gt;dests));
643 }
644
645 return (1);
646}
647
648int
649my_get_dests(cups_ptype_t type, cups_ptype_t mask,
650 cups_dest_t **dests)
651{
652 my_user_data_t user_data = { 0, NULL };
653
654 if (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, type,
655 mask, (cups_dest_cb_t)my_dest_cb,
656 &amp;user_data))
657 {
658 /*
659 * An error occurred, free all of the destinations and
660 * return...
661 */
662
663 cupsFreeDests(user_data.num_dests, user_dasta.dests);
664
665 *dests = NULL;
666
667 return (0);
668 }
669
670 /*
671 * Return the destination array...
672 */
673
674 *dests = user_data.dests;
675
676 return (user_data.num_dests);
677}
678</code></pre>
53af7f21 679 <h3><a id="basic-destination-information">Basic Destination Information</a></h3>
798d6e29
MS
680 <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>
681 <ul>
682 <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>
683 <li>&quot;printer-info&quot;: The human-readable description of the destination such as &quot;My Laser Printer&quot;.</li>
684 <li>&quot;printer-is-accepting-jobs&quot;: &quot;true&quot; if the destination is accepting new jobs, &quot;false&quot; otherwise.</li>
685 <li>&quot;printer-is-shared&quot;: &quot;true&quot; if the destination is being shared with other computers, &quot;false&quot; otherwise.</li>
686 <li>&quot;printer-location&quot;: The human-readable location of the destination such as &quot;Lab 4&quot;.</li>
687 <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>
688 <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>
689 <li>&quot;printer-state-change-time&quot;: The UNIX time when the destination entered the current state.</li>
690 <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>
691 <li>&quot;printer-type&quot;: The <code>cups_ptype_t</code> value associated with the destination.</li>
53af7f21 692 <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
693</ul>
694 <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>
695 <pre><code>const char *model = cupsGetOption(&quot;printer-make-and-model&quot;,
696 dest-&gt;num_options,
697 dest-&gt;options);
698</code></pre>
53af7f21 699 <h3><a id="detailed-destination-information">Detailed Destination Information</a></h3>
798d6e29
MS
700 <p>Once a destination has been chosen, the <code>cupsCopyDestInfo</code> function can be used to gather detailed information about the destination:</p>
701 <pre><code>cups_dinfo_t *
702cupsCopyDestInfo(http_t *http, cups_dest_t *dest);
703</code></pre>
704 <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>
705 <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 706 <h4><a id="getting-supported-options-and-values">Getting Supported Options and Values</a></h4>
798d6e29
MS
707 <p>The <code>cupsCheckDestSupported</code> function can be used to test whether a particular option or option and value is supported:</p>
708 <pre><code>int
709cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
710 cups_dinfo_t *info,
711 const char *option,
712 const char *value);
713</code></pre>
714 <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>
715 <ul>
716 <li><code>CUPS_COPIES</code>: Controls the number of copies that are produced.</li>
717 <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>
718 <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>
719 <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>
720 <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>
721 <li><code>CUPS_NUMBER_UP</code>: Controls the number of document pages that are placed on each media side.</li>
722 <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 723 <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
724 <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>
725 <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>
726</ul>
727 <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>
728 <p>The <code>cupsFindDestSupported</code> function returns the IPP attribute containing the supported values for a given option:</p>
729 <pre><code> ipp_attribute_t *
730 cupsFindDestSupported(http_t *http, cups_dest_t *dest,
731 cups_dinfo_t *dinfo,
732 const char *option);
733</code></pre>
734 <p>For example, the following code prints the supported finishing processes for a destination, if any, to the standard output:</p>
735 <pre><code>cups_dinfo_t *info = cupsCopyDestInfo(CUPS_HTTP_DEFAULT,
736 dest);
737
738if (cupsCheckDestSupported(CUPS_HTTP_DEFAULT, dest, info,
739 CUPS_FINISHINGS, NULL))
740{
741 ipp_attribute_t *finishings =
742 cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
743 CUPS_FINISHINGS);
744 int i, count = ippGetCount(finishings);
745
746 puts(&quot;finishings supported:&quot;);
747 for (i = 0; i &lt; count; i ++)
748 printf(&quot; %d\n&quot;, ippGetInteger(finishings, i));
749}
750else
751 puts(&quot;finishings not supported.&quot;);
752</code></pre>
753 <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>
754 <pre><code>ipp_attribute_t *attrs =
755 cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
756 &quot;job-creation-attributes&quot;);
757int i, count = ippGetCount(attrs);
758
759for (i = 0; i &lt; count; i ++)
760 puts(ippGetString(attrs, i, NULL));
761</code></pre>
53af7f21 762 <h4><a id="getting-default-values">Getting Default Values</a></h4>
798d6e29
MS
763 <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>
764 <pre><code>ipp_attribute_t *
765cupsFindDestDefault(http_t *http, cups_dest_t *dest,
766 cups_dinfo_t *dinfo,
767 const char *option);
768</code></pre>
769 <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>
770 <pre><code>const char *def_value =
771 cupsGetOption(CUPS_FINISHINGS, dest-&gt;num_options,
772 dest-&gt;options);
773ipp_attribute_t *def_attr =
774 cupsFindDestDefault(CUPS_HTTP_DEFAULT, dest, info,
775 CUPS_FINISHINGS);
776
777if (def_value != NULL)
778{
779 printf(&quot;Default finishings: %s\n&quot;, def_value);
780}
781else
782{
783 int i, count = ippGetCount(def_attr);
784
785 printf(&quot;Default finishings: %d&quot;,
786 ippGetInteger(def_attr, 0));
787 for (i = 1; i &lt; count; i ++)
788 printf(&quot;,%d&quot;, ippGetInteger(def_attr, i));
789 putchar('\n');
790}
791</code></pre>
53af7f21 792 <h4><a id="getting-ready-loaded-values">Getting Ready (Loaded) Values</a></h4>
798d6e29
MS
793 <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>
794 <p>The <code>cupsFindDestReady</code> function finds the IPP attribute containing the ready values for a given option:</p>
795 <pre><code>ipp_attribute_t *
796cupsFindDestReady(http_t *http, cups_dest_t *dest,
797 cups_dinfo_t *dinfo, const char *option);
798</code></pre>
799 <p>For example, the following code lists the ready finishing processes:</p>
800 <pre><code>ipp_attribute_t *ready_finishings =
801 cupsFindDestReady(CUPS_HTTP_DEFAULT, dest, info,
802 CUPS_FINISHINGS);
803
804if (ready_finishings != NULL)
805{
806 int i, count = ippGetCount(ready_finishings);
807
808 puts(&quot;finishings ready:&quot;);
809 for (i = 0; i &lt; count; i ++)
810 printf(&quot; %d\n&quot;, ippGetInteger(ready_finishings, i));
811}
812else
813 puts(&quot;no finishings are ready.&quot;);
814</code></pre>
53af7f21 815 <h4><a id="media-size-options">Media Size Options</a></h4>
798d6e29
MS
816 <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>
817 <pre><code>typedef struct cups_size_s
818{
819 char media[128];
820 int width, length;
821 int bottom, left, right, top;
822} cups_size_t;
823</code></pre>
824 <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>
825 <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>
826 <pre><code>int
827cupsGetDestMediaByName(http_t *http, cups_dest_t *dest,
828 cups_dinfo_t *dinfo,
829 const char *media,
830 unsigned flags, cups_size_t *size);
831
832int
833cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest,
834 cups_dinfo_t *dinfo,
835 int width, int length,
836 unsigned flags, cups_size_t *size);
837</code></pre>
838 <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>
839 <ul>
840 <li><code>CUPS_MEDIA_FLAGS_DEFAULT</code>: Find the closest size supported by the printer.</li>
841 <li><code>CUPS_MEDIA_FLAGS_BORDERLESS</code>: Find a borderless size.</li>
842 <li><code>CUPS_MEDIA_FLAGS_DUPLEX</code>: Find a size compatible with two-sided printing.</li>
843 <li><code>CUPS_MEDIA_FLAGS_EXACT</code>: Find an exact match for the size.</li>
844 <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>
845</ul>
846 <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>
847 <p>For example, the following code prints the margins for two-sided printing on US Letter media:</p>
848 <pre><code>cups_size_t size;
849
850if (cupsGetDestMediaByName(CUPS_HTTP_DEFAULT, dest, info,
851 CUPS_MEDIA_LETTER,
852 CUPS_MEDIA_FLAGS_DUPLEX, &amp;size))
853{
854 puts(&quot;Margins for duplex US Letter:&quot;);
855 printf(&quot; Bottom: %.2fin\n&quot;, size.bottom / 2540.0);
856 printf(&quot; Left: %.2fin\n&quot;, size.left / 2540.0);
857 printf(&quot; Right: %.2fin\n&quot;, size.right / 2540.0);
858 printf(&quot; Top: %.2fin\n&quot;, size.top / 2540.0);
859}
860else
861 puts(&quot;Margins for duplex US Letter are not available.&quot;);
862</code></pre>
863 <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>
864 <pre><code>int
865cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest,
866 cups_dinfo_t *dinfo, int n,
867 unsigned flags, cups_size_t *size);
868
869int
870cupsGetDestMediaCount(http_t *http, cups_dest_t *dest,
871 cups_dinfo_t *dinfo, unsigned flags);
872</code></pre>
873 <p>For example, the following code prints the list of ready media and corresponding margins:</p>
874 <pre><code>cups_size_t size;
875int i;
876int count = cupsGetDestMediaCount(CUPS_HTTP_DEFAULT,
877 dest, info,
878 CUPS_MEDIA_FLAGS_READY);
879
880for (i = 0; i &lt; count; i ++)
881{
882 if (cupsGetDestMediaByIndex(CUPS_HTTP_DEFAULT, dest, info,
883 i, CUPS_MEDIA_FLAGS_READY,
884 &amp;size))
885 {
886 printf(&quot;%s:\n&quot;, size.name);
887 printf(&quot; Width: %.2fin\n&quot;, size.width / 2540.0);
888 printf(&quot; Length: %.2fin\n&quot;, size.length / 2540.0);
889 printf(&quot; Bottom: %.2fin\n&quot;, size.bottom / 2540.0);
890 printf(&quot; Left: %.2fin\n&quot;, size.left / 2540.0);
891 printf(&quot; Right: %.2fin\n&quot;, size.right / 2540.0);
892 printf(&quot; Top: %.2fin\n&quot;, size.top / 2540.0);
893 }
894}
895</code></pre>
896 <p>Finally, the <code>cupsGetDestMediaDefault</code> function returns the default media size:</p>
897 <pre><code>int
898cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
899 cups_dinfo_t *dinfo, unsigned flags,
900 cups_size_t *size);
901</code></pre>
53af7f21 902 <h4><a id="localizing-options-and-values">Localizing Options and Values</a></h4>
6ad44eeb 903 <p>CUPS provides three functions to get localized, human-readable strings in the user's current locale for options and values: <code>cupsLocalizeDestMedia</code>, <code>cupsLocalizeDestOption</code>, and <code>cupsLocalizeDestValue</code>:</p>
798d6e29
MS
904 <pre><code>const char *
905cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest,
906 cups_dinfo_t *info, unsigned flags,
907 cups_size_t *size);
908
909const char *
910cupsLocalizeDestOption(http_t *http, cups_dest_t *dest,
911 cups_dinfo_t *info,
912 const char *option);
913
914const char *
915cupsLocalizeDestValue(http_t *http, cups_dest_t *dest,
916 cups_dinfo_t *info,
917 const char *option, const char *value);
918</code></pre>
53af7f21 919 <h3><a id="submitting-a-print-job">Submitting a Print Job</a></h3>
798d6e29
MS
920 <p>Once you are ready to submit a print job, you create a job using the <code>cupsCreateDestJob</code> function:</p>
921 <pre><code>ipp_status_t
922cupsCreateDestJob(http_t *http, cups_dest_t *dest,
923 cups_dinfo_t *info, int *job_id,
924 const char *title, int num_options,
925 cups_option_t *options);
926</code></pre>
927 <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>
928 <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>
929 <p>For example, the following code creates a new job that will print 42 copies of a two-sided US Letter document:</p>
930 <pre><code>int job_id = 0;
931int num_options = 0;
932cups_option_t *options = NULL;
933
934num_options = cupsAddOption(CUPS_COPIES, &quot;42&quot;,
935 num_options, &amp;options);
936num_options = cupsAddOption(CUPS_MEDIA, CUPS_MEDIA_LETTER,
937 num_options, &amp;options);
938num_options = cupsAddOption(CUPS_SIDES,
939 CUPS_SIDES_TWO_SIDED_PORTRAIT,
940 num_options, &amp;options);
941
942if (cupsCreateDestJob(CUPS_HTTP_DEFAULT, dest, info,
943 &amp;job_id, &quot;My Document&quot;, num_options,
944 options) == IPP_STATUS_OK)
945 printf(&quot;Created job: %d\n&quot;, job_id);
946else
947 printf(&quot;Unable to create job: %s\n&quot;,
948 cupsLastErrorString());
949</code></pre>
950 <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>
951 <pre><code>http_status_t
952cupsStartDestDocument(http_t *http, cups_dest_t *dest,
953 cups_dinfo_t *info, int job_id,
954 const char *docname,
955 const char *format,
956 int num_options,
957 cups_option_t *options,
958 int last_document);
959
960http_status_t
961cupsWriteRequestData(http_t *http, const char *buffer,
962 size_t length);
963
964ipp_status_t
965cupsFinishDestDocument(http_t *http, cups_dest_t *dest,
966 cups_dinfo_t *info);
967</code></pre>
968 <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>
969 <ul>
970 <li><code>CUPS_FORMAT_JPEG</code>: &quot;image/jpeg&quot;</li>
971 <li><code>CUPS_FORMAT_PDF</code>: &quot;application/pdf&quot;</li>
972 <li><code>CUPS_FORMAT_POSTSCRIPT</code>: &quot;application/postscript&quot;</li>
973 <li><code>CUPS_FORMAT_TEXT</code>: &quot;text/plain&quot;</li>
974</ul>
975 <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>
976 <p>For example, the following code submits a PDF file to the job that was just created:</p>
977 <pre><code>FILE *fp = fopen(&quot;filename.pdf&quot;, &quot;rb&quot;);
978size_t bytes;
979char buffer[65536];
980
981if (cupsStartDestDocument(CUPS_HTTP_DEFAULT, dest, info,
982 job_id, &quot;filename.pdf&quot;, 0, NULL,
983 1) == HTTP_STATUS_CONTINUE)
984{
985 while ((bytes = fread(buffer, 1, sizeof(buffer), fp)) &gt; 0)
986 if (cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer,
987 bytes) != HTTP_STATUS_CONTINUE)
988 break;
989
990 if (cupsFinishDestDocument(CUPS_HTTP_DEFAULT, dest,
991 info) == IPP_STATUS_OK)
992 puts(&quot;Document send succeeded.&quot;);
993 else
994 printf(&quot;Document send failed: %s\n&quot;,
995 cupsLastErrorString());
996}
997
998fclose(fp);
999</code></pre>
b0fb2d75
MS
1000 <h2><a id="sending-ipp-requests">Sending IPP Requests</a></h2>
1001 <p>CUPS provides a rich API for sending IPP requests to the scheduler or printers, typically from management or utility applications whose primary purpose is not to send print jobs.</p>
1002 <h3><a id="connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</a></h3>
1003 <p>The connection to the scheduler or printer is represented by the HTTP connection type <code>http_t</code>. The <code>cupsConnectDest</code> function connects to the scheduler or printer associated with the destination:</p>
1004 <pre><code>http_t *
1005cupsConnectDest(cups_dest_t *dest, unsigned flags, int msec,
1006 int *cancel, char *resource,
1007 size_t resourcesize, cups_dest_cb_t cb,
1008 void *user_data);
1009</code></pre>
1010 <p>The <code>dest</code> argument specifies the destination to connect to.</p>
1011 <p>The <code>flags</code> argument specifies whether you want to connect to the scheduler (<code>CUPS_DEST_FLAGS_NONE</code>) or device/printer (<code>CUPS_DEST_FLAGS_DEVICE</code>) associated with the destination.</p>
1012 <p>The <code>msec</code> argument specifies how long you are willing to wait for the connection to be established in milliseconds. Specify a value of <code>-1</code> to wait indefinitely.</p>
1013 <p>The <code>cancel</code> argument specifies the address of an integer variable that can be set to a non-zero value to cancel the connection. Specify a value of <code>NULL</code> to not provide a cancel variable.</p>
1014 <p>The <code>resource</code> and <code>resourcesize</code> arguments specify the address and size of a character string array to hold the path to use when sending an IPP request.</p>
1015 <p>The <code>cb</code> and <code>user_data</code> arguments specify a destination callback function that returns 1 to continue connecting or 0 to stop. The destination callback work the same way as the one used for the <code>cupsEnumDests</code> function.</p>
1016 <p>On success, a HTTP connection is returned that can be used to send IPP requests and get IPP responses.</p>
1017 <p>For example, the following code connects to the printer associated with a destination with a 30 second timeout:</p>
1018 <pre><code>char resource[256];
1019http_t *http = cupsConnectDest(dest, CUPS_DEST_FLAGS_DEVICE,
1020 30000, NULL, resource,
1021 sizeof(resource), NULL, NULL);
1022</code></pre>
1023 <h3><a id="creating-an-ipp-request">Creating an IPP Request</a></h3>
1024 <p>IPP requests are represented by the IPP message type <code>ipp_t</code> and each IPP attribute in the request is representing using the type <code>ipp_attribute_t</code>. Each IPP request includes an operation code (<code>IPP_OP_CREATE_JOB</code>, <code>IPP_OP_GET_PRINTER_ATTRIBUTES</code>, etc.) and a 32-bit integer identifier.</p>
1025 <p>The <code>ippNewRequest</code> function creates a new IPP request:</p>
1026 <pre><code>ipp_t *
1027ippNewRequest(ipp_op_t op);
1028</code></pre>
1029 <p>The <code>op</code> argument specifies the IPP operation code for the request. For example, the following code creates an IPP Get-Printer-Attributes request:</p>
1030 <pre><code>ipp_t *request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
1031</code></pre>
1032 <p>The request identifier is automatically set to a unique value for the current process.</p>
1033 <p>Each IPP request starts with two IPP attributes, &quot;attributes-charset&quot; and &quot;attributes-natural-language&quot;, followed by IPP attribute(s) that specify the target of the operation. The <code>ippNewRequest</code> automatically adds the correct &quot;attributes-charset&quot; and &quot;attributes-natural-language&quot; attributes, but you must add the target attribute(s). For example, the following code adds the &quot;printer-uri&quot; attribute to the IPP Get-Printer-Attributes request to specify which printer is being queried:</p>
1034 <pre><code>const char *printer_uri = cupsGetOption(&quot;device-uri&quot;,
1035 dest-&gt;num_options,
1036 dest-&gt;options);
1037
1038ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
1039 &quot;printer-uri&quot;, NULL, printer_uri);
1040</code></pre>
1041 <blockquote>
1042 <p>Note: If we wanted to query the scheduler instead of the device, we would look up the &quot;printer-uri-supported&quot; option instead of the &quot;device-uri&quot; value.</p>
1043</blockquote>
1044 <p>The <code>ippAddString</code> function adds the &quot;printer-uri&quot; attribute the the IPP request. The <code>IPP_TAG_OPERATION</code> argument specifies that the attribute is part of the operation. The <code>IPP_TAG_URI</code> argument specifies that the value is a Universal Resource Identifier (URI) string. The <code>NULL</code> argument specifies there is no language (English, French, Japanese, etc.) associated with the string, and the <code>printer_uri</code> argument specifies the string value.</p>
1045 <p>The IPP Get-Printer-Attributes request also supports an IPP attribute called &quot;requested-attributes&quot; that lists the attributes and values you are interested in. For example, the following code requests the printer state attributes:</p>
1046 <pre><code>static const char * const requested_attributes[] =
1047{
1048 &quot;printer-state&quot;,
1049 &quot;printer-state-message&quot;,
1050 &quot;printer-state-reasons&quot;
1051};
1052
1053ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
1054 &quot;requested-attributes&quot;, 3, NULL,
1055 requested_attributes);
1056</code></pre>
1057 <p>The <code>ippAddStrings</code> function adds an attribute with one or more strings, in this case three. The <code>IPP_TAG_KEYWORD</code> argument specifies that the strings are keyword values, which are used for attribute names. All strings use the same language (<code>NULL</code>), and the attribute will contain the three strings in the array <code>requested_attributes</code>.</p>
1058 <p>CUPS provides many functions to adding attributes of different types:</p>
1059 <ul>
1060 <li><code>ippAddBoolean</code> adds a boolean (<code>IPP_TAG_BOOLEAN</code>) attribute with one value.</li>
1061 <li><code>ippAddInteger</code> adds an enum (<code>IPP_TAG_ENUM</code>) or integer (<code>IPP_TAG_INTEGER</code>) attribute with one value.</li>
1062 <li><code>ippAddIntegers</code> adds an enum or integer attribute with one or more values.</li>
1063 <li><code>ippAddOctetString</code> adds an octetString attribute with one value.</li>
1064 <li><code>ippAddOutOfBand</code> adds a admin-defined (<code>IPP_TAG_ADMINDEFINE</code>), default (<code>IPP_TAG_DEFAULT</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable (<code>IPP_TAG_NOTSETTABLE</code>), unknown (<code>IPP_TAG_UNKNOWN</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_VALUE</code>) out-of-band attribute.</li>
1065 <li><code>ippAddRange</code> adds a rangeOfInteger attribute with one range.</li>
1066 <li><code>ippAddRanges</code> adds a rangeOfInteger attribute with one or more ranges.</li>
1067 <li><code>ippAddResolution</code> adds a resolution attribute with one resolution.</li>
1068 <li><code>ippAddResolutions</code> adds a resolution attribute with one or more resolutions.</li>
1069 <li><code>ippAddString</code> adds a charset (<code>IPP_TAG_CHARSET</code>), keyword (<code>IPP_TAG_KEYWORD</code>), mimeMediaType (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code> and <code>IPP_TAG_NAMELANG</code>), naturalLanguage (<code>IPP_TAG_NATURAL_LANGUAGE</code>), text (<code>IPP_TAG_TEXT</code> and <code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), or uriScheme (<code>IPP_TAG_URISCHEME</code>) attribute with one value.</li>
1070 <li><code>ippAddStrings</code> adds a charset, keyword, mimeMediaType, name, naturalLanguage, text, uri, or uriScheme attribute with one or more values.</li>
1071</ul>
1072 <h3><a id="sending-the-ipp-request">Sending the IPP Request</a></h3>
1073 <p>Once you have created the IPP request, you can send it using the <code>cupsDoRequest</code> function. For example, the following code sends the IPP Get-Printer-Attributes request to the destination and saves the response:</p>
1074 <pre><code>ipp_t *response = cupsDoRequest(http, request, resource);
1075</code></pre>
1076 <p>For requests like Send-Document that include a file, the <code>cupsDoFileRequest</code> function should be used:</p>
1077 <pre><code>ipp_t *response = cupsDoFileRequest(http, request, resource,
1078 filename);
1079</code></pre>
1080 <p>Both <code>cupsDoRequest</code> and <code>cupsDoFileRequest</code> free the IPP request. If a valid IPP response is received, it is stored in a new IPP message (<code>ipp_t</code>) and returned to the caller. Otherwise <code>NULL</code> is returned.</p>
1081 <p>The status from the most recent request can be queried using the <code>cupsLastError</code> function, for example:</p>
1082 <pre><code>if (cupsLastError() &gt;= IPP_STATUS_ERROR_BAD_REQUEST)
1083{
1084 /* request failed */
1085}
1086</code></pre>
1087 <p>A human-readable error message is also available using the <code>cupsLastErrorString</code> function:</p>
1088 <pre><code>if (cupsLastError() &gt;= IPP_STATUS_ERROR_BAD_REQUEST)
1089{
1090 /* request failed */
1091 printf(&quot;Request failed: %s\n&quot;, cupsLastErrorString());
1092}
1093</code></pre>
1094 <h3><a id="processing-the-ipp-response">Processing the IPP Response</a></h3>
1095 <p>Each response to an IPP request is also an IPP message (<code>ipp_t</code>) with its own IPP attributes (<code>ipp_attribute_t</code>) that includes a status code (<code>IPP_STATUS_OK</code>, <code>IPP_STATUS_ERROR_BAD_REQUEST</code>, etc.) and the corresponding 32-bit integer identifier from the request.</p>
1096 <p>For example, the following code finds the printer state attributes and prints their values:</p>
1097 <pre><code>ipp_attribute_t *attr;
1098
1099if ((attr = ippFindAttribute(response, &quot;printer-state&quot;,
1100 IPP_TAG_ENUM)) != NULL)
1101{
1102 printf(&quot;printer-state=%s\n&quot;,
db5424ea 1103 ippEnumString(&quot;printer-state&quot;, ippGetInteger(attr, 0)));
b0fb2d75
MS
1104}
1105else
1106 puts(&quot;printer-state=unknown&quot;);
1107
1108if ((attr = ippFindAttribute(response, &quot;printer-state-message&quot;,
1109 IPP_TAG_TEXT)) != NULL)
1110{
1111 printf(&quot;printer-state-message=\&quot;%s\&quot;\n&quot;,
1112 ippGetString(attr, 0, NULL)));
1113}
1114
1115if ((attr = ippFindAttribute(response, &quot;printer-state-reasons&quot;,
1116 IPP_TAG_KEYWORD)) != NULL)
1117{
1118 int i, count = ippGetCount(attr);
1119
1120 puts(&quot;printer-state-reasons=&quot;);
1121 for (i = 0; i &lt; count; i ++)
1122 printf(&quot; %s\n&quot;, ippGetString(attr, i, NULL)));
1123}
1124</code></pre>
1125 <p>The <code>ippGetCount</code> function returns the number of values in an attribute.</p>
1126 <p>The <code>ippGetInteger</code> and <code>ippGetString</code> functions return a single integer or string value from an attribute.</p>
db5424ea 1127 <p>The <code>ippEnumString</code> function converts a enum value to its keyword (string) equivalent.</p>
b0fb2d75
MS
1128 <p>Once you are done using the IPP response message, free it using the <code>ippDelete</code> function:</p>
1129 <pre><code>ippDelete(response);
1130</code></pre>
1131 <h3><a id="authentication">Authentication</a></h3>
1132 <p>CUPS normally handles authentication through the console. GUI applications should set a password callback using the <code>cupsSetPasswordCB2</code> function:</p>
1133 <pre><code>void
1134cupsSetPasswordCB2(cups_password_cb2_t cb, void *user_data);
1135</code></pre>
1136 <p>The password callback will be called when needed and is responsible for setting the current user name using <code>cupsSetUser</code> and returning a string:</p>
1137 <pre><code>const char *
1138cups_password_cb2(const char *prompt, http_t *http,
1139 const char *method, const char *resource,
1140 void *user_data);
1141</code></pre>
1142 <p>The <code>prompt</code> argument is a string from CUPS that should be displayed to the user.</p>
1143 <p>The <code>http</code> argument is the connection hosting the request that is being authenticated. The password callback can call the <code>httpGetField</code> and <code>httpGetSubField</code> functions to look for additional details concerning the authentication challenge.</p>
1144 <p>The <code>method</code> argument specifies the HTTP method used for the request and is typically &quot;POST&quot;.</p>
1145 <p>The <code>resource</code> argument specifies the path used for the request.</p>
1146 <p>The <code>user_data</code> argument provides the user data pointer from the <code>cupsSetPasswordCB2</code> call.</p>
798d6e29
MS
1147 <h2 class="title"><a id="FUNCTIONS">Functions</a></h2>
1148<h3 class="function"><a id="cupsAddDest">cupsAddDest</a></h3>
1149 <p class="description">Add a destination to the list of destinations.</p>
1150<p class="code">
98d88c8d
MS
1151int cupsAddDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
1152<h4 class="parameters">Parameters</h4>
1153<table class="list"><tbody>
1154<tr><th>name</th>
1155 <td class="description">Destination name</td></tr>
1156<tr><th>instance</th>
1157 <td class="description">Instance name or <code>NULL</code> for none/primary</td></tr>
1158<tr><th>num_dests</th>
1159 <td class="description">Number of destinations</td></tr>
1160<tr><th>dests</th>
1161 <td class="description">Destinations</td></tr>
1162</tbody></table>
798d6e29
MS
1163<h4 class="returnvalue">Return Value</h4>
1164 <p class="description">New number of destinations</p>
1165<h4 class="discussion">Discussion</h4>
1166 <p class="discussion">This function cannot be used to add a new class or printer queue,
1167it only adds a new container of saved options for the named
1168destination or instance.<br>
1169<br>
1170If the named destination already exists, the destination list is
1171returned unchanged. Adding a new instance of a destination creates
1172a copy of that destination's options.<br>
1173<br>
1174Use the <a href="#cupsSaveDests"><code>cupsSaveDests</code></a> function to save the updated list of
1175destinations to the user's lpoptions file.</p>
63b75fbe
MS
1176<h3 class="function"><span class="info">&#160;CUPS 2.3&#160;</span><a id="cupsAddDestMediaOptions">cupsAddDestMediaOptions</a></h3>
1177 <p class="description">Add the option corresponding to the specified media size.</p>
1178<p class="code">
1179int cupsAddDestMediaOptions(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
1180<h4 class="parameters">Parameters</h4>
1181<table class="list"><tbody>
1182<tr><th>http</th>
1183 <td class="description">Connection to destination</td></tr>
1184<tr><th>dest</th>
1185 <td class="description">Destination</td></tr>
1186<tr><th>dinfo</th>
1187 <td class="description">Destination information</td></tr>
1188<tr><th>flags</th>
1189 <td class="description">Media matching flags</td></tr>
1190<tr><th>size</th>
1191 <td class="description">Media size</td></tr>
1192<tr><th>num_options</th>
1193 <td class="description">Current number of options</td></tr>
1194<tr><th>options</th>
1195 <td class="description">Options</td></tr>
1196</tbody></table>
1197<h4 class="returnvalue">Return Value</h4>
1198 <p class="description">New number of options</p>
98d88c8d 1199<h3 class="function"><span class="info">&#160;CUPS 2.2.4/macOS 10.13&#160;</span><a id="cupsAddIntegerOption">cupsAddIntegerOption</a></h3>
53af7f21 1200 <p class="description">Add an integer option to an option array.</p>
798d6e29 1201<p class="code">
98d88c8d
MS
1202int cupsAddIntegerOption(const char *name, int value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
1203<h4 class="parameters">Parameters</h4>
1204<table class="list"><tbody>
1205<tr><th>name</th>
1206 <td class="description">Name of option</td></tr>
1207<tr><th>value</th>
1208 <td class="description">Value of option</td></tr>
1209<tr><th>num_options</th>
1210 <td class="description">Number of options</td></tr>
1211<tr><th>options</th>
1212 <td class="description">Pointer to options</td></tr>
1213</tbody></table>
798d6e29
MS
1214<h4 class="returnvalue">Return Value</h4>
1215 <p class="description">Number of options</p>
1216<h4 class="discussion">Discussion</h4>
1217 <p class="discussion">New option arrays can be initialized simply by passing 0 for the
53af7f21 1218&quot;num_options&quot; parameter.
798d6e29
MS
1219
1220</p>
53af7f21
MS
1221<h3 class="function"><a id="cupsAddOption">cupsAddOption</a></h3>
1222 <p class="description">Add an option to an option array.</p>
798d6e29 1223<p class="code">
98d88c8d
MS
1224int cupsAddOption(const char *name, const char *value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
1225<h4 class="parameters">Parameters</h4>
1226<table class="list"><tbody>
1227<tr><th>name</th>
1228 <td class="description">Name of option</td></tr>
1229<tr><th>value</th>
1230 <td class="description">Value of option</td></tr>
1231<tr><th>num_options</th>
1232 <td class="description">Number of options</td></tr>
1233<tr><th>options</th>
1234 <td class="description">Pointer to options</td></tr>
1235</tbody></table>
798d6e29 1236<h4 class="returnvalue">Return Value</h4>
53af7f21 1237 <p class="description">Number of options</p>
798d6e29 1238<h4 class="discussion">Discussion</h4>
53af7f21
MS
1239 <p class="discussion">New option arrays can be initialized simply by passing 0 for the
1240&quot;num_options&quot; parameter.</p>
98d88c8d 1241<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCancelDestJob">cupsCancelDestJob</a></h3>
798d6e29 1242 <p class="description">Cancel a job on a destination.</p>
98d88c8d
MS
1243<p class="code">
1244ipp_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>
1245<h4 class="parameters">Parameters</h4>
1246<table class="list"><tbody>
1247<tr><th>http</th>
1248 <td class="description">Connection to destination</td></tr>
1249<tr><th>dest</th>
1250 <td class="description">Destination</td></tr>
1251<tr><th>job_id</th>
1252 <td class="description">Job ID</td></tr>
1253</tbody></table>
1254<h4 class="returnvalue">Return Value</h4>
1255 <p class="description">Status of cancel operation</p>
1256<h4 class="discussion">Discussion</h4>
798d6e29
MS
1257 <p class="discussion">The &quot;job_id&quot; is the number returned by cupsCreateDestJob.<br>
1258<br>
1259Returns <code>IPP_STATUS_OK</code> on success and
98d88c8d 1260<code>IPP_STATUS_ERROR_NOT_AUTHORIZED</code> or
798d6e29
MS
1261<code>IPP_STATUS_ERROR_FORBIDDEN</code> on failure.
1262
798d6e29
MS
1263</p>
1264<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCheckDestSupported">cupsCheckDestSupported</a></h3>
1265 <p class="description">Check that the option and value are supported
1266by the destination.</p>
1267<p class="code">
98d88c8d
MS
1268int 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>
1269<h4 class="parameters">Parameters</h4>
1270<table class="list"><tbody>
1271<tr><th>http</th>
1272 <td class="description">Connection to destination</td></tr>
1273<tr><th>dest</th>
1274 <td class="description">Destination</td></tr>
1275<tr><th>dinfo</th>
1276 <td class="description">Destination information</td></tr>
1277<tr><th>option</th>
1278 <td class="description">Option</td></tr>
1279<tr><th>value</th>
b0fb2d75 1280 <td class="description">Value or <code>NULL</code></td></tr>
98d88c8d 1281</tbody></table>
798d6e29
MS
1282<h4 class="returnvalue">Return Value</h4>
1283 <p class="description">1 if supported, 0 otherwise</p>
1284<h4 class="discussion">Discussion</h4>
1285 <p class="discussion">Returns 1 if supported, 0 otherwise.
1286
1287</p>
1288<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCloseDestJob">cupsCloseDestJob</a></h3>
1289 <p class="description">Close a job and start printing.</p>
1290<p class="code">
98d88c8d
MS
1291ipp_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>
1292<h4 class="parameters">Parameters</h4>
1293<table class="list"><tbody>
1294<tr><th>http</th>
1295 <td class="description">Connection to destination</td></tr>
1296<tr><th>dest</th>
1297 <td class="description">Destination</td></tr>
1298<tr><th>info</th>
1299 <td class="description">Destination information</td></tr>
1300<tr><th>job_id</th>
1301 <td class="description">Job ID</td></tr>
1302</tbody></table>
798d6e29
MS
1303<h4 class="returnvalue">Return Value</h4>
1304 <p class="description">IPP status code</p>
1305<h4 class="discussion">Discussion</h4>
1306 <p class="discussion">Use when the last call to cupsStartDocument passed 0 for &quot;last_document&quot;.
1307&quot;job_id&quot; is the job ID returned by cupsCreateDestJob. Returns <code>IPP_STATUS_OK</code>
1308on success.
1309
1310</p>
1311<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsConnectDest">cupsConnectDest</a></h3>
699fe020 1312 <p class="description">Open a connection to the destination.</p>
98d88c8d
MS
1313<p class="code">
1314<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>
1315<h4 class="parameters">Parameters</h4>
1316<table class="list"><tbody>
1317<tr><th>dest</th>
1318 <td class="description">Destination</td></tr>
1319<tr><th>flags</th>
1320 <td class="description">Connection flags</td></tr>
1321<tr><th>msec</th>
1322 <td class="description">Timeout in milliseconds</td></tr>
1323<tr><th>cancel</th>
1324 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
1325<tr><th>resource</th>
1326 <td class="description">Resource buffer</td></tr>
1327<tr><th>resourcesize</th>
1328 <td class="description">Size of resource buffer</td></tr>
1329<tr><th>cb</th>
1330 <td class="description">Callback function</td></tr>
1331<tr><th>user_data</th>
1332 <td class="description">User data pointer</td></tr>
1333</tbody></table>
1334<h4 class="returnvalue">Return Value</h4>
1335 <p class="description">Connection to destination or <code>NULL</code></p>
1336<h4 class="discussion">Discussion</h4>
1337 <p class="discussion">Connect to the destination, returning a new <code>http_t</code> connection object
1338and optionally the resource path to use for the destination. These calls
1339will block until a connection is made, the timeout expires, the integer
1340pointed to by &quot;cancel&quot; is non-zero, or the callback function (or block)
1341returns 0. The caller is responsible for calling <a href="#httpClose"><code>httpClose</code></a> on the
b0fb2d75
MS
1342returned connection.<br>
1343<br>
699fe020 1344Starting with CUPS 2.2.4, the caller can pass <code>CUPS_DEST_FLAGS_DEVICE</code>
b0fb2d75
MS
1345for the &quot;flags&quot; argument to connect directly to the device associated with
1346the destination. Otherwise, the connection is made to the CUPS scheduler
1347associated with the destination.
798d6e29
MS
1348
1349</p>
53af7f21
MS
1350<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDest">cupsCopyDest</a></h3>
1351 <p class="description">Copy a destination.</p>
798d6e29 1352<p class="code">
98d88c8d
MS
1353int 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>
1354<h4 class="parameters">Parameters</h4>
1355<table class="list"><tbody>
1356<tr><th>dest</th>
1357 <td class="description">Destination to copy</td></tr>
1358<tr><th>num_dests</th>
1359 <td class="description">Number of destinations</td></tr>
1360<tr><th>dests</th>
1361 <td class="description">Destination array</td></tr>
1362</tbody></table>
798d6e29
MS
1363<h4 class="returnvalue">Return Value</h4>
1364 <p class="description">New number of destinations</p>
1365<h4 class="discussion">Discussion</h4>
1366 <p class="discussion">Make a copy of the destination to an array of destinations (or just a single
1367copy) - for use with the cupsEnumDests* functions. The caller is responsible
1368for calling cupsFreeDests() on the returned object(s).
1369
1370</p>
1371<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDestConflicts">cupsCopyDestConflicts</a></h3>
1372 <p class="description">Get conflicts and resolutions for a new
1373option/value pair.</p>
1374<p class="code">
98d88c8d
MS
1375int 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>
1376<h4 class="parameters">Parameters</h4>
1377<table class="list"><tbody>
1378<tr><th>http</th>
1379 <td class="description">Connection to destination</td></tr>
1380<tr><th>dest</th>
1381 <td class="description">Destination</td></tr>
1382<tr><th>dinfo</th>
1383 <td class="description">Destination information</td></tr>
1384<tr><th>num_options</th>
1385 <td class="description">Number of current options</td></tr>
1386<tr><th>options</th>
1387 <td class="description">Current options</td></tr>
1388<tr><th>new_option</th>
1389 <td class="description">New option</td></tr>
1390<tr><th>new_value</th>
1391 <td class="description">New value</td></tr>
1392<tr><th>num_conflicts</th>
1393 <td class="description">Number of conflicting options</td></tr>
1394<tr><th>conflicts</th>
1395 <td class="description">Conflicting options</td></tr>
1396<tr><th>num_resolved</th>
1397 <td class="description">Number of options to resolve</td></tr>
1398<tr><th>resolved</th>
1399 <td class="description">Resolved options</td></tr>
1400</tbody></table>
798d6e29
MS
1401<h4 class="returnvalue">Return Value</h4>
1402 <p class="description">1 if there is a conflict, 0 if none, -1 on error</p>
1403<h4 class="discussion">Discussion</h4>
1404 <p class="discussion">&quot;num_options&quot; and &quot;options&quot; represent the currently selected options by the
1405user. &quot;new_option&quot; and &quot;new_value&quot; are the setting the user has just
1406changed.<br>
1407<br>
1408Returns 1 if there is a conflict, 0 if there are no conflicts, and -1 if
1409there was an unrecoverable error such as a resolver loop.<br>
1410<br>
1411If &quot;num_conflicts&quot; and &quot;conflicts&quot; are not <code>NULL</code>, they are set to
1412contain the list of conflicting option/value pairs. Similarly, if
1413&quot;num_resolved&quot; and &quot;resolved&quot; are not <code>NULL</code> they will be set to the
1414list of changes needed to resolve the conflict.<br>
1415<br>
1416If cupsCopyDestConflicts returns 1 but &quot;num_resolved&quot; and &quot;resolved&quot; are set
1417to 0 and <code>NULL</code>, respectively, then the conflict cannot be resolved.
1418
1419</p>
1420<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDestInfo">cupsCopyDestInfo</a></h3>
1421 <p class="description">Get the supported values/capabilities for the
1422destination.</p>
1423<p class="code">
98d88c8d 1424<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 1425<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1426<table class="list"><tbody>
1427<tr><th>http</th>
1428 <td class="description">Connection to destination</td></tr>
1429<tr><th>dest</th>
1430 <td class="description">Destination</td></tr>
1431</tbody></table>
798d6e29
MS
1432<h4 class="returnvalue">Return Value</h4>
1433 <p class="description">Destination information</p>
1434<h4 class="discussion">Discussion</h4>
1435 <p class="discussion">The caller is responsible for calling <a href="#cupsFreeDestInfo"><code>cupsFreeDestInfo</code></a> on the return
1436value. <code>NULL</code> is returned on error.
1437
1438</p>
1439<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCreateDestJob">cupsCreateDestJob</a></h3>
1440 <p class="description">Create a job on a destination.</p>
1441<p class="code">
98d88c8d
MS
1442ipp_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>
1443<h4 class="parameters">Parameters</h4>
1444<table class="list"><tbody>
1445<tr><th>http</th>
1446 <td class="description">Connection to destination</td></tr>
1447<tr><th>dest</th>
1448 <td class="description">Destination</td></tr>
1449<tr><th>info</th>
1450 <td class="description">Destination information</td></tr>
1451<tr><th>job_id</th>
1452 <td class="description">Job ID or 0 on error</td></tr>
1453<tr><th>title</th>
1454 <td class="description">Job name</td></tr>
1455<tr><th>num_options</th>
1456 <td class="description">Number of job options</td></tr>
1457<tr><th>options</th>
1458 <td class="description">Job options</td></tr>
1459</tbody></table>
798d6e29
MS
1460<h4 class="returnvalue">Return Value</h4>
1461 <p class="description">IPP status code</p>
1462<h4 class="discussion">Discussion</h4>
1463 <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success, saving the job ID
1464in the variable pointed to by &quot;job_id&quot;.
1465
1466</p>
798d6e29
MS
1467<h3 class="function"><span class="info">&#160;CUPS 1.1.20/macOS 10.4&#160;</span><a id="cupsDoAuthentication">cupsDoAuthentication</a></h3>
1468 <p class="description">Authenticate a request.</p>
1469<p class="code">
98d88c8d
MS
1470int cupsDoAuthentication(<a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p>
1471<h4 class="parameters">Parameters</h4>
1472<table class="list"><tbody>
1473<tr><th>http</th>
1474 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
1475<tr><th>method</th>
1476 <td class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</td></tr>
1477<tr><th>resource</th>
1478 <td class="description">Resource path</td></tr>
1479</tbody></table>
798d6e29
MS
1480<h4 class="returnvalue">Return Value</h4>
1481 <p class="description">0 on success, -1 on error</p>
1482<h4 class="discussion">Discussion</h4>
1483 <p class="discussion">This function should be called in response to a <code>HTTP_STATUS_UNAUTHORIZED</code>
1484status, prior to resubmitting your request.
1485
1486</p>
ddf2ec73
MS
1487<h3 class="function"><span class="info">&#160;CUPS 2.3&#160;</span><a id="cupsEncodeOption">cupsEncodeOption</a></h3>
1488 <p class="description">Encode a single option into an IPP attribute.</p>
1489<p class="code">
1490<a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsEncodeOption(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group_tag, const char *name, const char *value);</p>
1491<h4 class="parameters">Parameters</h4>
1492<table class="list"><tbody>
1493<tr><th>ipp</th>
1494 <td class="description">IPP request/response</td></tr>
1495<tr><th>group_tag</th>
1496 <td class="description">Attribute group</td></tr>
1497<tr><th>name</th>
1498 <td class="description">Option name</td></tr>
1499<tr><th>value</th>
1500 <td class="description">Option string value</td></tr>
1501</tbody></table>
1502<h4 class="returnvalue">Return Value</h4>
1503 <p class="description">New attribute or <code>NULL</code> on error</p>
798d6e29 1504<h3 class="function"><a id="cupsEncodeOptions">cupsEncodeOptions</a></h3>
53af7f21 1505 <p class="description">Encode printer options into IPP attributes.</p>
98d88c8d
MS
1506<p class="code">
1507void cupsEncodeOptions(<a href="#ipp_t">ipp_t</a> *ipp, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
1508<h4 class="parameters">Parameters</h4>
1509<table class="list"><tbody>
1510<tr><th>ipp</th>
ddf2ec73 1511 <td class="description">IPP request/response</td></tr>
98d88c8d
MS
1512<tr><th>num_options</th>
1513 <td class="description">Number of options</td></tr>
1514<tr><th>options</th>
1515 <td class="description">Options</td></tr>
1516</tbody></table>
1517<h4 class="discussion">Discussion</h4>
798d6e29 1518 <p class="discussion">This function adds operation, job, and then subscription attributes,
98d88c8d
MS
1519in that order. Use the <a href="#cupsEncodeOptions2"><code>cupsEncodeOptions2</code></a> function to add attributes
1520for a single group.</p>
1521<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsEncodeOptions2">cupsEncodeOptions2</a></h3>
53af7f21 1522 <p class="description">Encode printer options into IPP attributes for a group.</p>
98d88c8d
MS
1523<p class="code">
1524void 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>
1525<h4 class="parameters">Parameters</h4>
1526<table class="list"><tbody>
1527<tr><th>ipp</th>
ddf2ec73 1528 <td class="description">IPP request/response</td></tr>
98d88c8d
MS
1529<tr><th>num_options</th>
1530 <td class="description">Number of options</td></tr>
1531<tr><th>options</th>
1532 <td class="description">Options</td></tr>
1533<tr><th>group_tag</th>
1534 <td class="description">Group to encode</td></tr>
1535</tbody></table>
1536<h4 class="discussion">Discussion</h4>
798d6e29 1537 <p class="discussion">This function only adds attributes for a single group. Call this
98d88c8d 1538function multiple times for each group, or use <a href="#cupsEncodeOptions"><code>cupsEncodeOptions</code></a>
798d6e29
MS
1539to add the standard groups.
1540
1541</p>
1542<h3 class="function"><a id="cupsEncryption">cupsEncryption</a></h3>
1543 <p class="description">Get the current encryption settings.</p>
1544<p class="code">
98d88c8d 1545<a href="#http_encryption_t">http_encryption_t</a> cupsEncryption(void);</p>
798d6e29
MS
1546<h4 class="returnvalue">Return Value</h4>
1547 <p class="description">Encryption settings</p>
1548<h4 class="discussion">Discussion</h4>
1549 <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
1550environment variable, then the ~/.cups/client.conf file, and finally the
1551/etc/cups/client.conf file. If not set, the default is
1552<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
1553<br>
1554Note: The current encryption setting is tracked separately for each thread
1555in a program. Multi-threaded programs that override the setting via the
1556<a href="#cupsSetEncryption"><code>cupsSetEncryption</code></a> function need to do so in each thread for the same
1557setting to be used.</p>
1558<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsEnumDests">cupsEnumDests</a></h3>
1559 <p class="description">Enumerate available destinations with a callback function.</p>
1560<p class="code">
98d88c8d
MS
1561int 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>
1562<h4 class="parameters">Parameters</h4>
1563<table class="list"><tbody>
1564<tr><th>flags</th>
1565 <td class="description">Enumeration flags</td></tr>
1566<tr><th>msec</th>
1567 <td class="description">Timeout in milliseconds, -1 for indefinite</td></tr>
1568<tr><th>cancel</th>
1569 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
1570<tr><th>type</th>
1571 <td class="description">Printer type bits</td></tr>
1572<tr><th>mask</th>
1573 <td class="description">Mask for printer type bits</td></tr>
1574<tr><th>cb</th>
1575 <td class="description">Callback function</td></tr>
1576<tr><th>user_data</th>
1577 <td class="description">User data</td></tr>
1578</tbody></table>
798d6e29
MS
1579<h4 class="returnvalue">Return Value</h4>
1580 <p class="description">1 on success, 0 on failure</p>
1581<h4 class="discussion">Discussion</h4>
53af7f21
MS
1582 <p class="discussion">Destinations are enumerated from one or more sources. The callback function
1583receives the <code>user_data</code> pointer and the destination pointer which can
1584be used as input to the <a href="#cupsCopyDest"><code>cupsCopyDest</code></a> function. The function must
1585return 1 to continue enumeration or 0 to stop.<br>
798d6e29 1586<br>
53af7f21
MS
1587The <code>type</code> and <code>mask</code> arguments allow the caller to filter the
1588destinations that are enumerated. Passing 0 for both will enumerate all
1589printers. The constant <code>CUPS_PRINTER_DISCOVERED</code> is used to filter on
1590destinations that are available but have not yet been added locally.<br>
798d6e29
MS
1591<br>
1592Enumeration happens on the current thread and does not return until all
718ee2ff
MS
1593destinations have been enumerated or the callback function returns 0.<br>
1594<br>
1595Note: The callback function will likely receive multiple updates for the same
1596destinations - it is up to the caller to suppress any duplicate destinations.
798d6e29
MS
1597
1598</p>
798d6e29
MS
1599<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestDefault">cupsFindDestDefault</a></h3>
1600 <p class="description">Find the default value(s) for the given option.</p>
1601<p class="code">
98d88c8d
MS
1602<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>
1603<h4 class="parameters">Parameters</h4>
1604<table class="list"><tbody>
1605<tr><th>http</th>
1606 <td class="description">Connection to destination</td></tr>
1607<tr><th>dest</th>
1608 <td class="description">Destination</td></tr>
1609<tr><th>dinfo</th>
1610 <td class="description">Destination information</td></tr>
1611<tr><th>option</th>
1612 <td class="description">Option/attribute name</td></tr>
1613</tbody></table>
798d6e29
MS
1614<h4 class="returnvalue">Return Value</h4>
1615 <p class="description">Default attribute or <code>NULL</code> for none</p>
1616<h4 class="discussion">Discussion</h4>
1617 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1618<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1619<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1620<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1621functions to inspect the default value(s) as needed.
1622
1623</p>
1624<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestReady">cupsFindDestReady</a></h3>
1625 <p class="description">Find the default value(s) for the given option.</p>
1626<p class="code">
98d88c8d
MS
1627<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>
1628<h4 class="parameters">Parameters</h4>
1629<table class="list"><tbody>
1630<tr><th>http</th>
1631 <td class="description">Connection to destination</td></tr>
1632<tr><th>dest</th>
1633 <td class="description">Destination</td></tr>
1634<tr><th>dinfo</th>
1635 <td class="description">Destination information</td></tr>
1636<tr><th>option</th>
1637 <td class="description">Option/attribute name</td></tr>
1638</tbody></table>
798d6e29
MS
1639<h4 class="returnvalue">Return Value</h4>
1640 <p class="description">Default attribute or <code>NULL</code> for none</p>
1641<h4 class="discussion">Discussion</h4>
1642 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1643<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1644<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1645<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1646functions to inspect the default value(s) as needed.
1647
1648</p>
1649<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestSupported">cupsFindDestSupported</a></h3>
1650 <p class="description">Find the default value(s) for the given option.</p>
1651<p class="code">
98d88c8d
MS
1652<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>
1653<h4 class="parameters">Parameters</h4>
1654<table class="list"><tbody>
1655<tr><th>http</th>
1656 <td class="description">Connection to destination</td></tr>
1657<tr><th>dest</th>
1658 <td class="description">Destination</td></tr>
1659<tr><th>dinfo</th>
1660 <td class="description">Destination information</td></tr>
1661<tr><th>option</th>
1662 <td class="description">Option/attribute name</td></tr>
1663</tbody></table>
798d6e29
MS
1664<h4 class="returnvalue">Return Value</h4>
1665 <p class="description">Default attribute or <code>NULL</code> for none</p>
1666<h4 class="discussion">Discussion</h4>
1667 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1668<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1669<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1670<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1671functions to inspect the default value(s) as needed.
1672
1673</p>
1674<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsFinishDestDocument">cupsFinishDestDocument</a></h3>
1675 <p class="description">Finish the current document.</p>
1676<p class="code">
98d88c8d
MS
1677ipp_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>
1678<h4 class="parameters">Parameters</h4>
1679<table class="list"><tbody>
1680<tr><th>http</th>
1681 <td class="description">Connection to destination</td></tr>
1682<tr><th>dest</th>
1683 <td class="description">Destination</td></tr>
1684<tr><th>info</th>
1685 <td class="description">Destination information</td></tr>
1686</tbody></table>
798d6e29
MS
1687<h4 class="returnvalue">Return Value</h4>
1688 <p class="description">Status of document submission</p>
1689<h4 class="discussion">Discussion</h4>
1690 <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success.
1691
798d6e29 1692</p>
98d88c8d 1693<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsFreeDestInfo">cupsFreeDestInfo</a></h3>
53af7f21
MS
1694 <p class="description">Free destination information obtained using
1695<a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a>.</p>
798d6e29 1696<p class="code">
98d88c8d 1697void cupsFreeDestInfo(<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo);</p>
798d6e29 1698<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1699<table class="list"><tbody>
1700<tr><th>dinfo</th>
1701 <td class="description">Destination information</td></tr>
1702</tbody></table>
1703<h3 class="function"><a id="cupsFreeDests">cupsFreeDests</a></h3>
53af7f21 1704 <p class="description">Free the memory used by the list of destinations.</p>
798d6e29 1705<p class="code">
98d88c8d 1706void cupsFreeDests(int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
798d6e29 1707<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1708<table class="list"><tbody>
1709<tr><th>num_dests</th>
1710 <td class="description">Number of destinations</td></tr>
1711<tr><th>dests</th>
1712 <td class="description">Destinations</td></tr>
1713</tbody></table>
1714<h3 class="function"><a id="cupsFreeJobs">cupsFreeJobs</a></h3>
53af7f21 1715 <p class="description">Free memory used by job data.</p>
798d6e29 1716<p class="code">
98d88c8d 1717void cupsFreeJobs(int num_jobs, <a href="#cups_job_t">cups_job_t</a> *jobs);</p>
798d6e29 1718<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1719<table class="list"><tbody>
1720<tr><th>num_jobs</th>
1721 <td class="description">Number of jobs</td></tr>
1722<tr><th>jobs</th>
1723 <td class="description">Jobs</td></tr>
1724</tbody></table>
1725<h3 class="function"><a id="cupsFreeOptions">cupsFreeOptions</a></h3>
53af7f21 1726 <p class="description">Free all memory used by options.</p>
98d88c8d
MS
1727<p class="code">
1728void cupsFreeOptions(int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
1729<h4 class="parameters">Parameters</h4>
1730<table class="list"><tbody>
1731<tr><th>num_options</th>
1732 <td class="description">Number of options</td></tr>
1733<tr><th>options</th>
1734 <td class="description">Pointer to options</td></tr>
1735</tbody></table>
798d6e29
MS
1736<h3 class="function"><a id="cupsGetDest">cupsGetDest</a></h3>
1737 <p class="description">Get the named destination from the list.</p>
1738<p class="code">
98d88c8d
MS
1739<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>
1740<h4 class="parameters">Parameters</h4>
1741<table class="list"><tbody>
1742<tr><th>name</th>
1743 <td class="description">Destination name or <code>NULL</code> for the default destination</td></tr>
1744<tr><th>instance</th>
1745 <td class="description">Instance name or <code>NULL</code></td></tr>
1746<tr><th>num_dests</th>
1747 <td class="description">Number of destinations</td></tr>
1748<tr><th>dests</th>
1749 <td class="description">Destinations</td></tr>
1750</tbody></table>
798d6e29
MS
1751<h4 class="returnvalue">Return Value</h4>
1752 <p class="description">Destination pointer or <code>NULL</code></p>
1753<h4 class="discussion">Discussion</h4>
98d88c8d 1754 <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
1755list of supported destinations for the current user.</p>
1756<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></h3>
1757 <p class="description">Get a media name, dimension, and margins for a
1758specific size.</p>
1759<p class="code">
98d88c8d
MS
1760int 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>
1761<h4 class="parameters">Parameters</h4>
1762<table class="list"><tbody>
1763<tr><th>http</th>
1764 <td class="description">Connection to destination</td></tr>
1765<tr><th>dest</th>
1766 <td class="description">Destination</td></tr>
1767<tr><th>dinfo</th>
1768 <td class="description">Destination information</td></tr>
1769<tr><th>n</th>
1770 <td class="description">Media size number (0-based)</td></tr>
1771<tr><th>flags</th>
1772 <td class="description">Media flags</td></tr>
1773<tr><th>size</th>
1774 <td class="description">Media size information</td></tr>
1775</tbody></table>
798d6e29
MS
1776<h4 class="returnvalue">Return Value</h4>
1777 <p class="description">1 on success, 0 on failure</p>
1778<h4 class="discussion">Discussion</h4>
1779 <p class="discussion">The <code>flags</code> parameter determines which set of media are indexed. For
1780example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will get the Nth
1781borderless size supported by the printer.
1782
1783</p>
1784<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsGetDestMediaByName">cupsGetDestMediaByName</a></h3>
1785 <p class="description">Get media names, dimensions, and margins.</p>
1786<p class="code">
98d88c8d
MS
1787int 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>
1788<h4 class="parameters">Parameters</h4>
1789<table class="list"><tbody>
1790<tr><th>http</th>
1791 <td class="description">Connection to destination</td></tr>
1792<tr><th>dest</th>
1793 <td class="description">Destination</td></tr>
1794<tr><th>dinfo</th>
1795 <td class="description">Destination information</td></tr>
1796<tr><th>media</th>
1797 <td class="description">Media name</td></tr>
1798<tr><th>flags</th>
1799 <td class="description">Media matching flags</td></tr>
1800<tr><th>size</th>
1801 <td class="description">Media size information</td></tr>
1802</tbody></table>
798d6e29
MS
1803<h4 class="returnvalue">Return Value</h4>
1804 <p class="description">1 on match, 0 on failure</p>
1805<h4 class="discussion">Discussion</h4>
1806 <p class="discussion">The &quot;media&quot; string is a PWG media name. &quot;Flags&quot; provides some matching
1807guidance (multiple flags can be combined):<br>
1808<br>
1809CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
1810CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
1811CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
1812CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
1813CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
1814size amongst the &quot;ready&quot; media.<br>
1815<br>
1816The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
1817<br>
1818Returns 1 when there is a match and 0 if there is not a match.
1819
1820</p>
1821<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></h3>
1822 <p class="description">Get media names, dimensions, and margins.</p>
1823<p class="code">
98d88c8d
MS
1824int 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>
1825<h4 class="parameters">Parameters</h4>
1826<table class="list"><tbody>
1827<tr><th>http</th>
1828 <td class="description">Connection to destination</td></tr>
1829<tr><th>dest</th>
1830 <td class="description">Destination</td></tr>
1831<tr><th>dinfo</th>
1832 <td class="description">Destination information</td></tr>
1833<tr><th>width</th>
1834 <td class="description">Media width in hundredths of
1835of millimeters</td></tr>
1836<tr><th>length</th>
1837 <td class="description">Media length in hundredths of
1838of millimeters</td></tr>
1839<tr><th>flags</th>
1840 <td class="description">Media matching flags</td></tr>
1841<tr><th>size</th>
1842 <td class="description">Media size information</td></tr>
1843</tbody></table>
798d6e29
MS
1844<h4 class="returnvalue">Return Value</h4>
1845 <p class="description">1 on match, 0 on failure</p>
1846<h4 class="discussion">Discussion</h4>
1847 <p class="discussion">&quot;Width&quot; and &quot;length&quot; are the dimensions in hundredths of millimeters.
1848&quot;Flags&quot; provides some matching guidance (multiple flags can be combined):<br>
1849<br>
1850CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
1851CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
1852CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
1853CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
1854CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
1855size amongst the &quot;ready&quot; media.<br>
1856<br>
1857The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
1858<br>
1859Returns 1 when there is a match and 0 if there is not a match.
1860
1861</p>
1862<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaCount">cupsGetDestMediaCount</a></h3>
1863 <p class="description">Get the number of sizes supported by a
1864destination.</p>
1865<p class="code">
98d88c8d
MS
1866int 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>
1867<h4 class="parameters">Parameters</h4>
1868<table class="list"><tbody>
1869<tr><th>http</th>
1870 <td class="description">Connection to destination</td></tr>
1871<tr><th>dest</th>
1872 <td class="description">Destination</td></tr>
1873<tr><th>dinfo</th>
1874 <td class="description">Destination information</td></tr>
1875<tr><th>flags</th>
1876 <td class="description">Media flags</td></tr>
1877</tbody></table>
798d6e29
MS
1878<h4 class="returnvalue">Return Value</h4>
1879 <p class="description">Number of sizes</p>
1880<h4 class="discussion">Discussion</h4>
1881 <p class="discussion">The <code>flags</code> parameter determines the set of media sizes that are
1882counted. For example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return
1883the number of borderless sizes.
1884
1885</p>
1886<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></h3>
1887 <p class="description">Get the default size for a destination.</p>
1888<p class="code">
98d88c8d
MS
1889int 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>
1890<h4 class="parameters">Parameters</h4>
1891<table class="list"><tbody>
1892<tr><th>http</th>
1893 <td class="description">Connection to destination</td></tr>
1894<tr><th>dest</th>
1895 <td class="description">Destination</td></tr>
1896<tr><th>dinfo</th>
1897 <td class="description">Destination information</td></tr>
1898<tr><th>flags</th>
1899 <td class="description">Media flags</td></tr>
1900<tr><th>size</th>
1901 <td class="description">Media size information</td></tr>
1902</tbody></table>
798d6e29
MS
1903<h4 class="returnvalue">Return Value</h4>
1904 <p class="description">1 on success, 0 on failure</p>
1905<h4 class="discussion">Discussion</h4>
1906 <p class="discussion">The <code>flags</code> parameter determines which default size is returned. For
1907example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the default
1908borderless size, typically US Letter or A4, but sometimes 4x6 photo media.
1909
1910</p>
1911<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsGetDestWithURI">cupsGetDestWithURI</a></h3>
1912 <p class="description">Get a destination associated with a URI.</p>
1913<p class="code">
98d88c8d 1914<a href="#cups_dest_t">cups_dest_t</a> *cupsGetDestWithURI(const char *name, const char *uri);</p>
798d6e29 1915<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1916<table class="list"><tbody>
1917<tr><th>name</th>
1918 <td class="description">Desired printer name or <code>NULL</code></td></tr>
1919<tr><th>uri</th>
1920 <td class="description">URI for the printer</td></tr>
1921</tbody></table>
798d6e29
MS
1922<h4 class="returnvalue">Return Value</h4>
1923 <p class="description">Destination or <code>NULL</code></p>
1924<h4 class="discussion">Discussion</h4>
1925 <p class="discussion">&quot;name&quot; is the desired name for the printer. If <code>NULL</code>, a name will be
1926created using the URI.<br>
1927<br>
1928&quot;uri&quot; is the &quot;ipp&quot; or &quot;ipps&quot; URI for the printer.
1929
1930</p>
98d88c8d
MS
1931<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetDests2">cupsGetDests2</a></h3>
1932 <p class="description">Get the list of destinations from the specified server.</p>
1933<p class="code">
1934int cupsGetDests2(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
1935<h4 class="parameters">Parameters</h4>
1936<table class="list"><tbody>
1937<tr><th>http</th>
1938 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
1939<tr><th>dests</th>
1940 <td class="description">Destinations</td></tr>
1941</tbody></table>
1942<h4 class="returnvalue">Return Value</h4>
1943 <p class="description">Number of destinations</p>
1944<h4 class="discussion">Discussion</h4>
1945 <p class="discussion">Starting with CUPS 1.2, the returned list of destinations include the
1946&quot;printer-info&quot;, &quot;printer-is-accepting-jobs&quot;, &quot;printer-is-shared&quot;,
1947&quot;printer-make-and-model&quot;, &quot;printer-state&quot;, &quot;printer-state-change-time&quot;,
1948&quot;printer-state-reasons&quot;, &quot;printer-type&quot;, and &quot;printer-uri-supported&quot;
1949attributes as options.<br>
1950<br>
1951CUPS 1.4 adds the &quot;marker-change-time&quot;, &quot;marker-colors&quot;,
1952&quot;marker-high-levels&quot;, &quot;marker-levels&quot;, &quot;marker-low-levels&quot;, &quot;marker-message&quot;,
1953&quot;marker-names&quot;, &quot;marker-types&quot;, and &quot;printer-commands&quot; attributes as options.<br>
1954<br>
1955CUPS 2.2 adds accessible IPP printers to the list of destinations that can
1956be used. The &quot;printer-uri-supported&quot; option will be present for those IPP
1957printers that have been recently used.<br>
1958<br>
1959Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and
1960the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination.
1961
1962</p>
1963<h3 class="function"><span class="info">&#160;CUPS 2.2.4/macOS 10.13&#160;</span><a id="cupsGetIntegerOption">cupsGetIntegerOption</a></h3>
53af7f21 1964 <p class="description">Get an integer option value.</p>
798d6e29 1965<p class="code">
98d88c8d
MS
1966int cupsGetIntegerOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
1967<h4 class="parameters">Parameters</h4>
1968<table class="list"><tbody>
1969<tr><th>name</th>
1970 <td class="description">Name of option</td></tr>
1971<tr><th>num_options</th>
1972 <td class="description">Number of options</td></tr>
1973<tr><th>options</th>
1974 <td class="description">Options</td></tr>
1975</tbody></table>
798d6e29 1976<h4 class="returnvalue">Return Value</h4>
53af7f21 1977 <p class="description">Option value or <code>INT_MIN</code></p>
798d6e29 1978<h4 class="discussion">Discussion</h4>
53af7f21
MS
1979 <p class="discussion">INT_MIN is returned when the option does not exist, is not an integer, or
1980exceeds the range of values for the &quot;int&quot; type.
1981
1982</p>
798d6e29
MS
1983<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetJobs2">cupsGetJobs2</a></h3>
1984 <p class="description">Get the jobs from the specified server.</p>
1985<p class="code">
98d88c8d
MS
1986int 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>
1987<h4 class="parameters">Parameters</h4>
1988<table class="list"><tbody>
1989<tr><th>http</th>
1990 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
1991<tr><th>jobs</th>
1992 <td class="description">Job data</td></tr>
1993<tr><th>name</th>
1994 <td class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</td></tr>
1995<tr><th>myjobs</th>
1996 <td class="description">0 = all users, 1 = mine</td></tr>
1997<tr><th>whichjobs</th>
1998 <td class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></td></tr>
1999</tbody></table>
798d6e29
MS
2000<h4 class="returnvalue">Return Value</h4>
2001 <p class="description">Number of jobs</p>
2002<h4 class="discussion">Discussion</h4>
2003 <p class="discussion">A &quot;whichjobs&quot; value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless
2004of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are
2005pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns
2006jobs that are stopped, canceled, aborted, or completed.
2007
2008</p>
2009<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsGetNamedDest">cupsGetNamedDest</a></h3>
2010 <p class="description">Get options for the named destination.</p>
2011<p class="code">
98d88c8d
MS
2012<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>
2013<h4 class="parameters">Parameters</h4>
2014<table class="list"><tbody>
2015<tr><th>http</th>
2016 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
2017<tr><th>name</th>
2018 <td class="description">Destination name or <code>NULL</code> for the default destination</td></tr>
2019<tr><th>instance</th>
2020 <td class="description">Instance name or <code>NULL</code></td></tr>
2021</tbody></table>
798d6e29
MS
2022<h4 class="returnvalue">Return Value</h4>
2023 <p class="description">Destination or <code>NULL</code></p>
2024<h4 class="discussion">Discussion</h4>
2025 <p class="discussion">This function is optimized for retrieving a single destination and should
98d88c8d
MS
2026be used instead of <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> when you
2027either know the name of the destination or want to print to the default
2028destination. If <code>NULL</code> is returned, the destination does not exist or
2029there is no default destination.<br>
798d6e29
MS
2030<br>
2031If &quot;http&quot; is <code>CUPS_HTTP_DEFAULT</code>, the connection to the default print
2032server will be used.<br>
2033<br>
2034If &quot;name&quot; is <code>NULL</code>, the default printer for the current user will be
2035returned.<br>
2036<br>
2037The returned destination must be freed using <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> with a
2038&quot;num_dests&quot; value of 1.
2039
2040</p>
2041<h3 class="function"><a id="cupsGetOption">cupsGetOption</a></h3>
2042 <p class="description">Get an option value.</p>
2043<p class="code">
98d88c8d
MS
2044const char *cupsGetOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
2045<h4 class="parameters">Parameters</h4>
2046<table class="list"><tbody>
2047<tr><th>name</th>
2048 <td class="description">Name of option</td></tr>
2049<tr><th>num_options</th>
2050 <td class="description">Number of options</td></tr>
2051<tr><th>options</th>
2052 <td class="description">Options</td></tr>
2053</tbody></table>
798d6e29
MS
2054<h4 class="returnvalue">Return Value</h4>
2055 <p class="description">Option value or <code>NULL</code></p>
798d6e29 2056<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsGetPassword2">cupsGetPassword2</a></h3>
98d88c8d 2057 <p class="description">Get a password from the user using the current
798d6e29
MS
2058password callback.</p>
2059<p class="code">
98d88c8d
MS
2060const char *cupsGetPassword2(const char *prompt, <a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p>
2061<h4 class="parameters">Parameters</h4>
2062<table class="list"><tbody>
2063<tr><th>prompt</th>
2064 <td class="description">Prompt string</td></tr>
2065<tr><th>http</th>
2066 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
2067<tr><th>method</th>
2068 <td class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</td></tr>
2069<tr><th>resource</th>
2070 <td class="description">Resource path</td></tr>
2071</tbody></table>
798d6e29
MS
2072<h4 class="returnvalue">Return Value</h4>
2073 <p class="description">Password</p>
2074<h4 class="discussion">Discussion</h4>
2075 <p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the
2076user does not provide a password.<br>
2077<br>
2078Note: The current password callback function is tracked separately for each
2079thread in a program. Multi-threaded programs that override the setting via
98d88c8d
MS
2080the <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> function need to do so in each thread for the
2081same function to be used.
798d6e29 2082
798d6e29 2083</p>
798d6e29
MS
2084<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></h3>
2085 <p class="description">Get the localized string for a destination media
2086size.</p>
2087<p class="code">
98d88c8d
MS
2088const 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>
2089<h4 class="parameters">Parameters</h4>
2090<table class="list"><tbody>
2091<tr><th>http</th>
2092 <td class="description">Connection to destination</td></tr>
2093<tr><th>dest</th>
2094 <td class="description">Destination</td></tr>
2095<tr><th>dinfo</th>
2096 <td class="description">Destination information</td></tr>
2097<tr><th>flags</th>
2098 <td class="description">Media flags</td></tr>
2099<tr><th>size</th>
2100 <td class="description">Media size</td></tr>
2101</tbody></table>
798d6e29
MS
2102<h4 class="returnvalue">Return Value</h4>
2103 <p class="description">Localized string</p>
2104<h4 class="discussion">Discussion</h4>
2105 <p class="discussion">The returned string is stored in the destination information and will become
2106invalid if the destination information is deleted.
2107
2108</p>
2109<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsLocalizeDestOption">cupsLocalizeDestOption</a></h3>
2110 <p class="description">Get the localized string for a destination
2111option.</p>
2112<p class="code">
98d88c8d
MS
2113const 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>
2114<h4 class="parameters">Parameters</h4>
2115<table class="list"><tbody>
2116<tr><th>http</th>
2117 <td class="description">Connection to destination</td></tr>
2118<tr><th>dest</th>
2119 <td class="description">Destination</td></tr>
2120<tr><th>dinfo</th>
2121 <td class="description">Destination information</td></tr>
2122<tr><th>option</th>
2123 <td class="description">Option to localize</td></tr>
2124</tbody></table>
798d6e29
MS
2125<h4 class="returnvalue">Return Value</h4>
2126 <p class="description">Localized string</p>
2127<h4 class="discussion">Discussion</h4>
2128 <p class="discussion">The returned string is stored in the destination information and will become
2129invalid if the destination information is deleted.
2130
2131</p>
2132<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsLocalizeDestValue">cupsLocalizeDestValue</a></h3>
2133 <p class="description">Get the localized string for a destination
2134option+value pair.</p>
2135<p class="code">
98d88c8d
MS
2136const 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>
2137<h4 class="parameters">Parameters</h4>
2138<table class="list"><tbody>
2139<tr><th>http</th>
2140 <td class="description">Connection to destination</td></tr>
2141<tr><th>dest</th>
2142 <td class="description">Destination</td></tr>
2143<tr><th>dinfo</th>
2144 <td class="description">Destination information</td></tr>
2145<tr><th>option</th>
2146 <td class="description">Option to localize</td></tr>
2147<tr><th>value</th>
2148 <td class="description">Value to localize</td></tr>
2149</tbody></table>
798d6e29
MS
2150<h4 class="returnvalue">Return Value</h4>
2151 <p class="description">Localized string</p>
2152<h4 class="discussion">Discussion</h4>
2153 <p class="discussion">The returned string is stored in the destination information and will become
2154invalid if the destination information is deleted.
2155
2156</p>
2157<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="cupsMakeServerCredentials">cupsMakeServerCredentials</a></h3>
2158 <p class="description">Make a self-signed certificate and private key pair.</p>
2159<p class="code">
98d88c8d
MS
2160int cupsMakeServerCredentials(const char *path, const char *common_name, int num_alt_names, const char **alt_names, time_t expiration_date);</p>
2161<h4 class="parameters">Parameters</h4>
2162<table class="list"><tbody>
2163<tr><th>path</th>
2164 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
2165<tr><th>common_name</th>
2166 <td class="description">Common name</td></tr>
2167<tr><th>num_alt_names</th>
2168 <td class="description">Number of subject alternate names</td></tr>
2169<tr><th>alt_names</th>
2170 <td class="description">Subject Alternate Names</td></tr>
2171<tr><th>expiration_date</th>
2172 <td class="description">Expiration date</td></tr>
2173</tbody></table>
798d6e29
MS
2174<h4 class="returnvalue">Return Value</h4>
2175 <p class="description">1 on success, 0 on failure</p>
798d6e29
MS
2176<h3 class="function"><a id="cupsParseOptions">cupsParseOptions</a></h3>
2177 <p class="description">Parse options from a command-line argument.</p>
2178<p class="code">
98d88c8d
MS
2179int cupsParseOptions(const char *arg, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
2180<h4 class="parameters">Parameters</h4>
2181<table class="list"><tbody>
2182<tr><th>arg</th>
2183 <td class="description">Argument to parse</td></tr>
2184<tr><th>num_options</th>
2185 <td class="description">Number of options</td></tr>
2186<tr><th>options</th>
2187 <td class="description">Options found</td></tr>
2188</tbody></table>
798d6e29
MS
2189<h4 class="returnvalue">Return Value</h4>
2190 <p class="description">Number of options found</p>
2191<h4 class="discussion">Discussion</h4>
2192 <p class="discussion">This function converts space-delimited name/value pairs according
2193to the PAPI text option ABNF specification. Collection values
2194(&quot;name={a=... b=... c=...}&quot;) are stored with the curley brackets
2195intact - use <code>cupsParseOptions</code> on the value to extract the
2196collection attributes.</p>
798d6e29
MS
2197<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsRemoveDest">cupsRemoveDest</a></h3>
2198 <p class="description">Remove a destination from the destination list.</p>
2199<p class="code">
98d88c8d
MS
2200int cupsRemoveDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
2201<h4 class="parameters">Parameters</h4>
2202<table class="list"><tbody>
2203<tr><th>name</th>
2204 <td class="description">Destination name</td></tr>
2205<tr><th>instance</th>
2206 <td class="description">Instance name or <code>NULL</code></td></tr>
2207<tr><th>num_dests</th>
2208 <td class="description">Number of destinations</td></tr>
2209<tr><th>dests</th>
2210 <td class="description">Destinations</td></tr>
2211</tbody></table>
798d6e29
MS
2212<h4 class="returnvalue">Return Value</h4>
2213 <p class="description">New number of destinations</p>
2214<h4 class="discussion">Discussion</h4>
2215 <p class="discussion">Removing a destination/instance does not delete the class or printer
2216queue, merely the lpoptions for that destination/instance. Use the
2217<a href="#cupsSetDests"><code>cupsSetDests</code></a> or <a href="#cupsSetDests2"><code>cupsSetDests2</code></a> functions to save the new
2218options for the user.
2219
2220</p>
2221<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsRemoveOption">cupsRemoveOption</a></h3>
2222 <p class="description">Remove an option from an option array.</p>
2223<p class="code">
98d88c8d
MS
2224int cupsRemoveOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
2225<h4 class="parameters">Parameters</h4>
2226<table class="list"><tbody>
2227<tr><th>name</th>
2228 <td class="description">Option name</td></tr>
2229<tr><th>num_options</th>
2230 <td class="description">Current number of options</td></tr>
2231<tr><th>options</th>
2232 <td class="description">Options</td></tr>
2233</tbody></table>
798d6e29
MS
2234<h4 class="returnvalue">Return Value</h4>
2235 <p class="description">New number of options</p>
2236<h3 class="function"><a id="cupsServer">cupsServer</a></h3>
2237 <p class="description">Return the hostname/address of the current server.</p>
2238<p class="code">
98d88c8d 2239const char *cupsServer(void);</p>
798d6e29
MS
2240<h4 class="returnvalue">Return Value</h4>
2241 <p class="description">Server name</p>
2242<h4 class="discussion">Discussion</h4>
2243 <p class="discussion">The default server comes from the CUPS_SERVER environment variable, then the
2244~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not
2245set, the default is the local system - either &quot;localhost&quot; or a domain socket
2246path.<br>
2247<br>
2248The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6
2249address, or a domain socket pathname.<br>
2250<br>
2251Note: The current server is tracked separately for each thread in a program.
2252Multi-threaded programs that override the server via the
2253<a href="#cupsSetServer"><code>cupsSetServer</code></a> function need to do so in each thread for the same
2254server to be used.</p>
98d88c8d
MS
2255<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetClientCertCB">cupsSetClientCertCB</a></h3>
2256 <p class="description">Set the client certificate callback.</p>
798d6e29 2257<p class="code">
98d88c8d 2258void cupsSetClientCertCB(<a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a> cb, void *user_data);</p>
798d6e29 2259<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2260<table class="list"><tbody>
2261<tr><th>cb</th>
2262 <td class="description">Callback function</td></tr>
2263<tr><th>user_data</th>
2264 <td class="description">User data pointer</td></tr>
2265</tbody></table>
2266<h4 class="discussion">Discussion</h4>
798d6e29
MS
2267 <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
2268<br>
2269Note: The current certificate callback is tracked separately for each thread
2270in a program. Multi-threaded programs that override the callback need to do
2271so in each thread for the same callback to be used.
2272
2273</p>
2274<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetCredentials">cupsSetCredentials</a></h3>
2275 <p class="description">Set the default credentials to be used for SSL/TLS
2276connections.</p>
2277<p class="code">
98d88c8d 2278int cupsSetCredentials(cups_array_t *credentials);</p>
798d6e29 2279<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2280<table class="list"><tbody>
2281<tr><th>credentials</th>
2282 <td class="description">Array of credentials</td></tr>
2283</tbody></table>
798d6e29
MS
2284<h4 class="returnvalue">Return Value</h4>
2285 <p class="description">Status of call (0 = success)</p>
2286<h4 class="discussion">Discussion</h4>
2287 <p class="discussion">Note: The default credentials are tracked separately for each thread in a
2288program. Multi-threaded programs that override the setting need to do so in
2289each thread for the same setting to be used.
2290
2291</p>
98d88c8d 2292<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsSetDefaultDest">cupsSetDefaultDest</a></h3>
53af7f21 2293 <p class="description">Set the default destination.</p>
98d88c8d
MS
2294<p class="code">
2295void cupsSetDefaultDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
2296<h4 class="parameters">Parameters</h4>
2297<table class="list"><tbody>
2298<tr><th>name</th>
2299 <td class="description">Destination name</td></tr>
2300<tr><th>instance</th>
2301 <td class="description">Instance name or <code>NULL</code></td></tr>
2302<tr><th>num_dests</th>
2303 <td class="description">Number of destinations</td></tr>
2304<tr><th>dests</th>
2305 <td class="description">Destinations</td></tr>
2306</tbody></table>
798d6e29
MS
2307<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsSetDests2">cupsSetDests2</a></h3>
2308 <p class="description">Save the list of destinations for the specified server.</p>
2309<p class="code">
98d88c8d
MS
2310int cupsSetDests2(<a href="#http_t">http_t</a> *http, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
2311<h4 class="parameters">Parameters</h4>
2312<table class="list"><tbody>
2313<tr><th>http</th>
2314 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
2315<tr><th>num_dests</th>
2316 <td class="description">Number of destinations</td></tr>
2317<tr><th>dests</th>
2318 <td class="description">Destinations</td></tr>
2319</tbody></table>
798d6e29
MS
2320<h4 class="returnvalue">Return Value</h4>
2321 <p class="description">0 on success, -1 on error</p>
2322<h4 class="discussion">Discussion</h4>
2323 <p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run
2324as root and ~/.cups/lpoptions when run as a normal user.
2325
2326</p>
2327<h3 class="function"><a id="cupsSetEncryption">cupsSetEncryption</a></h3>
98d88c8d 2328 <p class="description">Set the encryption preference.</p>
798d6e29 2329<p class="code">
98d88c8d 2330void cupsSetEncryption(<a href="#http_encryption_t">http_encryption_t</a> e);</p>
798d6e29 2331<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2332<table class="list"><tbody>
2333<tr><th>e</th>
2334 <td class="description">New encryption preference</td></tr>
2335</tbody></table>
2336<h4 class="discussion">Discussion</h4>
798d6e29
MS
2337 <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
2338environment variable, then the ~/.cups/client.conf file, and finally the
2339/etc/cups/client.conf file. If not set, the default is
2340<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
2341<br>
2342Note: The current encryption setting is tracked separately for each thread
2343in a program. Multi-threaded programs that override the setting need to do
2344so in each thread for the same setting to be used.</p>
98d88c8d
MS
2345<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsSetPasswordCB2">cupsSetPasswordCB2</a></h3>
2346 <p class="description">Set the advanced password callback for CUPS.</p>
798d6e29 2347<p class="code">
98d88c8d 2348void cupsSetPasswordCB2(<a href="#cups_password_cb2_t">cups_password_cb2_t</a> cb, void *user_data);</p>
798d6e29 2349<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2350<table class="list"><tbody>
2351<tr><th>cb</th>
2352 <td class="description">Callback function</td></tr>
2353<tr><th>user_data</th>
2354 <td class="description">User data pointer</td></tr>
2355</tbody></table>
2356<h4 class="discussion">Discussion</h4>
798d6e29
MS
2357 <p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which
2358reads the password from the console. Programs should call either this
2359function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered
2360by a program per thread.<br>
2361<br>
2362Note: The current password callback is tracked separately for each thread
2363in a program. Multi-threaded programs that override the callback need to do
2364so in each thread for the same callback to be used.
2365
2366</p>
2367<h3 class="function"><a id="cupsSetServer">cupsSetServer</a></h3>
98d88c8d 2368 <p class="description">Set the default server name and port.</p>
798d6e29 2369<p class="code">
98d88c8d 2370void cupsSetServer(const char *server);</p>
798d6e29 2371<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2372<table class="list"><tbody>
2373<tr><th>server</th>
2374 <td class="description">Server name</td></tr>
2375</tbody></table>
2376<h4 class="discussion">Discussion</h4>
798d6e29
MS
2377 <p class="discussion">The &quot;server&quot; string can be a fully-qualified hostname, a numeric
2378IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP
2379addresses can be optionally followed by a colon and port number to override
2380the default port 631, e.g. &quot;hostname:8631&quot;. Pass <code>NULL</code> to restore the
2381default server name and port.<br>
2382<br>
2383Note: The current server is tracked separately for each thread in a program.
2384Multi-threaded programs that override the server need to do so in each
2385thread for the same server to be used.</p>
98d88c8d
MS
2386<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetServerCertCB">cupsSetServerCertCB</a></h3>
2387 <p class="description">Set the server certificate callback.</p>
798d6e29 2388<p class="code">
98d88c8d 2389void cupsSetServerCertCB(<a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a> cb, void *user_data);</p>
798d6e29 2390<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2391<table class="list"><tbody>
2392<tr><th>cb</th>
2393 <td class="description">Callback function</td></tr>
2394<tr><th>user_data</th>
2395 <td class="description">User data pointer</td></tr>
2396</tbody></table>
2397<h4 class="discussion">Discussion</h4>
798d6e29
MS
2398 <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
2399<br>
2400Note: The current credentials callback is tracked separately for each thread
2401in a program. Multi-threaded programs that override the callback need to do
2402so in each thread for the same callback to be used.
2403
2404</p>
2405<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsSetServerCredentials">cupsSetServerCredentials</a></h3>
2406 <p class="description">Set the default server credentials.</p>
2407<p class="code">
98d88c8d
MS
2408int cupsSetServerCredentials(const char *path, const char *common_name, int auto_create);</p>
2409<h4 class="parameters">Parameters</h4>
2410<table class="list"><tbody>
2411<tr><th>path</th>
2412 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
2413<tr><th>common_name</th>
2414 <td class="description">Default common name for server</td></tr>
2415<tr><th>auto_create</th>
2416 <td class="description">1 = automatically create self-signed certificates</td></tr>
2417</tbody></table>
798d6e29
MS
2418<h4 class="returnvalue">Return Value</h4>
2419 <p class="description">1 on success, 0 on failure</p>
2420<h4 class="discussion">Discussion</h4>
2421 <p class="discussion">Note: The server credentials are used by all threads in the running process.
2422This function is threadsafe.
2423
2424</p>
2425<h3 class="function"><a id="cupsSetUser">cupsSetUser</a></h3>
98d88c8d 2426 <p class="description">Set the default user name.</p>
798d6e29 2427<p class="code">
98d88c8d 2428void cupsSetUser(const char *user);</p>
798d6e29 2429<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2430<table class="list"><tbody>
2431<tr><th>user</th>
2432 <td class="description">User name</td></tr>
2433</tbody></table>
2434<h4 class="discussion">Discussion</h4>
798d6e29
MS
2435 <p class="discussion">Pass <code>NULL</code> to restore the default user name.<br>
2436<br>
2437Note: The current user name is tracked separately for each thread in a
2438program. Multi-threaded programs that override the user name need to do so
2439in each thread for the same user name to be used.</p>
98d88c8d
MS
2440<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsSetUserAgent">cupsSetUserAgent</a></h3>
2441 <p class="description">Set the default HTTP User-Agent string.</p>
798d6e29 2442<p class="code">
98d88c8d 2443void cupsSetUserAgent(const char *user_agent);</p>
798d6e29 2444<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2445<table class="list"><tbody>
2446<tr><th>user_agent</th>
2447 <td class="description">User-Agent string or <code>NULL</code></td></tr>
2448</tbody></table>
2449<h4 class="discussion">Discussion</h4>
798d6e29
MS
2450 <p class="discussion">Setting the string to NULL forces the default value containing the CUPS
2451version, IPP version, and operating system version and architecture.
2452
2453</p>
2454<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsStartDestDocument">cupsStartDestDocument</a></h3>
2455 <p class="description">Start a new document.</p>
2456<p class="code">
98d88c8d
MS
2457http_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>
2458<h4 class="parameters">Parameters</h4>
2459<table class="list"><tbody>
2460<tr><th>http</th>
2461 <td class="description">Connection to destination</td></tr>
2462<tr><th>dest</th>
2463 <td class="description">Destination</td></tr>
2464<tr><th>info</th>
2465 <td class="description">Destination information</td></tr>
2466<tr><th>job_id</th>
2467 <td class="description">Job ID</td></tr>
2468<tr><th>docname</th>
2469 <td class="description">Document name</td></tr>
2470<tr><th>format</th>
2471 <td class="description">Document format</td></tr>
2472<tr><th>num_options</th>
2473 <td class="description">Number of document options</td></tr>
2474<tr><th>options</th>
2475 <td class="description">Document options</td></tr>
2476<tr><th>last_document</th>
2477 <td class="description">1 if this is the last document</td></tr>
2478</tbody></table>
798d6e29
MS
2479<h4 class="returnvalue">Return Value</h4>
2480 <p class="description">Status of document creation</p>
2481<h4 class="discussion">Discussion</h4>
2482 <p class="discussion">&quot;job_id&quot; is the job ID returned by cupsCreateDestJob. &quot;docname&quot; is the name
2483of the document/file being printed, &quot;format&quot; is the MIME media type for the
2484document (see CUPS_FORMAT_xxx constants), and &quot;num_options&quot; and &quot;options&quot;
2485are the options do be applied to the document. &quot;last_document&quot; should be 1
2486if this is the last document to be submitted in the job. Returns
2487<code>HTTP_CONTINUE</code> on success.
2488
798d6e29
MS
2489</p>
2490<h3 class="function"><a id="cupsUser">cupsUser</a></h3>
2491 <p class="description">Return the current user's name.</p>
2492<p class="code">
98d88c8d 2493const char *cupsUser(void);</p>
798d6e29
MS
2494<h4 class="returnvalue">Return Value</h4>
2495 <p class="description">User name</p>
2496<h4 class="discussion">Discussion</h4>
2497 <p class="discussion">Note: The current user name is tracked separately for each thread in a
2498program. Multi-threaded programs that override the user name with the
2499<a href="#cupsSetUser"><code>cupsSetUser</code></a> function need to do so in each thread for the same user
2500name to be used.</p>
2501<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsUserAgent">cupsUserAgent</a></h3>
2502 <p class="description">Return the default HTTP User-Agent string.</p>
2503<p class="code">
98d88c8d 2504const char *cupsUserAgent(void);</p>
798d6e29
MS
2505<h4 class="returnvalue">Return Value</h4>
2506 <p class="description">User-Agent string</p>
2507<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAcceptConnection">httpAcceptConnection</a></h3>
2508 <p class="description">Accept a new HTTP client connection from the
2509specified listening socket.</p>
2510<p class="code">
98d88c8d 2511<a href="#http_t">http_t</a> *httpAcceptConnection(int fd, int blocking);</p>
798d6e29 2512<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2513<table class="list"><tbody>
2514<tr><th>fd</th>
2515 <td class="description">Listen socket file descriptor</td></tr>
2516<tr><th>blocking</th>
2517 <td class="description">1 if the connection should be
2518blocking, 0 otherwise</td></tr>
2519</tbody></table>
798d6e29
MS
2520<h4 class="returnvalue">Return Value</h4>
2521 <p class="description">HTTP connection or <code>NULL</code></p>
2522<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpAddCredential">httpAddCredential</a></h3>
2523 <p class="description">Allocates and adds a single credential to an array.</p>
2524<p class="code">
98d88c8d
MS
2525int httpAddCredential(cups_array_t *credentials, const void *data, size_t datalen);</p>
2526<h4 class="parameters">Parameters</h4>
2527<table class="list"><tbody>
2528<tr><th>credentials</th>
2529 <td class="description">Credentials array</td></tr>
2530<tr><th>data</th>
2531 <td class="description">PEM-encoded X.509 data</td></tr>
2532<tr><th>datalen</th>
2533 <td class="description">Length of data</td></tr>
2534</tbody></table>
798d6e29
MS
2535<h4 class="returnvalue">Return Value</h4>
2536 <p class="description">0 on success, -1 on error</p>
2537<h4 class="discussion">Discussion</h4>
2538 <p class="discussion">Use <code>cupsArrayNew(NULL, NULL)</code> to create a credentials array.
2539
2540</p>
2541<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrAny">httpAddrAny</a></h3>
2542 <p class="description">Check for the &quot;any&quot; address.</p>
2543<p class="code">
98d88c8d 2544int httpAddrAny(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2545<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2546<table class="list"><tbody>
2547<tr><th>addr</th>
2548 <td class="description">Address to check</td></tr>
2549</tbody></table>
798d6e29
MS
2550<h4 class="returnvalue">Return Value</h4>
2551 <p class="description">1 if &quot;any&quot;, 0 otherwise</p>
2552<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpAddrClose">httpAddrClose</a></h3>
2553 <p class="description">Close a socket created by <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> or
2554<a href="#httpAddrListen"><code>httpAddrListen</code></a>.</p>
2555<p class="code">
98d88c8d 2556int httpAddrClose(<a href="#http_addr_t">http_addr_t</a> *addr, int fd);</p>
798d6e29 2557<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2558<table class="list"><tbody>
2559<tr><th>addr</th>
2560 <td class="description">Listen address or <code>NULL</code></td></tr>
2561<tr><th>fd</th>
2562 <td class="description">Socket file descriptor</td></tr>
2563</tbody></table>
798d6e29
MS
2564<h4 class="returnvalue">Return Value</h4>
2565 <p class="description">0 on success, -1 on failure</p>
2566<h4 class="discussion">Discussion</h4>
98d88c8d
MS
2567 <p class="discussion">Pass <code>NULL</code> for sockets created with <a href="#httpAddrConnect2"><code>httpAddrConnect2</code></a> and the
2568listen address for sockets created with <a href="#httpAddrListen"><code>httpAddrListen</code></a>. This function
2569ensures that domain sockets are removed when closed.
798d6e29
MS
2570
2571</p>
798d6e29
MS
2572<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrConnect2">httpAddrConnect2</a></h3>
2573 <p class="description">Connect to any of the addresses in the list with a
2574timeout and optional cancel.</p>
2575<p class="code">
98d88c8d
MS
2576<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>
2577<h4 class="parameters">Parameters</h4>
2578<table class="list"><tbody>
2579<tr><th>addrlist</th>
2580 <td class="description">List of potential addresses</td></tr>
2581<tr><th>sock</th>
2582 <td class="description">Socket</td></tr>
2583<tr><th>msec</th>
2584 <td class="description">Timeout in milliseconds</td></tr>
2585<tr><th>cancel</th>
2586 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
2587</tbody></table>
798d6e29
MS
2588<h4 class="returnvalue">Return Value</h4>
2589 <p class="description">Connected address or NULL on failure</p>
2590<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrCopyList">httpAddrCopyList</a></h3>
2591 <p class="description">Copy an address list.</p>
2592<p class="code">
98d88c8d 2593<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrCopyList(<a href="#http_addrlist_t">http_addrlist_t</a> *src);</p>
798d6e29 2594<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2595<table class="list"><tbody>
2596<tr><th>src</th>
2597 <td class="description">Source address list</td></tr>
2598</tbody></table>
798d6e29
MS
2599<h4 class="returnvalue">Return Value</h4>
2600 <p class="description">New address list or <code>NULL</code> on error</p>
2601<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrEqual">httpAddrEqual</a></h3>
2602 <p class="description">Compare two addresses.</p>
2603<p class="code">
98d88c8d 2604int 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 2605<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2606<table class="list"><tbody>
2607<tr><th>addr1</th>
2608 <td class="description">First address</td></tr>
2609<tr><th>addr2</th>
2610 <td class="description">Second address</td></tr>
2611</tbody></table>
798d6e29
MS
2612<h4 class="returnvalue">Return Value</h4>
2613 <p class="description">1 if equal, 0 if not</p>
2614<h3 class="function"><a id="httpAddrFamily">httpAddrFamily</a></h3>
2615 <p class="description">Get the address family of an address.</p>
2616<p class="code">
98d88c8d 2617int httpAddrFamily(<a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2618<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2619<table class="list"><tbody>
2620<tr><th>addr</th>
2621 <td class="description">Address</td></tr>
2622</tbody></table>
798d6e29
MS
2623<h4 class="returnvalue">Return Value</h4>
2624 <p class="description">Address family</p>
98d88c8d
MS
2625<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrFreeList">httpAddrFreeList</a></h3>
2626 <p class="description">Free an address list.</p>
798d6e29 2627<p class="code">
98d88c8d 2628void httpAddrFreeList(<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist);</p>
798d6e29 2629<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2630<table class="list"><tbody>
2631<tr><th>addrlist</th>
2632 <td class="description">Address list to free</td></tr>
2633</tbody></table>
798d6e29
MS
2634<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrGetList">httpAddrGetList</a></h3>
2635 <p class="description">Get a list of addresses for a hostname.</p>
2636<p class="code">
98d88c8d
MS
2637<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrGetList(const char *hostname, int family, const char *service);</p>
2638<h4 class="parameters">Parameters</h4>
2639<table class="list"><tbody>
2640<tr><th>hostname</th>
2641 <td class="description">Hostname, IP address, or NULL for passive listen address</td></tr>
2642<tr><th>family</th>
2643 <td class="description">Address family or AF_UNSPEC</td></tr>
2644<tr><th>service</th>
2645 <td class="description">Service name or port number</td></tr>
2646</tbody></table>
798d6e29
MS
2647<h4 class="returnvalue">Return Value</h4>
2648 <p class="description">List of addresses or NULL</p>
2649<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLength">httpAddrLength</a></h3>
2650 <p class="description">Return the length of the address in bytes.</p>
2651<p class="code">
98d88c8d 2652int httpAddrLength(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2653<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2654<table class="list"><tbody>
2655<tr><th>addr</th>
2656 <td class="description">Address</td></tr>
2657</tbody></table>
798d6e29
MS
2658<h4 class="returnvalue">Return Value</h4>
2659 <p class="description">Length in bytes</p>
2660<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrListen">httpAddrListen</a></h3>
2661 <p class="description">Create a listening socket bound to the specified
2662address and port.</p>
2663<p class="code">
98d88c8d 2664int httpAddrListen(<a href="#http_addr_t">http_addr_t</a> *addr, int port);</p>
798d6e29 2665<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2666<table class="list"><tbody>
2667<tr><th>addr</th>
2668 <td class="description">Address to bind to</td></tr>
2669<tr><th>port</th>
2670 <td class="description">Port number to bind to</td></tr>
2671</tbody></table>
798d6e29
MS
2672<h4 class="returnvalue">Return Value</h4>
2673 <p class="description">Socket or -1 on error</p>
2674<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLocalhost">httpAddrLocalhost</a></h3>
2675 <p class="description">Check for the local loopback address.</p>
2676<p class="code">
98d88c8d 2677int httpAddrLocalhost(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2678<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2679<table class="list"><tbody>
2680<tr><th>addr</th>
2681 <td class="description">Address to check</td></tr>
2682</tbody></table>
798d6e29
MS
2683<h4 class="returnvalue">Return Value</h4>
2684 <p class="description">1 if local host, 0 otherwise</p>
2685<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLookup">httpAddrLookup</a></h3>
2686 <p class="description">Lookup the hostname associated with the address.</p>
2687<p class="code">
98d88c8d
MS
2688char *httpAddrLookup(const <a href="#http_addr_t">http_addr_t</a> *addr, char *name, int namelen);</p>
2689<h4 class="parameters">Parameters</h4>
2690<table class="list"><tbody>
2691<tr><th>addr</th>
2692 <td class="description">Address to lookup</td></tr>
2693<tr><th>name</th>
2694 <td class="description">Host name buffer</td></tr>
2695<tr><th>namelen</th>
2696 <td class="description">Size of name buffer</td></tr>
2697</tbody></table>
798d6e29
MS
2698<h4 class="returnvalue">Return Value</h4>
2699 <p class="description">Host name</p>
2700<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrPort">httpAddrPort</a></h3>
2701 <p class="description">Get the port number associated with an address.</p>
2702<p class="code">
98d88c8d 2703int httpAddrPort(<a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2704<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2705<table class="list"><tbody>
2706<tr><th>addr</th>
2707 <td class="description">Address</td></tr>
2708</tbody></table>
798d6e29
MS
2709<h4 class="returnvalue">Return Value</h4>
2710 <p class="description">Port number</p>
2711<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrString">httpAddrString</a></h3>
2712 <p class="description">Convert an address to a numeric string.</p>
2713<p class="code">
98d88c8d
MS
2714char *httpAddrString(const <a href="#http_addr_t">http_addr_t</a> *addr, char *s, int slen);</p>
2715<h4 class="parameters">Parameters</h4>
2716<table class="list"><tbody>
2717<tr><th>addr</th>
2718 <td class="description">Address to convert</td></tr>
2719<tr><th>s</th>
2720 <td class="description">String buffer</td></tr>
2721<tr><th>slen</th>
2722 <td class="description">Length of string</td></tr>
2723</tbody></table>
798d6e29
MS
2724<h4 class="returnvalue">Return Value</h4>
2725 <p class="description">Numeric address string</p>
2726<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAssembleURI">httpAssembleURI</a></h3>
2727 <p class="description">Assemble a uniform resource identifier from its
2728components.</p>
2729<p class="code">
98d88c8d
MS
2730<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>
2731<h4 class="parameters">Parameters</h4>
2732<table class="list"><tbody>
2733<tr><th>encoding</th>
2734 <td class="description">Encoding flags</td></tr>
2735<tr><th>uri</th>
2736 <td class="description">URI buffer</td></tr>
2737<tr><th>urilen</th>
2738 <td class="description">Size of URI buffer</td></tr>
2739<tr><th>scheme</th>
2740 <td class="description">Scheme name</td></tr>
2741<tr><th>username</th>
2742 <td class="description">Username</td></tr>
2743<tr><th>host</th>
2744 <td class="description">Hostname or address</td></tr>
2745<tr><th>port</th>
2746 <td class="description">Port number</td></tr>
2747<tr><th>resource</th>
2748 <td class="description">Resource</td></tr>
2749</tbody></table>
798d6e29
MS
2750<h4 class="returnvalue">Return Value</h4>
2751 <p class="description">URI status</p>
2752<h4 class="discussion">Discussion</h4>
2753 <p class="discussion">This function escapes reserved characters in the URI depending on the
2754value of the &quot;encoding&quot; argument. You should use this function in
2755place of traditional string functions whenever you need to create a
2756URI string.
2757
2758</p>
2759<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAssembleURIf">httpAssembleURIf</a></h3>
2760 <p class="description">Assemble a uniform resource identifier from its
2761components with a formatted resource.</p>
2762<p class="code">
98d88c8d
MS
2763<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>
2764<h4 class="parameters">Parameters</h4>
2765<table class="list"><tbody>
2766<tr><th>encoding</th>
2767 <td class="description">Encoding flags</td></tr>
2768<tr><th>uri</th>
2769 <td class="description">URI buffer</td></tr>
2770<tr><th>urilen</th>
2771 <td class="description">Size of URI buffer</td></tr>
2772<tr><th>scheme</th>
2773 <td class="description">Scheme name</td></tr>
2774<tr><th>username</th>
2775 <td class="description">Username</td></tr>
2776<tr><th>host</th>
2777 <td class="description">Hostname or address</td></tr>
2778<tr><th>port</th>
2779 <td class="description">Port number</td></tr>
2780<tr><th>resourcef</th>
2781 <td class="description">Printf-style resource</td></tr>
2782<tr><th>...</th>
2783 <td class="description">Additional arguments as needed</td></tr>
2784</tbody></table>
798d6e29
MS
2785<h4 class="returnvalue">Return Value</h4>
2786 <p class="description">URI status</p>
2787<h4 class="discussion">Discussion</h4>
2788 <p class="discussion">This function creates a formatted version of the resource string
2789argument &quot;resourcef&quot; and escapes reserved characters in the URI
2790depending on the value of the &quot;encoding&quot; argument. You should use
2791this function in place of traditional string functions whenever
2792you need to create a URI string.
2793
2794</p>
2795<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAssembleUUID">httpAssembleUUID</a></h3>
2796 <p class="description">Assemble a name-based UUID URN conforming to RFC 4122.</p>
2797<p class="code">
98d88c8d
MS
2798char *httpAssembleUUID(const char *server, int port, const char *name, int number, char *buffer, size_t bufsize);</p>
2799<h4 class="parameters">Parameters</h4>
2800<table class="list"><tbody>
2801<tr><th>server</th>
2802 <td class="description">Server name</td></tr>
2803<tr><th>port</th>
2804 <td class="description">Port number</td></tr>
2805<tr><th>name</th>
2806 <td class="description">Object name or NULL</td></tr>
2807<tr><th>number</th>
2808 <td class="description">Object number or 0</td></tr>
2809<tr><th>buffer</th>
2810 <td class="description">String buffer</td></tr>
2811<tr><th>bufsize</th>
2812 <td class="description">Size of buffer</td></tr>
2813</tbody></table>
798d6e29
MS
2814<h4 class="returnvalue">Return Value</h4>
2815 <p class="description">UUID string</p>
2816<h4 class="discussion">Discussion</h4>
2817 <p class="discussion">This function creates a unique 128-bit identifying number using the server
2818name, port number, random data, and optionally an object name and/or object
2819number. The result is formatted as a UUID URN as defined in RFC 4122.<br>
2820<br>
2821The buffer needs to be at least 46 bytes in size.
2822
2823</p>
2824<h3 class="function"><a id="httpBlocking">httpBlocking</a></h3>
98d88c8d 2825 <p class="description">Set blocking/non-blocking behavior on a connection.</p>
798d6e29 2826<p class="code">
98d88c8d 2827void httpBlocking(<a href="#http_t">http_t</a> *http, int b);</p>
798d6e29 2828<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2829<table class="list"><tbody>
2830<tr><th>http</th>
2831 <td class="description">HTTP connection</td></tr>
2832<tr><th>b</th>
2833 <td class="description">1 = blocking, 0 = non-blocking</td></tr>
2834</tbody></table>
798d6e29
MS
2835<h3 class="function"><a id="httpCheck">httpCheck</a></h3>
2836 <p class="description">Check to see if there is a pending response from the server.</p>
2837<p class="code">
98d88c8d 2838int httpCheck(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2839<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2840<table class="list"><tbody>
2841<tr><th>http</th>
2842 <td class="description">HTTP connection</td></tr>
2843</tbody></table>
798d6e29
MS
2844<h4 class="returnvalue">Return Value</h4>
2845 <p class="description">0 = no data, 1 = data available</p>
98d88c8d
MS
2846<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpClearCookie">httpClearCookie</a></h3>
2847 <p class="description">Clear the cookie value(s).</p>
798d6e29 2848<p class="code">
98d88c8d 2849void httpClearCookie(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2850<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2851<table class="list"><tbody>
2852<tr><th>http</th>
2853 <td class="description">HTTP connection</td></tr>
2854</tbody></table>
798d6e29 2855<h3 class="function"><a id="httpClearFields">httpClearFields</a></h3>
98d88c8d 2856 <p class="description">Clear HTTP request fields.</p>
798d6e29 2857<p class="code">
98d88c8d 2858void httpClearFields(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2859<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2860<table class="list"><tbody>
2861<tr><th>http</th>
2862 <td class="description">HTTP connection</td></tr>
2863</tbody></table>
798d6e29 2864<h3 class="function"><a id="httpClose">httpClose</a></h3>
98d88c8d 2865 <p class="description">Close an HTTP connection.</p>
798d6e29 2866<p class="code">
98d88c8d 2867void httpClose(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2868<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2869<table class="list"><tbody>
2870<tr><th>http</th>
2871 <td class="description">HTTP connection</td></tr>
2872</tbody></table>
798d6e29
MS
2873<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpCompareCredentials">httpCompareCredentials</a></h3>
2874 <p class="description">Compare two sets of X.509 credentials.</p>
2875<p class="code">
98d88c8d 2876int httpCompareCredentials(cups_array_t *cred1, cups_array_t *cred2);</p>
798d6e29 2877<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2878<table class="list"><tbody>
2879<tr><th>cred1</th>
2880 <td class="description">First set of X.509 credentials</td></tr>
2881<tr><th>cred2</th>
2882 <td class="description">Second set of X.509 credentials</td></tr>
2883</tbody></table>
53af7f21
MS
2884<h4 class="returnvalue">Return Value</h4>
2885 <p class="description">1 if they match, 0 if they do not</p>
798d6e29
MS
2886<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpConnect2">httpConnect2</a></h3>
2887 <p class="description">Connect to a HTTP server.</p>
2888<p class="code">
98d88c8d
MS
2889<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>
2890<h4 class="parameters">Parameters</h4>
2891<table class="list"><tbody>
2892<tr><th>host</th>
2893 <td class="description">Host to connect to</td></tr>
2894<tr><th>port</th>
2895 <td class="description">Port number</td></tr>
2896<tr><th>addrlist</th>
65bebeac 2897 <td class="description">List of addresses or <code>NULL</code> to lookup</td></tr>
98d88c8d
MS
2898<tr><th>family</th>
2899 <td class="description">Address family to use or <code>AF_UNSPEC</code> for any</td></tr>
2900<tr><th>encryption</th>
2901 <td class="description">Type of encryption to use</td></tr>
2902<tr><th>blocking</th>
2903 <td class="description">1 for blocking connection, 0 for non-blocking</td></tr>
2904<tr><th>msec</th>
2905 <td class="description">Connection timeout in milliseconds, 0 means don't connect</td></tr>
2906<tr><th>cancel</th>
2907 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
2908</tbody></table>
798d6e29
MS
2909<h4 class="returnvalue">Return Value</h4>
2910 <p class="description">New HTTP connection</p>
798d6e29
MS
2911<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpCopyCredentials">httpCopyCredentials</a></h3>
2912 <p class="description">Copy the credentials associated with the peer in
2913an encrypted connection.</p>
2914<p class="code">
98d88c8d 2915int httpCopyCredentials(<a href="#http_t">http_t</a> *http, cups_array_t **credentials);</p>
798d6e29 2916<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2917<table class="list"><tbody>
2918<tr><th>http</th>
2919 <td class="description">Connection to server</td></tr>
2920<tr><th>credentials</th>
2921 <td class="description">Array of credentials</td></tr>
2922</tbody></table>
798d6e29
MS
2923<h4 class="returnvalue">Return Value</h4>
2924 <p class="description">Status of call (0 = success)</p>
2925<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></h3>
2926 <p class="description">Return whether the credentials are valid for the given name.</p>
2927<p class="code">
98d88c8d 2928int httpCredentialsAreValidForName(cups_array_t *credentials, const char *common_name);</p>
798d6e29 2929<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2930<table class="list"><tbody>
2931<tr><th>credentials</th>
2932 <td class="description">Credentials</td></tr>
2933<tr><th>common_name</th>
2934 <td class="description">Name to check</td></tr>
2935</tbody></table>
798d6e29
MS
2936<h4 class="returnvalue">Return Value</h4>
2937 <p class="description">1 if valid, 0 otherwise</p>
2938<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></h3>
2939 <p class="description">Return the expiration date of the credentials.</p>
2940<p class="code">
98d88c8d 2941time_t httpCredentialsGetExpiration(cups_array_t *credentials);</p>
798d6e29 2942<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2943<table class="list"><tbody>
2944<tr><th>credentials</th>
2945 <td class="description">Credentials</td></tr>
2946</tbody></table>
798d6e29
MS
2947<h4 class="returnvalue">Return Value</h4>
2948 <p class="description">Expiration date of credentials</p>
2949<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsGetTrust">httpCredentialsGetTrust</a></h3>
2950 <p class="description">Return the trust of credentials.</p>
2951<p class="code">
98d88c8d 2952<a href="#http_trust_t">http_trust_t</a> httpCredentialsGetTrust(cups_array_t *credentials, const char *common_name);</p>
798d6e29 2953<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2954<table class="list"><tbody>
2955<tr><th>credentials</th>
2956 <td class="description">Credentials</td></tr>
2957<tr><th>common_name</th>
2958 <td class="description">Common name for trust lookup</td></tr>
2959</tbody></table>
798d6e29
MS
2960<h4 class="returnvalue">Return Value</h4>
2961 <p class="description">Level of trust</p>
2962<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsString">httpCredentialsString</a></h3>
2963 <p class="description">Return a string representing the credentials.</p>
2964<p class="code">
98d88c8d
MS
2965size_t httpCredentialsString(cups_array_t *credentials, char *buffer, size_t bufsize);</p>
2966<h4 class="parameters">Parameters</h4>
2967<table class="list"><tbody>
2968<tr><th>credentials</th>
2969 <td class="description">Credentials</td></tr>
2970<tr><th>buffer</th>
2971 <td class="description">Buffer or <code>NULL</code></td></tr>
2972<tr><th>bufsize</th>
2973 <td class="description">Size of buffer</td></tr>
2974</tbody></table>
798d6e29
MS
2975<h4 class="returnvalue">Return Value</h4>
2976 <p class="description">Total size of credentials string</p>
798d6e29
MS
2977<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="httpDecode64_2">httpDecode64_2</a></h3>
2978 <p class="description">Base64-decode a string.</p>
2979<p class="code">
98d88c8d
MS
2980char *httpDecode64_2(char *out, int *outlen, const char *in);</p>
2981<h4 class="parameters">Parameters</h4>
2982<table class="list"><tbody>
2983<tr><th>out</th>
2984 <td class="description">String to write to</td></tr>
2985<tr><th>outlen</th>
2986 <td class="description">Size of output string</td></tr>
2987<tr><th>in</th>
2988 <td class="description">String to read from</td></tr>
2989</tbody></table>
798d6e29
MS
2990<h4 class="returnvalue">Return Value</h4>
2991 <p class="description">Decoded string</p>
98d88c8d
MS
2992<h4 class="discussion">Discussion</h4>
2993 <p class="discussion">The caller must initialize &quot;outlen&quot; to the maximum size of the decoded
65bebeac 2994string before calling <code>httpDecode64_2</code>. On return &quot;outlen&quot; contains the
98d88c8d
MS
2995decoded length of the string.
2996
2997</p>
798d6e29
MS
2998<h3 class="function"><a id="httpDelete">httpDelete</a></h3>
2999 <p class="description">Send a DELETE request to the server.</p>
3000<p class="code">
98d88c8d 3001int httpDelete(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3002<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3003<table class="list"><tbody>
3004<tr><th>http</th>
3005 <td class="description">HTTP connection</td></tr>
3006<tr><th>uri</th>
3007 <td class="description">URI to delete</td></tr>
3008</tbody></table>
798d6e29
MS
3009<h4 class="returnvalue">Return Value</h4>
3010 <p class="description">Status of call (0 = success)</p>
798d6e29
MS
3011<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="httpEncode64_2">httpEncode64_2</a></h3>
3012 <p class="description">Base64-encode a string.</p>
3013<p class="code">
98d88c8d
MS
3014char *httpEncode64_2(char *out, int outlen, const char *in, int inlen);</p>
3015<h4 class="parameters">Parameters</h4>
3016<table class="list"><tbody>
3017<tr><th>out</th>
3018 <td class="description">String to write to</td></tr>
3019<tr><th>outlen</th>
3020 <td class="description">Maximum size of output string</td></tr>
3021<tr><th>in</th>
3022 <td class="description">String to read from</td></tr>
3023<tr><th>inlen</th>
3024 <td class="description">Size of input string</td></tr>
3025</tbody></table>
798d6e29
MS
3026<h4 class="returnvalue">Return Value</h4>
3027 <p class="description">Encoded string</p>
3028<h3 class="function"><a id="httpEncryption">httpEncryption</a></h3>
3029 <p class="description">Set the required encryption on the link.</p>
3030<p class="code">
98d88c8d 3031int httpEncryption(<a href="#http_t">http_t</a> *http, <a href="#http_encryption_t">http_encryption_t</a> e);</p>
798d6e29 3032<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3033<table class="list"><tbody>
3034<tr><th>http</th>
3035 <td class="description">HTTP connection</td></tr>
3036<tr><th>e</th>
3037 <td class="description">New encryption preference</td></tr>
3038</tbody></table>
798d6e29
MS
3039<h4 class="returnvalue">Return Value</h4>
3040 <p class="description">-1 on error, 0 on success</p>
3041<h3 class="function"><a id="httpError">httpError</a></h3>
3042 <p class="description">Get the last error on a connection.</p>
3043<p class="code">
98d88c8d 3044int httpError(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3045<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3046<table class="list"><tbody>
3047<tr><th>http</th>
3048 <td class="description">HTTP connection</td></tr>
3049</tbody></table>
798d6e29
MS
3050<h4 class="returnvalue">Return Value</h4>
3051 <p class="description">Error code (errno) value</p>
3052<h3 class="function"><a id="httpFieldValue">httpFieldValue</a></h3>
3053 <p class="description">Return the HTTP field enumeration value for a field
3054name.</p>
3055<p class="code">
98d88c8d 3056<a href="#http_field_t">http_field_t</a> httpFieldValue(const char *name);</p>
798d6e29 3057<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3058<table class="list"><tbody>
3059<tr><th>name</th>
3060 <td class="description">String name</td></tr>
3061</tbody></table>
798d6e29
MS
3062<h4 class="returnvalue">Return Value</h4>
3063 <p class="description">Field index</p>
3064<h3 class="function"><a id="httpFlush">httpFlush</a></h3>
65bebeac 3065 <p class="description">Flush data read from a HTTP connection.</p>
798d6e29 3066<p class="code">
98d88c8d 3067void httpFlush(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3068<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3069<table class="list"><tbody>
3070<tr><th>http</th>
3071 <td class="description">HTTP connection</td></tr>
3072</tbody></table>
798d6e29 3073<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpFlushWrite">httpFlushWrite</a></h3>
65bebeac 3074 <p class="description">Flush data written to a HTTP connection.</p>
798d6e29 3075<p class="code">
98d88c8d 3076int httpFlushWrite(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3077<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3078<table class="list"><tbody>
3079<tr><th>http</th>
3080 <td class="description">HTTP connection</td></tr>
3081</tbody></table>
798d6e29
MS
3082<h4 class="returnvalue">Return Value</h4>
3083 <p class="description">Bytes written or -1 on error</p>
3084<h3 class="function"><a id="httpFreeCredentials">httpFreeCredentials</a></h3>
98d88c8d 3085 <p class="description">Free an array of credentials.</p>
798d6e29 3086<p class="code">
98d88c8d 3087void httpFreeCredentials(cups_array_t *credentials);</p>
798d6e29 3088<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3089<table class="list"><tbody>
3090<tr><th>credentials</th>
3091 <td class="description">Array of credentials</td></tr>
3092</tbody></table>
798d6e29
MS
3093<h3 class="function"><a id="httpGet">httpGet</a></h3>
3094 <p class="description">Send a GET request to the server.</p>
3095<p class="code">
98d88c8d 3096int httpGet(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3097<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3098<table class="list"><tbody>
3099<tr><th>http</th>
3100 <td class="description">HTTP connection</td></tr>
3101<tr><th>uri</th>
3102 <td class="description">URI to get</td></tr>
3103</tbody></table>
798d6e29
MS
3104<h4 class="returnvalue">Return Value</h4>
3105 <p class="description">Status of call (0 = success)</p>
3106<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetActivity">httpGetActivity</a></h3>
3107 <p class="description">Get the most recent activity for a connection.</p>
3108<p class="code">
98d88c8d 3109time_t httpGetActivity(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3110<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3111<table class="list"><tbody>
3112<tr><th>http</th>
3113 <td class="description">HTTP connection</td></tr>
3114</tbody></table>
798d6e29
MS
3115<h4 class="returnvalue">Return Value</h4>
3116 <p class="description">Time of last read or write</p>
3117<h4 class="discussion">Discussion</h4>
65bebeac 3118 <p class="discussion">The return value is the time in seconds of the last read or write.
798d6e29
MS
3119
3120</p>
3121<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetAddress">httpGetAddress</a></h3>
3122 <p class="description">Get the address of the connected peer of a connection.</p>
3123<p class="code">
98d88c8d 3124<a href="#http_addr_t">http_addr_t</a> *httpGetAddress(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3125<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3126<table class="list"><tbody>
3127<tr><th>http</th>
3128 <td class="description">HTTP connection</td></tr>
3129</tbody></table>
798d6e29
MS
3130<h4 class="returnvalue">Return Value</h4>
3131 <p class="description">Connected address or <code>NULL</code></p>
3132<h4 class="discussion">Discussion</h4>
65bebeac
MS
3133 <p class="discussion">For connections created with <a href="#httpConnect2"><code>httpConnect2</code></a>, the address is for the
3134server. For connections created with <a href="#httpAccept"><code>httpAccept</code></a>, the address is for
3135the client.<br>
3136<br>
3137Returns <code>NULL</code> if the socket is currently unconnected.
798d6e29
MS
3138
3139</p>
3140<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="httpGetAuthString">httpGetAuthString</a></h3>
3141 <p class="description">Get the current authorization string.</p>
3142<p class="code">
98d88c8d 3143char *httpGetAuthString(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3144<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3145<table class="list"><tbody>
3146<tr><th>http</th>
3147 <td class="description">HTTP connection</td></tr>
3148</tbody></table>
798d6e29
MS
3149<h4 class="returnvalue">Return Value</h4>
3150 <p class="description">Authorization string</p>
3151<h4 class="discussion">Discussion</h4>
65bebeac
MS
3152 <p class="discussion">The authorization string is set by <a href="#cupsDoAuthentication"><code>cupsDoAuthentication</code></a> and
3153<a href="#httpSetAuthString"><code>httpSetAuthString</code></a>. Use <a href="#httpGetAuthString"><code>httpGetAuthString</code></a> to retrieve the
3154string to use with <a href="#httpSetField"><code>httpSetField</code></a> for the
3155<code>HTTP_FIELD_AUTHORIZATION</code> value.
798d6e29
MS
3156
3157</p>
3158<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetBlocking">httpGetBlocking</a></h3>
3159 <p class="description">Get the blocking/non-block state of a connection.</p>
3160<p class="code">
98d88c8d 3161int httpGetBlocking(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3162<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3163<table class="list"><tbody>
3164<tr><th>http</th>
3165 <td class="description">HTTP connection</td></tr>
3166</tbody></table>
798d6e29
MS
3167<h4 class="returnvalue">Return Value</h4>
3168 <p class="description">1 if blocking, 0 if non-blocking</p>
3169<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpGetContentEncoding">httpGetContentEncoding</a></h3>
3170 <p class="description">Get a common content encoding, if any, between
3171the client and server.</p>
3172<p class="code">
98d88c8d 3173const char *httpGetContentEncoding(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3174<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3175<table class="list"><tbody>
3176<tr><th>http</th>
3177 <td class="description">HTTP connection</td></tr>
3178</tbody></table>
798d6e29
MS
3179<h4 class="returnvalue">Return Value</h4>
3180 <p class="description">Content-Coding value or
3181<code>NULL</code> for the identity
3182coding.</p>
3183<h4 class="discussion">Discussion</h4>
3184 <p class="discussion">This function uses the value of the Accepts-Encoding HTTP header and must be
3185called after receiving a response from the server or a request from the
3186client. The value returned can be use in subsequent requests (for clients)
3187or in the response (for servers) in order to compress the content stream.
3188
3189</p>
3190<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpGetCookie">httpGetCookie</a></h3>
3191 <p class="description">Get any cookie data from the response.</p>
3192<p class="code">
98d88c8d 3193const char *httpGetCookie(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3194<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3195<table class="list"><tbody>
3196<tr><th>http</th>
3197 <td class="description">HTTP connection</td></tr>
3198</tbody></table>
798d6e29 3199<h4 class="returnvalue">Return Value</h4>
65bebeac 3200 <p class="description">Cookie data or <code>NULL</code></p>
798d6e29
MS
3201<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetDateString2">httpGetDateString2</a></h3>
3202 <p class="description">Get a formatted date/time string from a time value.</p>
3203<p class="code">
98d88c8d
MS
3204const char *httpGetDateString2(time_t t, char *s, int slen);</p>
3205<h4 class="parameters">Parameters</h4>
3206<table class="list"><tbody>
3207<tr><th>t</th>
65bebeac 3208 <td class="description">Time in seconds</td></tr>
98d88c8d
MS
3209<tr><th>s</th>
3210 <td class="description">String buffer</td></tr>
3211<tr><th>slen</th>
3212 <td class="description">Size of string buffer</td></tr>
3213</tbody></table>
798d6e29
MS
3214<h4 class="returnvalue">Return Value</h4>
3215 <p class="description">Date/time string</p>
3216<h3 class="function"><a id="httpGetDateTime">httpGetDateTime</a></h3>
3217 <p class="description">Get a time value from a formatted date/time string.</p>
3218<p class="code">
98d88c8d 3219time_t httpGetDateTime(const char *s);</p>
798d6e29 3220<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3221<table class="list"><tbody>
3222<tr><th>s</th>
3223 <td class="description">Date/time string</td></tr>
3224</tbody></table>
798d6e29 3225<h4 class="returnvalue">Return Value</h4>
65bebeac 3226 <p class="description">Time in seconds</p>
798d6e29
MS
3227<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetEncryption">httpGetEncryption</a></h3>
3228 <p class="description">Get the current encryption mode of a connection.</p>
3229<p class="code">
98d88c8d 3230<a href="#http_encryption_t">http_encryption_t</a> httpGetEncryption(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3231<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3232<table class="list"><tbody>
3233<tr><th>http</th>
3234 <td class="description">HTTP connection</td></tr>
3235</tbody></table>
798d6e29
MS
3236<h4 class="returnvalue">Return Value</h4>
3237 <p class="description">Current encryption mode</p>
3238<h4 class="discussion">Discussion</h4>
3239 <p class="discussion">This function returns the encryption mode for the connection. Use the
3240<a href="#httpIsEncrypted"><code>httpIsEncrypted</code></a> function to determine whether a TLS session has
3241been established.
3242
3243</p>
3244<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpGetExpect">httpGetExpect</a></h3>
3245 <p class="description">Get the value of the Expect header, if any.</p>
3246<p class="code">
98d88c8d 3247http_status_t httpGetExpect(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3248<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3249<table class="list"><tbody>
3250<tr><th>http</th>
3251 <td class="description">HTTP connection</td></tr>
3252</tbody></table>
798d6e29
MS
3253<h4 class="returnvalue">Return Value</h4>
3254 <p class="description">Expect: status, if any</p>
3255<h4 class="discussion">Discussion</h4>
3256 <p class="discussion">Returns <code>HTTP_STATUS_NONE</code> if there is no Expect header, otherwise
3257returns the expected HTTP status code, typically <code>HTTP_STATUS_CONTINUE</code>.
3258
3259</p>
3260<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetFd">httpGetFd</a></h3>
3261 <p class="description">Get the file descriptor associated with a connection.</p>
3262<p class="code">
98d88c8d 3263int httpGetFd(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3264<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3265<table class="list"><tbody>
3266<tr><th>http</th>
3267 <td class="description">HTTP connection</td></tr>
3268</tbody></table>
798d6e29
MS
3269<h4 class="returnvalue">Return Value</h4>
3270 <p class="description">File descriptor or -1 if none</p>
3271<h3 class="function"><a id="httpGetField">httpGetField</a></h3>
3272 <p class="description">Get a field value from a request/response.</p>
3273<p class="code">
98d88c8d 3274const char *httpGetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field);</p>
798d6e29 3275<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3276<table class="list"><tbody>
3277<tr><th>http</th>
3278 <td class="description">HTTP connection</td></tr>
3279<tr><th>field</th>
3280 <td class="description">Field to get</td></tr>
3281</tbody></table>
798d6e29
MS
3282<h4 class="returnvalue">Return Value</h4>
3283 <p class="description">Field value</p>
798d6e29
MS
3284<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetHostname">httpGetHostname</a></h3>
3285 <p class="description">Get the FQDN for the connection or local system.</p>
3286<p class="code">
98d88c8d
MS
3287const char *httpGetHostname(<a href="#http_t">http_t</a> *http, char *s, int slen);</p>
3288<h4 class="parameters">Parameters</h4>
3289<table class="list"><tbody>
3290<tr><th>http</th>
3291 <td class="description">HTTP connection or NULL</td></tr>
3292<tr><th>s</th>
3293 <td class="description">String buffer for name</td></tr>
3294<tr><th>slen</th>
3295 <td class="description">Size of buffer</td></tr>
3296</tbody></table>
798d6e29
MS
3297<h4 class="returnvalue">Return Value</h4>
3298 <p class="description">FQDN for connection or system</p>
3299<h4 class="discussion">Discussion</h4>
3300 <p class="discussion">When &quot;http&quot; points to a connected socket, return the hostname or
3301address that was used in the call to httpConnect() or httpConnectEncrypt(),
3302or the address of the client for the connection from httpAcceptConnection().
3303Otherwise, return the FQDN for the local system using both gethostname()
3304and gethostbyname() to get the local hostname with domain.
3305
3306</p>
3307<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetKeepAlive">httpGetKeepAlive</a></h3>
3308 <p class="description">Get the current Keep-Alive state of the connection.</p>
3309<p class="code">
98d88c8d 3310<a href="#http_keepalive_t">http_keepalive_t</a> httpGetKeepAlive(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3311<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3312<table class="list"><tbody>
3313<tr><th>http</th>
3314 <td class="description">HTTP connection</td></tr>
3315</tbody></table>
798d6e29
MS
3316<h4 class="returnvalue">Return Value</h4>
3317 <p class="description">Keep-Alive state</p>
798d6e29
MS
3318<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetLength2">httpGetLength2</a></h3>
3319 <p class="description">Get the amount of data remaining from the
3320content-length or transfer-encoding fields.</p>
3321<p class="code">
98d88c8d 3322off_t httpGetLength2(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3323<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3324<table class="list"><tbody>
3325<tr><th>http</th>
3326 <td class="description">HTTP connection</td></tr>
3327</tbody></table>
798d6e29
MS
3328<h4 class="returnvalue">Return Value</h4>
3329 <p class="description">Content length</p>
3330<h4 class="discussion">Discussion</h4>
3331 <p class="discussion">This function returns the complete content length, even for
3332content larger than 2^31 - 1.
3333
3334</p>
3335<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetPending">httpGetPending</a></h3>
3336 <p class="description">Get the number of bytes that are buffered for writing.</p>
3337<p class="code">
98d88c8d 3338size_t httpGetPending(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3339<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3340<table class="list"><tbody>
3341<tr><th>http</th>
3342 <td class="description">HTTP connection</td></tr>
3343</tbody></table>
798d6e29
MS
3344<h4 class="returnvalue">Return Value</h4>
3345 <p class="description">Number of bytes buffered</p>
3346<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetReady">httpGetReady</a></h3>
3347 <p class="description">Get the number of bytes that can be read without blocking.</p>
3348<p class="code">
98d88c8d 3349size_t httpGetReady(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3350<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3351<table class="list"><tbody>
3352<tr><th>http</th>
3353 <td class="description">HTTP connection</td></tr>
3354</tbody></table>
798d6e29
MS
3355<h4 class="returnvalue">Return Value</h4>
3356 <p class="description">Number of bytes available</p>
3357<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetRemaining">httpGetRemaining</a></h3>
3358 <p class="description">Get the number of remaining bytes in the message
3359body or current chunk.</p>
3360<p class="code">
98d88c8d 3361size_t httpGetRemaining(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3362<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3363<table class="list"><tbody>
3364<tr><th>http</th>
3365 <td class="description">HTTP connection</td></tr>
3366</tbody></table>
798d6e29
MS
3367<h4 class="returnvalue">Return Value</h4>
3368 <p class="description">Remaining bytes</p>
3369<h4 class="discussion">Discussion</h4>
3370 <p class="discussion">The <a href="#httpIsChunked"><code>httpIsChunked</code></a> function can be used to determine whether the
3371message body is chunked or fixed-length.
3372
3373</p>
3374<h3 class="function"><a id="httpGetState">httpGetState</a></h3>
3375 <p class="description">Get the current state of the HTTP request.</p>
3376<p class="code">
98d88c8d 3377<a href="#http_state_t">http_state_t</a> httpGetState(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3378<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3379<table class="list"><tbody>
3380<tr><th>http</th>
3381 <td class="description">HTTP connection</td></tr>
3382</tbody></table>
798d6e29
MS
3383<h4 class="returnvalue">Return Value</h4>
3384 <p class="description">HTTP state</p>
3385<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetStatus">httpGetStatus</a></h3>
3386 <p class="description">Get the status of the last HTTP request.</p>
3387<p class="code">
98d88c8d 3388http_status_t httpGetStatus(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3389<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3390<table class="list"><tbody>
3391<tr><th>http</th>
3392 <td class="description">HTTP connection</td></tr>
3393</tbody></table>
798d6e29
MS
3394<h4 class="returnvalue">Return Value</h4>
3395 <p class="description">HTTP status</p>
798d6e29
MS
3396<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetSubField2">httpGetSubField2</a></h3>
3397 <p class="description">Get a sub-field value.</p>
3398<p class="code">
98d88c8d
MS
3399char *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>
3400<h4 class="parameters">Parameters</h4>
3401<table class="list"><tbody>
3402<tr><th>http</th>
3403 <td class="description">HTTP connection</td></tr>
3404<tr><th>field</th>
3405 <td class="description">Field index</td></tr>
3406<tr><th>name</th>
3407 <td class="description">Name of sub-field</td></tr>
3408<tr><th>value</th>
3409 <td class="description">Value string</td></tr>
3410<tr><th>valuelen</th>
3411 <td class="description">Size of value buffer</td></tr>
3412</tbody></table>
798d6e29 3413<h4 class="returnvalue">Return Value</h4>
65bebeac 3414 <p class="description">Value or <code>NULL</code></p>
798d6e29
MS
3415<h3 class="function"><a id="httpGetVersion">httpGetVersion</a></h3>
3416 <p class="description">Get the HTTP version at the other end.</p>
3417<p class="code">
98d88c8d 3418<a href="#http_version_t">http_version_t</a> httpGetVersion(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3419<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3420<table class="list"><tbody>
3421<tr><th>http</th>
3422 <td class="description">HTTP connection</td></tr>
3423</tbody></table>
798d6e29
MS
3424<h4 class="returnvalue">Return Value</h4>
3425 <p class="description">Version number</p>
3426<h3 class="function"><a id="httpGets">httpGets</a></h3>
3427 <p class="description">Get a line of text from a HTTP connection.</p>
3428<p class="code">
98d88c8d
MS
3429char *httpGets(char *line, int length, <a href="#http_t">http_t</a> *http);</p>
3430<h4 class="parameters">Parameters</h4>
3431<table class="list"><tbody>
3432<tr><th>line</th>
3433 <td class="description">Line to read into</td></tr>
3434<tr><th>length</th>
3435 <td class="description">Max length of buffer</td></tr>
3436<tr><th>http</th>
3437 <td class="description">HTTP connection</td></tr>
3438</tbody></table>
798d6e29 3439<h4 class="returnvalue">Return Value</h4>
65bebeac 3440 <p class="description">Line or <code>NULL</code></p>
798d6e29
MS
3441<h3 class="function"><a id="httpHead">httpHead</a></h3>
3442 <p class="description">Send a HEAD request to the server.</p>
3443<p class="code">
98d88c8d 3444int httpHead(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3445<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3446<table class="list"><tbody>
3447<tr><th>http</th>
3448 <td class="description">HTTP connection</td></tr>
3449<tr><th>uri</th>
3450 <td class="description">URI for head</td></tr>
3451</tbody></table>
798d6e29
MS
3452<h4 class="returnvalue">Return Value</h4>
3453 <p class="description">Status of call (0 = success)</p>
3454<h3 class="function"><a id="httpInitialize">httpInitialize</a></h3>
53af7f21
MS
3455 <p class="description">Initialize the HTTP interface library and set the
3456default HTTP proxy (if any).</p>
98d88c8d
MS
3457<p class="code">
3458void httpInitialize(void);</p>
798d6e29
MS
3459<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpIsChunked">httpIsChunked</a></h3>
3460 <p class="description">Report whether a message body is chunked.</p>
3461<p class="code">
98d88c8d 3462int httpIsChunked(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3463<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3464<table class="list"><tbody>
3465<tr><th>http</th>
3466 <td class="description">HTTP connection</td></tr>
3467</tbody></table>
798d6e29
MS
3468<h4 class="returnvalue">Return Value</h4>
3469 <p class="description">1 if chunked, 0 if not</p>
3470<h4 class="discussion">Discussion</h4>
3471 <p class="discussion">This function returns non-zero if the message body is composed of
3472variable-length chunks.
3473
3474</p>
3475<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpIsEncrypted">httpIsEncrypted</a></h3>
3476 <p class="description">Report whether a connection is encrypted.</p>
3477<p class="code">
98d88c8d 3478int httpIsEncrypted(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3479<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3480<table class="list"><tbody>
3481<tr><th>http</th>
3482 <td class="description">HTTP connection</td></tr>
3483</tbody></table>
798d6e29
MS
3484<h4 class="returnvalue">Return Value</h4>
3485 <p class="description">1 if encrypted, 0 if not</p>
3486<h4 class="discussion">Discussion</h4>
3487 <p class="discussion">This function returns non-zero if the connection is currently encrypted.
3488
3489</p>
3490<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpLoadCredentials">httpLoadCredentials</a></h3>
3491 <p class="description">Load X.509 credentials from a keychain file.</p>
3492<p class="code">
98d88c8d
MS
3493int httpLoadCredentials(const char *path, cups_array_t **credentials, const char *common_name);</p>
3494<h4 class="parameters">Parameters</h4>
3495<table class="list"><tbody>
3496<tr><th>path</th>
3497 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
3498<tr><th>credentials</th>
3499 <td class="description">Credentials</td></tr>
3500<tr><th>common_name</th>
3501 <td class="description">Common name for credentials</td></tr>
3502</tbody></table>
798d6e29
MS
3503<h4 class="returnvalue">Return Value</h4>
3504 <p class="description">0 on success, -1 on error</p>
3505<h3 class="function"><a id="httpOptions">httpOptions</a></h3>
3506 <p class="description">Send an OPTIONS request to the server.</p>
3507<p class="code">
98d88c8d 3508int httpOptions(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3509<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3510<table class="list"><tbody>
3511<tr><th>http</th>
3512 <td class="description">HTTP connection</td></tr>
3513<tr><th>uri</th>
3514 <td class="description">URI for options</td></tr>
3515</tbody></table>
798d6e29
MS
3516<h4 class="returnvalue">Return Value</h4>
3517 <p class="description">Status of call (0 = success)</p>
3518<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpPeek">httpPeek</a></h3>
3519 <p class="description">Peek at data from a HTTP connection.</p>
3520<p class="code">
98d88c8d
MS
3521ssize_t httpPeek(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p>
3522<h4 class="parameters">Parameters</h4>
3523<table class="list"><tbody>
3524<tr><th>http</th>
3525 <td class="description">HTTP connection</td></tr>
3526<tr><th>buffer</th>
3527 <td class="description">Buffer for data</td></tr>
3528<tr><th>length</th>
3529 <td class="description">Maximum number of bytes</td></tr>
3530</tbody></table>
798d6e29
MS
3531<h4 class="returnvalue">Return Value</h4>
3532 <p class="description">Number of bytes copied</p>
3533<h4 class="discussion">Discussion</h4>
3534 <p class="discussion">This function copies available data from the given HTTP connection, reading
3535a buffer as needed. The data is still available for reading using
65bebeac 3536<a href="#httpRead2"><code>httpRead2</code></a>.<br>
798d6e29
MS
3537<br>
3538For non-blocking connections the usual timeouts apply.
3539
3540</p>
3541<h3 class="function"><a id="httpPost">httpPost</a></h3>
3542 <p class="description">Send a POST request to the server.</p>
3543<p class="code">
98d88c8d 3544int httpPost(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3545<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3546<table class="list"><tbody>
3547<tr><th>http</th>
3548 <td class="description">HTTP connection</td></tr>
3549<tr><th>uri</th>
3550 <td class="description">URI for post</td></tr>
3551</tbody></table>
798d6e29
MS
3552<h4 class="returnvalue">Return Value</h4>
3553 <p class="description">Status of call (0 = success)</p>
3554<h3 class="function"><a id="httpPut">httpPut</a></h3>
3555 <p class="description">Send a PUT request to the server.</p>
3556<p class="code">
98d88c8d 3557int httpPut(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3558<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3559<table class="list"><tbody>
3560<tr><th>http</th>
3561 <td class="description">HTTP connection</td></tr>
3562<tr><th>uri</th>
3563 <td class="description">URI to put</td></tr>
3564</tbody></table>
798d6e29
MS
3565<h4 class="returnvalue">Return Value</h4>
3566 <p class="description">Status of call (0 = success)</p>
798d6e29
MS
3567<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpRead2">httpRead2</a></h3>
3568 <p class="description">Read data from a HTTP connection.</p>
3569<p class="code">
98d88c8d
MS
3570ssize_t httpRead2(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p>
3571<h4 class="parameters">Parameters</h4>
3572<table class="list"><tbody>
3573<tr><th>http</th>
3574 <td class="description">HTTP connection</td></tr>
3575<tr><th>buffer</th>
3576 <td class="description">Buffer for data</td></tr>
3577<tr><th>length</th>
3578 <td class="description">Maximum number of bytes</td></tr>
3579</tbody></table>
798d6e29
MS
3580<h4 class="returnvalue">Return Value</h4>
3581 <p class="description">Number of bytes read</p>
3582<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpReadRequest">httpReadRequest</a></h3>
3583 <p class="description">Read a HTTP request from a connection.</p>
3584<p class="code">
98d88c8d
MS
3585<a href="#http_state_t">http_state_t</a> httpReadRequest(<a href="#http_t">http_t</a> *http, char *uri, size_t urilen);</p>
3586<h4 class="parameters">Parameters</h4>
3587<table class="list"><tbody>
3588<tr><th>http</th>
3589 <td class="description">HTTP connection</td></tr>
3590<tr><th>uri</th>
3591 <td class="description">URI buffer</td></tr>
3592<tr><th>urilen</th>
3593 <td class="description">Size of URI buffer</td></tr>
3594</tbody></table>
798d6e29
MS
3595<h4 class="returnvalue">Return Value</h4>
3596 <p class="description">New state of connection</p>
798d6e29
MS
3597<h3 class="function"><a id="httpReconnect2">httpReconnect2</a></h3>
3598 <p class="description">Reconnect to a HTTP server with timeout and optional
3599cancel.</p>
3600<p class="code">
98d88c8d
MS
3601int httpReconnect2(<a href="#http_t">http_t</a> *http, int msec, int *cancel);</p>
3602<h4 class="parameters">Parameters</h4>
3603<table class="list"><tbody>
3604<tr><th>http</th>
3605 <td class="description">HTTP connection</td></tr>
3606<tr><th>msec</th>
3607 <td class="description">Timeout in milliseconds</td></tr>
3608<tr><th>cancel</th>
3609 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
3610</tbody></table>
798d6e29
MS
3611<h4 class="returnvalue">Return Value</h4>
3612 <p class="description">0 on success, non-zero on failure</p>
3613<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpResolveHostname">httpResolveHostname</a></h3>
3614 <p class="description">Resolve the hostname of the HTTP connection
3615address.</p>
3616<p class="code">
98d88c8d
MS
3617const char *httpResolveHostname(<a href="#http_t">http_t</a> *http, char *buffer, size_t bufsize);</p>
3618<h4 class="parameters">Parameters</h4>
3619<table class="list"><tbody>
3620<tr><th>http</th>
3621 <td class="description">HTTP connection</td></tr>
3622<tr><th>buffer</th>
3623 <td class="description">Hostname buffer</td></tr>
3624<tr><th>bufsize</th>
3625 <td class="description">Size of buffer</td></tr>
3626</tbody></table>
798d6e29
MS
3627<h4 class="returnvalue">Return Value</h4>
3628 <p class="description">Resolved hostname or <code>NULL</code></p>
3629<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpSaveCredentials">httpSaveCredentials</a></h3>
3630 <p class="description">Save X.509 credentials to a keychain file.</p>
3631<p class="code">
98d88c8d
MS
3632int httpSaveCredentials(const char *path, cups_array_t *credentials, const char *common_name);</p>
3633<h4 class="parameters">Parameters</h4>
3634<table class="list"><tbody>
3635<tr><th>path</th>
3636 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
3637<tr><th>credentials</th>
3638 <td class="description">Credentials</td></tr>
3639<tr><th>common_name</th>
3640 <td class="description">Common name for credentials</td></tr>
3641</tbody></table>
798d6e29
MS
3642<h4 class="returnvalue">Return Value</h4>
3643 <p class="description">-1 on error, 0 on success</p>
798d6e29
MS
3644<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSeparateURI">httpSeparateURI</a></h3>
3645 <p class="description">Separate a Universal Resource Identifier into its
3646components.</p>
3647<p class="code">
98d88c8d
MS
3648<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>
3649<h4 class="parameters">Parameters</h4>
3650<table class="list"><tbody>
3651<tr><th>decoding</th>
3652 <td class="description">Decoding flags</td></tr>
3653<tr><th>uri</th>
3654 <td class="description">Universal Resource Identifier</td></tr>
3655<tr><th>scheme</th>
3656 <td class="description">Scheme (http, https, etc.)</td></tr>
3657<tr><th>schemelen</th>
3658 <td class="description">Size of scheme buffer</td></tr>
3659<tr><th>username</th>
3660 <td class="description">Username</td></tr>
3661<tr><th>usernamelen</th>
3662 <td class="description">Size of username buffer</td></tr>
3663<tr><th>host</th>
3664 <td class="description">Hostname</td></tr>
3665<tr><th>hostlen</th>
3666 <td class="description">Size of hostname buffer</td></tr>
3667<tr><th>port</th>
3668 <td class="description">Port number to use</td></tr>
3669<tr><th>resource</th>
3670 <td class="description">Resource/filename</td></tr>
3671<tr><th>resourcelen</th>
3672 <td class="description">Size of resource buffer</td></tr>
3673</tbody></table>
798d6e29
MS
3674<h4 class="returnvalue">Return Value</h4>
3675 <p class="description">Result of separation</p>
98d88c8d 3676<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="httpSetAuthString">httpSetAuthString</a></h3>
53af7f21 3677 <p class="description">Set the current authorization string.</p>
98d88c8d
MS
3678<p class="code">
3679void httpSetAuthString(<a href="#http_t">http_t</a> *http, const char *scheme, const char *data);</p>
3680<h4 class="parameters">Parameters</h4>
3681<table class="list"><tbody>
3682<tr><th>http</th>
3683 <td class="description">HTTP connection</td></tr>
3684<tr><th>scheme</th>
3685 <td class="description">Auth scheme (NULL to clear it)</td></tr>
3686<tr><th>data</th>
3687 <td class="description">Auth data (NULL for none)</td></tr>
3688</tbody></table>
3689<h4 class="discussion">Discussion</h4>
798d6e29 3690 <p class="discussion">This function just stores a copy of the current authorization string in
65bebeac
MS
3691the HTTP connection object. You must still call <a href="#httpSetField"><code>httpSetField</code></a> to set
3692<code>HTTP_FIELD_AUTHORIZATION</code> prior to issuing a HTTP request using
3693<a href="#httpGet"><code>httpGet</code></a>, <a href="#httpHead"><code>httpHead</code></a>, <a href="#httpOptions"><code>httpOptions</code></a>, <a href="#httpPost"><code>httpPost</code></a>, or
3694<a href="#httpPut"><code>httpPut</code></a>.
798d6e29
MS
3695
3696</p>
98d88c8d
MS
3697<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpSetCookie">httpSetCookie</a></h3>
3698 <p class="description">Set the cookie value(s).</p>
798d6e29 3699<p class="code">
98d88c8d 3700void httpSetCookie(<a href="#http_t">http_t</a> *http, const char *cookie);</p>
798d6e29 3701<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3702<table class="list"><tbody>
3703<tr><th>http</th>
3704 <td class="description">Connection</td></tr>
3705<tr><th>cookie</th>
3706 <td class="description">Cookie string</td></tr>
3707</tbody></table>
798d6e29
MS
3708<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpSetCredentials">httpSetCredentials</a></h3>
3709 <p class="description">Set the credentials associated with an encrypted
3710connection.</p>
3711<p class="code">
98d88c8d 3712int httpSetCredentials(<a href="#http_t">http_t</a> *http, cups_array_t *credentials);</p>
798d6e29 3713<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3714<table class="list"><tbody>
3715<tr><th>http</th>
3716 <td class="description">HTTP connection</td></tr>
3717<tr><th>credentials</th>
3718 <td class="description">Array of credentials</td></tr>
3719</tbody></table>
798d6e29
MS
3720<h4 class="returnvalue">Return Value</h4>
3721 <p class="description">Status of call (0 = success)</p>
98d88c8d 3722<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpSetDefaultField">httpSetDefaultField</a></h3>
53af7f21 3723 <p class="description">Set the default value of an HTTP header.</p>
98d88c8d
MS
3724<p class="code">
3725void httpSetDefaultField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p>
3726<h4 class="parameters">Parameters</h4>
3727<table class="list"><tbody>
3728<tr><th>http</th>
3729 <td class="description">HTTP connection</td></tr>
3730<tr><th>field</th>
3731 <td class="description">Field index</td></tr>
3732<tr><th>value</th>
3733 <td class="description">Value</td></tr>
3734</tbody></table>
3735<h4 class="discussion">Discussion</h4>
798d6e29
MS
3736 <p class="discussion">Currently only <code>HTTP_FIELD_ACCEPT_ENCODING</code>, <code>HTTP_FIELD_SERVER</code>,
3737and <code>HTTP_FIELD_USER_AGENT</code> can be set.
3738
3739</p>
98d88c8d
MS
3740<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSetExpect">httpSetExpect</a></h3>
3741 <p class="description">Set the Expect: header in a request.</p>
798d6e29 3742<p class="code">
98d88c8d 3743void httpSetExpect(<a href="#http_t">http_t</a> *http, http_status_t expect);</p>
798d6e29 3744<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3745<table class="list"><tbody>
3746<tr><th>http</th>
3747 <td class="description">HTTP connection</td></tr>
3748<tr><th>expect</th>
3749 <td class="description">HTTP status to expect
3750(<code>HTTP_STATUS_CONTINUE</code>)</td></tr>
3751</tbody></table>
3752<h4 class="discussion">Discussion</h4>
798d6e29
MS
3753 <p class="discussion">Currently only <code>HTTP_STATUS_CONTINUE</code> is supported for the &quot;expect&quot;
3754argument.
3755
3756</p>
3757<h3 class="function"><a id="httpSetField">httpSetField</a></h3>
53af7f21 3758 <p class="description">Set the value of an HTTP header.</p>
798d6e29 3759<p class="code">
98d88c8d
MS
3760void httpSetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p>
3761<h4 class="parameters">Parameters</h4>
3762<table class="list"><tbody>
3763<tr><th>http</th>
3764 <td class="description">HTTP connection</td></tr>
3765<tr><th>field</th>
3766 <td class="description">Field index</td></tr>
3767<tr><th>value</th>
3768 <td class="description">Value</td></tr>
3769</tbody></table>
3770<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpSetKeepAlive">httpSetKeepAlive</a></h3>
53af7f21 3771 <p class="description">Set the current Keep-Alive state of a connection.</p>
98d88c8d
MS
3772<p class="code">
3773void httpSetKeepAlive(<a href="#http_t">http_t</a> *http, <a href="#http_keepalive_t">http_keepalive_t</a> keep_alive);</p>
3774<h4 class="parameters">Parameters</h4>
3775<table class="list"><tbody>
3776<tr><th>http</th>
3777 <td class="description">HTTP connection</td></tr>
3778<tr><th>keep_alive</th>
3779 <td class="description">New Keep-Alive value</td></tr>
3780</tbody></table>
3781<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSetLength">httpSetLength</a></h3>
53af7f21 3782 <p class="description">Set the content-length and content-encoding.</p>
98d88c8d
MS
3783<p class="code">
3784void httpSetLength(<a href="#http_t">http_t</a> *http, size_t length);</p>
3785<h4 class="parameters">Parameters</h4>
3786<table class="list"><tbody>
3787<tr><th>http</th>
3788 <td class="description">HTTP connection</td></tr>
3789<tr><th>length</th>
3790 <td class="description">Length (0 for chunked)</td></tr>
3791</tbody></table>
3792<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpSetTimeout">httpSetTimeout</a></h3>
53af7f21 3793 <p class="description">Set read/write timeouts and an optional callback.</p>
98d88c8d
MS
3794<p class="code">
3795void 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>
3796<h4 class="parameters">Parameters</h4>
3797<table class="list"><tbody>
3798<tr><th>http</th>
3799 <td class="description">HTTP connection</td></tr>
3800<tr><th>timeout</th>
3801 <td class="description">Number of seconds for timeout,
3802must be greater than 0</td></tr>
3803<tr><th>cb</th>
65bebeac 3804 <td class="description">Callback function or <code>NULL</code></td></tr>
98d88c8d
MS
3805<tr><th>user_data</th>
3806 <td class="description">User data pointer</td></tr>
3807</tbody></table>
3808<h4 class="discussion">Discussion</h4>
798d6e29
MS
3809 <p class="discussion">The optional timeout callback receives both the HTTP connection and a user
3810data pointer and must return 1 to continue or 0 to error (time) out.
3811
3812</p>
98d88c8d
MS
3813<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpShutdown">httpShutdown</a></h3>
3814 <p class="description">Shutdown one side of an HTTP connection.</p>
798d6e29 3815<p class="code">
98d88c8d 3816void httpShutdown(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3817<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3818<table class="list"><tbody>
3819<tr><th>http</th>
3820 <td class="description">HTTP connection</td></tr>
3821</tbody></table>
798d6e29
MS
3822<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpStateString">httpStateString</a></h3>
3823 <p class="description">Return the string describing a HTTP state value.</p>
3824<p class="code">
98d88c8d 3825const char *httpStateString(<a href="#http_state_t">http_state_t</a> state);</p>
798d6e29 3826<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3827<table class="list"><tbody>
3828<tr><th>state</th>
3829 <td class="description">HTTP state value</td></tr>
3830</tbody></table>
798d6e29
MS
3831<h4 class="returnvalue">Return Value</h4>
3832 <p class="description">State string</p>
3833<h3 class="function"><a id="httpStatus">httpStatus</a></h3>
3834 <p class="description">Return a short string describing a HTTP status code.</p>
3835<p class="code">
98d88c8d 3836const char *httpStatus(http_status_t status);</p>
798d6e29 3837<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3838<table class="list"><tbody>
3839<tr><th>status</th>
3840 <td class="description">HTTP status code</td></tr>
3841</tbody></table>
798d6e29
MS
3842<h4 class="returnvalue">Return Value</h4>
3843 <p class="description">Localized status string</p>
3844<h4 class="discussion">Discussion</h4>
3845 <p class="discussion">The returned string is localized to the current POSIX locale and is based
65bebeac 3846on the status strings defined in RFC 7231.</p>
798d6e29
MS
3847<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpURIStatusString">httpURIStatusString</a></h3>
3848 <p class="description">Return a string describing a URI status code.</p>
3849<p class="code">
98d88c8d 3850const char *httpURIStatusString(<a href="#http_uri_status_t">http_uri_status_t</a> status);</p>
798d6e29 3851<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3852<table class="list"><tbody>
3853<tr><th>status</th>
3854 <td class="description">URI status code</td></tr>
3855</tbody></table>
798d6e29
MS
3856<h4 class="returnvalue">Return Value</h4>
3857 <p class="description">Localized status string</p>
3858<h3 class="function"><a id="httpUpdate">httpUpdate</a></h3>
3859 <p class="description">Update the current HTTP state for incoming data.</p>
3860<p class="code">
98d88c8d 3861http_status_t httpUpdate(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3862<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3863<table class="list"><tbody>
3864<tr><th>http</th>
3865 <td class="description">HTTP connection</td></tr>
3866</tbody></table>
798d6e29
MS
3867<h4 class="returnvalue">Return Value</h4>
3868 <p class="description">HTTP status</p>
3869<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpWait">httpWait</a></h3>
3870 <p class="description">Wait for data available on a connection.</p>
3871<p class="code">
98d88c8d 3872int httpWait(<a href="#http_t">http_t</a> *http, int msec);</p>
798d6e29 3873<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3874<table class="list"><tbody>
3875<tr><th>http</th>
3876 <td class="description">HTTP connection</td></tr>
3877<tr><th>msec</th>
3878 <td class="description">Milliseconds to wait</td></tr>
3879</tbody></table>
798d6e29
MS
3880<h4 class="returnvalue">Return Value</h4>
3881 <p class="description">1 if data is available, 0 otherwise</p>
798d6e29
MS
3882<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpWrite2">httpWrite2</a></h3>
3883 <p class="description">Write data to a HTTP connection.</p>
3884<p class="code">
98d88c8d
MS
3885ssize_t httpWrite2(<a href="#http_t">http_t</a> *http, const char *buffer, size_t length);</p>
3886<h4 class="parameters">Parameters</h4>
3887<table class="list"><tbody>
3888<tr><th>http</th>
3889 <td class="description">HTTP connection</td></tr>
3890<tr><th>buffer</th>
3891 <td class="description">Buffer for data</td></tr>
3892<tr><th>length</th>
3893 <td class="description">Number of bytes to write</td></tr>
3894</tbody></table>
798d6e29
MS
3895<h4 class="returnvalue">Return Value</h4>
3896 <p class="description">Number of bytes written</p>
3897<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpWriteResponse">httpWriteResponse</a></h3>
3898 <p class="description">Write a HTTP response to a client connection.</p>
3899<p class="code">
98d88c8d 3900int httpWriteResponse(<a href="#http_t">http_t</a> *http, http_status_t status);</p>
798d6e29 3901<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3902<table class="list"><tbody>
3903<tr><th>http</th>
3904 <td class="description">HTTP connection</td></tr>
3905<tr><th>status</th>
3906 <td class="description">Status code</td></tr>
3907</tbody></table>
798d6e29
MS
3908<h4 class="returnvalue">Return Value</h4>
3909 <p class="description">0 on success, -1 on error</p>
3910<h3 class="function"><a id="ippAddBoolean">ippAddBoolean</a></h3>
3911 <p class="description">Add a boolean attribute to an IPP message.</p>
3912<p class="code">
98d88c8d
MS
3913<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>
3914<h4 class="parameters">Parameters</h4>
3915<table class="list"><tbody>
3916<tr><th>ipp</th>
3917 <td class="description">IPP message</td></tr>
3918<tr><th>group</th>
3919 <td class="description">IPP group</td></tr>
3920<tr><th>name</th>
3921 <td class="description">Name of attribute</td></tr>
3922<tr><th>value</th>
3923 <td class="description">Value of attribute</td></tr>
3924</tbody></table>
798d6e29
MS
3925<h4 class="returnvalue">Return Value</h4>
3926 <p class="description">New attribute</p>
3927<h4 class="discussion">Discussion</h4>
3928 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3929the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3930<br>
3931The <code>group</code> parameter specifies the IPP attribute group tag: none
3932(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3933event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3934(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3935(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
3936<h3 class="function"><a id="ippAddBooleans">ippAddBooleans</a></h3>
3937 <p class="description">Add an array of boolean values.</p>
3938<p class="code">
98d88c8d
MS
3939<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>
3940<h4 class="parameters">Parameters</h4>
3941<table class="list"><tbody>
3942<tr><th>ipp</th>
3943 <td class="description">IPP message</td></tr>
3944<tr><th>group</th>
3945 <td class="description">IPP group</td></tr>
3946<tr><th>name</th>
3947 <td class="description">Name of attribute</td></tr>
3948<tr><th>num_values</th>
3949 <td class="description">Number of values</td></tr>
3950<tr><th>values</th>
3951 <td class="description">Values</td></tr>
3952</tbody></table>
798d6e29
MS
3953<h4 class="returnvalue">Return Value</h4>
3954 <p class="description">New attribute</p>
3955<h4 class="discussion">Discussion</h4>
3956 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3957the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3958<br>
3959The <code>group</code> parameter specifies the IPP attribute group tag: none
3960(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3961event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3962(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3963(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
3964<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippAddCollection">ippAddCollection</a></h3>
3965 <p class="description">Add a collection value.</p>
3966<p class="code">
98d88c8d
MS
3967<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>
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>name</th>
3975 <td class="description">Name of attribute</td></tr>
3976<tr><th>value</th>
3977 <td class="description">Value</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>).
3990
3991</p>
3992<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippAddCollections">ippAddCollections</a></h3>
3993 <p class="description">Add an array of collection values.</p>
3994<p class="code">
98d88c8d
MS
3995<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>
3996<h4 class="parameters">Parameters</h4>
3997<table class="list"><tbody>
3998<tr><th>ipp</th>
3999 <td class="description">IPP message</td></tr>
4000<tr><th>group</th>
4001 <td class="description">IPP group</td></tr>
4002<tr><th>name</th>
4003 <td class="description">Name of attribute</td></tr>
4004<tr><th>num_values</th>
4005 <td class="description">Number of values</td></tr>
4006<tr><th>values</th>
4007 <td class="description">Values</td></tr>
4008</tbody></table>
798d6e29
MS
4009<h4 class="returnvalue">Return Value</h4>
4010 <p class="description">New attribute</p>
4011<h4 class="discussion">Discussion</h4>
4012 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4013the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4014<br>
4015The <code>group</code> parameter specifies the IPP attribute group tag: none
4016(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4017event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4018(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4019(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
4020
4021</p>
4022<h3 class="function"><a id="ippAddDate">ippAddDate</a></h3>
65bebeac 4023 <p class="description">Add a dateTime attribute to an IPP message.</p>
798d6e29 4024<p class="code">
98d88c8d
MS
4025<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>
4026<h4 class="parameters">Parameters</h4>
4027<table class="list"><tbody>
4028<tr><th>ipp</th>
4029 <td class="description">IPP message</td></tr>
4030<tr><th>group</th>
4031 <td class="description">IPP group</td></tr>
4032<tr><th>name</th>
4033 <td class="description">Name of attribute</td></tr>
4034<tr><th>value</th>
4035 <td class="description">Value</td></tr>
4036</tbody></table>
798d6e29
MS
4037<h4 class="returnvalue">Return Value</h4>
4038 <p class="description">New attribute</p>
4039<h4 class="discussion">Discussion</h4>
4040 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4041the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4042<br>
4043The <code>group</code> parameter specifies the IPP attribute group tag: none
4044(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4045event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4046(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4047(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4048<h3 class="function"><a id="ippAddInteger">ippAddInteger</a></h3>
4049 <p class="description">Add a integer attribute to an IPP message.</p>
4050<p class="code">
98d88c8d
MS
4051<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>
4052<h4 class="parameters">Parameters</h4>
4053<table class="list"><tbody>
4054<tr><th>ipp</th>
4055 <td class="description">IPP message</td></tr>
4056<tr><th>group</th>
4057 <td class="description">IPP group</td></tr>
4058<tr><th>value_tag</th>
4059 <td class="description">Type of attribute</td></tr>
4060<tr><th>name</th>
4061 <td class="description">Name of attribute</td></tr>
4062<tr><th>value</th>
4063 <td class="description">Value of attribute</td></tr>
4064</tbody></table>
798d6e29
MS
4065<h4 class="returnvalue">Return Value</h4>
4066 <p class="description">New attribute</p>
4067<h4 class="discussion">Discussion</h4>
4068 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4069the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4070<br>
4071The <code>group</code> parameter specifies the IPP attribute group tag: none
4072(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4073event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4074(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4075(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4076<br>
4077Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
4078(<code>IPP_TAG_INTEGER</code>).</p>
4079<h3 class="function"><a id="ippAddIntegers">ippAddIntegers</a></h3>
4080 <p class="description">Add an array of integer values.</p>
4081<p class="code">
98d88c8d
MS
4082<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>
4083<h4 class="parameters">Parameters</h4>
4084<table class="list"><tbody>
4085<tr><th>ipp</th>
4086 <td class="description">IPP message</td></tr>
4087<tr><th>group</th>
4088 <td class="description">IPP group</td></tr>
4089<tr><th>value_tag</th>
4090 <td class="description">Type of attribute</td></tr>
4091<tr><th>name</th>
4092 <td class="description">Name of attribute</td></tr>
4093<tr><th>num_values</th>
4094 <td class="description">Number of values</td></tr>
4095<tr><th>values</th>
4096 <td class="description">Values</td></tr>
4097</tbody></table>
798d6e29
MS
4098<h4 class="returnvalue">Return Value</h4>
4099 <p class="description">New attribute</p>
4100<h4 class="discussion">Discussion</h4>
4101 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4102the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4103<br>
4104The <code>group</code> parameter specifies the IPP attribute group tag: none
4105(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4106event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4107(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4108(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4109<br>
4110Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
4111(<code>IPP_TAG_INTEGER</code>).</p>
4112<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippAddOctetString">ippAddOctetString</a></h3>
4113 <p class="description">Add an octetString value to an IPP message.</p>
4114<p class="code">
98d88c8d
MS
4115<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>
4116<h4 class="parameters">Parameters</h4>
4117<table class="list"><tbody>
4118<tr><th>ipp</th>
4119 <td class="description">IPP message</td></tr>
4120<tr><th>group</th>
4121 <td class="description">IPP group</td></tr>
4122<tr><th>name</th>
4123 <td class="description">Name of attribute</td></tr>
4124<tr><th>data</th>
4125 <td class="description">octetString data</td></tr>
4126<tr><th>datalen</th>
4127 <td class="description">Length of data in bytes</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.<br>
4134<br>
4135The <code>group</code> parameter specifies the IPP attribute group tag: none
4136(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4137event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4138(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4139(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
4140
4141</p>
4142<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippAddOutOfBand">ippAddOutOfBand</a></h3>
4143 <p class="description">Add an out-of-band value to an IPP message.</p>
4144<p class="code">
98d88c8d
MS
4145<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>
4146<h4 class="parameters">Parameters</h4>
4147<table class="list"><tbody>
4148<tr><th>ipp</th>
4149 <td class="description">IPP message</td></tr>
4150<tr><th>group</th>
4151 <td class="description">IPP group</td></tr>
4152<tr><th>value_tag</th>
4153 <td class="description">Type of attribute</td></tr>
4154<tr><th>name</th>
4155 <td class="description">Name of attribute</td></tr>
4156</tbody></table>
798d6e29
MS
4157<h4 class="returnvalue">Return Value</h4>
4158 <p class="description">New attribute</p>
4159<h4 class="discussion">Discussion</h4>
4160 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4161the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4162<br>
4163The <code>group</code> parameter specifies the IPP attribute group tag: none
4164(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4165event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4166(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4167(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4168<br>
4169Supported out-of-band values include unsupported-value
4170(<code>IPP_TAG_UNSUPPORTED_VALUE</code>), default (<code>IPP_TAG_DEFAULT</code>), unknown
4171(<code>IPP_TAG_UNKNOWN</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable
4172(<code>IPP_TAG_NOTSETTABLE</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), and
4173admin-define (<code>IPP_TAG_ADMINDEFINE</code>).
4174
4175</p>
4176<h3 class="function"><a id="ippAddRange">ippAddRange</a></h3>
4177 <p class="description">Add a range of values to an IPP message.</p>
4178<p class="code">
98d88c8d
MS
4179<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>
4180<h4 class="parameters">Parameters</h4>
4181<table class="list"><tbody>
4182<tr><th>ipp</th>
4183 <td class="description">IPP message</td></tr>
4184<tr><th>group</th>
4185 <td class="description">IPP group</td></tr>
4186<tr><th>name</th>
4187 <td class="description">Name of attribute</td></tr>
4188<tr><th>lower</th>
4189 <td class="description">Lower value</td></tr>
4190<tr><th>upper</th>
4191 <td class="description">Upper value</td></tr>
4192</tbody></table>
798d6e29
MS
4193<h4 class="returnvalue">Return Value</h4>
4194 <p class="description">New attribute</p>
4195<h4 class="discussion">Discussion</h4>
4196 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4197the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4198<br>
4199The <code>group</code> parameter specifies the IPP attribute group tag: none
4200(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4201event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4202(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4203(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4204<br>
4205The <code>lower</code> parameter must be less than or equal to the <code>upper</code> parameter.</p>
4206<h3 class="function"><a id="ippAddRanges">ippAddRanges</a></h3>
4207 <p class="description">Add ranges of values to an IPP message.</p>
4208<p class="code">
98d88c8d
MS
4209<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>
4210<h4 class="parameters">Parameters</h4>
4211<table class="list"><tbody>
4212<tr><th>ipp</th>
4213 <td class="description">IPP message</td></tr>
4214<tr><th>group</th>
4215 <td class="description">IPP group</td></tr>
4216<tr><th>name</th>
4217 <td class="description">Name of attribute</td></tr>
4218<tr><th>num_values</th>
4219 <td class="description">Number of values</td></tr>
4220<tr><th>lower</th>
4221 <td class="description">Lower values</td></tr>
4222<tr><th>upper</th>
4223 <td class="description">Upper values</td></tr>
4224</tbody></table>
798d6e29
MS
4225<h4 class="returnvalue">Return Value</h4>
4226 <p class="description">New attribute</p>
4227<h4 class="discussion">Discussion</h4>
4228 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4229the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4230<br>
4231The <code>group</code> parameter specifies the IPP attribute group tag: none
4232(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4233event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4234(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4235(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4236<h3 class="function"><a id="ippAddResolution">ippAddResolution</a></h3>
4237 <p class="description">Add a resolution value to an IPP message.</p>
4238<p class="code">
98d88c8d
MS
4239<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>
4240<h4 class="parameters">Parameters</h4>
4241<table class="list"><tbody>
4242<tr><th>ipp</th>
4243 <td class="description">IPP message</td></tr>
4244<tr><th>group</th>
4245 <td class="description">IPP group</td></tr>
4246<tr><th>name</th>
4247 <td class="description">Name of attribute</td></tr>
4248<tr><th>units</th>
4249 <td class="description">Units for resolution</td></tr>
4250<tr><th>xres</th>
4251 <td class="description">X resolution</td></tr>
4252<tr><th>yres</th>
4253 <td class="description">Y resolution</td></tr>
4254</tbody></table>
798d6e29
MS
4255<h4 class="returnvalue">Return Value</h4>
4256 <p class="description">New attribute</p>
4257<h4 class="discussion">Discussion</h4>
4258 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4259the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4260<br>
4261The <code>group</code> parameter specifies the IPP attribute group tag: none
4262(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4263event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4264(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4265(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4266<h3 class="function"><a id="ippAddResolutions">ippAddResolutions</a></h3>
4267 <p class="description">Add resolution values to an IPP message.</p>
4268<p class="code">
98d88c8d
MS
4269<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>
4270<h4 class="parameters">Parameters</h4>
4271<table class="list"><tbody>
4272<tr><th>ipp</th>
4273 <td class="description">IPP message</td></tr>
4274<tr><th>group</th>
4275 <td class="description">IPP group</td></tr>
4276<tr><th>name</th>
4277 <td class="description">Name of attribute</td></tr>
4278<tr><th>num_values</th>
4279 <td class="description">Number of values</td></tr>
4280<tr><th>units</th>
4281 <td class="description">Units for resolution</td></tr>
4282<tr><th>xres</th>
4283 <td class="description">X resolutions</td></tr>
4284<tr><th>yres</th>
4285 <td class="description">Y resolutions</td></tr>
4286</tbody></table>
798d6e29
MS
4287<h4 class="returnvalue">Return Value</h4>
4288 <p class="description">New attribute</p>
4289<h4 class="discussion">Discussion</h4>
4290 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4291the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4292<br>
4293The <code>group</code> parameter specifies the IPP attribute group tag: none
4294(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4295event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4296(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4297(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4298<h3 class="function"><a id="ippAddSeparator">ippAddSeparator</a></h3>
4299 <p class="description">Add a group separator to an IPP message.</p>
4300<p class="code">
98d88c8d 4301<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddSeparator(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4302<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4303<table class="list"><tbody>
4304<tr><th>ipp</th>
4305 <td class="description">IPP message</td></tr>
4306</tbody></table>
798d6e29
MS
4307<h4 class="returnvalue">Return Value</h4>
4308 <p class="description">New attribute</p>
4309<h4 class="discussion">Discussion</h4>
4310 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4311the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.</p>
4312<h3 class="function"><a id="ippAddString">ippAddString</a></h3>
4313 <p class="description">Add a language-encoded string to an IPP message.</p>
4314<p class="code">
98d88c8d
MS
4315<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>
4316<h4 class="parameters">Parameters</h4>
4317<table class="list"><tbody>
4318<tr><th>ipp</th>
4319 <td class="description">IPP message</td></tr>
4320<tr><th>group</th>
4321 <td class="description">IPP group</td></tr>
4322<tr><th>value_tag</th>
4323 <td class="description">Type of attribute</td></tr>
4324<tr><th>name</th>
4325 <td class="description">Name of attribute</td></tr>
4326<tr><th>language</th>
4327 <td class="description">Language code</td></tr>
4328<tr><th>value</th>
4329 <td class="description">Value</td></tr>
4330</tbody></table>
798d6e29
MS
4331<h4 class="returnvalue">Return Value</h4>
4332 <p class="description">New attribute</p>
4333<h4 class="discussion">Discussion</h4>
4334 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4335the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4336<br>
4337The <code>group</code> parameter specifies the IPP attribute group tag: none
4338(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4339event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4340(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4341(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4342<br>
4343Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4344(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4345(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4346(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4347(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4348(<code>IPP_TAG_URISCHEME</code>).<br>
4349<br>
4350The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
4351textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
4352<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippAddStringf">ippAddStringf</a></h3>
4353 <p class="description">Add a formatted string to an IPP message.</p>
4354<p class="code">
98d88c8d
MS
4355<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>
4356<h4 class="parameters">Parameters</h4>
4357<table class="list"><tbody>
4358<tr><th>ipp</th>
4359 <td class="description">IPP message</td></tr>
4360<tr><th>group</th>
4361 <td class="description">IPP group</td></tr>
4362<tr><th>value_tag</th>
4363 <td class="description">Type of attribute</td></tr>
4364<tr><th>name</th>
4365 <td class="description">Name of attribute</td></tr>
4366<tr><th>language</th>
4367 <td class="description">Language code (<code>NULL</code> for default)</td></tr>
4368<tr><th>format</th>
4369 <td class="description">Printf-style format string</td></tr>
4370<tr><th>...</th>
4371 <td class="description">Additional arguments as needed</td></tr>
4372</tbody></table>
798d6e29
MS
4373<h4 class="returnvalue">Return Value</h4>
4374 <p class="description">New attribute</p>
4375<h4 class="discussion">Discussion</h4>
4376 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4377the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4378<br>
4379The <code>group</code> parameter specifies the IPP attribute group tag: none
4380(<code>IPP_TAG_ZERO</code>, for member attributes), document
4381(<code>IPP_TAG_DOCUMENT</code>), event notification
4382(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
4383printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
4384or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4385<br>
4386Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4387(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4388(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4389(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4390(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4391(<code>IPP_TAG_URISCHEME</code>).<br>
4392<br>
4393The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
4394and textWithLanguage string values and must be <code>NULL</code> for all other
4395string values.<br>
4396<br>
4397The <code>format</code> parameter uses formatting characters compatible with the
4398printf family of standard functions. Additional arguments follow it as
4399needed. The formatted string is truncated as needed to the maximum length of
4400the corresponding value type.
4401
4402</p>
4403<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippAddStringfv">ippAddStringfv</a></h3>
4404 <p class="description">Add a formatted string to an IPP message.</p>
4405<p class="code">
98d88c8d
MS
4406<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>
4407<h4 class="parameters">Parameters</h4>
4408<table class="list"><tbody>
4409<tr><th>ipp</th>
4410 <td class="description">IPP message</td></tr>
4411<tr><th>group</th>
4412 <td class="description">IPP group</td></tr>
4413<tr><th>value_tag</th>
4414 <td class="description">Type of attribute</td></tr>
4415<tr><th>name</th>
4416 <td class="description">Name of attribute</td></tr>
4417<tr><th>language</th>
4418 <td class="description">Language code (<code>NULL</code> for default)</td></tr>
4419<tr><th>format</th>
4420 <td class="description">Printf-style format string</td></tr>
4421<tr><th>ap</th>
4422 <td class="description">Additional arguments</td></tr>
4423</tbody></table>
798d6e29
MS
4424<h4 class="returnvalue">Return Value</h4>
4425 <p class="description">New attribute</p>
4426<h4 class="discussion">Discussion</h4>
4427 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4428the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4429<br>
4430The <code>group</code> parameter specifies the IPP attribute group tag: none
4431(<code>IPP_TAG_ZERO</code>, for member attributes), document
4432(<code>IPP_TAG_DOCUMENT</code>), event notification
4433(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
4434printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
4435or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4436<br>
4437Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4438(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4439(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4440(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4441(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4442(<code>IPP_TAG_URISCHEME</code>).<br>
4443<br>
4444The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
4445and textWithLanguage string values and must be <code>NULL</code> for all other
4446string values.<br>
4447<br>
4448The <code>format</code> parameter uses formatting characters compatible with the
4449printf family of standard functions. Additional arguments are passed in the
4450stdarg pointer <code>ap</code>. The formatted string is truncated as needed to the
4451maximum length of the corresponding value type.
4452
4453</p>
4454<h3 class="function"><a id="ippAddStrings">ippAddStrings</a></h3>
4455 <p class="description">Add language-encoded strings to an IPP message.</p>
4456<p class="code">
98d88c8d
MS
4457<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>
4458<h4 class="parameters">Parameters</h4>
4459<table class="list"><tbody>
4460<tr><th>ipp</th>
4461 <td class="description">IPP message</td></tr>
4462<tr><th>group</th>
4463 <td class="description">IPP group</td></tr>
4464<tr><th>value_tag</th>
4465 <td class="description">Type of attribute</td></tr>
4466<tr><th>name</th>
4467 <td class="description">Name of attribute</td></tr>
4468<tr><th>num_values</th>
4469 <td class="description">Number of values</td></tr>
4470<tr><th>language</th>
4471 <td class="description">Language code (<code>NULL</code> for default)</td></tr>
4472<tr><th>values</th>
4473 <td class="description">Values</td></tr>
4474</tbody></table>
798d6e29
MS
4475<h4 class="returnvalue">Return Value</h4>
4476 <p class="description">New attribute</p>
4477<h4 class="discussion">Discussion</h4>
4478 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4479the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4480<br>
4481The <code>group</code> parameter specifies the IPP attribute group tag: none
4482(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4483event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4484(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4485(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4486<br>
4487Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4488(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4489(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4490(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4491(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4492(<code>IPP_TAG_URISCHEME</code>).<br>
4493<br>
4494The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
4495textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
4496<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippAttributeString">ippAttributeString</a></h3>
4497 <p class="description">Convert the attribute's value to a string.</p>
4498<p class="code">
98d88c8d
MS
4499size_t ippAttributeString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, char *buffer, size_t bufsize);</p>
4500<h4 class="parameters">Parameters</h4>
4501<table class="list"><tbody>
4502<tr><th>attr</th>
4503 <td class="description">Attribute</td></tr>
4504<tr><th>buffer</th>
4505 <td class="description">String buffer or NULL</td></tr>
4506<tr><th>bufsize</th>
4507 <td class="description">Size of string buffer</td></tr>
4508</tbody></table>
798d6e29
MS
4509<h4 class="returnvalue">Return Value</h4>
4510 <p class="description">Number of bytes less nul</p>
4511<h4 class="discussion">Discussion</h4>
4512 <p class="discussion">Returns the number of bytes that would be written, not including the
4513trailing nul. The buffer pointer can be NULL to get the required length,
4514just like (v)snprintf.
4515
4516</p>
4517<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippContainsInteger">ippContainsInteger</a></h3>
4518 <p class="description">Determine whether an attribute contains the
4519specified value or is within the list of ranges.</p>
4520<p class="code">
98d88c8d 4521int ippContainsInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int value);</p>
798d6e29 4522<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4523<table class="list"><tbody>
4524<tr><th>attr</th>
4525 <td class="description">Attribute</td></tr>
4526<tr><th>value</th>
4527 <td class="description">Integer/enum value</td></tr>
4528</tbody></table>
798d6e29
MS
4529<h4 class="returnvalue">Return Value</h4>
4530 <p class="description">1 on a match, 0 on no match</p>
4531<h4 class="discussion">Discussion</h4>
4532 <p class="discussion">Returns non-zero when the attribute contains either a matching integer or
4533enum value, or the value falls within one of the rangeOfInteger values for
4534the attribute.
4535
4536</p>
4537<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippContainsString">ippContainsString</a></h3>
4538 <p class="description">Determine whether an attribute contains the
4539specified string value.</p>
4540<p class="code">
98d88c8d 4541int ippContainsString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, const char *value);</p>
798d6e29 4542<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4543<table class="list"><tbody>
4544<tr><th>attr</th>
4545 <td class="description">Attribute</td></tr>
4546<tr><th>value</th>
4547 <td class="description">String value</td></tr>
4548</tbody></table>
798d6e29
MS
4549<h4 class="returnvalue">Return Value</h4>
4550 <p class="description">1 on a match, 0 on no match</p>
4551<h4 class="discussion">Discussion</h4>
4552 <p class="discussion">Returns non-zero when the attribute contains a matching charset, keyword,
65bebeac 4553naturalLanguage, mimeMediaType, name, text, uri, or uriScheme value.
798d6e29
MS
4554
4555</p>
4556<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippCopyAttribute">ippCopyAttribute</a></h3>
4557 <p class="description">Copy an attribute.</p>
4558<p class="code">
98d88c8d
MS
4559<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>
4560<h4 class="parameters">Parameters</h4>
4561<table class="list"><tbody>
4562<tr><th>dst</th>
4563 <td class="description">Destination IPP message</td></tr>
4564<tr><th>srcattr</th>
4565 <td class="description">Attribute to copy</td></tr>
4566<tr><th>quickcopy</th>
4567 <td class="description">1 for a referenced copy, 0 for normal</td></tr>
4568</tbody></table>
798d6e29
MS
4569<h4 class="returnvalue">Return Value</h4>
4570 <p class="description">New attribute</p>
4571<h4 class="discussion">Discussion</h4>
4572 <p class="discussion">The specified attribute, <code>attr</code>, is copied to the destination IPP message.
4573When <code>quickcopy</code> is non-zero, a &quot;shallow&quot; reference copy of the attribute is
4574created - this should only be done as long as the original source IPP message will
4575not be freed for the life of the destination.
4576
4577</p>
4578<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippCopyAttributes">ippCopyAttributes</a></h3>
4579 <p class="description">Copy attributes from one IPP message to another.</p>
4580<p class="code">
98d88c8d
MS
4581int 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>
4582<h4 class="parameters">Parameters</h4>
4583<table class="list"><tbody>
4584<tr><th>dst</th>
4585 <td class="description">Destination IPP message</td></tr>
4586<tr><th>src</th>
4587 <td class="description">Source IPP message</td></tr>
4588<tr><th>quickcopy</th>
4589 <td class="description">1 for a referenced copy, 0 for normal</td></tr>
4590<tr><th>cb</th>
4591 <td class="description">Copy callback or <code>NULL</code> for none</td></tr>
4592<tr><th>context</th>
4593 <td class="description">Context pointer</td></tr>
4594</tbody></table>
798d6e29
MS
4595<h4 class="returnvalue">Return Value</h4>
4596 <p class="description">1 on success, 0 on error</p>
4597<h4 class="discussion">Discussion</h4>
4598 <p class="discussion">Zero or more attributes are copied from the source IPP message, <code>src</code>, to the
4599destination IPP message, <code>dst</code>. When <code>quickcopy</code> is non-zero, a &quot;shallow&quot;
4600reference copy of the attribute is created - this should only be done as long as the
4601original source IPP message will not be freed for the life of the destination.<br>
4602<br>
4603The <code>cb</code> and <code>context</code> parameters provide a generic way to &quot;filter&quot; the
4604attributes that are copied - the function must return 1 to copy the attribute or
46050 to skip it. The function may also choose to do a partial copy of the source attribute
4606itself.
4607
4608</p>
4609<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippCreateRequestedArray">ippCreateRequestedArray</a></h3>
4610 <p class="description">Create a CUPS array of attribute names from the
4611given requested-attributes attribute.</p>
4612<p class="code">
98d88c8d 4613cups_array_t *ippCreateRequestedArray(<a href="#ipp_t">ipp_t</a> *request);</p>
798d6e29 4614<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4615<table class="list"><tbody>
4616<tr><th>request</th>
4617 <td class="description">IPP request</td></tr>
4618</tbody></table>
798d6e29
MS
4619<h4 class="returnvalue">Return Value</h4>
4620 <p class="description">CUPS array or <code>NULL</code> if all</p>
4621<h4 class="discussion">Discussion</h4>
4622 <p class="discussion">This function creates a (sorted) CUPS array of attribute names matching the
4623list of &quot;requested-attribute&quot; values supplied in an IPP request. All IANA-
4624registered values are supported in addition to the CUPS IPP extension
4625attributes.<br>
4626<br>
4627The <code>request</code> parameter specifies the request message that was read from
4628the client.
4629
4630<code>NULL</code> is returned if all attributes should be returned. Otherwise, the
4631result is a sorted array of attribute names, where <code>cupsArrayFind(array,
4632"attribute-name")</code> will return a non-NULL pointer. The array must be freed
4633using the <code>cupsArrayDelete</code> function.
4634
4635</p>
4636<h3 class="function"><a id="ippDateToTime">ippDateToTime</a></h3>
65bebeac
MS
4637 <p class="description">Convert from RFC 2579 Date/Time format to time in
4638seconds.</p>
798d6e29 4639<p class="code">
98d88c8d 4640time_t ippDateToTime(const <a href="#ipp_uchar_t">ipp_uchar_t</a> *date);</p>
798d6e29 4641<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4642<table class="list"><tbody>
4643<tr><th>date</th>
65bebeac 4644 <td class="description">RFC 2579 date info</td></tr>
98d88c8d 4645</tbody></table>
798d6e29
MS
4646<h4 class="returnvalue">Return Value</h4>
4647 <p class="description">UNIX time value</p>
4648<h3 class="function"><a id="ippDelete">ippDelete</a></h3>
98d88c8d 4649 <p class="description">Delete an IPP message.</p>
798d6e29 4650<p class="code">
98d88c8d 4651void ippDelete(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4652<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4653<table class="list"><tbody>
4654<tr><th>ipp</th>
4655 <td class="description">IPP message</td></tr>
4656</tbody></table>
4657<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippDeleteAttribute">ippDeleteAttribute</a></h3>
53af7f21 4658 <p class="description">Delete a single attribute in an IPP message.</p>
98d88c8d
MS
4659<p class="code">
4660void ippDeleteAttribute(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
4661<h4 class="parameters">Parameters</h4>
4662<table class="list"><tbody>
4663<tr><th>ipp</th>
4664 <td class="description">IPP message</td></tr>
4665<tr><th>attr</th>
4666 <td class="description">Attribute to delete</td></tr>
4667</tbody></table>
798d6e29
MS
4668<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippDeleteValues">ippDeleteValues</a></h3>
4669 <p class="description">Delete values in an attribute.</p>
4670<p class="code">
98d88c8d
MS
4671int ippDeleteValues(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int count);</p>
4672<h4 class="parameters">Parameters</h4>
4673<table class="list"><tbody>
4674<tr><th>ipp</th>
4675 <td class="description">IPP message</td></tr>
4676<tr><th>attr</th>
4677 <td class="description">Attribute</td></tr>
4678<tr><th>element</th>
4679 <td class="description">Index of first value to delete (0-based)</td></tr>
4680<tr><th>count</th>
4681 <td class="description">Number of values to delete</td></tr>
4682</tbody></table>
798d6e29
MS
4683<h4 class="returnvalue">Return Value</h4>
4684 <p class="description">1 on success, 0 on failure</p>
4685<h4 class="discussion">Discussion</h4>
4686 <p class="discussion">The <code>element</code> parameter specifies the first value to delete, starting at
46870. It must be less than the number of values returned by <a href="#ippGetCount"><code>ippGetCount</code></a>.<br>
4688<br>
4689The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4690<br>
4691Deleting all values in an attribute deletes the attribute.
4692
4693</p>
4694<h3 class="function"><a id="ippEnumString">ippEnumString</a></h3>
4695 <p class="description">Return a string corresponding to the enum value.</p>
4696<p class="code">
98d88c8d 4697const char *ippEnumString(const char *attrname, int enumvalue);</p>
798d6e29 4698<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4699<table class="list"><tbody>
4700<tr><th>attrname</th>
4701 <td class="description">Attribute name</td></tr>
4702<tr><th>enumvalue</th>
4703 <td class="description">Enum value</td></tr>
4704</tbody></table>
798d6e29
MS
4705<h4 class="returnvalue">Return Value</h4>
4706 <p class="description">Enum string</p>
4707<h3 class="function"><a id="ippEnumValue">ippEnumValue</a></h3>
4708 <p class="description">Return the value associated with a given enum string.</p>
4709<p class="code">
98d88c8d 4710int ippEnumValue(const char *attrname, const char *enumstring);</p>
798d6e29 4711<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4712<table class="list"><tbody>
4713<tr><th>attrname</th>
4714 <td class="description">Attribute name</td></tr>
4715<tr><th>enumstring</th>
4716 <td class="description">Enum string</td></tr>
4717</tbody></table>
798d6e29
MS
4718<h4 class="returnvalue">Return Value</h4>
4719 <p class="description">Enum value or -1 if unknown</p>
4720<h3 class="function"><a id="ippErrorString">ippErrorString</a></h3>
4721 <p class="description">Return a name for the given status code.</p>
4722<p class="code">
98d88c8d 4723const char *ippErrorString(ipp_status_t error);</p>
798d6e29 4724<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4725<table class="list"><tbody>
4726<tr><th>error</th>
4727 <td class="description">Error status</td></tr>
4728</tbody></table>
798d6e29
MS
4729<h4 class="returnvalue">Return Value</h4>
4730 <p class="description">Text string</p>
4731<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippErrorValue">ippErrorValue</a></h3>
4732 <p class="description">Return a status code for the given name.</p>
4733<p class="code">
98d88c8d 4734ipp_status_t ippErrorValue(const char *name);</p>
798d6e29 4735<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4736<table class="list"><tbody>
4737<tr><th>name</th>
4738 <td class="description">Name</td></tr>
4739</tbody></table>
798d6e29
MS
4740<h4 class="returnvalue">Return Value</h4>
4741 <p class="description">IPP status code</p>
4742<h3 class="function"><a id="ippFindAttribute">ippFindAttribute</a></h3>
4743 <p class="description">Find a named attribute in a request.</p>
4744<p class="code">
98d88c8d
MS
4745<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>
4746<h4 class="parameters">Parameters</h4>
4747<table class="list"><tbody>
4748<tr><th>ipp</th>
4749 <td class="description">IPP message</td></tr>
4750<tr><th>name</th>
4751 <td class="description">Name of attribute</td></tr>
4752<tr><th>type</th>
4753 <td class="description">Type of attribute</td></tr>
4754</tbody></table>
798d6e29
MS
4755<h4 class="returnvalue">Return Value</h4>
4756 <p class="description">Matching attribute</p>
4757<h4 class="discussion">Discussion</h4>
4758 <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
4759of attribute and member names separated by slashes, for example
4760&quot;media-col/media-size&quot;.</p>
4761<h3 class="function"><a id="ippFindNextAttribute">ippFindNextAttribute</a></h3>
4762 <p class="description">Find the next named attribute in a request.</p>
4763<p class="code">
98d88c8d
MS
4764<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>
4765<h4 class="parameters">Parameters</h4>
4766<table class="list"><tbody>
4767<tr><th>ipp</th>
4768 <td class="description">IPP message</td></tr>
4769<tr><th>name</th>
4770 <td class="description">Name of attribute</td></tr>
4771<tr><th>type</th>
4772 <td class="description">Type of attribute</td></tr>
4773</tbody></table>
798d6e29
MS
4774<h4 class="returnvalue">Return Value</h4>
4775 <p class="description">Matching attribute</p>
4776<h4 class="discussion">Discussion</h4>
4777 <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
4778of attribute and member names separated by slashes, for example
4779&quot;media-col/media-size&quot;.</p>
4780<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippFirstAttribute">ippFirstAttribute</a></h3>
4781 <p class="description">Return the first attribute in the message.</p>
4782<p class="code">
98d88c8d 4783<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFirstAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4784<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4785<table class="list"><tbody>
4786<tr><th>ipp</th>
4787 <td class="description">IPP message</td></tr>
4788</tbody></table>
798d6e29
MS
4789<h4 class="returnvalue">Return Value</h4>
4790 <p class="description">First attribute or <code>NULL</code> if none</p>
4791<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetBoolean">ippGetBoolean</a></h3>
4792 <p class="description">Get a boolean value for an attribute.</p>
4793<p class="code">
98d88c8d 4794int ippGetBoolean(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
798d6e29 4795<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4796<table class="list"><tbody>
4797<tr><th>attr</th>
4798 <td class="description">IPP attribute</td></tr>
4799<tr><th>element</th>
4800 <td class="description">Value number (0-based)</td></tr>
4801</tbody></table>
798d6e29
MS
4802<h4 class="returnvalue">Return Value</h4>
4803 <p class="description">Boolean value or 0 on error</p>
4804<h4 class="discussion">Discussion</h4>
4805 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4806<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4807
4808</p>
4809<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetCollection">ippGetCollection</a></h3>
4810 <p class="description">Get a collection value for an attribute.</p>
4811<p class="code">
98d88c8d 4812<a href="#ipp_t">ipp_t</a> *ippGetCollection(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
798d6e29 4813<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4814<table class="list"><tbody>
4815<tr><th>attr</th>
4816 <td class="description">IPP attribute</td></tr>
4817<tr><th>element</th>
4818 <td class="description">Value number (0-based)</td></tr>
4819</tbody></table>
798d6e29
MS
4820<h4 class="returnvalue">Return Value</h4>
4821 <p class="description">Collection value or <code>NULL</code> on error</p>
4822<h4 class="discussion">Discussion</h4>
4823 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4824<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4825
4826</p>
4827<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetCount">ippGetCount</a></h3>
4828 <p class="description">Get the number of values in an attribute.</p>
4829<p class="code">
98d88c8d 4830int ippGetCount(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 4831<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4832<table class="list"><tbody>
4833<tr><th>attr</th>
4834 <td class="description">IPP attribute</td></tr>
4835</tbody></table>
798d6e29
MS
4836<h4 class="returnvalue">Return Value</h4>
4837 <p class="description">Number of values or 0 on error</p>
4838<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetDate">ippGetDate</a></h3>
65bebeac 4839 <p class="description">Get a dateTime value for an attribute.</p>
798d6e29 4840<p class="code">
98d88c8d 4841const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippGetDate(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
798d6e29 4842<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4843<table class="list"><tbody>
4844<tr><th>attr</th>
4845 <td class="description">IPP attribute</td></tr>
4846<tr><th>element</th>
4847 <td class="description">Value number (0-based)</td></tr>
4848</tbody></table>
798d6e29 4849<h4 class="returnvalue">Return Value</h4>
65bebeac 4850 <p class="description">dateTime value or <code>NULL</code></p>
798d6e29
MS
4851<h4 class="discussion">Discussion</h4>
4852 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4853<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4854
4855</p>
4856<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetGroupTag">ippGetGroupTag</a></h3>
4857 <p class="description">Get the group associated with an attribute.</p>
4858<p class="code">
98d88c8d 4859ipp_tag_t ippGetGroupTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 4860<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4861<table class="list"><tbody>
4862<tr><th>attr</th>
4863 <td class="description">IPP attribute</td></tr>
4864</tbody></table>
798d6e29
MS
4865<h4 class="returnvalue">Return Value</h4>
4866 <p class="description">Group tag or <code>IPP_TAG_ZERO</code> on error</p>
4867<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetInteger">ippGetInteger</a></h3>
4868 <p class="description">Get the integer/enum value for an attribute.</p>
4869<p class="code">
98d88c8d 4870int ippGetInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
798d6e29 4871<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4872<table class="list"><tbody>
4873<tr><th>attr</th>
4874 <td class="description">IPP attribute</td></tr>
4875<tr><th>element</th>
4876 <td class="description">Value number (0-based)</td></tr>
4877</tbody></table>
798d6e29
MS
4878<h4 class="returnvalue">Return Value</h4>
4879 <p class="description">Value or 0 on error</p>
4880<h4 class="discussion">Discussion</h4>
4881 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4882<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4883
4884</p>
4885<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetName">ippGetName</a></h3>
4886 <p class="description">Get the attribute name.</p>
4887<p class="code">
98d88c8d 4888const char *ippGetName(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 4889<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4890<table class="list"><tbody>
4891<tr><th>attr</th>
4892 <td class="description">IPP attribute</td></tr>
4893</tbody></table>
798d6e29
MS
4894<h4 class="returnvalue">Return Value</h4>
4895 <p class="description">Attribute name or <code>NULL</code> for separators</p>
4896<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippGetOctetString">ippGetOctetString</a></h3>
4897 <p class="description">Get an octetString value from an IPP attribute.</p>
4898<p class="code">
98d88c8d
MS
4899void *ippGetOctetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *datalen);</p>
4900<h4 class="parameters">Parameters</h4>
4901<table class="list"><tbody>
4902<tr><th>attr</th>
4903 <td class="description">IPP attribute</td></tr>
4904<tr><th>element</th>
4905 <td class="description">Value number (0-based)</td></tr>
4906<tr><th>datalen</th>
4907 <td class="description">Length of octetString data</td></tr>
4908</tbody></table>
798d6e29
MS
4909<h4 class="returnvalue">Return Value</h4>
4910 <p class="description">Pointer to octetString data</p>
4911<h4 class="discussion">Discussion</h4>
4912 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4913<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4914
4915</p>
4916<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetOperation">ippGetOperation</a></h3>
4917 <p class="description">Get the operation ID in an IPP message.</p>
4918<p class="code">
98d88c8d 4919ipp_op_t ippGetOperation(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4920<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4921<table class="list"><tbody>
4922<tr><th>ipp</th>
4923 <td class="description">IPP request message</td></tr>
4924</tbody></table>
798d6e29
MS
4925<h4 class="returnvalue">Return Value</h4>
4926 <p class="description">Operation ID or 0 on error</p>
4927<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetRange">ippGetRange</a></h3>
4928 <p class="description">Get a rangeOfInteger value from an attribute.</p>
4929<p class="code">
98d88c8d
MS
4930int ippGetRange(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *uppervalue);</p>
4931<h4 class="parameters">Parameters</h4>
4932<table class="list"><tbody>
4933<tr><th>attr</th>
4934 <td class="description">IPP attribute</td></tr>
4935<tr><th>element</th>
4936 <td class="description">Value number (0-based)</td></tr>
4937<tr><th>uppervalue</th>
4938 <td class="description">Upper value of range</td></tr>
4939</tbody></table>
798d6e29
MS
4940<h4 class="returnvalue">Return Value</h4>
4941 <p class="description">Lower value of range or 0</p>
4942<h4 class="discussion">Discussion</h4>
4943 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4944<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4945
4946</p>
4947<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetRequestId">ippGetRequestId</a></h3>
4948 <p class="description">Get the request ID from an IPP message.</p>
4949<p class="code">
98d88c8d 4950int ippGetRequestId(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4951<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4952<table class="list"><tbody>
4953<tr><th>ipp</th>
4954 <td class="description">IPP message</td></tr>
4955</tbody></table>
798d6e29
MS
4956<h4 class="returnvalue">Return Value</h4>
4957 <p class="description">Request ID or 0 on error</p>
4958<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetResolution">ippGetResolution</a></h3>
4959 <p class="description">Get a resolution value for an attribute.</p>
4960<p class="code">
98d88c8d
MS
4961int 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>
4962<h4 class="parameters">Parameters</h4>
4963<table class="list"><tbody>
4964<tr><th>attr</th>
4965 <td class="description">IPP attribute</td></tr>
4966<tr><th>element</th>
4967 <td class="description">Value number (0-based)</td></tr>
4968<tr><th>yres</th>
4969 <td class="description">Vertical/feed resolution</td></tr>
4970<tr><th>units</th>
4971 <td class="description">Units for resolution</td></tr>
4972</tbody></table>
798d6e29
MS
4973<h4 class="returnvalue">Return Value</h4>
4974 <p class="description">Horizontal/cross feed resolution or 0</p>
4975<h4 class="discussion">Discussion</h4>
4976 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4977<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4978
4979</p>
4980<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetState">ippGetState</a></h3>
4981 <p class="description">Get the IPP message state.</p>
4982<p class="code">
98d88c8d 4983<a href="#ipp_state_t">ipp_state_t</a> ippGetState(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4984<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4985<table class="list"><tbody>
4986<tr><th>ipp</th>
4987 <td class="description">IPP message</td></tr>
4988</tbody></table>
798d6e29
MS
4989<h4 class="returnvalue">Return Value</h4>
4990 <p class="description">IPP message state value</p>
4991<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetStatusCode">ippGetStatusCode</a></h3>
4992 <p class="description">Get the status code from an IPP response or event message.</p>
4993<p class="code">
98d88c8d 4994ipp_status_t ippGetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4995<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4996<table class="list"><tbody>
4997<tr><th>ipp</th>
4998 <td class="description">IPP response or event message</td></tr>
4999</tbody></table>
798d6e29
MS
5000<h4 class="returnvalue">Return Value</h4>
5001 <p class="description">Status code in IPP message</p>
5002<h3 class="function"><a id="ippGetString">ippGetString</a></h3>
98d88c8d
MS
5003 <p class="description"></p>
5004<p class="code">
5005const char *ippGetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, const char **language);</p>
5006<h4 class="parameters">Parameters</h4>
5007<table class="list"><tbody>
5008<tr><th>attr</th>
5009 <td class="description">IPP attribute</td></tr>
5010<tr><th>element</th>
5011 <td class="description">Value number (0-based)</td></tr>
5012<tr><th>language</th>
5013 <td class="description">Language code (<code>NULL</code> for don't care)</td></tr>
5014</tbody></table>
798d6e29
MS
5015<h4 class="returnvalue">Return Value</h4>
5016 <p class="description">Get the string and optionally the language code for an attribute.</p>
5017 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 5018<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
5019
5020</p>
5021<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetValueTag">ippGetValueTag</a></h3>
5022 <p class="description">Get the value tag for an attribute.</p>
5023<p class="code">
98d88c8d 5024ipp_tag_t ippGetValueTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 5025<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5026<table class="list"><tbody>
5027<tr><th>attr</th>
5028 <td class="description">IPP attribute</td></tr>
5029</tbody></table>
798d6e29
MS
5030<h4 class="returnvalue">Return Value</h4>
5031 <p class="description">Value tag or <code>IPP_TAG_ZERO</code> on error</p>
5032<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetVersion">ippGetVersion</a></h3>
5033 <p class="description">Get the major and minor version number from an IPP message.</p>
5034<p class="code">
98d88c8d 5035int ippGetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int *minor);</p>
798d6e29 5036<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5037<table class="list"><tbody>
5038<tr><th>ipp</th>
5039 <td class="description">IPP message</td></tr>
5040<tr><th>minor</th>
65bebeac 5041 <td class="description">Minor version number or <code>NULL</code> for don't care</td></tr>
98d88c8d 5042</tbody></table>
798d6e29
MS
5043<h4 class="returnvalue">Return Value</h4>
5044 <p class="description">Major version number or 0 on error</p>
5045<h3 class="function"><a id="ippLength">ippLength</a></h3>
5046 <p class="description">Compute the length of an IPP message.</p>
5047<p class="code">
98d88c8d 5048size_t ippLength(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5049<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5050<table class="list"><tbody>
5051<tr><th>ipp</th>
5052 <td class="description">IPP message</td></tr>
5053</tbody></table>
798d6e29
MS
5054<h4 class="returnvalue">Return Value</h4>
5055 <p class="description">Size of IPP message</p>
5056<h3 class="function"><a id="ippNew">ippNew</a></h3>
5057 <p class="description">Allocate a new IPP message.</p>
5058<p class="code">
98d88c8d 5059<a href="#ipp_t">ipp_t</a> *ippNew(void);</p>
798d6e29
MS
5060<h4 class="returnvalue">Return Value</h4>
5061 <p class="description">New IPP message</p>
5062<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippNewRequest">ippNewRequest</a></h3>
5063 <p class="description">Allocate a new IPP request message.</p>
5064<p class="code">
98d88c8d 5065<a href="#ipp_t">ipp_t</a> *ippNewRequest(ipp_op_t op);</p>
798d6e29 5066<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5067<table class="list"><tbody>
5068<tr><th>op</th>
5069 <td class="description">Operation code</td></tr>
5070</tbody></table>
798d6e29
MS
5071<h4 class="returnvalue">Return Value</h4>
5072 <p class="description">IPP request message</p>
5073<h4 class="discussion">Discussion</h4>
65bebeac
MS
5074 <p class="discussion">The new request message is initialized with the &quot;attributes-charset&quot; and
5075&quot;attributes-natural-language&quot; attributes added. The
5076&quot;attributes-natural-language&quot; value is derived from the current locale.
798d6e29
MS
5077
5078</p>
5079<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippNewResponse">ippNewResponse</a></h3>
5080 <p class="description">Allocate a new IPP response message.</p>
5081<p class="code">
98d88c8d 5082<a href="#ipp_t">ipp_t</a> *ippNewResponse(<a href="#ipp_t">ipp_t</a> *request);</p>
798d6e29 5083<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5084<table class="list"><tbody>
5085<tr><th>request</th>
5086 <td class="description">IPP request message</td></tr>
5087</tbody></table>
798d6e29
MS
5088<h4 class="returnvalue">Return Value</h4>
5089 <p class="description">IPP response message</p>
5090<h4 class="discussion">Discussion</h4>
65bebeac
MS
5091 <p class="discussion">The new response message is initialized with the same &quot;version-number&quot;,
5092&quot;request-id&quot;, &quot;attributes-charset&quot;, and &quot;attributes-natural-language&quot; as the
5093provided request message. If the &quot;attributes-charset&quot; or
5094&quot;attributes-natural-language&quot; attributes are missing from the request,
5095'utf-8' and a value derived from the current locale are substituted,
798d6e29
MS
5096respectively.
5097
5098</p>
5099<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippNextAttribute">ippNextAttribute</a></h3>
5100 <p class="description">Return the next attribute in the message.</p>
5101<p class="code">
98d88c8d 5102<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippNextAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5103<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5104<table class="list"><tbody>
5105<tr><th>ipp</th>
5106 <td class="description">IPP message</td></tr>
5107</tbody></table>
798d6e29
MS
5108<h4 class="returnvalue">Return Value</h4>
5109 <p class="description">Next attribute or <code>NULL</code> if none</p>
5110<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippOpString">ippOpString</a></h3>
5111 <p class="description">Return a name for the given operation id.</p>
5112<p class="code">
98d88c8d 5113const char *ippOpString(ipp_op_t op);</p>
798d6e29 5114<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5115<table class="list"><tbody>
5116<tr><th>op</th>
5117 <td class="description">Operation ID</td></tr>
5118</tbody></table>
798d6e29
MS
5119<h4 class="returnvalue">Return Value</h4>
5120 <p class="description">Name</p>
5121<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippOpValue">ippOpValue</a></h3>
5122 <p class="description">Return an operation id for the given name.</p>
5123<p class="code">
98d88c8d 5124ipp_op_t ippOpValue(const char *name);</p>
798d6e29 5125<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5126<table class="list"><tbody>
5127<tr><th>name</th>
5128 <td class="description">Textual name</td></tr>
5129</tbody></table>
798d6e29
MS
5130<h4 class="returnvalue">Return Value</h4>
5131 <p class="description">Operation ID</p>
5132<h3 class="function"><a id="ippPort">ippPort</a></h3>
5133 <p class="description">Return the default IPP port number.</p>
5134<p class="code">
98d88c8d 5135int ippPort(void);</p>
798d6e29
MS
5136<h4 class="returnvalue">Return Value</h4>
5137 <p class="description">Port number</p>
5138<h3 class="function"><a id="ippRead">ippRead</a></h3>
5139 <p class="description">Read data for an IPP message from a HTTP connection.</p>
5140<p class="code">
98d88c8d 5141<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 5142<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5143<table class="list"><tbody>
5144<tr><th>http</th>
5145 <td class="description">HTTP connection</td></tr>
5146<tr><th>ipp</th>
5147 <td class="description">IPP data</td></tr>
5148</tbody></table>
798d6e29
MS
5149<h4 class="returnvalue">Return Value</h4>
5150 <p class="description">Current state</p>
5151<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippReadFile">ippReadFile</a></h3>
5152 <p class="description">Read data for an IPP message from a file.</p>
5153<p class="code">
98d88c8d 5154<a href="#ipp_state_t">ipp_state_t</a> ippReadFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5155<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5156<table class="list"><tbody>
5157<tr><th>fd</th>
5158 <td class="description">HTTP data</td></tr>
5159<tr><th>ipp</th>
5160 <td class="description">IPP data</td></tr>
5161</tbody></table>
798d6e29
MS
5162<h4 class="returnvalue">Return Value</h4>
5163 <p class="description">Current state</p>
5164<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippReadIO">ippReadIO</a></h3>
5165 <p class="description">Read data for an IPP message.</p>
5166<p class="code">
98d88c8d
MS
5167<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>
5168<h4 class="parameters">Parameters</h4>
5169<table class="list"><tbody>
5170<tr><th>src</th>
5171 <td class="description">Data source</td></tr>
5172<tr><th>cb</th>
5173 <td class="description">Read callback function</td></tr>
5174<tr><th>blocking</th>
5175 <td class="description">Use blocking IO?</td></tr>
5176<tr><th>parent</th>
5177 <td class="description">Parent request, if any</td></tr>
5178<tr><th>ipp</th>
5179 <td class="description">IPP data</td></tr>
5180</tbody></table>
798d6e29
MS
5181<h4 class="returnvalue">Return Value</h4>
5182 <p class="description">Current state</p>
5183<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetBoolean">ippSetBoolean</a></h3>
5184 <p class="description">Set a boolean value in an attribute.</p>
5185<p class="code">
98d88c8d
MS
5186int ippSetBoolean(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int boolvalue);</p>
5187<h4 class="parameters">Parameters</h4>
5188<table class="list"><tbody>
5189<tr><th>ipp</th>
5190 <td class="description">IPP message</td></tr>
5191<tr><th>attr</th>
5192 <td class="description">IPP attribute</td></tr>
5193<tr><th>element</th>
5194 <td class="description">Value number (0-based)</td></tr>
5195<tr><th>boolvalue</th>
5196 <td class="description">Boolean value</td></tr>
5197</tbody></table>
798d6e29
MS
5198<h4 class="returnvalue">Return Value</h4>
5199 <p class="description">1 on success, 0 on failure</p>
5200<h4 class="discussion">Discussion</h4>
5201 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5202the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5203<br>
5204The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5205<br>
5206The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5207<code>ippGetCount(attr)</code>.
798d6e29
MS
5208
5209</p>
5210<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetCollection">ippSetCollection</a></h3>
5211 <p class="description">Set a collection value in an attribute.</p>
5212<p class="code">
98d88c8d
MS
5213int 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>
5214<h4 class="parameters">Parameters</h4>
5215<table class="list"><tbody>
5216<tr><th>ipp</th>
5217 <td class="description">IPP message</td></tr>
5218<tr><th>attr</th>
5219 <td class="description">IPP attribute</td></tr>
5220<tr><th>element</th>
5221 <td class="description">Value number (0-based)</td></tr>
5222<tr><th>colvalue</th>
5223 <td class="description">Collection value</td></tr>
5224</tbody></table>
798d6e29
MS
5225<h4 class="returnvalue">Return Value</h4>
5226 <p class="description">1 on success, 0 on failure</p>
5227<h4 class="discussion">Discussion</h4>
5228 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5229the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5230<br>
5231The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5232<br>
5233The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5234<code>ippGetCount(attr)</code>.
798d6e29
MS
5235
5236</p>
5237<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetDate">ippSetDate</a></h3>
65bebeac 5238 <p class="description">Set a dateTime value in an attribute.</p>
798d6e29 5239<p class="code">
98d88c8d
MS
5240int 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>
5241<h4 class="parameters">Parameters</h4>
5242<table class="list"><tbody>
5243<tr><th>ipp</th>
5244 <td class="description">IPP message</td></tr>
5245<tr><th>attr</th>
5246 <td class="description">IPP attribute</td></tr>
5247<tr><th>element</th>
5248 <td class="description">Value number (0-based)</td></tr>
5249<tr><th>datevalue</th>
65bebeac 5250 <td class="description">dateTime value</td></tr>
98d88c8d 5251</tbody></table>
798d6e29
MS
5252<h4 class="returnvalue">Return Value</h4>
5253 <p class="description">1 on success, 0 on failure</p>
5254<h4 class="discussion">Discussion</h4>
5255 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5256the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5257<br>
5258The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5259<br>
5260The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5261<code>ippGetCount(attr)</code>.
798d6e29
MS
5262
5263</p>
5264<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetGroupTag">ippSetGroupTag</a></h3>
5265 <p class="description">Set the group tag of an attribute.</p>
5266<p class="code">
98d88c8d
MS
5267int 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>
5268<h4 class="parameters">Parameters</h4>
5269<table class="list"><tbody>
5270<tr><th>ipp</th>
5271 <td class="description">IPP message</td></tr>
5272<tr><th>attr</th>
5273 <td class="description">Attribute</td></tr>
5274<tr><th>group_tag</th>
5275 <td class="description">Group tag</td></tr>
5276</tbody></table>
798d6e29
MS
5277<h4 class="returnvalue">Return Value</h4>
5278 <p class="description">1 on success, 0 on failure</p>
5279<h4 class="discussion">Discussion</h4>
5280 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5281the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5282<br>
5283The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5284<br>
5285The <code>group</code> parameter specifies the IPP attribute group tag: none
5286(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
5287event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
5288(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
5289(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
5290
5291</p>
5292<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetInteger">ippSetInteger</a></h3>
5293 <p class="description">Set an integer or enum value in an attribute.</p>
5294<p class="code">
98d88c8d
MS
5295int ippSetInteger(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int intvalue);</p>
5296<h4 class="parameters">Parameters</h4>
5297<table class="list"><tbody>
5298<tr><th>ipp</th>
5299 <td class="description">IPP message</td></tr>
5300<tr><th>attr</th>
5301 <td class="description">IPP attribute</td></tr>
5302<tr><th>element</th>
5303 <td class="description">Value number (0-based)</td></tr>
5304<tr><th>intvalue</th>
5305 <td class="description">Integer/enum value</td></tr>
5306</tbody></table>
798d6e29
MS
5307<h4 class="returnvalue">Return Value</h4>
5308 <p class="description">1 on success, 0 on failure</p>
5309<h4 class="discussion">Discussion</h4>
5310 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5311the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5312<br>
5313The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5314<br>
5315The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5316<code>ippGetCount(attr)</code>.
798d6e29
MS
5317
5318</p>
5319<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetName">ippSetName</a></h3>
5320 <p class="description">Set the name of an attribute.</p>
5321<p class="code">
98d88c8d
MS
5322int ippSetName(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, const char *name);</p>
5323<h4 class="parameters">Parameters</h4>
5324<table class="list"><tbody>
5325<tr><th>ipp</th>
5326 <td class="description">IPP message</td></tr>
5327<tr><th>attr</th>
5328 <td class="description">IPP attribute</td></tr>
5329<tr><th>name</th>
5330 <td class="description">Attribute name</td></tr>
5331</tbody></table>
798d6e29
MS
5332<h4 class="returnvalue">Return Value</h4>
5333 <p class="description">1 on success, 0 on failure</p>
5334<h4 class="discussion">Discussion</h4>
5335 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5336the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5337<br>
5338The <code>attr</code> parameter may be modified as a result of setting the value.
5339
5340</p>
5341<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetOctetString">ippSetOctetString</a></h3>
5342 <p class="description">Set an octetString value in an IPP attribute.</p>
5343<p class="code">
98d88c8d
MS
5344int 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>
5345<h4 class="parameters">Parameters</h4>
5346<table class="list"><tbody>
5347<tr><th>ipp</th>
5348 <td class="description">IPP message</td></tr>
5349<tr><th>attr</th>
5350 <td class="description">IPP attribute</td></tr>
5351<tr><th>element</th>
5352 <td class="description">Value number (0-based)</td></tr>
5353<tr><th>data</th>
5354 <td class="description">Pointer to octetString data</td></tr>
5355<tr><th>datalen</th>
5356 <td class="description">Length of octetString data</td></tr>
5357</tbody></table>
798d6e29
MS
5358<h4 class="returnvalue">Return Value</h4>
5359 <p class="description">1 on success, 0 on failure</p>
5360<h4 class="discussion">Discussion</h4>
5361 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5362the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5363<br>
5364The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5365<br>
5366The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5367<code>ippGetCount(attr)</code>.
798d6e29
MS
5368
5369</p>
5370<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetOperation">ippSetOperation</a></h3>
5371 <p class="description">Set the operation ID in an IPP request message.</p>
5372<p class="code">
98d88c8d 5373int ippSetOperation(<a href="#ipp_t">ipp_t</a> *ipp, ipp_op_t op);</p>
798d6e29 5374<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5375<table class="list"><tbody>
5376<tr><th>ipp</th>
5377 <td class="description">IPP request message</td></tr>
5378<tr><th>op</th>
5379 <td class="description">Operation ID</td></tr>
5380</tbody></table>
798d6e29
MS
5381<h4 class="returnvalue">Return Value</h4>
5382 <p class="description">1 on success, 0 on failure</p>
5383<h4 class="discussion">Discussion</h4>
5384 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5385the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
5386
5387</p>
5388<h3 class="function"><a id="ippSetPort">ippSetPort</a></h3>
98d88c8d 5389 <p class="description">Set the default port number.</p>
798d6e29 5390<p class="code">
98d88c8d 5391void ippSetPort(int p);</p>
798d6e29 5392<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5393<table class="list"><tbody>
5394<tr><th>p</th>
5395 <td class="description">Port number to use</td></tr>
5396</tbody></table>
798d6e29
MS
5397<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetRange">ippSetRange</a></h3>
5398 <p class="description">Set a rangeOfInteger value in an attribute.</p>
5399<p class="code">
98d88c8d
MS
5400int 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>
5401<h4 class="parameters">Parameters</h4>
5402<table class="list"><tbody>
5403<tr><th>ipp</th>
5404 <td class="description">IPP message</td></tr>
5405<tr><th>attr</th>
5406 <td class="description">IPP attribute</td></tr>
5407<tr><th>element</th>
5408 <td class="description">Value number (0-based)</td></tr>
5409<tr><th>lowervalue</th>
5410 <td class="description">Lower bound for range</td></tr>
5411<tr><th>uppervalue</th>
5412 <td class="description">Upper bound for range</td></tr>
5413</tbody></table>
798d6e29
MS
5414<h4 class="returnvalue">Return Value</h4>
5415 <p class="description">1 on success, 0 on failure</p>
5416<h4 class="discussion">Discussion</h4>
5417 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5418the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5419<br>
5420The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5421<br>
5422The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5423<code>ippGetCount(attr)</code>.
798d6e29
MS
5424
5425</p>
5426<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetRequestId">ippSetRequestId</a></h3>
5427 <p class="description">Set the request ID in an IPP message.</p>
5428<p class="code">
98d88c8d 5429int ippSetRequestId(<a href="#ipp_t">ipp_t</a> *ipp, int request_id);</p>
798d6e29 5430<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5431<table class="list"><tbody>
5432<tr><th>ipp</th>
5433 <td class="description">IPP message</td></tr>
5434<tr><th>request_id</th>
5435 <td class="description">Request ID</td></tr>
5436</tbody></table>
798d6e29
MS
5437<h4 class="returnvalue">Return Value</h4>
5438 <p class="description">1 on success, 0 on failure</p>
5439<h4 class="discussion">Discussion</h4>
5440 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5441the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5442<br>
5443The <code>request_id</code> parameter must be greater than 0.
5444
5445</p>
5446<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetResolution">ippSetResolution</a></h3>
5447 <p class="description">Set a resolution value in an attribute.</p>
5448<p class="code">
98d88c8d
MS
5449int 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>
5450<h4 class="parameters">Parameters</h4>
5451<table class="list"><tbody>
5452<tr><th>ipp</th>
5453 <td class="description">IPP message</td></tr>
5454<tr><th>attr</th>
5455 <td class="description">IPP attribute</td></tr>
5456<tr><th>element</th>
5457 <td class="description">Value number (0-based)</td></tr>
5458<tr><th>unitsvalue</th>
5459 <td class="description">Resolution units</td></tr>
5460<tr><th>xresvalue</th>
5461 <td class="description">Horizontal/cross feed resolution</td></tr>
5462<tr><th>yresvalue</th>
5463 <td class="description">Vertical/feed resolution</td></tr>
5464</tbody></table>
798d6e29
MS
5465<h4 class="returnvalue">Return Value</h4>
5466 <p class="description">1 on success, 0 on failure</p>
5467<h4 class="discussion">Discussion</h4>
5468 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5469the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5470<br>
5471The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5472<br>
5473The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5474<code>ippGetCount(attr)</code>.
798d6e29
MS
5475
5476</p>
5477<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetState">ippSetState</a></h3>
5478 <p class="description">Set the current state of the IPP message.</p>
5479<p class="code">
98d88c8d 5480int ippSetState(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_state_t">ipp_state_t</a> state);</p>
798d6e29 5481<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5482<table class="list"><tbody>
5483<tr><th>ipp</th>
5484 <td class="description">IPP message</td></tr>
5485<tr><th>state</th>
5486 <td class="description">IPP state value</td></tr>
5487</tbody></table>
798d6e29
MS
5488<h4 class="returnvalue">Return Value</h4>
5489 <p class="description">1 on success, 0 on failure</p>
5490<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetStatusCode">ippSetStatusCode</a></h3>
5491 <p class="description">Set the status code in an IPP response or event message.</p>
5492<p class="code">
98d88c8d 5493int ippSetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp, ipp_status_t status);</p>
798d6e29 5494<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5495<table class="list"><tbody>
5496<tr><th>ipp</th>
5497 <td class="description">IPP response or event message</td></tr>
5498<tr><th>status</th>
5499 <td class="description">Status code</td></tr>
5500</tbody></table>
798d6e29
MS
5501<h4 class="returnvalue">Return Value</h4>
5502 <p class="description">1 on success, 0 on failure</p>
5503<h4 class="discussion">Discussion</h4>
5504 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5505the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
5506
5507</p>
5508<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetString">ippSetString</a></h3>
5509 <p class="description">Set a string value in an attribute.</p>
5510<p class="code">
98d88c8d
MS
5511int 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>
5512<h4 class="parameters">Parameters</h4>
5513<table class="list"><tbody>
5514<tr><th>ipp</th>
5515 <td class="description">IPP message</td></tr>
5516<tr><th>attr</th>
5517 <td class="description">IPP attribute</td></tr>
5518<tr><th>element</th>
5519 <td class="description">Value number (0-based)</td></tr>
5520<tr><th>strvalue</th>
5521 <td class="description">String value</td></tr>
5522</tbody></table>
798d6e29
MS
5523<h4 class="returnvalue">Return Value</h4>
5524 <p class="description">1 on success, 0 on failure</p>
5525<h4 class="discussion">Discussion</h4>
5526 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5527the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5528<br>
5529The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5530<br>
5531The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5532<code>ippGetCount(attr)</code>.
798d6e29
MS
5533
5534</p>
5535<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetStringf">ippSetStringf</a></h3>
5536 <p class="description">Set a formatted string value of an attribute.</p>
5537<p class="code">
98d88c8d
MS
5538int 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>
5539<h4 class="parameters">Parameters</h4>
5540<table class="list"><tbody>
5541<tr><th>ipp</th>
5542 <td class="description">IPP message</td></tr>
5543<tr><th>attr</th>
5544 <td class="description">IPP attribute</td></tr>
5545<tr><th>element</th>
5546 <td class="description">Value number (0-based)</td></tr>
5547<tr><th>format</th>
5548 <td class="description">Printf-style format string</td></tr>
5549<tr><th>...</th>
5550 <td class="description">Additional arguments as needed</td></tr>
5551</tbody></table>
798d6e29
MS
5552<h4 class="returnvalue">Return Value</h4>
5553 <p class="description">1 on success, 0 on failure</p>
5554<h4 class="discussion">Discussion</h4>
5555 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5556the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5557<br>
5558The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5559<br>
5560The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5561<code>ippGetCount(attr)</code>.<br>
798d6e29
MS
5562<br>
5563The <code>format</code> parameter uses formatting characters compatible with the
5564printf family of standard functions. Additional arguments follow it as
5565needed. The formatted string is truncated as needed to the maximum length of
5566the corresponding value type.
5567
5568</p>
5569<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetStringfv">ippSetStringfv</a></h3>
5570 <p class="description">Set a formatted string value of an attribute.</p>
5571<p class="code">
98d88c8d
MS
5572int 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>
5573<h4 class="parameters">Parameters</h4>
5574<table class="list"><tbody>
5575<tr><th>ipp</th>
5576 <td class="description">IPP message</td></tr>
5577<tr><th>attr</th>
5578 <td class="description">IPP attribute</td></tr>
5579<tr><th>element</th>
5580 <td class="description">Value number (0-based)</td></tr>
5581<tr><th>format</th>
5582 <td class="description">Printf-style format string</td></tr>
5583<tr><th>ap</th>
5584 <td class="description">Pointer to additional arguments</td></tr>
5585</tbody></table>
798d6e29
MS
5586<h4 class="returnvalue">Return Value</h4>
5587 <p class="description">1 on success, 0 on failure</p>
5588<h4 class="discussion">Discussion</h4>
5589 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5590the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5591<br>
5592The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5593<br>
5594The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5595<code>ippGetCount(attr)</code>.<br>
798d6e29
MS
5596<br>
5597The <code>format</code> parameter uses formatting characters compatible with the
5598printf family of standard functions. Additional arguments follow it as
5599needed. The formatted string is truncated as needed to the maximum length of
5600the corresponding value type.
5601
5602</p>
5603<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetValueTag">ippSetValueTag</a></h3>
5604 <p class="description">Set the value tag of an attribute.</p>
5605<p class="code">
98d88c8d
MS
5606int 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>
5607<h4 class="parameters">Parameters</h4>
5608<table class="list"><tbody>
5609<tr><th>ipp</th>
5610 <td class="description">IPP message</td></tr>
5611<tr><th>attr</th>
5612 <td class="description">IPP attribute</td></tr>
5613<tr><th>value_tag</th>
5614 <td class="description">Value tag</td></tr>
5615</tbody></table>
798d6e29
MS
5616<h4 class="returnvalue">Return Value</h4>
5617 <p class="description">1 on success, 0 on failure</p>
5618<h4 class="discussion">Discussion</h4>
5619 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5620the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5621<br>
5622The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5623<br>
5624Integer (<code>IPP_TAG_INTEGER</code>) values can be promoted to rangeOfInteger
5625(<code>IPP_TAG_RANGE</code>) values, the various string tags can be promoted to name
5626(<code>IPP_TAG_NAME</code>) or nameWithLanguage (<code>IPP_TAG_NAMELANG</code>) values, text
5627(<code>IPP_TAG_TEXT</code>) values can be promoted to textWithLanguage
5628(<code>IPP_TAG_TEXTLANG</code>) values, and all values can be demoted to the various
5629out-of-band value tags such as no-value (<code>IPP_TAG_NOVALUE</code>). All other changes
5630will be rejected.<br>
5631<br>
5632Promoting a string attribute to nameWithLanguage or textWithLanguage adds the language
5633code in the &quot;attributes-natural-language&quot; attribute or, if not present, the language
5634code for the current locale.
5635
5636</p>
5637<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetVersion">ippSetVersion</a></h3>
5638 <p class="description">Set the version number in an IPP message.</p>
5639<p class="code">
98d88c8d
MS
5640int ippSetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int major, int minor);</p>
5641<h4 class="parameters">Parameters</h4>
5642<table class="list"><tbody>
5643<tr><th>ipp</th>
5644 <td class="description">IPP message</td></tr>
5645<tr><th>major</th>
5646 <td class="description">Major version number (major.minor)</td></tr>
5647<tr><th>minor</th>
5648 <td class="description">Minor version number (major.minor)</td></tr>
5649</tbody></table>
798d6e29
MS
5650<h4 class="returnvalue">Return Value</h4>
5651 <p class="description">1 on success, 0 on failure</p>
5652<h4 class="discussion">Discussion</h4>
5653 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5654the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5655<br>
5656The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2.
5657
5658</p>
5659<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="ippStateString">ippStateString</a></h3>
5660 <p class="description">Return the name corresponding to a state value.</p>
5661<p class="code">
98d88c8d 5662const char *ippStateString(<a href="#ipp_state_t">ipp_state_t</a> state);</p>
798d6e29 5663<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5664<table class="list"><tbody>
5665<tr><th>state</th>
5666 <td class="description">State value</td></tr>
5667</tbody></table>
798d6e29
MS
5668<h4 class="returnvalue">Return Value</h4>
5669 <p class="description">State name</p>
5670<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="ippTagString">ippTagString</a></h3>
5671 <p class="description">Return the tag name corresponding to a tag value.</p>
5672<p class="code">
98d88c8d 5673const char *ippTagString(ipp_tag_t tag);</p>
798d6e29 5674<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5675<table class="list"><tbody>
5676<tr><th>tag</th>
5677 <td class="description">Tag value</td></tr>
5678</tbody></table>
798d6e29
MS
5679<h4 class="returnvalue">Return Value</h4>
5680 <p class="description">Tag name</p>
5681<h4 class="discussion">Discussion</h4>
65bebeac 5682 <p class="discussion">The returned names are defined in RFC 8011 and the IANA IPP Registry.
798d6e29
MS
5683
5684</p>
5685<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="ippTagValue">ippTagValue</a></h3>
5686 <p class="description">Return the tag value corresponding to a tag name.</p>
5687<p class="code">
98d88c8d 5688ipp_tag_t ippTagValue(const char *name);</p>
798d6e29 5689<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5690<table class="list"><tbody>
5691<tr><th>name</th>
5692 <td class="description">Tag name</td></tr>
5693</tbody></table>
798d6e29
MS
5694<h4 class="returnvalue">Return Value</h4>
5695 <p class="description">Tag value</p>
5696<h4 class="discussion">Discussion</h4>
65bebeac 5697 <p class="discussion">The tag names are defined in RFC 8011 and the IANA IPP Registry.
798d6e29
MS
5698
5699</p>
5700<h3 class="function"><a id="ippTimeToDate">ippTimeToDate</a></h3>
65bebeac 5701 <p class="description">Convert from time in seconds to RFC 2579 format.</p>
798d6e29 5702<p class="code">
98d88c8d 5703const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippTimeToDate(time_t t);</p>
798d6e29 5704<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5705<table class="list"><tbody>
5706<tr><th>t</th>
65bebeac 5707 <td class="description">Time in seconds</td></tr>
98d88c8d 5708</tbody></table>
798d6e29 5709<h4 class="returnvalue">Return Value</h4>
65bebeac 5710 <p class="description">RFC-2579 date/time data</p>
798d6e29
MS
5711<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippValidateAttribute">ippValidateAttribute</a></h3>
5712 <p class="description">Validate the contents of an attribute.</p>
5713<p class="code">
98d88c8d 5714int ippValidateAttribute(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 5715<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5716<table class="list"><tbody>
5717<tr><th>attr</th>
5718 <td class="description">Attribute</td></tr>
5719</tbody></table>
798d6e29
MS
5720<h4 class="returnvalue">Return Value</h4>
5721 <p class="description">1 if valid, 0 otherwise</p>
5722<h4 class="discussion">Discussion</h4>
5723 <p class="discussion">This function validates the contents of an attribute based on the name and
5724value tag. 1 is returned if the attribute is valid, 0 otherwise. On
65bebeac 5725failure, <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> is set to a human-readable message.
798d6e29
MS
5726
5727</p>
5728<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippValidateAttributes">ippValidateAttributes</a></h3>
5729 <p class="description">Validate all attributes in an IPP message.</p>
5730<p class="code">
98d88c8d 5731int ippValidateAttributes(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5732<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5733<table class="list"><tbody>
5734<tr><th>ipp</th>
5735 <td class="description">IPP message</td></tr>
5736</tbody></table>
798d6e29
MS
5737<h4 class="returnvalue">Return Value</h4>
5738 <p class="description">1 if valid, 0 otherwise</p>
5739<h4 class="discussion">Discussion</h4>
5740 <p class="discussion">This function validates the contents of the IPP message, including each
65bebeac
MS
5741attribute. Like <a href="#ippValidateAttribute"><code>ippValidateAttribute</code></a>, <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> is
5742set to a human-readable message on failure.
798d6e29
MS
5743
5744</p>
5745<h3 class="function"><a id="ippWrite">ippWrite</a></h3>
5746 <p class="description">Write data for an IPP message to a HTTP connection.</p>
5747<p class="code">
98d88c8d 5748<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 5749<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5750<table class="list"><tbody>
5751<tr><th>http</th>
5752 <td class="description">HTTP connection</td></tr>
5753<tr><th>ipp</th>
5754 <td class="description">IPP data</td></tr>
5755</tbody></table>
798d6e29
MS
5756<h4 class="returnvalue">Return Value</h4>
5757 <p class="description">Current state</p>
5758<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippWriteFile">ippWriteFile</a></h3>
5759 <p class="description">Write data for an IPP message to a file.</p>
5760<p class="code">
98d88c8d 5761<a href="#ipp_state_t">ipp_state_t</a> ippWriteFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5762<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5763<table class="list"><tbody>
5764<tr><th>fd</th>
5765 <td class="description">HTTP data</td></tr>
5766<tr><th>ipp</th>
5767 <td class="description">IPP data</td></tr>
5768</tbody></table>
798d6e29
MS
5769<h4 class="returnvalue">Return Value</h4>
5770 <p class="description">Current state</p>
5771<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippWriteIO">ippWriteIO</a></h3>
5772 <p class="description">Write data for an IPP message.</p>
5773<p class="code">
98d88c8d
MS
5774<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>
5775<h4 class="parameters">Parameters</h4>
5776<table class="list"><tbody>
5777<tr><th>dst</th>
5778 <td class="description">Destination</td></tr>
5779<tr><th>cb</th>
5780 <td class="description">Write callback function</td></tr>
5781<tr><th>blocking</th>
5782 <td class="description">Use blocking IO?</td></tr>
5783<tr><th>parent</th>
5784 <td class="description">Parent IPP message</td></tr>
5785<tr><th>ipp</th>
5786 <td class="description">IPP data</td></tr>
5787</tbody></table>
798d6e29
MS
5788<h4 class="returnvalue">Return Value</h4>
5789 <p class="description">Current state</p>
798d6e29 5790 <h2 class="title"><a id="TYPES">Data Types</a></h2>
798d6e29
MS
5791 <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>
5792 <p class="description">Client credentials callback
5793</p>
5794 <p class="code">
53af7f21 5795typedef int(*)(http_t *http, void *tls, cups_array_t *distinguished_names, void *user_data)cups_client_cert_cb_t;
798d6e29
MS
5796</p>
5797 <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>
5798 <p class="description">Destination enumeration callback
5799</p>
5800 <p class="code">
5801typedef int(*)(void *user_data, unsigned flags, <a href="#cups_dest_t">cups_dest_t</a> *dest)cups_dest_cb_t;
5802</p>
5803 <h3 class="typedef"><a id="cups_dest_t">cups_dest_t</a></h3>
5804 <p class="description">Destination</p>
5805 <p class="code">
5806typedef struct <a href="#cups_dest_s">cups_dest_s</a> cups_dest_t;
5807</p>
5808 <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>
5809 <p class="description">Destination capability and status
5810information </p>
5811 <p class="code">
5812typedef struct _cups_dinfo_s cups_dinfo_t;
798d6e29
MS
5813</p>
5814 <h3 class="typedef"><a id="cups_job_t">cups_job_t</a></h3>
5815 <p class="description">Job</p>
5816 <p class="code">
5817typedef struct <a href="#cups_job_s">cups_job_s</a> cups_job_t;
798d6e29
MS
5818</p>
5819 <h3 class="typedef"><a id="cups_option_t">cups_option_t</a></h3>
5820 <p class="description">Printer Options</p>
5821 <p class="code">
5822typedef struct <a href="#cups_option_s">cups_option_s</a> cups_option_t;
5823</p>
5824 <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>
5825 <p class="description">New password callback
5826</p>
5827 <p class="code">
5828typedef 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
5829</p>
5830 <h3 class="typedef"><a id="cups_ptype_t">cups_ptype_t</a></h3>
5831 <p class="description">Printer type/capability bits</p>
5832 <p class="code">
5833typedef unsigned cups_ptype_t;
5834</p>
5835 <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>
5836 <p class="description">Server credentials callback
5837</p>
5838 <p class="code">
53af7f21 5839typedef int(*)(http_t *http, void *tls, cups_array_t *certs, void *user_data)cups_server_cert_cb_t;
798d6e29
MS
5840</p>
5841 <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>
5842 <p class="description">Media Size </p>
5843 <p class="code">
5844typedef struct <a href="#cups_size_s">cups_size_s</a> cups_size_t;
798d6e29
MS
5845</p>
5846 <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>
5847 <p class="description">Socket address union, which
5848makes using IPv6 and other
5849address types easier and
5850more portable. </p>
5851 <p class="code">
5852typedef union _http_addr_u / http_addr_t;
798d6e29
MS
5853</p>
5854 <h3 class="typedef"><a id="http_encoding_t">http_encoding_t</a></h3>
5855 <p class="description">HTTP transfer encoding values</p>
5856 <p class="code">
5857typedef enum <a href="#http_encoding_e">http_encoding_e</a> http_encoding_t;
5858</p>
5859 <h3 class="typedef"><a id="http_encryption_t">http_encryption_t</a></h3>
5860 <p class="description">HTTP encryption values</p>
5861 <p class="code">
5862typedef enum <a href="#http_encryption_e">http_encryption_e</a> http_encryption_t;
5863</p>
5864 <h3 class="typedef"><a id="http_field_t">http_field_t</a></h3>
5865 <p class="description">HTTP field names</p>
5866 <p class="code">
5867typedef enum <a href="#http_field_e">http_field_e</a> http_field_t;
5868</p>
5869 <h3 class="typedef"><a id="http_keepalive_t">http_keepalive_t</a></h3>
5870 <p class="description">HTTP keep-alive values</p>
5871 <p class="code">
5872typedef enum <a href="#http_keepalive_e">http_keepalive_e</a> http_keepalive_t;
5873</p>
5874 <h3 class="typedef"><a id="http_state_t">http_state_t</a></h3>
5875 <p class="description">HTTP state values; states
5876are server-oriented...</p>
5877 <p class="code">
5878typedef enum <a href="#http_state_e">http_state_e</a> http_state_t;
5879</p>
5880 <h3 class="typedef"><a id="http_t">http_t</a></h3>
5881 <p class="description">HTTP connection type</p>
5882 <p class="code">
5883typedef struct _http_s http_t;
5884</p>
5885 <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>
5886 <p class="description">HTTP timeout callback </p>
5887 <p class="code">
5888typedef int(*)(http_t *http, void *user_data)http_timeout_cb_t;
5889</p>
5890 <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>
5891 <p class="description">Level of trust for credentials </p>
5892 <p class="code">
5893typedef enum <a href="#http_trust_e">http_trust_e</a> http_trust_t;
5894</p>
5895 <h3 class="typedef"><a id="http_uri_coding_t">http_uri_coding_t</a></h3>
5896 <p class="description">URI en/decode flags</p>
5897 <p class="code">
5898typedef enum <a href="#http_uri_coding_e">http_uri_coding_e</a> http_uri_coding_t;
5899</p>
5900 <h3 class="typedef"><a id="http_uri_status_t"><span class="info">&#160;CUPS 1.2&#160;</span>http_uri_status_t</a></h3>
5901 <p class="description">URI separation status </p>
5902 <p class="code">
5903typedef enum <a href="#http_uri_status_e">http_uri_status_e</a> http_uri_status_t;
798d6e29
MS
5904</p>
5905 <h3 class="typedef"><a id="ipp_attribute_t">ipp_attribute_t</a></h3>
5906 <p class="description">IPP attribute</p>
5907 <p class="code">
5908typedef struct _ipp_attribute_s ipp_attribute_t;
5909</p>
65bebeac
MS
5910 <h3 class="typedef"><a id="ipp_copycb_t"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span>ipp_copycb_t</a></h3>
5911 <p class="description">ippCopyAttributes callback function </p>
798d6e29
MS
5912 <p class="code">
5913typedef 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
5914</p>
5915 <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>
65bebeac 5916 <p class="description">ippReadIO/ippWriteIO callback function </p>
798d6e29 5917 <p class="code">
98d88c8d 5918typedef ssize_t(*)(void *context, ipp_uchar_t *buffer, size_t bytes) ipp_iocb_t;
798d6e29
MS
5919</p>
5920 <h3 class="typedef"><a id="ipp_orient_t">ipp_orient_t</a></h3>
5921 <p class="description">Orientation values</p>
5922 <p class="code">
5923typedef enum <a href="#ipp_orient_e">ipp_orient_e</a> ipp_orient_t;
5924</p>
5925 <h3 class="typedef"><a id="ipp_pstate_t">ipp_pstate_t</a></h3>
65bebeac 5926 <p class="description">Printer state values</p>
798d6e29
MS
5927 <p class="code">
5928typedef enum <a href="#ipp_pstate_e">ipp_pstate_e</a> ipp_pstate_t;
5929</p>
5930 <h3 class="typedef"><a id="ipp_quality_t">ipp_quality_t</a></h3>
65bebeac 5931 <p class="description">Print quality values</p>
798d6e29
MS
5932 <p class="code">
5933typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t;
5934</p>
5935 <h3 class="typedef"><a id="ipp_res_t">ipp_res_t</a></h3>
5936 <p class="description">Resolution units</p>
5937 <p class="code">
5938typedef enum <a href="#ipp_res_e">ipp_res_e</a> ipp_res_t;
5939</p>
5940 <h3 class="typedef"><a id="ipp_state_t">ipp_state_t</a></h3>
65bebeac 5941 <p class="description">ipp_t state values</p>
798d6e29
MS
5942 <p class="code">
5943typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t;
5944</p>
5945 <h3 class="typedef"><a id="ipp_t">ipp_t</a></h3>
5946 <p class="description">IPP request/response data</p>
5947 <p class="code">
5948typedef struct _ipp_s ipp_t;
798d6e29
MS
5949</p>
5950 <h2 class="title"><a id="STRUCTURES">Structures</a></h2>
798d6e29
MS
5951<h3 class="struct"><a id="cups_dest_s">cups_dest_s</a></h3>
5952 <p class="description">Destination</p>
5953<p class="code">struct cups_dest_s {<br>
5954&#160;&#160;&#160;&#160;char *name, *instance;<br>
5955&#160;&#160;&#160;&#160;int is_default;<br>
5956&#160;&#160;&#160;&#160;int num_options;<br>
5957&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options;<br>
5958};</p>
5959<h4 class="members">Members</h4>
98d88c8d
MS
5960<table class="list"><tbody>
5961<tr><th>instance </th>
5962 <td class="description">Local instance name or NULL</td></tr>
5963<tr><th>is_default </th>
5964 <td class="description">Is this printer the default?</td></tr>
5965<tr><th>num_options </th>
5966 <td class="description">Number of options</td></tr>
5967<tr><th>options </th>
5968 <td class="description">Options</td></tr>
5969</tbody></table>
798d6e29
MS
5970<h3 class="struct"><a id="cups_job_s">cups_job_s</a></h3>
5971 <p class="description">Job</p>
5972<p class="code">struct cups_job_s {<br>
5973&#160;&#160;&#160;&#160;time_t completed_time;<br>
5974&#160;&#160;&#160;&#160;time_t creation_time;<br>
5975&#160;&#160;&#160;&#160;char *dest;<br>
5976&#160;&#160;&#160;&#160;char *format;<br>
5977&#160;&#160;&#160;&#160;int id;<br>
5978&#160;&#160;&#160;&#160;int priority;<br>
5979&#160;&#160;&#160;&#160;time_t processing_time;<br>
5980&#160;&#160;&#160;&#160;int size;<br>
5981&#160;&#160;&#160;&#160;ipp_jstate_t state;<br>
5982&#160;&#160;&#160;&#160;char *title;<br>
5983&#160;&#160;&#160;&#160;char *user;<br>
5984};</p>
5985<h4 class="members">Members</h4>
98d88c8d
MS
5986<table class="list"><tbody>
5987<tr><th>completed_time </th>
5988 <td class="description">Time the job was completed</td></tr>
5989<tr><th>creation_time </th>
5990 <td class="description">Time the job was created</td></tr>
5991<tr><th>dest </th>
5992 <td class="description">Printer or class name</td></tr>
5993<tr><th>format </th>
5994 <td class="description">Document format</td></tr>
5995<tr><th>id </th>
5996 <td class="description">The job ID</td></tr>
5997<tr><th>priority </th>
5998 <td class="description">Priority (1-100)</td></tr>
5999<tr><th>processing_time </th>
6000 <td class="description">Time the job was processed</td></tr>
6001<tr><th>size </th>
6002 <td class="description">Size in kilobytes</td></tr>
6003<tr><th>state </th>
6004 <td class="description">Job state</td></tr>
6005<tr><th>title </th>
6006 <td class="description">Title/job name</td></tr>
6007<tr><th>user </th>
6008 <td class="description">User that submitted the job</td></tr>
6009</tbody></table>
798d6e29
MS
6010<h3 class="struct"><a id="cups_option_s">cups_option_s</a></h3>
6011 <p class="description">Printer Options</p>
6012<p class="code">struct cups_option_s {<br>
6013&#160;&#160;&#160;&#160;char *name;<br>
6014&#160;&#160;&#160;&#160;char *value;<br>
6015};</p>
6016<h4 class="members">Members</h4>
98d88c8d
MS
6017<table class="list"><tbody>
6018<tr><th>name </th>
6019 <td class="description">Name of option</td></tr>
6020<tr><th>value </th>
6021 <td class="description">Value of option</td></tr>
6022</tbody></table>
798d6e29
MS
6023<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>
6024 <p class="description">Media Size </p>
6025<p class="code">struct cups_size_s {<br>
6026&#160;&#160;&#160;&#160;char media[128];<br>
6027&#160;&#160;&#160;&#160;int width, length, bottom, left, right, top;<br>
6028};</p>
6029<h4 class="members">Members</h4>
98d88c8d
MS
6030<table class="list"><tbody>
6031<tr><th>media[128] </th>
6032 <td class="description">Media name to use</td></tr>
6033<tr><th>top </th>
6034 <td class="description">Top margin in hundredths of
6035millimeters</td></tr>
6036</tbody></table>
798d6e29 6037 <h2 class="title"><a id="ENUMERATIONS">Constants</a></h2>
798d6e29
MS
6038 <h3 class="enumeration"><a id="cups_ptype_e">cups_ptype_e</a></h3>
6039 <p class="description">Printer type/capability bit
6040constants</p>
6041 <h4 class="constants">Constants</h4>
98d88c8d
MS
6042 <table class="list"><tbody>
6043 <tr><th>CUPS_PRINTER_AUTHENTICATED <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Printer requires authentication
6044</td></tr>
6045 <tr><th>CUPS_PRINTER_BIND </th> <td class="description">Can bind output</td></tr>
6046 <tr><th>CUPS_PRINTER_BW </th> <td class="description">Can do B&amp;W printing</td></tr>
6047 <tr><th>CUPS_PRINTER_CLASS </th> <td class="description">Printer class</td></tr>
6048 <tr><th>CUPS_PRINTER_COLLATE </th> <td class="description">Can quickly collate copies</td></tr>
6049 <tr><th>CUPS_PRINTER_COLOR </th> <td class="description">Can do color printing</td></tr>
6050 <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
6051</td></tr>
6052 <tr><th>CUPS_PRINTER_COPIES </th> <td class="description">Can do copies in hardware</td></tr>
6053 <tr><th>CUPS_PRINTER_COVER </th> <td class="description">Can cover output</td></tr>
6054 <tr><th>CUPS_PRINTER_DEFAULT </th> <td class="description">Default printer on network</td></tr>
6055 <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>
6056 <tr><th>CUPS_PRINTER_DUPLEX </th> <td class="description">Can do two-sided printing</td></tr>
6057 <tr><th>CUPS_PRINTER_FAX </th> <td class="description">Fax queue</td></tr>
6058 <tr><th>CUPS_PRINTER_LARGE </th> <td class="description">Can print on D/E/A1/A0-size media</td></tr>
6059 <tr><th>CUPS_PRINTER_LOCAL </th> <td class="description">Local printer or class</td></tr>
6060 <tr><th>CUPS_PRINTER_MEDIUM </th> <td class="description">Can print on Tabloid/B/C/A3/A2-size media</td></tr>
6061 <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
6062</td></tr>
6063 <tr><th>CUPS_PRINTER_PUNCH </th> <td class="description">Can punch output</td></tr>
6064 <tr><th>CUPS_PRINTER_REJECTING </th> <td class="description">Printer is rejecting jobs</td></tr>
6065 <tr><th>CUPS_PRINTER_REMOTE </th> <td class="description">Remote printer or class</td></tr>
6066 <tr><th>CUPS_PRINTER_SMALL </th> <td class="description">Can print on Letter/Legal/A4-size media</td></tr>
6067 <tr><th>CUPS_PRINTER_SORT </th> <td class="description">Can sort output</td></tr>
6068 <tr><th>CUPS_PRINTER_STAPLE </th> <td class="description">Can staple output</td></tr>
6069 <tr><th>CUPS_PRINTER_VARIABLE </th> <td class="description">Can print on rolls and custom-size media</td></tr>
6070</tbody></table>
798d6e29
MS
6071 <h3 class="enumeration"><a id="http_encoding_e">http_encoding_e</a></h3>
6072 <p class="description">HTTP transfer encoding values</p>
6073 <h4 class="constants">Constants</h4>
98d88c8d
MS
6074 <table class="list"><tbody>
6075 <tr><th>HTTP_ENCODING_CHUNKED </th> <td class="description">Data is chunked</td></tr>
6076 <tr><th>HTTP_ENCODING_FIELDS </th> <td class="description">Sending HTTP fields</td></tr>
6077 <tr><th>HTTP_ENCODING_LENGTH </th> <td class="description">Data is sent with Content-Length</td></tr>
6078</tbody></table>
798d6e29
MS
6079 <h3 class="enumeration"><a id="http_encryption_e">http_encryption_e</a></h3>
6080 <p class="description">HTTP encryption values</p>
6081 <h4 class="constants">Constants</h4>
98d88c8d
MS
6082 <table class="list"><tbody>
6083 <tr><th>HTTP_ENCRYPTION_ALWAYS </th> <td class="description">Always encrypt (SSL)</td></tr>
6084 <tr><th>HTTP_ENCRYPTION_IF_REQUESTED </th> <td class="description">Encrypt if requested (TLS upgrade)</td></tr>
6085 <tr><th>HTTP_ENCRYPTION_NEVER </th> <td class="description">Never encrypt</td></tr>
6086 <tr><th>HTTP_ENCRYPTION_REQUIRED </th> <td class="description">Encryption is required (TLS upgrade)</td></tr>
6087</tbody></table>
798d6e29
MS
6088 <h3 class="enumeration"><a id="http_field_e">http_field_e</a></h3>
6089 <p class="description">HTTP field names</p>
6090 <h4 class="constants">Constants</h4>
98d88c8d
MS
6091 <table class="list"><tbody>
6092 <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>
6093 <tr><th>HTTP_FIELD_ACCEPT_LANGUAGE </th> <td class="description">Accept-Language field</td></tr>
6094 <tr><th>HTTP_FIELD_ACCEPT_RANGES </th> <td class="description">Accept-Ranges field</td></tr>
6095 <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>
6096 <tr><th>HTTP_FIELD_AUTHORIZATION </th> <td class="description">Authorization field</td></tr>
6097 <tr><th>HTTP_FIELD_CONNECTION </th> <td class="description">Connection field</td></tr>
6098 <tr><th>HTTP_FIELD_CONTENT_ENCODING </th> <td class="description">Content-Encoding field</td></tr>
6099 <tr><th>HTTP_FIELD_CONTENT_LANGUAGE </th> <td class="description">Content-Language field</td></tr>
6100 <tr><th>HTTP_FIELD_CONTENT_LENGTH </th> <td class="description">Content-Length field</td></tr>
6101 <tr><th>HTTP_FIELD_CONTENT_LOCATION </th> <td class="description">Content-Location field</td></tr>
6102 <tr><th>HTTP_FIELD_CONTENT_MD5 </th> <td class="description">Content-MD5 field</td></tr>
6103 <tr><th>HTTP_FIELD_CONTENT_RANGE </th> <td class="description">Content-Range field</td></tr>
6104 <tr><th>HTTP_FIELD_CONTENT_TYPE </th> <td class="description">Content-Type field</td></tr>
6105 <tr><th>HTTP_FIELD_CONTENT_VERSION </th> <td class="description">Content-Version field</td></tr>
6106 <tr><th>HTTP_FIELD_DATE </th> <td class="description">Date field</td></tr>
6107 <tr><th>HTTP_FIELD_HOST </th> <td class="description">Host field</td></tr>
6108 <tr><th>HTTP_FIELD_IF_MODIFIED_SINCE </th> <td class="description">If-Modified-Since field</td></tr>
6109 <tr><th>HTTP_FIELD_IF_UNMODIFIED_SINCE </th> <td class="description">If-Unmodified-Since field</td></tr>
6110 <tr><th>HTTP_FIELD_KEEP_ALIVE </th> <td class="description">Keep-Alive field</td></tr>
6111 <tr><th>HTTP_FIELD_LAST_MODIFIED </th> <td class="description">Last-Modified field</td></tr>
6112 <tr><th>HTTP_FIELD_LINK </th> <td class="description">Link field</td></tr>
6113 <tr><th>HTTP_FIELD_LOCATION </th> <td class="description">Location field</td></tr>
6114 <tr><th>HTTP_FIELD_MAX </th> <td class="description">Maximum field index</td></tr>
6115 <tr><th>HTTP_FIELD_RANGE </th> <td class="description">Range field</td></tr>
6116 <tr><th>HTTP_FIELD_REFERER </th> <td class="description">Referer field</td></tr>
6117 <tr><th>HTTP_FIELD_RETRY_AFTER </th> <td class="description">Retry-After field</td></tr>
6118 <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>
6119 <tr><th>HTTP_FIELD_TRANSFER_ENCODING </th> <td class="description">Transfer-Encoding field</td></tr>
6120 <tr><th>HTTP_FIELD_UNKNOWN </th> <td class="description">Unknown field</td></tr>
6121 <tr><th>HTTP_FIELD_UPGRADE </th> <td class="description">Upgrade field</td></tr>
6122 <tr><th>HTTP_FIELD_USER_AGENT </th> <td class="description">User-Agent field</td></tr>
6123 <tr><th>HTTP_FIELD_WWW_AUTHENTICATE </th> <td class="description">WWW-Authenticate field</td></tr>
6124</tbody></table>
798d6e29
MS
6125 <h3 class="enumeration"><a id="http_keepalive_e">http_keepalive_e</a></h3>
6126 <p class="description">HTTP keep-alive values</p>
6127 <h4 class="constants">Constants</h4>
98d88c8d
MS
6128 <table class="list"><tbody>
6129 <tr><th>HTTP_KEEPALIVE_OFF </th> <td class="description">No keep alive support</td></tr>
6130 <tr><th>HTTP_KEEPALIVE_ON </th> <td class="description">Use keep alive</td></tr>
6131</tbody></table>
798d6e29
MS
6132 <h3 class="enumeration"><a id="http_state_e">http_state_e</a></h3>
6133 <p class="description">HTTP state values; states
6134are server-oriented...</p>
6135 <h4 class="constants">Constants</h4>
98d88c8d
MS
6136 <table class="list"><tbody>
6137 <tr><th>HTTP_STATE_CONNECT </th> <td class="description">CONNECT command, waiting for blank line</td></tr>
6138 <tr><th>HTTP_STATE_DELETE </th> <td class="description">DELETE command, waiting for blank line</td></tr>
6139 <tr><th>HTTP_STATE_ERROR </th> <td class="description">Error on socket</td></tr>
6140 <tr><th>HTTP_STATE_GET </th> <td class="description">GET command, waiting for blank line</td></tr>
6141 <tr><th>HTTP_STATE_GET_SEND </th> <td class="description">GET command, sending data</td></tr>
6142 <tr><th>HTTP_STATE_HEAD </th> <td class="description">HEAD command, waiting for blank line</td></tr>
6143 <tr><th>HTTP_STATE_OPTIONS </th> <td class="description">OPTIONS command, waiting for blank line</td></tr>
6144 <tr><th>HTTP_STATE_POST </th> <td class="description">POST command, waiting for blank line</td></tr>
6145 <tr><th>HTTP_STATE_POST_RECV </th> <td class="description">POST command, receiving data</td></tr>
6146 <tr><th>HTTP_STATE_POST_SEND </th> <td class="description">POST command, sending data</td></tr>
6147 <tr><th>HTTP_STATE_PUT </th> <td class="description">PUT command, waiting for blank line</td></tr>
6148 <tr><th>HTTP_STATE_PUT_RECV </th> <td class="description">PUT command, receiving data</td></tr>
6149 <tr><th>HTTP_STATE_STATUS </th> <td class="description">Command complete, sending status</td></tr>
6150 <tr><th>HTTP_STATE_TRACE </th> <td class="description">TRACE command, waiting for blank line</td></tr>
6151 <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>
6152 <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>
6153 <tr><th>HTTP_STATE_WAITING </th> <td class="description">Waiting for command</td></tr>
6154</tbody></table>
798d6e29
MS
6155 <h3 class="enumeration"><a id="http_status_e">http_status_e</a></h3>
6156 <p class="description">HTTP status codes</p>
6157 <h4 class="constants">Constants</h4>
98d88c8d
MS
6158 <table class="list"><tbody>
6159 <tr><th>HTTP_STATUS_ACCEPTED </th> <td class="description">DELETE command was successful</td></tr>
6160 <tr><th>HTTP_STATUS_BAD_GATEWAY </th> <td class="description">Bad gateway</td></tr>
6161 <tr><th>HTTP_STATUS_BAD_REQUEST </th> <td class="description">Bad request</td></tr>
6162 <tr><th>HTTP_STATUS_CONFLICT </th> <td class="description">Request is self-conflicting</td></tr>
6163 <tr><th>HTTP_STATUS_CONTINUE </th> <td class="description">Everything OK, keep going...</td></tr>
6164 <tr><th>HTTP_STATUS_CREATED </th> <td class="description">PUT command was successful</td></tr>
6165 <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>
6166 <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>
6167 <tr><th>HTTP_STATUS_ERROR </th> <td class="description">An error response from httpXxxx()</td></tr>
6168 <tr><th>HTTP_STATUS_EXPECTATION_FAILED </th> <td class="description">The expectation given in an Expect header field was not met</td></tr>
6169 <tr><th>HTTP_STATUS_FORBIDDEN </th> <td class="description">Forbidden to access this URI</td></tr>
699fe020 6170 <tr><th>HTTP_STATUS_FOUND </th> <td class="description">Document was found at a different URI</td></tr>
98d88c8d
MS
6171 <tr><th>HTTP_STATUS_GATEWAY_TIMEOUT </th> <td class="description">Gateway connection timed out</td></tr>
6172 <tr><th>HTTP_STATUS_GONE </th> <td class="description">Server has gone away</td></tr>
6173 <tr><th>HTTP_STATUS_LENGTH_REQUIRED </th> <td class="description">A content length or encoding is required</td></tr>
6174 <tr><th>HTTP_STATUS_METHOD_NOT_ALLOWED </th> <td class="description">Method is not allowed</td></tr>
6175 <tr><th>HTTP_STATUS_MOVED_PERMANENTLY </th> <td class="description">Document has moved permanently</td></tr>
98d88c8d
MS
6176 <tr><th>HTTP_STATUS_MULTIPLE_CHOICES </th> <td class="description">Multiple files match request</td></tr>
6177 <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>
6178 <tr><th>HTTP_STATUS_NOT_ACCEPTABLE </th> <td class="description">Not Acceptable</td></tr>
6179 <tr><th>HTTP_STATUS_NOT_AUTHORITATIVE </th> <td class="description">Information isn't authoritative</td></tr>
6180 <tr><th>HTTP_STATUS_NOT_FOUND </th> <td class="description">URI was not found</td></tr>
6181 <tr><th>HTTP_STATUS_NOT_IMPLEMENTED </th> <td class="description">Feature not implemented</td></tr>
6182 <tr><th>HTTP_STATUS_NOT_MODIFIED </th> <td class="description">File not modified</td></tr>
6183 <tr><th>HTTP_STATUS_NOT_SUPPORTED </th> <td class="description">HTTP version not supported</td></tr>
6184 <tr><th>HTTP_STATUS_NO_CONTENT </th> <td class="description">Successful command, no new data</td></tr>
6185 <tr><th>HTTP_STATUS_OK </th> <td class="description">OPTIONS/GET/HEAD/POST/TRACE command was successful</td></tr>
6186 <tr><th>HTTP_STATUS_PARTIAL_CONTENT </th> <td class="description">Only a partial file was received/sent</td></tr>
6187 <tr><th>HTTP_STATUS_PAYMENT_REQUIRED </th> <td class="description">Payment required</td></tr>
6188 <tr><th>HTTP_STATUS_PRECONDITION </th> <td class="description">Precondition failed</td></tr>
6189 <tr><th>HTTP_STATUS_PROXY_AUTHENTICATION </th> <td class="description">Proxy Authentication is Required</td></tr>
6190 <tr><th>HTTP_STATUS_REQUESTED_RANGE </th> <td class="description">The requested range is not satisfiable</td></tr>
6191 <tr><th>HTTP_STATUS_REQUEST_TIMEOUT </th> <td class="description">Request timed out</td></tr>
6192 <tr><th>HTTP_STATUS_REQUEST_TOO_LARGE </th> <td class="description">Request entity too large</td></tr>
6193 <tr><th>HTTP_STATUS_RESET_CONTENT </th> <td class="description">Content was reset/recreated</td></tr>
699fe020 6194 <tr><th>HTTP_STATUS_SEE_OTHER </th> <td class="description">See this other link</td></tr>
98d88c8d
MS
6195 <tr><th>HTTP_STATUS_SERVER_ERROR </th> <td class="description">Internal server error</td></tr>
6196 <tr><th>HTTP_STATUS_SERVICE_UNAVAILABLE </th> <td class="description">Service is unavailable</td></tr>
6197 <tr><th>HTTP_STATUS_SWITCHING_PROTOCOLS </th> <td class="description">HTTP upgrade to TLS/SSL</td></tr>
699fe020 6198 <tr><th>HTTP_STATUS_TEMPORARY_REDIRECT </th> <td class="description">Temporary redirection</td></tr>
98d88c8d
MS
6199 <tr><th>HTTP_STATUS_UNAUTHORIZED </th> <td class="description">Unauthorized to access host</td></tr>
6200 <tr><th>HTTP_STATUS_UNSUPPORTED_MEDIATYPE </th> <td class="description">The requested media type is unsupported</td></tr>
6201 <tr><th>HTTP_STATUS_UPGRADE_REQUIRED </th> <td class="description">Upgrade to SSL/TLS required</td></tr>
6202 <tr><th>HTTP_STATUS_URI_TOO_LONG </th> <td class="description">URI too long</td></tr>
6203 <tr><th>HTTP_STATUS_USE_PROXY </th> <td class="description">Must use a proxy to access this URI</td></tr>
6204</tbody></table>
798d6e29
MS
6205 <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>
6206 <p class="description">Level of trust for credentials </p>
6207 <h4 class="constants">Constants</h4>
98d88c8d
MS
6208 <table class="list"><tbody>
6209 <tr><th>HTTP_TRUST_CHANGED </th> <td class="description">Credentials have changed</td></tr>
6210 <tr><th>HTTP_TRUST_EXPIRED </th> <td class="description">Credentials are expired</td></tr>
6211 <tr><th>HTTP_TRUST_INVALID </th> <td class="description">Credentials are invalid</td></tr>
6212 <tr><th>HTTP_TRUST_OK </th> <td class="description">Credentials are OK/trusted</td></tr>
6213 <tr><th>HTTP_TRUST_RENEWED </th> <td class="description">Credentials have been renewed</td></tr>
6214 <tr><th>HTTP_TRUST_UNKNOWN </th> <td class="description">Credentials are unknown/new</td></tr>
6215</tbody></table>
798d6e29
MS
6216 <h3 class="enumeration"><a id="http_uri_coding_e">http_uri_coding_e</a></h3>
6217 <p class="description">URI en/decode flags</p>
6218 <h4 class="constants">Constants</h4>
98d88c8d
MS
6219 <table class="list"><tbody>
6220 <tr><th>HTTP_URI_CODING_ALL </th> <td class="description">En/decode everything</td></tr>
6221 <tr><th>HTTP_URI_CODING_HOSTNAME </th> <td class="description">En/decode the hostname portion</td></tr>
6222 <tr><th>HTTP_URI_CODING_MOST </th> <td class="description">En/decode all but the query</td></tr>
6223 <tr><th>HTTP_URI_CODING_NONE </th> <td class="description">Don't en/decode anything</td></tr>
6224 <tr><th>HTTP_URI_CODING_QUERY </th> <td class="description">En/decode the query portion</td></tr>
6225 <tr><th>HTTP_URI_CODING_RESOURCE </th> <td class="description">En/decode the resource portion</td></tr>
6226 <tr><th>HTTP_URI_CODING_RFC6874 </th> <td class="description">Use RFC 6874 address format</td></tr>
6227 <tr><th>HTTP_URI_CODING_USERNAME </th> <td class="description">En/decode the username portion</td></tr>
6228</tbody></table>
798d6e29
MS
6229 <h3 class="enumeration"><a id="http_uri_status_e"><span class="info">&#160;CUPS 1.2&#160;</span>http_uri_status_e</a></h3>
6230 <p class="description">URI separation status </p>
6231 <h4 class="constants">Constants</h4>
98d88c8d
MS
6232 <table class="list"><tbody>
6233 <tr><th>HTTP_URI_STATUS_BAD_ARGUMENTS </th> <td class="description">Bad arguments to function (error)</td></tr>
6234 <tr><th>HTTP_URI_STATUS_BAD_HOSTNAME </th> <td class="description">Bad hostname in URI (error)</td></tr>
6235 <tr><th>HTTP_URI_STATUS_BAD_PORT </th> <td class="description">Bad port number in URI (error)</td></tr>
6236 <tr><th>HTTP_URI_STATUS_BAD_RESOURCE </th> <td class="description">Bad resource in URI (error)</td></tr>
6237 <tr><th>HTTP_URI_STATUS_BAD_SCHEME </th> <td class="description">Bad scheme in URI (error)</td></tr>
6238 <tr><th>HTTP_URI_STATUS_BAD_URI </th> <td class="description">Bad/empty URI (error)</td></tr>
6239 <tr><th>HTTP_URI_STATUS_BAD_USERNAME </th> <td class="description">Bad username in URI (error)</td></tr>
6240 <tr><th>HTTP_URI_STATUS_MISSING_RESOURCE </th> <td class="description">Missing resource in URI (warning)</td></tr>
6241 <tr><th>HTTP_URI_STATUS_MISSING_SCHEME </th> <td class="description">Missing scheme in URI (warning)</td></tr>
6242 <tr><th>HTTP_URI_STATUS_OK </th> <td class="description">URI decoded OK</td></tr>
6243 <tr><th>HTTP_URI_STATUS_OVERFLOW </th> <td class="description">URI buffer for httpAssembleURI is too small</td></tr>
6244 <tr><th>HTTP_URI_STATUS_UNKNOWN_SCHEME </th> <td class="description">Unknown scheme in URI (warning)</td></tr>
6245</tbody></table>
798d6e29 6246 <h3 class="enumeration"><a id="ipp_finishings_e">ipp_finishings_e</a></h3>
718ee2ff 6247 <p class="description">Finishings values</p>
798d6e29 6248 <h4 class="constants">Constants</h4>
98d88c8d
MS
6249 <table class="list"><tbody>
6250 <tr><th>IPP_FINISHINGS_BALE </th> <td class="description">Bale (any type)</td></tr>
6251 <tr><th>IPP_FINISHINGS_BIND </th> <td class="description">Bind</td></tr>
6252 <tr><th>IPP_FINISHINGS_BIND_BOTTOM </th> <td class="description">Bind on bottom</td></tr>
6253 <tr><th>IPP_FINISHINGS_BIND_LEFT </th> <td class="description">Bind on left</td></tr>
6254 <tr><th>IPP_FINISHINGS_BIND_RIGHT </th> <td class="description">Bind on right</td></tr>
6255 <tr><th>IPP_FINISHINGS_BIND_TOP </th> <td class="description">Bind on top</td></tr>
6256 <tr><th>IPP_FINISHINGS_BOOKLET_MAKER </th> <td class="description">Fold to make booklet</td></tr>
6257 <tr><th>IPP_FINISHINGS_COAT </th> <td class="description">Apply protective liquid or powder coating</td></tr>
6258 <tr><th>IPP_FINISHINGS_COVER </th> <td class="description">Add cover</td></tr>
6259 <tr><th>IPP_FINISHINGS_EDGE_STITCH </th> <td class="description">Stitch along any side</td></tr>
6260 <tr><th>IPP_FINISHINGS_EDGE_STITCH_BOTTOM </th> <td class="description">Stitch along bottom edge</td></tr>
6261 <tr><th>IPP_FINISHINGS_EDGE_STITCH_LEFT </th> <td class="description">Stitch along left side</td></tr>
6262 <tr><th>IPP_FINISHINGS_EDGE_STITCH_RIGHT </th> <td class="description">Stitch along right side</td></tr>
6263 <tr><th>IPP_FINISHINGS_EDGE_STITCH_TOP </th> <td class="description">Stitch along top edge</td></tr>
6264 <tr><th>IPP_FINISHINGS_FOLD </th> <td class="description">Fold (any type)</td></tr>
6265 <tr><th>IPP_FINISHINGS_FOLD_ACCORDIAN </th> <td class="description">Accordian-fold the paper vertically into four sections</td></tr>
6266 <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>
6267 <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>
6268 <tr><th>IPP_FINISHINGS_FOLD_GATE </th> <td class="description">Fold the top and bottom quarters of the paper towards the midline</td></tr>
6269 <tr><th>IPP_FINISHINGS_FOLD_HALF </th> <td class="description">Fold the paper in half vertically</td></tr>
6270 <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>
6271 <tr><th>IPP_FINISHINGS_FOLD_LEFT_GATE </th> <td class="description">Fold the top quarter of the paper towards the midline</td></tr>
6272 <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>
6273 <tr><th>IPP_FINISHINGS_FOLD_PARALLEL </th> <td class="description">Fold the paper in half vertically two times, yielding four sections</td></tr>
6274 <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>
6275 <tr><th>IPP_FINISHINGS_FOLD_RIGHT_GATE </th> <td class="description">Fold the bottom quarter of the paper towards the midline</td></tr>
6276 <tr><th>IPP_FINISHINGS_FOLD_Z </th> <td class="description">Fold the paper vertically into three sections, forming a Z</td></tr>
6277 <tr><th>IPP_FINISHINGS_JOG_OFFSET </th> <td class="description">Offset for binding (any type)</td></tr>
6278 <tr><th>IPP_FINISHINGS_LAMINATE </th> <td class="description">Apply protective (solid) material</td></tr>
6279 <tr><th>IPP_FINISHINGS_NONE </th> <td class="description">No finishing</td></tr>
6280 <tr><th>IPP_FINISHINGS_PUNCH </th> <td class="description">Punch (any location/count)</td></tr>
6281 <tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_LEFT </th> <td class="description">Punch 1 hole bottom left</td></tr>
6282 <tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT </th> <td class="description">Punch 1 hole bottom right</td></tr>
6283 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_BOTTOM </th> <td class="description">Punch 2 holes bottom edge</td></tr>
6284 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_LEFT </th> <td class="description">Punch 2 holes left side</td></tr>
6285 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_RIGHT </th> <td class="description">Punch 2 holes right side</td></tr>
6286 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_TOP </th> <td class="description">Punch 2 holes top edge</td></tr>
6287 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM </th> <td class="description">Pucnh multiple holes bottom edge</td></tr>
6288 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT </th> <td class="description">Pucnh multiple holes left side</td></tr>
6289 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT </th> <td class="description">Pucnh multiple holes right side</td></tr>
6290 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_TOP </th> <td class="description">Pucnh multiple holes top edge</td></tr>
6291 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_BOTTOM </th> <td class="description">Punch 4 holes bottom edge</td></tr>
6292 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_LEFT </th> <td class="description">Punch 4 holes left side</td></tr>
6293 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_RIGHT </th> <td class="description">Punch 4 holes right side</td></tr>
6294 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_TOP </th> <td class="description">Punch 4 holes top edge</td></tr>
6295 <tr><th>IPP_FINISHINGS_PUNCH_TOP_LEFT </th> <td class="description">Punch 1 hole top left</td></tr>
6296 <tr><th>IPP_FINISHINGS_PUNCH_TOP_RIGHT </th> <td class="description">Punch 1 hole top right</td></tr>
6297 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM </th> <td class="description">Punch 3 holes bottom edge</td></tr>
6298 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_LEFT </th> <td class="description">Punch 3 holes left side</td></tr>
6299 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT </th> <td class="description">Punch 3 holes right side</td></tr>
6300 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_TOP </th> <td class="description">Punch 3 holes top edge</td></tr>
6301 <tr><th>IPP_FINISHINGS_SADDLE_STITCH </th> <td class="description">Staple interior</td></tr>
6302 <tr><th>IPP_FINISHINGS_STAPLE </th> <td class="description">Staple (any location/method)</td></tr>
6303 <tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_LEFT </th> <td class="description">Staple bottom left corner</td></tr>
6304 <tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT </th> <td class="description">Staple bottom right corner</td></tr>
6305 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_BOTTOM </th> <td class="description">Two staples on bottom</td></tr>
6306 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_LEFT </th> <td class="description">Two staples on left</td></tr>
6307 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_RIGHT </th> <td class="description">Two staples on right</td></tr>
6308 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_TOP </th> <td class="description">Two staples on top</td></tr>
6309 <tr><th>IPP_FINISHINGS_STAPLE_TOP_LEFT </th> <td class="description">Staple top left corner</td></tr>
6310 <tr><th>IPP_FINISHINGS_STAPLE_TOP_RIGHT </th> <td class="description">Staple top right corner</td></tr>
6311 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM </th> <td class="description">Three staples on bottom</td></tr>
6312 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_LEFT </th> <td class="description">Three staples on left</td></tr>
6313 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT </th> <td class="description">Three staples on right</td></tr>
6314 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_TOP </th> <td class="description">Three staples on top</td></tr>
6315 <tr><th>IPP_FINISHINGS_TRIM </th> <td class="description">Trim (any type)</td></tr>
6316 <tr><th>IPP_FINISHINGS_TRIM_AFTER_COPIES </th> <td class="description">Trim output after each copy</td></tr>
6317 <tr><th>IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS </th> <td class="description">Trim output after each document</td></tr>
6318 <tr><th>IPP_FINISHINGS_TRIM_AFTER_JOB </th> <td class="description">Trim output after job</td></tr>
6319 <tr><th>IPP_FINISHINGS_TRIM_AFTER_PAGES </th> <td class="description">Trim output after each page</td></tr>
6320</tbody></table>
798d6e29
MS
6321 <h3 class="enumeration"><a id="ipp_jstate_e">ipp_jstate_e</a></h3>
6322 <p class="description">Job states</p>
6323 <h4 class="constants">Constants</h4>
98d88c8d
MS
6324 <table class="list"><tbody>
6325 <tr><th>IPP_JSTATE_ABORTED </th> <td class="description">Job has aborted due to error</td></tr>
6326 <tr><th>IPP_JSTATE_CANCELED </th> <td class="description">Job has been canceled</td></tr>
6327 <tr><th>IPP_JSTATE_COMPLETED </th> <td class="description">Job has completed successfully</td></tr>
6328 <tr><th>IPP_JSTATE_HELD </th> <td class="description">Job is held for printing</td></tr>
6329 <tr><th>IPP_JSTATE_PENDING </th> <td class="description">Job is waiting to be printed</td></tr>
6330 <tr><th>IPP_JSTATE_PROCESSING </th> <td class="description">Job is currently printing</td></tr>
6331 <tr><th>IPP_JSTATE_STOPPED </th> <td class="description">Job has been stopped</td></tr>
6332</tbody></table>
798d6e29
MS
6333 <h3 class="enumeration"><a id="ipp_op_e">ipp_op_e</a></h3>
6334 <p class="description">IPP operations</p>
6335 <h4 class="constants">Constants</h4>
98d88c8d 6336 <table class="list"><tbody>
4f63d6cd 6337 <tr><th>IPP_OP_ALLOCATE_PRINTER_RESOURCES </th> <td class="description">Allocate-Printer-Resources: Use resources for a printer.</td></tr>
98d88c8d
MS
6338 <tr><th>IPP_OP_CANCEL_CURRENT_JOB </th> <td class="description">Cancel-Current-Job: Cancel the current job</td></tr>
6339 <tr><th>IPP_OP_CANCEL_JOB </th> <td class="description">Cancel-Job: Cancel a job</td></tr>
6340 <tr><th>IPP_OP_CANCEL_JOBS </th> <td class="description">Cancel-Jobs: Cancel all jobs (administrative)</td></tr>
6341 <tr><th>IPP_OP_CANCEL_MY_JOBS </th> <td class="description">Cancel-My-Jobs: Cancel a user's jobs</td></tr>
4f63d6cd 6342 <tr><th>IPP_OP_CANCEL_RESOURCE </th> <td class="description">Cancel-Resource: Uninstall a resource.</td></tr>
98d88c8d
MS
6343 <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>
6344 <tr><th>IPP_OP_CLOSE_JOB </th> <td class="description">Close-Job: Close a job and start printing</td></tr>
6345 <tr><th>IPP_OP_CREATE_JOB </th> <td class="description">Create-Job: Create an empty print job</td></tr>
6346 <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>
4f63d6cd 6347 <tr><th>IPP_OP_CREATE_PRINTER </th> <td class="description">Create-Printer: Create a new service.</td></tr>
98d88c8d 6348 <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>
4f63d6cd
MS
6349 <tr><th>IPP_OP_CREATE_RESOURCE </th> <td class="description">Create-Resource: Create a new (empty) resource.</td></tr>
6350 <tr><th>IPP_OP_CREATE_RESOURCE_SUBSCRIPTIONS </th> <td class="description">Create-Resource-Subscriptions: Create event subscriptions for a resource.</td></tr>
6351 <tr><th>IPP_OP_CREATE_SYSTEM_SUBSCRIPTIONS </th> <td class="description">Create-System-Subscriptions: Create event subscriptions for a system.</td></tr>
98d88c8d
MS
6352 <tr><th>IPP_OP_CUPS_ADD_MODIFY_CLASS </th> <td class="description">CUPS-Add-Modify-Class: Add or modify a class</td></tr>
6353 <tr><th>IPP_OP_CUPS_ADD_MODIFY_PRINTER </th> <td class="description">CUPS-Add-Modify-Printer: Add or modify a printer</td></tr>
6354 <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>
6355 <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>
6356 <tr><th>IPP_OP_CUPS_DELETE_CLASS </th> <td class="description">CUPS-Delete-Class: Delete a class</td></tr>
6357 <tr><th>IPP_OP_CUPS_DELETE_PRINTER </th> <td class="description">CUPS-Delete-Printer: Delete a printer</td></tr>
6358 <tr><th>IPP_OP_CUPS_GET_DEFAULT </th> <td class="description">CUPS-Get-Default: Get the default printer</td></tr>
6359 <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>
6360 <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>
6361 <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>
6362 <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>
6363 <tr><th>IPP_OP_CUPS_GET_PRINTERS </th> <td class="description">CUPS-Get-Printers: Get a list of printers and/or classes</td></tr>
6364 <tr><th>IPP_OP_CUPS_INVALID </th> <td class="description">Invalid operation name for <a href="#ippOpValue"><code>ippOpValue</code></a></td></tr>
6365 <tr><th>IPP_OP_CUPS_MOVE_JOB </th> <td class="description">CUPS-Move-Job: Move a job to a different printer</td></tr>
6366 <tr><th>IPP_OP_CUPS_SET_DEFAULT </th> <td class="description">CUPS-Set-Default: Set the default printer</td></tr>
4f63d6cd
MS
6367 <tr><th>IPP_OP_DEALLOCATE_PRINTER_RESOURCES </th> <td class="description">Deallocate-Printer-Resources: Stop using resources for a printer.</td></tr>
6368 <tr><th>IPP_OP_DELETE_PRINTER </th> <td class="description">Delete-Printer: Delete an existing service.</td></tr>
6369 <tr><th>IPP_OP_DISABLE_ALL_PRINTERS </th> <td class="description">Disable-All-Printers: Stop accepting new jobs on all services.</td></tr>
98d88c8d 6370 <tr><th>IPP_OP_DISABLE_PRINTER </th> <td class="description">Disable-Printer: Reject new jobs for a printer</td></tr>
4f63d6cd 6371 <tr><th>IPP_OP_ENABLE_ALL_PRINTERS </th> <td class="description">Enable-All-Printers: Start accepting new jobs on all services.</td></tr>
98d88c8d
MS
6372 <tr><th>IPP_OP_ENABLE_PRINTER </th> <td class="description">Enable-Printer: Accept new jobs for a printer</td></tr>
6373 <tr><th>IPP_OP_GET_JOBS </th> <td class="description">Get-Jobs: Get a list of jobs</td></tr>
6374 <tr><th>IPP_OP_GET_JOB_ATTRIBUTES </th> <td class="description">Get-Job-Attribute: Get information about a job</td></tr>
6375 <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>
4f63d6cd 6376 <tr><th>IPP_OP_GET_PRINTERS </th> <td class="description">Get-Printers: Get a list of services.</td></tr>
98d88c8d
MS
6377 <tr><th>IPP_OP_GET_PRINTER_ATTRIBUTES </th> <td class="description">Get-Printer-Attributes: Get information about a printer</td></tr>
6378 <tr><th>IPP_OP_GET_PRINTER_SUPPORTED_VALUES </th> <td class="description">Get-Printer-Supported-Values: Get supported values</td></tr>
6379 <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>
6380 <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>
4f63d6cd
MS
6381 <tr><th>IPP_OP_GET_SYSTEM_ATTRIBUTES </th> <td class="description">Get-System-Attributes: Get system object attributes.</td></tr>
6382 <tr><th>IPP_OP_GET_SYSTEM_SUPPORTED_VALUES </th> <td class="description">Get-System-Supported-Values: Get supported values for system object attributes.</td></tr>
98d88c8d
MS
6383 <tr><th>IPP_OP_HOLD_JOB </th> <td class="description">Hold-Job: Hold a job for printing</td></tr>
6384 <tr><th>IPP_OP_HOLD_NEW_JOBS </th> <td class="description">Hold-New-Jobs: Hold new jobs</td></tr>
6385 <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>
4f63d6cd
MS
6386 <tr><th>IPP_OP_INSTALL_RESOURCE </th> <td class="description">Install-Resource: Install a resource.</td></tr>
6387 <tr><th>IPP_OP_PAUSE_ALL_PRINTERS </th> <td class="description">Pause-All-Printers: Stop all services immediately.</td></tr>
6388 <tr><th>IPP_OP_PAUSE_ALL_PRINTERS_AFTER_CURRENT_JOB </th> <td class="description">Pause-All-Printers-After-Current-Job: Stop all services after processing the current jobs.</td></tr>
98d88c8d
MS
6389 <tr><th>IPP_OP_PAUSE_PRINTER </th> <td class="description">Pause-Printer: Stop a printer</td></tr>
6390 <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>
6391 <tr><th>IPP_OP_PRINT_JOB </th> <td class="description">Print-Job: Print a single file</td></tr>
6392 <tr><th>IPP_OP_PROMOTE_JOB </th> <td class="description">Promote-Job: Promote a job to print sooner</td></tr>
4f63d6cd 6393 <tr><th>IPP_OP_REGISTER_OUTPUT_DEVICE </th> <td class="description">Register-Output-Device: Register a remote service.</td></tr>
98d88c8d
MS
6394 <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>
6395 <tr><th>IPP_OP_RELEASE_JOB </th> <td class="description">Release-Job: Release a job for printing</td></tr>
6396 <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>
6397 <tr><th>IPP_OP_RESTART_JOB <span class="info">&#160;DEPRECATED&#160;</span></th> <td class="description">Restart-Job: Reprint a job </td></tr>
4f63d6cd
MS
6398 <tr><th>IPP_OP_RESTART_SYSTEM </th> <td class="description">Restart-System: Restart all services.</td></tr>
6399 <tr><th>IPP_OP_RESUME_ALL_PRINTERS </th> <td class="description">Resume-All-Printers: Start job processing on all services.</td></tr>
98d88c8d
MS
6400 <tr><th>IPP_OP_RESUME_JOB </th> <td class="description">Resume-Job: Resume the current job</td></tr>
6401 <tr><th>IPP_OP_RESUME_PRINTER </th> <td class="description">Resume-Printer: Start a printer</td></tr>
6402 <tr><th>IPP_OP_SCHEDULE_JOB_AFTER </th> <td class="description">Schedule-Job-After: Schedule a job to print after another</td></tr>
6403 <tr><th>IPP_OP_SEND_DOCUMENT </th> <td class="description">Send-Document: Add a file to a job</td></tr>
4f63d6cd 6404 <tr><th>IPP_OP_SEND_RESOURCE_DATA </th> <td class="description">Send-Resource-Data: Upload the data for a resource.</td></tr>
98d88c8d
MS
6405 <tr><th>IPP_OP_SET_JOB_ATTRIBUTES </th> <td class="description">Set-Job-Attributes: Set job values</td></tr>
6406 <tr><th>IPP_OP_SET_PRINTER_ATTRIBUTES </th> <td class="description">Set-Printer-Attributes: Set printer values</td></tr>
4f63d6cd
MS
6407 <tr><th>IPP_OP_SET_RESOURCE_ATTRIBUTES </th> <td class="description">Set-Resource-Attributes: Set resource object attributes.</td></tr>
6408 <tr><th>IPP_OP_SET_SYSTEM_ATTRIBUTES </th> <td class="description">Set-System-Attributes: Set system object attributes.</td></tr>
6409 <tr><th>IPP_OP_SHUTDOWN_ALL_PRINTERS </th> <td class="description">Shutdown-All-Printers: Shutdown all services.</td></tr>
6410 <tr><th>IPP_OP_SHUTDOWN_ONE_PRINTER </th> <td class="description">Shutdown-One-Printer: Shutdown a service.</td></tr>
6411 <tr><th>IPP_OP_STARTUP_ALL_PRINTERS </th> <td class="description">Startup-All-Printers: Startup all services.</td></tr>
6412 <tr><th>IPP_OP_STARTUP_ONE_PRINTER </th> <td class="description">Startup-One-Printer: Start a service.</td></tr>
98d88c8d
MS
6413 <tr><th>IPP_OP_SUSPEND_CURRENT_JOB </th> <td class="description">Suspend-Current-Job: Suspend the current job</td></tr>
6414 <tr><th>IPP_OP_VALIDATE_JOB </th> <td class="description">Validate-Job: Validate job values prior to submission</td></tr>
6415</tbody></table>
798d6e29
MS
6416 <h3 class="enumeration"><a id="ipp_orient_e">ipp_orient_e</a></h3>
6417 <p class="description">Orientation values</p>
6418 <h4 class="constants">Constants</h4>
98d88c8d
MS
6419 <table class="list"><tbody>
6420 <tr><th>IPP_ORIENT_LANDSCAPE </th> <td class="description">90 degrees counter-clockwise</td></tr>
6421 <tr><th>IPP_ORIENT_NONE </th> <td class="description">No rotation</td></tr>
6422 <tr><th>IPP_ORIENT_PORTRAIT </th> <td class="description">No rotation</td></tr>
6423 <tr><th>IPP_ORIENT_REVERSE_LANDSCAPE </th> <td class="description">90 degrees clockwise</td></tr>
6424 <tr><th>IPP_ORIENT_REVERSE_PORTRAIT </th> <td class="description">180 degrees</td></tr>
6425</tbody></table>
798d6e29 6426 <h3 class="enumeration"><a id="ipp_pstate_e">ipp_pstate_e</a></h3>
65bebeac 6427 <p class="description">Printer state values</p>
798d6e29 6428 <h4 class="constants">Constants</h4>
98d88c8d
MS
6429 <table class="list"><tbody>
6430 <tr><th>IPP_PSTATE_IDLE </th> <td class="description">Printer is idle</td></tr>
6431 <tr><th>IPP_PSTATE_PROCESSING </th> <td class="description">Printer is working</td></tr>
6432 <tr><th>IPP_PSTATE_STOPPED </th> <td class="description">Printer is stopped</td></tr>
6433</tbody></table>
798d6e29 6434 <h3 class="enumeration"><a id="ipp_quality_e">ipp_quality_e</a></h3>
65bebeac 6435 <p class="description">Print quality values</p>
798d6e29 6436 <h4 class="constants">Constants</h4>
98d88c8d
MS
6437 <table class="list"><tbody>
6438 <tr><th>IPP_QUALITY_DRAFT </th> <td class="description">Draft quality</td></tr>
6439 <tr><th>IPP_QUALITY_HIGH </th> <td class="description">High quality</td></tr>
6440 <tr><th>IPP_QUALITY_NORMAL </th> <td class="description">Normal quality</td></tr>
6441</tbody></table>
798d6e29
MS
6442 <h3 class="enumeration"><a id="ipp_res_e">ipp_res_e</a></h3>
6443 <p class="description">Resolution units</p>
6444 <h4 class="constants">Constants</h4>
98d88c8d
MS
6445 <table class="list"><tbody>
6446 <tr><th>IPP_RES_PER_CM </th> <td class="description">Pixels per centimeter</td></tr>
6447 <tr><th>IPP_RES_PER_INCH </th> <td class="description">Pixels per inch</td></tr>
6448</tbody></table>
798d6e29 6449 <h3 class="enumeration"><a id="ipp_state_e">ipp_state_e</a></h3>
65bebeac 6450 <p class="description">ipp_t state values</p>
798d6e29 6451 <h4 class="constants">Constants</h4>
98d88c8d
MS
6452 <table class="list"><tbody>
6453 <tr><th>IPP_STATE_ATTRIBUTE </th> <td class="description">One or more attributes need to be sent/received</td></tr>
6454 <tr><th>IPP_STATE_DATA </th> <td class="description">IPP request data needs to be sent/received</td></tr>
6455 <tr><th>IPP_STATE_ERROR </th> <td class="description">An error occurred</td></tr>
6456 <tr><th>IPP_STATE_HEADER </th> <td class="description">The request header needs to be sent/received</td></tr>
6457 <tr><th>IPP_STATE_IDLE </th> <td class="description">Nothing is happening/request completed</td></tr>
6458</tbody></table>
798d6e29 6459 <h3 class="enumeration"><a id="ipp_status_e">ipp_status_e</a></h3>
65bebeac 6460 <p class="description">IPP status code values</p>
798d6e29 6461 <h4 class="constants">Constants</h4>
98d88c8d
MS
6462 <table class="list"><tbody>
6463 <tr><th>IPP_STATUS_CUPS_INVALID </th> <td class="description">Invalid status name for <a href="#ippErrorValue"><code>ippErrorValue</code></a></td></tr>
6464 <tr><th>IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED </th> <td class="description">client-error-account-authorization-failed</td></tr>
6465 <tr><th>IPP_STATUS_ERROR_ACCOUNT_CLOSED </th> <td class="description">client-error-account-closed</td></tr>
6466 <tr><th>IPP_STATUS_ERROR_ACCOUNT_INFO_NEEDED </th> <td class="description">client-error-account-info-needed</td></tr>
6467 <tr><th>IPP_STATUS_ERROR_ACCOUNT_LIMIT_REACHED </th> <td class="description">client-error-account-limit-reached</td></tr>
6468 <tr><th>IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE </th> <td class="description">client-error-attributes-not-settable</td></tr>
6469 <tr><th>IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES </th> <td class="description">client-error-attributes-or-values-not-supported</td></tr>
6470 <tr><th>IPP_STATUS_ERROR_BAD_REQUEST </th> <td class="description">client-error-bad-request</td></tr>
6471 <tr><th>IPP_STATUS_ERROR_BUSY </th> <td class="description">server-error-busy</td></tr>
6472 <tr><th>IPP_STATUS_ERROR_CHARSET </th> <td class="description">client-error-charset-not-supported</td></tr>
6473 <tr><th>IPP_STATUS_ERROR_COMPRESSION_ERROR </th> <td class="description">client-error-compression-error</td></tr>
6474 <tr><th>IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED </th> <td class="description">client-error-compression-not-supported</td></tr>
6475 <tr><th>IPP_STATUS_ERROR_CONFLICTING </th> <td class="description">client-error-conflicting-attributes</td></tr>
6476 <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>
6477 <tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED </th> <td class="description">cups-error-account-closed @deprecate@</td></tr>
6478 <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>
6479 <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>
6480 <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>
6481 <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>
6482 <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>
6483 <tr><th>IPP_STATUS_ERROR_DEVICE </th> <td class="description">server-error-device-error</td></tr>
6484 <tr><th>IPP_STATUS_ERROR_DOCUMENT_ACCESS </th> <td class="description">client-error-document-access-error</td></tr>
6485 <tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR </th> <td class="description">client-error-document-format-error</td></tr>
6486 <tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED </th> <td class="description">client-error-document-format-not-supported</td></tr>
6487 <tr><th>IPP_STATUS_ERROR_DOCUMENT_PASSWORD </th> <td class="description">client-error-document-password-error</td></tr>
6488 <tr><th>IPP_STATUS_ERROR_DOCUMENT_PERMISSION </th> <td class="description">client-error-document-permission-error</td></tr>
6489 <tr><th>IPP_STATUS_ERROR_DOCUMENT_SECURITY </th> <td class="description">client-error-document-security-error</td></tr>
6490 <tr><th>IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE </th> <td class="description">client-error-document-unprintable-error</td></tr>
6491 <tr><th>IPP_STATUS_ERROR_FORBIDDEN </th> <td class="description">client-error-forbidden</td></tr>
6492 <tr><th>IPP_STATUS_ERROR_GONE </th> <td class="description">client-error-gone</td></tr>
6493 <tr><th>IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS </th> <td class="description">client-error-ignored-all-subscriptions</td></tr>
6494 <tr><th>IPP_STATUS_ERROR_INTERNAL </th> <td class="description">server-error-internal-error</td></tr>
6495 <tr><th>IPP_STATUS_ERROR_JOB_CANCELED </th> <td class="description">server-error-job-canceled</td></tr>
6496 <tr><th>IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED </th> <td class="description">server-error-multiple-document-jobs-not-supported</td></tr>
6497 <tr><th>IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS </th> <td class="description">server-error-not-accepting-jobs</td></tr>
6498 <tr><th>IPP_STATUS_ERROR_NOT_AUTHENTICATED </th> <td class="description">client-error-not-authenticated</td></tr>
6499 <tr><th>IPP_STATUS_ERROR_NOT_AUTHORIZED </th> <td class="description">client-error-not-authorized</td></tr>
6500 <tr><th>IPP_STATUS_ERROR_NOT_FETCHABLE </th> <td class="description">client-error-not-fetchable</td></tr>
6501 <tr><th>IPP_STATUS_ERROR_NOT_FOUND </th> <td class="description">client-error-not-found</td></tr>
6502 <tr><th>IPP_STATUS_ERROR_NOT_POSSIBLE </th> <td class="description">client-error-not-possible</td></tr>
6503 <tr><th>IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED </th> <td class="description">server-error-operation-not-supported</td></tr>
6504 <tr><th>IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED </th> <td class="description">server-error-printer-is-deactivated</td></tr>
6505 <tr><th>IPP_STATUS_ERROR_REQUEST_ENTITY </th> <td class="description">client-error-request-entity-too-large</td></tr>
6506 <tr><th>IPP_STATUS_ERROR_REQUEST_VALUE </th> <td class="description">client-error-request-value-too-long</td></tr>
6507 <tr><th>IPP_STATUS_ERROR_SERVICE_UNAVAILABLE </th> <td class="description">server-error-service-unavailable</td></tr>
6508 <tr><th>IPP_STATUS_ERROR_TEMPORARY </th> <td class="description">server-error-temporary-error</td></tr>
6509 <tr><th>IPP_STATUS_ERROR_TIMEOUT </th> <td class="description">client-error-timeout</td></tr>
6510 <tr><th>IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS </th> <td class="description">server-error-too-many-documents</td></tr>
6511 <tr><th>IPP_STATUS_ERROR_TOO_MANY_JOBS </th> <td class="description">server-error-too-many-jobs</td></tr>
6512 <tr><th>IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS </th> <td class="description">client-error-too-many-subscriptions</td></tr>
6513 <tr><th>IPP_STATUS_ERROR_URI_SCHEME </th> <td class="description">client-error-uri-scheme-not-supported</td></tr>
6514 <tr><th>IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED </th> <td class="description">server-error-version-not-supported</td></tr>
6515 <tr><th>IPP_STATUS_OK </th> <td class="description">successful-ok</td></tr>
6516 <tr><th>IPP_STATUS_OK_CONFLICTING </th> <td class="description">successful-ok-conflicting-attributes</td></tr>
6517 <tr><th>IPP_STATUS_OK_EVENTS_COMPLETE </th> <td class="description">successful-ok-events-complete</td></tr>
6518 <tr><th>IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED </th> <td class="description">successful-ok-ignored-or-substituted-attributes</td></tr>
6519 <tr><th>IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS </th> <td class="description">successful-ok-ignored-subscriptions</td></tr>
6520 <tr><th>IPP_STATUS_OK_TOO_MANY_EVENTS </th> <td class="description">successful-ok-too-many-events</td></tr>
6521</tbody></table>
798d6e29 6522 <h3 class="enumeration"><a id="ipp_tag_e">ipp_tag_e</a></h3>
65bebeac 6523 <p class="description">Value and group tag values for attributes</p>
798d6e29 6524 <h4 class="constants">Constants</h4>
98d88c8d
MS
6525 <table class="list"><tbody>
6526 <tr><th>IPP_TAG_ADMINDEFINE </th> <td class="description">Admin-defined value</td></tr>
6527 <tr><th>IPP_TAG_BOOLEAN </th> <td class="description">Boolean value</td></tr>
6528 <tr><th>IPP_TAG_CHARSET </th> <td class="description">Character set value</td></tr>
6529 <tr><th>IPP_TAG_CUPS_INVALID </th> <td class="description">Invalid tag name for <a href="#ippTagValue"><code>ippTagValue</code></a></td></tr>
6530 <tr><th>IPP_TAG_DATE </th> <td class="description">Date/time value</td></tr>
6531 <tr><th>IPP_TAG_DEFAULT </th> <td class="description">Default value</td></tr>
6532 <tr><th>IPP_TAG_DELETEATTR </th> <td class="description">Delete-attribute value</td></tr>
4f63d6cd 6533 <tr><th>IPP_TAG_DOCUMENT </th> <td class="description">Document group</td></tr>
98d88c8d
MS
6534 <tr><th>IPP_TAG_END </th> <td class="description">End-of-attributes</td></tr>
6535 <tr><th>IPP_TAG_ENUM </th> <td class="description">Enumeration value</td></tr>
6536 <tr><th>IPP_TAG_EVENT_NOTIFICATION </th> <td class="description">Event group</td></tr>
6537 <tr><th>IPP_TAG_INTEGER </th> <td class="description">Integer value</td></tr>
6538 <tr><th>IPP_TAG_JOB </th> <td class="description">Job group</td></tr>
6539 <tr><th>IPP_TAG_KEYWORD </th> <td class="description">Keyword value</td></tr>
6540 <tr><th>IPP_TAG_LANGUAGE </th> <td class="description">Language value</td></tr>
6541 <tr><th>IPP_TAG_MIMETYPE </th> <td class="description">MIME media type value</td></tr>
6542 <tr><th>IPP_TAG_NAME </th> <td class="description">Name value</td></tr>
6543 <tr><th>IPP_TAG_NAMELANG </th> <td class="description">Name-with-language value</td></tr>
6544 <tr><th>IPP_TAG_NOTSETTABLE </th> <td class="description">Not-settable value</td></tr>
6545 <tr><th>IPP_TAG_NOVALUE </th> <td class="description">No-value value</td></tr>
6546 <tr><th>IPP_TAG_OPERATION </th> <td class="description">Operation group</td></tr>
6547 <tr><th>IPP_TAG_PRINTER </th> <td class="description">Printer group</td></tr>
6548 <tr><th>IPP_TAG_RANGE </th> <td class="description">Range value</td></tr>
6549 <tr><th>IPP_TAG_RESOLUTION </th> <td class="description">Resolution value</td></tr>
4f63d6cd 6550 <tr><th>IPP_TAG_RESOURCE </th> <td class="description">Resource group</td></tr>
98d88c8d
MS
6551 <tr><th>IPP_TAG_STRING </th> <td class="description">Octet string value</td></tr>
6552 <tr><th>IPP_TAG_SUBSCRIPTION </th> <td class="description">Subscription group</td></tr>
4f63d6cd 6553 <tr><th>IPP_TAG_SYSTEM </th> <td class="description">System group</td></tr>
98d88c8d
MS
6554 <tr><th>IPP_TAG_TEXT </th> <td class="description">Text value</td></tr>
6555 <tr><th>IPP_TAG_TEXTLANG </th> <td class="description">Text-with-language value</td></tr>
6556 <tr><th>IPP_TAG_UNKNOWN </th> <td class="description">Unknown value</td></tr>
6557 <tr><th>IPP_TAG_UNSUPPORTED_GROUP </th> <td class="description">Unsupported attributes group</td></tr>
6558 <tr><th>IPP_TAG_UNSUPPORTED_VALUE </th> <td class="description">Unsupported value</td></tr>
6559 <tr><th>IPP_TAG_URI </th> <td class="description">URI value</td></tr>
6560 <tr><th>IPP_TAG_URISCHEME </th> <td class="description">URI scheme value</td></tr>
6561 <tr><th>IPP_TAG_ZERO </th> <td class="description">Zero tag - used for separators</td></tr>
6562</tbody></table>
798d6e29
MS
6563 </div>
6564 </body>
6565</html>