]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/cupspm.html
Update API documentation.
[thirdparty/cups.git] / doc / help / cupspm.html
CommitLineData
73721e3e 1<!DOCTYPE html>
798d6e29
MS
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">
93d79201 8 <meta name="creator" content="codedoc v3.2">
798d6e29 9 <meta name="author" content="Michael R Sweet">
73721e3e 10 <meta name="copyright" content="Copyright &#xa9; 2007-2019 by Apple Inc. All Rights Reserved.">
ddf2ec73 11 <meta name="version" content="2.3.0">
798d6e29 12 <style type="text/css"><!--
93d79201 13body, p, h1, h2, h3, h4, h5, h6 {
798d6e29 14 font-family: sans-serif;
93d79201 15 line-height: 1.4;
798d6e29 16}
93d79201 17h1, h2, h3, h4, h5, h6 {
798d6e29 18 font-weight: bold;
93d79201
MS
19 page-break-inside: avoid;
20}
21h1 {
22 font-size: 250%;
798d6e29
MS
23 margin: 0;
24}
93d79201 25h2 {
798d6e29
MS
26 font-size: 250%;
27 margin-top: 1.5em;
28}
93d79201
MS
29h3 {
30 font-size: 200%;
798d6e29
MS
31 margin-bottom: 0.5em;
32 margin-top: 1.5em;
33}
93d79201
MS
34h4 {
35 font-size: 150%;
798d6e29
MS
36 margin-bottom: 0.5em;
37 margin-top: 1.5em;
38}
93d79201
MS
39h5 {
40 font-size: 125%;
798d6e29
MS
41 margin-bottom: 0.5em;
42 margin-top: 1.5em;
43}
93d79201 44h6 {
798d6e29 45 font-size: 110%;
93d79201
MS
46 margin-bottom: 0.5em;
47 margin-top: 1.5em;
798d6e29 48}
93d79201
MS
49div.header h1, div.header p {
50 text-align: center;
798d6e29 51}
93d79201
MS
52div.contents, div.body, div.footer {
53 page-break-before: always;
798d6e29 54}
93d79201 55.class, .enumeration, .function, .struct, .typedef, .union {
798d6e29
MS
56 border-bottom: solid 2px gray;
57}
798d6e29
MS
58.description {
59 margin-top: 0.5em;
60}
798d6e29 61.function {
798d6e29
MS
62 margin-bottom: 0;
63}
798d6e29
MS
64blockquote {
65 border: solid thin gray;
66 box-shadow: 3px 3px 5px rgba(0,0,0,0.5);
67 padding: 0px 10px;
68 page-break-inside: avoid;
69}
70p code, li code, p.code, pre, ul.code li {
798d6e29 71 font-family: monospace;
798d6e29
MS
72 hyphens: manual;
73 -webkit-hyphens: manual;
798d6e29
MS
74}
75p.code, pre, ul.code li {
93d79201
MS
76 background: rgba(127,127,127,0.1);
77 border: thin dotted gray;
798d6e29 78 padding: 10px;
93d79201 79 page-break-inside: avoid;
798d6e29
MS
80}
81a:link, a:visited {
82 text-decoration: none;
83}
84span.info {
85 background: black;
86 border: solid thin black;
87 color: white;
88 font-size: 80%;
89 font-style: italic;
90 font-weight: bold;
91 white-space: nowrap;
92}
93d79201 93h1 span.info, h2 span.info, h3 span.info, h4 span.info {
98d88c8d
MS
94 border-top-left-radius: 10px;
95 border-top-right-radius: 10px;
798d6e29 96 float: right;
98d88c8d 97 padding: 3px 6px;
798d6e29
MS
98}
99ul.code, ul.contents, ul.subcontents {
100 list-style-type: none;
101 margin: 0;
102 padding-left: 0;
103}
104ul.code li {
105 margin: 0;
106}
107ul.contents > li {
108 margin-top: 1em;
109}
110ul.contents li ul.code, ul.contents li ul.subcontents {
111 padding-left: 2em;
112}
93d79201
MS
113table {
114 border-collapse: collapse;
115 border-spacing: 0;
116}
117td {
118 border: solid 1px #666;
119 padding: 5px 10px;
120 vertical-align: top;
121}
122td.left {
123 text-align: left;
124}
125td.center {
126 text-align: center;
127}
128td.right {
129 text-align: right;
130}
131th {
132 border-bottom: solid 2px #000;
133 padding: 1px 5px;
134 text-align: center;
135 vertical-align: bottom;
136}
137tr:nth-child(even) {
138 background: rgba(127,127,127,0.1);n}
98d88c8d
MS
139table.list {
140 border-collapse: collapse;
141 width: 100%;
798d6e29 142}
98d88c8d 143table.list th {
93d79201 144 border-bottom: none;
98d88c8d
MS
145 border-right: 2px solid gray;
146 font-family: monospace;
147 padding: 5px 10px 5px 2px;
148 text-align: right;
149 vertical-align: top;
798d6e29 150}
98d88c8d 151table.list td {
93d79201 152 border: none;
98d88c8d
MS
153 padding: 5px 2px 5px 10px;
154 text-align: left;
155 vertical-align: top;
798d6e29 156}
93d79201 157h2.title, h3.title {
798d6e29
MS
158 border-bottom: solid 2px black;
159}
160--></style>
161 </head>
162 <body>
93d79201
MS
163 <div class="header">
164 <h1 class="title">CUPS Programming Manual</h1>
165 <p>Michael R Sweet</p>
166 <p>Copyright &#xa9; 2007-2019 by Apple Inc. All Rights Reserved.</p>
167 </div>
798d6e29
MS
168 <div class="contents">
169 <h2 class="title">Contents</h2>
170 <ul class="contents">
53af7f21
MS
171 <li><a href="#introduction">Introduction</a><ul class="subcontents">
172 <li><a href="#guidelines">Guidelines</a></li>
173 <li><a href="#terms-used-in-this-document">Terms Used in This Document</a></li>
174 <li><a href="#compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></li>
798d6e29 175 </ul></li>
53af7f21
MS
176 <li><a href="#working-with-destinations">Working with Destinations</a><ul class="subcontents">
177 <li><a href="#finding-available-destinations">Finding Available Destinations</a></li>
178 <li><a href="#basic-destination-information">Basic Destination Information</a></li>
179 <li><a href="#detailed-destination-information">Detailed Destination Information</a></li>
180 <li><a href="#submitting-a-print-job">Submitting a Print Job</a></li>
798d6e29 181 </ul></li>
b0fb2d75
MS
182 <li><a href="#sending-ipp-requests">Sending IPP Requests</a><ul class="subcontents">
183 <li><a href="#connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</a></li>
184 <li><a href="#creating-an-ipp-request">Creating an IPP Request</a></li>
185 <li><a href="#sending-the-ipp-request">Sending the IPP Request</a></li>
186 <li><a href="#processing-the-ipp-response">Processing the IPP Response</a></li>
187 <li><a href="#authentication">Authentication</a></li>
188 </ul></li>
798d6e29 189 <li><a href="#FUNCTIONS">Functions</a><ul class="subcontents">
73721e3e 190 <li><a href="#CF_OPTIONS">CF_OPTIONS</a></li>
798d6e29 191 <li><a href="#cupsAddDest">cupsAddDest</a></li>
63b75fbe 192 <li><a href="#cupsAddDestMediaOptions">cupsAddDestMediaOptions</a></li>
53af7f21 193 <li><a href="#cupsAddIntegerOption">cupsAddIntegerOption</a></li>
798d6e29 194 <li><a href="#cupsAddOption">cupsAddOption</a></li>
798d6e29 195 <li><a href="#cupsCancelDestJob">cupsCancelDestJob</a></li>
798d6e29
MS
196 <li><a href="#cupsCheckDestSupported">cupsCheckDestSupported</a></li>
197 <li><a href="#cupsCloseDestJob">cupsCloseDestJob</a></li>
198 <li><a href="#cupsConnectDest">cupsConnectDest</a></li>
798d6e29
MS
199 <li><a href="#cupsCopyDest">cupsCopyDest</a></li>
200 <li><a href="#cupsCopyDestConflicts">cupsCopyDestConflicts</a></li>
201 <li><a href="#cupsCopyDestInfo">cupsCopyDestInfo</a></li>
202 <li><a href="#cupsCreateDestJob">cupsCreateDestJob</a></li>
798d6e29 203 <li><a href="#cupsDoAuthentication">cupsDoAuthentication</a></li>
ddf2ec73 204 <li><a href="#cupsEncodeOption">cupsEncodeOption</a></li>
798d6e29
MS
205 <li><a href="#cupsEncodeOptions">cupsEncodeOptions</a></li>
206 <li><a href="#cupsEncodeOptions2">cupsEncodeOptions2</a></li>
207 <li><a href="#cupsEncryption">cupsEncryption</a></li>
208 <li><a href="#cupsEnumDests">cupsEnumDests</a></li>
798d6e29
MS
209 <li><a href="#cupsFindDestDefault">cupsFindDestDefault</a></li>
210 <li><a href="#cupsFindDestReady">cupsFindDestReady</a></li>
211 <li><a href="#cupsFindDestSupported">cupsFindDestSupported</a></li>
212 <li><a href="#cupsFinishDestDocument">cupsFinishDestDocument</a></li>
798d6e29
MS
213 <li><a href="#cupsFreeDestInfo">cupsFreeDestInfo</a></li>
214 <li><a href="#cupsFreeDests">cupsFreeDests</a></li>
215 <li><a href="#cupsFreeJobs">cupsFreeJobs</a></li>
216 <li><a href="#cupsFreeOptions">cupsFreeOptions</a></li>
798d6e29
MS
217 <li><a href="#cupsGetDest">cupsGetDest</a></li>
218 <li><a href="#cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></li>
219 <li><a href="#cupsGetDestMediaByName">cupsGetDestMediaByName</a></li>
220 <li><a href="#cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></li>
221 <li><a href="#cupsGetDestMediaCount">cupsGetDestMediaCount</a></li>
222 <li><a href="#cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></li>
223 <li><a href="#cupsGetDestWithURI">cupsGetDestWithURI</a></li>
98d88c8d 224 <li><a href="#cupsGetDests2">cupsGetDests2</a></li>
53af7f21 225 <li><a href="#cupsGetIntegerOption">cupsGetIntegerOption</a></li>
798d6e29
MS
226 <li><a href="#cupsGetJobs2">cupsGetJobs2</a></li>
227 <li><a href="#cupsGetNamedDest">cupsGetNamedDest</a></li>
228 <li><a href="#cupsGetOption">cupsGetOption</a></li>
798d6e29 229 <li><a href="#cupsGetPassword2">cupsGetPassword2</a></li>
798d6e29
MS
230 <li><a href="#cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></li>
231 <li><a href="#cupsLocalizeDestOption">cupsLocalizeDestOption</a></li>
232 <li><a href="#cupsLocalizeDestValue">cupsLocalizeDestValue</a></li>
233 <li><a href="#cupsMakeServerCredentials">cupsMakeServerCredentials</a></li>
798d6e29 234 <li><a href="#cupsParseOptions">cupsParseOptions</a></li>
798d6e29
MS
235 <li><a href="#cupsRemoveDest">cupsRemoveDest</a></li>
236 <li><a href="#cupsRemoveOption">cupsRemoveOption</a></li>
237 <li><a href="#cupsServer">cupsServer</a></li>
238 <li><a href="#cupsSetClientCertCB">cupsSetClientCertCB</a></li>
239 <li><a href="#cupsSetCredentials">cupsSetCredentials</a></li>
240 <li><a href="#cupsSetDefaultDest">cupsSetDefaultDest</a></li>
798d6e29
MS
241 <li><a href="#cupsSetDests2">cupsSetDests2</a></li>
242 <li><a href="#cupsSetEncryption">cupsSetEncryption</a></li>
798d6e29
MS
243 <li><a href="#cupsSetPasswordCB2">cupsSetPasswordCB2</a></li>
244 <li><a href="#cupsSetServer">cupsSetServer</a></li>
245 <li><a href="#cupsSetServerCertCB">cupsSetServerCertCB</a></li>
246 <li><a href="#cupsSetServerCredentials">cupsSetServerCredentials</a></li>
247 <li><a href="#cupsSetUser">cupsSetUser</a></li>
248 <li><a href="#cupsSetUserAgent">cupsSetUserAgent</a></li>
249 <li><a href="#cupsStartDestDocument">cupsStartDestDocument</a></li>
798d6e29
MS
250 <li><a href="#cupsUser">cupsUser</a></li>
251 <li><a href="#cupsUserAgent">cupsUserAgent</a></li>
252 <li><a href="#httpAcceptConnection">httpAcceptConnection</a></li>
253 <li><a href="#httpAddCredential">httpAddCredential</a></li>
254 <li><a href="#httpAddrAny">httpAddrAny</a></li>
255 <li><a href="#httpAddrClose">httpAddrClose</a></li>
798d6e29
MS
256 <li><a href="#httpAddrConnect2">httpAddrConnect2</a></li>
257 <li><a href="#httpAddrCopyList">httpAddrCopyList</a></li>
258 <li><a href="#httpAddrEqual">httpAddrEqual</a></li>
259 <li><a href="#httpAddrFamily">httpAddrFamily</a></li>
260 <li><a href="#httpAddrFreeList">httpAddrFreeList</a></li>
261 <li><a href="#httpAddrGetList">httpAddrGetList</a></li>
262 <li><a href="#httpAddrLength">httpAddrLength</a></li>
263 <li><a href="#httpAddrListen">httpAddrListen</a></li>
264 <li><a href="#httpAddrLocalhost">httpAddrLocalhost</a></li>
265 <li><a href="#httpAddrLookup">httpAddrLookup</a></li>
266 <li><a href="#httpAddrPort">httpAddrPort</a></li>
267 <li><a href="#httpAddrString">httpAddrString</a></li>
268 <li><a href="#httpAssembleURI">httpAssembleURI</a></li>
269 <li><a href="#httpAssembleURIf">httpAssembleURIf</a></li>
270 <li><a href="#httpAssembleUUID">httpAssembleUUID</a></li>
271 <li><a href="#httpBlocking">httpBlocking</a></li>
272 <li><a href="#httpCheck">httpCheck</a></li>
273 <li><a href="#httpClearCookie">httpClearCookie</a></li>
274 <li><a href="#httpClearFields">httpClearFields</a></li>
275 <li><a href="#httpClose">httpClose</a></li>
276 <li><a href="#httpCompareCredentials">httpCompareCredentials</a></li>
798d6e29 277 <li><a href="#httpConnect2">httpConnect2</a></li>
798d6e29
MS
278 <li><a href="#httpCopyCredentials">httpCopyCredentials</a></li>
279 <li><a href="#httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></li>
280 <li><a href="#httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></li>
281 <li><a href="#httpCredentialsGetTrust">httpCredentialsGetTrust</a></li>
282 <li><a href="#httpCredentialsString">httpCredentialsString</a></li>
798d6e29
MS
283 <li><a href="#httpDecode64_2">httpDecode64_2</a></li>
284 <li><a href="#httpDelete">httpDelete</a></li>
798d6e29
MS
285 <li><a href="#httpEncode64_2">httpEncode64_2</a></li>
286 <li><a href="#httpEncryption">httpEncryption</a></li>
287 <li><a href="#httpError">httpError</a></li>
288 <li><a href="#httpFieldValue">httpFieldValue</a></li>
289 <li><a href="#httpFlush">httpFlush</a></li>
290 <li><a href="#httpFlushWrite">httpFlushWrite</a></li>
291 <li><a href="#httpFreeCredentials">httpFreeCredentials</a></li>
292 <li><a href="#httpGet">httpGet</a></li>
293 <li><a href="#httpGetActivity">httpGetActivity</a></li>
294 <li><a href="#httpGetAddress">httpGetAddress</a></li>
295 <li><a href="#httpGetAuthString">httpGetAuthString</a></li>
296 <li><a href="#httpGetBlocking">httpGetBlocking</a></li>
297 <li><a href="#httpGetContentEncoding">httpGetContentEncoding</a></li>
298 <li><a href="#httpGetCookie">httpGetCookie</a></li>
798d6e29
MS
299 <li><a href="#httpGetDateString2">httpGetDateString2</a></li>
300 <li><a href="#httpGetDateTime">httpGetDateTime</a></li>
301 <li><a href="#httpGetEncryption">httpGetEncryption</a></li>
302 <li><a href="#httpGetExpect">httpGetExpect</a></li>
303 <li><a href="#httpGetFd">httpGetFd</a></li>
304 <li><a href="#httpGetField">httpGetField</a></li>
798d6e29
MS
305 <li><a href="#httpGetHostname">httpGetHostname</a></li>
306 <li><a href="#httpGetKeepAlive">httpGetKeepAlive</a></li>
798d6e29
MS
307 <li><a href="#httpGetLength2">httpGetLength2</a></li>
308 <li><a href="#httpGetPending">httpGetPending</a></li>
309 <li><a href="#httpGetReady">httpGetReady</a></li>
310 <li><a href="#httpGetRemaining">httpGetRemaining</a></li>
311 <li><a href="#httpGetState">httpGetState</a></li>
312 <li><a href="#httpGetStatus">httpGetStatus</a></li>
798d6e29
MS
313 <li><a href="#httpGetSubField2">httpGetSubField2</a></li>
314 <li><a href="#httpGetVersion">httpGetVersion</a></li>
315 <li><a href="#httpGets">httpGets</a></li>
316 <li><a href="#httpHead">httpHead</a></li>
317 <li><a href="#httpInitialize">httpInitialize</a></li>
318 <li><a href="#httpIsChunked">httpIsChunked</a></li>
319 <li><a href="#httpIsEncrypted">httpIsEncrypted</a></li>
320 <li><a href="#httpLoadCredentials">httpLoadCredentials</a></li>
321 <li><a href="#httpOptions">httpOptions</a></li>
322 <li><a href="#httpPeek">httpPeek</a></li>
323 <li><a href="#httpPost">httpPost</a></li>
324 <li><a href="#httpPut">httpPut</a></li>
798d6e29
MS
325 <li><a href="#httpRead2">httpRead2</a></li>
326 <li><a href="#httpReadRequest">httpReadRequest</a></li>
798d6e29
MS
327 <li><a href="#httpReconnect2">httpReconnect2</a></li>
328 <li><a href="#httpResolveHostname">httpResolveHostname</a></li>
329 <li><a href="#httpSaveCredentials">httpSaveCredentials</a></li>
798d6e29
MS
330 <li><a href="#httpSeparateURI">httpSeparateURI</a></li>
331 <li><a href="#httpSetAuthString">httpSetAuthString</a></li>
332 <li><a href="#httpSetCookie">httpSetCookie</a></li>
333 <li><a href="#httpSetCredentials">httpSetCredentials</a></li>
334 <li><a href="#httpSetDefaultField">httpSetDefaultField</a></li>
335 <li><a href="#httpSetExpect">httpSetExpect</a></li>
336 <li><a href="#httpSetField">httpSetField</a></li>
337 <li><a href="#httpSetKeepAlive">httpSetKeepAlive</a></li>
338 <li><a href="#httpSetLength">httpSetLength</a></li>
339 <li><a href="#httpSetTimeout">httpSetTimeout</a></li>
340 <li><a href="#httpShutdown">httpShutdown</a></li>
341 <li><a href="#httpStateString">httpStateString</a></li>
342 <li><a href="#httpStatus">httpStatus</a></li>
798d6e29
MS
343 <li><a href="#httpURIStatusString">httpURIStatusString</a></li>
344 <li><a href="#httpUpdate">httpUpdate</a></li>
345 <li><a href="#httpWait">httpWait</a></li>
798d6e29
MS
346 <li><a href="#httpWrite2">httpWrite2</a></li>
347 <li><a href="#httpWriteResponse">httpWriteResponse</a></li>
348 <li><a href="#ippAddBoolean">ippAddBoolean</a></li>
349 <li><a href="#ippAddBooleans">ippAddBooleans</a></li>
350 <li><a href="#ippAddCollection">ippAddCollection</a></li>
351 <li><a href="#ippAddCollections">ippAddCollections</a></li>
352 <li><a href="#ippAddDate">ippAddDate</a></li>
353 <li><a href="#ippAddInteger">ippAddInteger</a></li>
354 <li><a href="#ippAddIntegers">ippAddIntegers</a></li>
355 <li><a href="#ippAddOctetString">ippAddOctetString</a></li>
356 <li><a href="#ippAddOutOfBand">ippAddOutOfBand</a></li>
357 <li><a href="#ippAddRange">ippAddRange</a></li>
358 <li><a href="#ippAddRanges">ippAddRanges</a></li>
359 <li><a href="#ippAddResolution">ippAddResolution</a></li>
360 <li><a href="#ippAddResolutions">ippAddResolutions</a></li>
361 <li><a href="#ippAddSeparator">ippAddSeparator</a></li>
362 <li><a href="#ippAddString">ippAddString</a></li>
363 <li><a href="#ippAddStringf">ippAddStringf</a></li>
364 <li><a href="#ippAddStringfv">ippAddStringfv</a></li>
365 <li><a href="#ippAddStrings">ippAddStrings</a></li>
366 <li><a href="#ippAttributeString">ippAttributeString</a></li>
367 <li><a href="#ippContainsInteger">ippContainsInteger</a></li>
368 <li><a href="#ippContainsString">ippContainsString</a></li>
369 <li><a href="#ippCopyAttribute">ippCopyAttribute</a></li>
370 <li><a href="#ippCopyAttributes">ippCopyAttributes</a></li>
371 <li><a href="#ippCreateRequestedArray">ippCreateRequestedArray</a></li>
372 <li><a href="#ippDateToTime">ippDateToTime</a></li>
373 <li><a href="#ippDelete">ippDelete</a></li>
374 <li><a href="#ippDeleteAttribute">ippDeleteAttribute</a></li>
375 <li><a href="#ippDeleteValues">ippDeleteValues</a></li>
376 <li><a href="#ippEnumString">ippEnumString</a></li>
377 <li><a href="#ippEnumValue">ippEnumValue</a></li>
378 <li><a href="#ippErrorString">ippErrorString</a></li>
379 <li><a href="#ippErrorValue">ippErrorValue</a></li>
380 <li><a href="#ippFindAttribute">ippFindAttribute</a></li>
381 <li><a href="#ippFindNextAttribute">ippFindNextAttribute</a></li>
382 <li><a href="#ippFirstAttribute">ippFirstAttribute</a></li>
383 <li><a href="#ippGetBoolean">ippGetBoolean</a></li>
384 <li><a href="#ippGetCollection">ippGetCollection</a></li>
385 <li><a href="#ippGetCount">ippGetCount</a></li>
386 <li><a href="#ippGetDate">ippGetDate</a></li>
387 <li><a href="#ippGetGroupTag">ippGetGroupTag</a></li>
388 <li><a href="#ippGetInteger">ippGetInteger</a></li>
389 <li><a href="#ippGetName">ippGetName</a></li>
390 <li><a href="#ippGetOctetString">ippGetOctetString</a></li>
391 <li><a href="#ippGetOperation">ippGetOperation</a></li>
392 <li><a href="#ippGetRange">ippGetRange</a></li>
393 <li><a href="#ippGetRequestId">ippGetRequestId</a></li>
394 <li><a href="#ippGetResolution">ippGetResolution</a></li>
395 <li><a href="#ippGetState">ippGetState</a></li>
396 <li><a href="#ippGetStatusCode">ippGetStatusCode</a></li>
397 <li><a href="#ippGetString">ippGetString</a></li>
398 <li><a href="#ippGetValueTag">ippGetValueTag</a></li>
399 <li><a href="#ippGetVersion">ippGetVersion</a></li>
400 <li><a href="#ippLength">ippLength</a></li>
401 <li><a href="#ippNew">ippNew</a></li>
402 <li><a href="#ippNewRequest">ippNewRequest</a></li>
403 <li><a href="#ippNewResponse">ippNewResponse</a></li>
404 <li><a href="#ippNextAttribute">ippNextAttribute</a></li>
405 <li><a href="#ippOpString">ippOpString</a></li>
406 <li><a href="#ippOpValue">ippOpValue</a></li>
407 <li><a href="#ippPort">ippPort</a></li>
408 <li><a href="#ippRead">ippRead</a></li>
409 <li><a href="#ippReadFile">ippReadFile</a></li>
410 <li><a href="#ippReadIO">ippReadIO</a></li>
411 <li><a href="#ippSetBoolean">ippSetBoolean</a></li>
412 <li><a href="#ippSetCollection">ippSetCollection</a></li>
413 <li><a href="#ippSetDate">ippSetDate</a></li>
414 <li><a href="#ippSetGroupTag">ippSetGroupTag</a></li>
415 <li><a href="#ippSetInteger">ippSetInteger</a></li>
416 <li><a href="#ippSetName">ippSetName</a></li>
417 <li><a href="#ippSetOctetString">ippSetOctetString</a></li>
418 <li><a href="#ippSetOperation">ippSetOperation</a></li>
419 <li><a href="#ippSetPort">ippSetPort</a></li>
420 <li><a href="#ippSetRange">ippSetRange</a></li>
421 <li><a href="#ippSetRequestId">ippSetRequestId</a></li>
422 <li><a href="#ippSetResolution">ippSetResolution</a></li>
423 <li><a href="#ippSetState">ippSetState</a></li>
424 <li><a href="#ippSetStatusCode">ippSetStatusCode</a></li>
425 <li><a href="#ippSetString">ippSetString</a></li>
426 <li><a href="#ippSetStringf">ippSetStringf</a></li>
427 <li><a href="#ippSetStringfv">ippSetStringfv</a></li>
428 <li><a href="#ippSetValueTag">ippSetValueTag</a></li>
429 <li><a href="#ippSetVersion">ippSetVersion</a></li>
430 <li><a href="#ippStateString">ippStateString</a></li>
431 <li><a href="#ippTagString">ippTagString</a></li>
432 <li><a href="#ippTagValue">ippTagValue</a></li>
433 <li><a href="#ippTimeToDate">ippTimeToDate</a></li>
434 <li><a href="#ippValidateAttribute">ippValidateAttribute</a></li>
435 <li><a href="#ippValidateAttributes">ippValidateAttributes</a></li>
436 <li><a href="#ippWrite">ippWrite</a></li>
437 <li><a href="#ippWriteFile">ippWriteFile</a></li>
438 <li><a href="#ippWriteIO">ippWriteIO</a></li>
798d6e29
MS
439 </ul></li>
440 <li><a href="#TYPES">Data Types</a><ul class="subcontents">
798d6e29 441 <li><a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a></li>
798d6e29
MS
442 <li><a href="#cups_dest_cb_t">cups_dest_cb_t</a></li>
443 <li><a href="#cups_dest_t">cups_dest_t</a></li>
444 <li><a href="#cups_dinfo_t">cups_dinfo_t</a></li>
798d6e29 445 <li><a href="#cups_job_t">cups_job_t</a></li>
798d6e29
MS
446 <li><a href="#cups_option_t">cups_option_t</a></li>
447 <li><a href="#cups_password_cb2_t">cups_password_cb2_t</a></li>
798d6e29
MS
448 <li><a href="#cups_ptype_t">cups_ptype_t</a></li>
449 <li><a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a></li>
450 <li><a href="#cups_size_t">cups_size_t</a></li>
798d6e29 451 <li><a href="#http_addr_t">http_addr_t</a></li>
798d6e29
MS
452 <li><a href="#http_encoding_t">http_encoding_t</a></li>
453 <li><a href="#http_encryption_t">http_encryption_t</a></li>
454 <li><a href="#http_field_t">http_field_t</a></li>
455 <li><a href="#http_keepalive_t">http_keepalive_t</a></li>
456 <li><a href="#http_state_t">http_state_t</a></li>
457 <li><a href="#http_t">http_t</a></li>
458 <li><a href="#http_timeout_cb_t">http_timeout_cb_t</a></li>
459 <li><a href="#http_trust_t">http_trust_t</a></li>
460 <li><a href="#http_uri_coding_t">http_uri_coding_t</a></li>
461 <li><a href="#http_uri_status_t">http_uri_status_t</a></li>
798d6e29
MS
462 <li><a href="#ipp_attribute_t">ipp_attribute_t</a></li>
463 <li><a href="#ipp_copycb_t">ipp_copycb_t</a></li>
798d6e29 464 <li><a href="#ipp_iocb_t">ipp_iocb_t</a></li>
798d6e29
MS
465 <li><a href="#ipp_orient_t">ipp_orient_t</a></li>
466 <li><a href="#ipp_pstate_t">ipp_pstate_t</a></li>
467 <li><a href="#ipp_quality_t">ipp_quality_t</a></li>
468 <li><a href="#ipp_res_t">ipp_res_t</a></li>
06a5a4d3
MS
469 <li><a href="#ipp_rstate_t">ipp_rstate_t</a></li>
470 <li><a href="#ipp_sstate_t">ipp_sstate_t</a></li>
798d6e29
MS
471 <li><a href="#ipp_state_t">ipp_state_t</a></li>
472 <li><a href="#ipp_t">ipp_t</a></li>
798d6e29
MS
473 </ul></li>
474 <li><a href="#STRUCTURES">Structures</a><ul class="subcontents">
798d6e29
MS
475 <li><a href="#cups_dest_s">cups_dest_s</a></li>
476 <li><a href="#cups_job_s">cups_job_s</a></li>
798d6e29
MS
477 <li><a href="#cups_option_s">cups_option_s</a></li>
478 <li><a href="#cups_size_s">cups_size_s</a></li>
798d6e29 479 </ul></li>
73721e3e
MS
480 <li><a href="#VARIABLES">Variables</a><ul class="subcontents">
481 <li><a href="#kSecOidOrganizationalUnit">kSecOidOrganizationalUnit</a></li>
482 </ul></li>
798d6e29 483 <li><a href="#ENUMERATIONS">Enumerations</a><ul class="subcontents">
798d6e29 484 <li><a href="#cups_ptype_e">cups_ptype_e</a></li>
798d6e29
MS
485 <li><a href="#http_encoding_e">http_encoding_e</a></li>
486 <li><a href="#http_encryption_e">http_encryption_e</a></li>
487 <li><a href="#http_field_e">http_field_e</a></li>
488 <li><a href="#http_keepalive_e">http_keepalive_e</a></li>
489 <li><a href="#http_state_e">http_state_e</a></li>
490 <li><a href="#http_status_e">http_status_e</a></li>
491 <li><a href="#http_trust_e">http_trust_e</a></li>
492 <li><a href="#http_uri_coding_e">http_uri_coding_e</a></li>
493 <li><a href="#http_uri_status_e">http_uri_status_e</a></li>
798d6e29 494 <li><a href="#ipp_finishings_e">ipp_finishings_e</a></li>
798d6e29
MS
495 <li><a href="#ipp_jstate_e">ipp_jstate_e</a></li>
496 <li><a href="#ipp_op_e">ipp_op_e</a></li>
497 <li><a href="#ipp_orient_e">ipp_orient_e</a></li>
498 <li><a href="#ipp_pstate_e">ipp_pstate_e</a></li>
499 <li><a href="#ipp_quality_e">ipp_quality_e</a></li>
500 <li><a href="#ipp_res_e">ipp_res_e</a></li>
06a5a4d3
MS
501 <li><a href="#ipp_rstate_e">ipp_rstate_e</a></li>
502 <li><a href="#ipp_sstate_e">ipp_sstate_e</a></li>
798d6e29
MS
503 <li><a href="#ipp_state_e">ipp_state_e</a></li>
504 <li><a href="#ipp_status_e">ipp_status_e</a></li>
505 <li><a href="#ipp_tag_e">ipp_tag_e</a></li>
506 </ul></li>
507 </ul>
508 </div>
509 <div class="body">
510 <blockquote>
1da024d1 511 <p>Please <a href="https://github.com/apple/cups/issues">file issues on Github</a> to provide feedback on this document.</p>
798d6e29 512</blockquote>
93d79201 513 <h2 class="title" id="introduction">Introduction</h2>
798d6e29
MS
514 <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>
515 <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>
93d79201 516 <h3 class="title" id="guidelines">Guidelines</h3>
73721e3e 517 <p>When writing software (other than printer drivers) that uses the &quot;cups&quot; library:</p>
798d6e29 518 <ul>
93d79201
MS
519 <li> <p>Do not use undocumented or deprecated APIs,</p>
520</li>
521 <li> <p>Do not rely on pre-configured printers,</p>
522</li>
523 <li> <p>Do not assume that printers support specific features or formats, and</p>
524</li>
525 <li> <p>Do not rely on implementation details (PPDs, etc.)</p>
526</li>
798d6e29
MS
527</ul>
528 <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>
529 <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>
73721e3e
MS
530 <blockquote>
531 <p><strong>Note:</strong></p>
532 <p>CUPS printer drivers necessarily depend on specific file formats and certain implementation details of the CUPS software. Please consult the Postscript and raster printer driver developer documentation on <a href="https://www.cups.org/documentation.html">CUPS.org</a> for more information.</p>
533</blockquote>
93d79201
MS
534 <h3 class="title" id="terms-used-in-this-document">Terms Used in This Document</h3>
535 <p>A <em>Destination</em> is a printer or print queue that accepts print jobs. A <em>Print Job</em> is a collection of one or more documents that are processed by a destination using options supplied when creating the job. A <em>Document</em> is a file (JPEG image, PDF file, etc.) suitable for printing. An <em>Option</em> controls some aspect of printing, such as the media used. <em>Media</em> is the sheets or roll that is printed on. An <em>Attribute</em> is an option encoded for an Internet Printing Protocol (IPP) request.</p>
536 <h3 class="title" id="compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</h3>
798d6e29
MS
537 <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>
538 <p>The following simple program lists the available destinations:</p>
539 <pre><code>#include &lt;stdio.h&gt;
540#include &lt;cups/cups.h&gt;
541
542int print_dest(void *user_data, unsigned flags, cups_dest_t *dest)
543{
544 if (dest-&gt;instance)
545 printf(&quot;%s/%s\n&quot;, dest-&gt;name, dest-&gt;instance);
546 else
547 puts(dest-&gt;name);
548
549 return (1);
550}
551
552int main(void)
553{
554 cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, 0, 0, print_dest, NULL);
555
556 return (0);
557}
558</code></pre>
93d79201
MS
559 <h4 id="compiling-with-xcode">Compiling with Xcode</h4>
560 <p>In Xcode, choose <em>New Project...</em> from the <em>File</em> menu (or press SHIFT+CMD+N), then select the <em>Command Line Tool</em> under the macOS Application project type. Click <em>Next</em> and enter a name for the project, for example &quot;firstcups&quot;. Click <em>Next</em> and choose a project directory. The click <em>Next</em> to create the project.</p>
561 <p>In the project window, click on the <em>Build Phases</em> group and expand the <em>Link Binary with Libraries</em> section. Click <em>+</em>, type &quot;libcups&quot; to show the library, and then double-click on <code>libcups.tbd</code>.</p>
798d6e29 562 <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>
93d79201 563 <h4 id="compiling-with-gcc">Compiling with GCC</h4>
798d6e29
MS
564 <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>
565 <pre><code>gcc -o simple `cups-config --cflags` simple.c `cups-config --libs`
566./simple
567</code></pre>
9c44e2cb 568 <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>
93d79201 569 <h2 class="title" id="working-with-destinations">Working with Destinations</h2>
9c44e2cb 570 <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 571 <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>
93d79201 572 <h3 class="title" id="finding-available-destinations">Finding Available Destinations</h3>
798d6e29
MS
573 <p>The <code>cupsEnumDests</code> function finds all of the available destinations:</p>
574 <pre><code> int
575 cupsEnumDests(unsigned flags, int msec, int *cancel,
576 cups_ptype_t type, cups_ptype_t mask,
577 cups_dest_cb_t cb, void *user_data)
578</code></pre>
579 <p>The <code>flags</code> argument specifies enumeration options, which at present must be <code>CUPS_DEST_FLAGS_NONE</code>.</p>
580 <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>
581 <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 582 <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 583 <ul>
93d79201
MS
584 <li> <p><code>CUPS_PRINTER_CLASS</code>: A collection of destinations.</p>
585</li>
586 <li> <p><code>CUPS_PRINTER_FAX</code>: A facsimile device.</p>
587</li>
588 <li> <p><code>CUPS_PRINTER_LOCAL</code>: A local printer or class. This constant has the value 0 (no bits set) and is only used for the <code>type</code> argument and is paired with the <code>CUPS_PRINTER_REMOTE</code> or <code>CUPS_PRINTER_DISCOVERED</code> constant passed in the <code>mask</code> argument.</p>
589</li>
590 <li> <p><code>CUPS_PRINTER_REMOTE</code>: A remote (shared) printer or class.</p>
591</li>
592 <li> <p><code>CUPS_PRINTER_DISCOVERED</code>: An available network printer or class.</p>
593</li>
594 <li> <p><code>CUPS_PRINTER_BW</code>: Can do B&amp;W printing.</p>
595</li>
596 <li> <p><code>CUPS_PRINTER_COLOR</code>: Can do color printing.</p>
597</li>
598 <li> <p><code>CUPS_PRINTER_DUPLEX</code>: Can do two-sided printing.</p>
599</li>
600 <li> <p><code>CUPS_PRINTER_STAPLE</code>: Can staple output.</p>
601</li>
602 <li> <p><code>CUPS_PRINTER_COLLATE</code>: Can quickly collate copies.</p>
603</li>
604 <li> <p><code>CUPS_PRINTER_PUNCH</code>: Can punch output.</p>
605</li>
606 <li> <p><code>CUPS_PRINTER_COVER</code>: Can cover output.</p>
607</li>
608 <li> <p><code>CUPS_PRINTER_BIND</code>: Can bind output.</p>
609</li>
610 <li> <p><code>CUPS_PRINTER_SORT</code>: Can sort output (mailboxes, etc.)</p>
611</li>
612 <li> <p><code>CUPS_PRINTER_SMALL</code>: Can print on Letter/Legal/A4-size media.</p>
613</li>
614 <li> <p><code>CUPS_PRINTER_MEDIUM</code>: Can print on Tabloid/B/C/A3/A2-size media.</p>
615</li>
616 <li> <p><code>CUPS_PRINTER_LARGE</code>: Can print on D/E/A1/A0-size media.</p>
617</li>
618 <li> <p><code>CUPS_PRINTER_VARIABLE</code>: Can print on rolls and custom-size media.</p>
619</li>
798d6e29
MS
620</ul>
621 <p>The <code>cb</code> argument specifies a function to call for every destination that is found:</p>
622 <pre><code>typedef int (*cups_dest_cb_t)(void *user_data,
623 unsigned flags,
624 cups_dest_t *dest);
625</code></pre>
9c44e2cb 626 <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 627 <ul>
93d79201
MS
628 <li> <p><code>CUPS_DEST_FLAGS_MORE</code>: There are more destinations coming.</p>
629</li>
630 <li> <p><code>CUPS_DEST_FLAGS_REMOVED</code>: The destination has gone away and should be removed from the list of destinations a user can select.</p>
631</li>
632 <li> <p><code>CUPS_DEST_FLAGS_ERROR</code>: An error occurred. The reason for the error can be found by calling the <code>cupsLastError</code> and/or <code>cupsLastErrorString</code> functions.</p>
633</li>
798d6e29
MS
634</ul>
635 <p>The callback function returns 0 to stop enumeration or 1 to continue.</p>
718ee2ff 636 <blockquote>
73721e3e
MS
637 <p><strong>Note:</strong></p>
638 <p>The callback function will likely be called multiple times for the same destination, so it is up to the caller to suppress any duplicate destinations.</p>
718ee2ff 639</blockquote>
798d6e29
MS
640 <p>The following example shows how to use <code>cupsEnumDests</code> to get a filtered array of destinations:</p>
641 <pre><code>typedef struct
642{
643 int num_dests;
644 cups_dest_t *dests;
645} my_user_data_t;
646
647int
648my_dest_cb(my_user_data_t *user_data, unsigned flags,
649 cups_dest_t *dest)
650{
651 if (flags &amp; CUPS_DEST_FLAGS_REMOVED)
652 {
653 /*
654 * Remove destination from array...
655 */
656
657 user_data-&gt;num_dests =
658 cupsRemoveDest(dest-&gt;name, dest-&gt;instance,
659 user_data-&gt;num_dests,
660 &amp;(user_data-&gt;dests));
661 }
662 else
663 {
664 /*
665 * Add destination to array...
666 */
667
668 user_data-&gt;num_dests =
669 cupsCopyDest(dest, user_data-&gt;num_dests,
670 &amp;(user_data-&gt;dests));
671 }
672
673 return (1);
674}
675
676int
677my_get_dests(cups_ptype_t type, cups_ptype_t mask,
678 cups_dest_t **dests)
679{
680 my_user_data_t user_data = { 0, NULL };
681
682 if (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, type,
683 mask, (cups_dest_cb_t)my_dest_cb,
684 &amp;user_data))
685 {
686 /*
687 * An error occurred, free all of the destinations and
688 * return...
689 */
690
691 cupsFreeDests(user_data.num_dests, user_dasta.dests);
692
693 *dests = NULL;
694
695 return (0);
696 }
697
698 /*
699 * Return the destination array...
700 */
701
702 *dests = user_data.dests;
703
704 return (user_data.num_dests);
705}
706</code></pre>
93d79201 707 <h3 class="title" id="basic-destination-information">Basic Destination Information</h3>
798d6e29
MS
708 <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>
709 <ul>
93d79201
MS
710 <li> <p>&quot;auth-info-required&quot;: The type of authentication required for printing to this destination: &quot;none&quot;, &quot;username,password&quot;, &quot;domain,username,password&quot;, or &quot;negotiate&quot; (Kerberos).</p>
711</li>
712 <li> <p>&quot;printer-info&quot;: The human-readable description of the destination such as &quot;My Laser Printer&quot;.</p>
713</li>
714 <li> <p>&quot;printer-is-accepting-jobs&quot;: &quot;true&quot; if the destination is accepting new jobs, &quot;false&quot; otherwise.</p>
715</li>
716 <li> <p>&quot;printer-is-shared&quot;: &quot;true&quot; if the destination is being shared with other computers, &quot;false&quot; otherwise.</p>
717</li>
718 <li> <p>&quot;printer-location&quot;: The human-readable location of the destination such as &quot;Lab 4&quot;.</p>
719</li>
720 <li> <p>&quot;printer-make-and-model&quot;: The human-readable make and model of the destination such as &quot;ExampleCorp LaserPrinter 4000 Series&quot;.</p>
721</li>
722 <li> <p>&quot;printer-state&quot;: &quot;3&quot; if the destination is idle, &quot;4&quot; if the destination is printing a job, and &quot;5&quot; if the destination is stopped.</p>
723</li>
724 <li> <p>&quot;printer-state-change-time&quot;: The UNIX time when the destination entered the current state.</p>
725</li>
726 <li> <p>&quot;printer-state-reasons&quot;: Additional comma-delimited state keywords for the destination such as &quot;media-tray-empty-error&quot; and &quot;toner-low-warning&quot;.</p>
727</li>
728 <li> <p>&quot;printer-type&quot;: The <code>cups_ptype_t</code> value associated with the destination.</p>
729</li>
730 <li> <p>&quot;printer-uri-supported&quot;: The URI associated with the destination; if not set, this destination was discovered but is not yet setup as a local printer.</p>
731</li>
798d6e29
MS
732</ul>
733 <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>
734 <pre><code>const char *model = cupsGetOption(&quot;printer-make-and-model&quot;,
735 dest-&gt;num_options,
736 dest-&gt;options);
737</code></pre>
93d79201 738 <h3 class="title" id="detailed-destination-information">Detailed Destination Information</h3>
798d6e29
MS
739 <p>Once a destination has been chosen, the <code>cupsCopyDestInfo</code> function can be used to gather detailed information about the destination:</p>
740 <pre><code>cups_dinfo_t *
741cupsCopyDestInfo(http_t *http, cups_dest_t *dest);
742</code></pre>
743 <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>
744 <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>
93d79201 745 <h4 id="getting-supported-options-and-values">Getting Supported Options and Values</h4>
798d6e29
MS
746 <p>The <code>cupsCheckDestSupported</code> function can be used to test whether a particular option or option and value is supported:</p>
747 <pre><code>int
748cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
749 cups_dinfo_t *info,
750 const char *option,
751 const char *value);
752</code></pre>
753 <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>
754 <ul>
93d79201
MS
755 <li> <p><code>CUPS_COPIES</code>: Controls the number of copies that are produced.</p>
756</li>
757 <li> <p><code>CUPS_FINISHINGS</code>: A comma-delimited list of integer constants that control the finishing processes that are applied to the job, including stapling, punching, and folding.</p>
758</li>
759 <li> <p><code>CUPS_MEDIA</code>: Controls the media size that is used, typically one of the following: <code>CUPS_MEDIA_3X5</code>, <code>CUPS_MEDIA_4X6</code>, <code>CUPS_MEDIA_5X7</code>, <code>CUPS_MEDIA_8X10</code>, <code>CUPS_MEDIA_A3</code>, <code>CUPS_MEDIA_A4</code>, <code>CUPS_MEDIA_A5</code>, <code>CUPS_MEDIA_A6</code>, <code>CUPS_MEDIA_ENV10</code>, <code>CUPS_MEDIA_ENVDL</code>, <code>CUPS_MEDIA_LEGAL</code>, <code>CUPS_MEDIA_LETTER</code>, <code>CUPS_MEDIA_PHOTO_L</code>, <code>CUPS_MEDIA_SUPERBA3</code>, or <code>CUPS_MEDIA_TABLOID</code>.</p>
760</li>
761 <li> <p><code>CUPS_MEDIA_SOURCE</code>: Controls where the media is pulled from, typically either <code>CUPS_MEDIA_SOURCE_AUTO</code> or <code>CUPS_MEDIA_SOURCE_MANUAL</code>.</p>
762</li>
763 <li> <p><code>CUPS_MEDIA_TYPE</code>: Controls the type of media that is used, typically one of the following: <code>CUPS_MEDIA_TYPE_AUTO</code>, <code>CUPS_MEDIA_TYPE_ENVELOPE</code>, <code>CUPS_MEDIA_TYPE_LABELS</code>, <code>CUPS_MEDIA_TYPE_LETTERHEAD</code>, <code>CUPS_MEDIA_TYPE_PHOTO</code>, <code>CUPS_MEDIA_TYPE_PHOTO_GLOSSY</code>, <code>CUPS_MEDIA_TYPE_PHOTO_MATTE</code>, <code>CUPS_MEDIA_TYPE_PLAIN</code>, or <code>CUPS_MEDIA_TYPE_TRANSPARENCY</code>.</p>
764</li>
765 <li> <p><code>CUPS_NUMBER_UP</code>: Controls the number of document pages that are placed on each media side.</p>
766</li>
767 <li> <p><code>CUPS_ORIENTATION</code>: Controls the orientation of document pages placed on the media: <code>CUPS_ORIENTATION_PORTRAIT</code> or <code>CUPS_ORIENTATION_LANDSCAPE</code>.</p>
768</li>
769 <li> <p><code>CUPS_PRINT_COLOR_MODE</code>: Controls whether the output is in color (<code>CUPS_PRINT_COLOR_MODE_COLOR</code>), grayscale (<code>CUPS_PRINT_COLOR_MODE_MONOCHROME</code>), or either (<code>CUPS_PRINT_COLOR_MODE_AUTO</code>).</p>
770</li>
771 <li> <p><code>CUPS_PRINT_QUALITY</code>: Controls the generate quality of the output: <code>CUPS_PRINT_QUALITY_DRAFT</code>, <code>CUPS_PRINT_QUALITY_NORMAL</code>, or <code>CUPS_PRINT_QUALITY_HIGH</code>.</p>
772</li>
773 <li> <p><code>CUPS_SIDES</code>: Controls whether prints are placed on one or both sides of the media: <code>CUPS_SIDES_ONE_SIDED</code>, <code>CUPS_SIDES_TWO_SIDED_PORTRAIT</code>, or <code>CUPS_SIDES_TWO_SIDED_LANDSCAPE</code>.</p>
774</li>
798d6e29
MS
775</ul>
776 <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>
777 <p>The <code>cupsFindDestSupported</code> function returns the IPP attribute containing the supported values for a given option:</p>
778 <pre><code> ipp_attribute_t *
779 cupsFindDestSupported(http_t *http, cups_dest_t *dest,
780 cups_dinfo_t *dinfo,
781 const char *option);
782</code></pre>
783 <p>For example, the following code prints the supported finishing processes for a destination, if any, to the standard output:</p>
784 <pre><code>cups_dinfo_t *info = cupsCopyDestInfo(CUPS_HTTP_DEFAULT,
785 dest);
786
787if (cupsCheckDestSupported(CUPS_HTTP_DEFAULT, dest, info,
788 CUPS_FINISHINGS, NULL))
789{
790 ipp_attribute_t *finishings =
791 cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
792 CUPS_FINISHINGS);
793 int i, count = ippGetCount(finishings);
794
795 puts(&quot;finishings supported:&quot;);
796 for (i = 0; i &lt; count; i ++)
797 printf(&quot; %d\n&quot;, ippGetInteger(finishings, i));
798}
799else
800 puts(&quot;finishings not supported.&quot;);
801</code></pre>
802 <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>
803 <pre><code>ipp_attribute_t *attrs =
804 cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
805 &quot;job-creation-attributes&quot;);
806int i, count = ippGetCount(attrs);
807
808for (i = 0; i &lt; count; i ++)
809 puts(ippGetString(attrs, i, NULL));
810</code></pre>
93d79201 811 <h4 id="getting-default-values">Getting Default Values</h4>
798d6e29
MS
812 <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>
813 <pre><code>ipp_attribute_t *
814cupsFindDestDefault(http_t *http, cups_dest_t *dest,
815 cups_dinfo_t *dinfo,
816 const char *option);
817</code></pre>
818 <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>
819 <pre><code>const char *def_value =
820 cupsGetOption(CUPS_FINISHINGS, dest-&gt;num_options,
821 dest-&gt;options);
822ipp_attribute_t *def_attr =
823 cupsFindDestDefault(CUPS_HTTP_DEFAULT, dest, info,
824 CUPS_FINISHINGS);
825
826if (def_value != NULL)
827{
828 printf(&quot;Default finishings: %s\n&quot;, def_value);
829}
830else
831{
832 int i, count = ippGetCount(def_attr);
833
834 printf(&quot;Default finishings: %d&quot;,
835 ippGetInteger(def_attr, 0));
836 for (i = 1; i &lt; count; i ++)
837 printf(&quot;,%d&quot;, ippGetInteger(def_attr, i));
838 putchar('\n');
839}
840</code></pre>
93d79201 841 <h4 id="getting-ready-loaded-values">Getting Ready (Loaded) Values</h4>
798d6e29
MS
842 <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>
843 <p>The <code>cupsFindDestReady</code> function finds the IPP attribute containing the ready values for a given option:</p>
844 <pre><code>ipp_attribute_t *
845cupsFindDestReady(http_t *http, cups_dest_t *dest,
846 cups_dinfo_t *dinfo, const char *option);
847</code></pre>
848 <p>For example, the following code lists the ready finishing processes:</p>
849 <pre><code>ipp_attribute_t *ready_finishings =
850 cupsFindDestReady(CUPS_HTTP_DEFAULT, dest, info,
851 CUPS_FINISHINGS);
852
853if (ready_finishings != NULL)
854{
855 int i, count = ippGetCount(ready_finishings);
856
857 puts(&quot;finishings ready:&quot;);
858 for (i = 0; i &lt; count; i ++)
859 printf(&quot; %d\n&quot;, ippGetInteger(ready_finishings, i));
860}
861else
862 puts(&quot;no finishings are ready.&quot;);
863</code></pre>
93d79201 864 <h4 id="media-size-options">Media Size Options</h4>
798d6e29
MS
865 <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>
866 <pre><code>typedef struct cups_size_s
867{
868 char media[128];
869 int width, length;
870 int bottom, left, right, top;
871} cups_size_t;
872</code></pre>
873 <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>
874 <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>
875 <pre><code>int
876cupsGetDestMediaByName(http_t *http, cups_dest_t *dest,
877 cups_dinfo_t *dinfo,
878 const char *media,
879 unsigned flags, cups_size_t *size);
880
881int
882cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest,
883 cups_dinfo_t *dinfo,
884 int width, int length,
885 unsigned flags, cups_size_t *size);
886</code></pre>
887 <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>
888 <ul>
93d79201
MS
889 <li> <p><code>CUPS_MEDIA_FLAGS_DEFAULT</code>: Find the closest size supported by the printer.</p>
890</li>
891 <li> <p><code>CUPS_MEDIA_FLAGS_BORDERLESS</code>: Find a borderless size.</p>
892</li>
893 <li> <p><code>CUPS_MEDIA_FLAGS_DUPLEX</code>: Find a size compatible with two-sided printing.</p>
894</li>
895 <li> <p><code>CUPS_MEDIA_FLAGS_EXACT</code>: Find an exact match for the size.</p>
896</li>
897 <li> <p><code>CUPS_MEDIA_FLAGS_READY</code>: If the printer supports media sensing or configuration of the media in each tray/source, find the size amongst the &quot;ready&quot; media.</p>
898</li>
798d6e29
MS
899</ul>
900 <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>
901 <p>For example, the following code prints the margins for two-sided printing on US Letter media:</p>
902 <pre><code>cups_size_t size;
903
904if (cupsGetDestMediaByName(CUPS_HTTP_DEFAULT, dest, info,
905 CUPS_MEDIA_LETTER,
906 CUPS_MEDIA_FLAGS_DUPLEX, &amp;size))
907{
908 puts(&quot;Margins for duplex US Letter:&quot;);
909 printf(&quot; Bottom: %.2fin\n&quot;, size.bottom / 2540.0);
910 printf(&quot; Left: %.2fin\n&quot;, size.left / 2540.0);
911 printf(&quot; Right: %.2fin\n&quot;, size.right / 2540.0);
912 printf(&quot; Top: %.2fin\n&quot;, size.top / 2540.0);
913}
914else
915 puts(&quot;Margins for duplex US Letter are not available.&quot;);
916</code></pre>
917 <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>
918 <pre><code>int
919cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest,
920 cups_dinfo_t *dinfo, int n,
921 unsigned flags, cups_size_t *size);
922
923int
924cupsGetDestMediaCount(http_t *http, cups_dest_t *dest,
925 cups_dinfo_t *dinfo, unsigned flags);
926</code></pre>
927 <p>For example, the following code prints the list of ready media and corresponding margins:</p>
928 <pre><code>cups_size_t size;
929int i;
930int count = cupsGetDestMediaCount(CUPS_HTTP_DEFAULT,
931 dest, info,
932 CUPS_MEDIA_FLAGS_READY);
933
934for (i = 0; i &lt; count; i ++)
935{
936 if (cupsGetDestMediaByIndex(CUPS_HTTP_DEFAULT, dest, info,
937 i, CUPS_MEDIA_FLAGS_READY,
938 &amp;size))
939 {
940 printf(&quot;%s:\n&quot;, size.name);
941 printf(&quot; Width: %.2fin\n&quot;, size.width / 2540.0);
942 printf(&quot; Length: %.2fin\n&quot;, size.length / 2540.0);
943 printf(&quot; Bottom: %.2fin\n&quot;, size.bottom / 2540.0);
944 printf(&quot; Left: %.2fin\n&quot;, size.left / 2540.0);
945 printf(&quot; Right: %.2fin\n&quot;, size.right / 2540.0);
946 printf(&quot; Top: %.2fin\n&quot;, size.top / 2540.0);
947 }
948}
949</code></pre>
950 <p>Finally, the <code>cupsGetDestMediaDefault</code> function returns the default media size:</p>
951 <pre><code>int
952cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
953 cups_dinfo_t *dinfo, unsigned flags,
954 cups_size_t *size);
955</code></pre>
93d79201 956 <h4 id="localizing-options-and-values">Localizing Options and Values</h4>
6ad44eeb 957 <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
958 <pre><code>const char *
959cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest,
960 cups_dinfo_t *info, unsigned flags,
961 cups_size_t *size);
962
963const char *
964cupsLocalizeDestOption(http_t *http, cups_dest_t *dest,
965 cups_dinfo_t *info,
966 const char *option);
967
968const char *
969cupsLocalizeDestValue(http_t *http, cups_dest_t *dest,
970 cups_dinfo_t *info,
971 const char *option, const char *value);
972</code></pre>
93d79201 973 <h3 class="title" id="submitting-a-print-job">Submitting a Print Job</h3>
798d6e29
MS
974 <p>Once you are ready to submit a print job, you create a job using the <code>cupsCreateDestJob</code> function:</p>
975 <pre><code>ipp_status_t
976cupsCreateDestJob(http_t *http, cups_dest_t *dest,
977 cups_dinfo_t *info, int *job_id,
978 const char *title, int num_options,
979 cups_option_t *options);
980</code></pre>
981 <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>
982 <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>
983 <p>For example, the following code creates a new job that will print 42 copies of a two-sided US Letter document:</p>
984 <pre><code>int job_id = 0;
985int num_options = 0;
986cups_option_t *options = NULL;
987
988num_options = cupsAddOption(CUPS_COPIES, &quot;42&quot;,
989 num_options, &amp;options);
990num_options = cupsAddOption(CUPS_MEDIA, CUPS_MEDIA_LETTER,
991 num_options, &amp;options);
992num_options = cupsAddOption(CUPS_SIDES,
993 CUPS_SIDES_TWO_SIDED_PORTRAIT,
994 num_options, &amp;options);
995
996if (cupsCreateDestJob(CUPS_HTTP_DEFAULT, dest, info,
997 &amp;job_id, &quot;My Document&quot;, num_options,
998 options) == IPP_STATUS_OK)
999 printf(&quot;Created job: %d\n&quot;, job_id);
1000else
1001 printf(&quot;Unable to create job: %s\n&quot;,
1002 cupsLastErrorString());
1003</code></pre>
1004 <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>
1005 <pre><code>http_status_t
1006cupsStartDestDocument(http_t *http, cups_dest_t *dest,
1007 cups_dinfo_t *info, int job_id,
1008 const char *docname,
1009 const char *format,
1010 int num_options,
1011 cups_option_t *options,
1012 int last_document);
1013
1014http_status_t
1015cupsWriteRequestData(http_t *http, const char *buffer,
1016 size_t length);
1017
1018ipp_status_t
1019cupsFinishDestDocument(http_t *http, cups_dest_t *dest,
1020 cups_dinfo_t *info);
1021</code></pre>
1022 <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>
1023 <ul>
93d79201
MS
1024 <li> <p><code>CUPS_FORMAT_JPEG</code>: &quot;image/jpeg&quot;</p>
1025</li>
1026 <li> <p><code>CUPS_FORMAT_PDF</code>: &quot;application/pdf&quot;</p>
1027</li>
1028 <li> <p><code>CUPS_FORMAT_POSTSCRIPT</code>: &quot;application/postscript&quot;</p>
1029</li>
1030 <li> <p><code>CUPS_FORMAT_TEXT</code>: &quot;text/plain&quot;</p>
1031</li>
798d6e29
MS
1032</ul>
1033 <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>
1034 <p>For example, the following code submits a PDF file to the job that was just created:</p>
1035 <pre><code>FILE *fp = fopen(&quot;filename.pdf&quot;, &quot;rb&quot;);
1036size_t bytes;
1037char buffer[65536];
1038
1039if (cupsStartDestDocument(CUPS_HTTP_DEFAULT, dest, info,
1040 job_id, &quot;filename.pdf&quot;, 0, NULL,
1041 1) == HTTP_STATUS_CONTINUE)
1042{
1043 while ((bytes = fread(buffer, 1, sizeof(buffer), fp)) &gt; 0)
1044 if (cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer,
1045 bytes) != HTTP_STATUS_CONTINUE)
1046 break;
1047
1048 if (cupsFinishDestDocument(CUPS_HTTP_DEFAULT, dest,
1049 info) == IPP_STATUS_OK)
1050 puts(&quot;Document send succeeded.&quot;);
1051 else
1052 printf(&quot;Document send failed: %s\n&quot;,
1053 cupsLastErrorString());
1054}
1055
1056fclose(fp);
1057</code></pre>
93d79201 1058 <h2 class="title" id="sending-ipp-requests">Sending IPP Requests</h2>
b0fb2d75 1059 <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>
93d79201 1060 <h3 class="title" id="connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</h3>
b0fb2d75
MS
1061 <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>
1062 <pre><code>http_t *
1063cupsConnectDest(cups_dest_t *dest, unsigned flags, int msec,
1064 int *cancel, char *resource,
1065 size_t resourcesize, cups_dest_cb_t cb,
1066 void *user_data);
1067</code></pre>
1068 <p>The <code>dest</code> argument specifies the destination to connect to.</p>
1069 <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>
1070 <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>
1071 <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>
1072 <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>
1073 <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>
1074 <p>On success, a HTTP connection is returned that can be used to send IPP requests and get IPP responses.</p>
1075 <p>For example, the following code connects to the printer associated with a destination with a 30 second timeout:</p>
1076 <pre><code>char resource[256];
1077http_t *http = cupsConnectDest(dest, CUPS_DEST_FLAGS_DEVICE,
1078 30000, NULL, resource,
1079 sizeof(resource), NULL, NULL);
1080</code></pre>
93d79201 1081 <h3 class="title" id="creating-an-ipp-request">Creating an IPP Request</h3>
b0fb2d75
MS
1082 <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>
1083 <p>The <code>ippNewRequest</code> function creates a new IPP request:</p>
1084 <pre><code>ipp_t *
1085ippNewRequest(ipp_op_t op);
1086</code></pre>
1087 <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>
1088 <pre><code>ipp_t *request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
1089</code></pre>
1090 <p>The request identifier is automatically set to a unique value for the current process.</p>
1091 <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>
1092 <pre><code>const char *printer_uri = cupsGetOption(&quot;device-uri&quot;,
1093 dest-&gt;num_options,
1094 dest-&gt;options);
1095
1096ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
1097 &quot;printer-uri&quot;, NULL, printer_uri);
1098</code></pre>
1099 <blockquote>
73721e3e
MS
1100 <p><strong>Note:</strong></p>
1101 <p>If we wanted to query the scheduler instead of the device, we would look up the &quot;printer-uri-supported&quot; option instead of the &quot;device-uri&quot; value.</p>
b0fb2d75
MS
1102</blockquote>
1103 <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>
1104 <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>
1105 <pre><code>static const char * const requested_attributes[] =
1106{
1107 &quot;printer-state&quot;,
1108 &quot;printer-state-message&quot;,
1109 &quot;printer-state-reasons&quot;
1110};
1111
1112ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
1113 &quot;requested-attributes&quot;, 3, NULL,
1114 requested_attributes);
1115</code></pre>
1116 <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>
1117 <p>CUPS provides many functions to adding attributes of different types:</p>
1118 <ul>
93d79201
MS
1119 <li> <p><code>ippAddBoolean</code> adds a boolean (<code>IPP_TAG_BOOLEAN</code>) attribute with one value.</p>
1120</li>
1121 <li> <p><code>ippAddInteger</code> adds an enum (<code>IPP_TAG_ENUM</code>) or integer (<code>IPP_TAG_INTEGER</code>) attribute with one value.</p>
1122</li>
1123 <li> <p><code>ippAddIntegers</code> adds an enum or integer attribute with one or more values.</p>
1124</li>
1125 <li> <p><code>ippAddOctetString</code> adds an octetString attribute with one value.</p>
1126</li>
1127 <li> <p><code>ippAddOutOfBand</code> adds a admin-defined (<code>IPP_TAG_ADMINDEFINE</code>), default (<code>IPP_TAG_DEFAULT</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable (<code>IPP_TAG_NOTSETTABLE</code>), unknown (<code>IPP_TAG_UNKNOWN</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_VALUE</code>) out-of-band attribute.</p>
1128</li>
1129 <li> <p><code>ippAddRange</code> adds a rangeOfInteger attribute with one range.</p>
1130</li>
1131 <li> <p><code>ippAddRanges</code> adds a rangeOfInteger attribute with one or more ranges.</p>
1132</li>
1133 <li> <p><code>ippAddResolution</code> adds a resolution attribute with one resolution.</p>
1134</li>
1135 <li> <p><code>ippAddResolutions</code> adds a resolution attribute with one or more resolutions.</p>
1136</li>
1137 <li> <p><code>ippAddString</code> adds a charset (<code>IPP_TAG_CHARSET</code>), keyword (<code>IPP_TAG_KEYWORD</code>), mimeMediaType (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code> and <code>IPP_TAG_NAMELANG</code>), naturalLanguage (<code>IPP_TAG_NATURAL_LANGUAGE</code>), text (<code>IPP_TAG_TEXT</code> and <code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), or uriScheme (<code>IPP_TAG_URISCHEME</code>) attribute with one value.</p>
1138</li>
1139 <li> <p><code>ippAddStrings</code> adds a charset, keyword, mimeMediaType, name, naturalLanguage, text, uri, or uriScheme attribute with one or more values.</p>
1140</li>
b0fb2d75 1141</ul>
93d79201 1142 <h3 class="title" id="sending-the-ipp-request">Sending the IPP Request</h3>
b0fb2d75
MS
1143 <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>
1144 <pre><code>ipp_t *response = cupsDoRequest(http, request, resource);
1145</code></pre>
1146 <p>For requests like Send-Document that include a file, the <code>cupsDoFileRequest</code> function should be used:</p>
1147 <pre><code>ipp_t *response = cupsDoFileRequest(http, request, resource,
1148 filename);
1149</code></pre>
1150 <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>
1151 <p>The status from the most recent request can be queried using the <code>cupsLastError</code> function, for example:</p>
1152 <pre><code>if (cupsLastError() &gt;= IPP_STATUS_ERROR_BAD_REQUEST)
1153{
1154 /* request failed */
1155}
1156</code></pre>
1157 <p>A human-readable error message is also available using the <code>cupsLastErrorString</code> function:</p>
1158 <pre><code>if (cupsLastError() &gt;= IPP_STATUS_ERROR_BAD_REQUEST)
1159{
1160 /* request failed */
1161 printf(&quot;Request failed: %s\n&quot;, cupsLastErrorString());
1162}
1163</code></pre>
93d79201 1164 <h3 class="title" id="processing-the-ipp-response">Processing the IPP Response</h3>
b0fb2d75
MS
1165 <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>
1166 <p>For example, the following code finds the printer state attributes and prints their values:</p>
1167 <pre><code>ipp_attribute_t *attr;
1168
1169if ((attr = ippFindAttribute(response, &quot;printer-state&quot;,
1170 IPP_TAG_ENUM)) != NULL)
1171{
1172 printf(&quot;printer-state=%s\n&quot;,
db5424ea 1173 ippEnumString(&quot;printer-state&quot;, ippGetInteger(attr, 0)));
b0fb2d75
MS
1174}
1175else
1176 puts(&quot;printer-state=unknown&quot;);
1177
1178if ((attr = ippFindAttribute(response, &quot;printer-state-message&quot;,
1179 IPP_TAG_TEXT)) != NULL)
1180{
1181 printf(&quot;printer-state-message=\&quot;%s\&quot;\n&quot;,
1182 ippGetString(attr, 0, NULL)));
1183}
1184
1185if ((attr = ippFindAttribute(response, &quot;printer-state-reasons&quot;,
1186 IPP_TAG_KEYWORD)) != NULL)
1187{
1188 int i, count = ippGetCount(attr);
1189
1190 puts(&quot;printer-state-reasons=&quot;);
1191 for (i = 0; i &lt; count; i ++)
1192 printf(&quot; %s\n&quot;, ippGetString(attr, i, NULL)));
1193}
1194</code></pre>
1195 <p>The <code>ippGetCount</code> function returns the number of values in an attribute.</p>
1196 <p>The <code>ippGetInteger</code> and <code>ippGetString</code> functions return a single integer or string value from an attribute.</p>
db5424ea 1197 <p>The <code>ippEnumString</code> function converts a enum value to its keyword (string) equivalent.</p>
b0fb2d75
MS
1198 <p>Once you are done using the IPP response message, free it using the <code>ippDelete</code> function:</p>
1199 <pre><code>ippDelete(response);
1200</code></pre>
93d79201 1201 <h3 class="title" id="authentication">Authentication</h3>
b0fb2d75
MS
1202 <p>CUPS normally handles authentication through the console. GUI applications should set a password callback using the <code>cupsSetPasswordCB2</code> function:</p>
1203 <pre><code>void
1204cupsSetPasswordCB2(cups_password_cb2_t cb, void *user_data);
1205</code></pre>
1206 <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>
1207 <pre><code>const char *
1208cups_password_cb2(const char *prompt, http_t *http,
1209 const char *method, const char *resource,
1210 void *user_data);
1211</code></pre>
1212 <p>The <code>prompt</code> argument is a string from CUPS that should be displayed to the user.</p>
1213 <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>
1214 <p>The <code>method</code> argument specifies the HTTP method used for the request and is typically &quot;POST&quot;.</p>
1215 <p>The <code>resource</code> argument specifies the path used for the request.</p>
1216 <p>The <code>user_data</code> argument provides the user data pointer from the <code>cupsSetPasswordCB2</code> call.</p>
798d6e29 1217 <h2 class="title"><a id="FUNCTIONS">Functions</a></h2>
73721e3e
MS
1218<h3 class="function"><a id="CF_OPTIONS">CF_OPTIONS</a></h3>
1219 <p class="description"></p>
1220<p class="code">
1221typedef CF_OPTIONS(uint32_t, SecKeyUsage);</p>
1222<h4 class="parameters">Parameters</h4>
1223<table class="list"><tbody>
1224<tr><th>uint32_t</th>
1225</tr>
1226<tr><th>SecKeyUsage</th>
1227</tr>
1228</tbody></table>
1229<h4 class="returnvalue">Return Value</h4>
1230 <p class="description"></p>
798d6e29
MS
1231<h3 class="function"><a id="cupsAddDest">cupsAddDest</a></h3>
1232 <p class="description">Add a destination to the list of destinations.</p>
1233<p class="code">
98d88c8d
MS
1234int cupsAddDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
1235<h4 class="parameters">Parameters</h4>
1236<table class="list"><tbody>
1237<tr><th>name</th>
1238 <td class="description">Destination name</td></tr>
1239<tr><th>instance</th>
1240 <td class="description">Instance name or <code>NULL</code> for none/primary</td></tr>
1241<tr><th>num_dests</th>
1242 <td class="description">Number of destinations</td></tr>
1243<tr><th>dests</th>
1244 <td class="description">Destinations</td></tr>
1245</tbody></table>
798d6e29
MS
1246<h4 class="returnvalue">Return Value</h4>
1247 <p class="description">New number of destinations</p>
1248<h4 class="discussion">Discussion</h4>
1249 <p class="discussion">This function cannot be used to add a new class or printer queue,
1250it only adds a new container of saved options for the named
1251destination or instance.<br>
1252<br>
1253If the named destination already exists, the destination list is
1254returned unchanged. Adding a new instance of a destination creates
1255a copy of that destination's options.<br>
1256<br>
1257Use the <a href="#cupsSaveDests"><code>cupsSaveDests</code></a> function to save the updated list of
1258destinations to the user's lpoptions file.</p>
63b75fbe
MS
1259<h3 class="function"><span class="info">&#160;CUPS 2.3&#160;</span><a id="cupsAddDestMediaOptions">cupsAddDestMediaOptions</a></h3>
1260 <p class="description">Add the option corresponding to the specified media size.</p>
1261<p class="code">
1262int 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>
1263<h4 class="parameters">Parameters</h4>
1264<table class="list"><tbody>
1265<tr><th>http</th>
1266 <td class="description">Connection to destination</td></tr>
1267<tr><th>dest</th>
1268 <td class="description">Destination</td></tr>
1269<tr><th>dinfo</th>
1270 <td class="description">Destination information</td></tr>
1271<tr><th>flags</th>
1272 <td class="description">Media matching flags</td></tr>
1273<tr><th>size</th>
1274 <td class="description">Media size</td></tr>
1275<tr><th>num_options</th>
1276 <td class="description">Current number of options</td></tr>
1277<tr><th>options</th>
1278 <td class="description">Options</td></tr>
1279</tbody></table>
1280<h4 class="returnvalue">Return Value</h4>
1281 <p class="description">New number of options</p>
98d88c8d 1282<h3 class="function"><span class="info">&#160;CUPS 2.2.4/macOS 10.13&#160;</span><a id="cupsAddIntegerOption">cupsAddIntegerOption</a></h3>
53af7f21 1283 <p class="description">Add an integer option to an option array.</p>
798d6e29 1284<p class="code">
98d88c8d
MS
1285int cupsAddIntegerOption(const char *name, int value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
1286<h4 class="parameters">Parameters</h4>
1287<table class="list"><tbody>
1288<tr><th>name</th>
1289 <td class="description">Name of option</td></tr>
1290<tr><th>value</th>
1291 <td class="description">Value of option</td></tr>
1292<tr><th>num_options</th>
1293 <td class="description">Number of options</td></tr>
1294<tr><th>options</th>
1295 <td class="description">Pointer to options</td></tr>
1296</tbody></table>
798d6e29
MS
1297<h4 class="returnvalue">Return Value</h4>
1298 <p class="description">Number of options</p>
1299<h4 class="discussion">Discussion</h4>
1300 <p class="discussion">New option arrays can be initialized simply by passing 0 for the
53af7f21 1301&quot;num_options&quot; parameter.
798d6e29
MS
1302
1303</p>
53af7f21
MS
1304<h3 class="function"><a id="cupsAddOption">cupsAddOption</a></h3>
1305 <p class="description">Add an option to an option array.</p>
798d6e29 1306<p class="code">
98d88c8d
MS
1307int cupsAddOption(const char *name, const char *value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
1308<h4 class="parameters">Parameters</h4>
1309<table class="list"><tbody>
1310<tr><th>name</th>
1311 <td class="description">Name of option</td></tr>
1312<tr><th>value</th>
1313 <td class="description">Value of option</td></tr>
1314<tr><th>num_options</th>
1315 <td class="description">Number of options</td></tr>
1316<tr><th>options</th>
1317 <td class="description">Pointer to options</td></tr>
1318</tbody></table>
798d6e29 1319<h4 class="returnvalue">Return Value</h4>
53af7f21 1320 <p class="description">Number of options</p>
798d6e29 1321<h4 class="discussion">Discussion</h4>
53af7f21
MS
1322 <p class="discussion">New option arrays can be initialized simply by passing 0 for the
1323&quot;num_options&quot; parameter.</p>
98d88c8d 1324<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCancelDestJob">cupsCancelDestJob</a></h3>
798d6e29 1325 <p class="description">Cancel a job on a destination.</p>
98d88c8d
MS
1326<p class="code">
1327ipp_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>
1328<h4 class="parameters">Parameters</h4>
1329<table class="list"><tbody>
1330<tr><th>http</th>
1331 <td class="description">Connection to destination</td></tr>
1332<tr><th>dest</th>
1333 <td class="description">Destination</td></tr>
1334<tr><th>job_id</th>
1335 <td class="description">Job ID</td></tr>
1336</tbody></table>
1337<h4 class="returnvalue">Return Value</h4>
1338 <p class="description">Status of cancel operation</p>
1339<h4 class="discussion">Discussion</h4>
798d6e29
MS
1340 <p class="discussion">The &quot;job_id&quot; is the number returned by cupsCreateDestJob.<br>
1341<br>
1342Returns <code>IPP_STATUS_OK</code> on success and
98d88c8d 1343<code>IPP_STATUS_ERROR_NOT_AUTHORIZED</code> or
798d6e29
MS
1344<code>IPP_STATUS_ERROR_FORBIDDEN</code> on failure.
1345
798d6e29
MS
1346</p>
1347<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCheckDestSupported">cupsCheckDestSupported</a></h3>
1348 <p class="description">Check that the option and value are supported
1349by the destination.</p>
1350<p class="code">
98d88c8d
MS
1351int 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>
1352<h4 class="parameters">Parameters</h4>
1353<table class="list"><tbody>
1354<tr><th>http</th>
1355 <td class="description">Connection to destination</td></tr>
1356<tr><th>dest</th>
1357 <td class="description">Destination</td></tr>
1358<tr><th>dinfo</th>
1359 <td class="description">Destination information</td></tr>
1360<tr><th>option</th>
1361 <td class="description">Option</td></tr>
1362<tr><th>value</th>
b0fb2d75 1363 <td class="description">Value or <code>NULL</code></td></tr>
98d88c8d 1364</tbody></table>
798d6e29
MS
1365<h4 class="returnvalue">Return Value</h4>
1366 <p class="description">1 if supported, 0 otherwise</p>
1367<h4 class="discussion">Discussion</h4>
1368 <p class="discussion">Returns 1 if supported, 0 otherwise.
1369
1370</p>
1371<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCloseDestJob">cupsCloseDestJob</a></h3>
1372 <p class="description">Close a job and start printing.</p>
1373<p class="code">
98d88c8d
MS
1374ipp_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>
1375<h4 class="parameters">Parameters</h4>
1376<table class="list"><tbody>
1377<tr><th>http</th>
1378 <td class="description">Connection to destination</td></tr>
1379<tr><th>dest</th>
1380 <td class="description">Destination</td></tr>
1381<tr><th>info</th>
1382 <td class="description">Destination information</td></tr>
1383<tr><th>job_id</th>
1384 <td class="description">Job ID</td></tr>
1385</tbody></table>
798d6e29
MS
1386<h4 class="returnvalue">Return Value</h4>
1387 <p class="description">IPP status code</p>
1388<h4 class="discussion">Discussion</h4>
1389 <p class="discussion">Use when the last call to cupsStartDocument passed 0 for &quot;last_document&quot;.
1390&quot;job_id&quot; is the job ID returned by cupsCreateDestJob. Returns <code>IPP_STATUS_OK</code>
1391on success.
1392
1393</p>
1394<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsConnectDest">cupsConnectDest</a></h3>
699fe020 1395 <p class="description">Open a connection to the destination.</p>
98d88c8d
MS
1396<p class="code">
1397<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>
1398<h4 class="parameters">Parameters</h4>
1399<table class="list"><tbody>
1400<tr><th>dest</th>
1401 <td class="description">Destination</td></tr>
1402<tr><th>flags</th>
1403 <td class="description">Connection flags</td></tr>
1404<tr><th>msec</th>
1405 <td class="description">Timeout in milliseconds</td></tr>
1406<tr><th>cancel</th>
1407 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
1408<tr><th>resource</th>
1409 <td class="description">Resource buffer</td></tr>
1410<tr><th>resourcesize</th>
1411 <td class="description">Size of resource buffer</td></tr>
1412<tr><th>cb</th>
1413 <td class="description">Callback function</td></tr>
1414<tr><th>user_data</th>
1415 <td class="description">User data pointer</td></tr>
1416</tbody></table>
1417<h4 class="returnvalue">Return Value</h4>
1418 <p class="description">Connection to destination or <code>NULL</code></p>
1419<h4 class="discussion">Discussion</h4>
1420 <p class="discussion">Connect to the destination, returning a new <code>http_t</code> connection object
1421and optionally the resource path to use for the destination. These calls
1422will block until a connection is made, the timeout expires, the integer
1423pointed to by &quot;cancel&quot; is non-zero, or the callback function (or block)
1424returns 0. The caller is responsible for calling <a href="#httpClose"><code>httpClose</code></a> on the
b0fb2d75
MS
1425returned connection.<br>
1426<br>
699fe020 1427Starting with CUPS 2.2.4, the caller can pass <code>CUPS_DEST_FLAGS_DEVICE</code>
b0fb2d75
MS
1428for the &quot;flags&quot; argument to connect directly to the device associated with
1429the destination. Otherwise, the connection is made to the CUPS scheduler
1430associated with the destination.
798d6e29
MS
1431
1432</p>
53af7f21
MS
1433<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDest">cupsCopyDest</a></h3>
1434 <p class="description">Copy a destination.</p>
798d6e29 1435<p class="code">
98d88c8d
MS
1436int 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>
1437<h4 class="parameters">Parameters</h4>
1438<table class="list"><tbody>
1439<tr><th>dest</th>
1440 <td class="description">Destination to copy</td></tr>
1441<tr><th>num_dests</th>
1442 <td class="description">Number of destinations</td></tr>
1443<tr><th>dests</th>
1444 <td class="description">Destination array</td></tr>
1445</tbody></table>
798d6e29
MS
1446<h4 class="returnvalue">Return Value</h4>
1447 <p class="description">New number of destinations</p>
1448<h4 class="discussion">Discussion</h4>
1449 <p class="discussion">Make a copy of the destination to an array of destinations (or just a single
1450copy) - for use with the cupsEnumDests* functions. The caller is responsible
1451for calling cupsFreeDests() on the returned object(s).
1452
1453</p>
1454<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDestConflicts">cupsCopyDestConflicts</a></h3>
1455 <p class="description">Get conflicts and resolutions for a new
1456option/value pair.</p>
1457<p class="code">
98d88c8d
MS
1458int 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>
1459<h4 class="parameters">Parameters</h4>
1460<table class="list"><tbody>
1461<tr><th>http</th>
1462 <td class="description">Connection to destination</td></tr>
1463<tr><th>dest</th>
1464 <td class="description">Destination</td></tr>
1465<tr><th>dinfo</th>
1466 <td class="description">Destination information</td></tr>
1467<tr><th>num_options</th>
1468 <td class="description">Number of current options</td></tr>
1469<tr><th>options</th>
1470 <td class="description">Current options</td></tr>
1471<tr><th>new_option</th>
1472 <td class="description">New option</td></tr>
1473<tr><th>new_value</th>
1474 <td class="description">New value</td></tr>
1475<tr><th>num_conflicts</th>
1476 <td class="description">Number of conflicting options</td></tr>
1477<tr><th>conflicts</th>
1478 <td class="description">Conflicting options</td></tr>
1479<tr><th>num_resolved</th>
1480 <td class="description">Number of options to resolve</td></tr>
1481<tr><th>resolved</th>
1482 <td class="description">Resolved options</td></tr>
1483</tbody></table>
798d6e29
MS
1484<h4 class="returnvalue">Return Value</h4>
1485 <p class="description">1 if there is a conflict, 0 if none, -1 on error</p>
1486<h4 class="discussion">Discussion</h4>
1487 <p class="discussion">&quot;num_options&quot; and &quot;options&quot; represent the currently selected options by the
1488user. &quot;new_option&quot; and &quot;new_value&quot; are the setting the user has just
1489changed.<br>
1490<br>
1491Returns 1 if there is a conflict, 0 if there are no conflicts, and -1 if
1492there was an unrecoverable error such as a resolver loop.<br>
1493<br>
1494If &quot;num_conflicts&quot; and &quot;conflicts&quot; are not <code>NULL</code>, they are set to
1495contain the list of conflicting option/value pairs. Similarly, if
1496&quot;num_resolved&quot; and &quot;resolved&quot; are not <code>NULL</code> they will be set to the
1497list of changes needed to resolve the conflict.<br>
1498<br>
1499If cupsCopyDestConflicts returns 1 but &quot;num_resolved&quot; and &quot;resolved&quot; are set
1500to 0 and <code>NULL</code>, respectively, then the conflict cannot be resolved.
1501
1502</p>
1503<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDestInfo">cupsCopyDestInfo</a></h3>
1504 <p class="description">Get the supported values/capabilities for the
1505destination.</p>
1506<p class="code">
98d88c8d 1507<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 1508<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1509<table class="list"><tbody>
1510<tr><th>http</th>
1511 <td class="description">Connection to destination</td></tr>
1512<tr><th>dest</th>
1513 <td class="description">Destination</td></tr>
1514</tbody></table>
798d6e29
MS
1515<h4 class="returnvalue">Return Value</h4>
1516 <p class="description">Destination information</p>
1517<h4 class="discussion">Discussion</h4>
1518 <p class="discussion">The caller is responsible for calling <a href="#cupsFreeDestInfo"><code>cupsFreeDestInfo</code></a> on the return
1519value. <code>NULL</code> is returned on error.
1520
1521</p>
1522<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCreateDestJob">cupsCreateDestJob</a></h3>
1523 <p class="description">Create a job on a destination.</p>
1524<p class="code">
98d88c8d
MS
1525ipp_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>
1526<h4 class="parameters">Parameters</h4>
1527<table class="list"><tbody>
1528<tr><th>http</th>
1529 <td class="description">Connection to destination</td></tr>
1530<tr><th>dest</th>
1531 <td class="description">Destination</td></tr>
1532<tr><th>info</th>
1533 <td class="description">Destination information</td></tr>
1534<tr><th>job_id</th>
1535 <td class="description">Job ID or 0 on error</td></tr>
1536<tr><th>title</th>
1537 <td class="description">Job name</td></tr>
1538<tr><th>num_options</th>
1539 <td class="description">Number of job options</td></tr>
1540<tr><th>options</th>
1541 <td class="description">Job options</td></tr>
1542</tbody></table>
798d6e29
MS
1543<h4 class="returnvalue">Return Value</h4>
1544 <p class="description">IPP status code</p>
1545<h4 class="discussion">Discussion</h4>
1546 <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success, saving the job ID
1547in the variable pointed to by &quot;job_id&quot;.
1548
1549</p>
798d6e29
MS
1550<h3 class="function"><span class="info">&#160;CUPS 1.1.20/macOS 10.4&#160;</span><a id="cupsDoAuthentication">cupsDoAuthentication</a></h3>
1551 <p class="description">Authenticate a request.</p>
1552<p class="code">
98d88c8d
MS
1553int cupsDoAuthentication(<a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p>
1554<h4 class="parameters">Parameters</h4>
1555<table class="list"><tbody>
1556<tr><th>http</th>
1557 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
1558<tr><th>method</th>
1559 <td class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</td></tr>
1560<tr><th>resource</th>
1561 <td class="description">Resource path</td></tr>
1562</tbody></table>
798d6e29
MS
1563<h4 class="returnvalue">Return Value</h4>
1564 <p class="description">0 on success, -1 on error</p>
1565<h4 class="discussion">Discussion</h4>
1566 <p class="discussion">This function should be called in response to a <code>HTTP_STATUS_UNAUTHORIZED</code>
1567status, prior to resubmitting your request.
1568
1569</p>
ddf2ec73
MS
1570<h3 class="function"><span class="info">&#160;CUPS 2.3&#160;</span><a id="cupsEncodeOption">cupsEncodeOption</a></h3>
1571 <p class="description">Encode a single option into an IPP attribute.</p>
1572<p class="code">
1573<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>
1574<h4 class="parameters">Parameters</h4>
1575<table class="list"><tbody>
1576<tr><th>ipp</th>
1577 <td class="description">IPP request/response</td></tr>
1578<tr><th>group_tag</th>
1579 <td class="description">Attribute group</td></tr>
1580<tr><th>name</th>
1581 <td class="description">Option name</td></tr>
1582<tr><th>value</th>
1583 <td class="description">Option string value</td></tr>
1584</tbody></table>
1585<h4 class="returnvalue">Return Value</h4>
1586 <p class="description">New attribute or <code>NULL</code> on error</p>
798d6e29 1587<h3 class="function"><a id="cupsEncodeOptions">cupsEncodeOptions</a></h3>
53af7f21 1588 <p class="description">Encode printer options into IPP attributes.</p>
98d88c8d
MS
1589<p class="code">
1590void cupsEncodeOptions(<a href="#ipp_t">ipp_t</a> *ipp, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
1591<h4 class="parameters">Parameters</h4>
1592<table class="list"><tbody>
1593<tr><th>ipp</th>
ddf2ec73 1594 <td class="description">IPP request/response</td></tr>
98d88c8d
MS
1595<tr><th>num_options</th>
1596 <td class="description">Number of options</td></tr>
1597<tr><th>options</th>
1598 <td class="description">Options</td></tr>
1599</tbody></table>
1600<h4 class="discussion">Discussion</h4>
798d6e29 1601 <p class="discussion">This function adds operation, job, and then subscription attributes,
98d88c8d
MS
1602in that order. Use the <a href="#cupsEncodeOptions2"><code>cupsEncodeOptions2</code></a> function to add attributes
1603for a single group.</p>
1604<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsEncodeOptions2">cupsEncodeOptions2</a></h3>
53af7f21 1605 <p class="description">Encode printer options into IPP attributes for a group.</p>
98d88c8d
MS
1606<p class="code">
1607void 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>
1608<h4 class="parameters">Parameters</h4>
1609<table class="list"><tbody>
1610<tr><th>ipp</th>
ddf2ec73 1611 <td class="description">IPP request/response</td></tr>
98d88c8d
MS
1612<tr><th>num_options</th>
1613 <td class="description">Number of options</td></tr>
1614<tr><th>options</th>
1615 <td class="description">Options</td></tr>
1616<tr><th>group_tag</th>
1617 <td class="description">Group to encode</td></tr>
1618</tbody></table>
1619<h4 class="discussion">Discussion</h4>
798d6e29 1620 <p class="discussion">This function only adds attributes for a single group. Call this
98d88c8d 1621function multiple times for each group, or use <a href="#cupsEncodeOptions"><code>cupsEncodeOptions</code></a>
798d6e29
MS
1622to add the standard groups.
1623
1624</p>
1625<h3 class="function"><a id="cupsEncryption">cupsEncryption</a></h3>
1626 <p class="description">Get the current encryption settings.</p>
1627<p class="code">
98d88c8d 1628<a href="#http_encryption_t">http_encryption_t</a> cupsEncryption(void);</p>
798d6e29
MS
1629<h4 class="returnvalue">Return Value</h4>
1630 <p class="description">Encryption settings</p>
1631<h4 class="discussion">Discussion</h4>
1632 <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
1633environment variable, then the ~/.cups/client.conf file, and finally the
1634/etc/cups/client.conf file. If not set, the default is
1635<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
1636<br>
1637Note: The current encryption setting is tracked separately for each thread
1638in a program. Multi-threaded programs that override the setting via the
1639<a href="#cupsSetEncryption"><code>cupsSetEncryption</code></a> function need to do so in each thread for the same
1640setting to be used.</p>
1641<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsEnumDests">cupsEnumDests</a></h3>
1642 <p class="description">Enumerate available destinations with a callback function.</p>
1643<p class="code">
98d88c8d
MS
1644int 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>
1645<h4 class="parameters">Parameters</h4>
1646<table class="list"><tbody>
1647<tr><th>flags</th>
1648 <td class="description">Enumeration flags</td></tr>
1649<tr><th>msec</th>
1650 <td class="description">Timeout in milliseconds, -1 for indefinite</td></tr>
1651<tr><th>cancel</th>
1652 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
1653<tr><th>type</th>
1654 <td class="description">Printer type bits</td></tr>
1655<tr><th>mask</th>
1656 <td class="description">Mask for printer type bits</td></tr>
1657<tr><th>cb</th>
1658 <td class="description">Callback function</td></tr>
1659<tr><th>user_data</th>
1660 <td class="description">User data</td></tr>
1661</tbody></table>
798d6e29
MS
1662<h4 class="returnvalue">Return Value</h4>
1663 <p class="description">1 on success, 0 on failure</p>
1664<h4 class="discussion">Discussion</h4>
53af7f21
MS
1665 <p class="discussion">Destinations are enumerated from one or more sources. The callback function
1666receives the <code>user_data</code> pointer and the destination pointer which can
1667be used as input to the <a href="#cupsCopyDest"><code>cupsCopyDest</code></a> function. The function must
1668return 1 to continue enumeration or 0 to stop.<br>
798d6e29 1669<br>
53af7f21
MS
1670The <code>type</code> and <code>mask</code> arguments allow the caller to filter the
1671destinations that are enumerated. Passing 0 for both will enumerate all
1672printers. The constant <code>CUPS_PRINTER_DISCOVERED</code> is used to filter on
1673destinations that are available but have not yet been added locally.<br>
798d6e29
MS
1674<br>
1675Enumeration happens on the current thread and does not return until all
718ee2ff
MS
1676destinations have been enumerated or the callback function returns 0.<br>
1677<br>
1678Note: The callback function will likely receive multiple updates for the same
1679destinations - it is up to the caller to suppress any duplicate destinations.
798d6e29
MS
1680
1681</p>
798d6e29
MS
1682<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestDefault">cupsFindDestDefault</a></h3>
1683 <p class="description">Find the default value(s) for the given option.</p>
1684<p class="code">
98d88c8d
MS
1685<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>
1686<h4 class="parameters">Parameters</h4>
1687<table class="list"><tbody>
1688<tr><th>http</th>
1689 <td class="description">Connection to destination</td></tr>
1690<tr><th>dest</th>
1691 <td class="description">Destination</td></tr>
1692<tr><th>dinfo</th>
1693 <td class="description">Destination information</td></tr>
1694<tr><th>option</th>
1695 <td class="description">Option/attribute name</td></tr>
1696</tbody></table>
798d6e29
MS
1697<h4 class="returnvalue">Return Value</h4>
1698 <p class="description">Default attribute or <code>NULL</code> for none</p>
1699<h4 class="discussion">Discussion</h4>
1700 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1701<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1702<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1703<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1704functions to inspect the default value(s) as needed.
1705
1706</p>
1707<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestReady">cupsFindDestReady</a></h3>
1708 <p class="description">Find the default value(s) for the given option.</p>
1709<p class="code">
98d88c8d
MS
1710<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>
1711<h4 class="parameters">Parameters</h4>
1712<table class="list"><tbody>
1713<tr><th>http</th>
1714 <td class="description">Connection to destination</td></tr>
1715<tr><th>dest</th>
1716 <td class="description">Destination</td></tr>
1717<tr><th>dinfo</th>
1718 <td class="description">Destination information</td></tr>
1719<tr><th>option</th>
1720 <td class="description">Option/attribute name</td></tr>
1721</tbody></table>
798d6e29
MS
1722<h4 class="returnvalue">Return Value</h4>
1723 <p class="description">Default attribute or <code>NULL</code> for none</p>
1724<h4 class="discussion">Discussion</h4>
1725 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1726<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1727<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1728<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1729functions to inspect the default value(s) as needed.
1730
1731</p>
1732<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestSupported">cupsFindDestSupported</a></h3>
1733 <p class="description">Find the default value(s) for the given option.</p>
1734<p class="code">
98d88c8d
MS
1735<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>
1736<h4 class="parameters">Parameters</h4>
1737<table class="list"><tbody>
1738<tr><th>http</th>
1739 <td class="description">Connection to destination</td></tr>
1740<tr><th>dest</th>
1741 <td class="description">Destination</td></tr>
1742<tr><th>dinfo</th>
1743 <td class="description">Destination information</td></tr>
1744<tr><th>option</th>
1745 <td class="description">Option/attribute name</td></tr>
1746</tbody></table>
798d6e29
MS
1747<h4 class="returnvalue">Return Value</h4>
1748 <p class="description">Default attribute or <code>NULL</code> for none</p>
1749<h4 class="discussion">Discussion</h4>
1750 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1751<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1752<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1753<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1754functions to inspect the default value(s) as needed.
1755
1756</p>
1757<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsFinishDestDocument">cupsFinishDestDocument</a></h3>
1758 <p class="description">Finish the current document.</p>
1759<p class="code">
98d88c8d
MS
1760ipp_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>
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>info</th>
1768 <td class="description">Destination information</td></tr>
1769</tbody></table>
798d6e29
MS
1770<h4 class="returnvalue">Return Value</h4>
1771 <p class="description">Status of document submission</p>
1772<h4 class="discussion">Discussion</h4>
1773 <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success.
1774
798d6e29 1775</p>
98d88c8d 1776<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsFreeDestInfo">cupsFreeDestInfo</a></h3>
53af7f21
MS
1777 <p class="description">Free destination information obtained using
1778<a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a>.</p>
798d6e29 1779<p class="code">
98d88c8d 1780void cupsFreeDestInfo(<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo);</p>
798d6e29 1781<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1782<table class="list"><tbody>
1783<tr><th>dinfo</th>
1784 <td class="description">Destination information</td></tr>
1785</tbody></table>
1786<h3 class="function"><a id="cupsFreeDests">cupsFreeDests</a></h3>
53af7f21 1787 <p class="description">Free the memory used by the list of destinations.</p>
798d6e29 1788<p class="code">
98d88c8d 1789void cupsFreeDests(int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
798d6e29 1790<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1791<table class="list"><tbody>
1792<tr><th>num_dests</th>
1793 <td class="description">Number of destinations</td></tr>
1794<tr><th>dests</th>
1795 <td class="description">Destinations</td></tr>
1796</tbody></table>
1797<h3 class="function"><a id="cupsFreeJobs">cupsFreeJobs</a></h3>
53af7f21 1798 <p class="description">Free memory used by job data.</p>
798d6e29 1799<p class="code">
98d88c8d 1800void cupsFreeJobs(int num_jobs, <a href="#cups_job_t">cups_job_t</a> *jobs);</p>
798d6e29 1801<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1802<table class="list"><tbody>
1803<tr><th>num_jobs</th>
1804 <td class="description">Number of jobs</td></tr>
1805<tr><th>jobs</th>
1806 <td class="description">Jobs</td></tr>
1807</tbody></table>
1808<h3 class="function"><a id="cupsFreeOptions">cupsFreeOptions</a></h3>
53af7f21 1809 <p class="description">Free all memory used by options.</p>
98d88c8d
MS
1810<p class="code">
1811void cupsFreeOptions(int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
1812<h4 class="parameters">Parameters</h4>
1813<table class="list"><tbody>
1814<tr><th>num_options</th>
1815 <td class="description">Number of options</td></tr>
1816<tr><th>options</th>
1817 <td class="description">Pointer to options</td></tr>
1818</tbody></table>
798d6e29
MS
1819<h3 class="function"><a id="cupsGetDest">cupsGetDest</a></h3>
1820 <p class="description">Get the named destination from the list.</p>
1821<p class="code">
98d88c8d
MS
1822<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>
1823<h4 class="parameters">Parameters</h4>
1824<table class="list"><tbody>
1825<tr><th>name</th>
1826 <td class="description">Destination name or <code>NULL</code> for the default destination</td></tr>
1827<tr><th>instance</th>
1828 <td class="description">Instance name or <code>NULL</code></td></tr>
1829<tr><th>num_dests</th>
1830 <td class="description">Number of destinations</td></tr>
1831<tr><th>dests</th>
1832 <td class="description">Destinations</td></tr>
1833</tbody></table>
798d6e29
MS
1834<h4 class="returnvalue">Return Value</h4>
1835 <p class="description">Destination pointer or <code>NULL</code></p>
1836<h4 class="discussion">Discussion</h4>
98d88c8d 1837 <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
1838list of supported destinations for the current user.</p>
1839<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></h3>
1840 <p class="description">Get a media name, dimension, and margins for a
1841specific size.</p>
1842<p class="code">
98d88c8d
MS
1843int 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>
1844<h4 class="parameters">Parameters</h4>
1845<table class="list"><tbody>
1846<tr><th>http</th>
1847 <td class="description">Connection to destination</td></tr>
1848<tr><th>dest</th>
1849 <td class="description">Destination</td></tr>
1850<tr><th>dinfo</th>
1851 <td class="description">Destination information</td></tr>
1852<tr><th>n</th>
1853 <td class="description">Media size number (0-based)</td></tr>
1854<tr><th>flags</th>
1855 <td class="description">Media flags</td></tr>
1856<tr><th>size</th>
1857 <td class="description">Media size information</td></tr>
1858</tbody></table>
798d6e29
MS
1859<h4 class="returnvalue">Return Value</h4>
1860 <p class="description">1 on success, 0 on failure</p>
1861<h4 class="discussion">Discussion</h4>
1862 <p class="discussion">The <code>flags</code> parameter determines which set of media are indexed. For
1863example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will get the Nth
1864borderless size supported by the printer.
1865
1866</p>
1867<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsGetDestMediaByName">cupsGetDestMediaByName</a></h3>
1868 <p class="description">Get media names, dimensions, and margins.</p>
1869<p class="code">
98d88c8d
MS
1870int 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>
1871<h4 class="parameters">Parameters</h4>
1872<table class="list"><tbody>
1873<tr><th>http</th>
1874 <td class="description">Connection to destination</td></tr>
1875<tr><th>dest</th>
1876 <td class="description">Destination</td></tr>
1877<tr><th>dinfo</th>
1878 <td class="description">Destination information</td></tr>
1879<tr><th>media</th>
1880 <td class="description">Media name</td></tr>
1881<tr><th>flags</th>
1882 <td class="description">Media matching flags</td></tr>
1883<tr><th>size</th>
1884 <td class="description">Media size information</td></tr>
1885</tbody></table>
798d6e29
MS
1886<h4 class="returnvalue">Return Value</h4>
1887 <p class="description">1 on match, 0 on failure</p>
1888<h4 class="discussion">Discussion</h4>
1889 <p class="discussion">The &quot;media&quot; string is a PWG media name. &quot;Flags&quot; provides some matching
1890guidance (multiple flags can be combined):<br>
1891<br>
1892CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
1893CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
1894CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
1895CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
1896CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
1897size amongst the &quot;ready&quot; media.<br>
1898<br>
1899The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
1900<br>
1901Returns 1 when there is a match and 0 if there is not a match.
1902
1903</p>
1904<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></h3>
1905 <p class="description">Get media names, dimensions, and margins.</p>
1906<p class="code">
98d88c8d
MS
1907int 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>
1908<h4 class="parameters">Parameters</h4>
1909<table class="list"><tbody>
1910<tr><th>http</th>
1911 <td class="description">Connection to destination</td></tr>
1912<tr><th>dest</th>
1913 <td class="description">Destination</td></tr>
1914<tr><th>dinfo</th>
1915 <td class="description">Destination information</td></tr>
1916<tr><th>width</th>
1917 <td class="description">Media width in hundredths of
1918of millimeters</td></tr>
1919<tr><th>length</th>
1920 <td class="description">Media length in hundredths of
1921of millimeters</td></tr>
1922<tr><th>flags</th>
1923 <td class="description">Media matching flags</td></tr>
1924<tr><th>size</th>
1925 <td class="description">Media size information</td></tr>
1926</tbody></table>
798d6e29
MS
1927<h4 class="returnvalue">Return Value</h4>
1928 <p class="description">1 on match, 0 on failure</p>
1929<h4 class="discussion">Discussion</h4>
1930 <p class="discussion">&quot;Width&quot; and &quot;length&quot; are the dimensions in hundredths of millimeters.
1931&quot;Flags&quot; provides some matching guidance (multiple flags can be combined):<br>
1932<br>
1933CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
1934CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
1935CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
1936CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
1937CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
1938size amongst the &quot;ready&quot; media.<br>
1939<br>
1940The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
1941<br>
1942Returns 1 when there is a match and 0 if there is not a match.
1943
1944</p>
1945<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaCount">cupsGetDestMediaCount</a></h3>
1946 <p class="description">Get the number of sizes supported by a
1947destination.</p>
1948<p class="code">
98d88c8d
MS
1949int 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>
1950<h4 class="parameters">Parameters</h4>
1951<table class="list"><tbody>
1952<tr><th>http</th>
1953 <td class="description">Connection to destination</td></tr>
1954<tr><th>dest</th>
1955 <td class="description">Destination</td></tr>
1956<tr><th>dinfo</th>
1957 <td class="description">Destination information</td></tr>
1958<tr><th>flags</th>
1959 <td class="description">Media flags</td></tr>
1960</tbody></table>
798d6e29
MS
1961<h4 class="returnvalue">Return Value</h4>
1962 <p class="description">Number of sizes</p>
1963<h4 class="discussion">Discussion</h4>
1964 <p class="discussion">The <code>flags</code> parameter determines the set of media sizes that are
1965counted. For example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return
1966the number of borderless sizes.
1967
1968</p>
1969<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></h3>
1970 <p class="description">Get the default size for a destination.</p>
1971<p class="code">
98d88c8d
MS
1972int 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>
1973<h4 class="parameters">Parameters</h4>
1974<table class="list"><tbody>
1975<tr><th>http</th>
1976 <td class="description">Connection to destination</td></tr>
1977<tr><th>dest</th>
1978 <td class="description">Destination</td></tr>
1979<tr><th>dinfo</th>
1980 <td class="description">Destination information</td></tr>
1981<tr><th>flags</th>
1982 <td class="description">Media flags</td></tr>
1983<tr><th>size</th>
1984 <td class="description">Media size information</td></tr>
1985</tbody></table>
798d6e29
MS
1986<h4 class="returnvalue">Return Value</h4>
1987 <p class="description">1 on success, 0 on failure</p>
1988<h4 class="discussion">Discussion</h4>
1989 <p class="discussion">The <code>flags</code> parameter determines which default size is returned. For
1990example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the default
1991borderless size, typically US Letter or A4, but sometimes 4x6 photo media.
1992
1993</p>
1994<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsGetDestWithURI">cupsGetDestWithURI</a></h3>
1995 <p class="description">Get a destination associated with a URI.</p>
1996<p class="code">
98d88c8d 1997<a href="#cups_dest_t">cups_dest_t</a> *cupsGetDestWithURI(const char *name, const char *uri);</p>
798d6e29 1998<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1999<table class="list"><tbody>
2000<tr><th>name</th>
2001 <td class="description">Desired printer name or <code>NULL</code></td></tr>
2002<tr><th>uri</th>
2003 <td class="description">URI for the printer</td></tr>
2004</tbody></table>
798d6e29
MS
2005<h4 class="returnvalue">Return Value</h4>
2006 <p class="description">Destination or <code>NULL</code></p>
2007<h4 class="discussion">Discussion</h4>
2008 <p class="discussion">&quot;name&quot; is the desired name for the printer. If <code>NULL</code>, a name will be
2009created using the URI.<br>
2010<br>
2011&quot;uri&quot; is the &quot;ipp&quot; or &quot;ipps&quot; URI for the printer.
2012
2013</p>
98d88c8d
MS
2014<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetDests2">cupsGetDests2</a></h3>
2015 <p class="description">Get the list of destinations from the specified server.</p>
2016<p class="code">
2017int cupsGetDests2(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
2018<h4 class="parameters">Parameters</h4>
2019<table class="list"><tbody>
2020<tr><th>http</th>
2021 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
2022<tr><th>dests</th>
2023 <td class="description">Destinations</td></tr>
2024</tbody></table>
2025<h4 class="returnvalue">Return Value</h4>
2026 <p class="description">Number of destinations</p>
2027<h4 class="discussion">Discussion</h4>
2028 <p class="discussion">Starting with CUPS 1.2, the returned list of destinations include the
2029&quot;printer-info&quot;, &quot;printer-is-accepting-jobs&quot;, &quot;printer-is-shared&quot;,
2030&quot;printer-make-and-model&quot;, &quot;printer-state&quot;, &quot;printer-state-change-time&quot;,
2031&quot;printer-state-reasons&quot;, &quot;printer-type&quot;, and &quot;printer-uri-supported&quot;
2032attributes as options.<br>
2033<br>
2034CUPS 1.4 adds the &quot;marker-change-time&quot;, &quot;marker-colors&quot;,
2035&quot;marker-high-levels&quot;, &quot;marker-levels&quot;, &quot;marker-low-levels&quot;, &quot;marker-message&quot;,
2036&quot;marker-names&quot;, &quot;marker-types&quot;, and &quot;printer-commands&quot; attributes as options.<br>
2037<br>
2038CUPS 2.2 adds accessible IPP printers to the list of destinations that can
2039be used. The &quot;printer-uri-supported&quot; option will be present for those IPP
2040printers that have been recently used.<br>
2041<br>
2042Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and
2043the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination.
2044
2045</p>
2046<h3 class="function"><span class="info">&#160;CUPS 2.2.4/macOS 10.13&#160;</span><a id="cupsGetIntegerOption">cupsGetIntegerOption</a></h3>
53af7f21 2047 <p class="description">Get an integer option value.</p>
798d6e29 2048<p class="code">
98d88c8d
MS
2049int cupsGetIntegerOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
2050<h4 class="parameters">Parameters</h4>
2051<table class="list"><tbody>
2052<tr><th>name</th>
2053 <td class="description">Name of option</td></tr>
2054<tr><th>num_options</th>
2055 <td class="description">Number of options</td></tr>
2056<tr><th>options</th>
2057 <td class="description">Options</td></tr>
2058</tbody></table>
798d6e29 2059<h4 class="returnvalue">Return Value</h4>
53af7f21 2060 <p class="description">Option value or <code>INT_MIN</code></p>
798d6e29 2061<h4 class="discussion">Discussion</h4>
53af7f21
MS
2062 <p class="discussion">INT_MIN is returned when the option does not exist, is not an integer, or
2063exceeds the range of values for the &quot;int&quot; type.
2064
2065</p>
798d6e29
MS
2066<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetJobs2">cupsGetJobs2</a></h3>
2067 <p class="description">Get the jobs from the specified server.</p>
2068<p class="code">
98d88c8d
MS
2069int 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>
2070<h4 class="parameters">Parameters</h4>
2071<table class="list"><tbody>
2072<tr><th>http</th>
2073 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
2074<tr><th>jobs</th>
2075 <td class="description">Job data</td></tr>
2076<tr><th>name</th>
2077 <td class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</td></tr>
2078<tr><th>myjobs</th>
2079 <td class="description">0 = all users, 1 = mine</td></tr>
2080<tr><th>whichjobs</th>
2081 <td class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></td></tr>
2082</tbody></table>
798d6e29
MS
2083<h4 class="returnvalue">Return Value</h4>
2084 <p class="description">Number of jobs</p>
2085<h4 class="discussion">Discussion</h4>
2086 <p class="discussion">A &quot;whichjobs&quot; value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless
2087of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are
2088pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns
2089jobs that are stopped, canceled, aborted, or completed.
2090
2091</p>
2092<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsGetNamedDest">cupsGetNamedDest</a></h3>
2093 <p class="description">Get options for the named destination.</p>
2094<p class="code">
98d88c8d
MS
2095<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>
2096<h4 class="parameters">Parameters</h4>
2097<table class="list"><tbody>
2098<tr><th>http</th>
2099 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
2100<tr><th>name</th>
2101 <td class="description">Destination name or <code>NULL</code> for the default destination</td></tr>
2102<tr><th>instance</th>
2103 <td class="description">Instance name or <code>NULL</code></td></tr>
2104</tbody></table>
798d6e29
MS
2105<h4 class="returnvalue">Return Value</h4>
2106 <p class="description">Destination or <code>NULL</code></p>
2107<h4 class="discussion">Discussion</h4>
2108 <p class="discussion">This function is optimized for retrieving a single destination and should
98d88c8d
MS
2109be used instead of <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> when you
2110either know the name of the destination or want to print to the default
2111destination. If <code>NULL</code> is returned, the destination does not exist or
2112there is no default destination.<br>
798d6e29
MS
2113<br>
2114If &quot;http&quot; is <code>CUPS_HTTP_DEFAULT</code>, the connection to the default print
2115server will be used.<br>
2116<br>
2117If &quot;name&quot; is <code>NULL</code>, the default printer for the current user will be
2118returned.<br>
2119<br>
2120The returned destination must be freed using <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> with a
2121&quot;num_dests&quot; value of 1.
2122
2123</p>
2124<h3 class="function"><a id="cupsGetOption">cupsGetOption</a></h3>
2125 <p class="description">Get an option value.</p>
2126<p class="code">
98d88c8d
MS
2127const char *cupsGetOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
2128<h4 class="parameters">Parameters</h4>
2129<table class="list"><tbody>
2130<tr><th>name</th>
2131 <td class="description">Name of option</td></tr>
2132<tr><th>num_options</th>
2133 <td class="description">Number of options</td></tr>
2134<tr><th>options</th>
2135 <td class="description">Options</td></tr>
2136</tbody></table>
798d6e29
MS
2137<h4 class="returnvalue">Return Value</h4>
2138 <p class="description">Option value or <code>NULL</code></p>
798d6e29 2139<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsGetPassword2">cupsGetPassword2</a></h3>
98d88c8d 2140 <p class="description">Get a password from the user using the current
798d6e29
MS
2141password callback.</p>
2142<p class="code">
98d88c8d
MS
2143const char *cupsGetPassword2(const char *prompt, <a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p>
2144<h4 class="parameters">Parameters</h4>
2145<table class="list"><tbody>
2146<tr><th>prompt</th>
2147 <td class="description">Prompt string</td></tr>
2148<tr><th>http</th>
2149 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
2150<tr><th>method</th>
2151 <td class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</td></tr>
2152<tr><th>resource</th>
2153 <td class="description">Resource path</td></tr>
2154</tbody></table>
798d6e29
MS
2155<h4 class="returnvalue">Return Value</h4>
2156 <p class="description">Password</p>
2157<h4 class="discussion">Discussion</h4>
2158 <p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the
2159user does not provide a password.<br>
2160<br>
2161Note: The current password callback function is tracked separately for each
2162thread in a program. Multi-threaded programs that override the setting via
98d88c8d
MS
2163the <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> function need to do so in each thread for the
2164same function to be used.
798d6e29 2165
798d6e29 2166</p>
798d6e29
MS
2167<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></h3>
2168 <p class="description">Get the localized string for a destination media
2169size.</p>
2170<p class="code">
98d88c8d
MS
2171const 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>
2172<h4 class="parameters">Parameters</h4>
2173<table class="list"><tbody>
2174<tr><th>http</th>
2175 <td class="description">Connection to destination</td></tr>
2176<tr><th>dest</th>
2177 <td class="description">Destination</td></tr>
2178<tr><th>dinfo</th>
2179 <td class="description">Destination information</td></tr>
2180<tr><th>flags</th>
2181 <td class="description">Media flags</td></tr>
2182<tr><th>size</th>
2183 <td class="description">Media size</td></tr>
2184</tbody></table>
798d6e29
MS
2185<h4 class="returnvalue">Return Value</h4>
2186 <p class="description">Localized string</p>
2187<h4 class="discussion">Discussion</h4>
2188 <p class="discussion">The returned string is stored in the destination information and will become
2189invalid if the destination information is deleted.
2190
2191</p>
2192<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsLocalizeDestOption">cupsLocalizeDestOption</a></h3>
2193 <p class="description">Get the localized string for a destination
2194option.</p>
2195<p class="code">
98d88c8d
MS
2196const 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>
2197<h4 class="parameters">Parameters</h4>
2198<table class="list"><tbody>
2199<tr><th>http</th>
2200 <td class="description">Connection to destination</td></tr>
2201<tr><th>dest</th>
2202 <td class="description">Destination</td></tr>
2203<tr><th>dinfo</th>
2204 <td class="description">Destination information</td></tr>
2205<tr><th>option</th>
2206 <td class="description">Option to localize</td></tr>
2207</tbody></table>
798d6e29
MS
2208<h4 class="returnvalue">Return Value</h4>
2209 <p class="description">Localized string</p>
2210<h4 class="discussion">Discussion</h4>
2211 <p class="discussion">The returned string is stored in the destination information and will become
2212invalid if the destination information is deleted.
2213
2214</p>
2215<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsLocalizeDestValue">cupsLocalizeDestValue</a></h3>
2216 <p class="description">Get the localized string for a destination
2217option+value pair.</p>
2218<p class="code">
98d88c8d
MS
2219const 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>
2220<h4 class="parameters">Parameters</h4>
2221<table class="list"><tbody>
2222<tr><th>http</th>
2223 <td class="description">Connection to destination</td></tr>
2224<tr><th>dest</th>
2225 <td class="description">Destination</td></tr>
2226<tr><th>dinfo</th>
2227 <td class="description">Destination information</td></tr>
2228<tr><th>option</th>
2229 <td class="description">Option to localize</td></tr>
2230<tr><th>value</th>
2231 <td class="description">Value to localize</td></tr>
2232</tbody></table>
798d6e29
MS
2233<h4 class="returnvalue">Return Value</h4>
2234 <p class="description">Localized string</p>
2235<h4 class="discussion">Discussion</h4>
2236 <p class="discussion">The returned string is stored in the destination information and will become
2237invalid if the destination information is deleted.
2238
2239</p>
2240<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="cupsMakeServerCredentials">cupsMakeServerCredentials</a></h3>
2241 <p class="description">Make a self-signed certificate and private key pair.</p>
2242<p class="code">
98d88c8d
MS
2243int cupsMakeServerCredentials(const char *path, const char *common_name, int num_alt_names, const char **alt_names, time_t expiration_date);</p>
2244<h4 class="parameters">Parameters</h4>
2245<table class="list"><tbody>
2246<tr><th>path</th>
2247 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
2248<tr><th>common_name</th>
2249 <td class="description">Common name</td></tr>
2250<tr><th>num_alt_names</th>
2251 <td class="description">Number of subject alternate names</td></tr>
2252<tr><th>alt_names</th>
2253 <td class="description">Subject Alternate Names</td></tr>
2254<tr><th>expiration_date</th>
2255 <td class="description">Expiration date</td></tr>
2256</tbody></table>
798d6e29
MS
2257<h4 class="returnvalue">Return Value</h4>
2258 <p class="description">1 on success, 0 on failure</p>
798d6e29
MS
2259<h3 class="function"><a id="cupsParseOptions">cupsParseOptions</a></h3>
2260 <p class="description">Parse options from a command-line argument.</p>
2261<p class="code">
98d88c8d
MS
2262int cupsParseOptions(const char *arg, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
2263<h4 class="parameters">Parameters</h4>
2264<table class="list"><tbody>
2265<tr><th>arg</th>
2266 <td class="description">Argument to parse</td></tr>
2267<tr><th>num_options</th>
2268 <td class="description">Number of options</td></tr>
2269<tr><th>options</th>
2270 <td class="description">Options found</td></tr>
2271</tbody></table>
798d6e29
MS
2272<h4 class="returnvalue">Return Value</h4>
2273 <p class="description">Number of options found</p>
2274<h4 class="discussion">Discussion</h4>
2275 <p class="discussion">This function converts space-delimited name/value pairs according
2276to the PAPI text option ABNF specification. Collection values
2277(&quot;name={a=... b=... c=...}&quot;) are stored with the curley brackets
2278intact - use <code>cupsParseOptions</code> on the value to extract the
2279collection attributes.</p>
798d6e29
MS
2280<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsRemoveDest">cupsRemoveDest</a></h3>
2281 <p class="description">Remove a destination from the destination list.</p>
2282<p class="code">
98d88c8d
MS
2283int cupsRemoveDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
2284<h4 class="parameters">Parameters</h4>
2285<table class="list"><tbody>
2286<tr><th>name</th>
2287 <td class="description">Destination name</td></tr>
2288<tr><th>instance</th>
2289 <td class="description">Instance name or <code>NULL</code></td></tr>
2290<tr><th>num_dests</th>
2291 <td class="description">Number of destinations</td></tr>
2292<tr><th>dests</th>
2293 <td class="description">Destinations</td></tr>
2294</tbody></table>
798d6e29
MS
2295<h4 class="returnvalue">Return Value</h4>
2296 <p class="description">New number of destinations</p>
2297<h4 class="discussion">Discussion</h4>
2298 <p class="discussion">Removing a destination/instance does not delete the class or printer
2299queue, merely the lpoptions for that destination/instance. Use the
2300<a href="#cupsSetDests"><code>cupsSetDests</code></a> or <a href="#cupsSetDests2"><code>cupsSetDests2</code></a> functions to save the new
2301options for the user.
2302
2303</p>
2304<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsRemoveOption">cupsRemoveOption</a></h3>
2305 <p class="description">Remove an option from an option array.</p>
2306<p class="code">
98d88c8d
MS
2307int cupsRemoveOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
2308<h4 class="parameters">Parameters</h4>
2309<table class="list"><tbody>
2310<tr><th>name</th>
2311 <td class="description">Option name</td></tr>
2312<tr><th>num_options</th>
2313 <td class="description">Current number of options</td></tr>
2314<tr><th>options</th>
2315 <td class="description">Options</td></tr>
2316</tbody></table>
798d6e29
MS
2317<h4 class="returnvalue">Return Value</h4>
2318 <p class="description">New number of options</p>
2319<h3 class="function"><a id="cupsServer">cupsServer</a></h3>
2320 <p class="description">Return the hostname/address of the current server.</p>
2321<p class="code">
98d88c8d 2322const char *cupsServer(void);</p>
798d6e29
MS
2323<h4 class="returnvalue">Return Value</h4>
2324 <p class="description">Server name</p>
2325<h4 class="discussion">Discussion</h4>
2326 <p class="discussion">The default server comes from the CUPS_SERVER environment variable, then the
2327~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not
2328set, the default is the local system - either &quot;localhost&quot; or a domain socket
2329path.<br>
2330<br>
2331The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6
2332address, or a domain socket pathname.<br>
2333<br>
2334Note: The current server is tracked separately for each thread in a program.
2335Multi-threaded programs that override the server via the
2336<a href="#cupsSetServer"><code>cupsSetServer</code></a> function need to do so in each thread for the same
2337server to be used.</p>
98d88c8d
MS
2338<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetClientCertCB">cupsSetClientCertCB</a></h3>
2339 <p class="description">Set the client certificate callback.</p>
798d6e29 2340<p class="code">
98d88c8d 2341void cupsSetClientCertCB(<a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a> cb, void *user_data);</p>
798d6e29 2342<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2343<table class="list"><tbody>
2344<tr><th>cb</th>
2345 <td class="description">Callback function</td></tr>
2346<tr><th>user_data</th>
2347 <td class="description">User data pointer</td></tr>
2348</tbody></table>
2349<h4 class="discussion">Discussion</h4>
798d6e29
MS
2350 <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
2351<br>
2352Note: The current certificate callback is tracked separately for each thread
2353in a program. Multi-threaded programs that override the callback need to do
2354so in each thread for the same callback to be used.
2355
2356</p>
2357<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetCredentials">cupsSetCredentials</a></h3>
2358 <p class="description">Set the default credentials to be used for SSL/TLS
2359connections.</p>
2360<p class="code">
98d88c8d 2361int cupsSetCredentials(cups_array_t *credentials);</p>
798d6e29 2362<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2363<table class="list"><tbody>
2364<tr><th>credentials</th>
2365 <td class="description">Array of credentials</td></tr>
2366</tbody></table>
798d6e29
MS
2367<h4 class="returnvalue">Return Value</h4>
2368 <p class="description">Status of call (0 = success)</p>
2369<h4 class="discussion">Discussion</h4>
2370 <p class="discussion">Note: The default credentials are tracked separately for each thread in a
2371program. Multi-threaded programs that override the setting need to do so in
2372each thread for the same setting to be used.
2373
2374</p>
98d88c8d 2375<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsSetDefaultDest">cupsSetDefaultDest</a></h3>
53af7f21 2376 <p class="description">Set the default destination.</p>
98d88c8d
MS
2377<p class="code">
2378void cupsSetDefaultDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
2379<h4 class="parameters">Parameters</h4>
2380<table class="list"><tbody>
2381<tr><th>name</th>
2382 <td class="description">Destination name</td></tr>
2383<tr><th>instance</th>
2384 <td class="description">Instance name or <code>NULL</code></td></tr>
2385<tr><th>num_dests</th>
2386 <td class="description">Number of destinations</td></tr>
2387<tr><th>dests</th>
2388 <td class="description">Destinations</td></tr>
2389</tbody></table>
798d6e29
MS
2390<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsSetDests2">cupsSetDests2</a></h3>
2391 <p class="description">Save the list of destinations for the specified server.</p>
2392<p class="code">
98d88c8d
MS
2393int cupsSetDests2(<a href="#http_t">http_t</a> *http, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
2394<h4 class="parameters">Parameters</h4>
2395<table class="list"><tbody>
2396<tr><th>http</th>
2397 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
2398<tr><th>num_dests</th>
2399 <td class="description">Number of destinations</td></tr>
2400<tr><th>dests</th>
2401 <td class="description">Destinations</td></tr>
2402</tbody></table>
798d6e29
MS
2403<h4 class="returnvalue">Return Value</h4>
2404 <p class="description">0 on success, -1 on error</p>
2405<h4 class="discussion">Discussion</h4>
2406 <p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run
2407as root and ~/.cups/lpoptions when run as a normal user.
2408
2409</p>
2410<h3 class="function"><a id="cupsSetEncryption">cupsSetEncryption</a></h3>
98d88c8d 2411 <p class="description">Set the encryption preference.</p>
798d6e29 2412<p class="code">
98d88c8d 2413void cupsSetEncryption(<a href="#http_encryption_t">http_encryption_t</a> e);</p>
798d6e29 2414<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2415<table class="list"><tbody>
2416<tr><th>e</th>
2417 <td class="description">New encryption preference</td></tr>
2418</tbody></table>
2419<h4 class="discussion">Discussion</h4>
798d6e29
MS
2420 <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
2421environment variable, then the ~/.cups/client.conf file, and finally the
2422/etc/cups/client.conf file. If not set, the default is
2423<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
2424<br>
2425Note: The current encryption setting is tracked separately for each thread
2426in a program. Multi-threaded programs that override the setting need to do
2427so in each thread for the same setting to be used.</p>
98d88c8d
MS
2428<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsSetPasswordCB2">cupsSetPasswordCB2</a></h3>
2429 <p class="description">Set the advanced password callback for CUPS.</p>
798d6e29 2430<p class="code">
98d88c8d 2431void cupsSetPasswordCB2(<a href="#cups_password_cb2_t">cups_password_cb2_t</a> cb, void *user_data);</p>
798d6e29 2432<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2433<table class="list"><tbody>
2434<tr><th>cb</th>
2435 <td class="description">Callback function</td></tr>
2436<tr><th>user_data</th>
2437 <td class="description">User data pointer</td></tr>
2438</tbody></table>
2439<h4 class="discussion">Discussion</h4>
798d6e29
MS
2440 <p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which
2441reads the password from the console. Programs should call either this
2442function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered
2443by a program per thread.<br>
2444<br>
2445Note: The current password callback is tracked separately for each thread
2446in a program. Multi-threaded programs that override the callback need to do
2447so in each thread for the same callback to be used.
2448
2449</p>
2450<h3 class="function"><a id="cupsSetServer">cupsSetServer</a></h3>
98d88c8d 2451 <p class="description">Set the default server name and port.</p>
798d6e29 2452<p class="code">
98d88c8d 2453void cupsSetServer(const char *server);</p>
798d6e29 2454<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2455<table class="list"><tbody>
2456<tr><th>server</th>
2457 <td class="description">Server name</td></tr>
2458</tbody></table>
2459<h4 class="discussion">Discussion</h4>
798d6e29
MS
2460 <p class="discussion">The &quot;server&quot; string can be a fully-qualified hostname, a numeric
2461IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP
2462addresses can be optionally followed by a colon and port number to override
2463the default port 631, e.g. &quot;hostname:8631&quot;. Pass <code>NULL</code> to restore the
2464default server name and port.<br>
2465<br>
2466Note: The current server is tracked separately for each thread in a program.
2467Multi-threaded programs that override the server need to do so in each
2468thread for the same server to be used.</p>
98d88c8d
MS
2469<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetServerCertCB">cupsSetServerCertCB</a></h3>
2470 <p class="description">Set the server certificate callback.</p>
798d6e29 2471<p class="code">
98d88c8d 2472void cupsSetServerCertCB(<a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a> cb, void *user_data);</p>
798d6e29 2473<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2474<table class="list"><tbody>
2475<tr><th>cb</th>
2476 <td class="description">Callback function</td></tr>
2477<tr><th>user_data</th>
2478 <td class="description">User data pointer</td></tr>
2479</tbody></table>
2480<h4 class="discussion">Discussion</h4>
798d6e29
MS
2481 <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
2482<br>
2483Note: The current credentials callback is tracked separately for each thread
2484in a program. Multi-threaded programs that override the callback need to do
2485so in each thread for the same callback to be used.
2486
2487</p>
2488<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsSetServerCredentials">cupsSetServerCredentials</a></h3>
2489 <p class="description">Set the default server credentials.</p>
2490<p class="code">
98d88c8d
MS
2491int cupsSetServerCredentials(const char *path, const char *common_name, int auto_create);</p>
2492<h4 class="parameters">Parameters</h4>
2493<table class="list"><tbody>
2494<tr><th>path</th>
2495 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
2496<tr><th>common_name</th>
2497 <td class="description">Default common name for server</td></tr>
2498<tr><th>auto_create</th>
2499 <td class="description">1 = automatically create self-signed certificates</td></tr>
2500</tbody></table>
798d6e29
MS
2501<h4 class="returnvalue">Return Value</h4>
2502 <p class="description">1 on success, 0 on failure</p>
2503<h4 class="discussion">Discussion</h4>
2504 <p class="discussion">Note: The server credentials are used by all threads in the running process.
2505This function is threadsafe.
2506
2507</p>
2508<h3 class="function"><a id="cupsSetUser">cupsSetUser</a></h3>
98d88c8d 2509 <p class="description">Set the default user name.</p>
798d6e29 2510<p class="code">
98d88c8d 2511void cupsSetUser(const char *user);</p>
798d6e29 2512<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2513<table class="list"><tbody>
2514<tr><th>user</th>
2515 <td class="description">User name</td></tr>
2516</tbody></table>
2517<h4 class="discussion">Discussion</h4>
798d6e29
MS
2518 <p class="discussion">Pass <code>NULL</code> to restore the default user name.<br>
2519<br>
2520Note: The current user name is tracked separately for each thread in a
2521program. Multi-threaded programs that override the user name need to do so
2522in each thread for the same user name to be used.</p>
98d88c8d
MS
2523<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsSetUserAgent">cupsSetUserAgent</a></h3>
2524 <p class="description">Set the default HTTP User-Agent string.</p>
798d6e29 2525<p class="code">
98d88c8d 2526void cupsSetUserAgent(const char *user_agent);</p>
798d6e29 2527<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2528<table class="list"><tbody>
2529<tr><th>user_agent</th>
2530 <td class="description">User-Agent string or <code>NULL</code></td></tr>
2531</tbody></table>
2532<h4 class="discussion">Discussion</h4>
798d6e29
MS
2533 <p class="discussion">Setting the string to NULL forces the default value containing the CUPS
2534version, IPP version, and operating system version and architecture.
2535
2536</p>
2537<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsStartDestDocument">cupsStartDestDocument</a></h3>
2538 <p class="description">Start a new document.</p>
2539<p class="code">
98d88c8d
MS
2540http_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>
2541<h4 class="parameters">Parameters</h4>
2542<table class="list"><tbody>
2543<tr><th>http</th>
2544 <td class="description">Connection to destination</td></tr>
2545<tr><th>dest</th>
2546 <td class="description">Destination</td></tr>
2547<tr><th>info</th>
2548 <td class="description">Destination information</td></tr>
2549<tr><th>job_id</th>
2550 <td class="description">Job ID</td></tr>
2551<tr><th>docname</th>
2552 <td class="description">Document name</td></tr>
2553<tr><th>format</th>
2554 <td class="description">Document format</td></tr>
2555<tr><th>num_options</th>
2556 <td class="description">Number of document options</td></tr>
2557<tr><th>options</th>
2558 <td class="description">Document options</td></tr>
2559<tr><th>last_document</th>
2560 <td class="description">1 if this is the last document</td></tr>
2561</tbody></table>
798d6e29
MS
2562<h4 class="returnvalue">Return Value</h4>
2563 <p class="description">Status of document creation</p>
2564<h4 class="discussion">Discussion</h4>
2565 <p class="discussion">&quot;job_id&quot; is the job ID returned by cupsCreateDestJob. &quot;docname&quot; is the name
2566of the document/file being printed, &quot;format&quot; is the MIME media type for the
2567document (see CUPS_FORMAT_xxx constants), and &quot;num_options&quot; and &quot;options&quot;
2568are the options do be applied to the document. &quot;last_document&quot; should be 1
2569if this is the last document to be submitted in the job. Returns
2570<code>HTTP_CONTINUE</code> on success.
2571
798d6e29
MS
2572</p>
2573<h3 class="function"><a id="cupsUser">cupsUser</a></h3>
2574 <p class="description">Return the current user's name.</p>
2575<p class="code">
98d88c8d 2576const char *cupsUser(void);</p>
798d6e29
MS
2577<h4 class="returnvalue">Return Value</h4>
2578 <p class="description">User name</p>
2579<h4 class="discussion">Discussion</h4>
2580 <p class="discussion">Note: The current user name is tracked separately for each thread in a
2581program. Multi-threaded programs that override the user name with the
2582<a href="#cupsSetUser"><code>cupsSetUser</code></a> function need to do so in each thread for the same user
2583name to be used.</p>
2584<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsUserAgent">cupsUserAgent</a></h3>
2585 <p class="description">Return the default HTTP User-Agent string.</p>
2586<p class="code">
98d88c8d 2587const char *cupsUserAgent(void);</p>
798d6e29
MS
2588<h4 class="returnvalue">Return Value</h4>
2589 <p class="description">User-Agent string</p>
2590<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAcceptConnection">httpAcceptConnection</a></h3>
2591 <p class="description">Accept a new HTTP client connection from the
2592specified listening socket.</p>
2593<p class="code">
98d88c8d 2594<a href="#http_t">http_t</a> *httpAcceptConnection(int fd, int blocking);</p>
798d6e29 2595<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2596<table class="list"><tbody>
2597<tr><th>fd</th>
2598 <td class="description">Listen socket file descriptor</td></tr>
2599<tr><th>blocking</th>
2600 <td class="description">1 if the connection should be
2601blocking, 0 otherwise</td></tr>
2602</tbody></table>
798d6e29
MS
2603<h4 class="returnvalue">Return Value</h4>
2604 <p class="description">HTTP connection or <code>NULL</code></p>
2605<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpAddCredential">httpAddCredential</a></h3>
2606 <p class="description">Allocates and adds a single credential to an array.</p>
2607<p class="code">
98d88c8d
MS
2608int httpAddCredential(cups_array_t *credentials, const void *data, size_t datalen);</p>
2609<h4 class="parameters">Parameters</h4>
2610<table class="list"><tbody>
2611<tr><th>credentials</th>
2612 <td class="description">Credentials array</td></tr>
2613<tr><th>data</th>
2614 <td class="description">PEM-encoded X.509 data</td></tr>
2615<tr><th>datalen</th>
2616 <td class="description">Length of data</td></tr>
2617</tbody></table>
798d6e29
MS
2618<h4 class="returnvalue">Return Value</h4>
2619 <p class="description">0 on success, -1 on error</p>
2620<h4 class="discussion">Discussion</h4>
2621 <p class="discussion">Use <code>cupsArrayNew(NULL, NULL)</code> to create a credentials array.
2622
2623</p>
2624<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrAny">httpAddrAny</a></h3>
2625 <p class="description">Check for the &quot;any&quot; address.</p>
2626<p class="code">
98d88c8d 2627int httpAddrAny(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2628<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2629<table class="list"><tbody>
2630<tr><th>addr</th>
2631 <td class="description">Address to check</td></tr>
2632</tbody></table>
798d6e29
MS
2633<h4 class="returnvalue">Return Value</h4>
2634 <p class="description">1 if &quot;any&quot;, 0 otherwise</p>
2635<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpAddrClose">httpAddrClose</a></h3>
2636 <p class="description">Close a socket created by <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> or
2637<a href="#httpAddrListen"><code>httpAddrListen</code></a>.</p>
2638<p class="code">
98d88c8d 2639int httpAddrClose(<a href="#http_addr_t">http_addr_t</a> *addr, int fd);</p>
798d6e29 2640<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2641<table class="list"><tbody>
2642<tr><th>addr</th>
2643 <td class="description">Listen address or <code>NULL</code></td></tr>
2644<tr><th>fd</th>
2645 <td class="description">Socket file descriptor</td></tr>
2646</tbody></table>
798d6e29
MS
2647<h4 class="returnvalue">Return Value</h4>
2648 <p class="description">0 on success, -1 on failure</p>
2649<h4 class="discussion">Discussion</h4>
98d88c8d
MS
2650 <p class="discussion">Pass <code>NULL</code> for sockets created with <a href="#httpAddrConnect2"><code>httpAddrConnect2</code></a> and the
2651listen address for sockets created with <a href="#httpAddrListen"><code>httpAddrListen</code></a>. This function
2652ensures that domain sockets are removed when closed.
798d6e29
MS
2653
2654</p>
798d6e29
MS
2655<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrConnect2">httpAddrConnect2</a></h3>
2656 <p class="description">Connect to any of the addresses in the list with a
2657timeout and optional cancel.</p>
2658<p class="code">
98d88c8d
MS
2659<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>
2660<h4 class="parameters">Parameters</h4>
2661<table class="list"><tbody>
2662<tr><th>addrlist</th>
2663 <td class="description">List of potential addresses</td></tr>
2664<tr><th>sock</th>
2665 <td class="description">Socket</td></tr>
2666<tr><th>msec</th>
2667 <td class="description">Timeout in milliseconds</td></tr>
2668<tr><th>cancel</th>
2669 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
2670</tbody></table>
798d6e29
MS
2671<h4 class="returnvalue">Return Value</h4>
2672 <p class="description">Connected address or NULL on failure</p>
2673<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrCopyList">httpAddrCopyList</a></h3>
2674 <p class="description">Copy an address list.</p>
2675<p class="code">
98d88c8d 2676<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrCopyList(<a href="#http_addrlist_t">http_addrlist_t</a> *src);</p>
798d6e29 2677<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2678<table class="list"><tbody>
2679<tr><th>src</th>
2680 <td class="description">Source address list</td></tr>
2681</tbody></table>
798d6e29
MS
2682<h4 class="returnvalue">Return Value</h4>
2683 <p class="description">New address list or <code>NULL</code> on error</p>
2684<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrEqual">httpAddrEqual</a></h3>
2685 <p class="description">Compare two addresses.</p>
2686<p class="code">
98d88c8d 2687int 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 2688<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2689<table class="list"><tbody>
2690<tr><th>addr1</th>
2691 <td class="description">First address</td></tr>
2692<tr><th>addr2</th>
2693 <td class="description">Second address</td></tr>
2694</tbody></table>
798d6e29
MS
2695<h4 class="returnvalue">Return Value</h4>
2696 <p class="description">1 if equal, 0 if not</p>
2697<h3 class="function"><a id="httpAddrFamily">httpAddrFamily</a></h3>
2698 <p class="description">Get the address family of an address.</p>
2699<p class="code">
98d88c8d 2700int httpAddrFamily(<a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2701<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2702<table class="list"><tbody>
2703<tr><th>addr</th>
2704 <td class="description">Address</td></tr>
2705</tbody></table>
798d6e29
MS
2706<h4 class="returnvalue">Return Value</h4>
2707 <p class="description">Address family</p>
98d88c8d
MS
2708<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrFreeList">httpAddrFreeList</a></h3>
2709 <p class="description">Free an address list.</p>
798d6e29 2710<p class="code">
98d88c8d 2711void httpAddrFreeList(<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist);</p>
798d6e29 2712<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2713<table class="list"><tbody>
2714<tr><th>addrlist</th>
2715 <td class="description">Address list to free</td></tr>
2716</tbody></table>
798d6e29
MS
2717<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrGetList">httpAddrGetList</a></h3>
2718 <p class="description">Get a list of addresses for a hostname.</p>
2719<p class="code">
98d88c8d
MS
2720<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrGetList(const char *hostname, int family, const char *service);</p>
2721<h4 class="parameters">Parameters</h4>
2722<table class="list"><tbody>
2723<tr><th>hostname</th>
2724 <td class="description">Hostname, IP address, or NULL for passive listen address</td></tr>
2725<tr><th>family</th>
2726 <td class="description">Address family or AF_UNSPEC</td></tr>
2727<tr><th>service</th>
2728 <td class="description">Service name or port number</td></tr>
2729</tbody></table>
798d6e29
MS
2730<h4 class="returnvalue">Return Value</h4>
2731 <p class="description">List of addresses or NULL</p>
2732<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLength">httpAddrLength</a></h3>
2733 <p class="description">Return the length of the address in bytes.</p>
2734<p class="code">
98d88c8d 2735int httpAddrLength(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2736<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2737<table class="list"><tbody>
2738<tr><th>addr</th>
2739 <td class="description">Address</td></tr>
2740</tbody></table>
798d6e29
MS
2741<h4 class="returnvalue">Return Value</h4>
2742 <p class="description">Length in bytes</p>
2743<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrListen">httpAddrListen</a></h3>
2744 <p class="description">Create a listening socket bound to the specified
2745address and port.</p>
2746<p class="code">
98d88c8d 2747int httpAddrListen(<a href="#http_addr_t">http_addr_t</a> *addr, int port);</p>
798d6e29 2748<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2749<table class="list"><tbody>
2750<tr><th>addr</th>
2751 <td class="description">Address to bind to</td></tr>
2752<tr><th>port</th>
2753 <td class="description">Port number to bind to</td></tr>
2754</tbody></table>
798d6e29
MS
2755<h4 class="returnvalue">Return Value</h4>
2756 <p class="description">Socket or -1 on error</p>
2757<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLocalhost">httpAddrLocalhost</a></h3>
2758 <p class="description">Check for the local loopback address.</p>
2759<p class="code">
98d88c8d 2760int httpAddrLocalhost(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2761<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2762<table class="list"><tbody>
2763<tr><th>addr</th>
2764 <td class="description">Address to check</td></tr>
2765</tbody></table>
798d6e29
MS
2766<h4 class="returnvalue">Return Value</h4>
2767 <p class="description">1 if local host, 0 otherwise</p>
2768<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLookup">httpAddrLookup</a></h3>
2769 <p class="description">Lookup the hostname associated with the address.</p>
2770<p class="code">
98d88c8d
MS
2771char *httpAddrLookup(const <a href="#http_addr_t">http_addr_t</a> *addr, char *name, int namelen);</p>
2772<h4 class="parameters">Parameters</h4>
2773<table class="list"><tbody>
2774<tr><th>addr</th>
2775 <td class="description">Address to lookup</td></tr>
2776<tr><th>name</th>
2777 <td class="description">Host name buffer</td></tr>
2778<tr><th>namelen</th>
2779 <td class="description">Size of name buffer</td></tr>
2780</tbody></table>
798d6e29
MS
2781<h4 class="returnvalue">Return Value</h4>
2782 <p class="description">Host name</p>
2783<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrPort">httpAddrPort</a></h3>
2784 <p class="description">Get the port number associated with an address.</p>
2785<p class="code">
98d88c8d 2786int httpAddrPort(<a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2787<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2788<table class="list"><tbody>
2789<tr><th>addr</th>
2790 <td class="description">Address</td></tr>
2791</tbody></table>
798d6e29
MS
2792<h4 class="returnvalue">Return Value</h4>
2793 <p class="description">Port number</p>
2794<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrString">httpAddrString</a></h3>
2795 <p class="description">Convert an address to a numeric string.</p>
2796<p class="code">
98d88c8d
MS
2797char *httpAddrString(const <a href="#http_addr_t">http_addr_t</a> *addr, char *s, int slen);</p>
2798<h4 class="parameters">Parameters</h4>
2799<table class="list"><tbody>
2800<tr><th>addr</th>
2801 <td class="description">Address to convert</td></tr>
2802<tr><th>s</th>
2803 <td class="description">String buffer</td></tr>
2804<tr><th>slen</th>
2805 <td class="description">Length of string</td></tr>
2806</tbody></table>
798d6e29
MS
2807<h4 class="returnvalue">Return Value</h4>
2808 <p class="description">Numeric address string</p>
2809<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAssembleURI">httpAssembleURI</a></h3>
2810 <p class="description">Assemble a uniform resource identifier from its
2811components.</p>
2812<p class="code">
98d88c8d
MS
2813<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>
2814<h4 class="parameters">Parameters</h4>
2815<table class="list"><tbody>
2816<tr><th>encoding</th>
2817 <td class="description">Encoding flags</td></tr>
2818<tr><th>uri</th>
2819 <td class="description">URI buffer</td></tr>
2820<tr><th>urilen</th>
2821 <td class="description">Size of URI buffer</td></tr>
2822<tr><th>scheme</th>
2823 <td class="description">Scheme name</td></tr>
2824<tr><th>username</th>
2825 <td class="description">Username</td></tr>
2826<tr><th>host</th>
2827 <td class="description">Hostname or address</td></tr>
2828<tr><th>port</th>
2829 <td class="description">Port number</td></tr>
2830<tr><th>resource</th>
2831 <td class="description">Resource</td></tr>
2832</tbody></table>
798d6e29
MS
2833<h4 class="returnvalue">Return Value</h4>
2834 <p class="description">URI status</p>
2835<h4 class="discussion">Discussion</h4>
2836 <p class="discussion">This function escapes reserved characters in the URI depending on the
2837value of the &quot;encoding&quot; argument. You should use this function in
2838place of traditional string functions whenever you need to create a
2839URI string.
2840
2841</p>
2842<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAssembleURIf">httpAssembleURIf</a></h3>
2843 <p class="description">Assemble a uniform resource identifier from its
2844components with a formatted resource.</p>
2845<p class="code">
98d88c8d
MS
2846<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>
2847<h4 class="parameters">Parameters</h4>
2848<table class="list"><tbody>
2849<tr><th>encoding</th>
2850 <td class="description">Encoding flags</td></tr>
2851<tr><th>uri</th>
2852 <td class="description">URI buffer</td></tr>
2853<tr><th>urilen</th>
2854 <td class="description">Size of URI buffer</td></tr>
2855<tr><th>scheme</th>
2856 <td class="description">Scheme name</td></tr>
2857<tr><th>username</th>
2858 <td class="description">Username</td></tr>
2859<tr><th>host</th>
2860 <td class="description">Hostname or address</td></tr>
2861<tr><th>port</th>
2862 <td class="description">Port number</td></tr>
2863<tr><th>resourcef</th>
2864 <td class="description">Printf-style resource</td></tr>
2865<tr><th>...</th>
2866 <td class="description">Additional arguments as needed</td></tr>
2867</tbody></table>
798d6e29
MS
2868<h4 class="returnvalue">Return Value</h4>
2869 <p class="description">URI status</p>
2870<h4 class="discussion">Discussion</h4>
2871 <p class="discussion">This function creates a formatted version of the resource string
2872argument &quot;resourcef&quot; and escapes reserved characters in the URI
2873depending on the value of the &quot;encoding&quot; argument. You should use
2874this function in place of traditional string functions whenever
2875you need to create a URI string.
2876
2877</p>
2878<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAssembleUUID">httpAssembleUUID</a></h3>
2879 <p class="description">Assemble a name-based UUID URN conforming to RFC 4122.</p>
2880<p class="code">
98d88c8d
MS
2881char *httpAssembleUUID(const char *server, int port, const char *name, int number, char *buffer, size_t bufsize);</p>
2882<h4 class="parameters">Parameters</h4>
2883<table class="list"><tbody>
2884<tr><th>server</th>
2885 <td class="description">Server name</td></tr>
2886<tr><th>port</th>
2887 <td class="description">Port number</td></tr>
2888<tr><th>name</th>
2889 <td class="description">Object name or NULL</td></tr>
2890<tr><th>number</th>
2891 <td class="description">Object number or 0</td></tr>
2892<tr><th>buffer</th>
2893 <td class="description">String buffer</td></tr>
2894<tr><th>bufsize</th>
2895 <td class="description">Size of buffer</td></tr>
2896</tbody></table>
798d6e29
MS
2897<h4 class="returnvalue">Return Value</h4>
2898 <p class="description">UUID string</p>
2899<h4 class="discussion">Discussion</h4>
2900 <p class="discussion">This function creates a unique 128-bit identifying number using the server
2901name, port number, random data, and optionally an object name and/or object
2902number. The result is formatted as a UUID URN as defined in RFC 4122.<br>
2903<br>
2904The buffer needs to be at least 46 bytes in size.
2905
2906</p>
2907<h3 class="function"><a id="httpBlocking">httpBlocking</a></h3>
98d88c8d 2908 <p class="description">Set blocking/non-blocking behavior on a connection.</p>
798d6e29 2909<p class="code">
98d88c8d 2910void httpBlocking(<a href="#http_t">http_t</a> *http, int b);</p>
798d6e29 2911<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2912<table class="list"><tbody>
2913<tr><th>http</th>
2914 <td class="description">HTTP connection</td></tr>
2915<tr><th>b</th>
2916 <td class="description">1 = blocking, 0 = non-blocking</td></tr>
2917</tbody></table>
798d6e29
MS
2918<h3 class="function"><a id="httpCheck">httpCheck</a></h3>
2919 <p class="description">Check to see if there is a pending response from the server.</p>
2920<p class="code">
98d88c8d 2921int httpCheck(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2922<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2923<table class="list"><tbody>
2924<tr><th>http</th>
2925 <td class="description">HTTP connection</td></tr>
2926</tbody></table>
798d6e29
MS
2927<h4 class="returnvalue">Return Value</h4>
2928 <p class="description">0 = no data, 1 = data available</p>
98d88c8d
MS
2929<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpClearCookie">httpClearCookie</a></h3>
2930 <p class="description">Clear the cookie value(s).</p>
798d6e29 2931<p class="code">
98d88c8d 2932void httpClearCookie(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2933<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2934<table class="list"><tbody>
2935<tr><th>http</th>
2936 <td class="description">HTTP connection</td></tr>
2937</tbody></table>
798d6e29 2938<h3 class="function"><a id="httpClearFields">httpClearFields</a></h3>
98d88c8d 2939 <p class="description">Clear HTTP request fields.</p>
798d6e29 2940<p class="code">
98d88c8d 2941void httpClearFields(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2942<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2943<table class="list"><tbody>
2944<tr><th>http</th>
2945 <td class="description">HTTP connection</td></tr>
2946</tbody></table>
798d6e29 2947<h3 class="function"><a id="httpClose">httpClose</a></h3>
98d88c8d 2948 <p class="description">Close an HTTP connection.</p>
798d6e29 2949<p class="code">
98d88c8d 2950void httpClose(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2951<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2952<table class="list"><tbody>
2953<tr><th>http</th>
2954 <td class="description">HTTP connection</td></tr>
2955</tbody></table>
798d6e29
MS
2956<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpCompareCredentials">httpCompareCredentials</a></h3>
2957 <p class="description">Compare two sets of X.509 credentials.</p>
2958<p class="code">
98d88c8d 2959int httpCompareCredentials(cups_array_t *cred1, cups_array_t *cred2);</p>
798d6e29 2960<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2961<table class="list"><tbody>
2962<tr><th>cred1</th>
2963 <td class="description">First set of X.509 credentials</td></tr>
2964<tr><th>cred2</th>
2965 <td class="description">Second set of X.509 credentials</td></tr>
2966</tbody></table>
53af7f21
MS
2967<h4 class="returnvalue">Return Value</h4>
2968 <p class="description">1 if they match, 0 if they do not</p>
798d6e29
MS
2969<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpConnect2">httpConnect2</a></h3>
2970 <p class="description">Connect to a HTTP server.</p>
2971<p class="code">
98d88c8d
MS
2972<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>
2973<h4 class="parameters">Parameters</h4>
2974<table class="list"><tbody>
2975<tr><th>host</th>
2976 <td class="description">Host to connect to</td></tr>
2977<tr><th>port</th>
2978 <td class="description">Port number</td></tr>
2979<tr><th>addrlist</th>
65bebeac 2980 <td class="description">List of addresses or <code>NULL</code> to lookup</td></tr>
98d88c8d
MS
2981<tr><th>family</th>
2982 <td class="description">Address family to use or <code>AF_UNSPEC</code> for any</td></tr>
2983<tr><th>encryption</th>
2984 <td class="description">Type of encryption to use</td></tr>
2985<tr><th>blocking</th>
2986 <td class="description">1 for blocking connection, 0 for non-blocking</td></tr>
2987<tr><th>msec</th>
2988 <td class="description">Connection timeout in milliseconds, 0 means don't connect</td></tr>
2989<tr><th>cancel</th>
2990 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
2991</tbody></table>
798d6e29
MS
2992<h4 class="returnvalue">Return Value</h4>
2993 <p class="description">New HTTP connection</p>
798d6e29
MS
2994<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpCopyCredentials">httpCopyCredentials</a></h3>
2995 <p class="description">Copy the credentials associated with the peer in
2996an encrypted connection.</p>
2997<p class="code">
98d88c8d 2998int httpCopyCredentials(<a href="#http_t">http_t</a> *http, cups_array_t **credentials);</p>
798d6e29 2999<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3000<table class="list"><tbody>
3001<tr><th>http</th>
3002 <td class="description">Connection to server</td></tr>
3003<tr><th>credentials</th>
3004 <td class="description">Array of credentials</td></tr>
3005</tbody></table>
798d6e29
MS
3006<h4 class="returnvalue">Return Value</h4>
3007 <p class="description">Status of call (0 = success)</p>
3008<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></h3>
3009 <p class="description">Return whether the credentials are valid for the given name.</p>
3010<p class="code">
98d88c8d 3011int httpCredentialsAreValidForName(cups_array_t *credentials, const char *common_name);</p>
798d6e29 3012<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3013<table class="list"><tbody>
3014<tr><th>credentials</th>
3015 <td class="description">Credentials</td></tr>
3016<tr><th>common_name</th>
3017 <td class="description">Name to check</td></tr>
3018</tbody></table>
798d6e29
MS
3019<h4 class="returnvalue">Return Value</h4>
3020 <p class="description">1 if valid, 0 otherwise</p>
3021<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></h3>
3022 <p class="description">Return the expiration date of the credentials.</p>
3023<p class="code">
98d88c8d 3024time_t httpCredentialsGetExpiration(cups_array_t *credentials);</p>
798d6e29 3025<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3026<table class="list"><tbody>
3027<tr><th>credentials</th>
3028 <td class="description">Credentials</td></tr>
3029</tbody></table>
798d6e29
MS
3030<h4 class="returnvalue">Return Value</h4>
3031 <p class="description">Expiration date of credentials</p>
3032<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsGetTrust">httpCredentialsGetTrust</a></h3>
3033 <p class="description">Return the trust of credentials.</p>
3034<p class="code">
98d88c8d 3035<a href="#http_trust_t">http_trust_t</a> httpCredentialsGetTrust(cups_array_t *credentials, const char *common_name);</p>
798d6e29 3036<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3037<table class="list"><tbody>
3038<tr><th>credentials</th>
3039 <td class="description">Credentials</td></tr>
3040<tr><th>common_name</th>
3041 <td class="description">Common name for trust lookup</td></tr>
3042</tbody></table>
798d6e29
MS
3043<h4 class="returnvalue">Return Value</h4>
3044 <p class="description">Level of trust</p>
3045<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsString">httpCredentialsString</a></h3>
3046 <p class="description">Return a string representing the credentials.</p>
3047<p class="code">
98d88c8d
MS
3048size_t httpCredentialsString(cups_array_t *credentials, char *buffer, size_t bufsize);</p>
3049<h4 class="parameters">Parameters</h4>
3050<table class="list"><tbody>
3051<tr><th>credentials</th>
3052 <td class="description">Credentials</td></tr>
3053<tr><th>buffer</th>
3054 <td class="description">Buffer or <code>NULL</code></td></tr>
3055<tr><th>bufsize</th>
3056 <td class="description">Size of buffer</td></tr>
3057</tbody></table>
798d6e29
MS
3058<h4 class="returnvalue">Return Value</h4>
3059 <p class="description">Total size of credentials string</p>
798d6e29
MS
3060<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="httpDecode64_2">httpDecode64_2</a></h3>
3061 <p class="description">Base64-decode a string.</p>
3062<p class="code">
98d88c8d
MS
3063char *httpDecode64_2(char *out, int *outlen, const char *in);</p>
3064<h4 class="parameters">Parameters</h4>
3065<table class="list"><tbody>
3066<tr><th>out</th>
3067 <td class="description">String to write to</td></tr>
3068<tr><th>outlen</th>
3069 <td class="description">Size of output string</td></tr>
3070<tr><th>in</th>
3071 <td class="description">String to read from</td></tr>
3072</tbody></table>
798d6e29
MS
3073<h4 class="returnvalue">Return Value</h4>
3074 <p class="description">Decoded string</p>
98d88c8d
MS
3075<h4 class="discussion">Discussion</h4>
3076 <p class="discussion">The caller must initialize &quot;outlen&quot; to the maximum size of the decoded
65bebeac 3077string before calling <code>httpDecode64_2</code>. On return &quot;outlen&quot; contains the
98d88c8d
MS
3078decoded length of the string.
3079
3080</p>
798d6e29
MS
3081<h3 class="function"><a id="httpDelete">httpDelete</a></h3>
3082 <p class="description">Send a DELETE request to the server.</p>
3083<p class="code">
98d88c8d 3084int httpDelete(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3085<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3086<table class="list"><tbody>
3087<tr><th>http</th>
3088 <td class="description">HTTP connection</td></tr>
3089<tr><th>uri</th>
3090 <td class="description">URI to delete</td></tr>
3091</tbody></table>
798d6e29
MS
3092<h4 class="returnvalue">Return Value</h4>
3093 <p class="description">Status of call (0 = success)</p>
798d6e29
MS
3094<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="httpEncode64_2">httpEncode64_2</a></h3>
3095 <p class="description">Base64-encode a string.</p>
3096<p class="code">
98d88c8d
MS
3097char *httpEncode64_2(char *out, int outlen, const char *in, int inlen);</p>
3098<h4 class="parameters">Parameters</h4>
3099<table class="list"><tbody>
3100<tr><th>out</th>
3101 <td class="description">String to write to</td></tr>
3102<tr><th>outlen</th>
3103 <td class="description">Maximum size of output string</td></tr>
3104<tr><th>in</th>
3105 <td class="description">String to read from</td></tr>
3106<tr><th>inlen</th>
3107 <td class="description">Size of input string</td></tr>
3108</tbody></table>
798d6e29
MS
3109<h4 class="returnvalue">Return Value</h4>
3110 <p class="description">Encoded string</p>
3111<h3 class="function"><a id="httpEncryption">httpEncryption</a></h3>
3112 <p class="description">Set the required encryption on the link.</p>
3113<p class="code">
98d88c8d 3114int httpEncryption(<a href="#http_t">http_t</a> *http, <a href="#http_encryption_t">http_encryption_t</a> e);</p>
798d6e29 3115<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3116<table class="list"><tbody>
3117<tr><th>http</th>
3118 <td class="description">HTTP connection</td></tr>
3119<tr><th>e</th>
3120 <td class="description">New encryption preference</td></tr>
3121</tbody></table>
798d6e29
MS
3122<h4 class="returnvalue">Return Value</h4>
3123 <p class="description">-1 on error, 0 on success</p>
3124<h3 class="function"><a id="httpError">httpError</a></h3>
3125 <p class="description">Get the last error on a connection.</p>
3126<p class="code">
98d88c8d 3127int httpError(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3128<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3129<table class="list"><tbody>
3130<tr><th>http</th>
3131 <td class="description">HTTP connection</td></tr>
3132</tbody></table>
798d6e29
MS
3133<h4 class="returnvalue">Return Value</h4>
3134 <p class="description">Error code (errno) value</p>
3135<h3 class="function"><a id="httpFieldValue">httpFieldValue</a></h3>
3136 <p class="description">Return the HTTP field enumeration value for a field
3137name.</p>
3138<p class="code">
98d88c8d 3139<a href="#http_field_t">http_field_t</a> httpFieldValue(const char *name);</p>
798d6e29 3140<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3141<table class="list"><tbody>
3142<tr><th>name</th>
3143 <td class="description">String name</td></tr>
3144</tbody></table>
798d6e29
MS
3145<h4 class="returnvalue">Return Value</h4>
3146 <p class="description">Field index</p>
3147<h3 class="function"><a id="httpFlush">httpFlush</a></h3>
65bebeac 3148 <p class="description">Flush data read from a HTTP connection.</p>
798d6e29 3149<p class="code">
98d88c8d 3150void httpFlush(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3151<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3152<table class="list"><tbody>
3153<tr><th>http</th>
3154 <td class="description">HTTP connection</td></tr>
3155</tbody></table>
798d6e29 3156<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpFlushWrite">httpFlushWrite</a></h3>
65bebeac 3157 <p class="description">Flush data written to a HTTP connection.</p>
798d6e29 3158<p class="code">
98d88c8d 3159int httpFlushWrite(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3160<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3161<table class="list"><tbody>
3162<tr><th>http</th>
3163 <td class="description">HTTP connection</td></tr>
3164</tbody></table>
798d6e29
MS
3165<h4 class="returnvalue">Return Value</h4>
3166 <p class="description">Bytes written or -1 on error</p>
3167<h3 class="function"><a id="httpFreeCredentials">httpFreeCredentials</a></h3>
98d88c8d 3168 <p class="description">Free an array of credentials.</p>
798d6e29 3169<p class="code">
98d88c8d 3170void httpFreeCredentials(cups_array_t *credentials);</p>
798d6e29 3171<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3172<table class="list"><tbody>
3173<tr><th>credentials</th>
3174 <td class="description">Array of credentials</td></tr>
3175</tbody></table>
798d6e29
MS
3176<h3 class="function"><a id="httpGet">httpGet</a></h3>
3177 <p class="description">Send a GET request to the server.</p>
3178<p class="code">
98d88c8d 3179int httpGet(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3180<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3181<table class="list"><tbody>
3182<tr><th>http</th>
3183 <td class="description">HTTP connection</td></tr>
3184<tr><th>uri</th>
3185 <td class="description">URI to get</td></tr>
3186</tbody></table>
798d6e29
MS
3187<h4 class="returnvalue">Return Value</h4>
3188 <p class="description">Status of call (0 = success)</p>
3189<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetActivity">httpGetActivity</a></h3>
3190 <p class="description">Get the most recent activity for a connection.</p>
3191<p class="code">
98d88c8d 3192time_t httpGetActivity(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3193<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3194<table class="list"><tbody>
3195<tr><th>http</th>
3196 <td class="description">HTTP connection</td></tr>
3197</tbody></table>
798d6e29
MS
3198<h4 class="returnvalue">Return Value</h4>
3199 <p class="description">Time of last read or write</p>
3200<h4 class="discussion">Discussion</h4>
65bebeac 3201 <p class="discussion">The return value is the time in seconds of the last read or write.
798d6e29
MS
3202
3203</p>
3204<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetAddress">httpGetAddress</a></h3>
3205 <p class="description">Get the address of the connected peer of a connection.</p>
3206<p class="code">
98d88c8d 3207<a href="#http_addr_t">http_addr_t</a> *httpGetAddress(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3208<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3209<table class="list"><tbody>
3210<tr><th>http</th>
3211 <td class="description">HTTP connection</td></tr>
3212</tbody></table>
798d6e29
MS
3213<h4 class="returnvalue">Return Value</h4>
3214 <p class="description">Connected address or <code>NULL</code></p>
3215<h4 class="discussion">Discussion</h4>
65bebeac
MS
3216 <p class="discussion">For connections created with <a href="#httpConnect2"><code>httpConnect2</code></a>, the address is for the
3217server. For connections created with <a href="#httpAccept"><code>httpAccept</code></a>, the address is for
3218the client.<br>
3219<br>
3220Returns <code>NULL</code> if the socket is currently unconnected.
798d6e29
MS
3221
3222</p>
3223<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="httpGetAuthString">httpGetAuthString</a></h3>
3224 <p class="description">Get the current authorization string.</p>
3225<p class="code">
98d88c8d 3226char *httpGetAuthString(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3227<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3228<table class="list"><tbody>
3229<tr><th>http</th>
3230 <td class="description">HTTP connection</td></tr>
3231</tbody></table>
798d6e29
MS
3232<h4 class="returnvalue">Return Value</h4>
3233 <p class="description">Authorization string</p>
3234<h4 class="discussion">Discussion</h4>
65bebeac
MS
3235 <p class="discussion">The authorization string is set by <a href="#cupsDoAuthentication"><code>cupsDoAuthentication</code></a> and
3236<a href="#httpSetAuthString"><code>httpSetAuthString</code></a>. Use <a href="#httpGetAuthString"><code>httpGetAuthString</code></a> to retrieve the
3237string to use with <a href="#httpSetField"><code>httpSetField</code></a> for the
3238<code>HTTP_FIELD_AUTHORIZATION</code> value.
798d6e29
MS
3239
3240</p>
3241<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetBlocking">httpGetBlocking</a></h3>
3242 <p class="description">Get the blocking/non-block state of a connection.</p>
3243<p class="code">
98d88c8d 3244int httpGetBlocking(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3245<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3246<table class="list"><tbody>
3247<tr><th>http</th>
3248 <td class="description">HTTP connection</td></tr>
3249</tbody></table>
798d6e29
MS
3250<h4 class="returnvalue">Return Value</h4>
3251 <p class="description">1 if blocking, 0 if non-blocking</p>
3252<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpGetContentEncoding">httpGetContentEncoding</a></h3>
3253 <p class="description">Get a common content encoding, if any, between
3254the client and server.</p>
3255<p class="code">
98d88c8d 3256const char *httpGetContentEncoding(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3257<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3258<table class="list"><tbody>
3259<tr><th>http</th>
3260 <td class="description">HTTP connection</td></tr>
3261</tbody></table>
798d6e29
MS
3262<h4 class="returnvalue">Return Value</h4>
3263 <p class="description">Content-Coding value or
3264<code>NULL</code> for the identity
3265coding.</p>
3266<h4 class="discussion">Discussion</h4>
3267 <p class="discussion">This function uses the value of the Accepts-Encoding HTTP header and must be
3268called after receiving a response from the server or a request from the
3269client. The value returned can be use in subsequent requests (for clients)
3270or in the response (for servers) in order to compress the content stream.
3271
3272</p>
3273<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpGetCookie">httpGetCookie</a></h3>
3274 <p class="description">Get any cookie data from the response.</p>
3275<p class="code">
98d88c8d 3276const char *httpGetCookie(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3277<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3278<table class="list"><tbody>
3279<tr><th>http</th>
3280 <td class="description">HTTP connection</td></tr>
3281</tbody></table>
798d6e29 3282<h4 class="returnvalue">Return Value</h4>
65bebeac 3283 <p class="description">Cookie data or <code>NULL</code></p>
798d6e29
MS
3284<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetDateString2">httpGetDateString2</a></h3>
3285 <p class="description">Get a formatted date/time string from a time value.</p>
3286<p class="code">
98d88c8d
MS
3287const char *httpGetDateString2(time_t t, char *s, int slen);</p>
3288<h4 class="parameters">Parameters</h4>
3289<table class="list"><tbody>
3290<tr><th>t</th>
65bebeac 3291 <td class="description">Time in seconds</td></tr>
98d88c8d
MS
3292<tr><th>s</th>
3293 <td class="description">String buffer</td></tr>
3294<tr><th>slen</th>
3295 <td class="description">Size of string buffer</td></tr>
3296</tbody></table>
798d6e29
MS
3297<h4 class="returnvalue">Return Value</h4>
3298 <p class="description">Date/time string</p>
3299<h3 class="function"><a id="httpGetDateTime">httpGetDateTime</a></h3>
3300 <p class="description">Get a time value from a formatted date/time string.</p>
3301<p class="code">
98d88c8d 3302time_t httpGetDateTime(const char *s);</p>
798d6e29 3303<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3304<table class="list"><tbody>
3305<tr><th>s</th>
3306 <td class="description">Date/time string</td></tr>
3307</tbody></table>
798d6e29 3308<h4 class="returnvalue">Return Value</h4>
65bebeac 3309 <p class="description">Time in seconds</p>
798d6e29
MS
3310<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetEncryption">httpGetEncryption</a></h3>
3311 <p class="description">Get the current encryption mode of a connection.</p>
3312<p class="code">
98d88c8d 3313<a href="#http_encryption_t">http_encryption_t</a> httpGetEncryption(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3314<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3315<table class="list"><tbody>
3316<tr><th>http</th>
3317 <td class="description">HTTP connection</td></tr>
3318</tbody></table>
798d6e29
MS
3319<h4 class="returnvalue">Return Value</h4>
3320 <p class="description">Current encryption mode</p>
3321<h4 class="discussion">Discussion</h4>
3322 <p class="discussion">This function returns the encryption mode for the connection. Use the
3323<a href="#httpIsEncrypted"><code>httpIsEncrypted</code></a> function to determine whether a TLS session has
3324been established.
3325
3326</p>
3327<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpGetExpect">httpGetExpect</a></h3>
3328 <p class="description">Get the value of the Expect header, if any.</p>
3329<p class="code">
98d88c8d 3330http_status_t httpGetExpect(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3331<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3332<table class="list"><tbody>
3333<tr><th>http</th>
3334 <td class="description">HTTP connection</td></tr>
3335</tbody></table>
798d6e29
MS
3336<h4 class="returnvalue">Return Value</h4>
3337 <p class="description">Expect: status, if any</p>
3338<h4 class="discussion">Discussion</h4>
3339 <p class="discussion">Returns <code>HTTP_STATUS_NONE</code> if there is no Expect header, otherwise
3340returns the expected HTTP status code, typically <code>HTTP_STATUS_CONTINUE</code>.
3341
3342</p>
3343<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetFd">httpGetFd</a></h3>
3344 <p class="description">Get the file descriptor associated with a connection.</p>
3345<p class="code">
98d88c8d 3346int httpGetFd(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3347<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3348<table class="list"><tbody>
3349<tr><th>http</th>
3350 <td class="description">HTTP connection</td></tr>
3351</tbody></table>
798d6e29
MS
3352<h4 class="returnvalue">Return Value</h4>
3353 <p class="description">File descriptor or -1 if none</p>
3354<h3 class="function"><a id="httpGetField">httpGetField</a></h3>
3355 <p class="description">Get a field value from a request/response.</p>
3356<p class="code">
98d88c8d 3357const char *httpGetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field);</p>
798d6e29 3358<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3359<table class="list"><tbody>
3360<tr><th>http</th>
3361 <td class="description">HTTP connection</td></tr>
3362<tr><th>field</th>
3363 <td class="description">Field to get</td></tr>
3364</tbody></table>
798d6e29
MS
3365<h4 class="returnvalue">Return Value</h4>
3366 <p class="description">Field value</p>
798d6e29
MS
3367<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetHostname">httpGetHostname</a></h3>
3368 <p class="description">Get the FQDN for the connection or local system.</p>
3369<p class="code">
98d88c8d
MS
3370const char *httpGetHostname(<a href="#http_t">http_t</a> *http, char *s, int slen);</p>
3371<h4 class="parameters">Parameters</h4>
3372<table class="list"><tbody>
3373<tr><th>http</th>
3374 <td class="description">HTTP connection or NULL</td></tr>
3375<tr><th>s</th>
3376 <td class="description">String buffer for name</td></tr>
3377<tr><th>slen</th>
3378 <td class="description">Size of buffer</td></tr>
3379</tbody></table>
798d6e29
MS
3380<h4 class="returnvalue">Return Value</h4>
3381 <p class="description">FQDN for connection or system</p>
3382<h4 class="discussion">Discussion</h4>
3383 <p class="discussion">When &quot;http&quot; points to a connected socket, return the hostname or
3384address that was used in the call to httpConnect() or httpConnectEncrypt(),
3385or the address of the client for the connection from httpAcceptConnection().
3386Otherwise, return the FQDN for the local system using both gethostname()
3387and gethostbyname() to get the local hostname with domain.
3388
3389</p>
3390<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetKeepAlive">httpGetKeepAlive</a></h3>
3391 <p class="description">Get the current Keep-Alive state of the connection.</p>
3392<p class="code">
98d88c8d 3393<a href="#http_keepalive_t">http_keepalive_t</a> httpGetKeepAlive(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3394<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3395<table class="list"><tbody>
3396<tr><th>http</th>
3397 <td class="description">HTTP connection</td></tr>
3398</tbody></table>
798d6e29
MS
3399<h4 class="returnvalue">Return Value</h4>
3400 <p class="description">Keep-Alive state</p>
798d6e29
MS
3401<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetLength2">httpGetLength2</a></h3>
3402 <p class="description">Get the amount of data remaining from the
3403content-length or transfer-encoding fields.</p>
3404<p class="code">
98d88c8d 3405off_t httpGetLength2(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3406<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3407<table class="list"><tbody>
3408<tr><th>http</th>
3409 <td class="description">HTTP connection</td></tr>
3410</tbody></table>
798d6e29
MS
3411<h4 class="returnvalue">Return Value</h4>
3412 <p class="description">Content length</p>
3413<h4 class="discussion">Discussion</h4>
3414 <p class="discussion">This function returns the complete content length, even for
3415content larger than 2^31 - 1.
3416
3417</p>
3418<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetPending">httpGetPending</a></h3>
3419 <p class="description">Get the number of bytes that are buffered for writing.</p>
3420<p class="code">
98d88c8d 3421size_t httpGetPending(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3422<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3423<table class="list"><tbody>
3424<tr><th>http</th>
3425 <td class="description">HTTP connection</td></tr>
3426</tbody></table>
798d6e29
MS
3427<h4 class="returnvalue">Return Value</h4>
3428 <p class="description">Number of bytes buffered</p>
3429<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetReady">httpGetReady</a></h3>
3430 <p class="description">Get the number of bytes that can be read without blocking.</p>
3431<p class="code">
98d88c8d 3432size_t httpGetReady(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3433<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3434<table class="list"><tbody>
3435<tr><th>http</th>
3436 <td class="description">HTTP connection</td></tr>
3437</tbody></table>
798d6e29
MS
3438<h4 class="returnvalue">Return Value</h4>
3439 <p class="description">Number of bytes available</p>
3440<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetRemaining">httpGetRemaining</a></h3>
3441 <p class="description">Get the number of remaining bytes in the message
3442body or current chunk.</p>
3443<p class="code">
98d88c8d 3444size_t httpGetRemaining(<a href="#http_t">http_t</a> *http);</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</tbody></table>
798d6e29
MS
3450<h4 class="returnvalue">Return Value</h4>
3451 <p class="description">Remaining bytes</p>
3452<h4 class="discussion">Discussion</h4>
3453 <p class="discussion">The <a href="#httpIsChunked"><code>httpIsChunked</code></a> function can be used to determine whether the
3454message body is chunked or fixed-length.
3455
3456</p>
3457<h3 class="function"><a id="httpGetState">httpGetState</a></h3>
3458 <p class="description">Get the current state of the HTTP request.</p>
3459<p class="code">
98d88c8d 3460<a href="#http_state_t">http_state_t</a> httpGetState(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3461<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3462<table class="list"><tbody>
3463<tr><th>http</th>
3464 <td class="description">HTTP connection</td></tr>
3465</tbody></table>
798d6e29
MS
3466<h4 class="returnvalue">Return Value</h4>
3467 <p class="description">HTTP state</p>
3468<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetStatus">httpGetStatus</a></h3>
3469 <p class="description">Get the status of the last HTTP request.</p>
3470<p class="code">
98d88c8d 3471http_status_t httpGetStatus(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3472<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3473<table class="list"><tbody>
3474<tr><th>http</th>
3475 <td class="description">HTTP connection</td></tr>
3476</tbody></table>
798d6e29
MS
3477<h4 class="returnvalue">Return Value</h4>
3478 <p class="description">HTTP status</p>
798d6e29
MS
3479<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetSubField2">httpGetSubField2</a></h3>
3480 <p class="description">Get a sub-field value.</p>
3481<p class="code">
98d88c8d
MS
3482char *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>
3483<h4 class="parameters">Parameters</h4>
3484<table class="list"><tbody>
3485<tr><th>http</th>
3486 <td class="description">HTTP connection</td></tr>
3487<tr><th>field</th>
3488 <td class="description">Field index</td></tr>
3489<tr><th>name</th>
3490 <td class="description">Name of sub-field</td></tr>
3491<tr><th>value</th>
3492 <td class="description">Value string</td></tr>
3493<tr><th>valuelen</th>
3494 <td class="description">Size of value buffer</td></tr>
3495</tbody></table>
798d6e29 3496<h4 class="returnvalue">Return Value</h4>
65bebeac 3497 <p class="description">Value or <code>NULL</code></p>
798d6e29
MS
3498<h3 class="function"><a id="httpGetVersion">httpGetVersion</a></h3>
3499 <p class="description">Get the HTTP version at the other end.</p>
3500<p class="code">
98d88c8d 3501<a href="#http_version_t">http_version_t</a> httpGetVersion(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3502<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3503<table class="list"><tbody>
3504<tr><th>http</th>
3505 <td class="description">HTTP connection</td></tr>
3506</tbody></table>
798d6e29
MS
3507<h4 class="returnvalue">Return Value</h4>
3508 <p class="description">Version number</p>
3509<h3 class="function"><a id="httpGets">httpGets</a></h3>
3510 <p class="description">Get a line of text from a HTTP connection.</p>
3511<p class="code">
98d88c8d
MS
3512char *httpGets(char *line, int length, <a href="#http_t">http_t</a> *http);</p>
3513<h4 class="parameters">Parameters</h4>
3514<table class="list"><tbody>
3515<tr><th>line</th>
3516 <td class="description">Line to read into</td></tr>
3517<tr><th>length</th>
3518 <td class="description">Max length of buffer</td></tr>
3519<tr><th>http</th>
3520 <td class="description">HTTP connection</td></tr>
3521</tbody></table>
798d6e29 3522<h4 class="returnvalue">Return Value</h4>
65bebeac 3523 <p class="description">Line or <code>NULL</code></p>
798d6e29
MS
3524<h3 class="function"><a id="httpHead">httpHead</a></h3>
3525 <p class="description">Send a HEAD request to the server.</p>
3526<p class="code">
98d88c8d 3527int httpHead(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3528<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3529<table class="list"><tbody>
3530<tr><th>http</th>
3531 <td class="description">HTTP connection</td></tr>
3532<tr><th>uri</th>
3533 <td class="description">URI for head</td></tr>
3534</tbody></table>
798d6e29
MS
3535<h4 class="returnvalue">Return Value</h4>
3536 <p class="description">Status of call (0 = success)</p>
3537<h3 class="function"><a id="httpInitialize">httpInitialize</a></h3>
53af7f21
MS
3538 <p class="description">Initialize the HTTP interface library and set the
3539default HTTP proxy (if any).</p>
98d88c8d
MS
3540<p class="code">
3541void httpInitialize(void);</p>
798d6e29
MS
3542<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpIsChunked">httpIsChunked</a></h3>
3543 <p class="description">Report whether a message body is chunked.</p>
3544<p class="code">
98d88c8d 3545int httpIsChunked(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3546<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3547<table class="list"><tbody>
3548<tr><th>http</th>
3549 <td class="description">HTTP connection</td></tr>
3550</tbody></table>
798d6e29
MS
3551<h4 class="returnvalue">Return Value</h4>
3552 <p class="description">1 if chunked, 0 if not</p>
3553<h4 class="discussion">Discussion</h4>
3554 <p class="discussion">This function returns non-zero if the message body is composed of
3555variable-length chunks.
3556
3557</p>
3558<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpIsEncrypted">httpIsEncrypted</a></h3>
3559 <p class="description">Report whether a connection is encrypted.</p>
3560<p class="code">
98d88c8d 3561int httpIsEncrypted(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3562<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3563<table class="list"><tbody>
3564<tr><th>http</th>
3565 <td class="description">HTTP connection</td></tr>
3566</tbody></table>
798d6e29
MS
3567<h4 class="returnvalue">Return Value</h4>
3568 <p class="description">1 if encrypted, 0 if not</p>
3569<h4 class="discussion">Discussion</h4>
3570 <p class="discussion">This function returns non-zero if the connection is currently encrypted.
3571
3572</p>
3573<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpLoadCredentials">httpLoadCredentials</a></h3>
3574 <p class="description">Load X.509 credentials from a keychain file.</p>
3575<p class="code">
98d88c8d
MS
3576int httpLoadCredentials(const char *path, cups_array_t **credentials, const char *common_name);</p>
3577<h4 class="parameters">Parameters</h4>
3578<table class="list"><tbody>
3579<tr><th>path</th>
3580 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
3581<tr><th>credentials</th>
3582 <td class="description">Credentials</td></tr>
3583<tr><th>common_name</th>
3584 <td class="description">Common name for credentials</td></tr>
3585</tbody></table>
798d6e29
MS
3586<h4 class="returnvalue">Return Value</h4>
3587 <p class="description">0 on success, -1 on error</p>
3588<h3 class="function"><a id="httpOptions">httpOptions</a></h3>
3589 <p class="description">Send an OPTIONS request to the server.</p>
3590<p class="code">
98d88c8d 3591int httpOptions(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3592<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3593<table class="list"><tbody>
3594<tr><th>http</th>
3595 <td class="description">HTTP connection</td></tr>
3596<tr><th>uri</th>
3597 <td class="description">URI for options</td></tr>
3598</tbody></table>
798d6e29
MS
3599<h4 class="returnvalue">Return Value</h4>
3600 <p class="description">Status of call (0 = success)</p>
3601<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpPeek">httpPeek</a></h3>
3602 <p class="description">Peek at data from a HTTP connection.</p>
3603<p class="code">
98d88c8d
MS
3604ssize_t httpPeek(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p>
3605<h4 class="parameters">Parameters</h4>
3606<table class="list"><tbody>
3607<tr><th>http</th>
3608 <td class="description">HTTP connection</td></tr>
3609<tr><th>buffer</th>
3610 <td class="description">Buffer for data</td></tr>
3611<tr><th>length</th>
3612 <td class="description">Maximum number of bytes</td></tr>
3613</tbody></table>
798d6e29
MS
3614<h4 class="returnvalue">Return Value</h4>
3615 <p class="description">Number of bytes copied</p>
3616<h4 class="discussion">Discussion</h4>
3617 <p class="discussion">This function copies available data from the given HTTP connection, reading
3618a buffer as needed. The data is still available for reading using
65bebeac 3619<a href="#httpRead2"><code>httpRead2</code></a>.<br>
798d6e29
MS
3620<br>
3621For non-blocking connections the usual timeouts apply.
3622
3623</p>
3624<h3 class="function"><a id="httpPost">httpPost</a></h3>
3625 <p class="description">Send a POST request to the server.</p>
3626<p class="code">
98d88c8d 3627int httpPost(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3628<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3629<table class="list"><tbody>
3630<tr><th>http</th>
3631 <td class="description">HTTP connection</td></tr>
3632<tr><th>uri</th>
3633 <td class="description">URI for post</td></tr>
3634</tbody></table>
798d6e29
MS
3635<h4 class="returnvalue">Return Value</h4>
3636 <p class="description">Status of call (0 = success)</p>
3637<h3 class="function"><a id="httpPut">httpPut</a></h3>
3638 <p class="description">Send a PUT request to the server.</p>
3639<p class="code">
98d88c8d 3640int httpPut(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3641<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3642<table class="list"><tbody>
3643<tr><th>http</th>
3644 <td class="description">HTTP connection</td></tr>
3645<tr><th>uri</th>
3646 <td class="description">URI to put</td></tr>
3647</tbody></table>
798d6e29
MS
3648<h4 class="returnvalue">Return Value</h4>
3649 <p class="description">Status of call (0 = success)</p>
798d6e29
MS
3650<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpRead2">httpRead2</a></h3>
3651 <p class="description">Read data from a HTTP connection.</p>
3652<p class="code">
98d88c8d
MS
3653ssize_t httpRead2(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p>
3654<h4 class="parameters">Parameters</h4>
3655<table class="list"><tbody>
3656<tr><th>http</th>
3657 <td class="description">HTTP connection</td></tr>
3658<tr><th>buffer</th>
3659 <td class="description">Buffer for data</td></tr>
3660<tr><th>length</th>
3661 <td class="description">Maximum number of bytes</td></tr>
3662</tbody></table>
798d6e29
MS
3663<h4 class="returnvalue">Return Value</h4>
3664 <p class="description">Number of bytes read</p>
3665<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpReadRequest">httpReadRequest</a></h3>
3666 <p class="description">Read a HTTP request from a connection.</p>
3667<p class="code">
98d88c8d
MS
3668<a href="#http_state_t">http_state_t</a> httpReadRequest(<a href="#http_t">http_t</a> *http, char *uri, size_t urilen);</p>
3669<h4 class="parameters">Parameters</h4>
3670<table class="list"><tbody>
3671<tr><th>http</th>
3672 <td class="description">HTTP connection</td></tr>
3673<tr><th>uri</th>
3674 <td class="description">URI buffer</td></tr>
3675<tr><th>urilen</th>
3676 <td class="description">Size of URI buffer</td></tr>
3677</tbody></table>
798d6e29
MS
3678<h4 class="returnvalue">Return Value</h4>
3679 <p class="description">New state of connection</p>
798d6e29
MS
3680<h3 class="function"><a id="httpReconnect2">httpReconnect2</a></h3>
3681 <p class="description">Reconnect to a HTTP server with timeout and optional
3682cancel.</p>
3683<p class="code">
98d88c8d
MS
3684int httpReconnect2(<a href="#http_t">http_t</a> *http, int msec, int *cancel);</p>
3685<h4 class="parameters">Parameters</h4>
3686<table class="list"><tbody>
3687<tr><th>http</th>
3688 <td class="description">HTTP connection</td></tr>
3689<tr><th>msec</th>
3690 <td class="description">Timeout in milliseconds</td></tr>
3691<tr><th>cancel</th>
3692 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
3693</tbody></table>
798d6e29
MS
3694<h4 class="returnvalue">Return Value</h4>
3695 <p class="description">0 on success, non-zero on failure</p>
3696<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpResolveHostname">httpResolveHostname</a></h3>
3697 <p class="description">Resolve the hostname of the HTTP connection
3698address.</p>
3699<p class="code">
98d88c8d
MS
3700const char *httpResolveHostname(<a href="#http_t">http_t</a> *http, char *buffer, size_t bufsize);</p>
3701<h4 class="parameters">Parameters</h4>
3702<table class="list"><tbody>
3703<tr><th>http</th>
3704 <td class="description">HTTP connection</td></tr>
3705<tr><th>buffer</th>
3706 <td class="description">Hostname buffer</td></tr>
3707<tr><th>bufsize</th>
3708 <td class="description">Size of buffer</td></tr>
3709</tbody></table>
798d6e29
MS
3710<h4 class="returnvalue">Return Value</h4>
3711 <p class="description">Resolved hostname or <code>NULL</code></p>
3712<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpSaveCredentials">httpSaveCredentials</a></h3>
3713 <p class="description">Save X.509 credentials to a keychain file.</p>
3714<p class="code">
98d88c8d
MS
3715int httpSaveCredentials(const char *path, cups_array_t *credentials, const char *common_name);</p>
3716<h4 class="parameters">Parameters</h4>
3717<table class="list"><tbody>
3718<tr><th>path</th>
3719 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
3720<tr><th>credentials</th>
3721 <td class="description">Credentials</td></tr>
3722<tr><th>common_name</th>
3723 <td class="description">Common name for credentials</td></tr>
3724</tbody></table>
798d6e29
MS
3725<h4 class="returnvalue">Return Value</h4>
3726 <p class="description">-1 on error, 0 on success</p>
798d6e29
MS
3727<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSeparateURI">httpSeparateURI</a></h3>
3728 <p class="description">Separate a Universal Resource Identifier into its
3729components.</p>
3730<p class="code">
98d88c8d
MS
3731<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>
3732<h4 class="parameters">Parameters</h4>
3733<table class="list"><tbody>
3734<tr><th>decoding</th>
3735 <td class="description">Decoding flags</td></tr>
3736<tr><th>uri</th>
3737 <td class="description">Universal Resource Identifier</td></tr>
3738<tr><th>scheme</th>
3739 <td class="description">Scheme (http, https, etc.)</td></tr>
3740<tr><th>schemelen</th>
3741 <td class="description">Size of scheme buffer</td></tr>
3742<tr><th>username</th>
3743 <td class="description">Username</td></tr>
3744<tr><th>usernamelen</th>
3745 <td class="description">Size of username buffer</td></tr>
3746<tr><th>host</th>
3747 <td class="description">Hostname</td></tr>
3748<tr><th>hostlen</th>
3749 <td class="description">Size of hostname buffer</td></tr>
3750<tr><th>port</th>
3751 <td class="description">Port number to use</td></tr>
3752<tr><th>resource</th>
3753 <td class="description">Resource/filename</td></tr>
3754<tr><th>resourcelen</th>
3755 <td class="description">Size of resource buffer</td></tr>
3756</tbody></table>
798d6e29
MS
3757<h4 class="returnvalue">Return Value</h4>
3758 <p class="description">Result of separation</p>
98d88c8d 3759<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="httpSetAuthString">httpSetAuthString</a></h3>
53af7f21 3760 <p class="description">Set the current authorization string.</p>
98d88c8d
MS
3761<p class="code">
3762void httpSetAuthString(<a href="#http_t">http_t</a> *http, const char *scheme, const char *data);</p>
3763<h4 class="parameters">Parameters</h4>
3764<table class="list"><tbody>
3765<tr><th>http</th>
3766 <td class="description">HTTP connection</td></tr>
3767<tr><th>scheme</th>
3768 <td class="description">Auth scheme (NULL to clear it)</td></tr>
3769<tr><th>data</th>
3770 <td class="description">Auth data (NULL for none)</td></tr>
3771</tbody></table>
3772<h4 class="discussion">Discussion</h4>
798d6e29 3773 <p class="discussion">This function just stores a copy of the current authorization string in
65bebeac
MS
3774the HTTP connection object. You must still call <a href="#httpSetField"><code>httpSetField</code></a> to set
3775<code>HTTP_FIELD_AUTHORIZATION</code> prior to issuing a HTTP request using
3776<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
3777<a href="#httpPut"><code>httpPut</code></a>.
798d6e29
MS
3778
3779</p>
98d88c8d
MS
3780<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpSetCookie">httpSetCookie</a></h3>
3781 <p class="description">Set the cookie value(s).</p>
798d6e29 3782<p class="code">
98d88c8d 3783void httpSetCookie(<a href="#http_t">http_t</a> *http, const char *cookie);</p>
798d6e29 3784<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3785<table class="list"><tbody>
3786<tr><th>http</th>
3787 <td class="description">Connection</td></tr>
3788<tr><th>cookie</th>
3789 <td class="description">Cookie string</td></tr>
3790</tbody></table>
798d6e29
MS
3791<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpSetCredentials">httpSetCredentials</a></h3>
3792 <p class="description">Set the credentials associated with an encrypted
3793connection.</p>
3794<p class="code">
98d88c8d 3795int httpSetCredentials(<a href="#http_t">http_t</a> *http, cups_array_t *credentials);</p>
798d6e29 3796<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3797<table class="list"><tbody>
3798<tr><th>http</th>
3799 <td class="description">HTTP connection</td></tr>
3800<tr><th>credentials</th>
3801 <td class="description">Array of credentials</td></tr>
3802</tbody></table>
798d6e29
MS
3803<h4 class="returnvalue">Return Value</h4>
3804 <p class="description">Status of call (0 = success)</p>
98d88c8d 3805<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpSetDefaultField">httpSetDefaultField</a></h3>
53af7f21 3806 <p class="description">Set the default value of an HTTP header.</p>
98d88c8d
MS
3807<p class="code">
3808void httpSetDefaultField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p>
3809<h4 class="parameters">Parameters</h4>
3810<table class="list"><tbody>
3811<tr><th>http</th>
3812 <td class="description">HTTP connection</td></tr>
3813<tr><th>field</th>
3814 <td class="description">Field index</td></tr>
3815<tr><th>value</th>
3816 <td class="description">Value</td></tr>
3817</tbody></table>
3818<h4 class="discussion">Discussion</h4>
798d6e29
MS
3819 <p class="discussion">Currently only <code>HTTP_FIELD_ACCEPT_ENCODING</code>, <code>HTTP_FIELD_SERVER</code>,
3820and <code>HTTP_FIELD_USER_AGENT</code> can be set.
3821
3822</p>
98d88c8d
MS
3823<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSetExpect">httpSetExpect</a></h3>
3824 <p class="description">Set the Expect: header in a request.</p>
798d6e29 3825<p class="code">
98d88c8d 3826void httpSetExpect(<a href="#http_t">http_t</a> *http, http_status_t expect);</p>
798d6e29 3827<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3828<table class="list"><tbody>
3829<tr><th>http</th>
3830 <td class="description">HTTP connection</td></tr>
3831<tr><th>expect</th>
3832 <td class="description">HTTP status to expect
3833(<code>HTTP_STATUS_CONTINUE</code>)</td></tr>
3834</tbody></table>
3835<h4 class="discussion">Discussion</h4>
798d6e29
MS
3836 <p class="discussion">Currently only <code>HTTP_STATUS_CONTINUE</code> is supported for the &quot;expect&quot;
3837argument.
3838
3839</p>
3840<h3 class="function"><a id="httpSetField">httpSetField</a></h3>
53af7f21 3841 <p class="description">Set the value of an HTTP header.</p>
798d6e29 3842<p class="code">
98d88c8d
MS
3843void httpSetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p>
3844<h4 class="parameters">Parameters</h4>
3845<table class="list"><tbody>
3846<tr><th>http</th>
3847 <td class="description">HTTP connection</td></tr>
3848<tr><th>field</th>
3849 <td class="description">Field index</td></tr>
3850<tr><th>value</th>
3851 <td class="description">Value</td></tr>
3852</tbody></table>
3853<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpSetKeepAlive">httpSetKeepAlive</a></h3>
53af7f21 3854 <p class="description">Set the current Keep-Alive state of a connection.</p>
98d88c8d
MS
3855<p class="code">
3856void httpSetKeepAlive(<a href="#http_t">http_t</a> *http, <a href="#http_keepalive_t">http_keepalive_t</a> keep_alive);</p>
3857<h4 class="parameters">Parameters</h4>
3858<table class="list"><tbody>
3859<tr><th>http</th>
3860 <td class="description">HTTP connection</td></tr>
3861<tr><th>keep_alive</th>
3862 <td class="description">New Keep-Alive value</td></tr>
3863</tbody></table>
3864<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSetLength">httpSetLength</a></h3>
53af7f21 3865 <p class="description">Set the content-length and content-encoding.</p>
98d88c8d
MS
3866<p class="code">
3867void httpSetLength(<a href="#http_t">http_t</a> *http, size_t length);</p>
3868<h4 class="parameters">Parameters</h4>
3869<table class="list"><tbody>
3870<tr><th>http</th>
3871 <td class="description">HTTP connection</td></tr>
3872<tr><th>length</th>
3873 <td class="description">Length (0 for chunked)</td></tr>
3874</tbody></table>
3875<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpSetTimeout">httpSetTimeout</a></h3>
53af7f21 3876 <p class="description">Set read/write timeouts and an optional callback.</p>
98d88c8d
MS
3877<p class="code">
3878void 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>
3879<h4 class="parameters">Parameters</h4>
3880<table class="list"><tbody>
3881<tr><th>http</th>
3882 <td class="description">HTTP connection</td></tr>
3883<tr><th>timeout</th>
3884 <td class="description">Number of seconds for timeout,
3885must be greater than 0</td></tr>
3886<tr><th>cb</th>
65bebeac 3887 <td class="description">Callback function or <code>NULL</code></td></tr>
98d88c8d
MS
3888<tr><th>user_data</th>
3889 <td class="description">User data pointer</td></tr>
3890</tbody></table>
3891<h4 class="discussion">Discussion</h4>
798d6e29
MS
3892 <p class="discussion">The optional timeout callback receives both the HTTP connection and a user
3893data pointer and must return 1 to continue or 0 to error (time) out.
3894
3895</p>
98d88c8d
MS
3896<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpShutdown">httpShutdown</a></h3>
3897 <p class="description">Shutdown one side of an HTTP connection.</p>
798d6e29 3898<p class="code">
98d88c8d 3899void httpShutdown(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3900<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3901<table class="list"><tbody>
3902<tr><th>http</th>
3903 <td class="description">HTTP connection</td></tr>
3904</tbody></table>
798d6e29
MS
3905<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpStateString">httpStateString</a></h3>
3906 <p class="description">Return the string describing a HTTP state value.</p>
3907<p class="code">
98d88c8d 3908const char *httpStateString(<a href="#http_state_t">http_state_t</a> state);</p>
798d6e29 3909<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3910<table class="list"><tbody>
3911<tr><th>state</th>
3912 <td class="description">HTTP state value</td></tr>
3913</tbody></table>
798d6e29
MS
3914<h4 class="returnvalue">Return Value</h4>
3915 <p class="description">State string</p>
3916<h3 class="function"><a id="httpStatus">httpStatus</a></h3>
3917 <p class="description">Return a short string describing a HTTP status code.</p>
3918<p class="code">
98d88c8d 3919const char *httpStatus(http_status_t status);</p>
798d6e29 3920<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3921<table class="list"><tbody>
3922<tr><th>status</th>
3923 <td class="description">HTTP status code</td></tr>
3924</tbody></table>
798d6e29
MS
3925<h4 class="returnvalue">Return Value</h4>
3926 <p class="description">Localized status string</p>
3927<h4 class="discussion">Discussion</h4>
3928 <p class="discussion">The returned string is localized to the current POSIX locale and is based
65bebeac 3929on the status strings defined in RFC 7231.</p>
798d6e29
MS
3930<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpURIStatusString">httpURIStatusString</a></h3>
3931 <p class="description">Return a string describing a URI status code.</p>
3932<p class="code">
98d88c8d 3933const char *httpURIStatusString(<a href="#http_uri_status_t">http_uri_status_t</a> status);</p>
798d6e29 3934<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3935<table class="list"><tbody>
3936<tr><th>status</th>
3937 <td class="description">URI status code</td></tr>
3938</tbody></table>
798d6e29
MS
3939<h4 class="returnvalue">Return Value</h4>
3940 <p class="description">Localized status string</p>
3941<h3 class="function"><a id="httpUpdate">httpUpdate</a></h3>
3942 <p class="description">Update the current HTTP state for incoming data.</p>
3943<p class="code">
98d88c8d 3944http_status_t httpUpdate(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3945<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3946<table class="list"><tbody>
3947<tr><th>http</th>
3948 <td class="description">HTTP connection</td></tr>
3949</tbody></table>
798d6e29
MS
3950<h4 class="returnvalue">Return Value</h4>
3951 <p class="description">HTTP status</p>
3952<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpWait">httpWait</a></h3>
3953 <p class="description">Wait for data available on a connection.</p>
3954<p class="code">
98d88c8d 3955int httpWait(<a href="#http_t">http_t</a> *http, int msec);</p>
798d6e29 3956<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3957<table class="list"><tbody>
3958<tr><th>http</th>
3959 <td class="description">HTTP connection</td></tr>
3960<tr><th>msec</th>
3961 <td class="description">Milliseconds to wait</td></tr>
3962</tbody></table>
798d6e29
MS
3963<h4 class="returnvalue">Return Value</h4>
3964 <p class="description">1 if data is available, 0 otherwise</p>
798d6e29
MS
3965<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpWrite2">httpWrite2</a></h3>
3966 <p class="description">Write data to a HTTP connection.</p>
3967<p class="code">
98d88c8d
MS
3968ssize_t httpWrite2(<a href="#http_t">http_t</a> *http, const char *buffer, size_t length);</p>
3969<h4 class="parameters">Parameters</h4>
3970<table class="list"><tbody>
3971<tr><th>http</th>
3972 <td class="description">HTTP connection</td></tr>
3973<tr><th>buffer</th>
3974 <td class="description">Buffer for data</td></tr>
3975<tr><th>length</th>
3976 <td class="description">Number of bytes to write</td></tr>
3977</tbody></table>
798d6e29
MS
3978<h4 class="returnvalue">Return Value</h4>
3979 <p class="description">Number of bytes written</p>
3980<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpWriteResponse">httpWriteResponse</a></h3>
3981 <p class="description">Write a HTTP response to a client connection.</p>
3982<p class="code">
98d88c8d 3983int httpWriteResponse(<a href="#http_t">http_t</a> *http, http_status_t status);</p>
798d6e29 3984<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3985<table class="list"><tbody>
3986<tr><th>http</th>
3987 <td class="description">HTTP connection</td></tr>
3988<tr><th>status</th>
3989 <td class="description">Status code</td></tr>
3990</tbody></table>
798d6e29
MS
3991<h4 class="returnvalue">Return Value</h4>
3992 <p class="description">0 on success, -1 on error</p>
3993<h3 class="function"><a id="ippAddBoolean">ippAddBoolean</a></h3>
3994 <p class="description">Add a boolean attribute to an IPP message.</p>
3995<p class="code">
98d88c8d
MS
3996<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>
3997<h4 class="parameters">Parameters</h4>
3998<table class="list"><tbody>
3999<tr><th>ipp</th>
4000 <td class="description">IPP message</td></tr>
4001<tr><th>group</th>
4002 <td class="description">IPP group</td></tr>
4003<tr><th>name</th>
4004 <td class="description">Name of attribute</td></tr>
4005<tr><th>value</th>
4006 <td class="description">Value of attribute</td></tr>
4007</tbody></table>
798d6e29
MS
4008<h4 class="returnvalue">Return Value</h4>
4009 <p class="description">New attribute</p>
4010<h4 class="discussion">Discussion</h4>
4011 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4012the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4013<br>
4014The <code>group</code> parameter specifies the IPP attribute group tag: none
4015(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4016event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4017(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4018(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4019<h3 class="function"><a id="ippAddBooleans">ippAddBooleans</a></h3>
4020 <p class="description">Add an array of boolean values.</p>
4021<p class="code">
98d88c8d
MS
4022<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>
4023<h4 class="parameters">Parameters</h4>
4024<table class="list"><tbody>
4025<tr><th>ipp</th>
4026 <td class="description">IPP message</td></tr>
4027<tr><th>group</th>
4028 <td class="description">IPP group</td></tr>
4029<tr><th>name</th>
4030 <td class="description">Name of attribute</td></tr>
4031<tr><th>num_values</th>
4032 <td class="description">Number of values</td></tr>
4033<tr><th>values</th>
4034 <td class="description">Values</td></tr>
4035</tbody></table>
798d6e29
MS
4036<h4 class="returnvalue">Return Value</h4>
4037 <p class="description">New attribute</p>
4038<h4 class="discussion">Discussion</h4>
4039 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4040the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4041<br>
4042The <code>group</code> parameter specifies the IPP attribute group tag: none
4043(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4044event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4045(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4046(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4047<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippAddCollection">ippAddCollection</a></h3>
4048 <p class="description">Add a collection value.</p>
4049<p class="code">
98d88c8d
MS
4050<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>
4051<h4 class="parameters">Parameters</h4>
4052<table class="list"><tbody>
4053<tr><th>ipp</th>
4054 <td class="description">IPP message</td></tr>
4055<tr><th>group</th>
4056 <td class="description">IPP group</td></tr>
4057<tr><th>name</th>
4058 <td class="description">Name of attribute</td></tr>
4059<tr><th>value</th>
4060 <td class="description">Value</td></tr>
4061</tbody></table>
798d6e29
MS
4062<h4 class="returnvalue">Return Value</h4>
4063 <p class="description">New attribute</p>
4064<h4 class="discussion">Discussion</h4>
4065 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4066the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4067<br>
4068The <code>group</code> parameter specifies the IPP attribute group tag: none
4069(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4070event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4071(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4072(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
4073
4074</p>
4075<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippAddCollections">ippAddCollections</a></h3>
4076 <p class="description">Add an array of collection values.</p>
4077<p class="code">
98d88c8d
MS
4078<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>
4079<h4 class="parameters">Parameters</h4>
4080<table class="list"><tbody>
4081<tr><th>ipp</th>
4082 <td class="description">IPP message</td></tr>
4083<tr><th>group</th>
4084 <td class="description">IPP group</td></tr>
4085<tr><th>name</th>
4086 <td class="description">Name of attribute</td></tr>
4087<tr><th>num_values</th>
4088 <td class="description">Number of values</td></tr>
4089<tr><th>values</th>
4090 <td class="description">Values</td></tr>
4091</tbody></table>
798d6e29
MS
4092<h4 class="returnvalue">Return Value</h4>
4093 <p class="description">New attribute</p>
4094<h4 class="discussion">Discussion</h4>
4095 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4096the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4097<br>
4098The <code>group</code> parameter specifies the IPP attribute group tag: none
4099(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4100event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4101(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4102(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
4103
4104</p>
4105<h3 class="function"><a id="ippAddDate">ippAddDate</a></h3>
65bebeac 4106 <p class="description">Add a dateTime attribute to an IPP message.</p>
798d6e29 4107<p class="code">
98d88c8d
MS
4108<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>
4109<h4 class="parameters">Parameters</h4>
4110<table class="list"><tbody>
4111<tr><th>ipp</th>
4112 <td class="description">IPP message</td></tr>
4113<tr><th>group</th>
4114 <td class="description">IPP group</td></tr>
4115<tr><th>name</th>
4116 <td class="description">Name of attribute</td></tr>
4117<tr><th>value</th>
4118 <td class="description">Value</td></tr>
4119</tbody></table>
798d6e29
MS
4120<h4 class="returnvalue">Return Value</h4>
4121 <p class="description">New attribute</p>
4122<h4 class="discussion">Discussion</h4>
4123 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4124the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4125<br>
4126The <code>group</code> parameter specifies the IPP attribute group tag: none
4127(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4128event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4129(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4130(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4131<h3 class="function"><a id="ippAddInteger">ippAddInteger</a></h3>
4132 <p class="description">Add a integer attribute to an IPP message.</p>
4133<p class="code">
98d88c8d
MS
4134<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>
4135<h4 class="parameters">Parameters</h4>
4136<table class="list"><tbody>
4137<tr><th>ipp</th>
4138 <td class="description">IPP message</td></tr>
4139<tr><th>group</th>
4140 <td class="description">IPP group</td></tr>
4141<tr><th>value_tag</th>
4142 <td class="description">Type of attribute</td></tr>
4143<tr><th>name</th>
4144 <td class="description">Name of attribute</td></tr>
4145<tr><th>value</th>
4146 <td class="description">Value of attribute</td></tr>
4147</tbody></table>
798d6e29
MS
4148<h4 class="returnvalue">Return Value</h4>
4149 <p class="description">New attribute</p>
4150<h4 class="discussion">Discussion</h4>
4151 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4152the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4153<br>
4154The <code>group</code> parameter specifies the IPP attribute group tag: none
4155(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4156event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4157(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4158(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4159<br>
4160Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
4161(<code>IPP_TAG_INTEGER</code>).</p>
4162<h3 class="function"><a id="ippAddIntegers">ippAddIntegers</a></h3>
4163 <p class="description">Add an array of integer values.</p>
4164<p class="code">
98d88c8d
MS
4165<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>
4166<h4 class="parameters">Parameters</h4>
4167<table class="list"><tbody>
4168<tr><th>ipp</th>
4169 <td class="description">IPP message</td></tr>
4170<tr><th>group</th>
4171 <td class="description">IPP group</td></tr>
4172<tr><th>value_tag</th>
4173 <td class="description">Type of attribute</td></tr>
4174<tr><th>name</th>
4175 <td class="description">Name of attribute</td></tr>
4176<tr><th>num_values</th>
4177 <td class="description">Number of values</td></tr>
4178<tr><th>values</th>
4179 <td class="description">Values</td></tr>
4180</tbody></table>
798d6e29
MS
4181<h4 class="returnvalue">Return Value</h4>
4182 <p class="description">New attribute</p>
4183<h4 class="discussion">Discussion</h4>
4184 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4185the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4186<br>
4187The <code>group</code> parameter specifies the IPP attribute group tag: none
4188(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4189event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4190(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4191(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4192<br>
4193Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
4194(<code>IPP_TAG_INTEGER</code>).</p>
4195<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippAddOctetString">ippAddOctetString</a></h3>
4196 <p class="description">Add an octetString value to an IPP message.</p>
4197<p class="code">
98d88c8d
MS
4198<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>
4199<h4 class="parameters">Parameters</h4>
4200<table class="list"><tbody>
4201<tr><th>ipp</th>
4202 <td class="description">IPP message</td></tr>
4203<tr><th>group</th>
4204 <td class="description">IPP group</td></tr>
4205<tr><th>name</th>
4206 <td class="description">Name of attribute</td></tr>
4207<tr><th>data</th>
4208 <td class="description">octetString data</td></tr>
4209<tr><th>datalen</th>
4210 <td class="description">Length of data in bytes</td></tr>
4211</tbody></table>
798d6e29
MS
4212<h4 class="returnvalue">Return Value</h4>
4213 <p class="description">New attribute</p>
4214<h4 class="discussion">Discussion</h4>
4215 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4216the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4217<br>
4218The <code>group</code> parameter specifies the IPP attribute group tag: none
4219(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4220event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4221(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4222(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
4223
4224</p>
4225<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippAddOutOfBand">ippAddOutOfBand</a></h3>
4226 <p class="description">Add an out-of-band value to an IPP message.</p>
4227<p class="code">
98d88c8d
MS
4228<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>
4229<h4 class="parameters">Parameters</h4>
4230<table class="list"><tbody>
4231<tr><th>ipp</th>
4232 <td class="description">IPP message</td></tr>
4233<tr><th>group</th>
4234 <td class="description">IPP group</td></tr>
4235<tr><th>value_tag</th>
4236 <td class="description">Type of attribute</td></tr>
4237<tr><th>name</th>
4238 <td class="description">Name of attribute</td></tr>
4239</tbody></table>
798d6e29
MS
4240<h4 class="returnvalue">Return Value</h4>
4241 <p class="description">New attribute</p>
4242<h4 class="discussion">Discussion</h4>
4243 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4244the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4245<br>
4246The <code>group</code> parameter specifies the IPP attribute group tag: none
4247(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4248event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4249(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4250(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4251<br>
4252Supported out-of-band values include unsupported-value
4253(<code>IPP_TAG_UNSUPPORTED_VALUE</code>), default (<code>IPP_TAG_DEFAULT</code>), unknown
4254(<code>IPP_TAG_UNKNOWN</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable
4255(<code>IPP_TAG_NOTSETTABLE</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), and
4256admin-define (<code>IPP_TAG_ADMINDEFINE</code>).
4257
4258</p>
4259<h3 class="function"><a id="ippAddRange">ippAddRange</a></h3>
4260 <p class="description">Add a range of values to an IPP message.</p>
4261<p class="code">
98d88c8d
MS
4262<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>
4263<h4 class="parameters">Parameters</h4>
4264<table class="list"><tbody>
4265<tr><th>ipp</th>
4266 <td class="description">IPP message</td></tr>
4267<tr><th>group</th>
4268 <td class="description">IPP group</td></tr>
4269<tr><th>name</th>
4270 <td class="description">Name of attribute</td></tr>
4271<tr><th>lower</th>
4272 <td class="description">Lower value</td></tr>
4273<tr><th>upper</th>
4274 <td class="description">Upper value</td></tr>
4275</tbody></table>
798d6e29
MS
4276<h4 class="returnvalue">Return Value</h4>
4277 <p class="description">New attribute</p>
4278<h4 class="discussion">Discussion</h4>
4279 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4280the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4281<br>
4282The <code>group</code> parameter specifies the IPP attribute group tag: none
4283(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4284event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4285(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4286(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4287<br>
4288The <code>lower</code> parameter must be less than or equal to the <code>upper</code> parameter.</p>
4289<h3 class="function"><a id="ippAddRanges">ippAddRanges</a></h3>
4290 <p class="description">Add ranges of values to an IPP message.</p>
4291<p class="code">
98d88c8d
MS
4292<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>
4293<h4 class="parameters">Parameters</h4>
4294<table class="list"><tbody>
4295<tr><th>ipp</th>
4296 <td class="description">IPP message</td></tr>
4297<tr><th>group</th>
4298 <td class="description">IPP group</td></tr>
4299<tr><th>name</th>
4300 <td class="description">Name of attribute</td></tr>
4301<tr><th>num_values</th>
4302 <td class="description">Number of values</td></tr>
4303<tr><th>lower</th>
4304 <td class="description">Lower values</td></tr>
4305<tr><th>upper</th>
4306 <td class="description">Upper values</td></tr>
4307</tbody></table>
798d6e29
MS
4308<h4 class="returnvalue">Return Value</h4>
4309 <p class="description">New attribute</p>
4310<h4 class="discussion">Discussion</h4>
4311 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4312the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4313<br>
4314The <code>group</code> parameter specifies the IPP attribute group tag: none
4315(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4316event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4317(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4318(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4319<h3 class="function"><a id="ippAddResolution">ippAddResolution</a></h3>
4320 <p class="description">Add a resolution value to an IPP message.</p>
4321<p class="code">
98d88c8d
MS
4322<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>
4323<h4 class="parameters">Parameters</h4>
4324<table class="list"><tbody>
4325<tr><th>ipp</th>
4326 <td class="description">IPP message</td></tr>
4327<tr><th>group</th>
4328 <td class="description">IPP group</td></tr>
4329<tr><th>name</th>
4330 <td class="description">Name of attribute</td></tr>
4331<tr><th>units</th>
4332 <td class="description">Units for resolution</td></tr>
4333<tr><th>xres</th>
4334 <td class="description">X resolution</td></tr>
4335<tr><th>yres</th>
4336 <td class="description">Y resolution</td></tr>
4337</tbody></table>
798d6e29
MS
4338<h4 class="returnvalue">Return Value</h4>
4339 <p class="description">New attribute</p>
4340<h4 class="discussion">Discussion</h4>
4341 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4342the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4343<br>
4344The <code>group</code> parameter specifies the IPP attribute group tag: none
4345(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4346event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4347(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4348(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4349<h3 class="function"><a id="ippAddResolutions">ippAddResolutions</a></h3>
4350 <p class="description">Add resolution values to an IPP message.</p>
4351<p class="code">
98d88c8d
MS
4352<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>
4353<h4 class="parameters">Parameters</h4>
4354<table class="list"><tbody>
4355<tr><th>ipp</th>
4356 <td class="description">IPP message</td></tr>
4357<tr><th>group</th>
4358 <td class="description">IPP group</td></tr>
4359<tr><th>name</th>
4360 <td class="description">Name of attribute</td></tr>
4361<tr><th>num_values</th>
4362 <td class="description">Number of values</td></tr>
4363<tr><th>units</th>
4364 <td class="description">Units for resolution</td></tr>
4365<tr><th>xres</th>
4366 <td class="description">X resolutions</td></tr>
4367<tr><th>yres</th>
4368 <td class="description">Y resolutions</td></tr>
4369</tbody></table>
798d6e29
MS
4370<h4 class="returnvalue">Return Value</h4>
4371 <p class="description">New attribute</p>
4372<h4 class="discussion">Discussion</h4>
4373 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4374the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4375<br>
4376The <code>group</code> parameter specifies the IPP attribute group tag: none
4377(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4378event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4379(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4380(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4381<h3 class="function"><a id="ippAddSeparator">ippAddSeparator</a></h3>
4382 <p class="description">Add a group separator to an IPP message.</p>
4383<p class="code">
98d88c8d 4384<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddSeparator(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4385<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4386<table class="list"><tbody>
4387<tr><th>ipp</th>
4388 <td class="description">IPP message</td></tr>
4389</tbody></table>
798d6e29
MS
4390<h4 class="returnvalue">Return Value</h4>
4391 <p class="description">New attribute</p>
4392<h4 class="discussion">Discussion</h4>
4393 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4394the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.</p>
4395<h3 class="function"><a id="ippAddString">ippAddString</a></h3>
4396 <p class="description">Add a language-encoded string to an IPP message.</p>
4397<p class="code">
98d88c8d
MS
4398<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>
4399<h4 class="parameters">Parameters</h4>
4400<table class="list"><tbody>
4401<tr><th>ipp</th>
4402 <td class="description">IPP message</td></tr>
4403<tr><th>group</th>
4404 <td class="description">IPP group</td></tr>
4405<tr><th>value_tag</th>
4406 <td class="description">Type of attribute</td></tr>
4407<tr><th>name</th>
4408 <td class="description">Name of attribute</td></tr>
4409<tr><th>language</th>
4410 <td class="description">Language code</td></tr>
4411<tr><th>value</th>
4412 <td class="description">Value</td></tr>
4413</tbody></table>
798d6e29
MS
4414<h4 class="returnvalue">Return Value</h4>
4415 <p class="description">New attribute</p>
4416<h4 class="discussion">Discussion</h4>
4417 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4418the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4419<br>
4420The <code>group</code> parameter specifies the IPP attribute group tag: none
4421(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4422event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4423(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4424(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4425<br>
4426Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4427(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4428(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4429(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4430(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4431(<code>IPP_TAG_URISCHEME</code>).<br>
4432<br>
4433The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
4434textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
4435<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippAddStringf">ippAddStringf</a></h3>
4436 <p class="description">Add a formatted string to an IPP message.</p>
4437<p class="code">
98d88c8d
MS
4438<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>
4439<h4 class="parameters">Parameters</h4>
4440<table class="list"><tbody>
4441<tr><th>ipp</th>
4442 <td class="description">IPP message</td></tr>
4443<tr><th>group</th>
4444 <td class="description">IPP group</td></tr>
4445<tr><th>value_tag</th>
4446 <td class="description">Type of attribute</td></tr>
4447<tr><th>name</th>
4448 <td class="description">Name of attribute</td></tr>
4449<tr><th>language</th>
4450 <td class="description">Language code (<code>NULL</code> for default)</td></tr>
4451<tr><th>format</th>
4452 <td class="description">Printf-style format string</td></tr>
4453<tr><th>...</th>
4454 <td class="description">Additional arguments as needed</td></tr>
4455</tbody></table>
798d6e29
MS
4456<h4 class="returnvalue">Return Value</h4>
4457 <p class="description">New attribute</p>
4458<h4 class="discussion">Discussion</h4>
4459 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4460the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4461<br>
4462The <code>group</code> parameter specifies the IPP attribute group tag: none
4463(<code>IPP_TAG_ZERO</code>, for member attributes), document
4464(<code>IPP_TAG_DOCUMENT</code>), event notification
4465(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
4466printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
4467or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4468<br>
4469Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4470(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4471(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4472(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4473(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4474(<code>IPP_TAG_URISCHEME</code>).<br>
4475<br>
4476The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
4477and textWithLanguage string values and must be <code>NULL</code> for all other
4478string values.<br>
4479<br>
4480The <code>format</code> parameter uses formatting characters compatible with the
4481printf family of standard functions. Additional arguments follow it as
4482needed. The formatted string is truncated as needed to the maximum length of
4483the corresponding value type.
4484
4485</p>
4486<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippAddStringfv">ippAddStringfv</a></h3>
4487 <p class="description">Add a formatted string to an IPP message.</p>
4488<p class="code">
98d88c8d
MS
4489<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>
4490<h4 class="parameters">Parameters</h4>
4491<table class="list"><tbody>
4492<tr><th>ipp</th>
4493 <td class="description">IPP message</td></tr>
4494<tr><th>group</th>
4495 <td class="description">IPP group</td></tr>
4496<tr><th>value_tag</th>
4497 <td class="description">Type of attribute</td></tr>
4498<tr><th>name</th>
4499 <td class="description">Name of attribute</td></tr>
4500<tr><th>language</th>
4501 <td class="description">Language code (<code>NULL</code> for default)</td></tr>
4502<tr><th>format</th>
4503 <td class="description">Printf-style format string</td></tr>
4504<tr><th>ap</th>
4505 <td class="description">Additional arguments</td></tr>
4506</tbody></table>
798d6e29
MS
4507<h4 class="returnvalue">Return Value</h4>
4508 <p class="description">New attribute</p>
4509<h4 class="discussion">Discussion</h4>
4510 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4511the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4512<br>
4513The <code>group</code> parameter specifies the IPP attribute group tag: none
4514(<code>IPP_TAG_ZERO</code>, for member attributes), document
4515(<code>IPP_TAG_DOCUMENT</code>), event notification
4516(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
4517printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
4518or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4519<br>
4520Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4521(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4522(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4523(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4524(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4525(<code>IPP_TAG_URISCHEME</code>).<br>
4526<br>
4527The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
4528and textWithLanguage string values and must be <code>NULL</code> for all other
4529string values.<br>
4530<br>
4531The <code>format</code> parameter uses formatting characters compatible with the
4532printf family of standard functions. Additional arguments are passed in the
4533stdarg pointer <code>ap</code>. The formatted string is truncated as needed to the
4534maximum length of the corresponding value type.
4535
4536</p>
4537<h3 class="function"><a id="ippAddStrings">ippAddStrings</a></h3>
4538 <p class="description">Add language-encoded strings to an IPP message.</p>
4539<p class="code">
98d88c8d
MS
4540<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>
4541<h4 class="parameters">Parameters</h4>
4542<table class="list"><tbody>
4543<tr><th>ipp</th>
4544 <td class="description">IPP message</td></tr>
4545<tr><th>group</th>
4546 <td class="description">IPP group</td></tr>
4547<tr><th>value_tag</th>
4548 <td class="description">Type of attribute</td></tr>
4549<tr><th>name</th>
4550 <td class="description">Name of attribute</td></tr>
4551<tr><th>num_values</th>
4552 <td class="description">Number of values</td></tr>
4553<tr><th>language</th>
4554 <td class="description">Language code (<code>NULL</code> for default)</td></tr>
4555<tr><th>values</th>
4556 <td class="description">Values</td></tr>
4557</tbody></table>
798d6e29
MS
4558<h4 class="returnvalue">Return Value</h4>
4559 <p class="description">New attribute</p>
4560<h4 class="discussion">Discussion</h4>
4561 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4562the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4563<br>
4564The <code>group</code> parameter specifies the IPP attribute group tag: none
4565(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4566event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4567(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4568(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4569<br>
4570Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4571(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4572(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4573(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4574(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4575(<code>IPP_TAG_URISCHEME</code>).<br>
4576<br>
4577The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
4578textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
4579<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippAttributeString">ippAttributeString</a></h3>
4580 <p class="description">Convert the attribute's value to a string.</p>
4581<p class="code">
98d88c8d
MS
4582size_t ippAttributeString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, char *buffer, size_t bufsize);</p>
4583<h4 class="parameters">Parameters</h4>
4584<table class="list"><tbody>
4585<tr><th>attr</th>
4586 <td class="description">Attribute</td></tr>
4587<tr><th>buffer</th>
4588 <td class="description">String buffer or NULL</td></tr>
4589<tr><th>bufsize</th>
4590 <td class="description">Size of string buffer</td></tr>
4591</tbody></table>
798d6e29
MS
4592<h4 class="returnvalue">Return Value</h4>
4593 <p class="description">Number of bytes less nul</p>
4594<h4 class="discussion">Discussion</h4>
4595 <p class="discussion">Returns the number of bytes that would be written, not including the
4596trailing nul. The buffer pointer can be NULL to get the required length,
4597just like (v)snprintf.
4598
4599</p>
4600<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippContainsInteger">ippContainsInteger</a></h3>
4601 <p class="description">Determine whether an attribute contains the
4602specified value or is within the list of ranges.</p>
4603<p class="code">
98d88c8d 4604int ippContainsInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int value);</p>
798d6e29 4605<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4606<table class="list"><tbody>
4607<tr><th>attr</th>
4608 <td class="description">Attribute</td></tr>
4609<tr><th>value</th>
4610 <td class="description">Integer/enum value</td></tr>
4611</tbody></table>
798d6e29
MS
4612<h4 class="returnvalue">Return Value</h4>
4613 <p class="description">1 on a match, 0 on no match</p>
4614<h4 class="discussion">Discussion</h4>
4615 <p class="discussion">Returns non-zero when the attribute contains either a matching integer or
4616enum value, or the value falls within one of the rangeOfInteger values for
4617the attribute.
4618
4619</p>
4620<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippContainsString">ippContainsString</a></h3>
4621 <p class="description">Determine whether an attribute contains the
4622specified string value.</p>
4623<p class="code">
98d88c8d 4624int ippContainsString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, const char *value);</p>
798d6e29 4625<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4626<table class="list"><tbody>
4627<tr><th>attr</th>
4628 <td class="description">Attribute</td></tr>
4629<tr><th>value</th>
4630 <td class="description">String value</td></tr>
4631</tbody></table>
798d6e29
MS
4632<h4 class="returnvalue">Return Value</h4>
4633 <p class="description">1 on a match, 0 on no match</p>
4634<h4 class="discussion">Discussion</h4>
4635 <p class="discussion">Returns non-zero when the attribute contains a matching charset, keyword,
65bebeac 4636naturalLanguage, mimeMediaType, name, text, uri, or uriScheme value.
798d6e29
MS
4637
4638</p>
4639<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippCopyAttribute">ippCopyAttribute</a></h3>
4640 <p class="description">Copy an attribute.</p>
4641<p class="code">
98d88c8d
MS
4642<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>
4643<h4 class="parameters">Parameters</h4>
4644<table class="list"><tbody>
4645<tr><th>dst</th>
4646 <td class="description">Destination IPP message</td></tr>
4647<tr><th>srcattr</th>
4648 <td class="description">Attribute to copy</td></tr>
4649<tr><th>quickcopy</th>
4650 <td class="description">1 for a referenced copy, 0 for normal</td></tr>
4651</tbody></table>
798d6e29
MS
4652<h4 class="returnvalue">Return Value</h4>
4653 <p class="description">New attribute</p>
4654<h4 class="discussion">Discussion</h4>
4655 <p class="discussion">The specified attribute, <code>attr</code>, is copied to the destination IPP message.
4656When <code>quickcopy</code> is non-zero, a &quot;shallow&quot; reference copy of the attribute is
4657created - this should only be done as long as the original source IPP message will
4658not be freed for the life of the destination.
4659
4660</p>
4661<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippCopyAttributes">ippCopyAttributes</a></h3>
4662 <p class="description">Copy attributes from one IPP message to another.</p>
4663<p class="code">
98d88c8d
MS
4664int 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>
4665<h4 class="parameters">Parameters</h4>
4666<table class="list"><tbody>
4667<tr><th>dst</th>
4668 <td class="description">Destination IPP message</td></tr>
4669<tr><th>src</th>
4670 <td class="description">Source IPP message</td></tr>
4671<tr><th>quickcopy</th>
4672 <td class="description">1 for a referenced copy, 0 for normal</td></tr>
4673<tr><th>cb</th>
4674 <td class="description">Copy callback or <code>NULL</code> for none</td></tr>
4675<tr><th>context</th>
4676 <td class="description">Context pointer</td></tr>
4677</tbody></table>
798d6e29
MS
4678<h4 class="returnvalue">Return Value</h4>
4679 <p class="description">1 on success, 0 on error</p>
4680<h4 class="discussion">Discussion</h4>
4681 <p class="discussion">Zero or more attributes are copied from the source IPP message, <code>src</code>, to the
4682destination IPP message, <code>dst</code>. When <code>quickcopy</code> is non-zero, a &quot;shallow&quot;
4683reference copy of the attribute is created - this should only be done as long as the
4684original source IPP message will not be freed for the life of the destination.<br>
4685<br>
4686The <code>cb</code> and <code>context</code> parameters provide a generic way to &quot;filter&quot; the
4687attributes that are copied - the function must return 1 to copy the attribute or
46880 to skip it. The function may also choose to do a partial copy of the source attribute
4689itself.
4690
4691</p>
4692<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippCreateRequestedArray">ippCreateRequestedArray</a></h3>
4693 <p class="description">Create a CUPS array of attribute names from the
4694given requested-attributes attribute.</p>
4695<p class="code">
98d88c8d 4696cups_array_t *ippCreateRequestedArray(<a href="#ipp_t">ipp_t</a> *request);</p>
798d6e29 4697<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4698<table class="list"><tbody>
4699<tr><th>request</th>
4700 <td class="description">IPP request</td></tr>
4701</tbody></table>
798d6e29
MS
4702<h4 class="returnvalue">Return Value</h4>
4703 <p class="description">CUPS array or <code>NULL</code> if all</p>
4704<h4 class="discussion">Discussion</h4>
4705 <p class="discussion">This function creates a (sorted) CUPS array of attribute names matching the
4706list of &quot;requested-attribute&quot; values supplied in an IPP request. All IANA-
4707registered values are supported in addition to the CUPS IPP extension
4708attributes.<br>
4709<br>
4710The <code>request</code> parameter specifies the request message that was read from
4711the client.
4712
4713<code>NULL</code> is returned if all attributes should be returned. Otherwise, the
4714result is a sorted array of attribute names, where <code>cupsArrayFind(array,
4715"attribute-name")</code> will return a non-NULL pointer. The array must be freed
4716using the <code>cupsArrayDelete</code> function.
4717
4718</p>
4719<h3 class="function"><a id="ippDateToTime">ippDateToTime</a></h3>
65bebeac
MS
4720 <p class="description">Convert from RFC 2579 Date/Time format to time in
4721seconds.</p>
798d6e29 4722<p class="code">
98d88c8d 4723time_t ippDateToTime(const <a href="#ipp_uchar_t">ipp_uchar_t</a> *date);</p>
798d6e29 4724<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4725<table class="list"><tbody>
4726<tr><th>date</th>
65bebeac 4727 <td class="description">RFC 2579 date info</td></tr>
98d88c8d 4728</tbody></table>
798d6e29
MS
4729<h4 class="returnvalue">Return Value</h4>
4730 <p class="description">UNIX time value</p>
4731<h3 class="function"><a id="ippDelete">ippDelete</a></h3>
98d88c8d 4732 <p class="description">Delete an IPP message.</p>
798d6e29 4733<p class="code">
98d88c8d 4734void ippDelete(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4735<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4736<table class="list"><tbody>
4737<tr><th>ipp</th>
4738 <td class="description">IPP message</td></tr>
4739</tbody></table>
4740<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippDeleteAttribute">ippDeleteAttribute</a></h3>
53af7f21 4741 <p class="description">Delete a single attribute in an IPP message.</p>
98d88c8d
MS
4742<p class="code">
4743void ippDeleteAttribute(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
4744<h4 class="parameters">Parameters</h4>
4745<table class="list"><tbody>
4746<tr><th>ipp</th>
4747 <td class="description">IPP message</td></tr>
4748<tr><th>attr</th>
4749 <td class="description">Attribute to delete</td></tr>
4750</tbody></table>
798d6e29
MS
4751<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippDeleteValues">ippDeleteValues</a></h3>
4752 <p class="description">Delete values in an attribute.</p>
4753<p class="code">
98d88c8d
MS
4754int ippDeleteValues(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int count);</p>
4755<h4 class="parameters">Parameters</h4>
4756<table class="list"><tbody>
4757<tr><th>ipp</th>
4758 <td class="description">IPP message</td></tr>
4759<tr><th>attr</th>
4760 <td class="description">Attribute</td></tr>
4761<tr><th>element</th>
4762 <td class="description">Index of first value to delete (0-based)</td></tr>
4763<tr><th>count</th>
4764 <td class="description">Number of values to delete</td></tr>
4765</tbody></table>
798d6e29
MS
4766<h4 class="returnvalue">Return Value</h4>
4767 <p class="description">1 on success, 0 on failure</p>
4768<h4 class="discussion">Discussion</h4>
4769 <p class="discussion">The <code>element</code> parameter specifies the first value to delete, starting at
47700. It must be less than the number of values returned by <a href="#ippGetCount"><code>ippGetCount</code></a>.<br>
4771<br>
4772The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4773<br>
4774Deleting all values in an attribute deletes the attribute.
4775
4776</p>
4777<h3 class="function"><a id="ippEnumString">ippEnumString</a></h3>
4778 <p class="description">Return a string corresponding to the enum value.</p>
4779<p class="code">
98d88c8d 4780const char *ippEnumString(const char *attrname, int enumvalue);</p>
798d6e29 4781<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4782<table class="list"><tbody>
4783<tr><th>attrname</th>
4784 <td class="description">Attribute name</td></tr>
4785<tr><th>enumvalue</th>
4786 <td class="description">Enum value</td></tr>
4787</tbody></table>
798d6e29
MS
4788<h4 class="returnvalue">Return Value</h4>
4789 <p class="description">Enum string</p>
4790<h3 class="function"><a id="ippEnumValue">ippEnumValue</a></h3>
4791 <p class="description">Return the value associated with a given enum string.</p>
4792<p class="code">
98d88c8d 4793int ippEnumValue(const char *attrname, const char *enumstring);</p>
798d6e29 4794<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4795<table class="list"><tbody>
4796<tr><th>attrname</th>
4797 <td class="description">Attribute name</td></tr>
4798<tr><th>enumstring</th>
4799 <td class="description">Enum string</td></tr>
4800</tbody></table>
798d6e29
MS
4801<h4 class="returnvalue">Return Value</h4>
4802 <p class="description">Enum value or -1 if unknown</p>
4803<h3 class="function"><a id="ippErrorString">ippErrorString</a></h3>
4804 <p class="description">Return a name for the given status code.</p>
4805<p class="code">
98d88c8d 4806const char *ippErrorString(ipp_status_t error);</p>
798d6e29 4807<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4808<table class="list"><tbody>
4809<tr><th>error</th>
4810 <td class="description">Error status</td></tr>
4811</tbody></table>
798d6e29
MS
4812<h4 class="returnvalue">Return Value</h4>
4813 <p class="description">Text string</p>
4814<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippErrorValue">ippErrorValue</a></h3>
4815 <p class="description">Return a status code for the given name.</p>
4816<p class="code">
98d88c8d 4817ipp_status_t ippErrorValue(const char *name);</p>
798d6e29 4818<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4819<table class="list"><tbody>
4820<tr><th>name</th>
4821 <td class="description">Name</td></tr>
4822</tbody></table>
798d6e29
MS
4823<h4 class="returnvalue">Return Value</h4>
4824 <p class="description">IPP status code</p>
4825<h3 class="function"><a id="ippFindAttribute">ippFindAttribute</a></h3>
4826 <p class="description">Find a named attribute in a request.</p>
4827<p class="code">
98d88c8d
MS
4828<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>
4829<h4 class="parameters">Parameters</h4>
4830<table class="list"><tbody>
4831<tr><th>ipp</th>
4832 <td class="description">IPP message</td></tr>
4833<tr><th>name</th>
4834 <td class="description">Name of attribute</td></tr>
4835<tr><th>type</th>
4836 <td class="description">Type of attribute</td></tr>
4837</tbody></table>
798d6e29
MS
4838<h4 class="returnvalue">Return Value</h4>
4839 <p class="description">Matching attribute</p>
4840<h4 class="discussion">Discussion</h4>
4841 <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
4842of attribute and member names separated by slashes, for example
4843&quot;media-col/media-size&quot;.</p>
4844<h3 class="function"><a id="ippFindNextAttribute">ippFindNextAttribute</a></h3>
4845 <p class="description">Find the next named attribute in a request.</p>
4846<p class="code">
98d88c8d
MS
4847<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>
4848<h4 class="parameters">Parameters</h4>
4849<table class="list"><tbody>
4850<tr><th>ipp</th>
4851 <td class="description">IPP message</td></tr>
4852<tr><th>name</th>
4853 <td class="description">Name of attribute</td></tr>
4854<tr><th>type</th>
4855 <td class="description">Type of attribute</td></tr>
4856</tbody></table>
798d6e29
MS
4857<h4 class="returnvalue">Return Value</h4>
4858 <p class="description">Matching attribute</p>
4859<h4 class="discussion">Discussion</h4>
4860 <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
4861of attribute and member names separated by slashes, for example
4862&quot;media-col/media-size&quot;.</p>
4863<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippFirstAttribute">ippFirstAttribute</a></h3>
4864 <p class="description">Return the first attribute in the message.</p>
4865<p class="code">
98d88c8d 4866<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFirstAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4867<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4868<table class="list"><tbody>
4869<tr><th>ipp</th>
4870 <td class="description">IPP message</td></tr>
4871</tbody></table>
798d6e29
MS
4872<h4 class="returnvalue">Return Value</h4>
4873 <p class="description">First attribute or <code>NULL</code> if none</p>
4874<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetBoolean">ippGetBoolean</a></h3>
4875 <p class="description">Get a boolean value for an attribute.</p>
4876<p class="code">
98d88c8d 4877int ippGetBoolean(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
798d6e29 4878<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4879<table class="list"><tbody>
4880<tr><th>attr</th>
4881 <td class="description">IPP attribute</td></tr>
4882<tr><th>element</th>
4883 <td class="description">Value number (0-based)</td></tr>
4884</tbody></table>
798d6e29
MS
4885<h4 class="returnvalue">Return Value</h4>
4886 <p class="description">Boolean value or 0 on error</p>
4887<h4 class="discussion">Discussion</h4>
4888 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4889<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4890
4891</p>
4892<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetCollection">ippGetCollection</a></h3>
4893 <p class="description">Get a collection value for an attribute.</p>
4894<p class="code">
98d88c8d 4895<a href="#ipp_t">ipp_t</a> *ippGetCollection(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
798d6e29 4896<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4897<table class="list"><tbody>
4898<tr><th>attr</th>
4899 <td class="description">IPP attribute</td></tr>
4900<tr><th>element</th>
4901 <td class="description">Value number (0-based)</td></tr>
4902</tbody></table>
798d6e29
MS
4903<h4 class="returnvalue">Return Value</h4>
4904 <p class="description">Collection value or <code>NULL</code> on error</p>
4905<h4 class="discussion">Discussion</h4>
4906 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4907<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4908
4909</p>
4910<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetCount">ippGetCount</a></h3>
4911 <p class="description">Get the number of values in an attribute.</p>
4912<p class="code">
98d88c8d 4913int ippGetCount(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 4914<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4915<table class="list"><tbody>
4916<tr><th>attr</th>
4917 <td class="description">IPP attribute</td></tr>
4918</tbody></table>
798d6e29
MS
4919<h4 class="returnvalue">Return Value</h4>
4920 <p class="description">Number of values or 0 on error</p>
4921<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetDate">ippGetDate</a></h3>
65bebeac 4922 <p class="description">Get a dateTime value for an attribute.</p>
798d6e29 4923<p class="code">
98d88c8d 4924const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippGetDate(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
798d6e29 4925<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4926<table class="list"><tbody>
4927<tr><th>attr</th>
4928 <td class="description">IPP attribute</td></tr>
4929<tr><th>element</th>
4930 <td class="description">Value number (0-based)</td></tr>
4931</tbody></table>
798d6e29 4932<h4 class="returnvalue">Return Value</h4>
65bebeac 4933 <p class="description">dateTime value or <code>NULL</code></p>
798d6e29
MS
4934<h4 class="discussion">Discussion</h4>
4935 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4936<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4937
4938</p>
4939<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetGroupTag">ippGetGroupTag</a></h3>
4940 <p class="description">Get the group associated with an attribute.</p>
4941<p class="code">
98d88c8d 4942ipp_tag_t ippGetGroupTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 4943<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4944<table class="list"><tbody>
4945<tr><th>attr</th>
4946 <td class="description">IPP attribute</td></tr>
4947</tbody></table>
798d6e29
MS
4948<h4 class="returnvalue">Return Value</h4>
4949 <p class="description">Group tag or <code>IPP_TAG_ZERO</code> on error</p>
4950<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetInteger">ippGetInteger</a></h3>
4951 <p class="description">Get the integer/enum value for an attribute.</p>
4952<p class="code">
98d88c8d 4953int ippGetInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
798d6e29 4954<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4955<table class="list"><tbody>
4956<tr><th>attr</th>
4957 <td class="description">IPP attribute</td></tr>
4958<tr><th>element</th>
4959 <td class="description">Value number (0-based)</td></tr>
4960</tbody></table>
798d6e29
MS
4961<h4 class="returnvalue">Return Value</h4>
4962 <p class="description">Value or 0 on error</p>
4963<h4 class="discussion">Discussion</h4>
4964 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4965<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4966
4967</p>
4968<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetName">ippGetName</a></h3>
4969 <p class="description">Get the attribute name.</p>
4970<p class="code">
98d88c8d 4971const char *ippGetName(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 4972<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4973<table class="list"><tbody>
4974<tr><th>attr</th>
4975 <td class="description">IPP attribute</td></tr>
4976</tbody></table>
798d6e29
MS
4977<h4 class="returnvalue">Return Value</h4>
4978 <p class="description">Attribute name or <code>NULL</code> for separators</p>
4979<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippGetOctetString">ippGetOctetString</a></h3>
4980 <p class="description">Get an octetString value from an IPP attribute.</p>
4981<p class="code">
98d88c8d
MS
4982void *ippGetOctetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *datalen);</p>
4983<h4 class="parameters">Parameters</h4>
4984<table class="list"><tbody>
4985<tr><th>attr</th>
4986 <td class="description">IPP attribute</td></tr>
4987<tr><th>element</th>
4988 <td class="description">Value number (0-based)</td></tr>
4989<tr><th>datalen</th>
4990 <td class="description">Length of octetString data</td></tr>
4991</tbody></table>
798d6e29
MS
4992<h4 class="returnvalue">Return Value</h4>
4993 <p class="description">Pointer to octetString data</p>
4994<h4 class="discussion">Discussion</h4>
4995 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4996<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4997
4998</p>
4999<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetOperation">ippGetOperation</a></h3>
5000 <p class="description">Get the operation ID in an IPP message.</p>
5001<p class="code">
98d88c8d 5002ipp_op_t ippGetOperation(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5003<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5004<table class="list"><tbody>
5005<tr><th>ipp</th>
5006 <td class="description">IPP request message</td></tr>
5007</tbody></table>
798d6e29
MS
5008<h4 class="returnvalue">Return Value</h4>
5009 <p class="description">Operation ID or 0 on error</p>
5010<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetRange">ippGetRange</a></h3>
5011 <p class="description">Get a rangeOfInteger value from an attribute.</p>
5012<p class="code">
98d88c8d
MS
5013int ippGetRange(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *uppervalue);</p>
5014<h4 class="parameters">Parameters</h4>
5015<table class="list"><tbody>
5016<tr><th>attr</th>
5017 <td class="description">IPP attribute</td></tr>
5018<tr><th>element</th>
5019 <td class="description">Value number (0-based)</td></tr>
5020<tr><th>uppervalue</th>
5021 <td class="description">Upper value of range</td></tr>
5022</tbody></table>
798d6e29
MS
5023<h4 class="returnvalue">Return Value</h4>
5024 <p class="description">Lower value of range or 0</p>
5025<h4 class="discussion">Discussion</h4>
5026 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 5027<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
5028
5029</p>
5030<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetRequestId">ippGetRequestId</a></h3>
5031 <p class="description">Get the request ID from an IPP message.</p>
5032<p class="code">
98d88c8d 5033int ippGetRequestId(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5034<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5035<table class="list"><tbody>
5036<tr><th>ipp</th>
5037 <td class="description">IPP message</td></tr>
5038</tbody></table>
798d6e29
MS
5039<h4 class="returnvalue">Return Value</h4>
5040 <p class="description">Request ID or 0 on error</p>
5041<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetResolution">ippGetResolution</a></h3>
5042 <p class="description">Get a resolution value for an attribute.</p>
5043<p class="code">
98d88c8d
MS
5044int 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>
5045<h4 class="parameters">Parameters</h4>
5046<table class="list"><tbody>
5047<tr><th>attr</th>
5048 <td class="description">IPP attribute</td></tr>
5049<tr><th>element</th>
5050 <td class="description">Value number (0-based)</td></tr>
5051<tr><th>yres</th>
5052 <td class="description">Vertical/feed resolution</td></tr>
5053<tr><th>units</th>
5054 <td class="description">Units for resolution</td></tr>
5055</tbody></table>
798d6e29
MS
5056<h4 class="returnvalue">Return Value</h4>
5057 <p class="description">Horizontal/cross feed resolution or 0</p>
5058<h4 class="discussion">Discussion</h4>
5059 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 5060<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
5061
5062</p>
5063<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetState">ippGetState</a></h3>
5064 <p class="description">Get the IPP message state.</p>
5065<p class="code">
98d88c8d 5066<a href="#ipp_state_t">ipp_state_t</a> ippGetState(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5067<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5068<table class="list"><tbody>
5069<tr><th>ipp</th>
5070 <td class="description">IPP message</td></tr>
5071</tbody></table>
798d6e29
MS
5072<h4 class="returnvalue">Return Value</h4>
5073 <p class="description">IPP message state value</p>
5074<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetStatusCode">ippGetStatusCode</a></h3>
5075 <p class="description">Get the status code from an IPP response or event message.</p>
5076<p class="code">
98d88c8d 5077ipp_status_t ippGetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5078<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5079<table class="list"><tbody>
5080<tr><th>ipp</th>
5081 <td class="description">IPP response or event message</td></tr>
5082</tbody></table>
798d6e29
MS
5083<h4 class="returnvalue">Return Value</h4>
5084 <p class="description">Status code in IPP message</p>
5085<h3 class="function"><a id="ippGetString">ippGetString</a></h3>
98d88c8d
MS
5086 <p class="description"></p>
5087<p class="code">
5088const char *ippGetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, const char **language);</p>
5089<h4 class="parameters">Parameters</h4>
5090<table class="list"><tbody>
5091<tr><th>attr</th>
5092 <td class="description">IPP attribute</td></tr>
5093<tr><th>element</th>
5094 <td class="description">Value number (0-based)</td></tr>
5095<tr><th>language</th>
5096 <td class="description">Language code (<code>NULL</code> for don't care)</td></tr>
5097</tbody></table>
798d6e29
MS
5098<h4 class="returnvalue">Return Value</h4>
5099 <p class="description">Get the string and optionally the language code for an attribute.</p>
5100 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 5101<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
5102
5103</p>
5104<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetValueTag">ippGetValueTag</a></h3>
5105 <p class="description">Get the value tag for an attribute.</p>
5106<p class="code">
98d88c8d 5107ipp_tag_t ippGetValueTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 5108<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5109<table class="list"><tbody>
5110<tr><th>attr</th>
5111 <td class="description">IPP attribute</td></tr>
5112</tbody></table>
798d6e29
MS
5113<h4 class="returnvalue">Return Value</h4>
5114 <p class="description">Value tag or <code>IPP_TAG_ZERO</code> on error</p>
5115<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetVersion">ippGetVersion</a></h3>
5116 <p class="description">Get the major and minor version number from an IPP message.</p>
5117<p class="code">
98d88c8d 5118int ippGetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int *minor);</p>
798d6e29 5119<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5120<table class="list"><tbody>
5121<tr><th>ipp</th>
5122 <td class="description">IPP message</td></tr>
5123<tr><th>minor</th>
65bebeac 5124 <td class="description">Minor version number or <code>NULL</code> for don't care</td></tr>
98d88c8d 5125</tbody></table>
798d6e29
MS
5126<h4 class="returnvalue">Return Value</h4>
5127 <p class="description">Major version number or 0 on error</p>
5128<h3 class="function"><a id="ippLength">ippLength</a></h3>
5129 <p class="description">Compute the length of an IPP message.</p>
5130<p class="code">
98d88c8d 5131size_t ippLength(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5132<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5133<table class="list"><tbody>
5134<tr><th>ipp</th>
5135 <td class="description">IPP message</td></tr>
5136</tbody></table>
798d6e29
MS
5137<h4 class="returnvalue">Return Value</h4>
5138 <p class="description">Size of IPP message</p>
5139<h3 class="function"><a id="ippNew">ippNew</a></h3>
5140 <p class="description">Allocate a new IPP message.</p>
5141<p class="code">
98d88c8d 5142<a href="#ipp_t">ipp_t</a> *ippNew(void);</p>
798d6e29
MS
5143<h4 class="returnvalue">Return Value</h4>
5144 <p class="description">New IPP message</p>
5145<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippNewRequest">ippNewRequest</a></h3>
5146 <p class="description">Allocate a new IPP request message.</p>
5147<p class="code">
98d88c8d 5148<a href="#ipp_t">ipp_t</a> *ippNewRequest(ipp_op_t op);</p>
798d6e29 5149<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5150<table class="list"><tbody>
5151<tr><th>op</th>
5152 <td class="description">Operation code</td></tr>
5153</tbody></table>
798d6e29
MS
5154<h4 class="returnvalue">Return Value</h4>
5155 <p class="description">IPP request message</p>
5156<h4 class="discussion">Discussion</h4>
65bebeac
MS
5157 <p class="discussion">The new request message is initialized with the &quot;attributes-charset&quot; and
5158&quot;attributes-natural-language&quot; attributes added. The
5159&quot;attributes-natural-language&quot; value is derived from the current locale.
798d6e29
MS
5160
5161</p>
5162<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippNewResponse">ippNewResponse</a></h3>
5163 <p class="description">Allocate a new IPP response message.</p>
5164<p class="code">
98d88c8d 5165<a href="#ipp_t">ipp_t</a> *ippNewResponse(<a href="#ipp_t">ipp_t</a> *request);</p>
798d6e29 5166<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5167<table class="list"><tbody>
5168<tr><th>request</th>
5169 <td class="description">IPP request message</td></tr>
5170</tbody></table>
798d6e29
MS
5171<h4 class="returnvalue">Return Value</h4>
5172 <p class="description">IPP response message</p>
5173<h4 class="discussion">Discussion</h4>
65bebeac
MS
5174 <p class="discussion">The new response message is initialized with the same &quot;version-number&quot;,
5175&quot;request-id&quot;, &quot;attributes-charset&quot;, and &quot;attributes-natural-language&quot; as the
5176provided request message. If the &quot;attributes-charset&quot; or
5177&quot;attributes-natural-language&quot; attributes are missing from the request,
5178'utf-8' and a value derived from the current locale are substituted,
798d6e29
MS
5179respectively.
5180
5181</p>
5182<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippNextAttribute">ippNextAttribute</a></h3>
5183 <p class="description">Return the next attribute in the message.</p>
5184<p class="code">
98d88c8d 5185<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippNextAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5186<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5187<table class="list"><tbody>
5188<tr><th>ipp</th>
5189 <td class="description">IPP message</td></tr>
5190</tbody></table>
798d6e29
MS
5191<h4 class="returnvalue">Return Value</h4>
5192 <p class="description">Next attribute or <code>NULL</code> if none</p>
5193<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippOpString">ippOpString</a></h3>
5194 <p class="description">Return a name for the given operation id.</p>
5195<p class="code">
98d88c8d 5196const char *ippOpString(ipp_op_t op);</p>
798d6e29 5197<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5198<table class="list"><tbody>
5199<tr><th>op</th>
5200 <td class="description">Operation ID</td></tr>
5201</tbody></table>
798d6e29
MS
5202<h4 class="returnvalue">Return Value</h4>
5203 <p class="description">Name</p>
5204<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippOpValue">ippOpValue</a></h3>
5205 <p class="description">Return an operation id for the given name.</p>
5206<p class="code">
98d88c8d 5207ipp_op_t ippOpValue(const char *name);</p>
798d6e29 5208<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5209<table class="list"><tbody>
5210<tr><th>name</th>
5211 <td class="description">Textual name</td></tr>
5212</tbody></table>
798d6e29
MS
5213<h4 class="returnvalue">Return Value</h4>
5214 <p class="description">Operation ID</p>
5215<h3 class="function"><a id="ippPort">ippPort</a></h3>
5216 <p class="description">Return the default IPP port number.</p>
5217<p class="code">
98d88c8d 5218int ippPort(void);</p>
798d6e29
MS
5219<h4 class="returnvalue">Return Value</h4>
5220 <p class="description">Port number</p>
5221<h3 class="function"><a id="ippRead">ippRead</a></h3>
5222 <p class="description">Read data for an IPP message from a HTTP connection.</p>
5223<p class="code">
98d88c8d 5224<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 5225<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5226<table class="list"><tbody>
5227<tr><th>http</th>
5228 <td class="description">HTTP connection</td></tr>
5229<tr><th>ipp</th>
5230 <td class="description">IPP data</td></tr>
5231</tbody></table>
798d6e29
MS
5232<h4 class="returnvalue">Return Value</h4>
5233 <p class="description">Current state</p>
5234<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippReadFile">ippReadFile</a></h3>
5235 <p class="description">Read data for an IPP message from a file.</p>
5236<p class="code">
98d88c8d 5237<a href="#ipp_state_t">ipp_state_t</a> ippReadFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5238<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5239<table class="list"><tbody>
5240<tr><th>fd</th>
5241 <td class="description">HTTP data</td></tr>
5242<tr><th>ipp</th>
5243 <td class="description">IPP data</td></tr>
5244</tbody></table>
798d6e29
MS
5245<h4 class="returnvalue">Return Value</h4>
5246 <p class="description">Current state</p>
5247<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippReadIO">ippReadIO</a></h3>
5248 <p class="description">Read data for an IPP message.</p>
5249<p class="code">
98d88c8d
MS
5250<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>
5251<h4 class="parameters">Parameters</h4>
5252<table class="list"><tbody>
5253<tr><th>src</th>
5254 <td class="description">Data source</td></tr>
5255<tr><th>cb</th>
5256 <td class="description">Read callback function</td></tr>
5257<tr><th>blocking</th>
5258 <td class="description">Use blocking IO?</td></tr>
5259<tr><th>parent</th>
5260 <td class="description">Parent request, if any</td></tr>
5261<tr><th>ipp</th>
5262 <td class="description">IPP data</td></tr>
5263</tbody></table>
798d6e29
MS
5264<h4 class="returnvalue">Return Value</h4>
5265 <p class="description">Current state</p>
5266<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetBoolean">ippSetBoolean</a></h3>
5267 <p class="description">Set a boolean value in an attribute.</p>
5268<p class="code">
98d88c8d
MS
5269int ippSetBoolean(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int boolvalue);</p>
5270<h4 class="parameters">Parameters</h4>
5271<table class="list"><tbody>
5272<tr><th>ipp</th>
5273 <td class="description">IPP message</td></tr>
5274<tr><th>attr</th>
5275 <td class="description">IPP attribute</td></tr>
5276<tr><th>element</th>
5277 <td class="description">Value number (0-based)</td></tr>
5278<tr><th>boolvalue</th>
5279 <td class="description">Boolean value</td></tr>
5280</tbody></table>
798d6e29
MS
5281<h4 class="returnvalue">Return Value</h4>
5282 <p class="description">1 on success, 0 on failure</p>
5283<h4 class="discussion">Discussion</h4>
5284 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5285the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5286<br>
5287The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5288<br>
5289The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5290<code>ippGetCount(attr)</code>.
798d6e29
MS
5291
5292</p>
5293<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetCollection">ippSetCollection</a></h3>
5294 <p class="description">Set a collection value in an attribute.</p>
5295<p class="code">
98d88c8d
MS
5296int 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>
5297<h4 class="parameters">Parameters</h4>
5298<table class="list"><tbody>
5299<tr><th>ipp</th>
5300 <td class="description">IPP message</td></tr>
5301<tr><th>attr</th>
5302 <td class="description">IPP attribute</td></tr>
5303<tr><th>element</th>
5304 <td class="description">Value number (0-based)</td></tr>
5305<tr><th>colvalue</th>
5306 <td class="description">Collection value</td></tr>
5307</tbody></table>
798d6e29
MS
5308<h4 class="returnvalue">Return Value</h4>
5309 <p class="description">1 on success, 0 on failure</p>
5310<h4 class="discussion">Discussion</h4>
5311 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5312the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5313<br>
5314The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5315<br>
5316The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5317<code>ippGetCount(attr)</code>.
798d6e29
MS
5318
5319</p>
5320<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetDate">ippSetDate</a></h3>
65bebeac 5321 <p class="description">Set a dateTime value in an attribute.</p>
798d6e29 5322<p class="code">
98d88c8d
MS
5323int 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>
5324<h4 class="parameters">Parameters</h4>
5325<table class="list"><tbody>
5326<tr><th>ipp</th>
5327 <td class="description">IPP message</td></tr>
5328<tr><th>attr</th>
5329 <td class="description">IPP attribute</td></tr>
5330<tr><th>element</th>
5331 <td class="description">Value number (0-based)</td></tr>
5332<tr><th>datevalue</th>
65bebeac 5333 <td class="description">dateTime value</td></tr>
98d88c8d 5334</tbody></table>
798d6e29
MS
5335<h4 class="returnvalue">Return Value</h4>
5336 <p class="description">1 on success, 0 on failure</p>
5337<h4 class="discussion">Discussion</h4>
5338 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5339the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5340<br>
5341The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5342<br>
5343The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5344<code>ippGetCount(attr)</code>.
798d6e29
MS
5345
5346</p>
5347<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetGroupTag">ippSetGroupTag</a></h3>
5348 <p class="description">Set the group tag of an attribute.</p>
5349<p class="code">
98d88c8d
MS
5350int 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>
5351<h4 class="parameters">Parameters</h4>
5352<table class="list"><tbody>
5353<tr><th>ipp</th>
5354 <td class="description">IPP message</td></tr>
5355<tr><th>attr</th>
5356 <td class="description">Attribute</td></tr>
5357<tr><th>group_tag</th>
5358 <td class="description">Group tag</td></tr>
5359</tbody></table>
798d6e29
MS
5360<h4 class="returnvalue">Return Value</h4>
5361 <p class="description">1 on success, 0 on failure</p>
5362<h4 class="discussion">Discussion</h4>
5363 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5364the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5365<br>
5366The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5367<br>
5368The <code>group</code> parameter specifies the IPP attribute group tag: none
5369(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
5370event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
5371(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
5372(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
5373
5374</p>
5375<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetInteger">ippSetInteger</a></h3>
5376 <p class="description">Set an integer or enum value in an attribute.</p>
5377<p class="code">
98d88c8d
MS
5378int ippSetInteger(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int intvalue);</p>
5379<h4 class="parameters">Parameters</h4>
5380<table class="list"><tbody>
5381<tr><th>ipp</th>
5382 <td class="description">IPP message</td></tr>
5383<tr><th>attr</th>
5384 <td class="description">IPP attribute</td></tr>
5385<tr><th>element</th>
5386 <td class="description">Value number (0-based)</td></tr>
5387<tr><th>intvalue</th>
5388 <td class="description">Integer/enum value</td></tr>
5389</tbody></table>
798d6e29
MS
5390<h4 class="returnvalue">Return Value</h4>
5391 <p class="description">1 on success, 0 on failure</p>
5392<h4 class="discussion">Discussion</h4>
5393 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5394the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5395<br>
5396The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5397<br>
5398The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5399<code>ippGetCount(attr)</code>.
798d6e29
MS
5400
5401</p>
5402<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetName">ippSetName</a></h3>
5403 <p class="description">Set the name of an attribute.</p>
5404<p class="code">
98d88c8d
MS
5405int ippSetName(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, const char *name);</p>
5406<h4 class="parameters">Parameters</h4>
5407<table class="list"><tbody>
5408<tr><th>ipp</th>
5409 <td class="description">IPP message</td></tr>
5410<tr><th>attr</th>
5411 <td class="description">IPP attribute</td></tr>
5412<tr><th>name</th>
5413 <td class="description">Attribute name</td></tr>
5414</tbody></table>
798d6e29
MS
5415<h4 class="returnvalue">Return Value</h4>
5416 <p class="description">1 on success, 0 on failure</p>
5417<h4 class="discussion">Discussion</h4>
5418 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5419the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5420<br>
5421The <code>attr</code> parameter may be modified as a result of setting the value.
5422
5423</p>
5424<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetOctetString">ippSetOctetString</a></h3>
5425 <p class="description">Set an octetString value in an IPP attribute.</p>
5426<p class="code">
98d88c8d
MS
5427int 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>
5428<h4 class="parameters">Parameters</h4>
5429<table class="list"><tbody>
5430<tr><th>ipp</th>
5431 <td class="description">IPP message</td></tr>
5432<tr><th>attr</th>
5433 <td class="description">IPP attribute</td></tr>
5434<tr><th>element</th>
5435 <td class="description">Value number (0-based)</td></tr>
5436<tr><th>data</th>
5437 <td class="description">Pointer to octetString data</td></tr>
5438<tr><th>datalen</th>
5439 <td class="description">Length of octetString data</td></tr>
5440</tbody></table>
798d6e29
MS
5441<h4 class="returnvalue">Return Value</h4>
5442 <p class="description">1 on success, 0 on failure</p>
5443<h4 class="discussion">Discussion</h4>
5444 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5445the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5446<br>
5447The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5448<br>
5449The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5450<code>ippGetCount(attr)</code>.
798d6e29
MS
5451
5452</p>
5453<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetOperation">ippSetOperation</a></h3>
5454 <p class="description">Set the operation ID in an IPP request message.</p>
5455<p class="code">
98d88c8d 5456int ippSetOperation(<a href="#ipp_t">ipp_t</a> *ipp, ipp_op_t op);</p>
798d6e29 5457<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5458<table class="list"><tbody>
5459<tr><th>ipp</th>
5460 <td class="description">IPP request message</td></tr>
5461<tr><th>op</th>
5462 <td class="description">Operation ID</td></tr>
5463</tbody></table>
798d6e29
MS
5464<h4 class="returnvalue">Return Value</h4>
5465 <p class="description">1 on success, 0 on failure</p>
5466<h4 class="discussion">Discussion</h4>
5467 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5468the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
5469
5470</p>
5471<h3 class="function"><a id="ippSetPort">ippSetPort</a></h3>
98d88c8d 5472 <p class="description">Set the default port number.</p>
798d6e29 5473<p class="code">
98d88c8d 5474void ippSetPort(int p);</p>
798d6e29 5475<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5476<table class="list"><tbody>
5477<tr><th>p</th>
5478 <td class="description">Port number to use</td></tr>
5479</tbody></table>
798d6e29
MS
5480<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetRange">ippSetRange</a></h3>
5481 <p class="description">Set a rangeOfInteger value in an attribute.</p>
5482<p class="code">
98d88c8d
MS
5483int 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>
5484<h4 class="parameters">Parameters</h4>
5485<table class="list"><tbody>
5486<tr><th>ipp</th>
5487 <td class="description">IPP message</td></tr>
5488<tr><th>attr</th>
5489 <td class="description">IPP attribute</td></tr>
5490<tr><th>element</th>
5491 <td class="description">Value number (0-based)</td></tr>
5492<tr><th>lowervalue</th>
5493 <td class="description">Lower bound for range</td></tr>
5494<tr><th>uppervalue</th>
5495 <td class="description">Upper bound for range</td></tr>
5496</tbody></table>
798d6e29
MS
5497<h4 class="returnvalue">Return Value</h4>
5498 <p class="description">1 on success, 0 on failure</p>
5499<h4 class="discussion">Discussion</h4>
5500 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5501the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5502<br>
5503The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5504<br>
5505The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5506<code>ippGetCount(attr)</code>.
798d6e29
MS
5507
5508</p>
5509<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetRequestId">ippSetRequestId</a></h3>
5510 <p class="description">Set the request ID in an IPP message.</p>
5511<p class="code">
98d88c8d 5512int ippSetRequestId(<a href="#ipp_t">ipp_t</a> *ipp, int request_id);</p>
798d6e29 5513<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5514<table class="list"><tbody>
5515<tr><th>ipp</th>
5516 <td class="description">IPP message</td></tr>
5517<tr><th>request_id</th>
5518 <td class="description">Request ID</td></tr>
5519</tbody></table>
798d6e29
MS
5520<h4 class="returnvalue">Return Value</h4>
5521 <p class="description">1 on success, 0 on failure</p>
5522<h4 class="discussion">Discussion</h4>
5523 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5524the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5525<br>
5526The <code>request_id</code> parameter must be greater than 0.
5527
5528</p>
5529<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetResolution">ippSetResolution</a></h3>
5530 <p class="description">Set a resolution value in an attribute.</p>
5531<p class="code">
98d88c8d
MS
5532int 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>
5533<h4 class="parameters">Parameters</h4>
5534<table class="list"><tbody>
5535<tr><th>ipp</th>
5536 <td class="description">IPP message</td></tr>
5537<tr><th>attr</th>
5538 <td class="description">IPP attribute</td></tr>
5539<tr><th>element</th>
5540 <td class="description">Value number (0-based)</td></tr>
5541<tr><th>unitsvalue</th>
5542 <td class="description">Resolution units</td></tr>
5543<tr><th>xresvalue</th>
5544 <td class="description">Horizontal/cross feed resolution</td></tr>
5545<tr><th>yresvalue</th>
5546 <td class="description">Vertical/feed resolution</td></tr>
5547</tbody></table>
798d6e29
MS
5548<h4 class="returnvalue">Return Value</h4>
5549 <p class="description">1 on success, 0 on failure</p>
5550<h4 class="discussion">Discussion</h4>
5551 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5552the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5553<br>
5554The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5555<br>
5556The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5557<code>ippGetCount(attr)</code>.
798d6e29
MS
5558
5559</p>
5560<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetState">ippSetState</a></h3>
5561 <p class="description">Set the current state of the IPP message.</p>
5562<p class="code">
98d88c8d 5563int ippSetState(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_state_t">ipp_state_t</a> state);</p>
798d6e29 5564<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5565<table class="list"><tbody>
5566<tr><th>ipp</th>
5567 <td class="description">IPP message</td></tr>
5568<tr><th>state</th>
5569 <td class="description">IPP state value</td></tr>
5570</tbody></table>
798d6e29
MS
5571<h4 class="returnvalue">Return Value</h4>
5572 <p class="description">1 on success, 0 on failure</p>
5573<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetStatusCode">ippSetStatusCode</a></h3>
5574 <p class="description">Set the status code in an IPP response or event message.</p>
5575<p class="code">
98d88c8d 5576int ippSetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp, ipp_status_t status);</p>
798d6e29 5577<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5578<table class="list"><tbody>
5579<tr><th>ipp</th>
5580 <td class="description">IPP response or event message</td></tr>
5581<tr><th>status</th>
5582 <td class="description">Status code</td></tr>
5583</tbody></table>
798d6e29
MS
5584<h4 class="returnvalue">Return Value</h4>
5585 <p class="description">1 on success, 0 on failure</p>
5586<h4 class="discussion">Discussion</h4>
5587 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5588the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
5589
5590</p>
5591<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetString">ippSetString</a></h3>
5592 <p class="description">Set a string value in an attribute.</p>
5593<p class="code">
98d88c8d
MS
5594int 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>
5595<h4 class="parameters">Parameters</h4>
5596<table class="list"><tbody>
5597<tr><th>ipp</th>
5598 <td class="description">IPP message</td></tr>
5599<tr><th>attr</th>
5600 <td class="description">IPP attribute</td></tr>
5601<tr><th>element</th>
5602 <td class="description">Value number (0-based)</td></tr>
5603<tr><th>strvalue</th>
5604 <td class="description">String value</td></tr>
5605</tbody></table>
798d6e29
MS
5606<h4 class="returnvalue">Return Value</h4>
5607 <p class="description">1 on success, 0 on failure</p>
5608<h4 class="discussion">Discussion</h4>
5609 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5610the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5611<br>
5612The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5613<br>
5614The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5615<code>ippGetCount(attr)</code>.
798d6e29
MS
5616
5617</p>
5618<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetStringf">ippSetStringf</a></h3>
5619 <p class="description">Set a formatted string value of an attribute.</p>
5620<p class="code">
98d88c8d
MS
5621int 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>
5622<h4 class="parameters">Parameters</h4>
5623<table class="list"><tbody>
5624<tr><th>ipp</th>
5625 <td class="description">IPP message</td></tr>
5626<tr><th>attr</th>
5627 <td class="description">IPP attribute</td></tr>
5628<tr><th>element</th>
5629 <td class="description">Value number (0-based)</td></tr>
5630<tr><th>format</th>
5631 <td class="description">Printf-style format string</td></tr>
5632<tr><th>...</th>
5633 <td class="description">Additional arguments as needed</td></tr>
5634</tbody></table>
798d6e29
MS
5635<h4 class="returnvalue">Return Value</h4>
5636 <p class="description">1 on success, 0 on failure</p>
5637<h4 class="discussion">Discussion</h4>
5638 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5639the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5640<br>
5641The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5642<br>
5643The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5644<code>ippGetCount(attr)</code>.<br>
798d6e29
MS
5645<br>
5646The <code>format</code> parameter uses formatting characters compatible with the
5647printf family of standard functions. Additional arguments follow it as
5648needed. The formatted string is truncated as needed to the maximum length of
5649the corresponding value type.
5650
5651</p>
5652<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetStringfv">ippSetStringfv</a></h3>
5653 <p class="description">Set a formatted string value of an attribute.</p>
5654<p class="code">
98d88c8d
MS
5655int 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>
5656<h4 class="parameters">Parameters</h4>
5657<table class="list"><tbody>
5658<tr><th>ipp</th>
5659 <td class="description">IPP message</td></tr>
5660<tr><th>attr</th>
5661 <td class="description">IPP attribute</td></tr>
5662<tr><th>element</th>
5663 <td class="description">Value number (0-based)</td></tr>
5664<tr><th>format</th>
5665 <td class="description">Printf-style format string</td></tr>
5666<tr><th>ap</th>
5667 <td class="description">Pointer to additional arguments</td></tr>
5668</tbody></table>
798d6e29
MS
5669<h4 class="returnvalue">Return Value</h4>
5670 <p class="description">1 on success, 0 on failure</p>
5671<h4 class="discussion">Discussion</h4>
5672 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5673the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5674<br>
5675The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5676<br>
5677The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5678<code>ippGetCount(attr)</code>.<br>
798d6e29
MS
5679<br>
5680The <code>format</code> parameter uses formatting characters compatible with the
5681printf family of standard functions. Additional arguments follow it as
5682needed. The formatted string is truncated as needed to the maximum length of
5683the corresponding value type.
5684
5685</p>
5686<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetValueTag">ippSetValueTag</a></h3>
5687 <p class="description">Set the value tag of an attribute.</p>
5688<p class="code">
98d88c8d
MS
5689int 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>
5690<h4 class="parameters">Parameters</h4>
5691<table class="list"><tbody>
5692<tr><th>ipp</th>
5693 <td class="description">IPP message</td></tr>
5694<tr><th>attr</th>
5695 <td class="description">IPP attribute</td></tr>
5696<tr><th>value_tag</th>
5697 <td class="description">Value tag</td></tr>
5698</tbody></table>
798d6e29
MS
5699<h4 class="returnvalue">Return Value</h4>
5700 <p class="description">1 on success, 0 on failure</p>
5701<h4 class="discussion">Discussion</h4>
5702 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5703the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5704<br>
5705The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5706<br>
5707Integer (<code>IPP_TAG_INTEGER</code>) values can be promoted to rangeOfInteger
5708(<code>IPP_TAG_RANGE</code>) values, the various string tags can be promoted to name
5709(<code>IPP_TAG_NAME</code>) or nameWithLanguage (<code>IPP_TAG_NAMELANG</code>) values, text
5710(<code>IPP_TAG_TEXT</code>) values can be promoted to textWithLanguage
5711(<code>IPP_TAG_TEXTLANG</code>) values, and all values can be demoted to the various
5712out-of-band value tags such as no-value (<code>IPP_TAG_NOVALUE</code>). All other changes
5713will be rejected.<br>
5714<br>
5715Promoting a string attribute to nameWithLanguage or textWithLanguage adds the language
5716code in the &quot;attributes-natural-language&quot; attribute or, if not present, the language
5717code for the current locale.
5718
5719</p>
5720<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetVersion">ippSetVersion</a></h3>
5721 <p class="description">Set the version number in an IPP message.</p>
5722<p class="code">
98d88c8d
MS
5723int ippSetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int major, int minor);</p>
5724<h4 class="parameters">Parameters</h4>
5725<table class="list"><tbody>
5726<tr><th>ipp</th>
5727 <td class="description">IPP message</td></tr>
5728<tr><th>major</th>
5729 <td class="description">Major version number (major.minor)</td></tr>
5730<tr><th>minor</th>
5731 <td class="description">Minor version number (major.minor)</td></tr>
5732</tbody></table>
798d6e29
MS
5733<h4 class="returnvalue">Return Value</h4>
5734 <p class="description">1 on success, 0 on failure</p>
5735<h4 class="discussion">Discussion</h4>
5736 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5737the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5738<br>
5739The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2.
5740
5741</p>
5742<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="ippStateString">ippStateString</a></h3>
5743 <p class="description">Return the name corresponding to a state value.</p>
5744<p class="code">
98d88c8d 5745const char *ippStateString(<a href="#ipp_state_t">ipp_state_t</a> state);</p>
798d6e29 5746<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5747<table class="list"><tbody>
5748<tr><th>state</th>
5749 <td class="description">State value</td></tr>
5750</tbody></table>
798d6e29
MS
5751<h4 class="returnvalue">Return Value</h4>
5752 <p class="description">State name</p>
5753<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="ippTagString">ippTagString</a></h3>
5754 <p class="description">Return the tag name corresponding to a tag value.</p>
5755<p class="code">
98d88c8d 5756const char *ippTagString(ipp_tag_t tag);</p>
798d6e29 5757<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5758<table class="list"><tbody>
5759<tr><th>tag</th>
5760 <td class="description">Tag value</td></tr>
5761</tbody></table>
798d6e29
MS
5762<h4 class="returnvalue">Return Value</h4>
5763 <p class="description">Tag name</p>
5764<h4 class="discussion">Discussion</h4>
65bebeac 5765 <p class="discussion">The returned names are defined in RFC 8011 and the IANA IPP Registry.
798d6e29
MS
5766
5767</p>
5768<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="ippTagValue">ippTagValue</a></h3>
5769 <p class="description">Return the tag value corresponding to a tag name.</p>
5770<p class="code">
98d88c8d 5771ipp_tag_t ippTagValue(const char *name);</p>
798d6e29 5772<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5773<table class="list"><tbody>
5774<tr><th>name</th>
5775 <td class="description">Tag name</td></tr>
5776</tbody></table>
798d6e29
MS
5777<h4 class="returnvalue">Return Value</h4>
5778 <p class="description">Tag value</p>
5779<h4 class="discussion">Discussion</h4>
65bebeac 5780 <p class="discussion">The tag names are defined in RFC 8011 and the IANA IPP Registry.
798d6e29
MS
5781
5782</p>
5783<h3 class="function"><a id="ippTimeToDate">ippTimeToDate</a></h3>
65bebeac 5784 <p class="description">Convert from time in seconds to RFC 2579 format.</p>
798d6e29 5785<p class="code">
98d88c8d 5786const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippTimeToDate(time_t t);</p>
798d6e29 5787<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5788<table class="list"><tbody>
5789<tr><th>t</th>
65bebeac 5790 <td class="description">Time in seconds</td></tr>
98d88c8d 5791</tbody></table>
798d6e29 5792<h4 class="returnvalue">Return Value</h4>
65bebeac 5793 <p class="description">RFC-2579 date/time data</p>
798d6e29
MS
5794<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippValidateAttribute">ippValidateAttribute</a></h3>
5795 <p class="description">Validate the contents of an attribute.</p>
5796<p class="code">
98d88c8d 5797int ippValidateAttribute(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 5798<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5799<table class="list"><tbody>
5800<tr><th>attr</th>
5801 <td class="description">Attribute</td></tr>
5802</tbody></table>
798d6e29
MS
5803<h4 class="returnvalue">Return Value</h4>
5804 <p class="description">1 if valid, 0 otherwise</p>
5805<h4 class="discussion">Discussion</h4>
5806 <p class="discussion">This function validates the contents of an attribute based on the name and
5807value tag. 1 is returned if the attribute is valid, 0 otherwise. On
65bebeac 5808failure, <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> is set to a human-readable message.
798d6e29
MS
5809
5810</p>
5811<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippValidateAttributes">ippValidateAttributes</a></h3>
5812 <p class="description">Validate all attributes in an IPP message.</p>
5813<p class="code">
98d88c8d 5814int ippValidateAttributes(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5815<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5816<table class="list"><tbody>
5817<tr><th>ipp</th>
5818 <td class="description">IPP message</td></tr>
5819</tbody></table>
798d6e29
MS
5820<h4 class="returnvalue">Return Value</h4>
5821 <p class="description">1 if valid, 0 otherwise</p>
5822<h4 class="discussion">Discussion</h4>
5823 <p class="discussion">This function validates the contents of the IPP message, including each
65bebeac
MS
5824attribute. Like <a href="#ippValidateAttribute"><code>ippValidateAttribute</code></a>, <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> is
5825set to a human-readable message on failure.
798d6e29
MS
5826
5827</p>
5828<h3 class="function"><a id="ippWrite">ippWrite</a></h3>
5829 <p class="description">Write data for an IPP message to a HTTP connection.</p>
5830<p class="code">
98d88c8d 5831<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 5832<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5833<table class="list"><tbody>
5834<tr><th>http</th>
5835 <td class="description">HTTP connection</td></tr>
5836<tr><th>ipp</th>
5837 <td class="description">IPP data</td></tr>
5838</tbody></table>
798d6e29
MS
5839<h4 class="returnvalue">Return Value</h4>
5840 <p class="description">Current state</p>
5841<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippWriteFile">ippWriteFile</a></h3>
5842 <p class="description">Write data for an IPP message to a file.</p>
5843<p class="code">
98d88c8d 5844<a href="#ipp_state_t">ipp_state_t</a> ippWriteFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5845<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5846<table class="list"><tbody>
5847<tr><th>fd</th>
5848 <td class="description">HTTP data</td></tr>
5849<tr><th>ipp</th>
5850 <td class="description">IPP data</td></tr>
5851</tbody></table>
798d6e29
MS
5852<h4 class="returnvalue">Return Value</h4>
5853 <p class="description">Current state</p>
5854<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippWriteIO">ippWriteIO</a></h3>
5855 <p class="description">Write data for an IPP message.</p>
5856<p class="code">
98d88c8d
MS
5857<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>
5858<h4 class="parameters">Parameters</h4>
5859<table class="list"><tbody>
5860<tr><th>dst</th>
5861 <td class="description">Destination</td></tr>
5862<tr><th>cb</th>
5863 <td class="description">Write callback function</td></tr>
5864<tr><th>blocking</th>
5865 <td class="description">Use blocking IO?</td></tr>
5866<tr><th>parent</th>
5867 <td class="description">Parent IPP message</td></tr>
5868<tr><th>ipp</th>
5869 <td class="description">IPP data</td></tr>
5870</tbody></table>
798d6e29
MS
5871<h4 class="returnvalue">Return Value</h4>
5872 <p class="description">Current state</p>
798d6e29 5873 <h2 class="title"><a id="TYPES">Data Types</a></h2>
798d6e29
MS
5874 <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>
5875 <p class="description">Client credentials callback
5876</p>
5877 <p class="code">
53af7f21 5878typedef int(*)(http_t *http, void *tls, cups_array_t *distinguished_names, void *user_data)cups_client_cert_cb_t;
798d6e29
MS
5879</p>
5880 <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>
5881 <p class="description">Destination enumeration callback
5882</p>
5883 <p class="code">
5884typedef int(*)(void *user_data, unsigned flags, <a href="#cups_dest_t">cups_dest_t</a> *dest)cups_dest_cb_t;
5885</p>
5886 <h3 class="typedef"><a id="cups_dest_t">cups_dest_t</a></h3>
5887 <p class="description">Destination</p>
5888 <p class="code">
5889typedef struct <a href="#cups_dest_s">cups_dest_s</a> cups_dest_t;
5890</p>
5891 <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>
5892 <p class="description">Destination capability and status
5893information </p>
5894 <p class="code">
5895typedef struct _cups_dinfo_s cups_dinfo_t;
798d6e29
MS
5896</p>
5897 <h3 class="typedef"><a id="cups_job_t">cups_job_t</a></h3>
5898 <p class="description">Job</p>
5899 <p class="code">
5900typedef struct <a href="#cups_job_s">cups_job_s</a> cups_job_t;
798d6e29
MS
5901</p>
5902 <h3 class="typedef"><a id="cups_option_t">cups_option_t</a></h3>
5903 <p class="description">Printer Options</p>
5904 <p class="code">
5905typedef struct <a href="#cups_option_s">cups_option_s</a> cups_option_t;
5906</p>
5907 <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>
5908 <p class="description">New password callback
5909</p>
5910 <p class="code">
5911typedef 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
5912</p>
5913 <h3 class="typedef"><a id="cups_ptype_t">cups_ptype_t</a></h3>
5914 <p class="description">Printer type/capability bits</p>
5915 <p class="code">
5916typedef unsigned cups_ptype_t;
5917</p>
5918 <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>
5919 <p class="description">Server credentials callback
5920</p>
5921 <p class="code">
53af7f21 5922typedef int(*)(http_t *http, void *tls, cups_array_t *certs, void *user_data)cups_server_cert_cb_t;
798d6e29
MS
5923</p>
5924 <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>
5925 <p class="description">Media Size </p>
5926 <p class="code">
5927typedef struct <a href="#cups_size_s">cups_size_s</a> cups_size_t;
798d6e29
MS
5928</p>
5929 <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>
5930 <p class="description">Socket address union, which
5931makes using IPv6 and other
5932address types easier and
5933more portable. </p>
5934 <p class="code">
5935typedef union _http_addr_u / http_addr_t;
798d6e29
MS
5936</p>
5937 <h3 class="typedef"><a id="http_encoding_t">http_encoding_t</a></h3>
5938 <p class="description">HTTP transfer encoding values</p>
5939 <p class="code">
5940typedef enum <a href="#http_encoding_e">http_encoding_e</a> http_encoding_t;
5941</p>
5942 <h3 class="typedef"><a id="http_encryption_t">http_encryption_t</a></h3>
5943 <p class="description">HTTP encryption values</p>
5944 <p class="code">
5945typedef enum <a href="#http_encryption_e">http_encryption_e</a> http_encryption_t;
5946</p>
5947 <h3 class="typedef"><a id="http_field_t">http_field_t</a></h3>
5948 <p class="description">HTTP field names</p>
5949 <p class="code">
5950typedef enum <a href="#http_field_e">http_field_e</a> http_field_t;
5951</p>
5952 <h3 class="typedef"><a id="http_keepalive_t">http_keepalive_t</a></h3>
5953 <p class="description">HTTP keep-alive values</p>
5954 <p class="code">
5955typedef enum <a href="#http_keepalive_e">http_keepalive_e</a> http_keepalive_t;
5956</p>
5957 <h3 class="typedef"><a id="http_state_t">http_state_t</a></h3>
5958 <p class="description">HTTP state values; states
5959are server-oriented...</p>
5960 <p class="code">
5961typedef enum <a href="#http_state_e">http_state_e</a> http_state_t;
5962</p>
5963 <h3 class="typedef"><a id="http_t">http_t</a></h3>
5964 <p class="description">HTTP connection type</p>
5965 <p class="code">
5966typedef struct _http_s http_t;
5967</p>
5968 <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>
5969 <p class="description">HTTP timeout callback </p>
5970 <p class="code">
5971typedef int(*)(http_t *http, void *user_data)http_timeout_cb_t;
5972</p>
5973 <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>
5974 <p class="description">Level of trust for credentials </p>
5975 <p class="code">
5976typedef enum <a href="#http_trust_e">http_trust_e</a> http_trust_t;
5977</p>
5978 <h3 class="typedef"><a id="http_uri_coding_t">http_uri_coding_t</a></h3>
5979 <p class="description">URI en/decode flags</p>
5980 <p class="code">
5981typedef enum <a href="#http_uri_coding_e">http_uri_coding_e</a> http_uri_coding_t;
5982</p>
5983 <h3 class="typedef"><a id="http_uri_status_t"><span class="info">&#160;CUPS 1.2&#160;</span>http_uri_status_t</a></h3>
5984 <p class="description">URI separation status </p>
5985 <p class="code">
5986typedef enum <a href="#http_uri_status_e">http_uri_status_e</a> http_uri_status_t;
798d6e29
MS
5987</p>
5988 <h3 class="typedef"><a id="ipp_attribute_t">ipp_attribute_t</a></h3>
5989 <p class="description">IPP attribute</p>
5990 <p class="code">
5991typedef struct _ipp_attribute_s ipp_attribute_t;
5992</p>
65bebeac
MS
5993 <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>
5994 <p class="description">ippCopyAttributes callback function </p>
798d6e29
MS
5995 <p class="code">
5996typedef 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
5997</p>
5998 <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 5999 <p class="description">ippReadIO/ippWriteIO callback function </p>
798d6e29 6000 <p class="code">
98d88c8d 6001typedef ssize_t(*)(void *context, ipp_uchar_t *buffer, size_t bytes) ipp_iocb_t;
798d6e29
MS
6002</p>
6003 <h3 class="typedef"><a id="ipp_orient_t">ipp_orient_t</a></h3>
6004 <p class="description">Orientation values</p>
6005 <p class="code">
6006typedef enum <a href="#ipp_orient_e">ipp_orient_e</a> ipp_orient_t;
6007</p>
6008 <h3 class="typedef"><a id="ipp_pstate_t">ipp_pstate_t</a></h3>
65bebeac 6009 <p class="description">Printer state values</p>
798d6e29
MS
6010 <p class="code">
6011typedef enum <a href="#ipp_pstate_e">ipp_pstate_e</a> ipp_pstate_t;
6012</p>
6013 <h3 class="typedef"><a id="ipp_quality_t">ipp_quality_t</a></h3>
65bebeac 6014 <p class="description">Print quality values</p>
798d6e29
MS
6015 <p class="code">
6016typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t;
6017</p>
6018 <h3 class="typedef"><a id="ipp_res_t">ipp_res_t</a></h3>
6019 <p class="description">Resolution units</p>
6020 <p class="code">
6021typedef enum <a href="#ipp_res_e">ipp_res_e</a> ipp_res_t;
06a5a4d3
MS
6022</p>
6023 <h3 class="typedef"><a id="ipp_rstate_t">ipp_rstate_t</a></h3>
6024 <p class="description">resource-state values</p>
6025 <p class="code">
6026typedef enum <a href="#ipp_rstate_e">ipp_rstate_e</a> ipp_rstate_t;
6027</p>
6028 <h3 class="typedef"><a id="ipp_sstate_t">ipp_sstate_t</a></h3>
6029 <p class="description">system-state values</p>
6030 <p class="code">
6031typedef enum <a href="#ipp_sstate_e">ipp_sstate_e</a> ipp_sstate_t;
798d6e29
MS
6032</p>
6033 <h3 class="typedef"><a id="ipp_state_t">ipp_state_t</a></h3>
65bebeac 6034 <p class="description">ipp_t state values</p>
798d6e29
MS
6035 <p class="code">
6036typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t;
6037</p>
6038 <h3 class="typedef"><a id="ipp_t">ipp_t</a></h3>
6039 <p class="description">IPP request/response data</p>
6040 <p class="code">
6041typedef struct _ipp_s ipp_t;
798d6e29
MS
6042</p>
6043 <h2 class="title"><a id="STRUCTURES">Structures</a></h2>
798d6e29
MS
6044<h3 class="struct"><a id="cups_dest_s">cups_dest_s</a></h3>
6045 <p class="description">Destination</p>
6046<p class="code">struct cups_dest_s {<br>
6047&#160;&#160;&#160;&#160;char *name, *instance;<br>
6048&#160;&#160;&#160;&#160;int is_default;<br>
6049&#160;&#160;&#160;&#160;int num_options;<br>
6050&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options;<br>
6051};</p>
6052<h4 class="members">Members</h4>
98d88c8d
MS
6053<table class="list"><tbody>
6054<tr><th>instance </th>
6055 <td class="description">Local instance name or NULL</td></tr>
6056<tr><th>is_default </th>
6057 <td class="description">Is this printer the default?</td></tr>
6058<tr><th>num_options </th>
6059 <td class="description">Number of options</td></tr>
6060<tr><th>options </th>
6061 <td class="description">Options</td></tr>
6062</tbody></table>
798d6e29
MS
6063<h3 class="struct"><a id="cups_job_s">cups_job_s</a></h3>
6064 <p class="description">Job</p>
6065<p class="code">struct cups_job_s {<br>
6066&#160;&#160;&#160;&#160;time_t completed_time;<br>
6067&#160;&#160;&#160;&#160;time_t creation_time;<br>
6068&#160;&#160;&#160;&#160;char *dest;<br>
6069&#160;&#160;&#160;&#160;char *format;<br>
6070&#160;&#160;&#160;&#160;int id;<br>
6071&#160;&#160;&#160;&#160;int priority;<br>
6072&#160;&#160;&#160;&#160;time_t processing_time;<br>
6073&#160;&#160;&#160;&#160;int size;<br>
6074&#160;&#160;&#160;&#160;ipp_jstate_t state;<br>
6075&#160;&#160;&#160;&#160;char *title;<br>
6076&#160;&#160;&#160;&#160;char *user;<br>
6077};</p>
6078<h4 class="members">Members</h4>
98d88c8d
MS
6079<table class="list"><tbody>
6080<tr><th>completed_time </th>
6081 <td class="description">Time the job was completed</td></tr>
6082<tr><th>creation_time </th>
6083 <td class="description">Time the job was created</td></tr>
6084<tr><th>dest </th>
6085 <td class="description">Printer or class name</td></tr>
6086<tr><th>format </th>
6087 <td class="description">Document format</td></tr>
6088<tr><th>id </th>
6089 <td class="description">The job ID</td></tr>
6090<tr><th>priority </th>
6091 <td class="description">Priority (1-100)</td></tr>
6092<tr><th>processing_time </th>
6093 <td class="description">Time the job was processed</td></tr>
6094<tr><th>size </th>
6095 <td class="description">Size in kilobytes</td></tr>
6096<tr><th>state </th>
6097 <td class="description">Job state</td></tr>
6098<tr><th>title </th>
6099 <td class="description">Title/job name</td></tr>
6100<tr><th>user </th>
6101 <td class="description">User that submitted the job</td></tr>
6102</tbody></table>
798d6e29
MS
6103<h3 class="struct"><a id="cups_option_s">cups_option_s</a></h3>
6104 <p class="description">Printer Options</p>
6105<p class="code">struct cups_option_s {<br>
6106&#160;&#160;&#160;&#160;char *name;<br>
6107&#160;&#160;&#160;&#160;char *value;<br>
6108};</p>
6109<h4 class="members">Members</h4>
98d88c8d
MS
6110<table class="list"><tbody>
6111<tr><th>name </th>
6112 <td class="description">Name of option</td></tr>
6113<tr><th>value </th>
6114 <td class="description">Value of option</td></tr>
6115</tbody></table>
798d6e29
MS
6116<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>
6117 <p class="description">Media Size </p>
6118<p class="code">struct cups_size_s {<br>
6119&#160;&#160;&#160;&#160;char media[128];<br>
6120&#160;&#160;&#160;&#160;int width, length, bottom, left, right, top;<br>
6121};</p>
6122<h4 class="members">Members</h4>
98d88c8d
MS
6123<table class="list"><tbody>
6124<tr><th>media[128] </th>
6125 <td class="description">Media name to use</td></tr>
6126<tr><th>top </th>
6127 <td class="description">Top margin in hundredths of
6128millimeters</td></tr>
6129</tbody></table>
73721e3e
MS
6130 <h2 class="title"><a id="VARIABLES">Variables</a></h2>
6131 <h3 class="variable"><a id="kSecOidOrganizationalUnit">kSecOidOrganizationalUnit</a></h3>
6132 <p class="description">Constants, very secure stuff...</p>
6133 <p class="code">extern const void *kSecOidOrganizationalUnit;</p>
798d6e29 6134 <h2 class="title"><a id="ENUMERATIONS">Constants</a></h2>
798d6e29
MS
6135 <h3 class="enumeration"><a id="cups_ptype_e">cups_ptype_e</a></h3>
6136 <p class="description">Printer type/capability bit
6137constants</p>
6138 <h4 class="constants">Constants</h4>
98d88c8d
MS
6139 <table class="list"><tbody>
6140 <tr><th>CUPS_PRINTER_AUTHENTICATED <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Printer requires authentication
6141</td></tr>
6142 <tr><th>CUPS_PRINTER_BIND </th> <td class="description">Can bind output</td></tr>
6143 <tr><th>CUPS_PRINTER_BW </th> <td class="description">Can do B&amp;W printing</td></tr>
6144 <tr><th>CUPS_PRINTER_CLASS </th> <td class="description">Printer class</td></tr>
6145 <tr><th>CUPS_PRINTER_COLLATE </th> <td class="description">Can quickly collate copies</td></tr>
6146 <tr><th>CUPS_PRINTER_COLOR </th> <td class="description">Can do color printing</td></tr>
6147 <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
6148</td></tr>
6149 <tr><th>CUPS_PRINTER_COPIES </th> <td class="description">Can do copies in hardware</td></tr>
6150 <tr><th>CUPS_PRINTER_COVER </th> <td class="description">Can cover output</td></tr>
6151 <tr><th>CUPS_PRINTER_DEFAULT </th> <td class="description">Default printer on network</td></tr>
6152 <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>
6153 <tr><th>CUPS_PRINTER_DUPLEX </th> <td class="description">Can do two-sided printing</td></tr>
6154 <tr><th>CUPS_PRINTER_FAX </th> <td class="description">Fax queue</td></tr>
6155 <tr><th>CUPS_PRINTER_LARGE </th> <td class="description">Can print on D/E/A1/A0-size media</td></tr>
6156 <tr><th>CUPS_PRINTER_LOCAL </th> <td class="description">Local printer or class</td></tr>
6157 <tr><th>CUPS_PRINTER_MEDIUM </th> <td class="description">Can print on Tabloid/B/C/A3/A2-size media</td></tr>
6158 <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
6159</td></tr>
6160 <tr><th>CUPS_PRINTER_PUNCH </th> <td class="description">Can punch output</td></tr>
6161 <tr><th>CUPS_PRINTER_REJECTING </th> <td class="description">Printer is rejecting jobs</td></tr>
6162 <tr><th>CUPS_PRINTER_REMOTE </th> <td class="description">Remote printer or class</td></tr>
6163 <tr><th>CUPS_PRINTER_SMALL </th> <td class="description">Can print on Letter/Legal/A4-size media</td></tr>
6164 <tr><th>CUPS_PRINTER_SORT </th> <td class="description">Can sort output</td></tr>
6165 <tr><th>CUPS_PRINTER_STAPLE </th> <td class="description">Can staple output</td></tr>
6166 <tr><th>CUPS_PRINTER_VARIABLE </th> <td class="description">Can print on rolls and custom-size media</td></tr>
6167</tbody></table>
798d6e29
MS
6168 <h3 class="enumeration"><a id="http_encoding_e">http_encoding_e</a></h3>
6169 <p class="description">HTTP transfer encoding values</p>
6170 <h4 class="constants">Constants</h4>
98d88c8d
MS
6171 <table class="list"><tbody>
6172 <tr><th>HTTP_ENCODING_CHUNKED </th> <td class="description">Data is chunked</td></tr>
6173 <tr><th>HTTP_ENCODING_FIELDS </th> <td class="description">Sending HTTP fields</td></tr>
6174 <tr><th>HTTP_ENCODING_LENGTH </th> <td class="description">Data is sent with Content-Length</td></tr>
6175</tbody></table>
798d6e29
MS
6176 <h3 class="enumeration"><a id="http_encryption_e">http_encryption_e</a></h3>
6177 <p class="description">HTTP encryption values</p>
6178 <h4 class="constants">Constants</h4>
98d88c8d
MS
6179 <table class="list"><tbody>
6180 <tr><th>HTTP_ENCRYPTION_ALWAYS </th> <td class="description">Always encrypt (SSL)</td></tr>
6181 <tr><th>HTTP_ENCRYPTION_IF_REQUESTED </th> <td class="description">Encrypt if requested (TLS upgrade)</td></tr>
6182 <tr><th>HTTP_ENCRYPTION_NEVER </th> <td class="description">Never encrypt</td></tr>
6183 <tr><th>HTTP_ENCRYPTION_REQUIRED </th> <td class="description">Encryption is required (TLS upgrade)</td></tr>
6184</tbody></table>
798d6e29
MS
6185 <h3 class="enumeration"><a id="http_field_e">http_field_e</a></h3>
6186 <p class="description">HTTP field names</p>
6187 <h4 class="constants">Constants</h4>
98d88c8d
MS
6188 <table class="list"><tbody>
6189 <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>
6190 <tr><th>HTTP_FIELD_ACCEPT_LANGUAGE </th> <td class="description">Accept-Language field</td></tr>
6191 <tr><th>HTTP_FIELD_ACCEPT_RANGES </th> <td class="description">Accept-Ranges field</td></tr>
6192 <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>
73721e3e 6193 <tr><th>HTTP_FIELD_AUTHENTICATION_INFO <span class="info">&#160;CUPS 2.2.9)&#160;</span></th> <td class="description">Authentication-Info field (</td></tr>
98d88c8d
MS
6194 <tr><th>HTTP_FIELD_AUTHORIZATION </th> <td class="description">Authorization field</td></tr>
6195 <tr><th>HTTP_FIELD_CONNECTION </th> <td class="description">Connection field</td></tr>
6196 <tr><th>HTTP_FIELD_CONTENT_ENCODING </th> <td class="description">Content-Encoding field</td></tr>
6197 <tr><th>HTTP_FIELD_CONTENT_LANGUAGE </th> <td class="description">Content-Language field</td></tr>
6198 <tr><th>HTTP_FIELD_CONTENT_LENGTH </th> <td class="description">Content-Length field</td></tr>
6199 <tr><th>HTTP_FIELD_CONTENT_LOCATION </th> <td class="description">Content-Location field</td></tr>
6200 <tr><th>HTTP_FIELD_CONTENT_MD5 </th> <td class="description">Content-MD5 field</td></tr>
6201 <tr><th>HTTP_FIELD_CONTENT_RANGE </th> <td class="description">Content-Range field</td></tr>
6202 <tr><th>HTTP_FIELD_CONTENT_TYPE </th> <td class="description">Content-Type field</td></tr>
6203 <tr><th>HTTP_FIELD_CONTENT_VERSION </th> <td class="description">Content-Version field</td></tr>
6204 <tr><th>HTTP_FIELD_DATE </th> <td class="description">Date field</td></tr>
6205 <tr><th>HTTP_FIELD_HOST </th> <td class="description">Host field</td></tr>
6206 <tr><th>HTTP_FIELD_IF_MODIFIED_SINCE </th> <td class="description">If-Modified-Since field</td></tr>
6207 <tr><th>HTTP_FIELD_IF_UNMODIFIED_SINCE </th> <td class="description">If-Unmodified-Since field</td></tr>
6208 <tr><th>HTTP_FIELD_KEEP_ALIVE </th> <td class="description">Keep-Alive field</td></tr>
6209 <tr><th>HTTP_FIELD_LAST_MODIFIED </th> <td class="description">Last-Modified field</td></tr>
6210 <tr><th>HTTP_FIELD_LINK </th> <td class="description">Link field</td></tr>
6211 <tr><th>HTTP_FIELD_LOCATION </th> <td class="description">Location field</td></tr>
6212 <tr><th>HTTP_FIELD_MAX </th> <td class="description">Maximum field index</td></tr>
6213 <tr><th>HTTP_FIELD_RANGE </th> <td class="description">Range field</td></tr>
6214 <tr><th>HTTP_FIELD_REFERER </th> <td class="description">Referer field</td></tr>
6215 <tr><th>HTTP_FIELD_RETRY_AFTER </th> <td class="description">Retry-After field</td></tr>
6216 <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>
6217 <tr><th>HTTP_FIELD_TRANSFER_ENCODING </th> <td class="description">Transfer-Encoding field</td></tr>
6218 <tr><th>HTTP_FIELD_UNKNOWN </th> <td class="description">Unknown field</td></tr>
6219 <tr><th>HTTP_FIELD_UPGRADE </th> <td class="description">Upgrade field</td></tr>
6220 <tr><th>HTTP_FIELD_USER_AGENT </th> <td class="description">User-Agent field</td></tr>
6221 <tr><th>HTTP_FIELD_WWW_AUTHENTICATE </th> <td class="description">WWW-Authenticate field</td></tr>
6222</tbody></table>
798d6e29
MS
6223 <h3 class="enumeration"><a id="http_keepalive_e">http_keepalive_e</a></h3>
6224 <p class="description">HTTP keep-alive values</p>
6225 <h4 class="constants">Constants</h4>
98d88c8d
MS
6226 <table class="list"><tbody>
6227 <tr><th>HTTP_KEEPALIVE_OFF </th> <td class="description">No keep alive support</td></tr>
6228 <tr><th>HTTP_KEEPALIVE_ON </th> <td class="description">Use keep alive</td></tr>
6229</tbody></table>
798d6e29
MS
6230 <h3 class="enumeration"><a id="http_state_e">http_state_e</a></h3>
6231 <p class="description">HTTP state values; states
6232are server-oriented...</p>
6233 <h4 class="constants">Constants</h4>
98d88c8d
MS
6234 <table class="list"><tbody>
6235 <tr><th>HTTP_STATE_CONNECT </th> <td class="description">CONNECT command, waiting for blank line</td></tr>
6236 <tr><th>HTTP_STATE_DELETE </th> <td class="description">DELETE command, waiting for blank line</td></tr>
6237 <tr><th>HTTP_STATE_ERROR </th> <td class="description">Error on socket</td></tr>
6238 <tr><th>HTTP_STATE_GET </th> <td class="description">GET command, waiting for blank line</td></tr>
6239 <tr><th>HTTP_STATE_GET_SEND </th> <td class="description">GET command, sending data</td></tr>
6240 <tr><th>HTTP_STATE_HEAD </th> <td class="description">HEAD command, waiting for blank line</td></tr>
6241 <tr><th>HTTP_STATE_OPTIONS </th> <td class="description">OPTIONS command, waiting for blank line</td></tr>
6242 <tr><th>HTTP_STATE_POST </th> <td class="description">POST command, waiting for blank line</td></tr>
6243 <tr><th>HTTP_STATE_POST_RECV </th> <td class="description">POST command, receiving data</td></tr>
6244 <tr><th>HTTP_STATE_POST_SEND </th> <td class="description">POST command, sending data</td></tr>
6245 <tr><th>HTTP_STATE_PUT </th> <td class="description">PUT command, waiting for blank line</td></tr>
6246 <tr><th>HTTP_STATE_PUT_RECV </th> <td class="description">PUT command, receiving data</td></tr>
6247 <tr><th>HTTP_STATE_STATUS </th> <td class="description">Command complete, sending status</td></tr>
6248 <tr><th>HTTP_STATE_TRACE </th> <td class="description">TRACE command, waiting for blank line</td></tr>
6249 <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>
6250 <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>
6251 <tr><th>HTTP_STATE_WAITING </th> <td class="description">Waiting for command</td></tr>
6252</tbody></table>
798d6e29
MS
6253 <h3 class="enumeration"><a id="http_status_e">http_status_e</a></h3>
6254 <p class="description">HTTP status codes</p>
6255 <h4 class="constants">Constants</h4>
98d88c8d
MS
6256 <table class="list"><tbody>
6257 <tr><th>HTTP_STATUS_ACCEPTED </th> <td class="description">DELETE command was successful</td></tr>
6258 <tr><th>HTTP_STATUS_BAD_GATEWAY </th> <td class="description">Bad gateway</td></tr>
6259 <tr><th>HTTP_STATUS_BAD_REQUEST </th> <td class="description">Bad request</td></tr>
6260 <tr><th>HTTP_STATUS_CONFLICT </th> <td class="description">Request is self-conflicting</td></tr>
6261 <tr><th>HTTP_STATUS_CONTINUE </th> <td class="description">Everything OK, keep going...</td></tr>
6262 <tr><th>HTTP_STATUS_CREATED </th> <td class="description">PUT command was successful</td></tr>
6263 <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>
6264 <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>
6265 <tr><th>HTTP_STATUS_ERROR </th> <td class="description">An error response from httpXxxx()</td></tr>
6266 <tr><th>HTTP_STATUS_EXPECTATION_FAILED </th> <td class="description">The expectation given in an Expect header field was not met</td></tr>
6267 <tr><th>HTTP_STATUS_FORBIDDEN </th> <td class="description">Forbidden to access this URI</td></tr>
699fe020 6268 <tr><th>HTTP_STATUS_FOUND </th> <td class="description">Document was found at a different URI</td></tr>
98d88c8d
MS
6269 <tr><th>HTTP_STATUS_GATEWAY_TIMEOUT </th> <td class="description">Gateway connection timed out</td></tr>
6270 <tr><th>HTTP_STATUS_GONE </th> <td class="description">Server has gone away</td></tr>
6271 <tr><th>HTTP_STATUS_LENGTH_REQUIRED </th> <td class="description">A content length or encoding is required</td></tr>
6272 <tr><th>HTTP_STATUS_METHOD_NOT_ALLOWED </th> <td class="description">Method is not allowed</td></tr>
6273 <tr><th>HTTP_STATUS_MOVED_PERMANENTLY </th> <td class="description">Document has moved permanently</td></tr>
98d88c8d
MS
6274 <tr><th>HTTP_STATUS_MULTIPLE_CHOICES </th> <td class="description">Multiple files match request</td></tr>
6275 <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>
6276 <tr><th>HTTP_STATUS_NOT_ACCEPTABLE </th> <td class="description">Not Acceptable</td></tr>
6277 <tr><th>HTTP_STATUS_NOT_AUTHORITATIVE </th> <td class="description">Information isn't authoritative</td></tr>
6278 <tr><th>HTTP_STATUS_NOT_FOUND </th> <td class="description">URI was not found</td></tr>
6279 <tr><th>HTTP_STATUS_NOT_IMPLEMENTED </th> <td class="description">Feature not implemented</td></tr>
6280 <tr><th>HTTP_STATUS_NOT_MODIFIED </th> <td class="description">File not modified</td></tr>
6281 <tr><th>HTTP_STATUS_NOT_SUPPORTED </th> <td class="description">HTTP version not supported</td></tr>
6282 <tr><th>HTTP_STATUS_NO_CONTENT </th> <td class="description">Successful command, no new data</td></tr>
6283 <tr><th>HTTP_STATUS_OK </th> <td class="description">OPTIONS/GET/HEAD/POST/TRACE command was successful</td></tr>
6284 <tr><th>HTTP_STATUS_PARTIAL_CONTENT </th> <td class="description">Only a partial file was received/sent</td></tr>
6285 <tr><th>HTTP_STATUS_PAYMENT_REQUIRED </th> <td class="description">Payment required</td></tr>
6286 <tr><th>HTTP_STATUS_PRECONDITION </th> <td class="description">Precondition failed</td></tr>
6287 <tr><th>HTTP_STATUS_PROXY_AUTHENTICATION </th> <td class="description">Proxy Authentication is Required</td></tr>
6288 <tr><th>HTTP_STATUS_REQUESTED_RANGE </th> <td class="description">The requested range is not satisfiable</td></tr>
6289 <tr><th>HTTP_STATUS_REQUEST_TIMEOUT </th> <td class="description">Request timed out</td></tr>
6290 <tr><th>HTTP_STATUS_REQUEST_TOO_LARGE </th> <td class="description">Request entity too large</td></tr>
6291 <tr><th>HTTP_STATUS_RESET_CONTENT </th> <td class="description">Content was reset/recreated</td></tr>
699fe020 6292 <tr><th>HTTP_STATUS_SEE_OTHER </th> <td class="description">See this other link</td></tr>
98d88c8d
MS
6293 <tr><th>HTTP_STATUS_SERVER_ERROR </th> <td class="description">Internal server error</td></tr>
6294 <tr><th>HTTP_STATUS_SERVICE_UNAVAILABLE </th> <td class="description">Service is unavailable</td></tr>
6295 <tr><th>HTTP_STATUS_SWITCHING_PROTOCOLS </th> <td class="description">HTTP upgrade to TLS/SSL</td></tr>
699fe020 6296 <tr><th>HTTP_STATUS_TEMPORARY_REDIRECT </th> <td class="description">Temporary redirection</td></tr>
98d88c8d
MS
6297 <tr><th>HTTP_STATUS_UNAUTHORIZED </th> <td class="description">Unauthorized to access host</td></tr>
6298 <tr><th>HTTP_STATUS_UNSUPPORTED_MEDIATYPE </th> <td class="description">The requested media type is unsupported</td></tr>
6299 <tr><th>HTTP_STATUS_UPGRADE_REQUIRED </th> <td class="description">Upgrade to SSL/TLS required</td></tr>
6300 <tr><th>HTTP_STATUS_URI_TOO_LONG </th> <td class="description">URI too long</td></tr>
6301 <tr><th>HTTP_STATUS_USE_PROXY </th> <td class="description">Must use a proxy to access this URI</td></tr>
6302</tbody></table>
798d6e29
MS
6303 <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>
6304 <p class="description">Level of trust for credentials </p>
6305 <h4 class="constants">Constants</h4>
98d88c8d
MS
6306 <table class="list"><tbody>
6307 <tr><th>HTTP_TRUST_CHANGED </th> <td class="description">Credentials have changed</td></tr>
6308 <tr><th>HTTP_TRUST_EXPIRED </th> <td class="description">Credentials are expired</td></tr>
6309 <tr><th>HTTP_TRUST_INVALID </th> <td class="description">Credentials are invalid</td></tr>
6310 <tr><th>HTTP_TRUST_OK </th> <td class="description">Credentials are OK/trusted</td></tr>
6311 <tr><th>HTTP_TRUST_RENEWED </th> <td class="description">Credentials have been renewed</td></tr>
6312 <tr><th>HTTP_TRUST_UNKNOWN </th> <td class="description">Credentials are unknown/new</td></tr>
6313</tbody></table>
798d6e29
MS
6314 <h3 class="enumeration"><a id="http_uri_coding_e">http_uri_coding_e</a></h3>
6315 <p class="description">URI en/decode flags</p>
6316 <h4 class="constants">Constants</h4>
98d88c8d
MS
6317 <table class="list"><tbody>
6318 <tr><th>HTTP_URI_CODING_ALL </th> <td class="description">En/decode everything</td></tr>
6319 <tr><th>HTTP_URI_CODING_HOSTNAME </th> <td class="description">En/decode the hostname portion</td></tr>
6320 <tr><th>HTTP_URI_CODING_MOST </th> <td class="description">En/decode all but the query</td></tr>
6321 <tr><th>HTTP_URI_CODING_NONE </th> <td class="description">Don't en/decode anything</td></tr>
6322 <tr><th>HTTP_URI_CODING_QUERY </th> <td class="description">En/decode the query portion</td></tr>
6323 <tr><th>HTTP_URI_CODING_RESOURCE </th> <td class="description">En/decode the resource portion</td></tr>
6324 <tr><th>HTTP_URI_CODING_RFC6874 </th> <td class="description">Use RFC 6874 address format</td></tr>
6325 <tr><th>HTTP_URI_CODING_USERNAME </th> <td class="description">En/decode the username portion</td></tr>
6326</tbody></table>
798d6e29
MS
6327 <h3 class="enumeration"><a id="http_uri_status_e"><span class="info">&#160;CUPS 1.2&#160;</span>http_uri_status_e</a></h3>
6328 <p class="description">URI separation status </p>
6329 <h4 class="constants">Constants</h4>
98d88c8d
MS
6330 <table class="list"><tbody>
6331 <tr><th>HTTP_URI_STATUS_BAD_ARGUMENTS </th> <td class="description">Bad arguments to function (error)</td></tr>
6332 <tr><th>HTTP_URI_STATUS_BAD_HOSTNAME </th> <td class="description">Bad hostname in URI (error)</td></tr>
6333 <tr><th>HTTP_URI_STATUS_BAD_PORT </th> <td class="description">Bad port number in URI (error)</td></tr>
6334 <tr><th>HTTP_URI_STATUS_BAD_RESOURCE </th> <td class="description">Bad resource in URI (error)</td></tr>
6335 <tr><th>HTTP_URI_STATUS_BAD_SCHEME </th> <td class="description">Bad scheme in URI (error)</td></tr>
6336 <tr><th>HTTP_URI_STATUS_BAD_URI </th> <td class="description">Bad/empty URI (error)</td></tr>
6337 <tr><th>HTTP_URI_STATUS_BAD_USERNAME </th> <td class="description">Bad username in URI (error)</td></tr>
6338 <tr><th>HTTP_URI_STATUS_MISSING_RESOURCE </th> <td class="description">Missing resource in URI (warning)</td></tr>
6339 <tr><th>HTTP_URI_STATUS_MISSING_SCHEME </th> <td class="description">Missing scheme in URI (warning)</td></tr>
6340 <tr><th>HTTP_URI_STATUS_OK </th> <td class="description">URI decoded OK</td></tr>
6341 <tr><th>HTTP_URI_STATUS_OVERFLOW </th> <td class="description">URI buffer for httpAssembleURI is too small</td></tr>
6342 <tr><th>HTTP_URI_STATUS_UNKNOWN_SCHEME </th> <td class="description">Unknown scheme in URI (warning)</td></tr>
6343</tbody></table>
798d6e29 6344 <h3 class="enumeration"><a id="ipp_finishings_e">ipp_finishings_e</a></h3>
718ee2ff 6345 <p class="description">Finishings values</p>
798d6e29 6346 <h4 class="constants">Constants</h4>
98d88c8d
MS
6347 <table class="list"><tbody>
6348 <tr><th>IPP_FINISHINGS_BALE </th> <td class="description">Bale (any type)</td></tr>
6349 <tr><th>IPP_FINISHINGS_BIND </th> <td class="description">Bind</td></tr>
6350 <tr><th>IPP_FINISHINGS_BIND_BOTTOM </th> <td class="description">Bind on bottom</td></tr>
6351 <tr><th>IPP_FINISHINGS_BIND_LEFT </th> <td class="description">Bind on left</td></tr>
6352 <tr><th>IPP_FINISHINGS_BIND_RIGHT </th> <td class="description">Bind on right</td></tr>
6353 <tr><th>IPP_FINISHINGS_BIND_TOP </th> <td class="description">Bind on top</td></tr>
6354 <tr><th>IPP_FINISHINGS_BOOKLET_MAKER </th> <td class="description">Fold to make booklet</td></tr>
6355 <tr><th>IPP_FINISHINGS_COAT </th> <td class="description">Apply protective liquid or powder coating</td></tr>
6356 <tr><th>IPP_FINISHINGS_COVER </th> <td class="description">Add cover</td></tr>
6357 <tr><th>IPP_FINISHINGS_EDGE_STITCH </th> <td class="description">Stitch along any side</td></tr>
6358 <tr><th>IPP_FINISHINGS_EDGE_STITCH_BOTTOM </th> <td class="description">Stitch along bottom edge</td></tr>
6359 <tr><th>IPP_FINISHINGS_EDGE_STITCH_LEFT </th> <td class="description">Stitch along left side</td></tr>
6360 <tr><th>IPP_FINISHINGS_EDGE_STITCH_RIGHT </th> <td class="description">Stitch along right side</td></tr>
6361 <tr><th>IPP_FINISHINGS_EDGE_STITCH_TOP </th> <td class="description">Stitch along top edge</td></tr>
6362 <tr><th>IPP_FINISHINGS_FOLD </th> <td class="description">Fold (any type)</td></tr>
6363 <tr><th>IPP_FINISHINGS_FOLD_ACCORDIAN </th> <td class="description">Accordian-fold the paper vertically into four sections</td></tr>
6364 <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>
6365 <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>
6366 <tr><th>IPP_FINISHINGS_FOLD_GATE </th> <td class="description">Fold the top and bottom quarters of the paper towards the midline</td></tr>
6367 <tr><th>IPP_FINISHINGS_FOLD_HALF </th> <td class="description">Fold the paper in half vertically</td></tr>
6368 <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>
6369 <tr><th>IPP_FINISHINGS_FOLD_LEFT_GATE </th> <td class="description">Fold the top quarter of the paper towards the midline</td></tr>
6370 <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>
6371 <tr><th>IPP_FINISHINGS_FOLD_PARALLEL </th> <td class="description">Fold the paper in half vertically two times, yielding four sections</td></tr>
6372 <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>
6373 <tr><th>IPP_FINISHINGS_FOLD_RIGHT_GATE </th> <td class="description">Fold the bottom quarter of the paper towards the midline</td></tr>
6374 <tr><th>IPP_FINISHINGS_FOLD_Z </th> <td class="description">Fold the paper vertically into three sections, forming a Z</td></tr>
6375 <tr><th>IPP_FINISHINGS_JOG_OFFSET </th> <td class="description">Offset for binding (any type)</td></tr>
6376 <tr><th>IPP_FINISHINGS_LAMINATE </th> <td class="description">Apply protective (solid) material</td></tr>
6377 <tr><th>IPP_FINISHINGS_NONE </th> <td class="description">No finishing</td></tr>
6378 <tr><th>IPP_FINISHINGS_PUNCH </th> <td class="description">Punch (any location/count)</td></tr>
6379 <tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_LEFT </th> <td class="description">Punch 1 hole bottom left</td></tr>
6380 <tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT </th> <td class="description">Punch 1 hole bottom right</td></tr>
6381 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_BOTTOM </th> <td class="description">Punch 2 holes bottom edge</td></tr>
6382 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_LEFT </th> <td class="description">Punch 2 holes left side</td></tr>
6383 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_RIGHT </th> <td class="description">Punch 2 holes right side</td></tr>
6384 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_TOP </th> <td class="description">Punch 2 holes top edge</td></tr>
6385 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM </th> <td class="description">Pucnh multiple holes bottom edge</td></tr>
6386 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT </th> <td class="description">Pucnh multiple holes left side</td></tr>
6387 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT </th> <td class="description">Pucnh multiple holes right side</td></tr>
6388 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_TOP </th> <td class="description">Pucnh multiple holes top edge</td></tr>
6389 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_BOTTOM </th> <td class="description">Punch 4 holes bottom edge</td></tr>
6390 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_LEFT </th> <td class="description">Punch 4 holes left side</td></tr>
6391 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_RIGHT </th> <td class="description">Punch 4 holes right side</td></tr>
6392 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_TOP </th> <td class="description">Punch 4 holes top edge</td></tr>
6393 <tr><th>IPP_FINISHINGS_PUNCH_TOP_LEFT </th> <td class="description">Punch 1 hole top left</td></tr>
6394 <tr><th>IPP_FINISHINGS_PUNCH_TOP_RIGHT </th> <td class="description">Punch 1 hole top right</td></tr>
6395 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM </th> <td class="description">Punch 3 holes bottom edge</td></tr>
6396 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_LEFT </th> <td class="description">Punch 3 holes left side</td></tr>
6397 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT </th> <td class="description">Punch 3 holes right side</td></tr>
6398 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_TOP </th> <td class="description">Punch 3 holes top edge</td></tr>
6399 <tr><th>IPP_FINISHINGS_SADDLE_STITCH </th> <td class="description">Staple interior</td></tr>
6400 <tr><th>IPP_FINISHINGS_STAPLE </th> <td class="description">Staple (any location/method)</td></tr>
6401 <tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_LEFT </th> <td class="description">Staple bottom left corner</td></tr>
6402 <tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT </th> <td class="description">Staple bottom right corner</td></tr>
6403 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_BOTTOM </th> <td class="description">Two staples on bottom</td></tr>
6404 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_LEFT </th> <td class="description">Two staples on left</td></tr>
6405 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_RIGHT </th> <td class="description">Two staples on right</td></tr>
6406 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_TOP </th> <td class="description">Two staples on top</td></tr>
6407 <tr><th>IPP_FINISHINGS_STAPLE_TOP_LEFT </th> <td class="description">Staple top left corner</td></tr>
6408 <tr><th>IPP_FINISHINGS_STAPLE_TOP_RIGHT </th> <td class="description">Staple top right corner</td></tr>
6409 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM </th> <td class="description">Three staples on bottom</td></tr>
6410 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_LEFT </th> <td class="description">Three staples on left</td></tr>
6411 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT </th> <td class="description">Three staples on right</td></tr>
6412 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_TOP </th> <td class="description">Three staples on top</td></tr>
6413 <tr><th>IPP_FINISHINGS_TRIM </th> <td class="description">Trim (any type)</td></tr>
6414 <tr><th>IPP_FINISHINGS_TRIM_AFTER_COPIES </th> <td class="description">Trim output after each copy</td></tr>
6415 <tr><th>IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS </th> <td class="description">Trim output after each document</td></tr>
6416 <tr><th>IPP_FINISHINGS_TRIM_AFTER_JOB </th> <td class="description">Trim output after job</td></tr>
6417 <tr><th>IPP_FINISHINGS_TRIM_AFTER_PAGES </th> <td class="description">Trim output after each page</td></tr>
6418</tbody></table>
798d6e29
MS
6419 <h3 class="enumeration"><a id="ipp_jstate_e">ipp_jstate_e</a></h3>
6420 <p class="description">Job states</p>
6421 <h4 class="constants">Constants</h4>
98d88c8d
MS
6422 <table class="list"><tbody>
6423 <tr><th>IPP_JSTATE_ABORTED </th> <td class="description">Job has aborted due to error</td></tr>
6424 <tr><th>IPP_JSTATE_CANCELED </th> <td class="description">Job has been canceled</td></tr>
6425 <tr><th>IPP_JSTATE_COMPLETED </th> <td class="description">Job has completed successfully</td></tr>
6426 <tr><th>IPP_JSTATE_HELD </th> <td class="description">Job is held for printing</td></tr>
6427 <tr><th>IPP_JSTATE_PENDING </th> <td class="description">Job is waiting to be printed</td></tr>
6428 <tr><th>IPP_JSTATE_PROCESSING </th> <td class="description">Job is currently printing</td></tr>
6429 <tr><th>IPP_JSTATE_STOPPED </th> <td class="description">Job has been stopped</td></tr>
6430</tbody></table>
798d6e29
MS
6431 <h3 class="enumeration"><a id="ipp_op_e">ipp_op_e</a></h3>
6432 <p class="description">IPP operations</p>
6433 <h4 class="constants">Constants</h4>
98d88c8d 6434 <table class="list"><tbody>
4f63d6cd 6435 <tr><th>IPP_OP_ALLOCATE_PRINTER_RESOURCES </th> <td class="description">Allocate-Printer-Resources: Use resources for a printer.</td></tr>
98d88c8d
MS
6436 <tr><th>IPP_OP_CANCEL_CURRENT_JOB </th> <td class="description">Cancel-Current-Job: Cancel the current job</td></tr>
6437 <tr><th>IPP_OP_CANCEL_JOB </th> <td class="description">Cancel-Job: Cancel a job</td></tr>
6438 <tr><th>IPP_OP_CANCEL_JOBS </th> <td class="description">Cancel-Jobs: Cancel all jobs (administrative)</td></tr>
6439 <tr><th>IPP_OP_CANCEL_MY_JOBS </th> <td class="description">Cancel-My-Jobs: Cancel a user's jobs</td></tr>
4f63d6cd 6440 <tr><th>IPP_OP_CANCEL_RESOURCE </th> <td class="description">Cancel-Resource: Uninstall a resource.</td></tr>
98d88c8d
MS
6441 <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>
6442 <tr><th>IPP_OP_CLOSE_JOB </th> <td class="description">Close-Job: Close a job and start printing</td></tr>
6443 <tr><th>IPP_OP_CREATE_JOB </th> <td class="description">Create-Job: Create an empty print job</td></tr>
6444 <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 6445 <tr><th>IPP_OP_CREATE_PRINTER </th> <td class="description">Create-Printer: Create a new service.</td></tr>
98d88c8d 6446 <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
6447 <tr><th>IPP_OP_CREATE_RESOURCE </th> <td class="description">Create-Resource: Create a new (empty) resource.</td></tr>
6448 <tr><th>IPP_OP_CREATE_RESOURCE_SUBSCRIPTIONS </th> <td class="description">Create-Resource-Subscriptions: Create event subscriptions for a resource.</td></tr>
6449 <tr><th>IPP_OP_CREATE_SYSTEM_SUBSCRIPTIONS </th> <td class="description">Create-System-Subscriptions: Create event subscriptions for a system.</td></tr>
98d88c8d
MS
6450 <tr><th>IPP_OP_CUPS_ADD_MODIFY_CLASS </th> <td class="description">CUPS-Add-Modify-Class: Add or modify a class</td></tr>
6451 <tr><th>IPP_OP_CUPS_ADD_MODIFY_PRINTER </th> <td class="description">CUPS-Add-Modify-Printer: Add or modify a printer</td></tr>
6452 <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>
6453 <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>
6454 <tr><th>IPP_OP_CUPS_DELETE_CLASS </th> <td class="description">CUPS-Delete-Class: Delete a class</td></tr>
6455 <tr><th>IPP_OP_CUPS_DELETE_PRINTER </th> <td class="description">CUPS-Delete-Printer: Delete a printer</td></tr>
6456 <tr><th>IPP_OP_CUPS_GET_DEFAULT </th> <td class="description">CUPS-Get-Default: Get the default printer</td></tr>
6457 <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>
6458 <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>
6459 <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>
6460 <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>
6461 <tr><th>IPP_OP_CUPS_GET_PRINTERS </th> <td class="description">CUPS-Get-Printers: Get a list of printers and/or classes</td></tr>
6462 <tr><th>IPP_OP_CUPS_INVALID </th> <td class="description">Invalid operation name for <a href="#ippOpValue"><code>ippOpValue</code></a></td></tr>
6463 <tr><th>IPP_OP_CUPS_MOVE_JOB </th> <td class="description">CUPS-Move-Job: Move a job to a different printer</td></tr>
6464 <tr><th>IPP_OP_CUPS_SET_DEFAULT </th> <td class="description">CUPS-Set-Default: Set the default printer</td></tr>
4f63d6cd
MS
6465 <tr><th>IPP_OP_DEALLOCATE_PRINTER_RESOURCES </th> <td class="description">Deallocate-Printer-Resources: Stop using resources for a printer.</td></tr>
6466 <tr><th>IPP_OP_DELETE_PRINTER </th> <td class="description">Delete-Printer: Delete an existing service.</td></tr>
6467 <tr><th>IPP_OP_DISABLE_ALL_PRINTERS </th> <td class="description">Disable-All-Printers: Stop accepting new jobs on all services.</td></tr>
98d88c8d 6468 <tr><th>IPP_OP_DISABLE_PRINTER </th> <td class="description">Disable-Printer: Reject new jobs for a printer</td></tr>
4f63d6cd 6469 <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
6470 <tr><th>IPP_OP_ENABLE_PRINTER </th> <td class="description">Enable-Printer: Accept new jobs for a printer</td></tr>
6471 <tr><th>IPP_OP_GET_JOBS </th> <td class="description">Get-Jobs: Get a list of jobs</td></tr>
6472 <tr><th>IPP_OP_GET_JOB_ATTRIBUTES </th> <td class="description">Get-Job-Attribute: Get information about a job</td></tr>
6473 <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 6474 <tr><th>IPP_OP_GET_PRINTERS </th> <td class="description">Get-Printers: Get a list of services.</td></tr>
98d88c8d
MS
6475 <tr><th>IPP_OP_GET_PRINTER_ATTRIBUTES </th> <td class="description">Get-Printer-Attributes: Get information about a printer</td></tr>
6476 <tr><th>IPP_OP_GET_PRINTER_SUPPORTED_VALUES </th> <td class="description">Get-Printer-Supported-Values: Get supported values</td></tr>
6477 <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>
6478 <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
6479 <tr><th>IPP_OP_GET_SYSTEM_ATTRIBUTES </th> <td class="description">Get-System-Attributes: Get system object attributes.</td></tr>
6480 <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
6481 <tr><th>IPP_OP_HOLD_JOB </th> <td class="description">Hold-Job: Hold a job for printing</td></tr>
6482 <tr><th>IPP_OP_HOLD_NEW_JOBS </th> <td class="description">Hold-New-Jobs: Hold new jobs</td></tr>
6483 <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
6484 <tr><th>IPP_OP_INSTALL_RESOURCE </th> <td class="description">Install-Resource: Install a resource.</td></tr>
6485 <tr><th>IPP_OP_PAUSE_ALL_PRINTERS </th> <td class="description">Pause-All-Printers: Stop all services immediately.</td></tr>
6486 <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
6487 <tr><th>IPP_OP_PAUSE_PRINTER </th> <td class="description">Pause-Printer: Stop a printer</td></tr>
6488 <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>
6489 <tr><th>IPP_OP_PRINT_JOB </th> <td class="description">Print-Job: Print a single file</td></tr>
6490 <tr><th>IPP_OP_PROMOTE_JOB </th> <td class="description">Promote-Job: Promote a job to print sooner</td></tr>
4f63d6cd 6491 <tr><th>IPP_OP_REGISTER_OUTPUT_DEVICE </th> <td class="description">Register-Output-Device: Register a remote service.</td></tr>
98d88c8d
MS
6492 <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>
6493 <tr><th>IPP_OP_RELEASE_JOB </th> <td class="description">Release-Job: Release a job for printing</td></tr>
6494 <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>
6495 <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
6496 <tr><th>IPP_OP_RESTART_SYSTEM </th> <td class="description">Restart-System: Restart all services.</td></tr>
6497 <tr><th>IPP_OP_RESUME_ALL_PRINTERS </th> <td class="description">Resume-All-Printers: Start job processing on all services.</td></tr>
98d88c8d
MS
6498 <tr><th>IPP_OP_RESUME_JOB </th> <td class="description">Resume-Job: Resume the current job</td></tr>
6499 <tr><th>IPP_OP_RESUME_PRINTER </th> <td class="description">Resume-Printer: Start a printer</td></tr>
6500 <tr><th>IPP_OP_SCHEDULE_JOB_AFTER </th> <td class="description">Schedule-Job-After: Schedule a job to print after another</td></tr>
6501 <tr><th>IPP_OP_SEND_DOCUMENT </th> <td class="description">Send-Document: Add a file to a job</td></tr>
4f63d6cd 6502 <tr><th>IPP_OP_SEND_RESOURCE_DATA </th> <td class="description">Send-Resource-Data: Upload the data for a resource.</td></tr>
98d88c8d
MS
6503 <tr><th>IPP_OP_SET_JOB_ATTRIBUTES </th> <td class="description">Set-Job-Attributes: Set job values</td></tr>
6504 <tr><th>IPP_OP_SET_PRINTER_ATTRIBUTES </th> <td class="description">Set-Printer-Attributes: Set printer values</td></tr>
4f63d6cd
MS
6505 <tr><th>IPP_OP_SET_RESOURCE_ATTRIBUTES </th> <td class="description">Set-Resource-Attributes: Set resource object attributes.</td></tr>
6506 <tr><th>IPP_OP_SET_SYSTEM_ATTRIBUTES </th> <td class="description">Set-System-Attributes: Set system object attributes.</td></tr>
6507 <tr><th>IPP_OP_SHUTDOWN_ALL_PRINTERS </th> <td class="description">Shutdown-All-Printers: Shutdown all services.</td></tr>
6508 <tr><th>IPP_OP_SHUTDOWN_ONE_PRINTER </th> <td class="description">Shutdown-One-Printer: Shutdown a service.</td></tr>
6509 <tr><th>IPP_OP_STARTUP_ALL_PRINTERS </th> <td class="description">Startup-All-Printers: Startup all services.</td></tr>
6510 <tr><th>IPP_OP_STARTUP_ONE_PRINTER </th> <td class="description">Startup-One-Printer: Start a service.</td></tr>
98d88c8d
MS
6511 <tr><th>IPP_OP_SUSPEND_CURRENT_JOB </th> <td class="description">Suspend-Current-Job: Suspend the current job</td></tr>
6512 <tr><th>IPP_OP_VALIDATE_JOB </th> <td class="description">Validate-Job: Validate job values prior to submission</td></tr>
6513</tbody></table>
798d6e29
MS
6514 <h3 class="enumeration"><a id="ipp_orient_e">ipp_orient_e</a></h3>
6515 <p class="description">Orientation values</p>
6516 <h4 class="constants">Constants</h4>
98d88c8d
MS
6517 <table class="list"><tbody>
6518 <tr><th>IPP_ORIENT_LANDSCAPE </th> <td class="description">90 degrees counter-clockwise</td></tr>
6519 <tr><th>IPP_ORIENT_NONE </th> <td class="description">No rotation</td></tr>
6520 <tr><th>IPP_ORIENT_PORTRAIT </th> <td class="description">No rotation</td></tr>
6521 <tr><th>IPP_ORIENT_REVERSE_LANDSCAPE </th> <td class="description">90 degrees clockwise</td></tr>
6522 <tr><th>IPP_ORIENT_REVERSE_PORTRAIT </th> <td class="description">180 degrees</td></tr>
6523</tbody></table>
798d6e29 6524 <h3 class="enumeration"><a id="ipp_pstate_e">ipp_pstate_e</a></h3>
65bebeac 6525 <p class="description">Printer state values</p>
798d6e29 6526 <h4 class="constants">Constants</h4>
98d88c8d
MS
6527 <table class="list"><tbody>
6528 <tr><th>IPP_PSTATE_IDLE </th> <td class="description">Printer is idle</td></tr>
6529 <tr><th>IPP_PSTATE_PROCESSING </th> <td class="description">Printer is working</td></tr>
6530 <tr><th>IPP_PSTATE_STOPPED </th> <td class="description">Printer is stopped</td></tr>
6531</tbody></table>
798d6e29 6532 <h3 class="enumeration"><a id="ipp_quality_e">ipp_quality_e</a></h3>
65bebeac 6533 <p class="description">Print quality values</p>
798d6e29 6534 <h4 class="constants">Constants</h4>
98d88c8d
MS
6535 <table class="list"><tbody>
6536 <tr><th>IPP_QUALITY_DRAFT </th> <td class="description">Draft quality</td></tr>
6537 <tr><th>IPP_QUALITY_HIGH </th> <td class="description">High quality</td></tr>
6538 <tr><th>IPP_QUALITY_NORMAL </th> <td class="description">Normal quality</td></tr>
6539</tbody></table>
798d6e29
MS
6540 <h3 class="enumeration"><a id="ipp_res_e">ipp_res_e</a></h3>
6541 <p class="description">Resolution units</p>
6542 <h4 class="constants">Constants</h4>
98d88c8d
MS
6543 <table class="list"><tbody>
6544 <tr><th>IPP_RES_PER_CM </th> <td class="description">Pixels per centimeter</td></tr>
6545 <tr><th>IPP_RES_PER_INCH </th> <td class="description">Pixels per inch</td></tr>
06a5a4d3
MS
6546</tbody></table>
6547 <h3 class="enumeration"><a id="ipp_rstate_e">ipp_rstate_e</a></h3>
6548 <p class="description">resource-state values</p>
6549 <h4 class="constants">Constants</h4>
6550 <table class="list"><tbody>
6551 <tr><th>IPP_RSTATE_ABORTED </th> <td class="description">Resource has been aborted and is pending deletion.</td></tr>
6552 <tr><th>IPP_RSTATE_AVAILABLE </th> <td class="description">Resource is available for installation.</td></tr>
6553 <tr><th>IPP_RSTATE_CANCELED </th> <td class="description">Resource has been canceled and is pending deletion.</td></tr>
6554 <tr><th>IPP_RSTATE_INSTALLED </th> <td class="description">Resource is installed.</td></tr>
6555 <tr><th>IPP_RSTATE_PENDING </th> <td class="description">Resource is created but has no data yet.</td></tr>
6556</tbody></table>
6557 <h3 class="enumeration"><a id="ipp_sstate_e">ipp_sstate_e</a></h3>
6558 <p class="description">system-state values</p>
6559 <h4 class="constants">Constants</h4>
6560 <table class="list"><tbody>
6561 <tr><th>IPP_SSTATE_IDLE </th> <td class="description">At least one printer is idle and none are processing a job.</td></tr>
6562 <tr><th>IPP_SSTATE_PROCESSING </th> <td class="description">At least one printer is processing a job.</td></tr>
6563 <tr><th>IPP_SSTATE_STOPPED </th> <td class="description">All printers are stopped.</td></tr>
98d88c8d 6564</tbody></table>
798d6e29 6565 <h3 class="enumeration"><a id="ipp_state_e">ipp_state_e</a></h3>
65bebeac 6566 <p class="description">ipp_t state values</p>
798d6e29 6567 <h4 class="constants">Constants</h4>
98d88c8d
MS
6568 <table class="list"><tbody>
6569 <tr><th>IPP_STATE_ATTRIBUTE </th> <td class="description">One or more attributes need to be sent/received</td></tr>
6570 <tr><th>IPP_STATE_DATA </th> <td class="description">IPP request data needs to be sent/received</td></tr>
6571 <tr><th>IPP_STATE_ERROR </th> <td class="description">An error occurred</td></tr>
6572 <tr><th>IPP_STATE_HEADER </th> <td class="description">The request header needs to be sent/received</td></tr>
6573 <tr><th>IPP_STATE_IDLE </th> <td class="description">Nothing is happening/request completed</td></tr>
6574</tbody></table>
798d6e29 6575 <h3 class="enumeration"><a id="ipp_status_e">ipp_status_e</a></h3>
65bebeac 6576 <p class="description">IPP status code values</p>
798d6e29 6577 <h4 class="constants">Constants</h4>
98d88c8d
MS
6578 <table class="list"><tbody>
6579 <tr><th>IPP_STATUS_CUPS_INVALID </th> <td class="description">Invalid status name for <a href="#ippErrorValue"><code>ippErrorValue</code></a></td></tr>
6580 <tr><th>IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED </th> <td class="description">client-error-account-authorization-failed</td></tr>
6581 <tr><th>IPP_STATUS_ERROR_ACCOUNT_CLOSED </th> <td class="description">client-error-account-closed</td></tr>
6582 <tr><th>IPP_STATUS_ERROR_ACCOUNT_INFO_NEEDED </th> <td class="description">client-error-account-info-needed</td></tr>
6583 <tr><th>IPP_STATUS_ERROR_ACCOUNT_LIMIT_REACHED </th> <td class="description">client-error-account-limit-reached</td></tr>
6584 <tr><th>IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE </th> <td class="description">client-error-attributes-not-settable</td></tr>
6585 <tr><th>IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES </th> <td class="description">client-error-attributes-or-values-not-supported</td></tr>
6586 <tr><th>IPP_STATUS_ERROR_BAD_REQUEST </th> <td class="description">client-error-bad-request</td></tr>
6587 <tr><th>IPP_STATUS_ERROR_BUSY </th> <td class="description">server-error-busy</td></tr>
6588 <tr><th>IPP_STATUS_ERROR_CHARSET </th> <td class="description">client-error-charset-not-supported</td></tr>
6589 <tr><th>IPP_STATUS_ERROR_COMPRESSION_ERROR </th> <td class="description">client-error-compression-error</td></tr>
6590 <tr><th>IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED </th> <td class="description">client-error-compression-not-supported</td></tr>
6591 <tr><th>IPP_STATUS_ERROR_CONFLICTING </th> <td class="description">client-error-conflicting-attributes</td></tr>
6592 <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>
6593 <tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED </th> <td class="description">cups-error-account-closed @deprecate@</td></tr>
6594 <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>
6595 <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>
6596 <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>
6597 <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>
6598 <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>
6599 <tr><th>IPP_STATUS_ERROR_DEVICE </th> <td class="description">server-error-device-error</td></tr>
6600 <tr><th>IPP_STATUS_ERROR_DOCUMENT_ACCESS </th> <td class="description">client-error-document-access-error</td></tr>
6601 <tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR </th> <td class="description">client-error-document-format-error</td></tr>
6602 <tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED </th> <td class="description">client-error-document-format-not-supported</td></tr>
6603 <tr><th>IPP_STATUS_ERROR_DOCUMENT_PASSWORD </th> <td class="description">client-error-document-password-error</td></tr>
6604 <tr><th>IPP_STATUS_ERROR_DOCUMENT_PERMISSION </th> <td class="description">client-error-document-permission-error</td></tr>
6605 <tr><th>IPP_STATUS_ERROR_DOCUMENT_SECURITY </th> <td class="description">client-error-document-security-error</td></tr>
6606 <tr><th>IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE </th> <td class="description">client-error-document-unprintable-error</td></tr>
6607 <tr><th>IPP_STATUS_ERROR_FORBIDDEN </th> <td class="description">client-error-forbidden</td></tr>
6608 <tr><th>IPP_STATUS_ERROR_GONE </th> <td class="description">client-error-gone</td></tr>
6609 <tr><th>IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS </th> <td class="description">client-error-ignored-all-subscriptions</td></tr>
6610 <tr><th>IPP_STATUS_ERROR_INTERNAL </th> <td class="description">server-error-internal-error</td></tr>
6611 <tr><th>IPP_STATUS_ERROR_JOB_CANCELED </th> <td class="description">server-error-job-canceled</td></tr>
6612 <tr><th>IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED </th> <td class="description">server-error-multiple-document-jobs-not-supported</td></tr>
6613 <tr><th>IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS </th> <td class="description">server-error-not-accepting-jobs</td></tr>
6614 <tr><th>IPP_STATUS_ERROR_NOT_AUTHENTICATED </th> <td class="description">client-error-not-authenticated</td></tr>
6615 <tr><th>IPP_STATUS_ERROR_NOT_AUTHORIZED </th> <td class="description">client-error-not-authorized</td></tr>
6616 <tr><th>IPP_STATUS_ERROR_NOT_FETCHABLE </th> <td class="description">client-error-not-fetchable</td></tr>
6617 <tr><th>IPP_STATUS_ERROR_NOT_FOUND </th> <td class="description">client-error-not-found</td></tr>
6618 <tr><th>IPP_STATUS_ERROR_NOT_POSSIBLE </th> <td class="description">client-error-not-possible</td></tr>
6619 <tr><th>IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED </th> <td class="description">server-error-operation-not-supported</td></tr>
6620 <tr><th>IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED </th> <td class="description">server-error-printer-is-deactivated</td></tr>
6621 <tr><th>IPP_STATUS_ERROR_REQUEST_ENTITY </th> <td class="description">client-error-request-entity-too-large</td></tr>
6622 <tr><th>IPP_STATUS_ERROR_REQUEST_VALUE </th> <td class="description">client-error-request-value-too-long</td></tr>
6623 <tr><th>IPP_STATUS_ERROR_SERVICE_UNAVAILABLE </th> <td class="description">server-error-service-unavailable</td></tr>
6624 <tr><th>IPP_STATUS_ERROR_TEMPORARY </th> <td class="description">server-error-temporary-error</td></tr>
6625 <tr><th>IPP_STATUS_ERROR_TIMEOUT </th> <td class="description">client-error-timeout</td></tr>
6626 <tr><th>IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS </th> <td class="description">server-error-too-many-documents</td></tr>
6627 <tr><th>IPP_STATUS_ERROR_TOO_MANY_JOBS </th> <td class="description">server-error-too-many-jobs</td></tr>
6628 <tr><th>IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS </th> <td class="description">client-error-too-many-subscriptions</td></tr>
6629 <tr><th>IPP_STATUS_ERROR_URI_SCHEME </th> <td class="description">client-error-uri-scheme-not-supported</td></tr>
6630 <tr><th>IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED </th> <td class="description">server-error-version-not-supported</td></tr>
6631 <tr><th>IPP_STATUS_OK </th> <td class="description">successful-ok</td></tr>
6632 <tr><th>IPP_STATUS_OK_CONFLICTING </th> <td class="description">successful-ok-conflicting-attributes</td></tr>
6633 <tr><th>IPP_STATUS_OK_EVENTS_COMPLETE </th> <td class="description">successful-ok-events-complete</td></tr>
6634 <tr><th>IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED </th> <td class="description">successful-ok-ignored-or-substituted-attributes</td></tr>
6635 <tr><th>IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS </th> <td class="description">successful-ok-ignored-subscriptions</td></tr>
6636 <tr><th>IPP_STATUS_OK_TOO_MANY_EVENTS </th> <td class="description">successful-ok-too-many-events</td></tr>
6637</tbody></table>
798d6e29 6638 <h3 class="enumeration"><a id="ipp_tag_e">ipp_tag_e</a></h3>
65bebeac 6639 <p class="description">Value and group tag values for attributes</p>
798d6e29 6640 <h4 class="constants">Constants</h4>
98d88c8d
MS
6641 <table class="list"><tbody>
6642 <tr><th>IPP_TAG_ADMINDEFINE </th> <td class="description">Admin-defined value</td></tr>
6643 <tr><th>IPP_TAG_BOOLEAN </th> <td class="description">Boolean value</td></tr>
6644 <tr><th>IPP_TAG_CHARSET </th> <td class="description">Character set value</td></tr>
6645 <tr><th>IPP_TAG_CUPS_INVALID </th> <td class="description">Invalid tag name for <a href="#ippTagValue"><code>ippTagValue</code></a></td></tr>
6646 <tr><th>IPP_TAG_DATE </th> <td class="description">Date/time value</td></tr>
6647 <tr><th>IPP_TAG_DEFAULT </th> <td class="description">Default value</td></tr>
6648 <tr><th>IPP_TAG_DELETEATTR </th> <td class="description">Delete-attribute value</td></tr>
4f63d6cd 6649 <tr><th>IPP_TAG_DOCUMENT </th> <td class="description">Document group</td></tr>
98d88c8d
MS
6650 <tr><th>IPP_TAG_END </th> <td class="description">End-of-attributes</td></tr>
6651 <tr><th>IPP_TAG_ENUM </th> <td class="description">Enumeration value</td></tr>
6652 <tr><th>IPP_TAG_EVENT_NOTIFICATION </th> <td class="description">Event group</td></tr>
6653 <tr><th>IPP_TAG_INTEGER </th> <td class="description">Integer value</td></tr>
6654 <tr><th>IPP_TAG_JOB </th> <td class="description">Job group</td></tr>
6655 <tr><th>IPP_TAG_KEYWORD </th> <td class="description">Keyword value</td></tr>
6656 <tr><th>IPP_TAG_LANGUAGE </th> <td class="description">Language value</td></tr>
6657 <tr><th>IPP_TAG_MIMETYPE </th> <td class="description">MIME media type value</td></tr>
6658 <tr><th>IPP_TAG_NAME </th> <td class="description">Name value</td></tr>
6659 <tr><th>IPP_TAG_NAMELANG </th> <td class="description">Name-with-language value</td></tr>
6660 <tr><th>IPP_TAG_NOTSETTABLE </th> <td class="description">Not-settable value</td></tr>
6661 <tr><th>IPP_TAG_NOVALUE </th> <td class="description">No-value value</td></tr>
6662 <tr><th>IPP_TAG_OPERATION </th> <td class="description">Operation group</td></tr>
6663 <tr><th>IPP_TAG_PRINTER </th> <td class="description">Printer group</td></tr>
6664 <tr><th>IPP_TAG_RANGE </th> <td class="description">Range value</td></tr>
6665 <tr><th>IPP_TAG_RESOLUTION </th> <td class="description">Resolution value</td></tr>
4f63d6cd 6666 <tr><th>IPP_TAG_RESOURCE </th> <td class="description">Resource group</td></tr>
98d88c8d
MS
6667 <tr><th>IPP_TAG_STRING </th> <td class="description">Octet string value</td></tr>
6668 <tr><th>IPP_TAG_SUBSCRIPTION </th> <td class="description">Subscription group</td></tr>
4f63d6cd 6669 <tr><th>IPP_TAG_SYSTEM </th> <td class="description">System group</td></tr>
98d88c8d
MS
6670 <tr><th>IPP_TAG_TEXT </th> <td class="description">Text value</td></tr>
6671 <tr><th>IPP_TAG_TEXTLANG </th> <td class="description">Text-with-language value</td></tr>
6672 <tr><th>IPP_TAG_UNKNOWN </th> <td class="description">Unknown value</td></tr>
6673 <tr><th>IPP_TAG_UNSUPPORTED_GROUP </th> <td class="description">Unsupported attributes group</td></tr>
6674 <tr><th>IPP_TAG_UNSUPPORTED_VALUE </th> <td class="description">Unsupported value</td></tr>
6675 <tr><th>IPP_TAG_URI </th> <td class="description">URI value</td></tr>
6676 <tr><th>IPP_TAG_URISCHEME </th> <td class="description">URI scheme value</td></tr>
6677 <tr><th>IPP_TAG_ZERO </th> <td class="description">Zero tag - used for separators</td></tr>
6678</tbody></table>
798d6e29
MS
6679 </div>
6680 </body>
6681</html>