]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/cupspm.html
Don't support default printers that are not queues.
[thirdparty/cups.git] / doc / help / cupspm.html
CommitLineData
798d6e29
MS
1<!doctype html>
2<html>
3<!-- SECTION: Programming -->
4 <head>
5 <title>CUPS Programming Manual</title>
6 <meta name="keywords" content="Programming">
7 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
8 <meta name="creator" content="Mini-XML v2.11">
9 <meta name="author" content="Michael R Sweet">
9c44e2cb 10 <meta name="copyright" content="Copyright &#xa9; 2007-2017 by Apple Inc. All Rights Reserved.">
798d6e29
MS
11 <meta name="version" content="2.2.4">
12 <style type="text/css"><!--
13body, p, h1, h2, h3, h4 {
14 font-family: sans-serif;
15}
16div.body h1 {
17 font-size: 250%;
18 font-weight: bold;
19 margin: 0;
20}
21div.body h2 {
22 font-size: 250%;
23 margin-top: 1.5em;
24}
25div.body h3 {
26 font-size: 150%;
27 margin-bottom: 0.5em;
28 margin-top: 1.5em;
29}
30div.body h4 {
31 font-size: 110%;
32 margin-bottom: 0.5em;
33 margin-top: 1.5em;
34}
35div.body h5 {
36 font-size: 100%;
37 margin-bottom: 0.5em;
38 margin-top: 1.5em;
39}
40div.contents {
41 background: #e8e8e8;
42 border: solid thin black;
43 padding: 10px;
44}
45div.contents h1 {
46 font-size: 110%;
47}
48div.contents h2 {
49 font-size: 100%;
50}
51div.contents ul.contents {
52 font-size: 80%;
53}
54.class {
55 border-bottom: solid 2px gray;
56}
57.constants {
58}
59.description {
60 margin-top: 0.5em;
61}
62.discussion {
63}
64.enumeration {
65 border-bottom: solid 2px gray;
66}
67.function {
68 border-bottom: solid 2px gray;
69 margin-bottom: 0;
70}
71.members {
72}
73.method {
74}
75.parameters {
76}
77.returnvalue {
78}
79.struct {
80 border-bottom: solid 2px gray;
81}
82.typedef {
83 border-bottom: solid 2px gray;
84}
85.union {
86 border-bottom: solid 2px gray;
87}
88.variable {
89}
9c44e2cb
MS
90h1, h2, h3, h4, h5, h6 {
91 page-break-inside: avoid;
92}
798d6e29
MS
93blockquote {
94 border: solid thin gray;
95 box-shadow: 3px 3px 5px rgba(0,0,0,0.5);
96 padding: 0px 10px;
97 page-break-inside: avoid;
98}
99p code, li code, p.code, pre, ul.code li {
100 background: rgba(127,127,127,0.1);
101 border: thin dotted gray;
102 font-family: monospace;
103 font-size: 90%;
104 hyphens: manual;
105 -webkit-hyphens: manual;
106 page-break-inside: avoid;
107}
108p.code, pre, ul.code li {
109 padding: 10px;
110}
111p code, li code {
112 padding: 2px 5px;
113}
114a:link, a:visited {
115 text-decoration: none;
116}
117span.info {
118 background: black;
119 border: solid thin black;
120 color: white;
121 font-size: 80%;
122 font-style: italic;
123 font-weight: bold;
124 white-space: nowrap;
125}
126h3 span.info, h4 span.info {
98d88c8d
MS
127 border-top-left-radius: 10px;
128 border-top-right-radius: 10px;
798d6e29 129 float: right;
98d88c8d 130 padding: 3px 6px;
798d6e29
MS
131}
132ul.code, ul.contents, ul.subcontents {
133 list-style-type: none;
134 margin: 0;
135 padding-left: 0;
136}
137ul.code li {
138 margin: 0;
139}
140ul.contents > li {
141 margin-top: 1em;
142}
143ul.contents li ul.code, ul.contents li ul.subcontents {
144 padding-left: 2em;
145}
98d88c8d
MS
146table.list {
147 border-collapse: collapse;
148 width: 100%;
798d6e29 149}
98d88c8d
MS
150table.list tr:nth-child(even) {
151 background: rgba(127,127,127,0.1);]n}
152table.list th {
153 border-right: 2px solid gray;
154 font-family: monospace;
155 padding: 5px 10px 5px 2px;
156 text-align: right;
157 vertical-align: top;
798d6e29 158}
98d88c8d
MS
159table.list td {
160 padding: 5px 2px 5px 10px;
161 text-align: left;
162 vertical-align: top;
798d6e29
MS
163}
164h1.title {
165}
166h2.title {
167 border-bottom: solid 2px black;
168}
169h3.title {
170 border-bottom: solid 2px black;
171}
172--></style>
173 </head>
174 <body>
175 <h1 class="title">CUPS Programming Manual</h1>
176 <p>Michael R Sweet</p>
9c44e2cb 177 <p>Copyright &#xa9; 2007-2017 by Apple Inc. All Rights Reserved.</p>
798d6e29
MS
178 <div class="contents">
179 <h2 class="title">Contents</h2>
180 <ul class="contents">
53af7f21
MS
181 <li><a href="#introduction">Introduction</a><ul class="subcontents">
182 <li><a href="#guidelines">Guidelines</a></li>
183 <li><a href="#terms-used-in-this-document">Terms Used in This Document</a></li>
184 <li><a href="#compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></li>
798d6e29 185 </ul></li>
53af7f21
MS
186 <li><a href="#working-with-destinations">Working with Destinations</a><ul class="subcontents">
187 <li><a href="#finding-available-destinations">Finding Available Destinations</a></li>
188 <li><a href="#basic-destination-information">Basic Destination Information</a></li>
189 <li><a href="#detailed-destination-information">Detailed Destination Information</a></li>
190 <li><a href="#submitting-a-print-job">Submitting a Print Job</a></li>
798d6e29 191 </ul></li>
b0fb2d75
MS
192 <li><a href="#sending-ipp-requests">Sending IPP Requests</a><ul class="subcontents">
193 <li><a href="#connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</a></li>
194 <li><a href="#creating-an-ipp-request">Creating an IPP Request</a></li>
195 <li><a href="#sending-the-ipp-request">Sending the IPP Request</a></li>
196 <li><a href="#processing-the-ipp-response">Processing the IPP Response</a></li>
197 <li><a href="#authentication">Authentication</a></li>
198 </ul></li>
798d6e29
MS
199 <li><a href="#FUNCTIONS">Functions</a><ul class="subcontents">
200 <li><a href="#cupsAddDest">cupsAddDest</a></li>
53af7f21 201 <li><a href="#cupsAddIntegerOption">cupsAddIntegerOption</a></li>
798d6e29 202 <li><a href="#cupsAddOption">cupsAddOption</a></li>
798d6e29 203 <li><a href="#cupsCancelDestJob">cupsCancelDestJob</a></li>
798d6e29
MS
204 <li><a href="#cupsCheckDestSupported">cupsCheckDestSupported</a></li>
205 <li><a href="#cupsCloseDestJob">cupsCloseDestJob</a></li>
206 <li><a href="#cupsConnectDest">cupsConnectDest</a></li>
798d6e29
MS
207 <li><a href="#cupsCopyDest">cupsCopyDest</a></li>
208 <li><a href="#cupsCopyDestConflicts">cupsCopyDestConflicts</a></li>
209 <li><a href="#cupsCopyDestInfo">cupsCopyDestInfo</a></li>
210 <li><a href="#cupsCreateDestJob">cupsCreateDestJob</a></li>
798d6e29
MS
211 <li><a href="#cupsDoAuthentication">cupsDoAuthentication</a></li>
212 <li><a href="#cupsEncodeOptions">cupsEncodeOptions</a></li>
213 <li><a href="#cupsEncodeOptions2">cupsEncodeOptions2</a></li>
214 <li><a href="#cupsEncryption">cupsEncryption</a></li>
215 <li><a href="#cupsEnumDests">cupsEnumDests</a></li>
798d6e29
MS
216 <li><a href="#cupsFindDestDefault">cupsFindDestDefault</a></li>
217 <li><a href="#cupsFindDestReady">cupsFindDestReady</a></li>
218 <li><a href="#cupsFindDestSupported">cupsFindDestSupported</a></li>
219 <li><a href="#cupsFinishDestDocument">cupsFinishDestDocument</a></li>
798d6e29
MS
220 <li><a href="#cupsFreeDestInfo">cupsFreeDestInfo</a></li>
221 <li><a href="#cupsFreeDests">cupsFreeDests</a></li>
222 <li><a href="#cupsFreeJobs">cupsFreeJobs</a></li>
223 <li><a href="#cupsFreeOptions">cupsFreeOptions</a></li>
798d6e29
MS
224 <li><a href="#cupsGetDest">cupsGetDest</a></li>
225 <li><a href="#cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></li>
226 <li><a href="#cupsGetDestMediaByName">cupsGetDestMediaByName</a></li>
227 <li><a href="#cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></li>
228 <li><a href="#cupsGetDestMediaCount">cupsGetDestMediaCount</a></li>
229 <li><a href="#cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></li>
230 <li><a href="#cupsGetDestWithURI">cupsGetDestWithURI</a></li>
98d88c8d 231 <li><a href="#cupsGetDests2">cupsGetDests2</a></li>
53af7f21 232 <li><a href="#cupsGetIntegerOption">cupsGetIntegerOption</a></li>
798d6e29
MS
233 <li><a href="#cupsGetJobs2">cupsGetJobs2</a></li>
234 <li><a href="#cupsGetNamedDest">cupsGetNamedDest</a></li>
235 <li><a href="#cupsGetOption">cupsGetOption</a></li>
798d6e29 236 <li><a href="#cupsGetPassword2">cupsGetPassword2</a></li>
798d6e29
MS
237 <li><a href="#cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></li>
238 <li><a href="#cupsLocalizeDestOption">cupsLocalizeDestOption</a></li>
239 <li><a href="#cupsLocalizeDestValue">cupsLocalizeDestValue</a></li>
240 <li><a href="#cupsMakeServerCredentials">cupsMakeServerCredentials</a></li>
798d6e29 241 <li><a href="#cupsParseOptions">cupsParseOptions</a></li>
798d6e29
MS
242 <li><a href="#cupsRemoveDest">cupsRemoveDest</a></li>
243 <li><a href="#cupsRemoveOption">cupsRemoveOption</a></li>
244 <li><a href="#cupsServer">cupsServer</a></li>
245 <li><a href="#cupsSetClientCertCB">cupsSetClientCertCB</a></li>
246 <li><a href="#cupsSetCredentials">cupsSetCredentials</a></li>
247 <li><a href="#cupsSetDefaultDest">cupsSetDefaultDest</a></li>
798d6e29
MS
248 <li><a href="#cupsSetDests2">cupsSetDests2</a></li>
249 <li><a href="#cupsSetEncryption">cupsSetEncryption</a></li>
798d6e29
MS
250 <li><a href="#cupsSetPasswordCB2">cupsSetPasswordCB2</a></li>
251 <li><a href="#cupsSetServer">cupsSetServer</a></li>
252 <li><a href="#cupsSetServerCertCB">cupsSetServerCertCB</a></li>
253 <li><a href="#cupsSetServerCredentials">cupsSetServerCredentials</a></li>
254 <li><a href="#cupsSetUser">cupsSetUser</a></li>
255 <li><a href="#cupsSetUserAgent">cupsSetUserAgent</a></li>
256 <li><a href="#cupsStartDestDocument">cupsStartDestDocument</a></li>
798d6e29
MS
257 <li><a href="#cupsUser">cupsUser</a></li>
258 <li><a href="#cupsUserAgent">cupsUserAgent</a></li>
259 <li><a href="#httpAcceptConnection">httpAcceptConnection</a></li>
260 <li><a href="#httpAddCredential">httpAddCredential</a></li>
261 <li><a href="#httpAddrAny">httpAddrAny</a></li>
262 <li><a href="#httpAddrClose">httpAddrClose</a></li>
798d6e29
MS
263 <li><a href="#httpAddrConnect2">httpAddrConnect2</a></li>
264 <li><a href="#httpAddrCopyList">httpAddrCopyList</a></li>
265 <li><a href="#httpAddrEqual">httpAddrEqual</a></li>
266 <li><a href="#httpAddrFamily">httpAddrFamily</a></li>
267 <li><a href="#httpAddrFreeList">httpAddrFreeList</a></li>
268 <li><a href="#httpAddrGetList">httpAddrGetList</a></li>
269 <li><a href="#httpAddrLength">httpAddrLength</a></li>
270 <li><a href="#httpAddrListen">httpAddrListen</a></li>
271 <li><a href="#httpAddrLocalhost">httpAddrLocalhost</a></li>
272 <li><a href="#httpAddrLookup">httpAddrLookup</a></li>
273 <li><a href="#httpAddrPort">httpAddrPort</a></li>
274 <li><a href="#httpAddrString">httpAddrString</a></li>
275 <li><a href="#httpAssembleURI">httpAssembleURI</a></li>
276 <li><a href="#httpAssembleURIf">httpAssembleURIf</a></li>
277 <li><a href="#httpAssembleUUID">httpAssembleUUID</a></li>
278 <li><a href="#httpBlocking">httpBlocking</a></li>
279 <li><a href="#httpCheck">httpCheck</a></li>
280 <li><a href="#httpClearCookie">httpClearCookie</a></li>
281 <li><a href="#httpClearFields">httpClearFields</a></li>
282 <li><a href="#httpClose">httpClose</a></li>
283 <li><a href="#httpCompareCredentials">httpCompareCredentials</a></li>
798d6e29 284 <li><a href="#httpConnect2">httpConnect2</a></li>
798d6e29
MS
285 <li><a href="#httpCopyCredentials">httpCopyCredentials</a></li>
286 <li><a href="#httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></li>
287 <li><a href="#httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></li>
288 <li><a href="#httpCredentialsGetTrust">httpCredentialsGetTrust</a></li>
289 <li><a href="#httpCredentialsString">httpCredentialsString</a></li>
798d6e29
MS
290 <li><a href="#httpDecode64_2">httpDecode64_2</a></li>
291 <li><a href="#httpDelete">httpDelete</a></li>
798d6e29
MS
292 <li><a href="#httpEncode64_2">httpEncode64_2</a></li>
293 <li><a href="#httpEncryption">httpEncryption</a></li>
294 <li><a href="#httpError">httpError</a></li>
295 <li><a href="#httpFieldValue">httpFieldValue</a></li>
296 <li><a href="#httpFlush">httpFlush</a></li>
297 <li><a href="#httpFlushWrite">httpFlushWrite</a></li>
298 <li><a href="#httpFreeCredentials">httpFreeCredentials</a></li>
299 <li><a href="#httpGet">httpGet</a></li>
300 <li><a href="#httpGetActivity">httpGetActivity</a></li>
301 <li><a href="#httpGetAddress">httpGetAddress</a></li>
302 <li><a href="#httpGetAuthString">httpGetAuthString</a></li>
303 <li><a href="#httpGetBlocking">httpGetBlocking</a></li>
304 <li><a href="#httpGetContentEncoding">httpGetContentEncoding</a></li>
305 <li><a href="#httpGetCookie">httpGetCookie</a></li>
798d6e29
MS
306 <li><a href="#httpGetDateString2">httpGetDateString2</a></li>
307 <li><a href="#httpGetDateTime">httpGetDateTime</a></li>
308 <li><a href="#httpGetEncryption">httpGetEncryption</a></li>
309 <li><a href="#httpGetExpect">httpGetExpect</a></li>
310 <li><a href="#httpGetFd">httpGetFd</a></li>
311 <li><a href="#httpGetField">httpGetField</a></li>
798d6e29
MS
312 <li><a href="#httpGetHostname">httpGetHostname</a></li>
313 <li><a href="#httpGetKeepAlive">httpGetKeepAlive</a></li>
798d6e29
MS
314 <li><a href="#httpGetLength2">httpGetLength2</a></li>
315 <li><a href="#httpGetPending">httpGetPending</a></li>
316 <li><a href="#httpGetReady">httpGetReady</a></li>
317 <li><a href="#httpGetRemaining">httpGetRemaining</a></li>
318 <li><a href="#httpGetState">httpGetState</a></li>
319 <li><a href="#httpGetStatus">httpGetStatus</a></li>
798d6e29
MS
320 <li><a href="#httpGetSubField2">httpGetSubField2</a></li>
321 <li><a href="#httpGetVersion">httpGetVersion</a></li>
322 <li><a href="#httpGets">httpGets</a></li>
323 <li><a href="#httpHead">httpHead</a></li>
324 <li><a href="#httpInitialize">httpInitialize</a></li>
325 <li><a href="#httpIsChunked">httpIsChunked</a></li>
326 <li><a href="#httpIsEncrypted">httpIsEncrypted</a></li>
327 <li><a href="#httpLoadCredentials">httpLoadCredentials</a></li>
328 <li><a href="#httpOptions">httpOptions</a></li>
329 <li><a href="#httpPeek">httpPeek</a></li>
330 <li><a href="#httpPost">httpPost</a></li>
331 <li><a href="#httpPut">httpPut</a></li>
798d6e29
MS
332 <li><a href="#httpRead2">httpRead2</a></li>
333 <li><a href="#httpReadRequest">httpReadRequest</a></li>
798d6e29
MS
334 <li><a href="#httpReconnect2">httpReconnect2</a></li>
335 <li><a href="#httpResolveHostname">httpResolveHostname</a></li>
336 <li><a href="#httpSaveCredentials">httpSaveCredentials</a></li>
798d6e29
MS
337 <li><a href="#httpSeparateURI">httpSeparateURI</a></li>
338 <li><a href="#httpSetAuthString">httpSetAuthString</a></li>
339 <li><a href="#httpSetCookie">httpSetCookie</a></li>
340 <li><a href="#httpSetCredentials">httpSetCredentials</a></li>
341 <li><a href="#httpSetDefaultField">httpSetDefaultField</a></li>
342 <li><a href="#httpSetExpect">httpSetExpect</a></li>
343 <li><a href="#httpSetField">httpSetField</a></li>
344 <li><a href="#httpSetKeepAlive">httpSetKeepAlive</a></li>
345 <li><a href="#httpSetLength">httpSetLength</a></li>
346 <li><a href="#httpSetTimeout">httpSetTimeout</a></li>
347 <li><a href="#httpShutdown">httpShutdown</a></li>
348 <li><a href="#httpStateString">httpStateString</a></li>
349 <li><a href="#httpStatus">httpStatus</a></li>
798d6e29
MS
350 <li><a href="#httpURIStatusString">httpURIStatusString</a></li>
351 <li><a href="#httpUpdate">httpUpdate</a></li>
352 <li><a href="#httpWait">httpWait</a></li>
798d6e29
MS
353 <li><a href="#httpWrite2">httpWrite2</a></li>
354 <li><a href="#httpWriteResponse">httpWriteResponse</a></li>
355 <li><a href="#ippAddBoolean">ippAddBoolean</a></li>
356 <li><a href="#ippAddBooleans">ippAddBooleans</a></li>
357 <li><a href="#ippAddCollection">ippAddCollection</a></li>
358 <li><a href="#ippAddCollections">ippAddCollections</a></li>
359 <li><a href="#ippAddDate">ippAddDate</a></li>
360 <li><a href="#ippAddInteger">ippAddInteger</a></li>
361 <li><a href="#ippAddIntegers">ippAddIntegers</a></li>
362 <li><a href="#ippAddOctetString">ippAddOctetString</a></li>
363 <li><a href="#ippAddOutOfBand">ippAddOutOfBand</a></li>
364 <li><a href="#ippAddRange">ippAddRange</a></li>
365 <li><a href="#ippAddRanges">ippAddRanges</a></li>
366 <li><a href="#ippAddResolution">ippAddResolution</a></li>
367 <li><a href="#ippAddResolutions">ippAddResolutions</a></li>
368 <li><a href="#ippAddSeparator">ippAddSeparator</a></li>
369 <li><a href="#ippAddString">ippAddString</a></li>
370 <li><a href="#ippAddStringf">ippAddStringf</a></li>
371 <li><a href="#ippAddStringfv">ippAddStringfv</a></li>
372 <li><a href="#ippAddStrings">ippAddStrings</a></li>
373 <li><a href="#ippAttributeString">ippAttributeString</a></li>
374 <li><a href="#ippContainsInteger">ippContainsInteger</a></li>
375 <li><a href="#ippContainsString">ippContainsString</a></li>
376 <li><a href="#ippCopyAttribute">ippCopyAttribute</a></li>
377 <li><a href="#ippCopyAttributes">ippCopyAttributes</a></li>
378 <li><a href="#ippCreateRequestedArray">ippCreateRequestedArray</a></li>
379 <li><a href="#ippDateToTime">ippDateToTime</a></li>
380 <li><a href="#ippDelete">ippDelete</a></li>
381 <li><a href="#ippDeleteAttribute">ippDeleteAttribute</a></li>
382 <li><a href="#ippDeleteValues">ippDeleteValues</a></li>
383 <li><a href="#ippEnumString">ippEnumString</a></li>
384 <li><a href="#ippEnumValue">ippEnumValue</a></li>
385 <li><a href="#ippErrorString">ippErrorString</a></li>
386 <li><a href="#ippErrorValue">ippErrorValue</a></li>
387 <li><a href="#ippFindAttribute">ippFindAttribute</a></li>
388 <li><a href="#ippFindNextAttribute">ippFindNextAttribute</a></li>
389 <li><a href="#ippFirstAttribute">ippFirstAttribute</a></li>
390 <li><a href="#ippGetBoolean">ippGetBoolean</a></li>
391 <li><a href="#ippGetCollection">ippGetCollection</a></li>
392 <li><a href="#ippGetCount">ippGetCount</a></li>
393 <li><a href="#ippGetDate">ippGetDate</a></li>
394 <li><a href="#ippGetGroupTag">ippGetGroupTag</a></li>
395 <li><a href="#ippGetInteger">ippGetInteger</a></li>
396 <li><a href="#ippGetName">ippGetName</a></li>
397 <li><a href="#ippGetOctetString">ippGetOctetString</a></li>
398 <li><a href="#ippGetOperation">ippGetOperation</a></li>
399 <li><a href="#ippGetRange">ippGetRange</a></li>
400 <li><a href="#ippGetRequestId">ippGetRequestId</a></li>
401 <li><a href="#ippGetResolution">ippGetResolution</a></li>
402 <li><a href="#ippGetState">ippGetState</a></li>
403 <li><a href="#ippGetStatusCode">ippGetStatusCode</a></li>
404 <li><a href="#ippGetString">ippGetString</a></li>
405 <li><a href="#ippGetValueTag">ippGetValueTag</a></li>
406 <li><a href="#ippGetVersion">ippGetVersion</a></li>
407 <li><a href="#ippLength">ippLength</a></li>
408 <li><a href="#ippNew">ippNew</a></li>
409 <li><a href="#ippNewRequest">ippNewRequest</a></li>
410 <li><a href="#ippNewResponse">ippNewResponse</a></li>
411 <li><a href="#ippNextAttribute">ippNextAttribute</a></li>
412 <li><a href="#ippOpString">ippOpString</a></li>
413 <li><a href="#ippOpValue">ippOpValue</a></li>
414 <li><a href="#ippPort">ippPort</a></li>
415 <li><a href="#ippRead">ippRead</a></li>
416 <li><a href="#ippReadFile">ippReadFile</a></li>
417 <li><a href="#ippReadIO">ippReadIO</a></li>
418 <li><a href="#ippSetBoolean">ippSetBoolean</a></li>
419 <li><a href="#ippSetCollection">ippSetCollection</a></li>
420 <li><a href="#ippSetDate">ippSetDate</a></li>
421 <li><a href="#ippSetGroupTag">ippSetGroupTag</a></li>
422 <li><a href="#ippSetInteger">ippSetInteger</a></li>
423 <li><a href="#ippSetName">ippSetName</a></li>
424 <li><a href="#ippSetOctetString">ippSetOctetString</a></li>
425 <li><a href="#ippSetOperation">ippSetOperation</a></li>
426 <li><a href="#ippSetPort">ippSetPort</a></li>
427 <li><a href="#ippSetRange">ippSetRange</a></li>
428 <li><a href="#ippSetRequestId">ippSetRequestId</a></li>
429 <li><a href="#ippSetResolution">ippSetResolution</a></li>
430 <li><a href="#ippSetState">ippSetState</a></li>
431 <li><a href="#ippSetStatusCode">ippSetStatusCode</a></li>
432 <li><a href="#ippSetString">ippSetString</a></li>
433 <li><a href="#ippSetStringf">ippSetStringf</a></li>
434 <li><a href="#ippSetStringfv">ippSetStringfv</a></li>
435 <li><a href="#ippSetValueTag">ippSetValueTag</a></li>
436 <li><a href="#ippSetVersion">ippSetVersion</a></li>
437 <li><a href="#ippStateString">ippStateString</a></li>
438 <li><a href="#ippTagString">ippTagString</a></li>
439 <li><a href="#ippTagValue">ippTagValue</a></li>
440 <li><a href="#ippTimeToDate">ippTimeToDate</a></li>
441 <li><a href="#ippValidateAttribute">ippValidateAttribute</a></li>
442 <li><a href="#ippValidateAttributes">ippValidateAttributes</a></li>
443 <li><a href="#ippWrite">ippWrite</a></li>
444 <li><a href="#ippWriteFile">ippWriteFile</a></li>
445 <li><a href="#ippWriteIO">ippWriteIO</a></li>
798d6e29
MS
446 </ul></li>
447 <li><a href="#TYPES">Data Types</a><ul class="subcontents">
798d6e29 448 <li><a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a></li>
798d6e29
MS
449 <li><a href="#cups_dest_cb_t">cups_dest_cb_t</a></li>
450 <li><a href="#cups_dest_t">cups_dest_t</a></li>
451 <li><a href="#cups_dinfo_t">cups_dinfo_t</a></li>
798d6e29 452 <li><a href="#cups_job_t">cups_job_t</a></li>
798d6e29
MS
453 <li><a href="#cups_option_t">cups_option_t</a></li>
454 <li><a href="#cups_password_cb2_t">cups_password_cb2_t</a></li>
798d6e29
MS
455 <li><a href="#cups_ptype_t">cups_ptype_t</a></li>
456 <li><a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a></li>
457 <li><a href="#cups_size_t">cups_size_t</a></li>
798d6e29 458 <li><a href="#http_addr_t">http_addr_t</a></li>
798d6e29
MS
459 <li><a href="#http_encoding_t">http_encoding_t</a></li>
460 <li><a href="#http_encryption_t">http_encryption_t</a></li>
461 <li><a href="#http_field_t">http_field_t</a></li>
462 <li><a href="#http_keepalive_t">http_keepalive_t</a></li>
463 <li><a href="#http_state_t">http_state_t</a></li>
464 <li><a href="#http_t">http_t</a></li>
465 <li><a href="#http_timeout_cb_t">http_timeout_cb_t</a></li>
466 <li><a href="#http_trust_t">http_trust_t</a></li>
467 <li><a href="#http_uri_coding_t">http_uri_coding_t</a></li>
468 <li><a href="#http_uri_status_t">http_uri_status_t</a></li>
798d6e29
MS
469 <li><a href="#ipp_attribute_t">ipp_attribute_t</a></li>
470 <li><a href="#ipp_copycb_t">ipp_copycb_t</a></li>
798d6e29 471 <li><a href="#ipp_iocb_t">ipp_iocb_t</a></li>
798d6e29
MS
472 <li><a href="#ipp_orient_t">ipp_orient_t</a></li>
473 <li><a href="#ipp_pstate_t">ipp_pstate_t</a></li>
474 <li><a href="#ipp_quality_t">ipp_quality_t</a></li>
475 <li><a href="#ipp_res_t">ipp_res_t</a></li>
476 <li><a href="#ipp_state_t">ipp_state_t</a></li>
477 <li><a href="#ipp_t">ipp_t</a></li>
798d6e29
MS
478 </ul></li>
479 <li><a href="#STRUCTURES">Structures</a><ul class="subcontents">
798d6e29
MS
480 <li><a href="#cups_dest_s">cups_dest_s</a></li>
481 <li><a href="#cups_job_s">cups_job_s</a></li>
798d6e29
MS
482 <li><a href="#cups_option_s">cups_option_s</a></li>
483 <li><a href="#cups_size_s">cups_size_s</a></li>
798d6e29 484 </ul></li>
798d6e29 485 <li><a href="#ENUMERATIONS">Enumerations</a><ul class="subcontents">
798d6e29 486 <li><a href="#cups_ptype_e">cups_ptype_e</a></li>
798d6e29
MS
487 <li><a href="#http_encoding_e">http_encoding_e</a></li>
488 <li><a href="#http_encryption_e">http_encryption_e</a></li>
489 <li><a href="#http_field_e">http_field_e</a></li>
490 <li><a href="#http_keepalive_e">http_keepalive_e</a></li>
491 <li><a href="#http_state_e">http_state_e</a></li>
492 <li><a href="#http_status_e">http_status_e</a></li>
493 <li><a href="#http_trust_e">http_trust_e</a></li>
494 <li><a href="#http_uri_coding_e">http_uri_coding_e</a></li>
495 <li><a href="#http_uri_status_e">http_uri_status_e</a></li>
798d6e29 496 <li><a href="#ipp_finishings_e">ipp_finishings_e</a></li>
798d6e29
MS
497 <li><a href="#ipp_jstate_e">ipp_jstate_e</a></li>
498 <li><a href="#ipp_op_e">ipp_op_e</a></li>
499 <li><a href="#ipp_orient_e">ipp_orient_e</a></li>
500 <li><a href="#ipp_pstate_e">ipp_pstate_e</a></li>
501 <li><a href="#ipp_quality_e">ipp_quality_e</a></li>
502 <li><a href="#ipp_res_e">ipp_res_e</a></li>
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>
511 <p>Note: This document is under active development and is incomplete, with a goal completing it prior to releasing CUPS 2.2.4. Please <a href="https://github.com/apple/cups/issues">file issues on Github</a> to provide any feedback.</p>
512</blockquote>
53af7f21 513 <h2><a id="introduction">Introduction</a></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>
53af7f21 516 <h3><a id="guidelines">Guidelines</a></h3>
798d6e29
MS
517 <p>When writing software that uses the &quot;cups&quot; library:</p>
518 <ul>
519 <li>Do not use undocumented or deprecated APIs,</li>
520 <li>Do not rely on pre-configured printers,</li>
521 <li>Do not assume that printers support specific features or formats, and</li>
522 <li>Do not rely on implementation details (PPDs, etc.)</li>
523</ul>
524 <p>CUPS is designed to insulate users and developers from the implementation details of printers and file formats. The goal is to allow an application to supply a print file in a standard format with the user intent (&quot;print four copies, two-sided on A4 media, and staple each copy&quot;) and have the printing system manage the printer communication and format conversion needed.</p>
525 <p>Similarly, printer and job management applications can use standard query operations to obtain the status information in a common, generic form and use standard management operations to control the state of those printers and jobs.</p>
53af7f21 526 <h3><a id="terms-used-in-this-document">Terms Used in This Document</a></h3>
9c44e2cb 527 <p>A <em>Destination</em> is a printer or print queue that accepts print jobs. A <em>Print</em> <em>Job</em> is one or more documents that are processed by a destination using options supplied when creating the job. A <em>Document</em> is a file (JPEG image, PDF file, etc.) suitable for printing. An <em>Option</em> controls some aspect of printing, such as the media used. <em>Media</em> is the sheets or roll that is printed on. An <em>Attribute</em> is an option encoded for an Internet Printing Protocol (IPP) request.</p>
53af7f21 528 <h3><a id="compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></h3>
798d6e29
MS
529 <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>
530 <p>The following simple program lists the available destinations:</p>
531 <pre><code>#include &lt;stdio.h&gt;
532#include &lt;cups/cups.h&gt;
533
534int print_dest(void *user_data, unsigned flags, cups_dest_t *dest)
535{
536 if (dest-&gt;instance)
537 printf(&quot;%s/%s\n&quot;, dest-&gt;name, dest-&gt;instance);
538 else
539 puts(dest-&gt;name);
540
541 return (1);
542}
543
544int main(void)
545{
546 cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, 0, 0, print_dest, NULL);
547
548 return (0);
549}
550</code></pre>
53af7f21 551 <h4><a id="compiling-with-xcode">Compiling with Xcode</a></h4>
9c44e2cb
MS
552 <p>In Xcode, choose <em>New</em> <em>Project...</em> from the <em>File</em> menu (or press SHIFT+CMD+N), then select the <em>Command</em> <em>Line</em> <em>Tool</em> under the macOS Application project type. Click <em>Next</em> and enter a name for the project, for example &quot;firstcups&quot;. Click <em>Next</em> and choose a project directory. The click <em>Next</em> to create the project.</p>
553 <p>In the project window, click on the <em>Build</em> <em>Phases</em> group and expand the <em>Link</em> <em>Binary</em> <em>with</em> <em>Libraries</em> section. Click <em>+</em>, type &quot;libcups&quot; to show the library, and then double-click on <code>libcups.tbd</code>.</p>
798d6e29 554 <p>Finally, click on the <code>main.c</code> file in the sidebar and copy the example program to the file. Build and run (CMD+R) to see the list of destinations.</p>
53af7f21 555 <h4><a id="compiling-with-gcc">Compiling with GCC</a></h4>
798d6e29
MS
556 <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>
557 <pre><code>gcc -o simple `cups-config --cflags` simple.c `cups-config --libs`
558./simple
559</code></pre>
9c44e2cb 560 <p>The <code>cups-config</code> command provides the compiler flags (<code>cups-config --cflags</code>) and libraries (<code>cups-config --libs</code>) needed for the local system.</p>
53af7f21 561 <h2><a id="working-with-destinations">Working with Destinations</a></h2>
9c44e2cb 562 <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 563 <p>Historically destinations have been manually maintained by the administrator of a system or network, but CUPS also supports dynamic discovery of destinations on the current network.</p>
53af7f21 564 <h3><a id="finding-available-destinations">Finding Available Destinations</a></h3>
798d6e29
MS
565 <p>The <code>cupsEnumDests</code> function finds all of the available destinations:</p>
566 <pre><code> int
567 cupsEnumDests(unsigned flags, int msec, int *cancel,
568 cups_ptype_t type, cups_ptype_t mask,
569 cups_dest_cb_t cb, void *user_data)
570</code></pre>
571 <p>The <code>flags</code> argument specifies enumeration options, which at present must be <code>CUPS_DEST_FLAGS_NONE</code>.</p>
572 <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>
573 <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 574 <p>The <code>type</code> and <code>mask</code> arguments are bitfields that allow the caller to filter the destinations based on categories and/or capabilities. The destination's &quot;printer-type&quot; value is masked by the <code>mask</code> value and compared to the <code>type</code> value when filtering. For example, to only enumerate destinations that are hosted on the local system, pass <code>CUPS_PRINTER_LOCAL</code> for the <code>type</code> argument and <code>CUPS_PRINTER_DISCOVERED</code> for the <code>mask</code> argument. The following constants can be used for filtering:</p>
798d6e29
MS
575 <ul>
576 <li><code>CUPS_PRINTER_CLASS</code>: A collection of destinations.</li>
577 <li><code>CUPS_PRINTER_FAX</code>: A facsimile device.</li>
53af7f21
MS
578 <li><code>CUPS_PRINTER_LOCAL</code>: A local printer or class. This constant has the value 0 (no bits set) and is only used for the <code>type</code> argument and is paired with the <code>CUPS_PRINTER_REMOTE</code> or <code>CUPS_PRINTER_DISCOVERED</code> constant passed in the <code>mask</code> argument.</li>
579 <li><code>CUPS_PRINTER_REMOTE</code>: A remote (shared) printer or class.</li>
580 <li><code>CUPS_PRINTER_DISCOVERED</code>: An available network printer or class.</li>
798d6e29
MS
581 <li><code>CUPS_PRINTER_BW</code>: Can do B&amp;W printing.</li>
582 <li><code>CUPS_PRINTER_COLOR</code>: Can do color printing.</li>
583 <li><code>CUPS_PRINTER_DUPLEX</code>: Can do two-sided printing.</li>
584 <li><code>CUPS_PRINTER_STAPLE</code>: Can staple output.</li>
585 <li><code>CUPS_PRINTER_COLLATE</code>: Can quickly collate copies.</li>
586 <li><code>CUPS_PRINTER_PUNCH</code>: Can punch output.</li>
587 <li><code>CUPS_PRINTER_COVER</code>: Can cover output.</li>
588 <li><code>CUPS_PRINTER_BIND</code>: Can bind output.</li>
589 <li><code>CUPS_PRINTER_SORT</code>: Can sort output (mailboxes, etc.)</li>
590 <li><code>CUPS_PRINTER_SMALL</code>: Can print on Letter/Legal/A4-size media.</li>
591 <li><code>CUPS_PRINTER_MEDIUM</code>: Can print on Tabloid/B/C/A3/A2-size media.</li>
592 <li><code>CUPS_PRINTER_LARGE</code>: Can print on D/E/A1/A0-size media.</li>
593 <li><code>CUPS_PRINTER_VARIABLE</code>: Can print on rolls and custom-size media.</li>
594</ul>
595 <p>The <code>cb</code> argument specifies a function to call for every destination that is found:</p>
596 <pre><code>typedef int (*cups_dest_cb_t)(void *user_data,
597 unsigned flags,
598 cups_dest_t *dest);
599</code></pre>
9c44e2cb 600 <p>The callback function receives a copy of the <code>user_data</code> argument along with a bitfield (<code>flags</code>) and the destination that was found. The <code>flags</code> argument can have any of the following constant (bit) values set:</p>
798d6e29
MS
601 <ul>
602 <li><code>CUPS_DEST_FLAGS_MORE</code>: There are more destinations coming.</li>
603 <li><code>CUPS_DEST_FLAGS_REMOVED</code>: The destination has gone away and should be removed from the list of destinations a user can select.</li>
604 <li><code>CUPS_DEST_FLAGS_ERROR</code>: An error occurred. The reason for the error can be found by calling the <code>cupsLastError</code> and/or <code>cupsLastErrorString</code> functions.</li>
605</ul>
606 <p>The callback function returns 0 to stop enumeration or 1 to continue.</p>
718ee2ff
MS
607 <blockquote>
608 <p>Note that the callback function will likely be called multiple times for the same destination, so it is up to the caller to suppress any duplicate destinations.</p>
609</blockquote>
798d6e29
MS
610 <p>The following example shows how to use <code>cupsEnumDests</code> to get a filtered array of destinations:</p>
611 <pre><code>typedef struct
612{
613 int num_dests;
614 cups_dest_t *dests;
615} my_user_data_t;
616
617int
618my_dest_cb(my_user_data_t *user_data, unsigned flags,
619 cups_dest_t *dest)
620{
621 if (flags &amp; CUPS_DEST_FLAGS_REMOVED)
622 {
623 /*
624 * Remove destination from array...
625 */
626
627 user_data-&gt;num_dests =
628 cupsRemoveDest(dest-&gt;name, dest-&gt;instance,
629 user_data-&gt;num_dests,
630 &amp;(user_data-&gt;dests));
631 }
632 else
633 {
634 /*
635 * Add destination to array...
636 */
637
638 user_data-&gt;num_dests =
639 cupsCopyDest(dest, user_data-&gt;num_dests,
640 &amp;(user_data-&gt;dests));
641 }
642
643 return (1);
644}
645
646int
647my_get_dests(cups_ptype_t type, cups_ptype_t mask,
648 cups_dest_t **dests)
649{
650 my_user_data_t user_data = { 0, NULL };
651
652 if (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, type,
653 mask, (cups_dest_cb_t)my_dest_cb,
654 &amp;user_data))
655 {
656 /*
657 * An error occurred, free all of the destinations and
658 * return...
659 */
660
661 cupsFreeDests(user_data.num_dests, user_dasta.dests);
662
663 *dests = NULL;
664
665 return (0);
666 }
667
668 /*
669 * Return the destination array...
670 */
671
672 *dests = user_data.dests;
673
674 return (user_data.num_dests);
675}
676</code></pre>
53af7f21 677 <h3><a id="basic-destination-information">Basic Destination Information</a></h3>
798d6e29
MS
678 <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>
679 <ul>
680 <li>&quot;auth-info-required&quot;: The type of authentication required for printing to this destination: &quot;none&quot;, &quot;username,password&quot;, &quot;domain,username,password&quot;, or &quot;negotiate&quot; (Kerberos).</li>
681 <li>&quot;printer-info&quot;: The human-readable description of the destination such as &quot;My Laser Printer&quot;.</li>
682 <li>&quot;printer-is-accepting-jobs&quot;: &quot;true&quot; if the destination is accepting new jobs, &quot;false&quot; otherwise.</li>
683 <li>&quot;printer-is-shared&quot;: &quot;true&quot; if the destination is being shared with other computers, &quot;false&quot; otherwise.</li>
684 <li>&quot;printer-location&quot;: The human-readable location of the destination such as &quot;Lab 4&quot;.</li>
685 <li>&quot;printer-make-and-model&quot;: The human-readable make and model of the destination such as &quot;ExampleCorp LaserPrinter 4000 Series&quot;.</li>
686 <li>&quot;printer-state&quot;: &quot;3&quot; if the destination is idle, &quot;4&quot; if the destination is printing a job, and &quot;5&quot; if the destination is stopped.</li>
687 <li>&quot;printer-state-change-time&quot;: The UNIX time when the destination entered the current state.</li>
688 <li>&quot;printer-state-reasons&quot;: Additional comma-delimited state keywords for the destination such as &quot;media-tray-empty-error&quot; and &quot;toner-low-warning&quot;.</li>
689 <li>&quot;printer-type&quot;: The <code>cups_ptype_t</code> value associated with the destination.</li>
53af7f21 690 <li>&quot;printer-uri-supported&quot;: The URI associated with the destination; if not set, this destination was discovered but is not yet setup as a local printer.</li>
798d6e29
MS
691</ul>
692 <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>
693 <pre><code>const char *model = cupsGetOption(&quot;printer-make-and-model&quot;,
694 dest-&gt;num_options,
695 dest-&gt;options);
696</code></pre>
53af7f21 697 <h3><a id="detailed-destination-information">Detailed Destination Information</a></h3>
798d6e29
MS
698 <p>Once a destination has been chosen, the <code>cupsCopyDestInfo</code> function can be used to gather detailed information about the destination:</p>
699 <pre><code>cups_dinfo_t *
700cupsCopyDestInfo(http_t *http, cups_dest_t *dest);
701</code></pre>
702 <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>
703 <p>The <code>cups_dinfo_t</code> structure that is returned contains a snapshot of the supported options and their supported, ready, and default values. It also can report constraints between different options and values, and recommend changes to resolve those constraints.</p>
53af7f21 704 <h4><a id="getting-supported-options-and-values">Getting Supported Options and Values</a></h4>
798d6e29
MS
705 <p>The <code>cupsCheckDestSupported</code> function can be used to test whether a particular option or option and value is supported:</p>
706 <pre><code>int
707cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
708 cups_dinfo_t *info,
709 const char *option,
710 const char *value);
711</code></pre>
712 <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>
713 <ul>
714 <li><code>CUPS_COPIES</code>: Controls the number of copies that are produced.</li>
715 <li><code>CUPS_FINISHINGS</code>: A comma-delimited list of integer constants that control the finishing processes that are applied to the job, including stapling, punching, and folding.</li>
716 <li><code>CUPS_MEDIA</code>: Controls the media size that is used, typically one of the following: <code>CUPS_MEDIA_3X5</code>, <code>CUPS_MEDIA_4X6</code>, <code>CUPS_MEDIA_5X7</code>, <code>CUPS_MEDIA_8X10</code>, <code>CUPS_MEDIA_A3</code>, <code>CUPS_MEDIA_A4</code>, <code>CUPS_MEDIA_A5</code>, <code>CUPS_MEDIA_A6</code>, <code>CUPS_MEDIA_ENV10</code>, <code>CUPS_MEDIA_ENVDL</code>, <code>CUPS_MEDIA_LEGAL</code>, <code>CUPS_MEDIA_LETTER</code>, <code>CUPS_MEDIA_PHOTO_L</code>, <code>CUPS_MEDIA_SUPERBA3</code>, or <code>CUPS_MEDIA_TABLOID</code>.</li>
717 <li><code>CUPS_MEDIA_SOURCE</code>: Controls where the media is pulled from, typically either <code>CUPS_MEDIA_SOURCE_AUTO</code> or <code>CUPS_MEDIA_SOURCE_MANUAL</code>.</li>
718 <li><code>CUPS_MEDIA_TYPE</code>: Controls the type of media that is used, typically one of the following: <code>CUPS_MEDIA_TYPE_AUTO</code>, <code>CUPS_MEDIA_TYPE_ENVELOPE</code>, <code>CUPS_MEDIA_TYPE_LABELS</code>, <code>CUPS_MEDIA_TYPE_LETTERHEAD</code>, <code>CUPS_MEDIA_TYPE_PHOTO</code>, <code>CUPS_MEDIA_TYPE_PHOTO_GLOSSY</code>, <code>CUPS_MEDIA_TYPE_PHOTO_MATTE</code>, <code>CUPS_MEDIA_TYPE_PLAIN</code>, or <code>CUPS_MEDIA_TYPE_TRANSPARENCY</code>.</li>
719 <li><code>CUPS_NUMBER_UP</code>: Controls the number of document pages that are placed on each media side.</li>
720 <li><code>CUPS_ORIENTATION</code>: Controls the orientation of document pages placed on the media: <code>CUPS_ORIENTATION_PORTRAIT</code> or <code>CUPS_ORIENTATION_LANDSCAPE</code>.</li>
9c44e2cb 721 <li><code>CUPS_PRINT_COLOR_MODE</code>: Controls whether the output is in color (<code>CUPS_PRINT_COLOR_MODE_COLOR</code>), grayscale (<code>CUPS_PRINT_COLOR_MODE_MONOCHROME</code>), or either (<code>CUPS_PRINT_COLOR_MODE_AUTO</code>).</li>
798d6e29
MS
722 <li><code>CUPS_PRINT_QUALITY</code>: Controls the generate quality of the output: <code>CUPS_PRINT_QUALITY_DRAFT</code>, <code>CUPS_PRINT_QUALITY_NORMAL</code>, or <code>CUPS_PRINT_QUALITY_HIGH</code>.</li>
723 <li><code>CUPS_SIDES</code>: Controls whether prints are placed on one or both sides of the media: <code>CUPS_SIDES_ONE_SIDED</code>, <code>CUPS_SIDES_TWO_SIDED_PORTRAIT</code>, or <code>CUPS_SIDES_TWO_SIDED_LANDSCAPE</code>.</li>
724</ul>
725 <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>
726 <p>The <code>cupsFindDestSupported</code> function returns the IPP attribute containing the supported values for a given option:</p>
727 <pre><code> ipp_attribute_t *
728 cupsFindDestSupported(http_t *http, cups_dest_t *dest,
729 cups_dinfo_t *dinfo,
730 const char *option);
731</code></pre>
732 <p>For example, the following code prints the supported finishing processes for a destination, if any, to the standard output:</p>
733 <pre><code>cups_dinfo_t *info = cupsCopyDestInfo(CUPS_HTTP_DEFAULT,
734 dest);
735
736if (cupsCheckDestSupported(CUPS_HTTP_DEFAULT, dest, info,
737 CUPS_FINISHINGS, NULL))
738{
739 ipp_attribute_t *finishings =
740 cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
741 CUPS_FINISHINGS);
742 int i, count = ippGetCount(finishings);
743
744 puts(&quot;finishings supported:&quot;);
745 for (i = 0; i &lt; count; i ++)
746 printf(&quot; %d\n&quot;, ippGetInteger(finishings, i));
747}
748else
749 puts(&quot;finishings not supported.&quot;);
750</code></pre>
751 <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>
752 <pre><code>ipp_attribute_t *attrs =
753 cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
754 &quot;job-creation-attributes&quot;);
755int i, count = ippGetCount(attrs);
756
757for (i = 0; i &lt; count; i ++)
758 puts(ippGetString(attrs, i, NULL));
759</code></pre>
53af7f21 760 <h4><a id="getting-default-values">Getting Default Values</a></h4>
798d6e29
MS
761 <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>
762 <pre><code>ipp_attribute_t *
763cupsFindDestDefault(http_t *http, cups_dest_t *dest,
764 cups_dinfo_t *dinfo,
765 const char *option);
766</code></pre>
767 <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>
768 <pre><code>const char *def_value =
769 cupsGetOption(CUPS_FINISHINGS, dest-&gt;num_options,
770 dest-&gt;options);
771ipp_attribute_t *def_attr =
772 cupsFindDestDefault(CUPS_HTTP_DEFAULT, dest, info,
773 CUPS_FINISHINGS);
774
775if (def_value != NULL)
776{
777 printf(&quot;Default finishings: %s\n&quot;, def_value);
778}
779else
780{
781 int i, count = ippGetCount(def_attr);
782
783 printf(&quot;Default finishings: %d&quot;,
784 ippGetInteger(def_attr, 0));
785 for (i = 1; i &lt; count; i ++)
786 printf(&quot;,%d&quot;, ippGetInteger(def_attr, i));
787 putchar('\n');
788}
789</code></pre>
53af7f21 790 <h4><a id="getting-ready-loaded-values">Getting Ready (Loaded) Values</a></h4>
798d6e29
MS
791 <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>
792 <p>The <code>cupsFindDestReady</code> function finds the IPP attribute containing the ready values for a given option:</p>
793 <pre><code>ipp_attribute_t *
794cupsFindDestReady(http_t *http, cups_dest_t *dest,
795 cups_dinfo_t *dinfo, const char *option);
796</code></pre>
797 <p>For example, the following code lists the ready finishing processes:</p>
798 <pre><code>ipp_attribute_t *ready_finishings =
799 cupsFindDestReady(CUPS_HTTP_DEFAULT, dest, info,
800 CUPS_FINISHINGS);
801
802if (ready_finishings != NULL)
803{
804 int i, count = ippGetCount(ready_finishings);
805
806 puts(&quot;finishings ready:&quot;);
807 for (i = 0; i &lt; count; i ++)
808 printf(&quot; %d\n&quot;, ippGetInteger(ready_finishings, i));
809}
810else
811 puts(&quot;no finishings are ready.&quot;);
812</code></pre>
53af7f21 813 <h4><a id="media-size-options">Media Size Options</a></h4>
798d6e29
MS
814 <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>
815 <pre><code>typedef struct cups_size_s
816{
817 char media[128];
818 int width, length;
819 int bottom, left, right, top;
820} cups_size_t;
821</code></pre>
822 <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>
823 <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>
824 <pre><code>int
825cupsGetDestMediaByName(http_t *http, cups_dest_t *dest,
826 cups_dinfo_t *dinfo,
827 const char *media,
828 unsigned flags, cups_size_t *size);
829
830int
831cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest,
832 cups_dinfo_t *dinfo,
833 int width, int length,
834 unsigned flags, cups_size_t *size);
835</code></pre>
836 <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>
837 <ul>
838 <li><code>CUPS_MEDIA_FLAGS_DEFAULT</code>: Find the closest size supported by the printer.</li>
839 <li><code>CUPS_MEDIA_FLAGS_BORDERLESS</code>: Find a borderless size.</li>
840 <li><code>CUPS_MEDIA_FLAGS_DUPLEX</code>: Find a size compatible with two-sided printing.</li>
841 <li><code>CUPS_MEDIA_FLAGS_EXACT</code>: Find an exact match for the size.</li>
842 <li><code>CUPS_MEDIA_FLAGS_READY</code>: If the printer supports media sensing or configuration of the media in each tray/source, find the size amongst the &quot;ready&quot; media.</li>
843</ul>
844 <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>
845 <p>For example, the following code prints the margins for two-sided printing on US Letter media:</p>
846 <pre><code>cups_size_t size;
847
848if (cupsGetDestMediaByName(CUPS_HTTP_DEFAULT, dest, info,
849 CUPS_MEDIA_LETTER,
850 CUPS_MEDIA_FLAGS_DUPLEX, &amp;size))
851{
852 puts(&quot;Margins for duplex US Letter:&quot;);
853 printf(&quot; Bottom: %.2fin\n&quot;, size.bottom / 2540.0);
854 printf(&quot; Left: %.2fin\n&quot;, size.left / 2540.0);
855 printf(&quot; Right: %.2fin\n&quot;, size.right / 2540.0);
856 printf(&quot; Top: %.2fin\n&quot;, size.top / 2540.0);
857}
858else
859 puts(&quot;Margins for duplex US Letter are not available.&quot;);
860</code></pre>
861 <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>
862 <pre><code>int
863cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest,
864 cups_dinfo_t *dinfo, int n,
865 unsigned flags, cups_size_t *size);
866
867int
868cupsGetDestMediaCount(http_t *http, cups_dest_t *dest,
869 cups_dinfo_t *dinfo, unsigned flags);
870</code></pre>
871 <p>For example, the following code prints the list of ready media and corresponding margins:</p>
872 <pre><code>cups_size_t size;
873int i;
874int count = cupsGetDestMediaCount(CUPS_HTTP_DEFAULT,
875 dest, info,
876 CUPS_MEDIA_FLAGS_READY);
877
878for (i = 0; i &lt; count; i ++)
879{
880 if (cupsGetDestMediaByIndex(CUPS_HTTP_DEFAULT, dest, info,
881 i, CUPS_MEDIA_FLAGS_READY,
882 &amp;size))
883 {
884 printf(&quot;%s:\n&quot;, size.name);
885 printf(&quot; Width: %.2fin\n&quot;, size.width / 2540.0);
886 printf(&quot; Length: %.2fin\n&quot;, size.length / 2540.0);
887 printf(&quot; Bottom: %.2fin\n&quot;, size.bottom / 2540.0);
888 printf(&quot; Left: %.2fin\n&quot;, size.left / 2540.0);
889 printf(&quot; Right: %.2fin\n&quot;, size.right / 2540.0);
890 printf(&quot; Top: %.2fin\n&quot;, size.top / 2540.0);
891 }
892}
893</code></pre>
894 <p>Finally, the <code>cupsGetDestMediaDefault</code> function returns the default media size:</p>
895 <pre><code>int
896cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
897 cups_dinfo_t *dinfo, unsigned flags,
898 cups_size_t *size);
899</code></pre>
53af7f21 900 <h4><a id="localizing-options-and-values">Localizing Options and Values</a></h4>
798d6e29
MS
901 <p>CUPS provides three functions to get localized versions of options and values: <code>cupsLocalizeDestMedia</code>, <code>cupsLocalizeDestOption</code>, and <code>cupsLocalizeDestValue</code>:</p>
902 <pre><code>const char *
903cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest,
904 cups_dinfo_t *info, unsigned flags,
905 cups_size_t *size);
906
907const char *
908cupsLocalizeDestOption(http_t *http, cups_dest_t *dest,
909 cups_dinfo_t *info,
910 const char *option);
911
912const char *
913cupsLocalizeDestValue(http_t *http, cups_dest_t *dest,
914 cups_dinfo_t *info,
915 const char *option, const char *value);
916</code></pre>
53af7f21 917 <h3><a id="submitting-a-print-job">Submitting a Print Job</a></h3>
798d6e29
MS
918 <p>Once you are ready to submit a print job, you create a job using the <code>cupsCreateDestJob</code> function:</p>
919 <pre><code>ipp_status_t
920cupsCreateDestJob(http_t *http, cups_dest_t *dest,
921 cups_dinfo_t *info, int *job_id,
922 const char *title, int num_options,
923 cups_option_t *options);
924</code></pre>
925 <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>
926 <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>
927 <p>For example, the following code creates a new job that will print 42 copies of a two-sided US Letter document:</p>
928 <pre><code>int job_id = 0;
929int num_options = 0;
930cups_option_t *options = NULL;
931
932num_options = cupsAddOption(CUPS_COPIES, &quot;42&quot;,
933 num_options, &amp;options);
934num_options = cupsAddOption(CUPS_MEDIA, CUPS_MEDIA_LETTER,
935 num_options, &amp;options);
936num_options = cupsAddOption(CUPS_SIDES,
937 CUPS_SIDES_TWO_SIDED_PORTRAIT,
938 num_options, &amp;options);
939
940if (cupsCreateDestJob(CUPS_HTTP_DEFAULT, dest, info,
941 &amp;job_id, &quot;My Document&quot;, num_options,
942 options) == IPP_STATUS_OK)
943 printf(&quot;Created job: %d\n&quot;, job_id);
944else
945 printf(&quot;Unable to create job: %s\n&quot;,
946 cupsLastErrorString());
947</code></pre>
948 <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>
949 <pre><code>http_status_t
950cupsStartDestDocument(http_t *http, cups_dest_t *dest,
951 cups_dinfo_t *info, int job_id,
952 const char *docname,
953 const char *format,
954 int num_options,
955 cups_option_t *options,
956 int last_document);
957
958http_status_t
959cupsWriteRequestData(http_t *http, const char *buffer,
960 size_t length);
961
962ipp_status_t
963cupsFinishDestDocument(http_t *http, cups_dest_t *dest,
964 cups_dinfo_t *info);
965</code></pre>
966 <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>
967 <ul>
968 <li><code>CUPS_FORMAT_JPEG</code>: &quot;image/jpeg&quot;</li>
969 <li><code>CUPS_FORMAT_PDF</code>: &quot;application/pdf&quot;</li>
970 <li><code>CUPS_FORMAT_POSTSCRIPT</code>: &quot;application/postscript&quot;</li>
971 <li><code>CUPS_FORMAT_TEXT</code>: &quot;text/plain&quot;</li>
972</ul>
973 <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>
974 <p>For example, the following code submits a PDF file to the job that was just created:</p>
975 <pre><code>FILE *fp = fopen(&quot;filename.pdf&quot;, &quot;rb&quot;);
976size_t bytes;
977char buffer[65536];
978
979if (cupsStartDestDocument(CUPS_HTTP_DEFAULT, dest, info,
980 job_id, &quot;filename.pdf&quot;, 0, NULL,
981 1) == HTTP_STATUS_CONTINUE)
982{
983 while ((bytes = fread(buffer, 1, sizeof(buffer), fp)) &gt; 0)
984 if (cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer,
985 bytes) != HTTP_STATUS_CONTINUE)
986 break;
987
988 if (cupsFinishDestDocument(CUPS_HTTP_DEFAULT, dest,
989 info) == IPP_STATUS_OK)
990 puts(&quot;Document send succeeded.&quot;);
991 else
992 printf(&quot;Document send failed: %s\n&quot;,
993 cupsLastErrorString());
994}
995
996fclose(fp);
997</code></pre>
b0fb2d75
MS
998 <h2><a id="sending-ipp-requests">Sending IPP Requests</a></h2>
999 <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>
1000 <h3><a id="connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</a></h3>
1001 <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>
1002 <pre><code>http_t *
1003cupsConnectDest(cups_dest_t *dest, unsigned flags, int msec,
1004 int *cancel, char *resource,
1005 size_t resourcesize, cups_dest_cb_t cb,
1006 void *user_data);
1007</code></pre>
1008 <p>The <code>dest</code> argument specifies the destination to connect to.</p>
1009 <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>
1010 <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>
1011 <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>
1012 <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>
1013 <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>
1014 <p>On success, a HTTP connection is returned that can be used to send IPP requests and get IPP responses.</p>
1015 <p>For example, the following code connects to the printer associated with a destination with a 30 second timeout:</p>
1016 <pre><code>char resource[256];
1017http_t *http = cupsConnectDest(dest, CUPS_DEST_FLAGS_DEVICE,
1018 30000, NULL, resource,
1019 sizeof(resource), NULL, NULL);
1020</code></pre>
1021 <h3><a id="creating-an-ipp-request">Creating an IPP Request</a></h3>
1022 <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>
1023 <p>The <code>ippNewRequest</code> function creates a new IPP request:</p>
1024 <pre><code>ipp_t *
1025ippNewRequest(ipp_op_t op);
1026</code></pre>
1027 <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>
1028 <pre><code>ipp_t *request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
1029</code></pre>
1030 <p>The request identifier is automatically set to a unique value for the current process.</p>
1031 <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>
1032 <pre><code>const char *printer_uri = cupsGetOption(&quot;device-uri&quot;,
1033 dest-&gt;num_options,
1034 dest-&gt;options);
1035
1036ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
1037 &quot;printer-uri&quot;, NULL, printer_uri);
1038</code></pre>
1039 <blockquote>
1040 <p>Note: If we wanted to query the scheduler instead of the device, we would look up the &quot;printer-uri-supported&quot; option instead of the &quot;device-uri&quot; value.</p>
1041</blockquote>
1042 <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>
1043 <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>
1044 <pre><code>static const char * const requested_attributes[] =
1045{
1046 &quot;printer-state&quot;,
1047 &quot;printer-state-message&quot;,
1048 &quot;printer-state-reasons&quot;
1049};
1050
1051ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
1052 &quot;requested-attributes&quot;, 3, NULL,
1053 requested_attributes);
1054</code></pre>
1055 <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>
1056 <p>CUPS provides many functions to adding attributes of different types:</p>
1057 <ul>
1058 <li><code>ippAddBoolean</code> adds a boolean (<code>IPP_TAG_BOOLEAN</code>) attribute with one value.</li>
1059 <li><code>ippAddInteger</code> adds an enum (<code>IPP_TAG_ENUM</code>) or integer (<code>IPP_TAG_INTEGER</code>) attribute with one value.</li>
1060 <li><code>ippAddIntegers</code> adds an enum or integer attribute with one or more values.</li>
1061 <li><code>ippAddOctetString</code> adds an octetString attribute with one value.</li>
1062 <li><code>ippAddOutOfBand</code> adds a admin-defined (<code>IPP_TAG_ADMINDEFINE</code>), default (<code>IPP_TAG_DEFAULT</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable (<code>IPP_TAG_NOTSETTABLE</code>), unknown (<code>IPP_TAG_UNKNOWN</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_VALUE</code>) out-of-band attribute.</li>
1063 <li><code>ippAddRange</code> adds a rangeOfInteger attribute with one range.</li>
1064 <li><code>ippAddRanges</code> adds a rangeOfInteger attribute with one or more ranges.</li>
1065 <li><code>ippAddResolution</code> adds a resolution attribute with one resolution.</li>
1066 <li><code>ippAddResolutions</code> adds a resolution attribute with one or more resolutions.</li>
1067 <li><code>ippAddString</code> adds a charset (<code>IPP_TAG_CHARSET</code>), keyword (<code>IPP_TAG_KEYWORD</code>), mimeMediaType (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code> and <code>IPP_TAG_NAMELANG</code>), naturalLanguage (<code>IPP_TAG_NATURAL_LANGUAGE</code>), text (<code>IPP_TAG_TEXT</code> and <code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), or uriScheme (<code>IPP_TAG_URISCHEME</code>) attribute with one value.</li>
1068 <li><code>ippAddStrings</code> adds a charset, keyword, mimeMediaType, name, naturalLanguage, text, uri, or uriScheme attribute with one or more values.</li>
1069</ul>
1070 <h3><a id="sending-the-ipp-request">Sending the IPP Request</a></h3>
1071 <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>
1072 <pre><code>ipp_t *response = cupsDoRequest(http, request, resource);
1073</code></pre>
1074 <p>For requests like Send-Document that include a file, the <code>cupsDoFileRequest</code> function should be used:</p>
1075 <pre><code>ipp_t *response = cupsDoFileRequest(http, request, resource,
1076 filename);
1077</code></pre>
1078 <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>
1079 <p>The status from the most recent request can be queried using the <code>cupsLastError</code> function, for example:</p>
1080 <pre><code>if (cupsLastError() &gt;= IPP_STATUS_ERROR_BAD_REQUEST)
1081{
1082 /* request failed */
1083}
1084</code></pre>
1085 <p>A human-readable error message is also available using the <code>cupsLastErrorString</code> function:</p>
1086 <pre><code>if (cupsLastError() &gt;= IPP_STATUS_ERROR_BAD_REQUEST)
1087{
1088 /* request failed */
1089 printf(&quot;Request failed: %s\n&quot;, cupsLastErrorString());
1090}
1091</code></pre>
1092 <h3><a id="processing-the-ipp-response">Processing the IPP Response</a></h3>
1093 <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>
1094 <p>For example, the following code finds the printer state attributes and prints their values:</p>
1095 <pre><code>ipp_attribute_t *attr;
1096
1097if ((attr = ippFindAttribute(response, &quot;printer-state&quot;,
1098 IPP_TAG_ENUM)) != NULL)
1099{
1100 printf(&quot;printer-state=%s\n&quot;,
1101 ippTagString(&quot;printer-state&quot;, ippGetInteger(attr, 0)));
1102}
1103else
1104 puts(&quot;printer-state=unknown&quot;);
1105
1106if ((attr = ippFindAttribute(response, &quot;printer-state-message&quot;,
1107 IPP_TAG_TEXT)) != NULL)
1108{
1109 printf(&quot;printer-state-message=\&quot;%s\&quot;\n&quot;,
1110 ippGetString(attr, 0, NULL)));
1111}
1112
1113if ((attr = ippFindAttribute(response, &quot;printer-state-reasons&quot;,
1114 IPP_TAG_KEYWORD)) != NULL)
1115{
1116 int i, count = ippGetCount(attr);
1117
1118 puts(&quot;printer-state-reasons=&quot;);
1119 for (i = 0; i &lt; count; i ++)
1120 printf(&quot; %s\n&quot;, ippGetString(attr, i, NULL)));
1121}
1122</code></pre>
1123 <p>The <code>ippGetCount</code> function returns the number of values in an attribute.</p>
1124 <p>The <code>ippGetInteger</code> and <code>ippGetString</code> functions return a single integer or string value from an attribute.</p>
1125 <p>The <code>ippTagString</code> function converts a enum value to its keyword (string) equivalent.</p>
1126 <p>Once you are done using the IPP response message, free it using the <code>ippDelete</code> function:</p>
1127 <pre><code>ippDelete(response);
1128</code></pre>
1129 <h3><a id="authentication">Authentication</a></h3>
1130 <p>CUPS normally handles authentication through the console. GUI applications should set a password callback using the <code>cupsSetPasswordCB2</code> function:</p>
1131 <pre><code>void
1132cupsSetPasswordCB2(cups_password_cb2_t cb, void *user_data);
1133</code></pre>
1134 <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>
1135 <pre><code>const char *
1136cups_password_cb2(const char *prompt, http_t *http,
1137 const char *method, const char *resource,
1138 void *user_data);
1139</code></pre>
1140 <p>The <code>prompt</code> argument is a string from CUPS that should be displayed to the user.</p>
1141 <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>
1142 <p>The <code>method</code> argument specifies the HTTP method used for the request and is typically &quot;POST&quot;.</p>
1143 <p>The <code>resource</code> argument specifies the path used for the request.</p>
1144 <p>The <code>user_data</code> argument provides the user data pointer from the <code>cupsSetPasswordCB2</code> call.</p>
798d6e29
MS
1145 <h2 class="title"><a id="FUNCTIONS">Functions</a></h2>
1146<h3 class="function"><a id="cupsAddDest">cupsAddDest</a></h3>
1147 <p class="description">Add a destination to the list of destinations.</p>
1148<p class="code">
98d88c8d
MS
1149int cupsAddDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
1150<h4 class="parameters">Parameters</h4>
1151<table class="list"><tbody>
1152<tr><th>name</th>
1153 <td class="description">Destination name</td></tr>
1154<tr><th>instance</th>
1155 <td class="description">Instance name or <code>NULL</code> for none/primary</td></tr>
1156<tr><th>num_dests</th>
1157 <td class="description">Number of destinations</td></tr>
1158<tr><th>dests</th>
1159 <td class="description">Destinations</td></tr>
1160</tbody></table>
798d6e29
MS
1161<h4 class="returnvalue">Return Value</h4>
1162 <p class="description">New number of destinations</p>
1163<h4 class="discussion">Discussion</h4>
1164 <p class="discussion">This function cannot be used to add a new class or printer queue,
1165it only adds a new container of saved options for the named
1166destination or instance.<br>
1167<br>
1168If the named destination already exists, the destination list is
1169returned unchanged. Adding a new instance of a destination creates
1170a copy of that destination's options.<br>
1171<br>
1172Use the <a href="#cupsSaveDests"><code>cupsSaveDests</code></a> function to save the updated list of
1173destinations to the user's lpoptions file.</p>
98d88c8d 1174<h3 class="function"><span class="info">&#160;CUPS 2.2.4/macOS 10.13&#160;</span><a id="cupsAddIntegerOption">cupsAddIntegerOption</a></h3>
53af7f21 1175 <p class="description">Add an integer option to an option array.</p>
798d6e29 1176<p class="code">
98d88c8d
MS
1177int cupsAddIntegerOption(const char *name, int value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
1178<h4 class="parameters">Parameters</h4>
1179<table class="list"><tbody>
1180<tr><th>name</th>
1181 <td class="description">Name of option</td></tr>
1182<tr><th>value</th>
1183 <td class="description">Value of option</td></tr>
1184<tr><th>num_options</th>
1185 <td class="description">Number of options</td></tr>
1186<tr><th>options</th>
1187 <td class="description">Pointer to options</td></tr>
1188</tbody></table>
798d6e29
MS
1189<h4 class="returnvalue">Return Value</h4>
1190 <p class="description">Number of options</p>
1191<h4 class="discussion">Discussion</h4>
1192 <p class="discussion">New option arrays can be initialized simply by passing 0 for the
53af7f21 1193&quot;num_options&quot; parameter.
798d6e29
MS
1194
1195</p>
53af7f21
MS
1196<h3 class="function"><a id="cupsAddOption">cupsAddOption</a></h3>
1197 <p class="description">Add an option to an option array.</p>
798d6e29 1198<p class="code">
98d88c8d
MS
1199int cupsAddOption(const char *name, const char *value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
1200<h4 class="parameters">Parameters</h4>
1201<table class="list"><tbody>
1202<tr><th>name</th>
1203 <td class="description">Name of option</td></tr>
1204<tr><th>value</th>
1205 <td class="description">Value of option</td></tr>
1206<tr><th>num_options</th>
1207 <td class="description">Number of options</td></tr>
1208<tr><th>options</th>
1209 <td class="description">Pointer to options</td></tr>
1210</tbody></table>
798d6e29 1211<h4 class="returnvalue">Return Value</h4>
53af7f21 1212 <p class="description">Number of options</p>
798d6e29 1213<h4 class="discussion">Discussion</h4>
53af7f21
MS
1214 <p class="discussion">New option arrays can be initialized simply by passing 0 for the
1215&quot;num_options&quot; parameter.</p>
98d88c8d 1216<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCancelDestJob">cupsCancelDestJob</a></h3>
798d6e29 1217 <p class="description">Cancel a job on a destination.</p>
98d88c8d
MS
1218<p class="code">
1219ipp_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>
1220<h4 class="parameters">Parameters</h4>
1221<table class="list"><tbody>
1222<tr><th>http</th>
1223 <td class="description">Connection to destination</td></tr>
1224<tr><th>dest</th>
1225 <td class="description">Destination</td></tr>
1226<tr><th>job_id</th>
1227 <td class="description">Job ID</td></tr>
1228</tbody></table>
1229<h4 class="returnvalue">Return Value</h4>
1230 <p class="description">Status of cancel operation</p>
1231<h4 class="discussion">Discussion</h4>
798d6e29
MS
1232 <p class="discussion">The &quot;job_id&quot; is the number returned by cupsCreateDestJob.<br>
1233<br>
1234Returns <code>IPP_STATUS_OK</code> on success and
98d88c8d 1235<code>IPP_STATUS_ERROR_NOT_AUTHORIZED</code> or
798d6e29
MS
1236<code>IPP_STATUS_ERROR_FORBIDDEN</code> on failure.
1237
798d6e29
MS
1238</p>
1239<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCheckDestSupported">cupsCheckDestSupported</a></h3>
1240 <p class="description">Check that the option and value are supported
1241by the destination.</p>
1242<p class="code">
98d88c8d
MS
1243int 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>
1244<h4 class="parameters">Parameters</h4>
1245<table class="list"><tbody>
1246<tr><th>http</th>
1247 <td class="description">Connection to destination</td></tr>
1248<tr><th>dest</th>
1249 <td class="description">Destination</td></tr>
1250<tr><th>dinfo</th>
1251 <td class="description">Destination information</td></tr>
1252<tr><th>option</th>
1253 <td class="description">Option</td></tr>
1254<tr><th>value</th>
b0fb2d75 1255 <td class="description">Value or <code>NULL</code></td></tr>
98d88c8d 1256</tbody></table>
798d6e29
MS
1257<h4 class="returnvalue">Return Value</h4>
1258 <p class="description">1 if supported, 0 otherwise</p>
1259<h4 class="discussion">Discussion</h4>
1260 <p class="discussion">Returns 1 if supported, 0 otherwise.
1261
1262</p>
1263<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCloseDestJob">cupsCloseDestJob</a></h3>
1264 <p class="description">Close a job and start printing.</p>
1265<p class="code">
98d88c8d
MS
1266ipp_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>
1267<h4 class="parameters">Parameters</h4>
1268<table class="list"><tbody>
1269<tr><th>http</th>
1270 <td class="description">Connection to destination</td></tr>
1271<tr><th>dest</th>
1272 <td class="description">Destination</td></tr>
1273<tr><th>info</th>
1274 <td class="description">Destination information</td></tr>
1275<tr><th>job_id</th>
1276 <td class="description">Job ID</td></tr>
1277</tbody></table>
798d6e29
MS
1278<h4 class="returnvalue">Return Value</h4>
1279 <p class="description">IPP status code</p>
1280<h4 class="discussion">Discussion</h4>
1281 <p class="discussion">Use when the last call to cupsStartDocument passed 0 for &quot;last_document&quot;.
1282&quot;job_id&quot; is the job ID returned by cupsCreateDestJob. Returns <code>IPP_STATUS_OK</code>
1283on success.
1284
1285</p>
1286<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsConnectDest">cupsConnectDest</a></h3>
98d88c8d
MS
1287 <p class="description">Open a conection to the destination.</p>
1288<p class="code">
1289<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>
1290<h4 class="parameters">Parameters</h4>
1291<table class="list"><tbody>
1292<tr><th>dest</th>
1293 <td class="description">Destination</td></tr>
1294<tr><th>flags</th>
1295 <td class="description">Connection flags</td></tr>
1296<tr><th>msec</th>
1297 <td class="description">Timeout in milliseconds</td></tr>
1298<tr><th>cancel</th>
1299 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
1300<tr><th>resource</th>
1301 <td class="description">Resource buffer</td></tr>
1302<tr><th>resourcesize</th>
1303 <td class="description">Size of resource buffer</td></tr>
1304<tr><th>cb</th>
1305 <td class="description">Callback function</td></tr>
1306<tr><th>user_data</th>
1307 <td class="description">User data pointer</td></tr>
1308</tbody></table>
1309<h4 class="returnvalue">Return Value</h4>
1310 <p class="description">Connection to destination or <code>NULL</code></p>
1311<h4 class="discussion">Discussion</h4>
1312 <p class="discussion">Connect to the destination, returning a new <code>http_t</code> connection object
1313and optionally the resource path to use for the destination. These calls
1314will block until a connection is made, the timeout expires, the integer
1315pointed to by &quot;cancel&quot; is non-zero, or the callback function (or block)
1316returns 0. The caller is responsible for calling <a href="#httpClose"><code>httpClose</code></a> on the
b0fb2d75
MS
1317returned connection.<br>
1318<br>
1319Starting with CUPS 2.2.4, the caller can pass <code>CUPS_DEST_FLAGS_DEVICE</code>
1320for the &quot;flags&quot; argument to connect directly to the device associated with
1321the destination. Otherwise, the connection is made to the CUPS scheduler
1322associated with the destination.
798d6e29
MS
1323
1324</p>
53af7f21
MS
1325<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDest">cupsCopyDest</a></h3>
1326 <p class="description">Copy a destination.</p>
798d6e29 1327<p class="code">
98d88c8d
MS
1328int 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>
1329<h4 class="parameters">Parameters</h4>
1330<table class="list"><tbody>
1331<tr><th>dest</th>
1332 <td class="description">Destination to copy</td></tr>
1333<tr><th>num_dests</th>
1334 <td class="description">Number of destinations</td></tr>
1335<tr><th>dests</th>
1336 <td class="description">Destination array</td></tr>
1337</tbody></table>
798d6e29
MS
1338<h4 class="returnvalue">Return Value</h4>
1339 <p class="description">New number of destinations</p>
1340<h4 class="discussion">Discussion</h4>
1341 <p class="discussion">Make a copy of the destination to an array of destinations (or just a single
1342copy) - for use with the cupsEnumDests* functions. The caller is responsible
1343for calling cupsFreeDests() on the returned object(s).
1344
1345</p>
1346<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDestConflicts">cupsCopyDestConflicts</a></h3>
1347 <p class="description">Get conflicts and resolutions for a new
1348option/value pair.</p>
1349<p class="code">
98d88c8d
MS
1350int 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>
1351<h4 class="parameters">Parameters</h4>
1352<table class="list"><tbody>
1353<tr><th>http</th>
1354 <td class="description">Connection to destination</td></tr>
1355<tr><th>dest</th>
1356 <td class="description">Destination</td></tr>
1357<tr><th>dinfo</th>
1358 <td class="description">Destination information</td></tr>
1359<tr><th>num_options</th>
1360 <td class="description">Number of current options</td></tr>
1361<tr><th>options</th>
1362 <td class="description">Current options</td></tr>
1363<tr><th>new_option</th>
1364 <td class="description">New option</td></tr>
1365<tr><th>new_value</th>
1366 <td class="description">New value</td></tr>
1367<tr><th>num_conflicts</th>
1368 <td class="description">Number of conflicting options</td></tr>
1369<tr><th>conflicts</th>
1370 <td class="description">Conflicting options</td></tr>
1371<tr><th>num_resolved</th>
1372 <td class="description">Number of options to resolve</td></tr>
1373<tr><th>resolved</th>
1374 <td class="description">Resolved options</td></tr>
1375</tbody></table>
798d6e29
MS
1376<h4 class="returnvalue">Return Value</h4>
1377 <p class="description">1 if there is a conflict, 0 if none, -1 on error</p>
1378<h4 class="discussion">Discussion</h4>
1379 <p class="discussion">&quot;num_options&quot; and &quot;options&quot; represent the currently selected options by the
1380user. &quot;new_option&quot; and &quot;new_value&quot; are the setting the user has just
1381changed.<br>
1382<br>
1383Returns 1 if there is a conflict, 0 if there are no conflicts, and -1 if
1384there was an unrecoverable error such as a resolver loop.<br>
1385<br>
1386If &quot;num_conflicts&quot; and &quot;conflicts&quot; are not <code>NULL</code>, they are set to
1387contain the list of conflicting option/value pairs. Similarly, if
1388&quot;num_resolved&quot; and &quot;resolved&quot; are not <code>NULL</code> they will be set to the
1389list of changes needed to resolve the conflict.<br>
1390<br>
1391If cupsCopyDestConflicts returns 1 but &quot;num_resolved&quot; and &quot;resolved&quot; are set
1392to 0 and <code>NULL</code>, respectively, then the conflict cannot be resolved.
1393
1394</p>
1395<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDestInfo">cupsCopyDestInfo</a></h3>
1396 <p class="description">Get the supported values/capabilities for the
1397destination.</p>
1398<p class="code">
98d88c8d 1399<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 1400<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1401<table class="list"><tbody>
1402<tr><th>http</th>
1403 <td class="description">Connection to destination</td></tr>
1404<tr><th>dest</th>
1405 <td class="description">Destination</td></tr>
1406</tbody></table>
798d6e29
MS
1407<h4 class="returnvalue">Return Value</h4>
1408 <p class="description">Destination information</p>
1409<h4 class="discussion">Discussion</h4>
1410 <p class="discussion">The caller is responsible for calling <a href="#cupsFreeDestInfo"><code>cupsFreeDestInfo</code></a> on the return
1411value. <code>NULL</code> is returned on error.
1412
1413</p>
1414<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCreateDestJob">cupsCreateDestJob</a></h3>
1415 <p class="description">Create a job on a destination.</p>
1416<p class="code">
98d88c8d
MS
1417ipp_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>
1418<h4 class="parameters">Parameters</h4>
1419<table class="list"><tbody>
1420<tr><th>http</th>
1421 <td class="description">Connection to destination</td></tr>
1422<tr><th>dest</th>
1423 <td class="description">Destination</td></tr>
1424<tr><th>info</th>
1425 <td class="description">Destination information</td></tr>
1426<tr><th>job_id</th>
1427 <td class="description">Job ID or 0 on error</td></tr>
1428<tr><th>title</th>
1429 <td class="description">Job name</td></tr>
1430<tr><th>num_options</th>
1431 <td class="description">Number of job options</td></tr>
1432<tr><th>options</th>
1433 <td class="description">Job options</td></tr>
1434</tbody></table>
798d6e29
MS
1435<h4 class="returnvalue">Return Value</h4>
1436 <p class="description">IPP status code</p>
1437<h4 class="discussion">Discussion</h4>
1438 <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success, saving the job ID
1439in the variable pointed to by &quot;job_id&quot;.
1440
1441</p>
798d6e29
MS
1442<h3 class="function"><span class="info">&#160;CUPS 1.1.20/macOS 10.4&#160;</span><a id="cupsDoAuthentication">cupsDoAuthentication</a></h3>
1443 <p class="description">Authenticate a request.</p>
1444<p class="code">
98d88c8d
MS
1445int cupsDoAuthentication(<a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p>
1446<h4 class="parameters">Parameters</h4>
1447<table class="list"><tbody>
1448<tr><th>http</th>
1449 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
1450<tr><th>method</th>
1451 <td class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</td></tr>
1452<tr><th>resource</th>
1453 <td class="description">Resource path</td></tr>
1454</tbody></table>
798d6e29
MS
1455<h4 class="returnvalue">Return Value</h4>
1456 <p class="description">0 on success, -1 on error</p>
1457<h4 class="discussion">Discussion</h4>
1458 <p class="discussion">This function should be called in response to a <code>HTTP_STATUS_UNAUTHORIZED</code>
1459status, prior to resubmitting your request.
1460
1461</p>
1462<h3 class="function"><a id="cupsEncodeOptions">cupsEncodeOptions</a></h3>
53af7f21 1463 <p class="description">Encode printer options into IPP attributes.</p>
98d88c8d
MS
1464<p class="code">
1465void cupsEncodeOptions(<a href="#ipp_t">ipp_t</a> *ipp, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
1466<h4 class="parameters">Parameters</h4>
1467<table class="list"><tbody>
1468<tr><th>ipp</th>
1469 <td class="description">Request to add to</td></tr>
1470<tr><th>num_options</th>
1471 <td class="description">Number of options</td></tr>
1472<tr><th>options</th>
1473 <td class="description">Options</td></tr>
1474</tbody></table>
1475<h4 class="discussion">Discussion</h4>
798d6e29 1476 <p class="discussion">This function adds operation, job, and then subscription attributes,
98d88c8d
MS
1477in that order. Use the <a href="#cupsEncodeOptions2"><code>cupsEncodeOptions2</code></a> function to add attributes
1478for a single group.</p>
1479<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsEncodeOptions2">cupsEncodeOptions2</a></h3>
53af7f21 1480 <p class="description">Encode printer options into IPP attributes for a group.</p>
98d88c8d
MS
1481<p class="code">
1482void 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>
1483<h4 class="parameters">Parameters</h4>
1484<table class="list"><tbody>
1485<tr><th>ipp</th>
1486 <td class="description">Request to add to</td></tr>
1487<tr><th>num_options</th>
1488 <td class="description">Number of options</td></tr>
1489<tr><th>options</th>
1490 <td class="description">Options</td></tr>
1491<tr><th>group_tag</th>
1492 <td class="description">Group to encode</td></tr>
1493</tbody></table>
1494<h4 class="discussion">Discussion</h4>
798d6e29 1495 <p class="discussion">This function only adds attributes for a single group. Call this
98d88c8d 1496function multiple times for each group, or use <a href="#cupsEncodeOptions"><code>cupsEncodeOptions</code></a>
798d6e29
MS
1497to add the standard groups.
1498
1499</p>
1500<h3 class="function"><a id="cupsEncryption">cupsEncryption</a></h3>
1501 <p class="description">Get the current encryption settings.</p>
1502<p class="code">
98d88c8d 1503<a href="#http_encryption_t">http_encryption_t</a> cupsEncryption(void);</p>
798d6e29
MS
1504<h4 class="returnvalue">Return Value</h4>
1505 <p class="description">Encryption settings</p>
1506<h4 class="discussion">Discussion</h4>
1507 <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
1508environment variable, then the ~/.cups/client.conf file, and finally the
1509/etc/cups/client.conf file. If not set, the default is
1510<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
1511<br>
1512Note: The current encryption setting is tracked separately for each thread
1513in a program. Multi-threaded programs that override the setting via the
1514<a href="#cupsSetEncryption"><code>cupsSetEncryption</code></a> function need to do so in each thread for the same
1515setting to be used.</p>
1516<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsEnumDests">cupsEnumDests</a></h3>
1517 <p class="description">Enumerate available destinations with a callback function.</p>
1518<p class="code">
98d88c8d
MS
1519int 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>
1520<h4 class="parameters">Parameters</h4>
1521<table class="list"><tbody>
1522<tr><th>flags</th>
1523 <td class="description">Enumeration flags</td></tr>
1524<tr><th>msec</th>
1525 <td class="description">Timeout in milliseconds, -1 for indefinite</td></tr>
1526<tr><th>cancel</th>
1527 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
1528<tr><th>type</th>
1529 <td class="description">Printer type bits</td></tr>
1530<tr><th>mask</th>
1531 <td class="description">Mask for printer type bits</td></tr>
1532<tr><th>cb</th>
1533 <td class="description">Callback function</td></tr>
1534<tr><th>user_data</th>
1535 <td class="description">User data</td></tr>
1536</tbody></table>
798d6e29
MS
1537<h4 class="returnvalue">Return Value</h4>
1538 <p class="description">1 on success, 0 on failure</p>
1539<h4 class="discussion">Discussion</h4>
53af7f21
MS
1540 <p class="discussion">Destinations are enumerated from one or more sources. The callback function
1541receives the <code>user_data</code> pointer and the destination pointer which can
1542be used as input to the <a href="#cupsCopyDest"><code>cupsCopyDest</code></a> function. The function must
1543return 1 to continue enumeration or 0 to stop.<br>
798d6e29 1544<br>
53af7f21
MS
1545The <code>type</code> and <code>mask</code> arguments allow the caller to filter the
1546destinations that are enumerated. Passing 0 for both will enumerate all
1547printers. The constant <code>CUPS_PRINTER_DISCOVERED</code> is used to filter on
1548destinations that are available but have not yet been added locally.<br>
798d6e29
MS
1549<br>
1550Enumeration happens on the current thread and does not return until all
718ee2ff
MS
1551destinations have been enumerated or the callback function returns 0.<br>
1552<br>
1553Note: The callback function will likely receive multiple updates for the same
1554destinations - it is up to the caller to suppress any duplicate destinations.
798d6e29
MS
1555
1556</p>
798d6e29
MS
1557<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestDefault">cupsFindDestDefault</a></h3>
1558 <p class="description">Find the default value(s) for the given option.</p>
1559<p class="code">
98d88c8d
MS
1560<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>
1561<h4 class="parameters">Parameters</h4>
1562<table class="list"><tbody>
1563<tr><th>http</th>
1564 <td class="description">Connection to destination</td></tr>
1565<tr><th>dest</th>
1566 <td class="description">Destination</td></tr>
1567<tr><th>dinfo</th>
1568 <td class="description">Destination information</td></tr>
1569<tr><th>option</th>
1570 <td class="description">Option/attribute name</td></tr>
1571</tbody></table>
798d6e29
MS
1572<h4 class="returnvalue">Return Value</h4>
1573 <p class="description">Default attribute or <code>NULL</code> for none</p>
1574<h4 class="discussion">Discussion</h4>
1575 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1576<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1577<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1578<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1579functions to inspect the default value(s) as needed.
1580
1581</p>
1582<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestReady">cupsFindDestReady</a></h3>
1583 <p class="description">Find the default value(s) for the given option.</p>
1584<p class="code">
98d88c8d
MS
1585<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>
1586<h4 class="parameters">Parameters</h4>
1587<table class="list"><tbody>
1588<tr><th>http</th>
1589 <td class="description">Connection to destination</td></tr>
1590<tr><th>dest</th>
1591 <td class="description">Destination</td></tr>
1592<tr><th>dinfo</th>
1593 <td class="description">Destination information</td></tr>
1594<tr><th>option</th>
1595 <td class="description">Option/attribute name</td></tr>
1596</tbody></table>
798d6e29
MS
1597<h4 class="returnvalue">Return Value</h4>
1598 <p class="description">Default attribute or <code>NULL</code> for none</p>
1599<h4 class="discussion">Discussion</h4>
1600 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1601<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1602<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1603<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1604functions to inspect the default value(s) as needed.
1605
1606</p>
1607<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestSupported">cupsFindDestSupported</a></h3>
1608 <p class="description">Find the default value(s) for the given option.</p>
1609<p class="code">
98d88c8d
MS
1610<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>
1611<h4 class="parameters">Parameters</h4>
1612<table class="list"><tbody>
1613<tr><th>http</th>
1614 <td class="description">Connection to destination</td></tr>
1615<tr><th>dest</th>
1616 <td class="description">Destination</td></tr>
1617<tr><th>dinfo</th>
1618 <td class="description">Destination information</td></tr>
1619<tr><th>option</th>
1620 <td class="description">Option/attribute name</td></tr>
1621</tbody></table>
798d6e29
MS
1622<h4 class="returnvalue">Return Value</h4>
1623 <p class="description">Default attribute or <code>NULL</code> for none</p>
1624<h4 class="discussion">Discussion</h4>
1625 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
1626<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
1627<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
1628<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
1629functions to inspect the default value(s) as needed.
1630
1631</p>
1632<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsFinishDestDocument">cupsFinishDestDocument</a></h3>
1633 <p class="description">Finish the current document.</p>
1634<p class="code">
98d88c8d
MS
1635ipp_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>
1636<h4 class="parameters">Parameters</h4>
1637<table class="list"><tbody>
1638<tr><th>http</th>
1639 <td class="description">Connection to destination</td></tr>
1640<tr><th>dest</th>
1641 <td class="description">Destination</td></tr>
1642<tr><th>info</th>
1643 <td class="description">Destination information</td></tr>
1644</tbody></table>
798d6e29
MS
1645<h4 class="returnvalue">Return Value</h4>
1646 <p class="description">Status of document submission</p>
1647<h4 class="discussion">Discussion</h4>
1648 <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success.
1649
798d6e29 1650</p>
98d88c8d 1651<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsFreeDestInfo">cupsFreeDestInfo</a></h3>
53af7f21
MS
1652 <p class="description">Free destination information obtained using
1653<a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a>.</p>
798d6e29 1654<p class="code">
98d88c8d 1655void cupsFreeDestInfo(<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo);</p>
798d6e29 1656<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1657<table class="list"><tbody>
1658<tr><th>dinfo</th>
1659 <td class="description">Destination information</td></tr>
1660</tbody></table>
1661<h3 class="function"><a id="cupsFreeDests">cupsFreeDests</a></h3>
53af7f21 1662 <p class="description">Free the memory used by the list of destinations.</p>
798d6e29 1663<p class="code">
98d88c8d 1664void cupsFreeDests(int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
798d6e29 1665<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1666<table class="list"><tbody>
1667<tr><th>num_dests</th>
1668 <td class="description">Number of destinations</td></tr>
1669<tr><th>dests</th>
1670 <td class="description">Destinations</td></tr>
1671</tbody></table>
1672<h3 class="function"><a id="cupsFreeJobs">cupsFreeJobs</a></h3>
53af7f21 1673 <p class="description">Free memory used by job data.</p>
798d6e29 1674<p class="code">
98d88c8d 1675void cupsFreeJobs(int num_jobs, <a href="#cups_job_t">cups_job_t</a> *jobs);</p>
798d6e29 1676<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1677<table class="list"><tbody>
1678<tr><th>num_jobs</th>
1679 <td class="description">Number of jobs</td></tr>
1680<tr><th>jobs</th>
1681 <td class="description">Jobs</td></tr>
1682</tbody></table>
1683<h3 class="function"><a id="cupsFreeOptions">cupsFreeOptions</a></h3>
53af7f21 1684 <p class="description">Free all memory used by options.</p>
98d88c8d
MS
1685<p class="code">
1686void cupsFreeOptions(int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
1687<h4 class="parameters">Parameters</h4>
1688<table class="list"><tbody>
1689<tr><th>num_options</th>
1690 <td class="description">Number of options</td></tr>
1691<tr><th>options</th>
1692 <td class="description">Pointer to options</td></tr>
1693</tbody></table>
798d6e29
MS
1694<h3 class="function"><a id="cupsGetDest">cupsGetDest</a></h3>
1695 <p class="description">Get the named destination from the list.</p>
1696<p class="code">
98d88c8d
MS
1697<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>
1698<h4 class="parameters">Parameters</h4>
1699<table class="list"><tbody>
1700<tr><th>name</th>
1701 <td class="description">Destination name or <code>NULL</code> for the default destination</td></tr>
1702<tr><th>instance</th>
1703 <td class="description">Instance name or <code>NULL</code></td></tr>
1704<tr><th>num_dests</th>
1705 <td class="description">Number of destinations</td></tr>
1706<tr><th>dests</th>
1707 <td class="description">Destinations</td></tr>
1708</tbody></table>
798d6e29
MS
1709<h4 class="returnvalue">Return Value</h4>
1710 <p class="description">Destination pointer or <code>NULL</code></p>
1711<h4 class="discussion">Discussion</h4>
98d88c8d 1712 <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
1713list of supported destinations for the current user.</p>
1714<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></h3>
1715 <p class="description">Get a media name, dimension, and margins for a
1716specific size.</p>
1717<p class="code">
98d88c8d
MS
1718int 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>
1719<h4 class="parameters">Parameters</h4>
1720<table class="list"><tbody>
1721<tr><th>http</th>
1722 <td class="description">Connection to destination</td></tr>
1723<tr><th>dest</th>
1724 <td class="description">Destination</td></tr>
1725<tr><th>dinfo</th>
1726 <td class="description">Destination information</td></tr>
1727<tr><th>n</th>
1728 <td class="description">Media size number (0-based)</td></tr>
1729<tr><th>flags</th>
1730 <td class="description">Media flags</td></tr>
1731<tr><th>size</th>
1732 <td class="description">Media size information</td></tr>
1733</tbody></table>
798d6e29
MS
1734<h4 class="returnvalue">Return Value</h4>
1735 <p class="description">1 on success, 0 on failure</p>
1736<h4 class="discussion">Discussion</h4>
1737 <p class="discussion">The <code>flags</code> parameter determines which set of media are indexed. For
1738example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will get the Nth
1739borderless size supported by the printer.
1740
1741</p>
1742<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsGetDestMediaByName">cupsGetDestMediaByName</a></h3>
1743 <p class="description">Get media names, dimensions, and margins.</p>
1744<p class="code">
98d88c8d
MS
1745int 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>
1746<h4 class="parameters">Parameters</h4>
1747<table class="list"><tbody>
1748<tr><th>http</th>
1749 <td class="description">Connection to destination</td></tr>
1750<tr><th>dest</th>
1751 <td class="description">Destination</td></tr>
1752<tr><th>dinfo</th>
1753 <td class="description">Destination information</td></tr>
1754<tr><th>media</th>
1755 <td class="description">Media name</td></tr>
1756<tr><th>flags</th>
1757 <td class="description">Media matching flags</td></tr>
1758<tr><th>size</th>
1759 <td class="description">Media size information</td></tr>
1760</tbody></table>
798d6e29
MS
1761<h4 class="returnvalue">Return Value</h4>
1762 <p class="description">1 on match, 0 on failure</p>
1763<h4 class="discussion">Discussion</h4>
1764 <p class="discussion">The &quot;media&quot; string is a PWG media name. &quot;Flags&quot; provides some matching
1765guidance (multiple flags can be combined):<br>
1766<br>
1767CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
1768CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
1769CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
1770CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
1771CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
1772size amongst the &quot;ready&quot; media.<br>
1773<br>
1774The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
1775<br>
1776Returns 1 when there is a match and 0 if there is not a match.
1777
1778</p>
1779<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></h3>
1780 <p class="description">Get media names, dimensions, and margins.</p>
1781<p class="code">
98d88c8d
MS
1782int 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>
1783<h4 class="parameters">Parameters</h4>
1784<table class="list"><tbody>
1785<tr><th>http</th>
1786 <td class="description">Connection to destination</td></tr>
1787<tr><th>dest</th>
1788 <td class="description">Destination</td></tr>
1789<tr><th>dinfo</th>
1790 <td class="description">Destination information</td></tr>
1791<tr><th>width</th>
1792 <td class="description">Media width in hundredths of
1793of millimeters</td></tr>
1794<tr><th>length</th>
1795 <td class="description">Media length in hundredths of
1796of millimeters</td></tr>
1797<tr><th>flags</th>
1798 <td class="description">Media matching flags</td></tr>
1799<tr><th>size</th>
1800 <td class="description">Media size information</td></tr>
1801</tbody></table>
798d6e29
MS
1802<h4 class="returnvalue">Return Value</h4>
1803 <p class="description">1 on match, 0 on failure</p>
1804<h4 class="discussion">Discussion</h4>
1805 <p class="discussion">&quot;Width&quot; and &quot;length&quot; are the dimensions in hundredths of millimeters.
1806&quot;Flags&quot; provides some matching guidance (multiple flags can be combined):<br>
1807<br>
1808CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
1809CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
1810CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
1811CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
1812CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
1813size amongst the &quot;ready&quot; media.<br>
1814<br>
1815The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
1816<br>
1817Returns 1 when there is a match and 0 if there is not a match.
1818
1819</p>
1820<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaCount">cupsGetDestMediaCount</a></h3>
1821 <p class="description">Get the number of sizes supported by a
1822destination.</p>
1823<p class="code">
98d88c8d
MS
1824int 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>
1825<h4 class="parameters">Parameters</h4>
1826<table class="list"><tbody>
1827<tr><th>http</th>
1828 <td class="description">Connection to destination</td></tr>
1829<tr><th>dest</th>
1830 <td class="description">Destination</td></tr>
1831<tr><th>dinfo</th>
1832 <td class="description">Destination information</td></tr>
1833<tr><th>flags</th>
1834 <td class="description">Media flags</td></tr>
1835</tbody></table>
798d6e29
MS
1836<h4 class="returnvalue">Return Value</h4>
1837 <p class="description">Number of sizes</p>
1838<h4 class="discussion">Discussion</h4>
1839 <p class="discussion">The <code>flags</code> parameter determines the set of media sizes that are
1840counted. For example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return
1841the number of borderless sizes.
1842
1843</p>
1844<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></h3>
1845 <p class="description">Get the default size for a destination.</p>
1846<p class="code">
98d88c8d
MS
1847int 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>
1848<h4 class="parameters">Parameters</h4>
1849<table class="list"><tbody>
1850<tr><th>http</th>
1851 <td class="description">Connection to destination</td></tr>
1852<tr><th>dest</th>
1853 <td class="description">Destination</td></tr>
1854<tr><th>dinfo</th>
1855 <td class="description">Destination information</td></tr>
1856<tr><th>flags</th>
1857 <td class="description">Media flags</td></tr>
1858<tr><th>size</th>
1859 <td class="description">Media size information</td></tr>
1860</tbody></table>
798d6e29
MS
1861<h4 class="returnvalue">Return Value</h4>
1862 <p class="description">1 on success, 0 on failure</p>
1863<h4 class="discussion">Discussion</h4>
1864 <p class="discussion">The <code>flags</code> parameter determines which default size is returned. For
1865example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the default
1866borderless size, typically US Letter or A4, but sometimes 4x6 photo media.
1867
1868</p>
1869<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsGetDestWithURI">cupsGetDestWithURI</a></h3>
1870 <p class="description">Get a destination associated with a URI.</p>
1871<p class="code">
98d88c8d 1872<a href="#cups_dest_t">cups_dest_t</a> *cupsGetDestWithURI(const char *name, const char *uri);</p>
798d6e29 1873<h4 class="parameters">Parameters</h4>
98d88c8d
MS
1874<table class="list"><tbody>
1875<tr><th>name</th>
1876 <td class="description">Desired printer name or <code>NULL</code></td></tr>
1877<tr><th>uri</th>
1878 <td class="description">URI for the printer</td></tr>
1879</tbody></table>
798d6e29
MS
1880<h4 class="returnvalue">Return Value</h4>
1881 <p class="description">Destination or <code>NULL</code></p>
1882<h4 class="discussion">Discussion</h4>
1883 <p class="discussion">&quot;name&quot; is the desired name for the printer. If <code>NULL</code>, a name will be
1884created using the URI.<br>
1885<br>
1886&quot;uri&quot; is the &quot;ipp&quot; or &quot;ipps&quot; URI for the printer.
1887
1888</p>
98d88c8d
MS
1889<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetDests2">cupsGetDests2</a></h3>
1890 <p class="description">Get the list of destinations from the specified server.</p>
1891<p class="code">
1892int cupsGetDests2(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
1893<h4 class="parameters">Parameters</h4>
1894<table class="list"><tbody>
1895<tr><th>http</th>
1896 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
1897<tr><th>dests</th>
1898 <td class="description">Destinations</td></tr>
1899</tbody></table>
1900<h4 class="returnvalue">Return Value</h4>
1901 <p class="description">Number of destinations</p>
1902<h4 class="discussion">Discussion</h4>
1903 <p class="discussion">Starting with CUPS 1.2, the returned list of destinations include the
1904&quot;printer-info&quot;, &quot;printer-is-accepting-jobs&quot;, &quot;printer-is-shared&quot;,
1905&quot;printer-make-and-model&quot;, &quot;printer-state&quot;, &quot;printer-state-change-time&quot;,
1906&quot;printer-state-reasons&quot;, &quot;printer-type&quot;, and &quot;printer-uri-supported&quot;
1907attributes as options.<br>
1908<br>
1909CUPS 1.4 adds the &quot;marker-change-time&quot;, &quot;marker-colors&quot;,
1910&quot;marker-high-levels&quot;, &quot;marker-levels&quot;, &quot;marker-low-levels&quot;, &quot;marker-message&quot;,
1911&quot;marker-names&quot;, &quot;marker-types&quot;, and &quot;printer-commands&quot; attributes as options.<br>
1912<br>
1913CUPS 2.2 adds accessible IPP printers to the list of destinations that can
1914be used. The &quot;printer-uri-supported&quot; option will be present for those IPP
1915printers that have been recently used.<br>
1916<br>
1917Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and
1918the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination.
1919
1920</p>
1921<h3 class="function"><span class="info">&#160;CUPS 2.2.4/macOS 10.13&#160;</span><a id="cupsGetIntegerOption">cupsGetIntegerOption</a></h3>
53af7f21 1922 <p class="description">Get an integer option value.</p>
798d6e29 1923<p class="code">
98d88c8d
MS
1924int cupsGetIntegerOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
1925<h4 class="parameters">Parameters</h4>
1926<table class="list"><tbody>
1927<tr><th>name</th>
1928 <td class="description">Name of option</td></tr>
1929<tr><th>num_options</th>
1930 <td class="description">Number of options</td></tr>
1931<tr><th>options</th>
1932 <td class="description">Options</td></tr>
1933</tbody></table>
798d6e29 1934<h4 class="returnvalue">Return Value</h4>
53af7f21 1935 <p class="description">Option value or <code>INT_MIN</code></p>
798d6e29 1936<h4 class="discussion">Discussion</h4>
53af7f21
MS
1937 <p class="discussion">INT_MIN is returned when the option does not exist, is not an integer, or
1938exceeds the range of values for the &quot;int&quot; type.
1939
1940</p>
798d6e29
MS
1941<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetJobs2">cupsGetJobs2</a></h3>
1942 <p class="description">Get the jobs from the specified server.</p>
1943<p class="code">
98d88c8d
MS
1944int 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>
1945<h4 class="parameters">Parameters</h4>
1946<table class="list"><tbody>
1947<tr><th>http</th>
1948 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
1949<tr><th>jobs</th>
1950 <td class="description">Job data</td></tr>
1951<tr><th>name</th>
1952 <td class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</td></tr>
1953<tr><th>myjobs</th>
1954 <td class="description">0 = all users, 1 = mine</td></tr>
1955<tr><th>whichjobs</th>
1956 <td class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></td></tr>
1957</tbody></table>
798d6e29
MS
1958<h4 class="returnvalue">Return Value</h4>
1959 <p class="description">Number of jobs</p>
1960<h4 class="discussion">Discussion</h4>
1961 <p class="discussion">A &quot;whichjobs&quot; value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless
1962of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are
1963pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns
1964jobs that are stopped, canceled, aborted, or completed.
1965
1966</p>
1967<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsGetNamedDest">cupsGetNamedDest</a></h3>
1968 <p class="description">Get options for the named destination.</p>
1969<p class="code">
98d88c8d
MS
1970<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>
1971<h4 class="parameters">Parameters</h4>
1972<table class="list"><tbody>
1973<tr><th>http</th>
1974 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
1975<tr><th>name</th>
1976 <td class="description">Destination name or <code>NULL</code> for the default destination</td></tr>
1977<tr><th>instance</th>
1978 <td class="description">Instance name or <code>NULL</code></td></tr>
1979</tbody></table>
798d6e29
MS
1980<h4 class="returnvalue">Return Value</h4>
1981 <p class="description">Destination or <code>NULL</code></p>
1982<h4 class="discussion">Discussion</h4>
1983 <p class="discussion">This function is optimized for retrieving a single destination and should
98d88c8d
MS
1984be used instead of <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> when you
1985either know the name of the destination or want to print to the default
1986destination. If <code>NULL</code> is returned, the destination does not exist or
1987there is no default destination.<br>
798d6e29
MS
1988<br>
1989If &quot;http&quot; is <code>CUPS_HTTP_DEFAULT</code>, the connection to the default print
1990server will be used.<br>
1991<br>
1992If &quot;name&quot; is <code>NULL</code>, the default printer for the current user will be
1993returned.<br>
1994<br>
1995The returned destination must be freed using <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> with a
1996&quot;num_dests&quot; value of 1.
1997
1998</p>
1999<h3 class="function"><a id="cupsGetOption">cupsGetOption</a></h3>
2000 <p class="description">Get an option value.</p>
2001<p class="code">
98d88c8d
MS
2002const char *cupsGetOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
2003<h4 class="parameters">Parameters</h4>
2004<table class="list"><tbody>
2005<tr><th>name</th>
2006 <td class="description">Name of option</td></tr>
2007<tr><th>num_options</th>
2008 <td class="description">Number of options</td></tr>
2009<tr><th>options</th>
2010 <td class="description">Options</td></tr>
2011</tbody></table>
798d6e29
MS
2012<h4 class="returnvalue">Return Value</h4>
2013 <p class="description">Option value or <code>NULL</code></p>
798d6e29 2014<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsGetPassword2">cupsGetPassword2</a></h3>
98d88c8d 2015 <p class="description">Get a password from the user using the current
798d6e29
MS
2016password callback.</p>
2017<p class="code">
98d88c8d
MS
2018const char *cupsGetPassword2(const char *prompt, <a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p>
2019<h4 class="parameters">Parameters</h4>
2020<table class="list"><tbody>
2021<tr><th>prompt</th>
2022 <td class="description">Prompt string</td></tr>
2023<tr><th>http</th>
2024 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
2025<tr><th>method</th>
2026 <td class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</td></tr>
2027<tr><th>resource</th>
2028 <td class="description">Resource path</td></tr>
2029</tbody></table>
798d6e29
MS
2030<h4 class="returnvalue">Return Value</h4>
2031 <p class="description">Password</p>
2032<h4 class="discussion">Discussion</h4>
2033 <p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the
2034user does not provide a password.<br>
2035<br>
2036Note: The current password callback function is tracked separately for each
2037thread in a program. Multi-threaded programs that override the setting via
98d88c8d
MS
2038the <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> function need to do so in each thread for the
2039same function to be used.
798d6e29 2040
798d6e29 2041</p>
798d6e29
MS
2042<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></h3>
2043 <p class="description">Get the localized string for a destination media
2044size.</p>
2045<p class="code">
98d88c8d
MS
2046const 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>
2047<h4 class="parameters">Parameters</h4>
2048<table class="list"><tbody>
2049<tr><th>http</th>
2050 <td class="description">Connection to destination</td></tr>
2051<tr><th>dest</th>
2052 <td class="description">Destination</td></tr>
2053<tr><th>dinfo</th>
2054 <td class="description">Destination information</td></tr>
2055<tr><th>flags</th>
2056 <td class="description">Media flags</td></tr>
2057<tr><th>size</th>
2058 <td class="description">Media size</td></tr>
2059</tbody></table>
798d6e29
MS
2060<h4 class="returnvalue">Return Value</h4>
2061 <p class="description">Localized string</p>
2062<h4 class="discussion">Discussion</h4>
2063 <p class="discussion">The returned string is stored in the destination information and will become
2064invalid if the destination information is deleted.
2065
2066</p>
2067<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsLocalizeDestOption">cupsLocalizeDestOption</a></h3>
2068 <p class="description">Get the localized string for a destination
2069option.</p>
2070<p class="code">
98d88c8d
MS
2071const 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>
2072<h4 class="parameters">Parameters</h4>
2073<table class="list"><tbody>
2074<tr><th>http</th>
2075 <td class="description">Connection to destination</td></tr>
2076<tr><th>dest</th>
2077 <td class="description">Destination</td></tr>
2078<tr><th>dinfo</th>
2079 <td class="description">Destination information</td></tr>
2080<tr><th>option</th>
2081 <td class="description">Option to localize</td></tr>
2082</tbody></table>
798d6e29
MS
2083<h4 class="returnvalue">Return Value</h4>
2084 <p class="description">Localized string</p>
2085<h4 class="discussion">Discussion</h4>
2086 <p class="discussion">The returned string is stored in the destination information and will become
2087invalid if the destination information is deleted.
2088
2089</p>
2090<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsLocalizeDestValue">cupsLocalizeDestValue</a></h3>
2091 <p class="description">Get the localized string for a destination
2092option+value pair.</p>
2093<p class="code">
98d88c8d
MS
2094const 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>
2095<h4 class="parameters">Parameters</h4>
2096<table class="list"><tbody>
2097<tr><th>http</th>
2098 <td class="description">Connection to destination</td></tr>
2099<tr><th>dest</th>
2100 <td class="description">Destination</td></tr>
2101<tr><th>dinfo</th>
2102 <td class="description">Destination information</td></tr>
2103<tr><th>option</th>
2104 <td class="description">Option to localize</td></tr>
2105<tr><th>value</th>
2106 <td class="description">Value to localize</td></tr>
2107</tbody></table>
798d6e29
MS
2108<h4 class="returnvalue">Return Value</h4>
2109 <p class="description">Localized string</p>
2110<h4 class="discussion">Discussion</h4>
2111 <p class="discussion">The returned string is stored in the destination information and will become
2112invalid if the destination information is deleted.
2113
2114</p>
2115<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="cupsMakeServerCredentials">cupsMakeServerCredentials</a></h3>
2116 <p class="description">Make a self-signed certificate and private key pair.</p>
2117<p class="code">
98d88c8d
MS
2118int cupsMakeServerCredentials(const char *path, const char *common_name, int num_alt_names, const char **alt_names, time_t expiration_date);</p>
2119<h4 class="parameters">Parameters</h4>
2120<table class="list"><tbody>
2121<tr><th>path</th>
2122 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
2123<tr><th>common_name</th>
2124 <td class="description">Common name</td></tr>
2125<tr><th>num_alt_names</th>
2126 <td class="description">Number of subject alternate names</td></tr>
2127<tr><th>alt_names</th>
2128 <td class="description">Subject Alternate Names</td></tr>
2129<tr><th>expiration_date</th>
2130 <td class="description">Expiration date</td></tr>
2131</tbody></table>
798d6e29
MS
2132<h4 class="returnvalue">Return Value</h4>
2133 <p class="description">1 on success, 0 on failure</p>
798d6e29
MS
2134<h3 class="function"><a id="cupsParseOptions">cupsParseOptions</a></h3>
2135 <p class="description">Parse options from a command-line argument.</p>
2136<p class="code">
98d88c8d
MS
2137int cupsParseOptions(const char *arg, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
2138<h4 class="parameters">Parameters</h4>
2139<table class="list"><tbody>
2140<tr><th>arg</th>
2141 <td class="description">Argument to parse</td></tr>
2142<tr><th>num_options</th>
2143 <td class="description">Number of options</td></tr>
2144<tr><th>options</th>
2145 <td class="description">Options found</td></tr>
2146</tbody></table>
798d6e29
MS
2147<h4 class="returnvalue">Return Value</h4>
2148 <p class="description">Number of options found</p>
2149<h4 class="discussion">Discussion</h4>
2150 <p class="discussion">This function converts space-delimited name/value pairs according
2151to the PAPI text option ABNF specification. Collection values
2152(&quot;name={a=... b=... c=...}&quot;) are stored with the curley brackets
2153intact - use <code>cupsParseOptions</code> on the value to extract the
2154collection attributes.</p>
798d6e29
MS
2155<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsRemoveDest">cupsRemoveDest</a></h3>
2156 <p class="description">Remove a destination from the destination list.</p>
2157<p class="code">
98d88c8d
MS
2158int cupsRemoveDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
2159<h4 class="parameters">Parameters</h4>
2160<table class="list"><tbody>
2161<tr><th>name</th>
2162 <td class="description">Destination name</td></tr>
2163<tr><th>instance</th>
2164 <td class="description">Instance name or <code>NULL</code></td></tr>
2165<tr><th>num_dests</th>
2166 <td class="description">Number of destinations</td></tr>
2167<tr><th>dests</th>
2168 <td class="description">Destinations</td></tr>
2169</tbody></table>
798d6e29
MS
2170<h4 class="returnvalue">Return Value</h4>
2171 <p class="description">New number of destinations</p>
2172<h4 class="discussion">Discussion</h4>
2173 <p class="discussion">Removing a destination/instance does not delete the class or printer
2174queue, merely the lpoptions for that destination/instance. Use the
2175<a href="#cupsSetDests"><code>cupsSetDests</code></a> or <a href="#cupsSetDests2"><code>cupsSetDests2</code></a> functions to save the new
2176options for the user.
2177
2178</p>
2179<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsRemoveOption">cupsRemoveOption</a></h3>
2180 <p class="description">Remove an option from an option array.</p>
2181<p class="code">
98d88c8d
MS
2182int cupsRemoveOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
2183<h4 class="parameters">Parameters</h4>
2184<table class="list"><tbody>
2185<tr><th>name</th>
2186 <td class="description">Option name</td></tr>
2187<tr><th>num_options</th>
2188 <td class="description">Current number of options</td></tr>
2189<tr><th>options</th>
2190 <td class="description">Options</td></tr>
2191</tbody></table>
798d6e29
MS
2192<h4 class="returnvalue">Return Value</h4>
2193 <p class="description">New number of options</p>
2194<h3 class="function"><a id="cupsServer">cupsServer</a></h3>
2195 <p class="description">Return the hostname/address of the current server.</p>
2196<p class="code">
98d88c8d 2197const char *cupsServer(void);</p>
798d6e29
MS
2198<h4 class="returnvalue">Return Value</h4>
2199 <p class="description">Server name</p>
2200<h4 class="discussion">Discussion</h4>
2201 <p class="discussion">The default server comes from the CUPS_SERVER environment variable, then the
2202~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not
2203set, the default is the local system - either &quot;localhost&quot; or a domain socket
2204path.<br>
2205<br>
2206The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6
2207address, or a domain socket pathname.<br>
2208<br>
2209Note: The current server is tracked separately for each thread in a program.
2210Multi-threaded programs that override the server via the
2211<a href="#cupsSetServer"><code>cupsSetServer</code></a> function need to do so in each thread for the same
2212server to be used.</p>
98d88c8d
MS
2213<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetClientCertCB">cupsSetClientCertCB</a></h3>
2214 <p class="description">Set the client certificate callback.</p>
798d6e29 2215<p class="code">
98d88c8d 2216void cupsSetClientCertCB(<a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a> cb, void *user_data);</p>
798d6e29 2217<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2218<table class="list"><tbody>
2219<tr><th>cb</th>
2220 <td class="description">Callback function</td></tr>
2221<tr><th>user_data</th>
2222 <td class="description">User data pointer</td></tr>
2223</tbody></table>
2224<h4 class="discussion">Discussion</h4>
798d6e29
MS
2225 <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
2226<br>
2227Note: The current certificate callback is tracked separately for each thread
2228in a program. Multi-threaded programs that override the callback need to do
2229so in each thread for the same callback to be used.
2230
2231</p>
2232<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetCredentials">cupsSetCredentials</a></h3>
2233 <p class="description">Set the default credentials to be used for SSL/TLS
2234connections.</p>
2235<p class="code">
98d88c8d 2236int cupsSetCredentials(cups_array_t *credentials);</p>
798d6e29 2237<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2238<table class="list"><tbody>
2239<tr><th>credentials</th>
2240 <td class="description">Array of credentials</td></tr>
2241</tbody></table>
798d6e29
MS
2242<h4 class="returnvalue">Return Value</h4>
2243 <p class="description">Status of call (0 = success)</p>
2244<h4 class="discussion">Discussion</h4>
2245 <p class="discussion">Note: The default credentials are tracked separately for each thread in a
2246program. Multi-threaded programs that override the setting need to do so in
2247each thread for the same setting to be used.
2248
2249</p>
98d88c8d 2250<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsSetDefaultDest">cupsSetDefaultDest</a></h3>
53af7f21 2251 <p class="description">Set the default destination.</p>
98d88c8d
MS
2252<p class="code">
2253void cupsSetDefaultDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
2254<h4 class="parameters">Parameters</h4>
2255<table class="list"><tbody>
2256<tr><th>name</th>
2257 <td class="description">Destination name</td></tr>
2258<tr><th>instance</th>
2259 <td class="description">Instance name or <code>NULL</code></td></tr>
2260<tr><th>num_dests</th>
2261 <td class="description">Number of destinations</td></tr>
2262<tr><th>dests</th>
2263 <td class="description">Destinations</td></tr>
2264</tbody></table>
798d6e29
MS
2265<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsSetDests2">cupsSetDests2</a></h3>
2266 <p class="description">Save the list of destinations for the specified server.</p>
2267<p class="code">
98d88c8d
MS
2268int cupsSetDests2(<a href="#http_t">http_t</a> *http, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
2269<h4 class="parameters">Parameters</h4>
2270<table class="list"><tbody>
2271<tr><th>http</th>
2272 <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
2273<tr><th>num_dests</th>
2274 <td class="description">Number of destinations</td></tr>
2275<tr><th>dests</th>
2276 <td class="description">Destinations</td></tr>
2277</tbody></table>
798d6e29
MS
2278<h4 class="returnvalue">Return Value</h4>
2279 <p class="description">0 on success, -1 on error</p>
2280<h4 class="discussion">Discussion</h4>
2281 <p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run
2282as root and ~/.cups/lpoptions when run as a normal user.
2283
2284</p>
2285<h3 class="function"><a id="cupsSetEncryption">cupsSetEncryption</a></h3>
98d88c8d 2286 <p class="description">Set the encryption preference.</p>
798d6e29 2287<p class="code">
98d88c8d 2288void cupsSetEncryption(<a href="#http_encryption_t">http_encryption_t</a> e);</p>
798d6e29 2289<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2290<table class="list"><tbody>
2291<tr><th>e</th>
2292 <td class="description">New encryption preference</td></tr>
2293</tbody></table>
2294<h4 class="discussion">Discussion</h4>
798d6e29
MS
2295 <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
2296environment variable, then the ~/.cups/client.conf file, and finally the
2297/etc/cups/client.conf file. If not set, the default is
2298<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
2299<br>
2300Note: The current encryption setting is tracked separately for each thread
2301in a program. Multi-threaded programs that override the setting need to do
2302so in each thread for the same setting to be used.</p>
98d88c8d
MS
2303<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsSetPasswordCB2">cupsSetPasswordCB2</a></h3>
2304 <p class="description">Set the advanced password callback for CUPS.</p>
798d6e29 2305<p class="code">
98d88c8d 2306void cupsSetPasswordCB2(<a href="#cups_password_cb2_t">cups_password_cb2_t</a> cb, void *user_data);</p>
798d6e29 2307<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2308<table class="list"><tbody>
2309<tr><th>cb</th>
2310 <td class="description">Callback function</td></tr>
2311<tr><th>user_data</th>
2312 <td class="description">User data pointer</td></tr>
2313</tbody></table>
2314<h4 class="discussion">Discussion</h4>
798d6e29
MS
2315 <p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which
2316reads the password from the console. Programs should call either this
2317function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered
2318by a program per thread.<br>
2319<br>
2320Note: The current password callback is tracked separately for each thread
2321in a program. Multi-threaded programs that override the callback need to do
2322so in each thread for the same callback to be used.
2323
2324</p>
2325<h3 class="function"><a id="cupsSetServer">cupsSetServer</a></h3>
98d88c8d 2326 <p class="description">Set the default server name and port.</p>
798d6e29 2327<p class="code">
98d88c8d 2328void cupsSetServer(const char *server);</p>
798d6e29 2329<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2330<table class="list"><tbody>
2331<tr><th>server</th>
2332 <td class="description">Server name</td></tr>
2333</tbody></table>
2334<h4 class="discussion">Discussion</h4>
798d6e29
MS
2335 <p class="discussion">The &quot;server&quot; string can be a fully-qualified hostname, a numeric
2336IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP
2337addresses can be optionally followed by a colon and port number to override
2338the default port 631, e.g. &quot;hostname:8631&quot;. Pass <code>NULL</code> to restore the
2339default server name and port.<br>
2340<br>
2341Note: The current server is tracked separately for each thread in a program.
2342Multi-threaded programs that override the server need to do so in each
2343thread for the same server to be used.</p>
98d88c8d
MS
2344<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetServerCertCB">cupsSetServerCertCB</a></h3>
2345 <p class="description">Set the server certificate callback.</p>
798d6e29 2346<p class="code">
98d88c8d 2347void cupsSetServerCertCB(<a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a> cb, void *user_data);</p>
798d6e29 2348<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2349<table class="list"><tbody>
2350<tr><th>cb</th>
2351 <td class="description">Callback function</td></tr>
2352<tr><th>user_data</th>
2353 <td class="description">User data pointer</td></tr>
2354</tbody></table>
2355<h4 class="discussion">Discussion</h4>
798d6e29
MS
2356 <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
2357<br>
2358Note: The current credentials callback is tracked separately for each thread
2359in a program. Multi-threaded programs that override the callback need to do
2360so in each thread for the same callback to be used.
2361
2362</p>
2363<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsSetServerCredentials">cupsSetServerCredentials</a></h3>
2364 <p class="description">Set the default server credentials.</p>
2365<p class="code">
98d88c8d
MS
2366int cupsSetServerCredentials(const char *path, const char *common_name, int auto_create);</p>
2367<h4 class="parameters">Parameters</h4>
2368<table class="list"><tbody>
2369<tr><th>path</th>
2370 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
2371<tr><th>common_name</th>
2372 <td class="description">Default common name for server</td></tr>
2373<tr><th>auto_create</th>
2374 <td class="description">1 = automatically create self-signed certificates</td></tr>
2375</tbody></table>
798d6e29
MS
2376<h4 class="returnvalue">Return Value</h4>
2377 <p class="description">1 on success, 0 on failure</p>
2378<h4 class="discussion">Discussion</h4>
2379 <p class="discussion">Note: The server credentials are used by all threads in the running process.
2380This function is threadsafe.
2381
2382</p>
2383<h3 class="function"><a id="cupsSetUser">cupsSetUser</a></h3>
98d88c8d 2384 <p class="description">Set the default user name.</p>
798d6e29 2385<p class="code">
98d88c8d 2386void cupsSetUser(const char *user);</p>
798d6e29 2387<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2388<table class="list"><tbody>
2389<tr><th>user</th>
2390 <td class="description">User name</td></tr>
2391</tbody></table>
2392<h4 class="discussion">Discussion</h4>
798d6e29
MS
2393 <p class="discussion">Pass <code>NULL</code> to restore the default user name.<br>
2394<br>
2395Note: The current user name is tracked separately for each thread in a
2396program. Multi-threaded programs that override the user name need to do so
2397in each thread for the same user name to be used.</p>
98d88c8d
MS
2398<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsSetUserAgent">cupsSetUserAgent</a></h3>
2399 <p class="description">Set the default HTTP User-Agent string.</p>
798d6e29 2400<p class="code">
98d88c8d 2401void cupsSetUserAgent(const char *user_agent);</p>
798d6e29 2402<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2403<table class="list"><tbody>
2404<tr><th>user_agent</th>
2405 <td class="description">User-Agent string or <code>NULL</code></td></tr>
2406</tbody></table>
2407<h4 class="discussion">Discussion</h4>
798d6e29
MS
2408 <p class="discussion">Setting the string to NULL forces the default value containing the CUPS
2409version, IPP version, and operating system version and architecture.
2410
2411</p>
2412<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsStartDestDocument">cupsStartDestDocument</a></h3>
2413 <p class="description">Start a new document.</p>
2414<p class="code">
98d88c8d
MS
2415http_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>
2416<h4 class="parameters">Parameters</h4>
2417<table class="list"><tbody>
2418<tr><th>http</th>
2419 <td class="description">Connection to destination</td></tr>
2420<tr><th>dest</th>
2421 <td class="description">Destination</td></tr>
2422<tr><th>info</th>
2423 <td class="description">Destination information</td></tr>
2424<tr><th>job_id</th>
2425 <td class="description">Job ID</td></tr>
2426<tr><th>docname</th>
2427 <td class="description">Document name</td></tr>
2428<tr><th>format</th>
2429 <td class="description">Document format</td></tr>
2430<tr><th>num_options</th>
2431 <td class="description">Number of document options</td></tr>
2432<tr><th>options</th>
2433 <td class="description">Document options</td></tr>
2434<tr><th>last_document</th>
2435 <td class="description">1 if this is the last document</td></tr>
2436</tbody></table>
798d6e29
MS
2437<h4 class="returnvalue">Return Value</h4>
2438 <p class="description">Status of document creation</p>
2439<h4 class="discussion">Discussion</h4>
2440 <p class="discussion">&quot;job_id&quot; is the job ID returned by cupsCreateDestJob. &quot;docname&quot; is the name
2441of the document/file being printed, &quot;format&quot; is the MIME media type for the
2442document (see CUPS_FORMAT_xxx constants), and &quot;num_options&quot; and &quot;options&quot;
2443are the options do be applied to the document. &quot;last_document&quot; should be 1
2444if this is the last document to be submitted in the job. Returns
2445<code>HTTP_CONTINUE</code> on success.
2446
798d6e29
MS
2447</p>
2448<h3 class="function"><a id="cupsUser">cupsUser</a></h3>
2449 <p class="description">Return the current user's name.</p>
2450<p class="code">
98d88c8d 2451const char *cupsUser(void);</p>
798d6e29
MS
2452<h4 class="returnvalue">Return Value</h4>
2453 <p class="description">User name</p>
2454<h4 class="discussion">Discussion</h4>
2455 <p class="discussion">Note: The current user name is tracked separately for each thread in a
2456program. Multi-threaded programs that override the user name with the
2457<a href="#cupsSetUser"><code>cupsSetUser</code></a> function need to do so in each thread for the same user
2458name to be used.</p>
2459<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsUserAgent">cupsUserAgent</a></h3>
2460 <p class="description">Return the default HTTP User-Agent string.</p>
2461<p class="code">
98d88c8d 2462const char *cupsUserAgent(void);</p>
798d6e29
MS
2463<h4 class="returnvalue">Return Value</h4>
2464 <p class="description">User-Agent string</p>
2465<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAcceptConnection">httpAcceptConnection</a></h3>
2466 <p class="description">Accept a new HTTP client connection from the
2467specified listening socket.</p>
2468<p class="code">
98d88c8d 2469<a href="#http_t">http_t</a> *httpAcceptConnection(int fd, int blocking);</p>
798d6e29 2470<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2471<table class="list"><tbody>
2472<tr><th>fd</th>
2473 <td class="description">Listen socket file descriptor</td></tr>
2474<tr><th>blocking</th>
2475 <td class="description">1 if the connection should be
2476blocking, 0 otherwise</td></tr>
2477</tbody></table>
798d6e29
MS
2478<h4 class="returnvalue">Return Value</h4>
2479 <p class="description">HTTP connection or <code>NULL</code></p>
2480<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpAddCredential">httpAddCredential</a></h3>
2481 <p class="description">Allocates and adds a single credential to an array.</p>
2482<p class="code">
98d88c8d
MS
2483int httpAddCredential(cups_array_t *credentials, const void *data, size_t datalen);</p>
2484<h4 class="parameters">Parameters</h4>
2485<table class="list"><tbody>
2486<tr><th>credentials</th>
2487 <td class="description">Credentials array</td></tr>
2488<tr><th>data</th>
2489 <td class="description">PEM-encoded X.509 data</td></tr>
2490<tr><th>datalen</th>
2491 <td class="description">Length of data</td></tr>
2492</tbody></table>
798d6e29
MS
2493<h4 class="returnvalue">Return Value</h4>
2494 <p class="description">0 on success, -1 on error</p>
2495<h4 class="discussion">Discussion</h4>
2496 <p class="discussion">Use <code>cupsArrayNew(NULL, NULL)</code> to create a credentials array.
2497
2498</p>
2499<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrAny">httpAddrAny</a></h3>
2500 <p class="description">Check for the &quot;any&quot; address.</p>
2501<p class="code">
98d88c8d 2502int httpAddrAny(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2503<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2504<table class="list"><tbody>
2505<tr><th>addr</th>
2506 <td class="description">Address to check</td></tr>
2507</tbody></table>
798d6e29
MS
2508<h4 class="returnvalue">Return Value</h4>
2509 <p class="description">1 if &quot;any&quot;, 0 otherwise</p>
2510<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpAddrClose">httpAddrClose</a></h3>
2511 <p class="description">Close a socket created by <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> or
2512<a href="#httpAddrListen"><code>httpAddrListen</code></a>.</p>
2513<p class="code">
98d88c8d 2514int httpAddrClose(<a href="#http_addr_t">http_addr_t</a> *addr, int fd);</p>
798d6e29 2515<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2516<table class="list"><tbody>
2517<tr><th>addr</th>
2518 <td class="description">Listen address or <code>NULL</code></td></tr>
2519<tr><th>fd</th>
2520 <td class="description">Socket file descriptor</td></tr>
2521</tbody></table>
798d6e29
MS
2522<h4 class="returnvalue">Return Value</h4>
2523 <p class="description">0 on success, -1 on failure</p>
2524<h4 class="discussion">Discussion</h4>
98d88c8d
MS
2525 <p class="discussion">Pass <code>NULL</code> for sockets created with <a href="#httpAddrConnect2"><code>httpAddrConnect2</code></a> and the
2526listen address for sockets created with <a href="#httpAddrListen"><code>httpAddrListen</code></a>. This function
2527ensures that domain sockets are removed when closed.
798d6e29
MS
2528
2529</p>
798d6e29
MS
2530<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrConnect2">httpAddrConnect2</a></h3>
2531 <p class="description">Connect to any of the addresses in the list with a
2532timeout and optional cancel.</p>
2533<p class="code">
98d88c8d
MS
2534<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>
2535<h4 class="parameters">Parameters</h4>
2536<table class="list"><tbody>
2537<tr><th>addrlist</th>
2538 <td class="description">List of potential addresses</td></tr>
2539<tr><th>sock</th>
2540 <td class="description">Socket</td></tr>
2541<tr><th>msec</th>
2542 <td class="description">Timeout in milliseconds</td></tr>
2543<tr><th>cancel</th>
2544 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
2545</tbody></table>
798d6e29
MS
2546<h4 class="returnvalue">Return Value</h4>
2547 <p class="description">Connected address or NULL on failure</p>
2548<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrCopyList">httpAddrCopyList</a></h3>
2549 <p class="description">Copy an address list.</p>
2550<p class="code">
98d88c8d 2551<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrCopyList(<a href="#http_addrlist_t">http_addrlist_t</a> *src);</p>
798d6e29 2552<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2553<table class="list"><tbody>
2554<tr><th>src</th>
2555 <td class="description">Source address list</td></tr>
2556</tbody></table>
798d6e29
MS
2557<h4 class="returnvalue">Return Value</h4>
2558 <p class="description">New address list or <code>NULL</code> on error</p>
2559<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrEqual">httpAddrEqual</a></h3>
2560 <p class="description">Compare two addresses.</p>
2561<p class="code">
98d88c8d 2562int 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 2563<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2564<table class="list"><tbody>
2565<tr><th>addr1</th>
2566 <td class="description">First address</td></tr>
2567<tr><th>addr2</th>
2568 <td class="description">Second address</td></tr>
2569</tbody></table>
798d6e29
MS
2570<h4 class="returnvalue">Return Value</h4>
2571 <p class="description">1 if equal, 0 if not</p>
2572<h3 class="function"><a id="httpAddrFamily">httpAddrFamily</a></h3>
2573 <p class="description">Get the address family of an address.</p>
2574<p class="code">
98d88c8d 2575int httpAddrFamily(<a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2576<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2577<table class="list"><tbody>
2578<tr><th>addr</th>
2579 <td class="description">Address</td></tr>
2580</tbody></table>
798d6e29
MS
2581<h4 class="returnvalue">Return Value</h4>
2582 <p class="description">Address family</p>
98d88c8d
MS
2583<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrFreeList">httpAddrFreeList</a></h3>
2584 <p class="description">Free an address list.</p>
798d6e29 2585<p class="code">
98d88c8d 2586void httpAddrFreeList(<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist);</p>
798d6e29 2587<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2588<table class="list"><tbody>
2589<tr><th>addrlist</th>
2590 <td class="description">Address list to free</td></tr>
2591</tbody></table>
798d6e29
MS
2592<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrGetList">httpAddrGetList</a></h3>
2593 <p class="description">Get a list of addresses for a hostname.</p>
2594<p class="code">
98d88c8d
MS
2595<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrGetList(const char *hostname, int family, const char *service);</p>
2596<h4 class="parameters">Parameters</h4>
2597<table class="list"><tbody>
2598<tr><th>hostname</th>
2599 <td class="description">Hostname, IP address, or NULL for passive listen address</td></tr>
2600<tr><th>family</th>
2601 <td class="description">Address family or AF_UNSPEC</td></tr>
2602<tr><th>service</th>
2603 <td class="description">Service name or port number</td></tr>
2604</tbody></table>
798d6e29
MS
2605<h4 class="returnvalue">Return Value</h4>
2606 <p class="description">List of addresses or NULL</p>
2607<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLength">httpAddrLength</a></h3>
2608 <p class="description">Return the length of the address in bytes.</p>
2609<p class="code">
98d88c8d 2610int httpAddrLength(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2611<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2612<table class="list"><tbody>
2613<tr><th>addr</th>
2614 <td class="description">Address</td></tr>
2615</tbody></table>
798d6e29
MS
2616<h4 class="returnvalue">Return Value</h4>
2617 <p class="description">Length in bytes</p>
2618<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrListen">httpAddrListen</a></h3>
2619 <p class="description">Create a listening socket bound to the specified
2620address and port.</p>
2621<p class="code">
98d88c8d 2622int httpAddrListen(<a href="#http_addr_t">http_addr_t</a> *addr, int port);</p>
798d6e29 2623<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2624<table class="list"><tbody>
2625<tr><th>addr</th>
2626 <td class="description">Address to bind to</td></tr>
2627<tr><th>port</th>
2628 <td class="description">Port number to bind to</td></tr>
2629</tbody></table>
798d6e29
MS
2630<h4 class="returnvalue">Return Value</h4>
2631 <p class="description">Socket or -1 on error</p>
2632<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLocalhost">httpAddrLocalhost</a></h3>
2633 <p class="description">Check for the local loopback address.</p>
2634<p class="code">
98d88c8d 2635int httpAddrLocalhost(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2636<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2637<table class="list"><tbody>
2638<tr><th>addr</th>
2639 <td class="description">Address to check</td></tr>
2640</tbody></table>
798d6e29
MS
2641<h4 class="returnvalue">Return Value</h4>
2642 <p class="description">1 if local host, 0 otherwise</p>
2643<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLookup">httpAddrLookup</a></h3>
2644 <p class="description">Lookup the hostname associated with the address.</p>
2645<p class="code">
98d88c8d
MS
2646char *httpAddrLookup(const <a href="#http_addr_t">http_addr_t</a> *addr, char *name, int namelen);</p>
2647<h4 class="parameters">Parameters</h4>
2648<table class="list"><tbody>
2649<tr><th>addr</th>
2650 <td class="description">Address to lookup</td></tr>
2651<tr><th>name</th>
2652 <td class="description">Host name buffer</td></tr>
2653<tr><th>namelen</th>
2654 <td class="description">Size of name buffer</td></tr>
2655</tbody></table>
798d6e29
MS
2656<h4 class="returnvalue">Return Value</h4>
2657 <p class="description">Host name</p>
2658<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrPort">httpAddrPort</a></h3>
2659 <p class="description">Get the port number associated with an address.</p>
2660<p class="code">
98d88c8d 2661int httpAddrPort(<a href="#http_addr_t">http_addr_t</a> *addr);</p>
798d6e29 2662<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2663<table class="list"><tbody>
2664<tr><th>addr</th>
2665 <td class="description">Address</td></tr>
2666</tbody></table>
798d6e29
MS
2667<h4 class="returnvalue">Return Value</h4>
2668 <p class="description">Port number</p>
2669<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrString">httpAddrString</a></h3>
2670 <p class="description">Convert an address to a numeric string.</p>
2671<p class="code">
98d88c8d
MS
2672char *httpAddrString(const <a href="#http_addr_t">http_addr_t</a> *addr, char *s, int slen);</p>
2673<h4 class="parameters">Parameters</h4>
2674<table class="list"><tbody>
2675<tr><th>addr</th>
2676 <td class="description">Address to convert</td></tr>
2677<tr><th>s</th>
2678 <td class="description">String buffer</td></tr>
2679<tr><th>slen</th>
2680 <td class="description">Length of string</td></tr>
2681</tbody></table>
798d6e29
MS
2682<h4 class="returnvalue">Return Value</h4>
2683 <p class="description">Numeric address string</p>
2684<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAssembleURI">httpAssembleURI</a></h3>
2685 <p class="description">Assemble a uniform resource identifier from its
2686components.</p>
2687<p class="code">
98d88c8d
MS
2688<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>
2689<h4 class="parameters">Parameters</h4>
2690<table class="list"><tbody>
2691<tr><th>encoding</th>
2692 <td class="description">Encoding flags</td></tr>
2693<tr><th>uri</th>
2694 <td class="description">URI buffer</td></tr>
2695<tr><th>urilen</th>
2696 <td class="description">Size of URI buffer</td></tr>
2697<tr><th>scheme</th>
2698 <td class="description">Scheme name</td></tr>
2699<tr><th>username</th>
2700 <td class="description">Username</td></tr>
2701<tr><th>host</th>
2702 <td class="description">Hostname or address</td></tr>
2703<tr><th>port</th>
2704 <td class="description">Port number</td></tr>
2705<tr><th>resource</th>
2706 <td class="description">Resource</td></tr>
2707</tbody></table>
798d6e29
MS
2708<h4 class="returnvalue">Return Value</h4>
2709 <p class="description">URI status</p>
2710<h4 class="discussion">Discussion</h4>
2711 <p class="discussion">This function escapes reserved characters in the URI depending on the
2712value of the &quot;encoding&quot; argument. You should use this function in
2713place of traditional string functions whenever you need to create a
2714URI string.
2715
2716</p>
2717<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAssembleURIf">httpAssembleURIf</a></h3>
2718 <p class="description">Assemble a uniform resource identifier from its
2719components with a formatted resource.</p>
2720<p class="code">
98d88c8d
MS
2721<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>
2722<h4 class="parameters">Parameters</h4>
2723<table class="list"><tbody>
2724<tr><th>encoding</th>
2725 <td class="description">Encoding flags</td></tr>
2726<tr><th>uri</th>
2727 <td class="description">URI buffer</td></tr>
2728<tr><th>urilen</th>
2729 <td class="description">Size of URI buffer</td></tr>
2730<tr><th>scheme</th>
2731 <td class="description">Scheme name</td></tr>
2732<tr><th>username</th>
2733 <td class="description">Username</td></tr>
2734<tr><th>host</th>
2735 <td class="description">Hostname or address</td></tr>
2736<tr><th>port</th>
2737 <td class="description">Port number</td></tr>
2738<tr><th>resourcef</th>
2739 <td class="description">Printf-style resource</td></tr>
2740<tr><th>...</th>
2741 <td class="description">Additional arguments as needed</td></tr>
2742</tbody></table>
798d6e29
MS
2743<h4 class="returnvalue">Return Value</h4>
2744 <p class="description">URI status</p>
2745<h4 class="discussion">Discussion</h4>
2746 <p class="discussion">This function creates a formatted version of the resource string
2747argument &quot;resourcef&quot; and escapes reserved characters in the URI
2748depending on the value of the &quot;encoding&quot; argument. You should use
2749this function in place of traditional string functions whenever
2750you need to create a URI string.
2751
2752</p>
2753<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAssembleUUID">httpAssembleUUID</a></h3>
2754 <p class="description">Assemble a name-based UUID URN conforming to RFC 4122.</p>
2755<p class="code">
98d88c8d
MS
2756char *httpAssembleUUID(const char *server, int port, const char *name, int number, char *buffer, size_t bufsize);</p>
2757<h4 class="parameters">Parameters</h4>
2758<table class="list"><tbody>
2759<tr><th>server</th>
2760 <td class="description">Server name</td></tr>
2761<tr><th>port</th>
2762 <td class="description">Port number</td></tr>
2763<tr><th>name</th>
2764 <td class="description">Object name or NULL</td></tr>
2765<tr><th>number</th>
2766 <td class="description">Object number or 0</td></tr>
2767<tr><th>buffer</th>
2768 <td class="description">String buffer</td></tr>
2769<tr><th>bufsize</th>
2770 <td class="description">Size of buffer</td></tr>
2771</tbody></table>
798d6e29
MS
2772<h4 class="returnvalue">Return Value</h4>
2773 <p class="description">UUID string</p>
2774<h4 class="discussion">Discussion</h4>
2775 <p class="discussion">This function creates a unique 128-bit identifying number using the server
2776name, port number, random data, and optionally an object name and/or object
2777number. The result is formatted as a UUID URN as defined in RFC 4122.<br>
2778<br>
2779The buffer needs to be at least 46 bytes in size.
2780
2781</p>
2782<h3 class="function"><a id="httpBlocking">httpBlocking</a></h3>
98d88c8d 2783 <p class="description">Set blocking/non-blocking behavior on a connection.</p>
798d6e29 2784<p class="code">
98d88c8d 2785void httpBlocking(<a href="#http_t">http_t</a> *http, int b);</p>
798d6e29 2786<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2787<table class="list"><tbody>
2788<tr><th>http</th>
2789 <td class="description">HTTP connection</td></tr>
2790<tr><th>b</th>
2791 <td class="description">1 = blocking, 0 = non-blocking</td></tr>
2792</tbody></table>
798d6e29
MS
2793<h3 class="function"><a id="httpCheck">httpCheck</a></h3>
2794 <p class="description">Check to see if there is a pending response from the server.</p>
2795<p class="code">
98d88c8d 2796int httpCheck(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2797<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2798<table class="list"><tbody>
2799<tr><th>http</th>
2800 <td class="description">HTTP connection</td></tr>
2801</tbody></table>
798d6e29
MS
2802<h4 class="returnvalue">Return Value</h4>
2803 <p class="description">0 = no data, 1 = data available</p>
98d88c8d
MS
2804<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpClearCookie">httpClearCookie</a></h3>
2805 <p class="description">Clear the cookie value(s).</p>
798d6e29 2806<p class="code">
98d88c8d 2807void httpClearCookie(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2808<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2809<table class="list"><tbody>
2810<tr><th>http</th>
2811 <td class="description">HTTP connection</td></tr>
2812</tbody></table>
798d6e29 2813<h3 class="function"><a id="httpClearFields">httpClearFields</a></h3>
98d88c8d 2814 <p class="description">Clear HTTP request fields.</p>
798d6e29 2815<p class="code">
98d88c8d 2816void httpClearFields(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2817<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2818<table class="list"><tbody>
2819<tr><th>http</th>
2820 <td class="description">HTTP connection</td></tr>
2821</tbody></table>
798d6e29 2822<h3 class="function"><a id="httpClose">httpClose</a></h3>
98d88c8d 2823 <p class="description">Close an HTTP connection.</p>
798d6e29 2824<p class="code">
98d88c8d 2825void httpClose(<a href="#http_t">http_t</a> *http);</p>
798d6e29 2826<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2827<table class="list"><tbody>
2828<tr><th>http</th>
2829 <td class="description">HTTP connection</td></tr>
2830</tbody></table>
798d6e29
MS
2831<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpCompareCredentials">httpCompareCredentials</a></h3>
2832 <p class="description">Compare two sets of X.509 credentials.</p>
2833<p class="code">
98d88c8d 2834int httpCompareCredentials(cups_array_t *cred1, cups_array_t *cred2);</p>
798d6e29 2835<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2836<table class="list"><tbody>
2837<tr><th>cred1</th>
2838 <td class="description">First set of X.509 credentials</td></tr>
2839<tr><th>cred2</th>
2840 <td class="description">Second set of X.509 credentials</td></tr>
2841</tbody></table>
53af7f21
MS
2842<h4 class="returnvalue">Return Value</h4>
2843 <p class="description">1 if they match, 0 if they do not</p>
798d6e29
MS
2844<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpConnect2">httpConnect2</a></h3>
2845 <p class="description">Connect to a HTTP server.</p>
2846<p class="code">
98d88c8d
MS
2847<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>
2848<h4 class="parameters">Parameters</h4>
2849<table class="list"><tbody>
2850<tr><th>host</th>
2851 <td class="description">Host to connect to</td></tr>
2852<tr><th>port</th>
2853 <td class="description">Port number</td></tr>
2854<tr><th>addrlist</th>
65bebeac 2855 <td class="description">List of addresses or <code>NULL</code> to lookup</td></tr>
98d88c8d
MS
2856<tr><th>family</th>
2857 <td class="description">Address family to use or <code>AF_UNSPEC</code> for any</td></tr>
2858<tr><th>encryption</th>
2859 <td class="description">Type of encryption to use</td></tr>
2860<tr><th>blocking</th>
2861 <td class="description">1 for blocking connection, 0 for non-blocking</td></tr>
2862<tr><th>msec</th>
2863 <td class="description">Connection timeout in milliseconds, 0 means don't connect</td></tr>
2864<tr><th>cancel</th>
2865 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
2866</tbody></table>
798d6e29
MS
2867<h4 class="returnvalue">Return Value</h4>
2868 <p class="description">New HTTP connection</p>
798d6e29
MS
2869<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpCopyCredentials">httpCopyCredentials</a></h3>
2870 <p class="description">Copy the credentials associated with the peer in
2871an encrypted connection.</p>
2872<p class="code">
98d88c8d 2873int httpCopyCredentials(<a href="#http_t">http_t</a> *http, cups_array_t **credentials);</p>
798d6e29 2874<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2875<table class="list"><tbody>
2876<tr><th>http</th>
2877 <td class="description">Connection to server</td></tr>
2878<tr><th>credentials</th>
2879 <td class="description">Array of credentials</td></tr>
2880</tbody></table>
798d6e29
MS
2881<h4 class="returnvalue">Return Value</h4>
2882 <p class="description">Status of call (0 = success)</p>
2883<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></h3>
2884 <p class="description">Return whether the credentials are valid for the given name.</p>
2885<p class="code">
98d88c8d 2886int httpCredentialsAreValidForName(cups_array_t *credentials, const char *common_name);</p>
798d6e29 2887<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2888<table class="list"><tbody>
2889<tr><th>credentials</th>
2890 <td class="description">Credentials</td></tr>
2891<tr><th>common_name</th>
2892 <td class="description">Name to check</td></tr>
2893</tbody></table>
798d6e29
MS
2894<h4 class="returnvalue">Return Value</h4>
2895 <p class="description">1 if valid, 0 otherwise</p>
2896<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></h3>
2897 <p class="description">Return the expiration date of the credentials.</p>
2898<p class="code">
98d88c8d 2899time_t httpCredentialsGetExpiration(cups_array_t *credentials);</p>
798d6e29 2900<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2901<table class="list"><tbody>
2902<tr><th>credentials</th>
2903 <td class="description">Credentials</td></tr>
2904</tbody></table>
798d6e29
MS
2905<h4 class="returnvalue">Return Value</h4>
2906 <p class="description">Expiration date of credentials</p>
2907<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsGetTrust">httpCredentialsGetTrust</a></h3>
2908 <p class="description">Return the trust of credentials.</p>
2909<p class="code">
98d88c8d 2910<a href="#http_trust_t">http_trust_t</a> httpCredentialsGetTrust(cups_array_t *credentials, const char *common_name);</p>
798d6e29 2911<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2912<table class="list"><tbody>
2913<tr><th>credentials</th>
2914 <td class="description">Credentials</td></tr>
2915<tr><th>common_name</th>
2916 <td class="description">Common name for trust lookup</td></tr>
2917</tbody></table>
798d6e29
MS
2918<h4 class="returnvalue">Return Value</h4>
2919 <p class="description">Level of trust</p>
2920<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsString">httpCredentialsString</a></h3>
2921 <p class="description">Return a string representing the credentials.</p>
2922<p class="code">
98d88c8d
MS
2923size_t httpCredentialsString(cups_array_t *credentials, char *buffer, size_t bufsize);</p>
2924<h4 class="parameters">Parameters</h4>
2925<table class="list"><tbody>
2926<tr><th>credentials</th>
2927 <td class="description">Credentials</td></tr>
2928<tr><th>buffer</th>
2929 <td class="description">Buffer or <code>NULL</code></td></tr>
2930<tr><th>bufsize</th>
2931 <td class="description">Size of buffer</td></tr>
2932</tbody></table>
798d6e29
MS
2933<h4 class="returnvalue">Return Value</h4>
2934 <p class="description">Total size of credentials string</p>
798d6e29
MS
2935<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="httpDecode64_2">httpDecode64_2</a></h3>
2936 <p class="description">Base64-decode a string.</p>
2937<p class="code">
98d88c8d
MS
2938char *httpDecode64_2(char *out, int *outlen, const char *in);</p>
2939<h4 class="parameters">Parameters</h4>
2940<table class="list"><tbody>
2941<tr><th>out</th>
2942 <td class="description">String to write to</td></tr>
2943<tr><th>outlen</th>
2944 <td class="description">Size of output string</td></tr>
2945<tr><th>in</th>
2946 <td class="description">String to read from</td></tr>
2947</tbody></table>
798d6e29
MS
2948<h4 class="returnvalue">Return Value</h4>
2949 <p class="description">Decoded string</p>
98d88c8d
MS
2950<h4 class="discussion">Discussion</h4>
2951 <p class="discussion">The caller must initialize &quot;outlen&quot; to the maximum size of the decoded
65bebeac 2952string before calling <code>httpDecode64_2</code>. On return &quot;outlen&quot; contains the
98d88c8d
MS
2953decoded length of the string.
2954
2955</p>
798d6e29
MS
2956<h3 class="function"><a id="httpDelete">httpDelete</a></h3>
2957 <p class="description">Send a DELETE request to the server.</p>
2958<p class="code">
98d88c8d 2959int httpDelete(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 2960<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2961<table class="list"><tbody>
2962<tr><th>http</th>
2963 <td class="description">HTTP connection</td></tr>
2964<tr><th>uri</th>
2965 <td class="description">URI to delete</td></tr>
2966</tbody></table>
798d6e29
MS
2967<h4 class="returnvalue">Return Value</h4>
2968 <p class="description">Status of call (0 = success)</p>
798d6e29
MS
2969<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="httpEncode64_2">httpEncode64_2</a></h3>
2970 <p class="description">Base64-encode a string.</p>
2971<p class="code">
98d88c8d
MS
2972char *httpEncode64_2(char *out, int outlen, const char *in, int inlen);</p>
2973<h4 class="parameters">Parameters</h4>
2974<table class="list"><tbody>
2975<tr><th>out</th>
2976 <td class="description">String to write to</td></tr>
2977<tr><th>outlen</th>
2978 <td class="description">Maximum size of output string</td></tr>
2979<tr><th>in</th>
2980 <td class="description">String to read from</td></tr>
2981<tr><th>inlen</th>
2982 <td class="description">Size of input string</td></tr>
2983</tbody></table>
798d6e29
MS
2984<h4 class="returnvalue">Return Value</h4>
2985 <p class="description">Encoded string</p>
2986<h3 class="function"><a id="httpEncryption">httpEncryption</a></h3>
2987 <p class="description">Set the required encryption on the link.</p>
2988<p class="code">
98d88c8d 2989int httpEncryption(<a href="#http_t">http_t</a> *http, <a href="#http_encryption_t">http_encryption_t</a> e);</p>
798d6e29 2990<h4 class="parameters">Parameters</h4>
98d88c8d
MS
2991<table class="list"><tbody>
2992<tr><th>http</th>
2993 <td class="description">HTTP connection</td></tr>
2994<tr><th>e</th>
2995 <td class="description">New encryption preference</td></tr>
2996</tbody></table>
798d6e29
MS
2997<h4 class="returnvalue">Return Value</h4>
2998 <p class="description">-1 on error, 0 on success</p>
2999<h3 class="function"><a id="httpError">httpError</a></h3>
3000 <p class="description">Get the last error on a connection.</p>
3001<p class="code">
98d88c8d 3002int httpError(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3003<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3004<table class="list"><tbody>
3005<tr><th>http</th>
3006 <td class="description">HTTP connection</td></tr>
3007</tbody></table>
798d6e29
MS
3008<h4 class="returnvalue">Return Value</h4>
3009 <p class="description">Error code (errno) value</p>
3010<h3 class="function"><a id="httpFieldValue">httpFieldValue</a></h3>
3011 <p class="description">Return the HTTP field enumeration value for a field
3012name.</p>
3013<p class="code">
98d88c8d 3014<a href="#http_field_t">http_field_t</a> httpFieldValue(const char *name);</p>
798d6e29 3015<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3016<table class="list"><tbody>
3017<tr><th>name</th>
3018 <td class="description">String name</td></tr>
3019</tbody></table>
798d6e29
MS
3020<h4 class="returnvalue">Return Value</h4>
3021 <p class="description">Field index</p>
3022<h3 class="function"><a id="httpFlush">httpFlush</a></h3>
65bebeac 3023 <p class="description">Flush data read from a HTTP connection.</p>
798d6e29 3024<p class="code">
98d88c8d 3025void httpFlush(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3026<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3027<table class="list"><tbody>
3028<tr><th>http</th>
3029 <td class="description">HTTP connection</td></tr>
3030</tbody></table>
798d6e29 3031<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpFlushWrite">httpFlushWrite</a></h3>
65bebeac 3032 <p class="description">Flush data written to a HTTP connection.</p>
798d6e29 3033<p class="code">
98d88c8d 3034int httpFlushWrite(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3035<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3036<table class="list"><tbody>
3037<tr><th>http</th>
3038 <td class="description">HTTP connection</td></tr>
3039</tbody></table>
798d6e29
MS
3040<h4 class="returnvalue">Return Value</h4>
3041 <p class="description">Bytes written or -1 on error</p>
3042<h3 class="function"><a id="httpFreeCredentials">httpFreeCredentials</a></h3>
98d88c8d 3043 <p class="description">Free an array of credentials.</p>
798d6e29 3044<p class="code">
98d88c8d 3045void httpFreeCredentials(cups_array_t *credentials);</p>
798d6e29 3046<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3047<table class="list"><tbody>
3048<tr><th>credentials</th>
3049 <td class="description">Array of credentials</td></tr>
3050</tbody></table>
798d6e29
MS
3051<h3 class="function"><a id="httpGet">httpGet</a></h3>
3052 <p class="description">Send a GET request to the server.</p>
3053<p class="code">
98d88c8d 3054int httpGet(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3055<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3056<table class="list"><tbody>
3057<tr><th>http</th>
3058 <td class="description">HTTP connection</td></tr>
3059<tr><th>uri</th>
3060 <td class="description">URI to get</td></tr>
3061</tbody></table>
798d6e29
MS
3062<h4 class="returnvalue">Return Value</h4>
3063 <p class="description">Status of call (0 = success)</p>
3064<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetActivity">httpGetActivity</a></h3>
3065 <p class="description">Get the most recent activity for a connection.</p>
3066<p class="code">
98d88c8d 3067time_t httpGetActivity(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3068<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3069<table class="list"><tbody>
3070<tr><th>http</th>
3071 <td class="description">HTTP connection</td></tr>
3072</tbody></table>
798d6e29
MS
3073<h4 class="returnvalue">Return Value</h4>
3074 <p class="description">Time of last read or write</p>
3075<h4 class="discussion">Discussion</h4>
65bebeac 3076 <p class="discussion">The return value is the time in seconds of the last read or write.
798d6e29
MS
3077
3078</p>
3079<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetAddress">httpGetAddress</a></h3>
3080 <p class="description">Get the address of the connected peer of a connection.</p>
3081<p class="code">
98d88c8d 3082<a href="#http_addr_t">http_addr_t</a> *httpGetAddress(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3083<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3084<table class="list"><tbody>
3085<tr><th>http</th>
3086 <td class="description">HTTP connection</td></tr>
3087</tbody></table>
798d6e29
MS
3088<h4 class="returnvalue">Return Value</h4>
3089 <p class="description">Connected address or <code>NULL</code></p>
3090<h4 class="discussion">Discussion</h4>
65bebeac
MS
3091 <p class="discussion">For connections created with <a href="#httpConnect2"><code>httpConnect2</code></a>, the address is for the
3092server. For connections created with <a href="#httpAccept"><code>httpAccept</code></a>, the address is for
3093the client.<br>
3094<br>
3095Returns <code>NULL</code> if the socket is currently unconnected.
798d6e29
MS
3096
3097</p>
3098<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="httpGetAuthString">httpGetAuthString</a></h3>
3099 <p class="description">Get the current authorization string.</p>
3100<p class="code">
98d88c8d 3101char *httpGetAuthString(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3102<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3103<table class="list"><tbody>
3104<tr><th>http</th>
3105 <td class="description">HTTP connection</td></tr>
3106</tbody></table>
798d6e29
MS
3107<h4 class="returnvalue">Return Value</h4>
3108 <p class="description">Authorization string</p>
3109<h4 class="discussion">Discussion</h4>
65bebeac
MS
3110 <p class="discussion">The authorization string is set by <a href="#cupsDoAuthentication"><code>cupsDoAuthentication</code></a> and
3111<a href="#httpSetAuthString"><code>httpSetAuthString</code></a>. Use <a href="#httpGetAuthString"><code>httpGetAuthString</code></a> to retrieve the
3112string to use with <a href="#httpSetField"><code>httpSetField</code></a> for the
3113<code>HTTP_FIELD_AUTHORIZATION</code> value.
798d6e29
MS
3114
3115</p>
3116<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetBlocking">httpGetBlocking</a></h3>
3117 <p class="description">Get the blocking/non-block state of a connection.</p>
3118<p class="code">
98d88c8d 3119int httpGetBlocking(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3120<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3121<table class="list"><tbody>
3122<tr><th>http</th>
3123 <td class="description">HTTP connection</td></tr>
3124</tbody></table>
798d6e29
MS
3125<h4 class="returnvalue">Return Value</h4>
3126 <p class="description">1 if blocking, 0 if non-blocking</p>
3127<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpGetContentEncoding">httpGetContentEncoding</a></h3>
3128 <p class="description">Get a common content encoding, if any, between
3129the client and server.</p>
3130<p class="code">
98d88c8d 3131const char *httpGetContentEncoding(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3132<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3133<table class="list"><tbody>
3134<tr><th>http</th>
3135 <td class="description">HTTP connection</td></tr>
3136</tbody></table>
798d6e29
MS
3137<h4 class="returnvalue">Return Value</h4>
3138 <p class="description">Content-Coding value or
3139<code>NULL</code> for the identity
3140coding.</p>
3141<h4 class="discussion">Discussion</h4>
3142 <p class="discussion">This function uses the value of the Accepts-Encoding HTTP header and must be
3143called after receiving a response from the server or a request from the
3144client. The value returned can be use in subsequent requests (for clients)
3145or in the response (for servers) in order to compress the content stream.
3146
3147</p>
3148<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpGetCookie">httpGetCookie</a></h3>
3149 <p class="description">Get any cookie data from the response.</p>
3150<p class="code">
98d88c8d 3151const char *httpGetCookie(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3152<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3153<table class="list"><tbody>
3154<tr><th>http</th>
3155 <td class="description">HTTP connection</td></tr>
3156</tbody></table>
798d6e29 3157<h4 class="returnvalue">Return Value</h4>
65bebeac 3158 <p class="description">Cookie data or <code>NULL</code></p>
798d6e29
MS
3159<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetDateString2">httpGetDateString2</a></h3>
3160 <p class="description">Get a formatted date/time string from a time value.</p>
3161<p class="code">
98d88c8d
MS
3162const char *httpGetDateString2(time_t t, char *s, int slen);</p>
3163<h4 class="parameters">Parameters</h4>
3164<table class="list"><tbody>
3165<tr><th>t</th>
65bebeac 3166 <td class="description">Time in seconds</td></tr>
98d88c8d
MS
3167<tr><th>s</th>
3168 <td class="description">String buffer</td></tr>
3169<tr><th>slen</th>
3170 <td class="description">Size of string buffer</td></tr>
3171</tbody></table>
798d6e29
MS
3172<h4 class="returnvalue">Return Value</h4>
3173 <p class="description">Date/time string</p>
3174<h3 class="function"><a id="httpGetDateTime">httpGetDateTime</a></h3>
3175 <p class="description">Get a time value from a formatted date/time string.</p>
3176<p class="code">
98d88c8d 3177time_t httpGetDateTime(const char *s);</p>
798d6e29 3178<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3179<table class="list"><tbody>
3180<tr><th>s</th>
3181 <td class="description">Date/time string</td></tr>
3182</tbody></table>
798d6e29 3183<h4 class="returnvalue">Return Value</h4>
65bebeac 3184 <p class="description">Time in seconds</p>
798d6e29
MS
3185<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetEncryption">httpGetEncryption</a></h3>
3186 <p class="description">Get the current encryption mode of a connection.</p>
3187<p class="code">
98d88c8d 3188<a href="#http_encryption_t">http_encryption_t</a> httpGetEncryption(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3189<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3190<table class="list"><tbody>
3191<tr><th>http</th>
3192 <td class="description">HTTP connection</td></tr>
3193</tbody></table>
798d6e29
MS
3194<h4 class="returnvalue">Return Value</h4>
3195 <p class="description">Current encryption mode</p>
3196<h4 class="discussion">Discussion</h4>
3197 <p class="discussion">This function returns the encryption mode for the connection. Use the
3198<a href="#httpIsEncrypted"><code>httpIsEncrypted</code></a> function to determine whether a TLS session has
3199been established.
3200
3201</p>
3202<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpGetExpect">httpGetExpect</a></h3>
3203 <p class="description">Get the value of the Expect header, if any.</p>
3204<p class="code">
98d88c8d 3205http_status_t httpGetExpect(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3206<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3207<table class="list"><tbody>
3208<tr><th>http</th>
3209 <td class="description">HTTP connection</td></tr>
3210</tbody></table>
798d6e29
MS
3211<h4 class="returnvalue">Return Value</h4>
3212 <p class="description">Expect: status, if any</p>
3213<h4 class="discussion">Discussion</h4>
3214 <p class="discussion">Returns <code>HTTP_STATUS_NONE</code> if there is no Expect header, otherwise
3215returns the expected HTTP status code, typically <code>HTTP_STATUS_CONTINUE</code>.
3216
3217</p>
3218<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetFd">httpGetFd</a></h3>
3219 <p class="description">Get the file descriptor associated with a connection.</p>
3220<p class="code">
98d88c8d 3221int httpGetFd(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3222<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3223<table class="list"><tbody>
3224<tr><th>http</th>
3225 <td class="description">HTTP connection</td></tr>
3226</tbody></table>
798d6e29
MS
3227<h4 class="returnvalue">Return Value</h4>
3228 <p class="description">File descriptor or -1 if none</p>
3229<h3 class="function"><a id="httpGetField">httpGetField</a></h3>
3230 <p class="description">Get a field value from a request/response.</p>
3231<p class="code">
98d88c8d 3232const char *httpGetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field);</p>
798d6e29 3233<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3234<table class="list"><tbody>
3235<tr><th>http</th>
3236 <td class="description">HTTP connection</td></tr>
3237<tr><th>field</th>
3238 <td class="description">Field to get</td></tr>
3239</tbody></table>
798d6e29
MS
3240<h4 class="returnvalue">Return Value</h4>
3241 <p class="description">Field value</p>
798d6e29
MS
3242<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetHostname">httpGetHostname</a></h3>
3243 <p class="description">Get the FQDN for the connection or local system.</p>
3244<p class="code">
98d88c8d
MS
3245const char *httpGetHostname(<a href="#http_t">http_t</a> *http, char *s, int slen);</p>
3246<h4 class="parameters">Parameters</h4>
3247<table class="list"><tbody>
3248<tr><th>http</th>
3249 <td class="description">HTTP connection or NULL</td></tr>
3250<tr><th>s</th>
3251 <td class="description">String buffer for name</td></tr>
3252<tr><th>slen</th>
3253 <td class="description">Size of buffer</td></tr>
3254</tbody></table>
798d6e29
MS
3255<h4 class="returnvalue">Return Value</h4>
3256 <p class="description">FQDN for connection or system</p>
3257<h4 class="discussion">Discussion</h4>
3258 <p class="discussion">When &quot;http&quot; points to a connected socket, return the hostname or
3259address that was used in the call to httpConnect() or httpConnectEncrypt(),
3260or the address of the client for the connection from httpAcceptConnection().
3261Otherwise, return the FQDN for the local system using both gethostname()
3262and gethostbyname() to get the local hostname with domain.
3263
3264</p>
3265<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetKeepAlive">httpGetKeepAlive</a></h3>
3266 <p class="description">Get the current Keep-Alive state of the connection.</p>
3267<p class="code">
98d88c8d 3268<a href="#http_keepalive_t">http_keepalive_t</a> httpGetKeepAlive(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3269<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3270<table class="list"><tbody>
3271<tr><th>http</th>
3272 <td class="description">HTTP connection</td></tr>
3273</tbody></table>
798d6e29
MS
3274<h4 class="returnvalue">Return Value</h4>
3275 <p class="description">Keep-Alive state</p>
798d6e29
MS
3276<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetLength2">httpGetLength2</a></h3>
3277 <p class="description">Get the amount of data remaining from the
3278content-length or transfer-encoding fields.</p>
3279<p class="code">
98d88c8d 3280off_t httpGetLength2(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3281<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3282<table class="list"><tbody>
3283<tr><th>http</th>
3284 <td class="description">HTTP connection</td></tr>
3285</tbody></table>
798d6e29
MS
3286<h4 class="returnvalue">Return Value</h4>
3287 <p class="description">Content length</p>
3288<h4 class="discussion">Discussion</h4>
3289 <p class="discussion">This function returns the complete content length, even for
3290content larger than 2^31 - 1.
3291
3292</p>
3293<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetPending">httpGetPending</a></h3>
3294 <p class="description">Get the number of bytes that are buffered for writing.</p>
3295<p class="code">
98d88c8d 3296size_t httpGetPending(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3297<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3298<table class="list"><tbody>
3299<tr><th>http</th>
3300 <td class="description">HTTP connection</td></tr>
3301</tbody></table>
798d6e29
MS
3302<h4 class="returnvalue">Return Value</h4>
3303 <p class="description">Number of bytes buffered</p>
3304<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetReady">httpGetReady</a></h3>
3305 <p class="description">Get the number of bytes that can be read without blocking.</p>
3306<p class="code">
98d88c8d 3307size_t httpGetReady(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3308<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3309<table class="list"><tbody>
3310<tr><th>http</th>
3311 <td class="description">HTTP connection</td></tr>
3312</tbody></table>
798d6e29
MS
3313<h4 class="returnvalue">Return Value</h4>
3314 <p class="description">Number of bytes available</p>
3315<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetRemaining">httpGetRemaining</a></h3>
3316 <p class="description">Get the number of remaining bytes in the message
3317body or current chunk.</p>
3318<p class="code">
98d88c8d 3319size_t httpGetRemaining(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3320<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3321<table class="list"><tbody>
3322<tr><th>http</th>
3323 <td class="description">HTTP connection</td></tr>
3324</tbody></table>
798d6e29
MS
3325<h4 class="returnvalue">Return Value</h4>
3326 <p class="description">Remaining bytes</p>
3327<h4 class="discussion">Discussion</h4>
3328 <p class="discussion">The <a href="#httpIsChunked"><code>httpIsChunked</code></a> function can be used to determine whether the
3329message body is chunked or fixed-length.
3330
3331</p>
3332<h3 class="function"><a id="httpGetState">httpGetState</a></h3>
3333 <p class="description">Get the current state of the HTTP request.</p>
3334<p class="code">
98d88c8d 3335<a href="#http_state_t">http_state_t</a> httpGetState(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3336<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3337<table class="list"><tbody>
3338<tr><th>http</th>
3339 <td class="description">HTTP connection</td></tr>
3340</tbody></table>
798d6e29
MS
3341<h4 class="returnvalue">Return Value</h4>
3342 <p class="description">HTTP state</p>
3343<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetStatus">httpGetStatus</a></h3>
3344 <p class="description">Get the status of the last HTTP request.</p>
3345<p class="code">
98d88c8d 3346http_status_t httpGetStatus(<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">HTTP status</p>
798d6e29
MS
3354<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetSubField2">httpGetSubField2</a></h3>
3355 <p class="description">Get a sub-field value.</p>
3356<p class="code">
98d88c8d
MS
3357char *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>
3358<h4 class="parameters">Parameters</h4>
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 index</td></tr>
3364<tr><th>name</th>
3365 <td class="description">Name of sub-field</td></tr>
3366<tr><th>value</th>
3367 <td class="description">Value string</td></tr>
3368<tr><th>valuelen</th>
3369 <td class="description">Size of value buffer</td></tr>
3370</tbody></table>
798d6e29 3371<h4 class="returnvalue">Return Value</h4>
65bebeac 3372 <p class="description">Value or <code>NULL</code></p>
798d6e29
MS
3373<h3 class="function"><a id="httpGetVersion">httpGetVersion</a></h3>
3374 <p class="description">Get the HTTP version at the other end.</p>
3375<p class="code">
98d88c8d 3376<a href="#http_version_t">http_version_t</a> httpGetVersion(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3377<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3378<table class="list"><tbody>
3379<tr><th>http</th>
3380 <td class="description">HTTP connection</td></tr>
3381</tbody></table>
798d6e29
MS
3382<h4 class="returnvalue">Return Value</h4>
3383 <p class="description">Version number</p>
3384<h3 class="function"><a id="httpGets">httpGets</a></h3>
3385 <p class="description">Get a line of text from a HTTP connection.</p>
3386<p class="code">
98d88c8d
MS
3387char *httpGets(char *line, int length, <a href="#http_t">http_t</a> *http);</p>
3388<h4 class="parameters">Parameters</h4>
3389<table class="list"><tbody>
3390<tr><th>line</th>
3391 <td class="description">Line to read into</td></tr>
3392<tr><th>length</th>
3393 <td class="description">Max length of buffer</td></tr>
3394<tr><th>http</th>
3395 <td class="description">HTTP connection</td></tr>
3396</tbody></table>
798d6e29 3397<h4 class="returnvalue">Return Value</h4>
65bebeac 3398 <p class="description">Line or <code>NULL</code></p>
798d6e29
MS
3399<h3 class="function"><a id="httpHead">httpHead</a></h3>
3400 <p class="description">Send a HEAD request to the server.</p>
3401<p class="code">
98d88c8d 3402int httpHead(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3403<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3404<table class="list"><tbody>
3405<tr><th>http</th>
3406 <td class="description">HTTP connection</td></tr>
3407<tr><th>uri</th>
3408 <td class="description">URI for head</td></tr>
3409</tbody></table>
798d6e29
MS
3410<h4 class="returnvalue">Return Value</h4>
3411 <p class="description">Status of call (0 = success)</p>
3412<h3 class="function"><a id="httpInitialize">httpInitialize</a></h3>
53af7f21
MS
3413 <p class="description">Initialize the HTTP interface library and set the
3414default HTTP proxy (if any).</p>
98d88c8d
MS
3415<p class="code">
3416void httpInitialize(void);</p>
798d6e29
MS
3417<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpIsChunked">httpIsChunked</a></h3>
3418 <p class="description">Report whether a message body is chunked.</p>
3419<p class="code">
98d88c8d 3420int httpIsChunked(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3421<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3422<table class="list"><tbody>
3423<tr><th>http</th>
3424 <td class="description">HTTP connection</td></tr>
3425</tbody></table>
798d6e29
MS
3426<h4 class="returnvalue">Return Value</h4>
3427 <p class="description">1 if chunked, 0 if not</p>
3428<h4 class="discussion">Discussion</h4>
3429 <p class="discussion">This function returns non-zero if the message body is composed of
3430variable-length chunks.
3431
3432</p>
3433<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpIsEncrypted">httpIsEncrypted</a></h3>
3434 <p class="description">Report whether a connection is encrypted.</p>
3435<p class="code">
98d88c8d 3436int httpIsEncrypted(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3437<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3438<table class="list"><tbody>
3439<tr><th>http</th>
3440 <td class="description">HTTP connection</td></tr>
3441</tbody></table>
798d6e29
MS
3442<h4 class="returnvalue">Return Value</h4>
3443 <p class="description">1 if encrypted, 0 if not</p>
3444<h4 class="discussion">Discussion</h4>
3445 <p class="discussion">This function returns non-zero if the connection is currently encrypted.
3446
3447</p>
3448<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpLoadCredentials">httpLoadCredentials</a></h3>
3449 <p class="description">Load X.509 credentials from a keychain file.</p>
3450<p class="code">
98d88c8d
MS
3451int httpLoadCredentials(const char *path, cups_array_t **credentials, const char *common_name);</p>
3452<h4 class="parameters">Parameters</h4>
3453<table class="list"><tbody>
3454<tr><th>path</th>
3455 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
3456<tr><th>credentials</th>
3457 <td class="description">Credentials</td></tr>
3458<tr><th>common_name</th>
3459 <td class="description">Common name for credentials</td></tr>
3460</tbody></table>
798d6e29
MS
3461<h4 class="returnvalue">Return Value</h4>
3462 <p class="description">0 on success, -1 on error</p>
3463<h3 class="function"><a id="httpOptions">httpOptions</a></h3>
3464 <p class="description">Send an OPTIONS request to the server.</p>
3465<p class="code">
98d88c8d 3466int httpOptions(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3467<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3468<table class="list"><tbody>
3469<tr><th>http</th>
3470 <td class="description">HTTP connection</td></tr>
3471<tr><th>uri</th>
3472 <td class="description">URI for options</td></tr>
3473</tbody></table>
798d6e29
MS
3474<h4 class="returnvalue">Return Value</h4>
3475 <p class="description">Status of call (0 = success)</p>
3476<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpPeek">httpPeek</a></h3>
3477 <p class="description">Peek at data from a HTTP connection.</p>
3478<p class="code">
98d88c8d
MS
3479ssize_t httpPeek(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p>
3480<h4 class="parameters">Parameters</h4>
3481<table class="list"><tbody>
3482<tr><th>http</th>
3483 <td class="description">HTTP connection</td></tr>
3484<tr><th>buffer</th>
3485 <td class="description">Buffer for data</td></tr>
3486<tr><th>length</th>
3487 <td class="description">Maximum number of bytes</td></tr>
3488</tbody></table>
798d6e29
MS
3489<h4 class="returnvalue">Return Value</h4>
3490 <p class="description">Number of bytes copied</p>
3491<h4 class="discussion">Discussion</h4>
3492 <p class="discussion">This function copies available data from the given HTTP connection, reading
3493a buffer as needed. The data is still available for reading using
65bebeac 3494<a href="#httpRead2"><code>httpRead2</code></a>.<br>
798d6e29
MS
3495<br>
3496For non-blocking connections the usual timeouts apply.
3497
3498</p>
3499<h3 class="function"><a id="httpPost">httpPost</a></h3>
3500 <p class="description">Send a POST request to the server.</p>
3501<p class="code">
98d88c8d 3502int httpPost(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3503<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3504<table class="list"><tbody>
3505<tr><th>http</th>
3506 <td class="description">HTTP connection</td></tr>
3507<tr><th>uri</th>
3508 <td class="description">URI for post</td></tr>
3509</tbody></table>
798d6e29
MS
3510<h4 class="returnvalue">Return Value</h4>
3511 <p class="description">Status of call (0 = success)</p>
3512<h3 class="function"><a id="httpPut">httpPut</a></h3>
3513 <p class="description">Send a PUT request to the server.</p>
3514<p class="code">
98d88c8d 3515int httpPut(<a href="#http_t">http_t</a> *http, const char *uri);</p>
798d6e29 3516<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3517<table class="list"><tbody>
3518<tr><th>http</th>
3519 <td class="description">HTTP connection</td></tr>
3520<tr><th>uri</th>
3521 <td class="description">URI to put</td></tr>
3522</tbody></table>
798d6e29
MS
3523<h4 class="returnvalue">Return Value</h4>
3524 <p class="description">Status of call (0 = success)</p>
798d6e29
MS
3525<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpRead2">httpRead2</a></h3>
3526 <p class="description">Read data from a HTTP connection.</p>
3527<p class="code">
98d88c8d
MS
3528ssize_t httpRead2(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p>
3529<h4 class="parameters">Parameters</h4>
3530<table class="list"><tbody>
3531<tr><th>http</th>
3532 <td class="description">HTTP connection</td></tr>
3533<tr><th>buffer</th>
3534 <td class="description">Buffer for data</td></tr>
3535<tr><th>length</th>
3536 <td class="description">Maximum number of bytes</td></tr>
3537</tbody></table>
798d6e29
MS
3538<h4 class="returnvalue">Return Value</h4>
3539 <p class="description">Number of bytes read</p>
3540<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpReadRequest">httpReadRequest</a></h3>
3541 <p class="description">Read a HTTP request from a connection.</p>
3542<p class="code">
98d88c8d
MS
3543<a href="#http_state_t">http_state_t</a> httpReadRequest(<a href="#http_t">http_t</a> *http, char *uri, size_t urilen);</p>
3544<h4 class="parameters">Parameters</h4>
3545<table class="list"><tbody>
3546<tr><th>http</th>
3547 <td class="description">HTTP connection</td></tr>
3548<tr><th>uri</th>
3549 <td class="description">URI buffer</td></tr>
3550<tr><th>urilen</th>
3551 <td class="description">Size of URI buffer</td></tr>
3552</tbody></table>
798d6e29
MS
3553<h4 class="returnvalue">Return Value</h4>
3554 <p class="description">New state of connection</p>
798d6e29
MS
3555<h3 class="function"><a id="httpReconnect2">httpReconnect2</a></h3>
3556 <p class="description">Reconnect to a HTTP server with timeout and optional
3557cancel.</p>
3558<p class="code">
98d88c8d
MS
3559int httpReconnect2(<a href="#http_t">http_t</a> *http, int msec, int *cancel);</p>
3560<h4 class="parameters">Parameters</h4>
3561<table class="list"><tbody>
3562<tr><th>http</th>
3563 <td class="description">HTTP connection</td></tr>
3564<tr><th>msec</th>
3565 <td class="description">Timeout in milliseconds</td></tr>
3566<tr><th>cancel</th>
3567 <td class="description">Pointer to &quot;cancel&quot; variable</td></tr>
3568</tbody></table>
798d6e29
MS
3569<h4 class="returnvalue">Return Value</h4>
3570 <p class="description">0 on success, non-zero on failure</p>
3571<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpResolveHostname">httpResolveHostname</a></h3>
3572 <p class="description">Resolve the hostname of the HTTP connection
3573address.</p>
3574<p class="code">
98d88c8d
MS
3575const char *httpResolveHostname(<a href="#http_t">http_t</a> *http, char *buffer, size_t bufsize);</p>
3576<h4 class="parameters">Parameters</h4>
3577<table class="list"><tbody>
3578<tr><th>http</th>
3579 <td class="description">HTTP connection</td></tr>
3580<tr><th>buffer</th>
3581 <td class="description">Hostname buffer</td></tr>
3582<tr><th>bufsize</th>
3583 <td class="description">Size of buffer</td></tr>
3584</tbody></table>
798d6e29
MS
3585<h4 class="returnvalue">Return Value</h4>
3586 <p class="description">Resolved hostname or <code>NULL</code></p>
3587<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpSaveCredentials">httpSaveCredentials</a></h3>
3588 <p class="description">Save X.509 credentials to a keychain file.</p>
3589<p class="code">
98d88c8d
MS
3590int httpSaveCredentials(const char *path, cups_array_t *credentials, const char *common_name);</p>
3591<h4 class="parameters">Parameters</h4>
3592<table class="list"><tbody>
3593<tr><th>path</th>
3594 <td class="description">Keychain path or <code>NULL</code> for default</td></tr>
3595<tr><th>credentials</th>
3596 <td class="description">Credentials</td></tr>
3597<tr><th>common_name</th>
3598 <td class="description">Common name for credentials</td></tr>
3599</tbody></table>
798d6e29
MS
3600<h4 class="returnvalue">Return Value</h4>
3601 <p class="description">-1 on error, 0 on success</p>
798d6e29
MS
3602<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSeparateURI">httpSeparateURI</a></h3>
3603 <p class="description">Separate a Universal Resource Identifier into its
3604components.</p>
3605<p class="code">
98d88c8d
MS
3606<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>
3607<h4 class="parameters">Parameters</h4>
3608<table class="list"><tbody>
3609<tr><th>decoding</th>
3610 <td class="description">Decoding flags</td></tr>
3611<tr><th>uri</th>
3612 <td class="description">Universal Resource Identifier</td></tr>
3613<tr><th>scheme</th>
3614 <td class="description">Scheme (http, https, etc.)</td></tr>
3615<tr><th>schemelen</th>
3616 <td class="description">Size of scheme buffer</td></tr>
3617<tr><th>username</th>
3618 <td class="description">Username</td></tr>
3619<tr><th>usernamelen</th>
3620 <td class="description">Size of username buffer</td></tr>
3621<tr><th>host</th>
3622 <td class="description">Hostname</td></tr>
3623<tr><th>hostlen</th>
3624 <td class="description">Size of hostname buffer</td></tr>
3625<tr><th>port</th>
3626 <td class="description">Port number to use</td></tr>
3627<tr><th>resource</th>
3628 <td class="description">Resource/filename</td></tr>
3629<tr><th>resourcelen</th>
3630 <td class="description">Size of resource buffer</td></tr>
3631</tbody></table>
798d6e29
MS
3632<h4 class="returnvalue">Return Value</h4>
3633 <p class="description">Result of separation</p>
98d88c8d 3634<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="httpSetAuthString">httpSetAuthString</a></h3>
53af7f21 3635 <p class="description">Set the current authorization string.</p>
98d88c8d
MS
3636<p class="code">
3637void httpSetAuthString(<a href="#http_t">http_t</a> *http, const char *scheme, const char *data);</p>
3638<h4 class="parameters">Parameters</h4>
3639<table class="list"><tbody>
3640<tr><th>http</th>
3641 <td class="description">HTTP connection</td></tr>
3642<tr><th>scheme</th>
3643 <td class="description">Auth scheme (NULL to clear it)</td></tr>
3644<tr><th>data</th>
3645 <td class="description">Auth data (NULL for none)</td></tr>
3646</tbody></table>
3647<h4 class="discussion">Discussion</h4>
798d6e29 3648 <p class="discussion">This function just stores a copy of the current authorization string in
65bebeac
MS
3649the HTTP connection object. You must still call <a href="#httpSetField"><code>httpSetField</code></a> to set
3650<code>HTTP_FIELD_AUTHORIZATION</code> prior to issuing a HTTP request using
3651<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
3652<a href="#httpPut"><code>httpPut</code></a>.
798d6e29
MS
3653
3654</p>
98d88c8d
MS
3655<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpSetCookie">httpSetCookie</a></h3>
3656 <p class="description">Set the cookie value(s).</p>
798d6e29 3657<p class="code">
98d88c8d 3658void httpSetCookie(<a href="#http_t">http_t</a> *http, const char *cookie);</p>
798d6e29 3659<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3660<table class="list"><tbody>
3661<tr><th>http</th>
3662 <td class="description">Connection</td></tr>
3663<tr><th>cookie</th>
3664 <td class="description">Cookie string</td></tr>
3665</tbody></table>
798d6e29
MS
3666<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpSetCredentials">httpSetCredentials</a></h3>
3667 <p class="description">Set the credentials associated with an encrypted
3668connection.</p>
3669<p class="code">
98d88c8d 3670int httpSetCredentials(<a href="#http_t">http_t</a> *http, cups_array_t *credentials);</p>
798d6e29 3671<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3672<table class="list"><tbody>
3673<tr><th>http</th>
3674 <td class="description">HTTP connection</td></tr>
3675<tr><th>credentials</th>
3676 <td class="description">Array of credentials</td></tr>
3677</tbody></table>
798d6e29
MS
3678<h4 class="returnvalue">Return Value</h4>
3679 <p class="description">Status of call (0 = success)</p>
98d88c8d 3680<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpSetDefaultField">httpSetDefaultField</a></h3>
53af7f21 3681 <p class="description">Set the default value of an HTTP header.</p>
98d88c8d
MS
3682<p class="code">
3683void httpSetDefaultField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p>
3684<h4 class="parameters">Parameters</h4>
3685<table class="list"><tbody>
3686<tr><th>http</th>
3687 <td class="description">HTTP connection</td></tr>
3688<tr><th>field</th>
3689 <td class="description">Field index</td></tr>
3690<tr><th>value</th>
3691 <td class="description">Value</td></tr>
3692</tbody></table>
3693<h4 class="discussion">Discussion</h4>
798d6e29
MS
3694 <p class="discussion">Currently only <code>HTTP_FIELD_ACCEPT_ENCODING</code>, <code>HTTP_FIELD_SERVER</code>,
3695and <code>HTTP_FIELD_USER_AGENT</code> can be set.
3696
3697</p>
98d88c8d
MS
3698<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSetExpect">httpSetExpect</a></h3>
3699 <p class="description">Set the Expect: header in a request.</p>
798d6e29 3700<p class="code">
98d88c8d 3701void httpSetExpect(<a href="#http_t">http_t</a> *http, http_status_t expect);</p>
798d6e29 3702<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3703<table class="list"><tbody>
3704<tr><th>http</th>
3705 <td class="description">HTTP connection</td></tr>
3706<tr><th>expect</th>
3707 <td class="description">HTTP status to expect
3708(<code>HTTP_STATUS_CONTINUE</code>)</td></tr>
3709</tbody></table>
3710<h4 class="discussion">Discussion</h4>
798d6e29
MS
3711 <p class="discussion">Currently only <code>HTTP_STATUS_CONTINUE</code> is supported for the &quot;expect&quot;
3712argument.
3713
3714</p>
3715<h3 class="function"><a id="httpSetField">httpSetField</a></h3>
53af7f21 3716 <p class="description">Set the value of an HTTP header.</p>
798d6e29 3717<p class="code">
98d88c8d
MS
3718void httpSetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p>
3719<h4 class="parameters">Parameters</h4>
3720<table class="list"><tbody>
3721<tr><th>http</th>
3722 <td class="description">HTTP connection</td></tr>
3723<tr><th>field</th>
3724 <td class="description">Field index</td></tr>
3725<tr><th>value</th>
3726 <td class="description">Value</td></tr>
3727</tbody></table>
3728<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpSetKeepAlive">httpSetKeepAlive</a></h3>
53af7f21 3729 <p class="description">Set the current Keep-Alive state of a connection.</p>
98d88c8d
MS
3730<p class="code">
3731void httpSetKeepAlive(<a href="#http_t">http_t</a> *http, <a href="#http_keepalive_t">http_keepalive_t</a> keep_alive);</p>
3732<h4 class="parameters">Parameters</h4>
3733<table class="list"><tbody>
3734<tr><th>http</th>
3735 <td class="description">HTTP connection</td></tr>
3736<tr><th>keep_alive</th>
3737 <td class="description">New Keep-Alive value</td></tr>
3738</tbody></table>
3739<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSetLength">httpSetLength</a></h3>
53af7f21 3740 <p class="description">Set the content-length and content-encoding.</p>
98d88c8d
MS
3741<p class="code">
3742void httpSetLength(<a href="#http_t">http_t</a> *http, size_t length);</p>
3743<h4 class="parameters">Parameters</h4>
3744<table class="list"><tbody>
3745<tr><th>http</th>
3746 <td class="description">HTTP connection</td></tr>
3747<tr><th>length</th>
3748 <td class="description">Length (0 for chunked)</td></tr>
3749</tbody></table>
3750<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpSetTimeout">httpSetTimeout</a></h3>
53af7f21 3751 <p class="description">Set read/write timeouts and an optional callback.</p>
98d88c8d
MS
3752<p class="code">
3753void 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>
3754<h4 class="parameters">Parameters</h4>
3755<table class="list"><tbody>
3756<tr><th>http</th>
3757 <td class="description">HTTP connection</td></tr>
3758<tr><th>timeout</th>
3759 <td class="description">Number of seconds for timeout,
3760must be greater than 0</td></tr>
3761<tr><th>cb</th>
65bebeac 3762 <td class="description">Callback function or <code>NULL</code></td></tr>
98d88c8d
MS
3763<tr><th>user_data</th>
3764 <td class="description">User data pointer</td></tr>
3765</tbody></table>
3766<h4 class="discussion">Discussion</h4>
798d6e29
MS
3767 <p class="discussion">The optional timeout callback receives both the HTTP connection and a user
3768data pointer and must return 1 to continue or 0 to error (time) out.
3769
3770</p>
98d88c8d
MS
3771<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpShutdown">httpShutdown</a></h3>
3772 <p class="description">Shutdown one side of an HTTP connection.</p>
798d6e29 3773<p class="code">
98d88c8d 3774void httpShutdown(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3775<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3776<table class="list"><tbody>
3777<tr><th>http</th>
3778 <td class="description">HTTP connection</td></tr>
3779</tbody></table>
798d6e29
MS
3780<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpStateString">httpStateString</a></h3>
3781 <p class="description">Return the string describing a HTTP state value.</p>
3782<p class="code">
98d88c8d 3783const char *httpStateString(<a href="#http_state_t">http_state_t</a> state);</p>
798d6e29 3784<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3785<table class="list"><tbody>
3786<tr><th>state</th>
3787 <td class="description">HTTP state value</td></tr>
3788</tbody></table>
798d6e29
MS
3789<h4 class="returnvalue">Return Value</h4>
3790 <p class="description">State string</p>
3791<h3 class="function"><a id="httpStatus">httpStatus</a></h3>
3792 <p class="description">Return a short string describing a HTTP status code.</p>
3793<p class="code">
98d88c8d 3794const char *httpStatus(http_status_t status);</p>
798d6e29 3795<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3796<table class="list"><tbody>
3797<tr><th>status</th>
3798 <td class="description">HTTP status code</td></tr>
3799</tbody></table>
798d6e29
MS
3800<h4 class="returnvalue">Return Value</h4>
3801 <p class="description">Localized status string</p>
3802<h4 class="discussion">Discussion</h4>
3803 <p class="discussion">The returned string is localized to the current POSIX locale and is based
65bebeac 3804on the status strings defined in RFC 7231.</p>
798d6e29
MS
3805<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpURIStatusString">httpURIStatusString</a></h3>
3806 <p class="description">Return a string describing a URI status code.</p>
3807<p class="code">
98d88c8d 3808const char *httpURIStatusString(<a href="#http_uri_status_t">http_uri_status_t</a> status);</p>
798d6e29 3809<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3810<table class="list"><tbody>
3811<tr><th>status</th>
3812 <td class="description">URI status code</td></tr>
3813</tbody></table>
798d6e29
MS
3814<h4 class="returnvalue">Return Value</h4>
3815 <p class="description">Localized status string</p>
3816<h3 class="function"><a id="httpUpdate">httpUpdate</a></h3>
3817 <p class="description">Update the current HTTP state for incoming data.</p>
3818<p class="code">
98d88c8d 3819http_status_t httpUpdate(<a href="#http_t">http_t</a> *http);</p>
798d6e29 3820<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3821<table class="list"><tbody>
3822<tr><th>http</th>
3823 <td class="description">HTTP connection</td></tr>
3824</tbody></table>
798d6e29
MS
3825<h4 class="returnvalue">Return Value</h4>
3826 <p class="description">HTTP status</p>
3827<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpWait">httpWait</a></h3>
3828 <p class="description">Wait for data available on a connection.</p>
3829<p class="code">
98d88c8d 3830int httpWait(<a href="#http_t">http_t</a> *http, int msec);</p>
798d6e29 3831<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3832<table class="list"><tbody>
3833<tr><th>http</th>
3834 <td class="description">HTTP connection</td></tr>
3835<tr><th>msec</th>
3836 <td class="description">Milliseconds to wait</td></tr>
3837</tbody></table>
798d6e29
MS
3838<h4 class="returnvalue">Return Value</h4>
3839 <p class="description">1 if data is available, 0 otherwise</p>
798d6e29
MS
3840<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpWrite2">httpWrite2</a></h3>
3841 <p class="description">Write data to a HTTP connection.</p>
3842<p class="code">
98d88c8d
MS
3843ssize_t httpWrite2(<a href="#http_t">http_t</a> *http, const char *buffer, size_t length);</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>buffer</th>
3849 <td class="description">Buffer for data</td></tr>
3850<tr><th>length</th>
3851 <td class="description">Number of bytes to write</td></tr>
3852</tbody></table>
798d6e29
MS
3853<h4 class="returnvalue">Return Value</h4>
3854 <p class="description">Number of bytes written</p>
3855<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpWriteResponse">httpWriteResponse</a></h3>
3856 <p class="description">Write a HTTP response to a client connection.</p>
3857<p class="code">
98d88c8d 3858int httpWriteResponse(<a href="#http_t">http_t</a> *http, http_status_t status);</p>
798d6e29 3859<h4 class="parameters">Parameters</h4>
98d88c8d
MS
3860<table class="list"><tbody>
3861<tr><th>http</th>
3862 <td class="description">HTTP connection</td></tr>
3863<tr><th>status</th>
3864 <td class="description">Status code</td></tr>
3865</tbody></table>
798d6e29
MS
3866<h4 class="returnvalue">Return Value</h4>
3867 <p class="description">0 on success, -1 on error</p>
3868<h3 class="function"><a id="ippAddBoolean">ippAddBoolean</a></h3>
3869 <p class="description">Add a boolean attribute to an IPP message.</p>
3870<p class="code">
98d88c8d
MS
3871<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>
3872<h4 class="parameters">Parameters</h4>
3873<table class="list"><tbody>
3874<tr><th>ipp</th>
3875 <td class="description">IPP message</td></tr>
3876<tr><th>group</th>
3877 <td class="description">IPP group</td></tr>
3878<tr><th>name</th>
3879 <td class="description">Name of attribute</td></tr>
3880<tr><th>value</th>
3881 <td class="description">Value of attribute</td></tr>
3882</tbody></table>
798d6e29
MS
3883<h4 class="returnvalue">Return Value</h4>
3884 <p class="description">New attribute</p>
3885<h4 class="discussion">Discussion</h4>
3886 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3887the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3888<br>
3889The <code>group</code> parameter specifies the IPP attribute group tag: none
3890(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3891event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3892(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3893(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
3894<h3 class="function"><a id="ippAddBooleans">ippAddBooleans</a></h3>
3895 <p class="description">Add an array of boolean values.</p>
3896<p class="code">
98d88c8d
MS
3897<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>
3898<h4 class="parameters">Parameters</h4>
3899<table class="list"><tbody>
3900<tr><th>ipp</th>
3901 <td class="description">IPP message</td></tr>
3902<tr><th>group</th>
3903 <td class="description">IPP group</td></tr>
3904<tr><th>name</th>
3905 <td class="description">Name of attribute</td></tr>
3906<tr><th>num_values</th>
3907 <td class="description">Number of values</td></tr>
3908<tr><th>values</th>
3909 <td class="description">Values</td></tr>
3910</tbody></table>
798d6e29
MS
3911<h4 class="returnvalue">Return Value</h4>
3912 <p class="description">New attribute</p>
3913<h4 class="discussion">Discussion</h4>
3914 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3915the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3916<br>
3917The <code>group</code> parameter specifies the IPP attribute group tag: none
3918(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3919event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3920(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3921(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
3922<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippAddCollection">ippAddCollection</a></h3>
3923 <p class="description">Add a collection value.</p>
3924<p class="code">
98d88c8d
MS
3925<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>
3926<h4 class="parameters">Parameters</h4>
3927<table class="list"><tbody>
3928<tr><th>ipp</th>
3929 <td class="description">IPP message</td></tr>
3930<tr><th>group</th>
3931 <td class="description">IPP group</td></tr>
3932<tr><th>name</th>
3933 <td class="description">Name of attribute</td></tr>
3934<tr><th>value</th>
3935 <td class="description">Value</td></tr>
3936</tbody></table>
798d6e29
MS
3937<h4 class="returnvalue">Return Value</h4>
3938 <p class="description">New attribute</p>
3939<h4 class="discussion">Discussion</h4>
3940 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3941the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3942<br>
3943The <code>group</code> parameter specifies the IPP attribute group tag: none
3944(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3945event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3946(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3947(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
3948
3949</p>
3950<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippAddCollections">ippAddCollections</a></h3>
3951 <p class="description">Add an array of collection values.</p>
3952<p class="code">
98d88c8d
MS
3953<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>
3954<h4 class="parameters">Parameters</h4>
3955<table class="list"><tbody>
3956<tr><th>ipp</th>
3957 <td class="description">IPP message</td></tr>
3958<tr><th>group</th>
3959 <td class="description">IPP group</td></tr>
3960<tr><th>name</th>
3961 <td class="description">Name of attribute</td></tr>
3962<tr><th>num_values</th>
3963 <td class="description">Number of values</td></tr>
3964<tr><th>values</th>
3965 <td class="description">Values</td></tr>
3966</tbody></table>
798d6e29
MS
3967<h4 class="returnvalue">Return Value</h4>
3968 <p class="description">New attribute</p>
3969<h4 class="discussion">Discussion</h4>
3970 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3971the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3972<br>
3973The <code>group</code> parameter specifies the IPP attribute group tag: none
3974(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3975event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3976(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3977(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
3978
3979</p>
3980<h3 class="function"><a id="ippAddDate">ippAddDate</a></h3>
65bebeac 3981 <p class="description">Add a dateTime attribute to an IPP message.</p>
798d6e29 3982<p class="code">
98d88c8d
MS
3983<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>
3984<h4 class="parameters">Parameters</h4>
3985<table class="list"><tbody>
3986<tr><th>ipp</th>
3987 <td class="description">IPP message</td></tr>
3988<tr><th>group</th>
3989 <td class="description">IPP group</td></tr>
3990<tr><th>name</th>
3991 <td class="description">Name of attribute</td></tr>
3992<tr><th>value</th>
3993 <td class="description">Value</td></tr>
3994</tbody></table>
798d6e29
MS
3995<h4 class="returnvalue">Return Value</h4>
3996 <p class="description">New attribute</p>
3997<h4 class="discussion">Discussion</h4>
3998 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3999the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4000<br>
4001The <code>group</code> parameter specifies the IPP attribute group tag: none
4002(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4003event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4004(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4005(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4006<h3 class="function"><a id="ippAddInteger">ippAddInteger</a></h3>
4007 <p class="description">Add a integer attribute to an IPP message.</p>
4008<p class="code">
98d88c8d
MS
4009<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>
4010<h4 class="parameters">Parameters</h4>
4011<table class="list"><tbody>
4012<tr><th>ipp</th>
4013 <td class="description">IPP message</td></tr>
4014<tr><th>group</th>
4015 <td class="description">IPP group</td></tr>
4016<tr><th>value_tag</th>
4017 <td class="description">Type of attribute</td></tr>
4018<tr><th>name</th>
4019 <td class="description">Name of attribute</td></tr>
4020<tr><th>value</th>
4021 <td class="description">Value of attribute</td></tr>
4022</tbody></table>
798d6e29
MS
4023<h4 class="returnvalue">Return Value</h4>
4024 <p class="description">New attribute</p>
4025<h4 class="discussion">Discussion</h4>
4026 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4027the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4028<br>
4029The <code>group</code> parameter specifies the IPP attribute group tag: none
4030(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4031event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4032(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4033(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4034<br>
4035Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
4036(<code>IPP_TAG_INTEGER</code>).</p>
4037<h3 class="function"><a id="ippAddIntegers">ippAddIntegers</a></h3>
4038 <p class="description">Add an array of integer values.</p>
4039<p class="code">
98d88c8d
MS
4040<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>
4041<h4 class="parameters">Parameters</h4>
4042<table class="list"><tbody>
4043<tr><th>ipp</th>
4044 <td class="description">IPP message</td></tr>
4045<tr><th>group</th>
4046 <td class="description">IPP group</td></tr>
4047<tr><th>value_tag</th>
4048 <td class="description">Type of attribute</td></tr>
4049<tr><th>name</th>
4050 <td class="description">Name of attribute</td></tr>
4051<tr><th>num_values</th>
4052 <td class="description">Number of values</td></tr>
4053<tr><th>values</th>
4054 <td class="description">Values</td></tr>
4055</tbody></table>
798d6e29
MS
4056<h4 class="returnvalue">Return Value</h4>
4057 <p class="description">New attribute</p>
4058<h4 class="discussion">Discussion</h4>
4059 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4060the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4061<br>
4062The <code>group</code> parameter specifies the IPP attribute group tag: none
4063(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4064event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4065(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4066(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4067<br>
4068Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
4069(<code>IPP_TAG_INTEGER</code>).</p>
4070<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippAddOctetString">ippAddOctetString</a></h3>
4071 <p class="description">Add an octetString value to an IPP message.</p>
4072<p class="code">
98d88c8d
MS
4073<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>
4074<h4 class="parameters">Parameters</h4>
4075<table class="list"><tbody>
4076<tr><th>ipp</th>
4077 <td class="description">IPP message</td></tr>
4078<tr><th>group</th>
4079 <td class="description">IPP group</td></tr>
4080<tr><th>name</th>
4081 <td class="description">Name of attribute</td></tr>
4082<tr><th>data</th>
4083 <td class="description">octetString data</td></tr>
4084<tr><th>datalen</th>
4085 <td class="description">Length of data in bytes</td></tr>
4086</tbody></table>
798d6e29
MS
4087<h4 class="returnvalue">Return Value</h4>
4088 <p class="description">New attribute</p>
4089<h4 class="discussion">Discussion</h4>
4090 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4091the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4092<br>
4093The <code>group</code> parameter specifies the IPP attribute group tag: none
4094(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4095event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4096(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4097(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
4098
4099</p>
4100<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippAddOutOfBand">ippAddOutOfBand</a></h3>
4101 <p class="description">Add an out-of-band value to an IPP message.</p>
4102<p class="code">
98d88c8d
MS
4103<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>
4104<h4 class="parameters">Parameters</h4>
4105<table class="list"><tbody>
4106<tr><th>ipp</th>
4107 <td class="description">IPP message</td></tr>
4108<tr><th>group</th>
4109 <td class="description">IPP group</td></tr>
4110<tr><th>value_tag</th>
4111 <td class="description">Type of attribute</td></tr>
4112<tr><th>name</th>
4113 <td class="description">Name of attribute</td></tr>
4114</tbody></table>
798d6e29
MS
4115<h4 class="returnvalue">Return Value</h4>
4116 <p class="description">New attribute</p>
4117<h4 class="discussion">Discussion</h4>
4118 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4119the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4120<br>
4121The <code>group</code> parameter specifies the IPP attribute group tag: none
4122(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4123event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4124(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4125(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4126<br>
4127Supported out-of-band values include unsupported-value
4128(<code>IPP_TAG_UNSUPPORTED_VALUE</code>), default (<code>IPP_TAG_DEFAULT</code>), unknown
4129(<code>IPP_TAG_UNKNOWN</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable
4130(<code>IPP_TAG_NOTSETTABLE</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), and
4131admin-define (<code>IPP_TAG_ADMINDEFINE</code>).
4132
4133</p>
4134<h3 class="function"><a id="ippAddRange">ippAddRange</a></h3>
4135 <p class="description">Add a range of values to an IPP message.</p>
4136<p class="code">
98d88c8d
MS
4137<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>
4138<h4 class="parameters">Parameters</h4>
4139<table class="list"><tbody>
4140<tr><th>ipp</th>
4141 <td class="description">IPP message</td></tr>
4142<tr><th>group</th>
4143 <td class="description">IPP group</td></tr>
4144<tr><th>name</th>
4145 <td class="description">Name of attribute</td></tr>
4146<tr><th>lower</th>
4147 <td class="description">Lower value</td></tr>
4148<tr><th>upper</th>
4149 <td class="description">Upper value</td></tr>
4150</tbody></table>
798d6e29
MS
4151<h4 class="returnvalue">Return Value</h4>
4152 <p class="description">New attribute</p>
4153<h4 class="discussion">Discussion</h4>
4154 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4155the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4156<br>
4157The <code>group</code> parameter specifies the IPP attribute group tag: none
4158(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4159event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4160(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4161(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4162<br>
4163The <code>lower</code> parameter must be less than or equal to the <code>upper</code> parameter.</p>
4164<h3 class="function"><a id="ippAddRanges">ippAddRanges</a></h3>
4165 <p class="description">Add ranges of values to an IPP message.</p>
4166<p class="code">
98d88c8d
MS
4167<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>
4168<h4 class="parameters">Parameters</h4>
4169<table class="list"><tbody>
4170<tr><th>ipp</th>
4171 <td class="description">IPP message</td></tr>
4172<tr><th>group</th>
4173 <td class="description">IPP group</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>lower</th>
4179 <td class="description">Lower values</td></tr>
4180<tr><th>upper</th>
4181 <td class="description">Upper values</td></tr>
4182</tbody></table>
798d6e29
MS
4183<h4 class="returnvalue">Return Value</h4>
4184 <p class="description">New attribute</p>
4185<h4 class="discussion">Discussion</h4>
4186 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4187the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4188<br>
4189The <code>group</code> parameter specifies the IPP attribute group tag: none
4190(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4191event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4192(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4193(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4194<h3 class="function"><a id="ippAddResolution">ippAddResolution</a></h3>
4195 <p class="description">Add a resolution value to an IPP message.</p>
4196<p class="code">
98d88c8d
MS
4197<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>
4198<h4 class="parameters">Parameters</h4>
4199<table class="list"><tbody>
4200<tr><th>ipp</th>
4201 <td class="description">IPP message</td></tr>
4202<tr><th>group</th>
4203 <td class="description">IPP group</td></tr>
4204<tr><th>name</th>
4205 <td class="description">Name of attribute</td></tr>
4206<tr><th>units</th>
4207 <td class="description">Units for resolution</td></tr>
4208<tr><th>xres</th>
4209 <td class="description">X resolution</td></tr>
4210<tr><th>yres</th>
4211 <td class="description">Y resolution</td></tr>
4212</tbody></table>
798d6e29
MS
4213<h4 class="returnvalue">Return Value</h4>
4214 <p class="description">New attribute</p>
4215<h4 class="discussion">Discussion</h4>
4216 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4217the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4218<br>
4219The <code>group</code> parameter specifies the IPP attribute group tag: none
4220(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4221event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4222(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4223(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4224<h3 class="function"><a id="ippAddResolutions">ippAddResolutions</a></h3>
4225 <p class="description">Add resolution values to an IPP message.</p>
4226<p class="code">
98d88c8d
MS
4227<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>
4228<h4 class="parameters">Parameters</h4>
4229<table class="list"><tbody>
4230<tr><th>ipp</th>
4231 <td class="description">IPP message</td></tr>
4232<tr><th>group</th>
4233 <td class="description">IPP group</td></tr>
4234<tr><th>name</th>
4235 <td class="description">Name of attribute</td></tr>
4236<tr><th>num_values</th>
4237 <td class="description">Number of values</td></tr>
4238<tr><th>units</th>
4239 <td class="description">Units for resolution</td></tr>
4240<tr><th>xres</th>
4241 <td class="description">X resolutions</td></tr>
4242<tr><th>yres</th>
4243 <td class="description">Y resolutions</td></tr>
4244</tbody></table>
798d6e29
MS
4245<h4 class="returnvalue">Return Value</h4>
4246 <p class="description">New attribute</p>
4247<h4 class="discussion">Discussion</h4>
4248 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4249the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4250<br>
4251The <code>group</code> parameter specifies the IPP attribute group tag: none
4252(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4253event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4254(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4255(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
4256<h3 class="function"><a id="ippAddSeparator">ippAddSeparator</a></h3>
4257 <p class="description">Add a group separator to an IPP message.</p>
4258<p class="code">
98d88c8d 4259<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddSeparator(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4260<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4261<table class="list"><tbody>
4262<tr><th>ipp</th>
4263 <td class="description">IPP message</td></tr>
4264</tbody></table>
798d6e29
MS
4265<h4 class="returnvalue">Return Value</h4>
4266 <p class="description">New attribute</p>
4267<h4 class="discussion">Discussion</h4>
4268 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4269the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.</p>
4270<h3 class="function"><a id="ippAddString">ippAddString</a></h3>
4271 <p class="description">Add a language-encoded string to an IPP message.</p>
4272<p class="code">
98d88c8d
MS
4273<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>
4274<h4 class="parameters">Parameters</h4>
4275<table class="list"><tbody>
4276<tr><th>ipp</th>
4277 <td class="description">IPP message</td></tr>
4278<tr><th>group</th>
4279 <td class="description">IPP group</td></tr>
4280<tr><th>value_tag</th>
4281 <td class="description">Type of attribute</td></tr>
4282<tr><th>name</th>
4283 <td class="description">Name of attribute</td></tr>
4284<tr><th>language</th>
4285 <td class="description">Language code</td></tr>
4286<tr><th>value</th>
4287 <td class="description">Value</td></tr>
4288</tbody></table>
798d6e29
MS
4289<h4 class="returnvalue">Return Value</h4>
4290 <p class="description">New attribute</p>
4291<h4 class="discussion">Discussion</h4>
4292 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4293the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4294<br>
4295The <code>group</code> parameter specifies the IPP attribute group tag: none
4296(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4297event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4298(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4299(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4300<br>
4301Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4302(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4303(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4304(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4305(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4306(<code>IPP_TAG_URISCHEME</code>).<br>
4307<br>
4308The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
4309textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
4310<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippAddStringf">ippAddStringf</a></h3>
4311 <p class="description">Add a formatted string to an IPP message.</p>
4312<p class="code">
98d88c8d
MS
4313<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>
4314<h4 class="parameters">Parameters</h4>
4315<table class="list"><tbody>
4316<tr><th>ipp</th>
4317 <td class="description">IPP message</td></tr>
4318<tr><th>group</th>
4319 <td class="description">IPP group</td></tr>
4320<tr><th>value_tag</th>
4321 <td class="description">Type of attribute</td></tr>
4322<tr><th>name</th>
4323 <td class="description">Name of attribute</td></tr>
4324<tr><th>language</th>
4325 <td class="description">Language code (<code>NULL</code> for default)</td></tr>
4326<tr><th>format</th>
4327 <td class="description">Printf-style format string</td></tr>
4328<tr><th>...</th>
4329 <td class="description">Additional arguments as needed</td></tr>
4330</tbody></table>
798d6e29
MS
4331<h4 class="returnvalue">Return Value</h4>
4332 <p class="description">New attribute</p>
4333<h4 class="discussion">Discussion</h4>
4334 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4335the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4336<br>
4337The <code>group</code> parameter specifies the IPP attribute group tag: none
4338(<code>IPP_TAG_ZERO</code>, for member attributes), document
4339(<code>IPP_TAG_DOCUMENT</code>), event notification
4340(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
4341printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
4342or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4343<br>
4344Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4345(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4346(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4347(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4348(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4349(<code>IPP_TAG_URISCHEME</code>).<br>
4350<br>
4351The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
4352and textWithLanguage string values and must be <code>NULL</code> for all other
4353string values.<br>
4354<br>
4355The <code>format</code> parameter uses formatting characters compatible with the
4356printf family of standard functions. Additional arguments follow it as
4357needed. The formatted string is truncated as needed to the maximum length of
4358the corresponding value type.
4359
4360</p>
4361<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippAddStringfv">ippAddStringfv</a></h3>
4362 <p class="description">Add a formatted string to an IPP message.</p>
4363<p class="code">
98d88c8d
MS
4364<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>
4365<h4 class="parameters">Parameters</h4>
4366<table class="list"><tbody>
4367<tr><th>ipp</th>
4368 <td class="description">IPP message</td></tr>
4369<tr><th>group</th>
4370 <td class="description">IPP group</td></tr>
4371<tr><th>value_tag</th>
4372 <td class="description">Type of attribute</td></tr>
4373<tr><th>name</th>
4374 <td class="description">Name of attribute</td></tr>
4375<tr><th>language</th>
4376 <td class="description">Language code (<code>NULL</code> for default)</td></tr>
4377<tr><th>format</th>
4378 <td class="description">Printf-style format string</td></tr>
4379<tr><th>ap</th>
4380 <td class="description">Additional arguments</td></tr>
4381</tbody></table>
798d6e29
MS
4382<h4 class="returnvalue">Return Value</h4>
4383 <p class="description">New attribute</p>
4384<h4 class="discussion">Discussion</h4>
4385 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4386the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4387<br>
4388The <code>group</code> parameter specifies the IPP attribute group tag: none
4389(<code>IPP_TAG_ZERO</code>, for member attributes), document
4390(<code>IPP_TAG_DOCUMENT</code>), event notification
4391(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
4392printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
4393or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4394<br>
4395Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4396(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4397(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4398(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4399(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4400(<code>IPP_TAG_URISCHEME</code>).<br>
4401<br>
4402The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
4403and textWithLanguage string values and must be <code>NULL</code> for all other
4404string values.<br>
4405<br>
4406The <code>format</code> parameter uses formatting characters compatible with the
4407printf family of standard functions. Additional arguments are passed in the
4408stdarg pointer <code>ap</code>. The formatted string is truncated as needed to the
4409maximum length of the corresponding value type.
4410
4411</p>
4412<h3 class="function"><a id="ippAddStrings">ippAddStrings</a></h3>
4413 <p class="description">Add language-encoded strings to an IPP message.</p>
4414<p class="code">
98d88c8d
MS
4415<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>
4416<h4 class="parameters">Parameters</h4>
4417<table class="list"><tbody>
4418<tr><th>ipp</th>
4419 <td class="description">IPP message</td></tr>
4420<tr><th>group</th>
4421 <td class="description">IPP group</td></tr>
4422<tr><th>value_tag</th>
4423 <td class="description">Type of attribute</td></tr>
4424<tr><th>name</th>
4425 <td class="description">Name of attribute</td></tr>
4426<tr><th>num_values</th>
4427 <td class="description">Number of values</td></tr>
4428<tr><th>language</th>
4429 <td class="description">Language code (<code>NULL</code> for default)</td></tr>
4430<tr><th>values</th>
4431 <td class="description">Values</td></tr>
4432</tbody></table>
798d6e29
MS
4433<h4 class="returnvalue">Return Value</h4>
4434 <p class="description">New attribute</p>
4435<h4 class="discussion">Discussion</h4>
4436 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4437the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
4438<br>
4439The <code>group</code> parameter specifies the IPP attribute group tag: none
4440(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4441event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4442(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4443(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4444<br>
4445Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4446(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4447(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4448(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4449(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4450(<code>IPP_TAG_URISCHEME</code>).<br>
4451<br>
4452The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
4453textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
4454<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippAttributeString">ippAttributeString</a></h3>
4455 <p class="description">Convert the attribute's value to a string.</p>
4456<p class="code">
98d88c8d
MS
4457size_t ippAttributeString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, char *buffer, size_t bufsize);</p>
4458<h4 class="parameters">Parameters</h4>
4459<table class="list"><tbody>
4460<tr><th>attr</th>
4461 <td class="description">Attribute</td></tr>
4462<tr><th>buffer</th>
4463 <td class="description">String buffer or NULL</td></tr>
4464<tr><th>bufsize</th>
4465 <td class="description">Size of string buffer</td></tr>
4466</tbody></table>
798d6e29
MS
4467<h4 class="returnvalue">Return Value</h4>
4468 <p class="description">Number of bytes less nul</p>
4469<h4 class="discussion">Discussion</h4>
4470 <p class="discussion">Returns the number of bytes that would be written, not including the
4471trailing nul. The buffer pointer can be NULL to get the required length,
4472just like (v)snprintf.
4473
4474</p>
4475<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippContainsInteger">ippContainsInteger</a></h3>
4476 <p class="description">Determine whether an attribute contains the
4477specified value or is within the list of ranges.</p>
4478<p class="code">
98d88c8d 4479int ippContainsInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int value);</p>
798d6e29 4480<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4481<table class="list"><tbody>
4482<tr><th>attr</th>
4483 <td class="description">Attribute</td></tr>
4484<tr><th>value</th>
4485 <td class="description">Integer/enum value</td></tr>
4486</tbody></table>
798d6e29
MS
4487<h4 class="returnvalue">Return Value</h4>
4488 <p class="description">1 on a match, 0 on no match</p>
4489<h4 class="discussion">Discussion</h4>
4490 <p class="discussion">Returns non-zero when the attribute contains either a matching integer or
4491enum value, or the value falls within one of the rangeOfInteger values for
4492the attribute.
4493
4494</p>
4495<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippContainsString">ippContainsString</a></h3>
4496 <p class="description">Determine whether an attribute contains the
4497specified string value.</p>
4498<p class="code">
98d88c8d 4499int ippContainsString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, const char *value);</p>
798d6e29 4500<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4501<table class="list"><tbody>
4502<tr><th>attr</th>
4503 <td class="description">Attribute</td></tr>
4504<tr><th>value</th>
4505 <td class="description">String value</td></tr>
4506</tbody></table>
798d6e29
MS
4507<h4 class="returnvalue">Return Value</h4>
4508 <p class="description">1 on a match, 0 on no match</p>
4509<h4 class="discussion">Discussion</h4>
4510 <p class="discussion">Returns non-zero when the attribute contains a matching charset, keyword,
65bebeac 4511naturalLanguage, mimeMediaType, name, text, uri, or uriScheme value.
798d6e29
MS
4512
4513</p>
4514<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippCopyAttribute">ippCopyAttribute</a></h3>
4515 <p class="description">Copy an attribute.</p>
4516<p class="code">
98d88c8d
MS
4517<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>
4518<h4 class="parameters">Parameters</h4>
4519<table class="list"><tbody>
4520<tr><th>dst</th>
4521 <td class="description">Destination IPP message</td></tr>
4522<tr><th>srcattr</th>
4523 <td class="description">Attribute to copy</td></tr>
4524<tr><th>quickcopy</th>
4525 <td class="description">1 for a referenced copy, 0 for normal</td></tr>
4526</tbody></table>
798d6e29
MS
4527<h4 class="returnvalue">Return Value</h4>
4528 <p class="description">New attribute</p>
4529<h4 class="discussion">Discussion</h4>
4530 <p class="discussion">The specified attribute, <code>attr</code>, is copied to the destination IPP message.
4531When <code>quickcopy</code> is non-zero, a &quot;shallow&quot; reference copy of the attribute is
4532created - this should only be done as long as the original source IPP message will
4533not be freed for the life of the destination.
4534
4535</p>
4536<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippCopyAttributes">ippCopyAttributes</a></h3>
4537 <p class="description">Copy attributes from one IPP message to another.</p>
4538<p class="code">
98d88c8d
MS
4539int 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>
4540<h4 class="parameters">Parameters</h4>
4541<table class="list"><tbody>
4542<tr><th>dst</th>
4543 <td class="description">Destination IPP message</td></tr>
4544<tr><th>src</th>
4545 <td class="description">Source IPP message</td></tr>
4546<tr><th>quickcopy</th>
4547 <td class="description">1 for a referenced copy, 0 for normal</td></tr>
4548<tr><th>cb</th>
4549 <td class="description">Copy callback or <code>NULL</code> for none</td></tr>
4550<tr><th>context</th>
4551 <td class="description">Context pointer</td></tr>
4552</tbody></table>
798d6e29
MS
4553<h4 class="returnvalue">Return Value</h4>
4554 <p class="description">1 on success, 0 on error</p>
4555<h4 class="discussion">Discussion</h4>
4556 <p class="discussion">Zero or more attributes are copied from the source IPP message, <code>src</code>, to the
4557destination IPP message, <code>dst</code>. When <code>quickcopy</code> is non-zero, a &quot;shallow&quot;
4558reference copy of the attribute is created - this should only be done as long as the
4559original source IPP message will not be freed for the life of the destination.<br>
4560<br>
4561The <code>cb</code> and <code>context</code> parameters provide a generic way to &quot;filter&quot; the
4562attributes that are copied - the function must return 1 to copy the attribute or
45630 to skip it. The function may also choose to do a partial copy of the source attribute
4564itself.
4565
4566</p>
4567<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippCreateRequestedArray">ippCreateRequestedArray</a></h3>
4568 <p class="description">Create a CUPS array of attribute names from the
4569given requested-attributes attribute.</p>
4570<p class="code">
98d88c8d 4571cups_array_t *ippCreateRequestedArray(<a href="#ipp_t">ipp_t</a> *request);</p>
798d6e29 4572<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4573<table class="list"><tbody>
4574<tr><th>request</th>
4575 <td class="description">IPP request</td></tr>
4576</tbody></table>
798d6e29
MS
4577<h4 class="returnvalue">Return Value</h4>
4578 <p class="description">CUPS array or <code>NULL</code> if all</p>
4579<h4 class="discussion">Discussion</h4>
4580 <p class="discussion">This function creates a (sorted) CUPS array of attribute names matching the
4581list of &quot;requested-attribute&quot; values supplied in an IPP request. All IANA-
4582registered values are supported in addition to the CUPS IPP extension
4583attributes.<br>
4584<br>
4585The <code>request</code> parameter specifies the request message that was read from
4586the client.
4587
4588<code>NULL</code> is returned if all attributes should be returned. Otherwise, the
4589result is a sorted array of attribute names, where <code>cupsArrayFind(array,
4590"attribute-name")</code> will return a non-NULL pointer. The array must be freed
4591using the <code>cupsArrayDelete</code> function.
4592
4593</p>
4594<h3 class="function"><a id="ippDateToTime">ippDateToTime</a></h3>
65bebeac
MS
4595 <p class="description">Convert from RFC 2579 Date/Time format to time in
4596seconds.</p>
798d6e29 4597<p class="code">
98d88c8d 4598time_t ippDateToTime(const <a href="#ipp_uchar_t">ipp_uchar_t</a> *date);</p>
798d6e29 4599<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4600<table class="list"><tbody>
4601<tr><th>date</th>
65bebeac 4602 <td class="description">RFC 2579 date info</td></tr>
98d88c8d 4603</tbody></table>
798d6e29
MS
4604<h4 class="returnvalue">Return Value</h4>
4605 <p class="description">UNIX time value</p>
4606<h3 class="function"><a id="ippDelete">ippDelete</a></h3>
98d88c8d 4607 <p class="description">Delete an IPP message.</p>
798d6e29 4608<p class="code">
98d88c8d 4609void ippDelete(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4610<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4611<table class="list"><tbody>
4612<tr><th>ipp</th>
4613 <td class="description">IPP message</td></tr>
4614</tbody></table>
4615<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippDeleteAttribute">ippDeleteAttribute</a></h3>
53af7f21 4616 <p class="description">Delete a single attribute in an IPP message.</p>
98d88c8d
MS
4617<p class="code">
4618void ippDeleteAttribute(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
4619<h4 class="parameters">Parameters</h4>
4620<table class="list"><tbody>
4621<tr><th>ipp</th>
4622 <td class="description">IPP message</td></tr>
4623<tr><th>attr</th>
4624 <td class="description">Attribute to delete</td></tr>
4625</tbody></table>
798d6e29
MS
4626<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippDeleteValues">ippDeleteValues</a></h3>
4627 <p class="description">Delete values in an attribute.</p>
4628<p class="code">
98d88c8d
MS
4629int ippDeleteValues(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int count);</p>
4630<h4 class="parameters">Parameters</h4>
4631<table class="list"><tbody>
4632<tr><th>ipp</th>
4633 <td class="description">IPP message</td></tr>
4634<tr><th>attr</th>
4635 <td class="description">Attribute</td></tr>
4636<tr><th>element</th>
4637 <td class="description">Index of first value to delete (0-based)</td></tr>
4638<tr><th>count</th>
4639 <td class="description">Number of values to delete</td></tr>
4640</tbody></table>
798d6e29
MS
4641<h4 class="returnvalue">Return Value</h4>
4642 <p class="description">1 on success, 0 on failure</p>
4643<h4 class="discussion">Discussion</h4>
4644 <p class="discussion">The <code>element</code> parameter specifies the first value to delete, starting at
46450. It must be less than the number of values returned by <a href="#ippGetCount"><code>ippGetCount</code></a>.<br>
4646<br>
4647The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4648<br>
4649Deleting all values in an attribute deletes the attribute.
4650
4651</p>
4652<h3 class="function"><a id="ippEnumString">ippEnumString</a></h3>
4653 <p class="description">Return a string corresponding to the enum value.</p>
4654<p class="code">
98d88c8d 4655const char *ippEnumString(const char *attrname, int enumvalue);</p>
798d6e29 4656<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4657<table class="list"><tbody>
4658<tr><th>attrname</th>
4659 <td class="description">Attribute name</td></tr>
4660<tr><th>enumvalue</th>
4661 <td class="description">Enum value</td></tr>
4662</tbody></table>
798d6e29
MS
4663<h4 class="returnvalue">Return Value</h4>
4664 <p class="description">Enum string</p>
4665<h3 class="function"><a id="ippEnumValue">ippEnumValue</a></h3>
4666 <p class="description">Return the value associated with a given enum string.</p>
4667<p class="code">
98d88c8d 4668int ippEnumValue(const char *attrname, const char *enumstring);</p>
798d6e29 4669<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4670<table class="list"><tbody>
4671<tr><th>attrname</th>
4672 <td class="description">Attribute name</td></tr>
4673<tr><th>enumstring</th>
4674 <td class="description">Enum string</td></tr>
4675</tbody></table>
798d6e29
MS
4676<h4 class="returnvalue">Return Value</h4>
4677 <p class="description">Enum value or -1 if unknown</p>
4678<h3 class="function"><a id="ippErrorString">ippErrorString</a></h3>
4679 <p class="description">Return a name for the given status code.</p>
4680<p class="code">
98d88c8d 4681const char *ippErrorString(ipp_status_t error);</p>
798d6e29 4682<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4683<table class="list"><tbody>
4684<tr><th>error</th>
4685 <td class="description">Error status</td></tr>
4686</tbody></table>
798d6e29
MS
4687<h4 class="returnvalue">Return Value</h4>
4688 <p class="description">Text string</p>
4689<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippErrorValue">ippErrorValue</a></h3>
4690 <p class="description">Return a status code for the given name.</p>
4691<p class="code">
98d88c8d 4692ipp_status_t ippErrorValue(const char *name);</p>
798d6e29 4693<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4694<table class="list"><tbody>
4695<tr><th>name</th>
4696 <td class="description">Name</td></tr>
4697</tbody></table>
798d6e29
MS
4698<h4 class="returnvalue">Return Value</h4>
4699 <p class="description">IPP status code</p>
4700<h3 class="function"><a id="ippFindAttribute">ippFindAttribute</a></h3>
4701 <p class="description">Find a named attribute in a request.</p>
4702<p class="code">
98d88c8d
MS
4703<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>
4704<h4 class="parameters">Parameters</h4>
4705<table class="list"><tbody>
4706<tr><th>ipp</th>
4707 <td class="description">IPP message</td></tr>
4708<tr><th>name</th>
4709 <td class="description">Name of attribute</td></tr>
4710<tr><th>type</th>
4711 <td class="description">Type of attribute</td></tr>
4712</tbody></table>
798d6e29
MS
4713<h4 class="returnvalue">Return Value</h4>
4714 <p class="description">Matching attribute</p>
4715<h4 class="discussion">Discussion</h4>
4716 <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
4717of attribute and member names separated by slashes, for example
4718&quot;media-col/media-size&quot;.</p>
4719<h3 class="function"><a id="ippFindNextAttribute">ippFindNextAttribute</a></h3>
4720 <p class="description">Find the next named attribute in a request.</p>
4721<p class="code">
98d88c8d
MS
4722<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>
4723<h4 class="parameters">Parameters</h4>
4724<table class="list"><tbody>
4725<tr><th>ipp</th>
4726 <td class="description">IPP message</td></tr>
4727<tr><th>name</th>
4728 <td class="description">Name of attribute</td></tr>
4729<tr><th>type</th>
4730 <td class="description">Type of attribute</td></tr>
4731</tbody></table>
798d6e29
MS
4732<h4 class="returnvalue">Return Value</h4>
4733 <p class="description">Matching attribute</p>
4734<h4 class="discussion">Discussion</h4>
4735 <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
4736of attribute and member names separated by slashes, for example
4737&quot;media-col/media-size&quot;.</p>
4738<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippFirstAttribute">ippFirstAttribute</a></h3>
4739 <p class="description">Return the first attribute in the message.</p>
4740<p class="code">
98d88c8d 4741<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFirstAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4742<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4743<table class="list"><tbody>
4744<tr><th>ipp</th>
4745 <td class="description">IPP message</td></tr>
4746</tbody></table>
798d6e29
MS
4747<h4 class="returnvalue">Return Value</h4>
4748 <p class="description">First attribute or <code>NULL</code> if none</p>
4749<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetBoolean">ippGetBoolean</a></h3>
4750 <p class="description">Get a boolean value for an attribute.</p>
4751<p class="code">
98d88c8d 4752int ippGetBoolean(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
798d6e29 4753<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4754<table class="list"><tbody>
4755<tr><th>attr</th>
4756 <td class="description">IPP attribute</td></tr>
4757<tr><th>element</th>
4758 <td class="description">Value number (0-based)</td></tr>
4759</tbody></table>
798d6e29
MS
4760<h4 class="returnvalue">Return Value</h4>
4761 <p class="description">Boolean value or 0 on error</p>
4762<h4 class="discussion">Discussion</h4>
4763 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4764<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4765
4766</p>
4767<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetCollection">ippGetCollection</a></h3>
4768 <p class="description">Get a collection value for an attribute.</p>
4769<p class="code">
98d88c8d 4770<a href="#ipp_t">ipp_t</a> *ippGetCollection(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
798d6e29 4771<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4772<table class="list"><tbody>
4773<tr><th>attr</th>
4774 <td class="description">IPP attribute</td></tr>
4775<tr><th>element</th>
4776 <td class="description">Value number (0-based)</td></tr>
4777</tbody></table>
798d6e29
MS
4778<h4 class="returnvalue">Return Value</h4>
4779 <p class="description">Collection value or <code>NULL</code> on error</p>
4780<h4 class="discussion">Discussion</h4>
4781 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4782<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4783
4784</p>
4785<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetCount">ippGetCount</a></h3>
4786 <p class="description">Get the number of values in an attribute.</p>
4787<p class="code">
98d88c8d 4788int ippGetCount(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 4789<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4790<table class="list"><tbody>
4791<tr><th>attr</th>
4792 <td class="description">IPP attribute</td></tr>
4793</tbody></table>
798d6e29
MS
4794<h4 class="returnvalue">Return Value</h4>
4795 <p class="description">Number of values or 0 on error</p>
4796<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetDate">ippGetDate</a></h3>
65bebeac 4797 <p class="description">Get a dateTime value for an attribute.</p>
798d6e29 4798<p class="code">
98d88c8d 4799const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippGetDate(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
798d6e29 4800<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4801<table class="list"><tbody>
4802<tr><th>attr</th>
4803 <td class="description">IPP attribute</td></tr>
4804<tr><th>element</th>
4805 <td class="description">Value number (0-based)</td></tr>
4806</tbody></table>
798d6e29 4807<h4 class="returnvalue">Return Value</h4>
65bebeac 4808 <p class="description">dateTime value or <code>NULL</code></p>
798d6e29
MS
4809<h4 class="discussion">Discussion</h4>
4810 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4811<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4812
4813</p>
4814<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetGroupTag">ippGetGroupTag</a></h3>
4815 <p class="description">Get the group associated with an attribute.</p>
4816<p class="code">
98d88c8d 4817ipp_tag_t ippGetGroupTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 4818<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4819<table class="list"><tbody>
4820<tr><th>attr</th>
4821 <td class="description">IPP attribute</td></tr>
4822</tbody></table>
798d6e29
MS
4823<h4 class="returnvalue">Return Value</h4>
4824 <p class="description">Group tag or <code>IPP_TAG_ZERO</code> on error</p>
4825<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetInteger">ippGetInteger</a></h3>
4826 <p class="description">Get the integer/enum value for an attribute.</p>
4827<p class="code">
98d88c8d 4828int ippGetInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
798d6e29 4829<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4830<table class="list"><tbody>
4831<tr><th>attr</th>
4832 <td class="description">IPP attribute</td></tr>
4833<tr><th>element</th>
4834 <td class="description">Value number (0-based)</td></tr>
4835</tbody></table>
798d6e29
MS
4836<h4 class="returnvalue">Return Value</h4>
4837 <p class="description">Value or 0 on error</p>
4838<h4 class="discussion">Discussion</h4>
4839 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4840<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4841
4842</p>
4843<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetName">ippGetName</a></h3>
4844 <p class="description">Get the attribute name.</p>
4845<p class="code">
98d88c8d 4846const char *ippGetName(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 4847<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4848<table class="list"><tbody>
4849<tr><th>attr</th>
4850 <td class="description">IPP attribute</td></tr>
4851</tbody></table>
798d6e29
MS
4852<h4 class="returnvalue">Return Value</h4>
4853 <p class="description">Attribute name or <code>NULL</code> for separators</p>
4854<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippGetOctetString">ippGetOctetString</a></h3>
4855 <p class="description">Get an octetString value from an IPP attribute.</p>
4856<p class="code">
98d88c8d
MS
4857void *ippGetOctetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *datalen);</p>
4858<h4 class="parameters">Parameters</h4>
4859<table class="list"><tbody>
4860<tr><th>attr</th>
4861 <td class="description">IPP attribute</td></tr>
4862<tr><th>element</th>
4863 <td class="description">Value number (0-based)</td></tr>
4864<tr><th>datalen</th>
4865 <td class="description">Length of octetString data</td></tr>
4866</tbody></table>
798d6e29
MS
4867<h4 class="returnvalue">Return Value</h4>
4868 <p class="description">Pointer to octetString data</p>
4869<h4 class="discussion">Discussion</h4>
4870 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4871<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4872
4873</p>
4874<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetOperation">ippGetOperation</a></h3>
4875 <p class="description">Get the operation ID in an IPP message.</p>
4876<p class="code">
98d88c8d 4877ipp_op_t ippGetOperation(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4878<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4879<table class="list"><tbody>
4880<tr><th>ipp</th>
4881 <td class="description">IPP request message</td></tr>
4882</tbody></table>
798d6e29
MS
4883<h4 class="returnvalue">Return Value</h4>
4884 <p class="description">Operation ID or 0 on error</p>
4885<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetRange">ippGetRange</a></h3>
4886 <p class="description">Get a rangeOfInteger value from an attribute.</p>
4887<p class="code">
98d88c8d
MS
4888int ippGetRange(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *uppervalue);</p>
4889<h4 class="parameters">Parameters</h4>
4890<table class="list"><tbody>
4891<tr><th>attr</th>
4892 <td class="description">IPP attribute</td></tr>
4893<tr><th>element</th>
4894 <td class="description">Value number (0-based)</td></tr>
4895<tr><th>uppervalue</th>
4896 <td class="description">Upper value of range</td></tr>
4897</tbody></table>
798d6e29
MS
4898<h4 class="returnvalue">Return Value</h4>
4899 <p class="description">Lower value of range or 0</p>
4900<h4 class="discussion">Discussion</h4>
4901 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4902<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4903
4904</p>
4905<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetRequestId">ippGetRequestId</a></h3>
4906 <p class="description">Get the request ID from an IPP message.</p>
4907<p class="code">
98d88c8d 4908int ippGetRequestId(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4909<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4910<table class="list"><tbody>
4911<tr><th>ipp</th>
4912 <td class="description">IPP message</td></tr>
4913</tbody></table>
798d6e29
MS
4914<h4 class="returnvalue">Return Value</h4>
4915 <p class="description">Request ID or 0 on error</p>
4916<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetResolution">ippGetResolution</a></h3>
4917 <p class="description">Get a resolution value for an attribute.</p>
4918<p class="code">
98d88c8d
MS
4919int 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>
4920<h4 class="parameters">Parameters</h4>
4921<table class="list"><tbody>
4922<tr><th>attr</th>
4923 <td class="description">IPP attribute</td></tr>
4924<tr><th>element</th>
4925 <td class="description">Value number (0-based)</td></tr>
4926<tr><th>yres</th>
4927 <td class="description">Vertical/feed resolution</td></tr>
4928<tr><th>units</th>
4929 <td class="description">Units for resolution</td></tr>
4930</tbody></table>
798d6e29
MS
4931<h4 class="returnvalue">Return Value</h4>
4932 <p class="description">Horizontal/cross feed resolution or 0</p>
4933<h4 class="discussion">Discussion</h4>
4934 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4935<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4936
4937</p>
4938<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetState">ippGetState</a></h3>
4939 <p class="description">Get the IPP message state.</p>
4940<p class="code">
98d88c8d 4941<a href="#ipp_state_t">ipp_state_t</a> ippGetState(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4942<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4943<table class="list"><tbody>
4944<tr><th>ipp</th>
4945 <td class="description">IPP message</td></tr>
4946</tbody></table>
798d6e29
MS
4947<h4 class="returnvalue">Return Value</h4>
4948 <p class="description">IPP message state value</p>
4949<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetStatusCode">ippGetStatusCode</a></h3>
4950 <p class="description">Get the status code from an IPP response or event message.</p>
4951<p class="code">
98d88c8d 4952ipp_status_t ippGetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 4953<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4954<table class="list"><tbody>
4955<tr><th>ipp</th>
4956 <td class="description">IPP response or event message</td></tr>
4957</tbody></table>
798d6e29
MS
4958<h4 class="returnvalue">Return Value</h4>
4959 <p class="description">Status code in IPP message</p>
4960<h3 class="function"><a id="ippGetString">ippGetString</a></h3>
98d88c8d
MS
4961 <p class="description"></p>
4962<p class="code">
4963const char *ippGetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, const char **language);</p>
4964<h4 class="parameters">Parameters</h4>
4965<table class="list"><tbody>
4966<tr><th>attr</th>
4967 <td class="description">IPP attribute</td></tr>
4968<tr><th>element</th>
4969 <td class="description">Value number (0-based)</td></tr>
4970<tr><th>language</th>
4971 <td class="description">Language code (<code>NULL</code> for don't care)</td></tr>
4972</tbody></table>
798d6e29
MS
4973<h4 class="returnvalue">Return Value</h4>
4974 <p class="description">Get the string and optionally the language code for an attribute.</p>
4975 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
65bebeac 4976<code>ippGetCount(attr)</code> - 1.
798d6e29
MS
4977
4978</p>
4979<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetValueTag">ippGetValueTag</a></h3>
4980 <p class="description">Get the value tag for an attribute.</p>
4981<p class="code">
98d88c8d 4982ipp_tag_t ippGetValueTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 4983<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4984<table class="list"><tbody>
4985<tr><th>attr</th>
4986 <td class="description">IPP attribute</td></tr>
4987</tbody></table>
798d6e29
MS
4988<h4 class="returnvalue">Return Value</h4>
4989 <p class="description">Value tag or <code>IPP_TAG_ZERO</code> on error</p>
4990<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetVersion">ippGetVersion</a></h3>
4991 <p class="description">Get the major and minor version number from an IPP message.</p>
4992<p class="code">
98d88c8d 4993int ippGetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int *minor);</p>
798d6e29 4994<h4 class="parameters">Parameters</h4>
98d88c8d
MS
4995<table class="list"><tbody>
4996<tr><th>ipp</th>
4997 <td class="description">IPP message</td></tr>
4998<tr><th>minor</th>
65bebeac 4999 <td class="description">Minor version number or <code>NULL</code> for don't care</td></tr>
98d88c8d 5000</tbody></table>
798d6e29
MS
5001<h4 class="returnvalue">Return Value</h4>
5002 <p class="description">Major version number or 0 on error</p>
5003<h3 class="function"><a id="ippLength">ippLength</a></h3>
5004 <p class="description">Compute the length of an IPP message.</p>
5005<p class="code">
98d88c8d 5006size_t ippLength(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5007<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5008<table class="list"><tbody>
5009<tr><th>ipp</th>
5010 <td class="description">IPP message</td></tr>
5011</tbody></table>
798d6e29
MS
5012<h4 class="returnvalue">Return Value</h4>
5013 <p class="description">Size of IPP message</p>
5014<h3 class="function"><a id="ippNew">ippNew</a></h3>
5015 <p class="description">Allocate a new IPP message.</p>
5016<p class="code">
98d88c8d 5017<a href="#ipp_t">ipp_t</a> *ippNew(void);</p>
798d6e29
MS
5018<h4 class="returnvalue">Return Value</h4>
5019 <p class="description">New IPP message</p>
5020<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippNewRequest">ippNewRequest</a></h3>
5021 <p class="description">Allocate a new IPP request message.</p>
5022<p class="code">
98d88c8d 5023<a href="#ipp_t">ipp_t</a> *ippNewRequest(ipp_op_t op);</p>
798d6e29 5024<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5025<table class="list"><tbody>
5026<tr><th>op</th>
5027 <td class="description">Operation code</td></tr>
5028</tbody></table>
798d6e29
MS
5029<h4 class="returnvalue">Return Value</h4>
5030 <p class="description">IPP request message</p>
5031<h4 class="discussion">Discussion</h4>
65bebeac
MS
5032 <p class="discussion">The new request message is initialized with the &quot;attributes-charset&quot; and
5033&quot;attributes-natural-language&quot; attributes added. The
5034&quot;attributes-natural-language&quot; value is derived from the current locale.
798d6e29
MS
5035
5036</p>
5037<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippNewResponse">ippNewResponse</a></h3>
5038 <p class="description">Allocate a new IPP response message.</p>
5039<p class="code">
98d88c8d 5040<a href="#ipp_t">ipp_t</a> *ippNewResponse(<a href="#ipp_t">ipp_t</a> *request);</p>
798d6e29 5041<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5042<table class="list"><tbody>
5043<tr><th>request</th>
5044 <td class="description">IPP request message</td></tr>
5045</tbody></table>
798d6e29
MS
5046<h4 class="returnvalue">Return Value</h4>
5047 <p class="description">IPP response message</p>
5048<h4 class="discussion">Discussion</h4>
65bebeac
MS
5049 <p class="discussion">The new response message is initialized with the same &quot;version-number&quot;,
5050&quot;request-id&quot;, &quot;attributes-charset&quot;, and &quot;attributes-natural-language&quot; as the
5051provided request message. If the &quot;attributes-charset&quot; or
5052&quot;attributes-natural-language&quot; attributes are missing from the request,
5053'utf-8' and a value derived from the current locale are substituted,
798d6e29
MS
5054respectively.
5055
5056</p>
5057<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippNextAttribute">ippNextAttribute</a></h3>
5058 <p class="description">Return the next attribute in the message.</p>
5059<p class="code">
98d88c8d 5060<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippNextAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5061<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5062<table class="list"><tbody>
5063<tr><th>ipp</th>
5064 <td class="description">IPP message</td></tr>
5065</tbody></table>
798d6e29
MS
5066<h4 class="returnvalue">Return Value</h4>
5067 <p class="description">Next attribute or <code>NULL</code> if none</p>
5068<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippOpString">ippOpString</a></h3>
5069 <p class="description">Return a name for the given operation id.</p>
5070<p class="code">
98d88c8d 5071const char *ippOpString(ipp_op_t op);</p>
798d6e29 5072<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5073<table class="list"><tbody>
5074<tr><th>op</th>
5075 <td class="description">Operation ID</td></tr>
5076</tbody></table>
798d6e29
MS
5077<h4 class="returnvalue">Return Value</h4>
5078 <p class="description">Name</p>
5079<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippOpValue">ippOpValue</a></h3>
5080 <p class="description">Return an operation id for the given name.</p>
5081<p class="code">
98d88c8d 5082ipp_op_t ippOpValue(const char *name);</p>
798d6e29 5083<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5084<table class="list"><tbody>
5085<tr><th>name</th>
5086 <td class="description">Textual name</td></tr>
5087</tbody></table>
798d6e29
MS
5088<h4 class="returnvalue">Return Value</h4>
5089 <p class="description">Operation ID</p>
5090<h3 class="function"><a id="ippPort">ippPort</a></h3>
5091 <p class="description">Return the default IPP port number.</p>
5092<p class="code">
98d88c8d 5093int ippPort(void);</p>
798d6e29
MS
5094<h4 class="returnvalue">Return Value</h4>
5095 <p class="description">Port number</p>
5096<h3 class="function"><a id="ippRead">ippRead</a></h3>
5097 <p class="description">Read data for an IPP message from a HTTP connection.</p>
5098<p class="code">
98d88c8d 5099<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 5100<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5101<table class="list"><tbody>
5102<tr><th>http</th>
5103 <td class="description">HTTP connection</td></tr>
5104<tr><th>ipp</th>
5105 <td class="description">IPP data</td></tr>
5106</tbody></table>
798d6e29
MS
5107<h4 class="returnvalue">Return Value</h4>
5108 <p class="description">Current state</p>
5109<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippReadFile">ippReadFile</a></h3>
5110 <p class="description">Read data for an IPP message from a file.</p>
5111<p class="code">
98d88c8d 5112<a href="#ipp_state_t">ipp_state_t</a> ippReadFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5113<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5114<table class="list"><tbody>
5115<tr><th>fd</th>
5116 <td class="description">HTTP data</td></tr>
5117<tr><th>ipp</th>
5118 <td class="description">IPP data</td></tr>
5119</tbody></table>
798d6e29
MS
5120<h4 class="returnvalue">Return Value</h4>
5121 <p class="description">Current state</p>
5122<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippReadIO">ippReadIO</a></h3>
5123 <p class="description">Read data for an IPP message.</p>
5124<p class="code">
98d88c8d
MS
5125<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>
5126<h4 class="parameters">Parameters</h4>
5127<table class="list"><tbody>
5128<tr><th>src</th>
5129 <td class="description">Data source</td></tr>
5130<tr><th>cb</th>
5131 <td class="description">Read callback function</td></tr>
5132<tr><th>blocking</th>
5133 <td class="description">Use blocking IO?</td></tr>
5134<tr><th>parent</th>
5135 <td class="description">Parent request, if any</td></tr>
5136<tr><th>ipp</th>
5137 <td class="description">IPP data</td></tr>
5138</tbody></table>
798d6e29
MS
5139<h4 class="returnvalue">Return Value</h4>
5140 <p class="description">Current state</p>
5141<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetBoolean">ippSetBoolean</a></h3>
5142 <p class="description">Set a boolean value in an attribute.</p>
5143<p class="code">
98d88c8d
MS
5144int ippSetBoolean(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int boolvalue);</p>
5145<h4 class="parameters">Parameters</h4>
5146<table class="list"><tbody>
5147<tr><th>ipp</th>
5148 <td class="description">IPP message</td></tr>
5149<tr><th>attr</th>
5150 <td class="description">IPP attribute</td></tr>
5151<tr><th>element</th>
5152 <td class="description">Value number (0-based)</td></tr>
5153<tr><th>boolvalue</th>
5154 <td class="description">Boolean value</td></tr>
5155</tbody></table>
798d6e29
MS
5156<h4 class="returnvalue">Return Value</h4>
5157 <p class="description">1 on success, 0 on failure</p>
5158<h4 class="discussion">Discussion</h4>
5159 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5160the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5161<br>
5162The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5163<br>
5164The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5165<code>ippGetCount(attr)</code>.
798d6e29
MS
5166
5167</p>
5168<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetCollection">ippSetCollection</a></h3>
5169 <p class="description">Set a collection value in an attribute.</p>
5170<p class="code">
98d88c8d
MS
5171int 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>
5172<h4 class="parameters">Parameters</h4>
5173<table class="list"><tbody>
5174<tr><th>ipp</th>
5175 <td class="description">IPP message</td></tr>
5176<tr><th>attr</th>
5177 <td class="description">IPP attribute</td></tr>
5178<tr><th>element</th>
5179 <td class="description">Value number (0-based)</td></tr>
5180<tr><th>colvalue</th>
5181 <td class="description">Collection value</td></tr>
5182</tbody></table>
798d6e29
MS
5183<h4 class="returnvalue">Return Value</h4>
5184 <p class="description">1 on success, 0 on failure</p>
5185<h4 class="discussion">Discussion</h4>
5186 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5187the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5188<br>
5189The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5190<br>
5191The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5192<code>ippGetCount(attr)</code>.
798d6e29
MS
5193
5194</p>
5195<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetDate">ippSetDate</a></h3>
65bebeac 5196 <p class="description">Set a dateTime value in an attribute.</p>
798d6e29 5197<p class="code">
98d88c8d
MS
5198int 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>
5199<h4 class="parameters">Parameters</h4>
5200<table class="list"><tbody>
5201<tr><th>ipp</th>
5202 <td class="description">IPP message</td></tr>
5203<tr><th>attr</th>
5204 <td class="description">IPP attribute</td></tr>
5205<tr><th>element</th>
5206 <td class="description">Value number (0-based)</td></tr>
5207<tr><th>datevalue</th>
65bebeac 5208 <td class="description">dateTime value</td></tr>
98d88c8d 5209</tbody></table>
798d6e29
MS
5210<h4 class="returnvalue">Return Value</h4>
5211 <p class="description">1 on success, 0 on failure</p>
5212<h4 class="discussion">Discussion</h4>
5213 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5214the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5215<br>
5216The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5217<br>
5218The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5219<code>ippGetCount(attr)</code>.
798d6e29
MS
5220
5221</p>
5222<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetGroupTag">ippSetGroupTag</a></h3>
5223 <p class="description">Set the group tag of an attribute.</p>
5224<p class="code">
98d88c8d
MS
5225int 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>
5226<h4 class="parameters">Parameters</h4>
5227<table class="list"><tbody>
5228<tr><th>ipp</th>
5229 <td class="description">IPP message</td></tr>
5230<tr><th>attr</th>
5231 <td class="description">Attribute</td></tr>
5232<tr><th>group_tag</th>
5233 <td class="description">Group tag</td></tr>
5234</tbody></table>
798d6e29
MS
5235<h4 class="returnvalue">Return Value</h4>
5236 <p class="description">1 on success, 0 on failure</p>
5237<h4 class="discussion">Discussion</h4>
5238 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5239the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5240<br>
5241The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5242<br>
5243The <code>group</code> parameter specifies the IPP attribute group tag: none
5244(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
5245event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
5246(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
5247(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
5248
5249</p>
5250<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetInteger">ippSetInteger</a></h3>
5251 <p class="description">Set an integer or enum value in an attribute.</p>
5252<p class="code">
98d88c8d
MS
5253int ippSetInteger(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int intvalue);</p>
5254<h4 class="parameters">Parameters</h4>
5255<table class="list"><tbody>
5256<tr><th>ipp</th>
5257 <td class="description">IPP message</td></tr>
5258<tr><th>attr</th>
5259 <td class="description">IPP attribute</td></tr>
5260<tr><th>element</th>
5261 <td class="description">Value number (0-based)</td></tr>
5262<tr><th>intvalue</th>
5263 <td class="description">Integer/enum value</td></tr>
5264</tbody></table>
798d6e29
MS
5265<h4 class="returnvalue">Return Value</h4>
5266 <p class="description">1 on success, 0 on failure</p>
5267<h4 class="discussion">Discussion</h4>
5268 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5269the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5270<br>
5271The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5272<br>
5273The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5274<code>ippGetCount(attr)</code>.
798d6e29
MS
5275
5276</p>
5277<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetName">ippSetName</a></h3>
5278 <p class="description">Set the name of an attribute.</p>
5279<p class="code">
98d88c8d
MS
5280int ippSetName(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, const char *name);</p>
5281<h4 class="parameters">Parameters</h4>
5282<table class="list"><tbody>
5283<tr><th>ipp</th>
5284 <td class="description">IPP message</td></tr>
5285<tr><th>attr</th>
5286 <td class="description">IPP attribute</td></tr>
5287<tr><th>name</th>
5288 <td class="description">Attribute name</td></tr>
5289</tbody></table>
798d6e29
MS
5290<h4 class="returnvalue">Return Value</h4>
5291 <p class="description">1 on success, 0 on failure</p>
5292<h4 class="discussion">Discussion</h4>
5293 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5294the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5295<br>
5296The <code>attr</code> parameter may be modified as a result of setting the value.
5297
5298</p>
5299<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetOctetString">ippSetOctetString</a></h3>
5300 <p class="description">Set an octetString value in an IPP attribute.</p>
5301<p class="code">
98d88c8d
MS
5302int 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>
5303<h4 class="parameters">Parameters</h4>
5304<table class="list"><tbody>
5305<tr><th>ipp</th>
5306 <td class="description">IPP message</td></tr>
5307<tr><th>attr</th>
5308 <td class="description">IPP attribute</td></tr>
5309<tr><th>element</th>
5310 <td class="description">Value number (0-based)</td></tr>
5311<tr><th>data</th>
5312 <td class="description">Pointer to octetString data</td></tr>
5313<tr><th>datalen</th>
5314 <td class="description">Length of octetString data</td></tr>
5315</tbody></table>
798d6e29
MS
5316<h4 class="returnvalue">Return Value</h4>
5317 <p class="description">1 on success, 0 on failure</p>
5318<h4 class="discussion">Discussion</h4>
5319 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5320the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5321<br>
5322The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5323<br>
5324The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5325<code>ippGetCount(attr)</code>.
798d6e29
MS
5326
5327</p>
5328<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetOperation">ippSetOperation</a></h3>
5329 <p class="description">Set the operation ID in an IPP request message.</p>
5330<p class="code">
98d88c8d 5331int ippSetOperation(<a href="#ipp_t">ipp_t</a> *ipp, ipp_op_t op);</p>
798d6e29 5332<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5333<table class="list"><tbody>
5334<tr><th>ipp</th>
5335 <td class="description">IPP request message</td></tr>
5336<tr><th>op</th>
5337 <td class="description">Operation ID</td></tr>
5338</tbody></table>
798d6e29
MS
5339<h4 class="returnvalue">Return Value</h4>
5340 <p class="description">1 on success, 0 on failure</p>
5341<h4 class="discussion">Discussion</h4>
5342 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5343the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
5344
5345</p>
5346<h3 class="function"><a id="ippSetPort">ippSetPort</a></h3>
98d88c8d 5347 <p class="description">Set the default port number.</p>
798d6e29 5348<p class="code">
98d88c8d 5349void ippSetPort(int p);</p>
798d6e29 5350<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5351<table class="list"><tbody>
5352<tr><th>p</th>
5353 <td class="description">Port number to use</td></tr>
5354</tbody></table>
798d6e29
MS
5355<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetRange">ippSetRange</a></h3>
5356 <p class="description">Set a rangeOfInteger value in an attribute.</p>
5357<p class="code">
98d88c8d
MS
5358int 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>
5359<h4 class="parameters">Parameters</h4>
5360<table class="list"><tbody>
5361<tr><th>ipp</th>
5362 <td class="description">IPP message</td></tr>
5363<tr><th>attr</th>
5364 <td class="description">IPP attribute</td></tr>
5365<tr><th>element</th>
5366 <td class="description">Value number (0-based)</td></tr>
5367<tr><th>lowervalue</th>
5368 <td class="description">Lower bound for range</td></tr>
5369<tr><th>uppervalue</th>
5370 <td class="description">Upper bound for range</td></tr>
5371</tbody></table>
798d6e29
MS
5372<h4 class="returnvalue">Return Value</h4>
5373 <p class="description">1 on success, 0 on failure</p>
5374<h4 class="discussion">Discussion</h4>
5375 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5376the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5377<br>
5378The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5379<br>
5380The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5381<code>ippGetCount(attr)</code>.
798d6e29
MS
5382
5383</p>
5384<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetRequestId">ippSetRequestId</a></h3>
5385 <p class="description">Set the request ID in an IPP message.</p>
5386<p class="code">
98d88c8d 5387int ippSetRequestId(<a href="#ipp_t">ipp_t</a> *ipp, int request_id);</p>
798d6e29 5388<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5389<table class="list"><tbody>
5390<tr><th>ipp</th>
5391 <td class="description">IPP message</td></tr>
5392<tr><th>request_id</th>
5393 <td class="description">Request ID</td></tr>
5394</tbody></table>
798d6e29
MS
5395<h4 class="returnvalue">Return Value</h4>
5396 <p class="description">1 on success, 0 on failure</p>
5397<h4 class="discussion">Discussion</h4>
5398 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5399the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5400<br>
5401The <code>request_id</code> parameter must be greater than 0.
5402
5403</p>
5404<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetResolution">ippSetResolution</a></h3>
5405 <p class="description">Set a resolution value in an attribute.</p>
5406<p class="code">
98d88c8d
MS
5407int 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>
5408<h4 class="parameters">Parameters</h4>
5409<table class="list"><tbody>
5410<tr><th>ipp</th>
5411 <td class="description">IPP message</td></tr>
5412<tr><th>attr</th>
5413 <td class="description">IPP attribute</td></tr>
5414<tr><th>element</th>
5415 <td class="description">Value number (0-based)</td></tr>
5416<tr><th>unitsvalue</th>
5417 <td class="description">Resolution units</td></tr>
5418<tr><th>xresvalue</th>
5419 <td class="description">Horizontal/cross feed resolution</td></tr>
5420<tr><th>yresvalue</th>
5421 <td class="description">Vertical/feed resolution</td></tr>
5422</tbody></table>
798d6e29
MS
5423<h4 class="returnvalue">Return Value</h4>
5424 <p class="description">1 on success, 0 on failure</p>
5425<h4 class="discussion">Discussion</h4>
5426 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5427the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5428<br>
5429The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5430<br>
5431The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5432<code>ippGetCount(attr)</code>.
798d6e29
MS
5433
5434</p>
5435<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetState">ippSetState</a></h3>
5436 <p class="description">Set the current state of the IPP message.</p>
5437<p class="code">
98d88c8d 5438int ippSetState(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_state_t">ipp_state_t</a> state);</p>
798d6e29 5439<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5440<table class="list"><tbody>
5441<tr><th>ipp</th>
5442 <td class="description">IPP message</td></tr>
5443<tr><th>state</th>
5444 <td class="description">IPP state value</td></tr>
5445</tbody></table>
798d6e29
MS
5446<h4 class="returnvalue">Return Value</h4>
5447 <p class="description">1 on success, 0 on failure</p>
5448<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetStatusCode">ippSetStatusCode</a></h3>
5449 <p class="description">Set the status code in an IPP response or event message.</p>
5450<p class="code">
98d88c8d 5451int ippSetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp, ipp_status_t status);</p>
798d6e29 5452<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5453<table class="list"><tbody>
5454<tr><th>ipp</th>
5455 <td class="description">IPP response or event message</td></tr>
5456<tr><th>status</th>
5457 <td class="description">Status code</td></tr>
5458</tbody></table>
798d6e29
MS
5459<h4 class="returnvalue">Return Value</h4>
5460 <p class="description">1 on success, 0 on failure</p>
5461<h4 class="discussion">Discussion</h4>
5462 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5463the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
5464
5465</p>
5466<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetString">ippSetString</a></h3>
5467 <p class="description">Set a string value in an attribute.</p>
5468<p class="code">
98d88c8d
MS
5469int 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>
5470<h4 class="parameters">Parameters</h4>
5471<table class="list"><tbody>
5472<tr><th>ipp</th>
5473 <td class="description">IPP message</td></tr>
5474<tr><th>attr</th>
5475 <td class="description">IPP attribute</td></tr>
5476<tr><th>element</th>
5477 <td class="description">Value number (0-based)</td></tr>
5478<tr><th>strvalue</th>
5479 <td class="description">String value</td></tr>
5480</tbody></table>
798d6e29
MS
5481<h4 class="returnvalue">Return Value</h4>
5482 <p class="description">1 on success, 0 on failure</p>
5483<h4 class="discussion">Discussion</h4>
5484 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5485the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5486<br>
5487The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5488<br>
5489The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5490<code>ippGetCount(attr)</code>.
798d6e29
MS
5491
5492</p>
5493<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetStringf">ippSetStringf</a></h3>
5494 <p class="description">Set a formatted string value of an attribute.</p>
5495<p class="code">
98d88c8d
MS
5496int 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>
5497<h4 class="parameters">Parameters</h4>
5498<table class="list"><tbody>
5499<tr><th>ipp</th>
5500 <td class="description">IPP message</td></tr>
5501<tr><th>attr</th>
5502 <td class="description">IPP attribute</td></tr>
5503<tr><th>element</th>
5504 <td class="description">Value number (0-based)</td></tr>
5505<tr><th>format</th>
5506 <td class="description">Printf-style format string</td></tr>
5507<tr><th>...</th>
5508 <td class="description">Additional arguments as needed</td></tr>
5509</tbody></table>
798d6e29
MS
5510<h4 class="returnvalue">Return Value</h4>
5511 <p class="description">1 on success, 0 on failure</p>
5512<h4 class="discussion">Discussion</h4>
5513 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5514the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5515<br>
5516The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5517<br>
5518The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5519<code>ippGetCount(attr)</code>.<br>
798d6e29
MS
5520<br>
5521The <code>format</code> parameter uses formatting characters compatible with the
5522printf family of standard functions. Additional arguments follow it as
5523needed. The formatted string is truncated as needed to the maximum length of
5524the corresponding value type.
5525
5526</p>
5527<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetStringfv">ippSetStringfv</a></h3>
5528 <p class="description">Set a formatted string value of an attribute.</p>
5529<p class="code">
98d88c8d
MS
5530int 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>
5531<h4 class="parameters">Parameters</h4>
5532<table class="list"><tbody>
5533<tr><th>ipp</th>
5534 <td class="description">IPP message</td></tr>
5535<tr><th>attr</th>
5536 <td class="description">IPP attribute</td></tr>
5537<tr><th>element</th>
5538 <td class="description">Value number (0-based)</td></tr>
5539<tr><th>format</th>
5540 <td class="description">Printf-style format string</td></tr>
5541<tr><th>ap</th>
5542 <td class="description">Pointer to additional arguments</td></tr>
5543</tbody></table>
798d6e29
MS
5544<h4 class="returnvalue">Return Value</h4>
5545 <p class="description">1 on success, 0 on failure</p>
5546<h4 class="discussion">Discussion</h4>
5547 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5548the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5549<br>
5550The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5551<br>
5552The <code>element</code> parameter specifies which value to set from 0 to
65bebeac 5553<code>ippGetCount(attr)</code>.<br>
798d6e29
MS
5554<br>
5555The <code>format</code> parameter uses formatting characters compatible with the
5556printf family of standard functions. Additional arguments follow it as
5557needed. The formatted string is truncated as needed to the maximum length of
5558the corresponding value type.
5559
5560</p>
5561<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetValueTag">ippSetValueTag</a></h3>
5562 <p class="description">Set the value tag of an attribute.</p>
5563<p class="code">
98d88c8d
MS
5564int 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>
5565<h4 class="parameters">Parameters</h4>
5566<table class="list"><tbody>
5567<tr><th>ipp</th>
5568 <td class="description">IPP message</td></tr>
5569<tr><th>attr</th>
5570 <td class="description">IPP attribute</td></tr>
5571<tr><th>value_tag</th>
5572 <td class="description">Value tag</td></tr>
5573</tbody></table>
798d6e29
MS
5574<h4 class="returnvalue">Return Value</h4>
5575 <p class="description">1 on success, 0 on failure</p>
5576<h4 class="discussion">Discussion</h4>
5577 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5578the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5579<br>
5580The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5581<br>
5582Integer (<code>IPP_TAG_INTEGER</code>) values can be promoted to rangeOfInteger
5583(<code>IPP_TAG_RANGE</code>) values, the various string tags can be promoted to name
5584(<code>IPP_TAG_NAME</code>) or nameWithLanguage (<code>IPP_TAG_NAMELANG</code>) values, text
5585(<code>IPP_TAG_TEXT</code>) values can be promoted to textWithLanguage
5586(<code>IPP_TAG_TEXTLANG</code>) values, and all values can be demoted to the various
5587out-of-band value tags such as no-value (<code>IPP_TAG_NOVALUE</code>). All other changes
5588will be rejected.<br>
5589<br>
5590Promoting a string attribute to nameWithLanguage or textWithLanguage adds the language
5591code in the &quot;attributes-natural-language&quot; attribute or, if not present, the language
5592code for the current locale.
5593
5594</p>
5595<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetVersion">ippSetVersion</a></h3>
5596 <p class="description">Set the version number in an IPP message.</p>
5597<p class="code">
98d88c8d
MS
5598int ippSetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int major, int minor);</p>
5599<h4 class="parameters">Parameters</h4>
5600<table class="list"><tbody>
5601<tr><th>ipp</th>
5602 <td class="description">IPP message</td></tr>
5603<tr><th>major</th>
5604 <td class="description">Major version number (major.minor)</td></tr>
5605<tr><th>minor</th>
5606 <td class="description">Minor version number (major.minor)</td></tr>
5607</tbody></table>
798d6e29
MS
5608<h4 class="returnvalue">Return Value</h4>
5609 <p class="description">1 on success, 0 on failure</p>
5610<h4 class="discussion">Discussion</h4>
5611 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5612the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5613<br>
5614The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2.
5615
5616</p>
5617<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="ippStateString">ippStateString</a></h3>
5618 <p class="description">Return the name corresponding to a state value.</p>
5619<p class="code">
98d88c8d 5620const char *ippStateString(<a href="#ipp_state_t">ipp_state_t</a> state);</p>
798d6e29 5621<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5622<table class="list"><tbody>
5623<tr><th>state</th>
5624 <td class="description">State value</td></tr>
5625</tbody></table>
798d6e29
MS
5626<h4 class="returnvalue">Return Value</h4>
5627 <p class="description">State name</p>
5628<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="ippTagString">ippTagString</a></h3>
5629 <p class="description">Return the tag name corresponding to a tag value.</p>
5630<p class="code">
98d88c8d 5631const char *ippTagString(ipp_tag_t tag);</p>
798d6e29 5632<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5633<table class="list"><tbody>
5634<tr><th>tag</th>
5635 <td class="description">Tag value</td></tr>
5636</tbody></table>
798d6e29
MS
5637<h4 class="returnvalue">Return Value</h4>
5638 <p class="description">Tag name</p>
5639<h4 class="discussion">Discussion</h4>
65bebeac 5640 <p class="discussion">The returned names are defined in RFC 8011 and the IANA IPP Registry.
798d6e29
MS
5641
5642</p>
5643<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="ippTagValue">ippTagValue</a></h3>
5644 <p class="description">Return the tag value corresponding to a tag name.</p>
5645<p class="code">
98d88c8d 5646ipp_tag_t ippTagValue(const char *name);</p>
798d6e29 5647<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5648<table class="list"><tbody>
5649<tr><th>name</th>
5650 <td class="description">Tag name</td></tr>
5651</tbody></table>
798d6e29
MS
5652<h4 class="returnvalue">Return Value</h4>
5653 <p class="description">Tag value</p>
5654<h4 class="discussion">Discussion</h4>
65bebeac 5655 <p class="discussion">The tag names are defined in RFC 8011 and the IANA IPP Registry.
798d6e29
MS
5656
5657</p>
5658<h3 class="function"><a id="ippTimeToDate">ippTimeToDate</a></h3>
65bebeac 5659 <p class="description">Convert from time in seconds to RFC 2579 format.</p>
798d6e29 5660<p class="code">
98d88c8d 5661const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippTimeToDate(time_t t);</p>
798d6e29 5662<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5663<table class="list"><tbody>
5664<tr><th>t</th>
65bebeac 5665 <td class="description">Time in seconds</td></tr>
98d88c8d 5666</tbody></table>
798d6e29 5667<h4 class="returnvalue">Return Value</h4>
65bebeac 5668 <p class="description">RFC-2579 date/time data</p>
798d6e29
MS
5669<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippValidateAttribute">ippValidateAttribute</a></h3>
5670 <p class="description">Validate the contents of an attribute.</p>
5671<p class="code">
98d88c8d 5672int ippValidateAttribute(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
798d6e29 5673<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5674<table class="list"><tbody>
5675<tr><th>attr</th>
5676 <td class="description">Attribute</td></tr>
5677</tbody></table>
798d6e29
MS
5678<h4 class="returnvalue">Return Value</h4>
5679 <p class="description">1 if valid, 0 otherwise</p>
5680<h4 class="discussion">Discussion</h4>
5681 <p class="discussion">This function validates the contents of an attribute based on the name and
5682value tag. 1 is returned if the attribute is valid, 0 otherwise. On
65bebeac 5683failure, <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> is set to a human-readable message.
798d6e29
MS
5684
5685</p>
5686<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippValidateAttributes">ippValidateAttributes</a></h3>
5687 <p class="description">Validate all attributes in an IPP message.</p>
5688<p class="code">
98d88c8d 5689int ippValidateAttributes(<a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5690<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5691<table class="list"><tbody>
5692<tr><th>ipp</th>
5693 <td class="description">IPP message</td></tr>
5694</tbody></table>
798d6e29
MS
5695<h4 class="returnvalue">Return Value</h4>
5696 <p class="description">1 if valid, 0 otherwise</p>
5697<h4 class="discussion">Discussion</h4>
5698 <p class="discussion">This function validates the contents of the IPP message, including each
65bebeac
MS
5699attribute. Like <a href="#ippValidateAttribute"><code>ippValidateAttribute</code></a>, <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> is
5700set to a human-readable message on failure.
798d6e29
MS
5701
5702</p>
5703<h3 class="function"><a id="ippWrite">ippWrite</a></h3>
5704 <p class="description">Write data for an IPP message to a HTTP connection.</p>
5705<p class="code">
98d88c8d 5706<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 5707<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5708<table class="list"><tbody>
5709<tr><th>http</th>
5710 <td class="description">HTTP connection</td></tr>
5711<tr><th>ipp</th>
5712 <td class="description">IPP data</td></tr>
5713</tbody></table>
798d6e29
MS
5714<h4 class="returnvalue">Return Value</h4>
5715 <p class="description">Current state</p>
5716<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippWriteFile">ippWriteFile</a></h3>
5717 <p class="description">Write data for an IPP message to a file.</p>
5718<p class="code">
98d88c8d 5719<a href="#ipp_state_t">ipp_state_t</a> ippWriteFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p>
798d6e29 5720<h4 class="parameters">Parameters</h4>
98d88c8d
MS
5721<table class="list"><tbody>
5722<tr><th>fd</th>
5723 <td class="description">HTTP data</td></tr>
5724<tr><th>ipp</th>
5725 <td class="description">IPP data</td></tr>
5726</tbody></table>
798d6e29
MS
5727<h4 class="returnvalue">Return Value</h4>
5728 <p class="description">Current state</p>
5729<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippWriteIO">ippWriteIO</a></h3>
5730 <p class="description">Write data for an IPP message.</p>
5731<p class="code">
98d88c8d
MS
5732<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>
5733<h4 class="parameters">Parameters</h4>
5734<table class="list"><tbody>
5735<tr><th>dst</th>
5736 <td class="description">Destination</td></tr>
5737<tr><th>cb</th>
5738 <td class="description">Write callback function</td></tr>
5739<tr><th>blocking</th>
5740 <td class="description">Use blocking IO?</td></tr>
5741<tr><th>parent</th>
5742 <td class="description">Parent IPP message</td></tr>
5743<tr><th>ipp</th>
5744 <td class="description">IPP data</td></tr>
5745</tbody></table>
798d6e29
MS
5746<h4 class="returnvalue">Return Value</h4>
5747 <p class="description">Current state</p>
798d6e29 5748 <h2 class="title"><a id="TYPES">Data Types</a></h2>
798d6e29
MS
5749 <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>
5750 <p class="description">Client credentials callback
5751</p>
5752 <p class="code">
53af7f21 5753typedef int(*)(http_t *http, void *tls, cups_array_t *distinguished_names, void *user_data)cups_client_cert_cb_t;
798d6e29
MS
5754</p>
5755 <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>
5756 <p class="description">Destination enumeration callback
5757</p>
5758 <p class="code">
5759typedef int(*)(void *user_data, unsigned flags, <a href="#cups_dest_t">cups_dest_t</a> *dest)cups_dest_cb_t;
5760</p>
5761 <h3 class="typedef"><a id="cups_dest_t">cups_dest_t</a></h3>
5762 <p class="description">Destination</p>
5763 <p class="code">
5764typedef struct <a href="#cups_dest_s">cups_dest_s</a> cups_dest_t;
5765</p>
5766 <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>
5767 <p class="description">Destination capability and status
5768information </p>
5769 <p class="code">
5770typedef struct _cups_dinfo_s cups_dinfo_t;
798d6e29
MS
5771</p>
5772 <h3 class="typedef"><a id="cups_job_t">cups_job_t</a></h3>
5773 <p class="description">Job</p>
5774 <p class="code">
5775typedef struct <a href="#cups_job_s">cups_job_s</a> cups_job_t;
798d6e29
MS
5776</p>
5777 <h3 class="typedef"><a id="cups_option_t">cups_option_t</a></h3>
5778 <p class="description">Printer Options</p>
5779 <p class="code">
5780typedef struct <a href="#cups_option_s">cups_option_s</a> cups_option_t;
5781</p>
5782 <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>
5783 <p class="description">New password callback
5784</p>
5785 <p class="code">
5786typedef 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
5787</p>
5788 <h3 class="typedef"><a id="cups_ptype_t">cups_ptype_t</a></h3>
5789 <p class="description">Printer type/capability bits</p>
5790 <p class="code">
5791typedef unsigned cups_ptype_t;
5792</p>
5793 <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>
5794 <p class="description">Server credentials callback
5795</p>
5796 <p class="code">
53af7f21 5797typedef int(*)(http_t *http, void *tls, cups_array_t *certs, void *user_data)cups_server_cert_cb_t;
798d6e29
MS
5798</p>
5799 <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>
5800 <p class="description">Media Size </p>
5801 <p class="code">
5802typedef struct <a href="#cups_size_s">cups_size_s</a> cups_size_t;
798d6e29
MS
5803</p>
5804 <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>
5805 <p class="description">Socket address union, which
5806makes using IPv6 and other
5807address types easier and
5808more portable. </p>
5809 <p class="code">
5810typedef union _http_addr_u / http_addr_t;
798d6e29
MS
5811</p>
5812 <h3 class="typedef"><a id="http_encoding_t">http_encoding_t</a></h3>
5813 <p class="description">HTTP transfer encoding values</p>
5814 <p class="code">
5815typedef enum <a href="#http_encoding_e">http_encoding_e</a> http_encoding_t;
5816</p>
5817 <h3 class="typedef"><a id="http_encryption_t">http_encryption_t</a></h3>
5818 <p class="description">HTTP encryption values</p>
5819 <p class="code">
5820typedef enum <a href="#http_encryption_e">http_encryption_e</a> http_encryption_t;
5821</p>
5822 <h3 class="typedef"><a id="http_field_t">http_field_t</a></h3>
5823 <p class="description">HTTP field names</p>
5824 <p class="code">
5825typedef enum <a href="#http_field_e">http_field_e</a> http_field_t;
5826</p>
5827 <h3 class="typedef"><a id="http_keepalive_t">http_keepalive_t</a></h3>
5828 <p class="description">HTTP keep-alive values</p>
5829 <p class="code">
5830typedef enum <a href="#http_keepalive_e">http_keepalive_e</a> http_keepalive_t;
5831</p>
5832 <h3 class="typedef"><a id="http_state_t">http_state_t</a></h3>
5833 <p class="description">HTTP state values; states
5834are server-oriented...</p>
5835 <p class="code">
5836typedef enum <a href="#http_state_e">http_state_e</a> http_state_t;
5837</p>
5838 <h3 class="typedef"><a id="http_t">http_t</a></h3>
5839 <p class="description">HTTP connection type</p>
5840 <p class="code">
5841typedef struct _http_s http_t;
5842</p>
5843 <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>
5844 <p class="description">HTTP timeout callback </p>
5845 <p class="code">
5846typedef int(*)(http_t *http, void *user_data)http_timeout_cb_t;
5847</p>
5848 <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>
5849 <p class="description">Level of trust for credentials </p>
5850 <p class="code">
5851typedef enum <a href="#http_trust_e">http_trust_e</a> http_trust_t;
5852</p>
5853 <h3 class="typedef"><a id="http_uri_coding_t">http_uri_coding_t</a></h3>
5854 <p class="description">URI en/decode flags</p>
5855 <p class="code">
5856typedef enum <a href="#http_uri_coding_e">http_uri_coding_e</a> http_uri_coding_t;
5857</p>
5858 <h3 class="typedef"><a id="http_uri_status_t"><span class="info">&#160;CUPS 1.2&#160;</span>http_uri_status_t</a></h3>
5859 <p class="description">URI separation status </p>
5860 <p class="code">
5861typedef enum <a href="#http_uri_status_e">http_uri_status_e</a> http_uri_status_t;
798d6e29
MS
5862</p>
5863 <h3 class="typedef"><a id="ipp_attribute_t">ipp_attribute_t</a></h3>
5864 <p class="description">IPP attribute</p>
5865 <p class="code">
5866typedef struct _ipp_attribute_s ipp_attribute_t;
5867</p>
65bebeac
MS
5868 <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>
5869 <p class="description">ippCopyAttributes callback function </p>
798d6e29
MS
5870 <p class="code">
5871typedef 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
5872</p>
5873 <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 5874 <p class="description">ippReadIO/ippWriteIO callback function </p>
798d6e29 5875 <p class="code">
98d88c8d 5876typedef ssize_t(*)(void *context, ipp_uchar_t *buffer, size_t bytes) ipp_iocb_t;
798d6e29
MS
5877</p>
5878 <h3 class="typedef"><a id="ipp_orient_t">ipp_orient_t</a></h3>
5879 <p class="description">Orientation values</p>
5880 <p class="code">
5881typedef enum <a href="#ipp_orient_e">ipp_orient_e</a> ipp_orient_t;
5882</p>
5883 <h3 class="typedef"><a id="ipp_pstate_t">ipp_pstate_t</a></h3>
65bebeac 5884 <p class="description">Printer state values</p>
798d6e29
MS
5885 <p class="code">
5886typedef enum <a href="#ipp_pstate_e">ipp_pstate_e</a> ipp_pstate_t;
5887</p>
5888 <h3 class="typedef"><a id="ipp_quality_t">ipp_quality_t</a></h3>
65bebeac 5889 <p class="description">Print quality values</p>
798d6e29
MS
5890 <p class="code">
5891typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t;
5892</p>
5893 <h3 class="typedef"><a id="ipp_res_t">ipp_res_t</a></h3>
5894 <p class="description">Resolution units</p>
5895 <p class="code">
5896typedef enum <a href="#ipp_res_e">ipp_res_e</a> ipp_res_t;
5897</p>
5898 <h3 class="typedef"><a id="ipp_state_t">ipp_state_t</a></h3>
65bebeac 5899 <p class="description">ipp_t state values</p>
798d6e29
MS
5900 <p class="code">
5901typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t;
5902</p>
5903 <h3 class="typedef"><a id="ipp_t">ipp_t</a></h3>
5904 <p class="description">IPP request/response data</p>
5905 <p class="code">
5906typedef struct _ipp_s ipp_t;
798d6e29
MS
5907</p>
5908 <h2 class="title"><a id="STRUCTURES">Structures</a></h2>
798d6e29
MS
5909<h3 class="struct"><a id="cups_dest_s">cups_dest_s</a></h3>
5910 <p class="description">Destination</p>
5911<p class="code">struct cups_dest_s {<br>
5912&#160;&#160;&#160;&#160;char *name, *instance;<br>
5913&#160;&#160;&#160;&#160;int is_default;<br>
5914&#160;&#160;&#160;&#160;int num_options;<br>
5915&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options;<br>
5916};</p>
5917<h4 class="members">Members</h4>
98d88c8d
MS
5918<table class="list"><tbody>
5919<tr><th>instance </th>
5920 <td class="description">Local instance name or NULL</td></tr>
5921<tr><th>is_default </th>
5922 <td class="description">Is this printer the default?</td></tr>
5923<tr><th>num_options </th>
5924 <td class="description">Number of options</td></tr>
5925<tr><th>options </th>
5926 <td class="description">Options</td></tr>
5927</tbody></table>
798d6e29
MS
5928<h3 class="struct"><a id="cups_job_s">cups_job_s</a></h3>
5929 <p class="description">Job</p>
5930<p class="code">struct cups_job_s {<br>
5931&#160;&#160;&#160;&#160;time_t completed_time;<br>
5932&#160;&#160;&#160;&#160;time_t creation_time;<br>
5933&#160;&#160;&#160;&#160;char *dest;<br>
5934&#160;&#160;&#160;&#160;char *format;<br>
5935&#160;&#160;&#160;&#160;int id;<br>
5936&#160;&#160;&#160;&#160;int priority;<br>
5937&#160;&#160;&#160;&#160;time_t processing_time;<br>
5938&#160;&#160;&#160;&#160;int size;<br>
5939&#160;&#160;&#160;&#160;ipp_jstate_t state;<br>
5940&#160;&#160;&#160;&#160;char *title;<br>
5941&#160;&#160;&#160;&#160;char *user;<br>
5942};</p>
5943<h4 class="members">Members</h4>
98d88c8d
MS
5944<table class="list"><tbody>
5945<tr><th>completed_time </th>
5946 <td class="description">Time the job was completed</td></tr>
5947<tr><th>creation_time </th>
5948 <td class="description">Time the job was created</td></tr>
5949<tr><th>dest </th>
5950 <td class="description">Printer or class name</td></tr>
5951<tr><th>format </th>
5952 <td class="description">Document format</td></tr>
5953<tr><th>id </th>
5954 <td class="description">The job ID</td></tr>
5955<tr><th>priority </th>
5956 <td class="description">Priority (1-100)</td></tr>
5957<tr><th>processing_time </th>
5958 <td class="description">Time the job was processed</td></tr>
5959<tr><th>size </th>
5960 <td class="description">Size in kilobytes</td></tr>
5961<tr><th>state </th>
5962 <td class="description">Job state</td></tr>
5963<tr><th>title </th>
5964 <td class="description">Title/job name</td></tr>
5965<tr><th>user </th>
5966 <td class="description">User that submitted the job</td></tr>
5967</tbody></table>
798d6e29
MS
5968<h3 class="struct"><a id="cups_option_s">cups_option_s</a></h3>
5969 <p class="description">Printer Options</p>
5970<p class="code">struct cups_option_s {<br>
5971&#160;&#160;&#160;&#160;char *name;<br>
5972&#160;&#160;&#160;&#160;char *value;<br>
5973};</p>
5974<h4 class="members">Members</h4>
98d88c8d
MS
5975<table class="list"><tbody>
5976<tr><th>name </th>
5977 <td class="description">Name of option</td></tr>
5978<tr><th>value </th>
5979 <td class="description">Value of option</td></tr>
5980</tbody></table>
798d6e29
MS
5981<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>
5982 <p class="description">Media Size </p>
5983<p class="code">struct cups_size_s {<br>
5984&#160;&#160;&#160;&#160;char media[128];<br>
5985&#160;&#160;&#160;&#160;int width, length, bottom, left, right, top;<br>
5986};</p>
5987<h4 class="members">Members</h4>
98d88c8d
MS
5988<table class="list"><tbody>
5989<tr><th>media[128] </th>
5990 <td class="description">Media name to use</td></tr>
5991<tr><th>top </th>
5992 <td class="description">Top margin in hundredths of
5993millimeters</td></tr>
5994</tbody></table>
798d6e29 5995 <h2 class="title"><a id="ENUMERATIONS">Constants</a></h2>
798d6e29
MS
5996 <h3 class="enumeration"><a id="cups_ptype_e">cups_ptype_e</a></h3>
5997 <p class="description">Printer type/capability bit
5998constants</p>
5999 <h4 class="constants">Constants</h4>
98d88c8d
MS
6000 <table class="list"><tbody>
6001 <tr><th>CUPS_PRINTER_AUTHENTICATED <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></th> <td class="description">Printer requires authentication
6002</td></tr>
6003 <tr><th>CUPS_PRINTER_BIND </th> <td class="description">Can bind output</td></tr>
6004 <tr><th>CUPS_PRINTER_BW </th> <td class="description">Can do B&amp;W printing</td></tr>
6005 <tr><th>CUPS_PRINTER_CLASS </th> <td class="description">Printer class</td></tr>
6006 <tr><th>CUPS_PRINTER_COLLATE </th> <td class="description">Can quickly collate copies</td></tr>
6007 <tr><th>CUPS_PRINTER_COLOR </th> <td class="description">Can do color printing</td></tr>
6008 <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
6009</td></tr>
6010 <tr><th>CUPS_PRINTER_COPIES </th> <td class="description">Can do copies in hardware</td></tr>
6011 <tr><th>CUPS_PRINTER_COVER </th> <td class="description">Can cover output</td></tr>
6012 <tr><th>CUPS_PRINTER_DEFAULT </th> <td class="description">Default printer on network</td></tr>
6013 <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>
6014 <tr><th>CUPS_PRINTER_DUPLEX </th> <td class="description">Can do two-sided printing</td></tr>
6015 <tr><th>CUPS_PRINTER_FAX </th> <td class="description">Fax queue</td></tr>
6016 <tr><th>CUPS_PRINTER_LARGE </th> <td class="description">Can print on D/E/A1/A0-size media</td></tr>
6017 <tr><th>CUPS_PRINTER_LOCAL </th> <td class="description">Local printer or class</td></tr>
6018 <tr><th>CUPS_PRINTER_MEDIUM </th> <td class="description">Can print on Tabloid/B/C/A3/A2-size media</td></tr>
6019 <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
6020</td></tr>
6021 <tr><th>CUPS_PRINTER_PUNCH </th> <td class="description">Can punch output</td></tr>
6022 <tr><th>CUPS_PRINTER_REJECTING </th> <td class="description">Printer is rejecting jobs</td></tr>
6023 <tr><th>CUPS_PRINTER_REMOTE </th> <td class="description">Remote printer or class</td></tr>
6024 <tr><th>CUPS_PRINTER_SMALL </th> <td class="description">Can print on Letter/Legal/A4-size media</td></tr>
6025 <tr><th>CUPS_PRINTER_SORT </th> <td class="description">Can sort output</td></tr>
6026 <tr><th>CUPS_PRINTER_STAPLE </th> <td class="description">Can staple output</td></tr>
6027 <tr><th>CUPS_PRINTER_VARIABLE </th> <td class="description">Can print on rolls and custom-size media</td></tr>
6028</tbody></table>
798d6e29
MS
6029 <h3 class="enumeration"><a id="http_encoding_e">http_encoding_e</a></h3>
6030 <p class="description">HTTP transfer encoding values</p>
6031 <h4 class="constants">Constants</h4>
98d88c8d
MS
6032 <table class="list"><tbody>
6033 <tr><th>HTTP_ENCODING_CHUNKED </th> <td class="description">Data is chunked</td></tr>
6034 <tr><th>HTTP_ENCODING_FIELDS </th> <td class="description">Sending HTTP fields</td></tr>
6035 <tr><th>HTTP_ENCODING_LENGTH </th> <td class="description">Data is sent with Content-Length</td></tr>
6036</tbody></table>
798d6e29
MS
6037 <h3 class="enumeration"><a id="http_encryption_e">http_encryption_e</a></h3>
6038 <p class="description">HTTP encryption values</p>
6039 <h4 class="constants">Constants</h4>
98d88c8d
MS
6040 <table class="list"><tbody>
6041 <tr><th>HTTP_ENCRYPTION_ALWAYS </th> <td class="description">Always encrypt (SSL)</td></tr>
6042 <tr><th>HTTP_ENCRYPTION_IF_REQUESTED </th> <td class="description">Encrypt if requested (TLS upgrade)</td></tr>
6043 <tr><th>HTTP_ENCRYPTION_NEVER </th> <td class="description">Never encrypt</td></tr>
6044 <tr><th>HTTP_ENCRYPTION_REQUIRED </th> <td class="description">Encryption is required (TLS upgrade)</td></tr>
6045</tbody></table>
798d6e29
MS
6046 <h3 class="enumeration"><a id="http_field_e">http_field_e</a></h3>
6047 <p class="description">HTTP field names</p>
6048 <h4 class="constants">Constants</h4>
98d88c8d
MS
6049 <table class="list"><tbody>
6050 <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>
6051 <tr><th>HTTP_FIELD_ACCEPT_LANGUAGE </th> <td class="description">Accept-Language field</td></tr>
6052 <tr><th>HTTP_FIELD_ACCEPT_RANGES </th> <td class="description">Accept-Ranges field</td></tr>
6053 <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>
6054 <tr><th>HTTP_FIELD_AUTHORIZATION </th> <td class="description">Authorization field</td></tr>
6055 <tr><th>HTTP_FIELD_CONNECTION </th> <td class="description">Connection field</td></tr>
6056 <tr><th>HTTP_FIELD_CONTENT_ENCODING </th> <td class="description">Content-Encoding field</td></tr>
6057 <tr><th>HTTP_FIELD_CONTENT_LANGUAGE </th> <td class="description">Content-Language field</td></tr>
6058 <tr><th>HTTP_FIELD_CONTENT_LENGTH </th> <td class="description">Content-Length field</td></tr>
6059 <tr><th>HTTP_FIELD_CONTENT_LOCATION </th> <td class="description">Content-Location field</td></tr>
6060 <tr><th>HTTP_FIELD_CONTENT_MD5 </th> <td class="description">Content-MD5 field</td></tr>
6061 <tr><th>HTTP_FIELD_CONTENT_RANGE </th> <td class="description">Content-Range field</td></tr>
6062 <tr><th>HTTP_FIELD_CONTENT_TYPE </th> <td class="description">Content-Type field</td></tr>
6063 <tr><th>HTTP_FIELD_CONTENT_VERSION </th> <td class="description">Content-Version field</td></tr>
6064 <tr><th>HTTP_FIELD_DATE </th> <td class="description">Date field</td></tr>
6065 <tr><th>HTTP_FIELD_HOST </th> <td class="description">Host field</td></tr>
6066 <tr><th>HTTP_FIELD_IF_MODIFIED_SINCE </th> <td class="description">If-Modified-Since field</td></tr>
6067 <tr><th>HTTP_FIELD_IF_UNMODIFIED_SINCE </th> <td class="description">If-Unmodified-Since field</td></tr>
6068 <tr><th>HTTP_FIELD_KEEP_ALIVE </th> <td class="description">Keep-Alive field</td></tr>
6069 <tr><th>HTTP_FIELD_LAST_MODIFIED </th> <td class="description">Last-Modified field</td></tr>
6070 <tr><th>HTTP_FIELD_LINK </th> <td class="description">Link field</td></tr>
6071 <tr><th>HTTP_FIELD_LOCATION </th> <td class="description">Location field</td></tr>
6072 <tr><th>HTTP_FIELD_MAX </th> <td class="description">Maximum field index</td></tr>
6073 <tr><th>HTTP_FIELD_RANGE </th> <td class="description">Range field</td></tr>
6074 <tr><th>HTTP_FIELD_REFERER </th> <td class="description">Referer field</td></tr>
6075 <tr><th>HTTP_FIELD_RETRY_AFTER </th> <td class="description">Retry-After field</td></tr>
6076 <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>
6077 <tr><th>HTTP_FIELD_TRANSFER_ENCODING </th> <td class="description">Transfer-Encoding field</td></tr>
6078 <tr><th>HTTP_FIELD_UNKNOWN </th> <td class="description">Unknown field</td></tr>
6079 <tr><th>HTTP_FIELD_UPGRADE </th> <td class="description">Upgrade field</td></tr>
6080 <tr><th>HTTP_FIELD_USER_AGENT </th> <td class="description">User-Agent field</td></tr>
6081 <tr><th>HTTP_FIELD_WWW_AUTHENTICATE </th> <td class="description">WWW-Authenticate field</td></tr>
6082</tbody></table>
798d6e29
MS
6083 <h3 class="enumeration"><a id="http_keepalive_e">http_keepalive_e</a></h3>
6084 <p class="description">HTTP keep-alive values</p>
6085 <h4 class="constants">Constants</h4>
98d88c8d
MS
6086 <table class="list"><tbody>
6087 <tr><th>HTTP_KEEPALIVE_OFF </th> <td class="description">No keep alive support</td></tr>
6088 <tr><th>HTTP_KEEPALIVE_ON </th> <td class="description">Use keep alive</td></tr>
6089</tbody></table>
798d6e29
MS
6090 <h3 class="enumeration"><a id="http_state_e">http_state_e</a></h3>
6091 <p class="description">HTTP state values; states
6092are server-oriented...</p>
6093 <h4 class="constants">Constants</h4>
98d88c8d
MS
6094 <table class="list"><tbody>
6095 <tr><th>HTTP_STATE_CONNECT </th> <td class="description">CONNECT command, waiting for blank line</td></tr>
6096 <tr><th>HTTP_STATE_DELETE </th> <td class="description">DELETE command, waiting for blank line</td></tr>
6097 <tr><th>HTTP_STATE_ERROR </th> <td class="description">Error on socket</td></tr>
6098 <tr><th>HTTP_STATE_GET </th> <td class="description">GET command, waiting for blank line</td></tr>
6099 <tr><th>HTTP_STATE_GET_SEND </th> <td class="description">GET command, sending data</td></tr>
6100 <tr><th>HTTP_STATE_HEAD </th> <td class="description">HEAD command, waiting for blank line</td></tr>
6101 <tr><th>HTTP_STATE_OPTIONS </th> <td class="description">OPTIONS command, waiting for blank line</td></tr>
6102 <tr><th>HTTP_STATE_POST </th> <td class="description">POST command, waiting for blank line</td></tr>
6103 <tr><th>HTTP_STATE_POST_RECV </th> <td class="description">POST command, receiving data</td></tr>
6104 <tr><th>HTTP_STATE_POST_SEND </th> <td class="description">POST command, sending data</td></tr>
6105 <tr><th>HTTP_STATE_PUT </th> <td class="description">PUT command, waiting for blank line</td></tr>
6106 <tr><th>HTTP_STATE_PUT_RECV </th> <td class="description">PUT command, receiving data</td></tr>
6107 <tr><th>HTTP_STATE_STATUS </th> <td class="description">Command complete, sending status</td></tr>
6108 <tr><th>HTTP_STATE_TRACE </th> <td class="description">TRACE command, waiting for blank line</td></tr>
6109 <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>
6110 <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>
6111 <tr><th>HTTP_STATE_WAITING </th> <td class="description">Waiting for command</td></tr>
6112</tbody></table>
798d6e29
MS
6113 <h3 class="enumeration"><a id="http_status_e">http_status_e</a></h3>
6114 <p class="description">HTTP status codes</p>
6115 <h4 class="constants">Constants</h4>
98d88c8d
MS
6116 <table class="list"><tbody>
6117 <tr><th>HTTP_STATUS_ACCEPTED </th> <td class="description">DELETE command was successful</td></tr>
6118 <tr><th>HTTP_STATUS_BAD_GATEWAY </th> <td class="description">Bad gateway</td></tr>
6119 <tr><th>HTTP_STATUS_BAD_REQUEST </th> <td class="description">Bad request</td></tr>
6120 <tr><th>HTTP_STATUS_CONFLICT </th> <td class="description">Request is self-conflicting</td></tr>
6121 <tr><th>HTTP_STATUS_CONTINUE </th> <td class="description">Everything OK, keep going...</td></tr>
6122 <tr><th>HTTP_STATUS_CREATED </th> <td class="description">PUT command was successful</td></tr>
6123 <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>
6124 <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>
6125 <tr><th>HTTP_STATUS_ERROR </th> <td class="description">An error response from httpXxxx()</td></tr>
6126 <tr><th>HTTP_STATUS_EXPECTATION_FAILED </th> <td class="description">The expectation given in an Expect header field was not met</td></tr>
6127 <tr><th>HTTP_STATUS_FORBIDDEN </th> <td class="description">Forbidden to access this URI</td></tr>
6128 <tr><th>HTTP_STATUS_GATEWAY_TIMEOUT </th> <td class="description">Gateway connection timed out</td></tr>
6129 <tr><th>HTTP_STATUS_GONE </th> <td class="description">Server has gone away</td></tr>
6130 <tr><th>HTTP_STATUS_LENGTH_REQUIRED </th> <td class="description">A content length or encoding is required</td></tr>
6131 <tr><th>HTTP_STATUS_METHOD_NOT_ALLOWED </th> <td class="description">Method is not allowed</td></tr>
6132 <tr><th>HTTP_STATUS_MOVED_PERMANENTLY </th> <td class="description">Document has moved permanently</td></tr>
6133 <tr><th>HTTP_STATUS_MOVED_TEMPORARILY </th> <td class="description">Document has moved temporarily</td></tr>
6134 <tr><th>HTTP_STATUS_MULTIPLE_CHOICES </th> <td class="description">Multiple files match request</td></tr>
6135 <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>
6136 <tr><th>HTTP_STATUS_NOT_ACCEPTABLE </th> <td class="description">Not Acceptable</td></tr>
6137 <tr><th>HTTP_STATUS_NOT_AUTHORITATIVE </th> <td class="description">Information isn't authoritative</td></tr>
6138 <tr><th>HTTP_STATUS_NOT_FOUND </th> <td class="description">URI was not found</td></tr>
6139 <tr><th>HTTP_STATUS_NOT_IMPLEMENTED </th> <td class="description">Feature not implemented</td></tr>
6140 <tr><th>HTTP_STATUS_NOT_MODIFIED </th> <td class="description">File not modified</td></tr>
6141 <tr><th>HTTP_STATUS_NOT_SUPPORTED </th> <td class="description">HTTP version not supported</td></tr>
6142 <tr><th>HTTP_STATUS_NO_CONTENT </th> <td class="description">Successful command, no new data</td></tr>
6143 <tr><th>HTTP_STATUS_OK </th> <td class="description">OPTIONS/GET/HEAD/POST/TRACE command was successful</td></tr>
6144 <tr><th>HTTP_STATUS_PARTIAL_CONTENT </th> <td class="description">Only a partial file was received/sent</td></tr>
6145 <tr><th>HTTP_STATUS_PAYMENT_REQUIRED </th> <td class="description">Payment required</td></tr>
6146 <tr><th>HTTP_STATUS_PRECONDITION </th> <td class="description">Precondition failed</td></tr>
6147 <tr><th>HTTP_STATUS_PROXY_AUTHENTICATION </th> <td class="description">Proxy Authentication is Required</td></tr>
6148 <tr><th>HTTP_STATUS_REQUESTED_RANGE </th> <td class="description">The requested range is not satisfiable</td></tr>
6149 <tr><th>HTTP_STATUS_REQUEST_TIMEOUT </th> <td class="description">Request timed out</td></tr>
6150 <tr><th>HTTP_STATUS_REQUEST_TOO_LARGE </th> <td class="description">Request entity too large</td></tr>
6151 <tr><th>HTTP_STATUS_RESET_CONTENT </th> <td class="description">Content was reset/recreated</td></tr>
6152 <tr><th>HTTP_STATUS_SEE_OTHER </th> <td class="description">See this other link...</td></tr>
6153 <tr><th>HTTP_STATUS_SERVER_ERROR </th> <td class="description">Internal server error</td></tr>
6154 <tr><th>HTTP_STATUS_SERVICE_UNAVAILABLE </th> <td class="description">Service is unavailable</td></tr>
6155 <tr><th>HTTP_STATUS_SWITCHING_PROTOCOLS </th> <td class="description">HTTP upgrade to TLS/SSL</td></tr>
6156 <tr><th>HTTP_STATUS_UNAUTHORIZED </th> <td class="description">Unauthorized to access host</td></tr>
6157 <tr><th>HTTP_STATUS_UNSUPPORTED_MEDIATYPE </th> <td class="description">The requested media type is unsupported</td></tr>
6158 <tr><th>HTTP_STATUS_UPGRADE_REQUIRED </th> <td class="description">Upgrade to SSL/TLS required</td></tr>
6159 <tr><th>HTTP_STATUS_URI_TOO_LONG </th> <td class="description">URI too long</td></tr>
6160 <tr><th>HTTP_STATUS_USE_PROXY </th> <td class="description">Must use a proxy to access this URI</td></tr>
6161</tbody></table>
798d6e29
MS
6162 <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>
6163 <p class="description">Level of trust for credentials </p>
6164 <h4 class="constants">Constants</h4>
98d88c8d
MS
6165 <table class="list"><tbody>
6166 <tr><th>HTTP_TRUST_CHANGED </th> <td class="description">Credentials have changed</td></tr>
6167 <tr><th>HTTP_TRUST_EXPIRED </th> <td class="description">Credentials are expired</td></tr>
6168 <tr><th>HTTP_TRUST_INVALID </th> <td class="description">Credentials are invalid</td></tr>
6169 <tr><th>HTTP_TRUST_OK </th> <td class="description">Credentials are OK/trusted</td></tr>
6170 <tr><th>HTTP_TRUST_RENEWED </th> <td class="description">Credentials have been renewed</td></tr>
6171 <tr><th>HTTP_TRUST_UNKNOWN </th> <td class="description">Credentials are unknown/new</td></tr>
6172</tbody></table>
798d6e29
MS
6173 <h3 class="enumeration"><a id="http_uri_coding_e">http_uri_coding_e</a></h3>
6174 <p class="description">URI en/decode flags</p>
6175 <h4 class="constants">Constants</h4>
98d88c8d
MS
6176 <table class="list"><tbody>
6177 <tr><th>HTTP_URI_CODING_ALL </th> <td class="description">En/decode everything</td></tr>
6178 <tr><th>HTTP_URI_CODING_HOSTNAME </th> <td class="description">En/decode the hostname portion</td></tr>
6179 <tr><th>HTTP_URI_CODING_MOST </th> <td class="description">En/decode all but the query</td></tr>
6180 <tr><th>HTTP_URI_CODING_NONE </th> <td class="description">Don't en/decode anything</td></tr>
6181 <tr><th>HTTP_URI_CODING_QUERY </th> <td class="description">En/decode the query portion</td></tr>
6182 <tr><th>HTTP_URI_CODING_RESOURCE </th> <td class="description">En/decode the resource portion</td></tr>
6183 <tr><th>HTTP_URI_CODING_RFC6874 </th> <td class="description">Use RFC 6874 address format</td></tr>
6184 <tr><th>HTTP_URI_CODING_USERNAME </th> <td class="description">En/decode the username portion</td></tr>
6185</tbody></table>
798d6e29
MS
6186 <h3 class="enumeration"><a id="http_uri_status_e"><span class="info">&#160;CUPS 1.2&#160;</span>http_uri_status_e</a></h3>
6187 <p class="description">URI separation status </p>
6188 <h4 class="constants">Constants</h4>
98d88c8d
MS
6189 <table class="list"><tbody>
6190 <tr><th>HTTP_URI_STATUS_BAD_ARGUMENTS </th> <td class="description">Bad arguments to function (error)</td></tr>
6191 <tr><th>HTTP_URI_STATUS_BAD_HOSTNAME </th> <td class="description">Bad hostname in URI (error)</td></tr>
6192 <tr><th>HTTP_URI_STATUS_BAD_PORT </th> <td class="description">Bad port number in URI (error)</td></tr>
6193 <tr><th>HTTP_URI_STATUS_BAD_RESOURCE </th> <td class="description">Bad resource in URI (error)</td></tr>
6194 <tr><th>HTTP_URI_STATUS_BAD_SCHEME </th> <td class="description">Bad scheme in URI (error)</td></tr>
6195 <tr><th>HTTP_URI_STATUS_BAD_URI </th> <td class="description">Bad/empty URI (error)</td></tr>
6196 <tr><th>HTTP_URI_STATUS_BAD_USERNAME </th> <td class="description">Bad username in URI (error)</td></tr>
6197 <tr><th>HTTP_URI_STATUS_MISSING_RESOURCE </th> <td class="description">Missing resource in URI (warning)</td></tr>
6198 <tr><th>HTTP_URI_STATUS_MISSING_SCHEME </th> <td class="description">Missing scheme in URI (warning)</td></tr>
6199 <tr><th>HTTP_URI_STATUS_OK </th> <td class="description">URI decoded OK</td></tr>
6200 <tr><th>HTTP_URI_STATUS_OVERFLOW </th> <td class="description">URI buffer for httpAssembleURI is too small</td></tr>
6201 <tr><th>HTTP_URI_STATUS_UNKNOWN_SCHEME </th> <td class="description">Unknown scheme in URI (warning)</td></tr>
6202</tbody></table>
798d6e29 6203 <h3 class="enumeration"><a id="ipp_finishings_e">ipp_finishings_e</a></h3>
718ee2ff 6204 <p class="description">Finishings values</p>
798d6e29 6205 <h4 class="constants">Constants</h4>
98d88c8d
MS
6206 <table class="list"><tbody>
6207 <tr><th>IPP_FINISHINGS_BALE </th> <td class="description">Bale (any type)</td></tr>
6208 <tr><th>IPP_FINISHINGS_BIND </th> <td class="description">Bind</td></tr>
6209 <tr><th>IPP_FINISHINGS_BIND_BOTTOM </th> <td class="description">Bind on bottom</td></tr>
6210 <tr><th>IPP_FINISHINGS_BIND_LEFT </th> <td class="description">Bind on left</td></tr>
6211 <tr><th>IPP_FINISHINGS_BIND_RIGHT </th> <td class="description">Bind on right</td></tr>
6212 <tr><th>IPP_FINISHINGS_BIND_TOP </th> <td class="description">Bind on top</td></tr>
6213 <tr><th>IPP_FINISHINGS_BOOKLET_MAKER </th> <td class="description">Fold to make booklet</td></tr>
6214 <tr><th>IPP_FINISHINGS_COAT </th> <td class="description">Apply protective liquid or powder coating</td></tr>
6215 <tr><th>IPP_FINISHINGS_COVER </th> <td class="description">Add cover</td></tr>
6216 <tr><th>IPP_FINISHINGS_EDGE_STITCH </th> <td class="description">Stitch along any side</td></tr>
6217 <tr><th>IPP_FINISHINGS_EDGE_STITCH_BOTTOM </th> <td class="description">Stitch along bottom edge</td></tr>
6218 <tr><th>IPP_FINISHINGS_EDGE_STITCH_LEFT </th> <td class="description">Stitch along left side</td></tr>
6219 <tr><th>IPP_FINISHINGS_EDGE_STITCH_RIGHT </th> <td class="description">Stitch along right side</td></tr>
6220 <tr><th>IPP_FINISHINGS_EDGE_STITCH_TOP </th> <td class="description">Stitch along top edge</td></tr>
6221 <tr><th>IPP_FINISHINGS_FOLD </th> <td class="description">Fold (any type)</td></tr>
6222 <tr><th>IPP_FINISHINGS_FOLD_ACCORDIAN </th> <td class="description">Accordian-fold the paper vertically into four sections</td></tr>
6223 <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>
6224 <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>
6225 <tr><th>IPP_FINISHINGS_FOLD_GATE </th> <td class="description">Fold the top and bottom quarters of the paper towards the midline</td></tr>
6226 <tr><th>IPP_FINISHINGS_FOLD_HALF </th> <td class="description">Fold the paper in half vertically</td></tr>
6227 <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>
6228 <tr><th>IPP_FINISHINGS_FOLD_LEFT_GATE </th> <td class="description">Fold the top quarter of the paper towards the midline</td></tr>
6229 <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>
6230 <tr><th>IPP_FINISHINGS_FOLD_PARALLEL </th> <td class="description">Fold the paper in half vertically two times, yielding four sections</td></tr>
6231 <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>
6232 <tr><th>IPP_FINISHINGS_FOLD_RIGHT_GATE </th> <td class="description">Fold the bottom quarter of the paper towards the midline</td></tr>
6233 <tr><th>IPP_FINISHINGS_FOLD_Z </th> <td class="description">Fold the paper vertically into three sections, forming a Z</td></tr>
6234 <tr><th>IPP_FINISHINGS_JOG_OFFSET </th> <td class="description">Offset for binding (any type)</td></tr>
6235 <tr><th>IPP_FINISHINGS_LAMINATE </th> <td class="description">Apply protective (solid) material</td></tr>
6236 <tr><th>IPP_FINISHINGS_NONE </th> <td class="description">No finishing</td></tr>
6237 <tr><th>IPP_FINISHINGS_PUNCH </th> <td class="description">Punch (any location/count)</td></tr>
6238 <tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_LEFT </th> <td class="description">Punch 1 hole bottom left</td></tr>
6239 <tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT </th> <td class="description">Punch 1 hole bottom right</td></tr>
6240 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_BOTTOM </th> <td class="description">Punch 2 holes bottom edge</td></tr>
6241 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_LEFT </th> <td class="description">Punch 2 holes left side</td></tr>
6242 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_RIGHT </th> <td class="description">Punch 2 holes right side</td></tr>
6243 <tr><th>IPP_FINISHINGS_PUNCH_DUAL_TOP </th> <td class="description">Punch 2 holes top edge</td></tr>
6244 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM </th> <td class="description">Pucnh multiple holes bottom edge</td></tr>
6245 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT </th> <td class="description">Pucnh multiple holes left side</td></tr>
6246 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT </th> <td class="description">Pucnh multiple holes right side</td></tr>
6247 <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_TOP </th> <td class="description">Pucnh multiple holes top edge</td></tr>
6248 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_BOTTOM </th> <td class="description">Punch 4 holes bottom edge</td></tr>
6249 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_LEFT </th> <td class="description">Punch 4 holes left side</td></tr>
6250 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_RIGHT </th> <td class="description">Punch 4 holes right side</td></tr>
6251 <tr><th>IPP_FINISHINGS_PUNCH_QUAD_TOP </th> <td class="description">Punch 4 holes top edge</td></tr>
6252 <tr><th>IPP_FINISHINGS_PUNCH_TOP_LEFT </th> <td class="description">Punch 1 hole top left</td></tr>
6253 <tr><th>IPP_FINISHINGS_PUNCH_TOP_RIGHT </th> <td class="description">Punch 1 hole top right</td></tr>
6254 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM </th> <td class="description">Punch 3 holes bottom edge</td></tr>
6255 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_LEFT </th> <td class="description">Punch 3 holes left side</td></tr>
6256 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT </th> <td class="description">Punch 3 holes right side</td></tr>
6257 <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_TOP </th> <td class="description">Punch 3 holes top edge</td></tr>
6258 <tr><th>IPP_FINISHINGS_SADDLE_STITCH </th> <td class="description">Staple interior</td></tr>
6259 <tr><th>IPP_FINISHINGS_STAPLE </th> <td class="description">Staple (any location/method)</td></tr>
6260 <tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_LEFT </th> <td class="description">Staple bottom left corner</td></tr>
6261 <tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT </th> <td class="description">Staple bottom right corner</td></tr>
6262 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_BOTTOM </th> <td class="description">Two staples on bottom</td></tr>
6263 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_LEFT </th> <td class="description">Two staples on left</td></tr>
6264 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_RIGHT </th> <td class="description">Two staples on right</td></tr>
6265 <tr><th>IPP_FINISHINGS_STAPLE_DUAL_TOP </th> <td class="description">Two staples on top</td></tr>
6266 <tr><th>IPP_FINISHINGS_STAPLE_TOP_LEFT </th> <td class="description">Staple top left corner</td></tr>
6267 <tr><th>IPP_FINISHINGS_STAPLE_TOP_RIGHT </th> <td class="description">Staple top right corner</td></tr>
6268 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM </th> <td class="description">Three staples on bottom</td></tr>
6269 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_LEFT </th> <td class="description">Three staples on left</td></tr>
6270 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT </th> <td class="description">Three staples on right</td></tr>
6271 <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_TOP </th> <td class="description">Three staples on top</td></tr>
6272 <tr><th>IPP_FINISHINGS_TRIM </th> <td class="description">Trim (any type)</td></tr>
6273 <tr><th>IPP_FINISHINGS_TRIM_AFTER_COPIES </th> <td class="description">Trim output after each copy</td></tr>
6274 <tr><th>IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS </th> <td class="description">Trim output after each document</td></tr>
6275 <tr><th>IPP_FINISHINGS_TRIM_AFTER_JOB </th> <td class="description">Trim output after job</td></tr>
6276 <tr><th>IPP_FINISHINGS_TRIM_AFTER_PAGES </th> <td class="description">Trim output after each page</td></tr>
6277</tbody></table>
798d6e29
MS
6278 <h3 class="enumeration"><a id="ipp_jstate_e">ipp_jstate_e</a></h3>
6279 <p class="description">Job states</p>
6280 <h4 class="constants">Constants</h4>
98d88c8d
MS
6281 <table class="list"><tbody>
6282 <tr><th>IPP_JSTATE_ABORTED </th> <td class="description">Job has aborted due to error</td></tr>
6283 <tr><th>IPP_JSTATE_CANCELED </th> <td class="description">Job has been canceled</td></tr>
6284 <tr><th>IPP_JSTATE_COMPLETED </th> <td class="description">Job has completed successfully</td></tr>
6285 <tr><th>IPP_JSTATE_HELD </th> <td class="description">Job is held for printing</td></tr>
6286 <tr><th>IPP_JSTATE_PENDING </th> <td class="description">Job is waiting to be printed</td></tr>
6287 <tr><th>IPP_JSTATE_PROCESSING </th> <td class="description">Job is currently printing</td></tr>
6288 <tr><th>IPP_JSTATE_STOPPED </th> <td class="description">Job has been stopped</td></tr>
6289</tbody></table>
798d6e29
MS
6290 <h3 class="enumeration"><a id="ipp_op_e">ipp_op_e</a></h3>
6291 <p class="description">IPP operations</p>
6292 <h4 class="constants">Constants</h4>
98d88c8d
MS
6293 <table class="list"><tbody>
6294 <tr><th>IPP_OP_CANCEL_CURRENT_JOB </th> <td class="description">Cancel-Current-Job: Cancel the current job</td></tr>
6295 <tr><th>IPP_OP_CANCEL_JOB </th> <td class="description">Cancel-Job: Cancel a job</td></tr>
6296 <tr><th>IPP_OP_CANCEL_JOBS </th> <td class="description">Cancel-Jobs: Cancel all jobs (administrative)</td></tr>
6297 <tr><th>IPP_OP_CANCEL_MY_JOBS </th> <td class="description">Cancel-My-Jobs: Cancel a user's jobs</td></tr>
6298 <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>
6299 <tr><th>IPP_OP_CLOSE_JOB </th> <td class="description">Close-Job: Close a job and start printing</td></tr>
6300 <tr><th>IPP_OP_CREATE_JOB </th> <td class="description">Create-Job: Create an empty print job</td></tr>
6301 <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>
6302 <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>
6303 <tr><th>IPP_OP_CUPS_ADD_MODIFY_CLASS </th> <td class="description">CUPS-Add-Modify-Class: Add or modify a class</td></tr>
6304 <tr><th>IPP_OP_CUPS_ADD_MODIFY_PRINTER </th> <td class="description">CUPS-Add-Modify-Printer: Add or modify a printer</td></tr>
6305 <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>
6306 <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>
6307 <tr><th>IPP_OP_CUPS_DELETE_CLASS </th> <td class="description">CUPS-Delete-Class: Delete a class</td></tr>
6308 <tr><th>IPP_OP_CUPS_DELETE_PRINTER </th> <td class="description">CUPS-Delete-Printer: Delete a printer</td></tr>
6309 <tr><th>IPP_OP_CUPS_GET_DEFAULT </th> <td class="description">CUPS-Get-Default: Get the default printer</td></tr>
6310 <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>
6311 <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>
6312 <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>
6313 <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>
6314 <tr><th>IPP_OP_CUPS_GET_PRINTERS </th> <td class="description">CUPS-Get-Printers: Get a list of printers and/or classes</td></tr>
6315 <tr><th>IPP_OP_CUPS_INVALID </th> <td class="description">Invalid operation name for <a href="#ippOpValue"><code>ippOpValue</code></a></td></tr>
6316 <tr><th>IPP_OP_CUPS_MOVE_JOB </th> <td class="description">CUPS-Move-Job: Move a job to a different printer</td></tr>
6317 <tr><th>IPP_OP_CUPS_SET_DEFAULT </th> <td class="description">CUPS-Set-Default: Set the default printer</td></tr>
6318 <tr><th>IPP_OP_DISABLE_PRINTER </th> <td class="description">Disable-Printer: Reject new jobs for a printer</td></tr>
6319 <tr><th>IPP_OP_ENABLE_PRINTER </th> <td class="description">Enable-Printer: Accept new jobs for a printer</td></tr>
6320 <tr><th>IPP_OP_GET_JOBS </th> <td class="description">Get-Jobs: Get a list of jobs</td></tr>
6321 <tr><th>IPP_OP_GET_JOB_ATTRIBUTES </th> <td class="description">Get-Job-Attribute: Get information about a job</td></tr>
6322 <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>
6323 <tr><th>IPP_OP_GET_PRINTER_ATTRIBUTES </th> <td class="description">Get-Printer-Attributes: Get information about a printer</td></tr>
6324 <tr><th>IPP_OP_GET_PRINTER_SUPPORTED_VALUES </th> <td class="description">Get-Printer-Supported-Values: Get supported values</td></tr>
6325 <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>
6326 <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>
6327 <tr><th>IPP_OP_HOLD_JOB </th> <td class="description">Hold-Job: Hold a job for printing</td></tr>
6328 <tr><th>IPP_OP_HOLD_NEW_JOBS </th> <td class="description">Hold-New-Jobs: Hold new jobs</td></tr>
6329 <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>
6330 <tr><th>IPP_OP_PAUSE_PRINTER </th> <td class="description">Pause-Printer: Stop a printer</td></tr>
6331 <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>
6332 <tr><th>IPP_OP_PRINT_JOB </th> <td class="description">Print-Job: Print a single file</td></tr>
6333 <tr><th>IPP_OP_PROMOTE_JOB </th> <td class="description">Promote-Job: Promote a job to print sooner</td></tr>
6334 <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>
6335 <tr><th>IPP_OP_RELEASE_JOB </th> <td class="description">Release-Job: Release a job for printing</td></tr>
6336 <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>
6337 <tr><th>IPP_OP_RESTART_JOB <span class="info">&#160;DEPRECATED&#160;</span></th> <td class="description">Restart-Job: Reprint a job </td></tr>
6338 <tr><th>IPP_OP_RESUME_JOB </th> <td class="description">Resume-Job: Resume the current job</td></tr>
6339 <tr><th>IPP_OP_RESUME_PRINTER </th> <td class="description">Resume-Printer: Start a printer</td></tr>
6340 <tr><th>IPP_OP_SCHEDULE_JOB_AFTER </th> <td class="description">Schedule-Job-After: Schedule a job to print after another</td></tr>
6341 <tr><th>IPP_OP_SEND_DOCUMENT </th> <td class="description">Send-Document: Add a file to a job</td></tr>
6342 <tr><th>IPP_OP_SET_JOB_ATTRIBUTES </th> <td class="description">Set-Job-Attributes: Set job values</td></tr>
6343 <tr><th>IPP_OP_SET_PRINTER_ATTRIBUTES </th> <td class="description">Set-Printer-Attributes: Set printer values</td></tr>
6344 <tr><th>IPP_OP_SUSPEND_CURRENT_JOB </th> <td class="description">Suspend-Current-Job: Suspend the current job</td></tr>
6345 <tr><th>IPP_OP_VALIDATE_JOB </th> <td class="description">Validate-Job: Validate job values prior to submission</td></tr>
6346</tbody></table>
798d6e29
MS
6347 <h3 class="enumeration"><a id="ipp_orient_e">ipp_orient_e</a></h3>
6348 <p class="description">Orientation values</p>
6349 <h4 class="constants">Constants</h4>
98d88c8d
MS
6350 <table class="list"><tbody>
6351 <tr><th>IPP_ORIENT_LANDSCAPE </th> <td class="description">90 degrees counter-clockwise</td></tr>
6352 <tr><th>IPP_ORIENT_NONE </th> <td class="description">No rotation</td></tr>
6353 <tr><th>IPP_ORIENT_PORTRAIT </th> <td class="description">No rotation</td></tr>
6354 <tr><th>IPP_ORIENT_REVERSE_LANDSCAPE </th> <td class="description">90 degrees clockwise</td></tr>
6355 <tr><th>IPP_ORIENT_REVERSE_PORTRAIT </th> <td class="description">180 degrees</td></tr>
6356</tbody></table>
798d6e29 6357 <h3 class="enumeration"><a id="ipp_pstate_e">ipp_pstate_e</a></h3>
65bebeac 6358 <p class="description">Printer state values</p>
798d6e29 6359 <h4 class="constants">Constants</h4>
98d88c8d
MS
6360 <table class="list"><tbody>
6361 <tr><th>IPP_PSTATE_IDLE </th> <td class="description">Printer is idle</td></tr>
6362 <tr><th>IPP_PSTATE_PROCESSING </th> <td class="description">Printer is working</td></tr>
6363 <tr><th>IPP_PSTATE_STOPPED </th> <td class="description">Printer is stopped</td></tr>
6364</tbody></table>
798d6e29 6365 <h3 class="enumeration"><a id="ipp_quality_e">ipp_quality_e</a></h3>
65bebeac 6366 <p class="description">Print quality values</p>
798d6e29 6367 <h4 class="constants">Constants</h4>
98d88c8d
MS
6368 <table class="list"><tbody>
6369 <tr><th>IPP_QUALITY_DRAFT </th> <td class="description">Draft quality</td></tr>
6370 <tr><th>IPP_QUALITY_HIGH </th> <td class="description">High quality</td></tr>
6371 <tr><th>IPP_QUALITY_NORMAL </th> <td class="description">Normal quality</td></tr>
6372</tbody></table>
798d6e29
MS
6373 <h3 class="enumeration"><a id="ipp_res_e">ipp_res_e</a></h3>
6374 <p class="description">Resolution units</p>
6375 <h4 class="constants">Constants</h4>
98d88c8d
MS
6376 <table class="list"><tbody>
6377 <tr><th>IPP_RES_PER_CM </th> <td class="description">Pixels per centimeter</td></tr>
6378 <tr><th>IPP_RES_PER_INCH </th> <td class="description">Pixels per inch</td></tr>
6379</tbody></table>
798d6e29 6380 <h3 class="enumeration"><a id="ipp_state_e">ipp_state_e</a></h3>
65bebeac 6381 <p class="description">ipp_t state values</p>
798d6e29 6382 <h4 class="constants">Constants</h4>
98d88c8d
MS
6383 <table class="list"><tbody>
6384 <tr><th>IPP_STATE_ATTRIBUTE </th> <td class="description">One or more attributes need to be sent/received</td></tr>
6385 <tr><th>IPP_STATE_DATA </th> <td class="description">IPP request data needs to be sent/received</td></tr>
6386 <tr><th>IPP_STATE_ERROR </th> <td class="description">An error occurred</td></tr>
6387 <tr><th>IPP_STATE_HEADER </th> <td class="description">The request header needs to be sent/received</td></tr>
6388 <tr><th>IPP_STATE_IDLE </th> <td class="description">Nothing is happening/request completed</td></tr>
6389</tbody></table>
798d6e29 6390 <h3 class="enumeration"><a id="ipp_status_e">ipp_status_e</a></h3>
65bebeac 6391 <p class="description">IPP status code values</p>
798d6e29 6392 <h4 class="constants">Constants</h4>
98d88c8d
MS
6393 <table class="list"><tbody>
6394 <tr><th>IPP_STATUS_CUPS_INVALID </th> <td class="description">Invalid status name for <a href="#ippErrorValue"><code>ippErrorValue</code></a></td></tr>
6395 <tr><th>IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED </th> <td class="description">client-error-account-authorization-failed</td></tr>
6396 <tr><th>IPP_STATUS_ERROR_ACCOUNT_CLOSED </th> <td class="description">client-error-account-closed</td></tr>
6397 <tr><th>IPP_STATUS_ERROR_ACCOUNT_INFO_NEEDED </th> <td class="description">client-error-account-info-needed</td></tr>
6398 <tr><th>IPP_STATUS_ERROR_ACCOUNT_LIMIT_REACHED </th> <td class="description">client-error-account-limit-reached</td></tr>
6399 <tr><th>IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE </th> <td class="description">client-error-attributes-not-settable</td></tr>
6400 <tr><th>IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES </th> <td class="description">client-error-attributes-or-values-not-supported</td></tr>
6401 <tr><th>IPP_STATUS_ERROR_BAD_REQUEST </th> <td class="description">client-error-bad-request</td></tr>
6402 <tr><th>IPP_STATUS_ERROR_BUSY </th> <td class="description">server-error-busy</td></tr>
6403 <tr><th>IPP_STATUS_ERROR_CHARSET </th> <td class="description">client-error-charset-not-supported</td></tr>
6404 <tr><th>IPP_STATUS_ERROR_COMPRESSION_ERROR </th> <td class="description">client-error-compression-error</td></tr>
6405 <tr><th>IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED </th> <td class="description">client-error-compression-not-supported</td></tr>
6406 <tr><th>IPP_STATUS_ERROR_CONFLICTING </th> <td class="description">client-error-conflicting-attributes</td></tr>
6407 <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>
6408 <tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED </th> <td class="description">cups-error-account-closed @deprecate@</td></tr>
6409 <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>
6410 <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>
6411 <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>
6412 <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>
6413 <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>
6414 <tr><th>IPP_STATUS_ERROR_DEVICE </th> <td class="description">server-error-device-error</td></tr>
6415 <tr><th>IPP_STATUS_ERROR_DOCUMENT_ACCESS </th> <td class="description">client-error-document-access-error</td></tr>
6416 <tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR </th> <td class="description">client-error-document-format-error</td></tr>
6417 <tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED </th> <td class="description">client-error-document-format-not-supported</td></tr>
6418 <tr><th>IPP_STATUS_ERROR_DOCUMENT_PASSWORD </th> <td class="description">client-error-document-password-error</td></tr>
6419 <tr><th>IPP_STATUS_ERROR_DOCUMENT_PERMISSION </th> <td class="description">client-error-document-permission-error</td></tr>
6420 <tr><th>IPP_STATUS_ERROR_DOCUMENT_SECURITY </th> <td class="description">client-error-document-security-error</td></tr>
6421 <tr><th>IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE </th> <td class="description">client-error-document-unprintable-error</td></tr>
6422 <tr><th>IPP_STATUS_ERROR_FORBIDDEN </th> <td class="description">client-error-forbidden</td></tr>
6423 <tr><th>IPP_STATUS_ERROR_GONE </th> <td class="description">client-error-gone</td></tr>
6424 <tr><th>IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS </th> <td class="description">client-error-ignored-all-subscriptions</td></tr>
6425 <tr><th>IPP_STATUS_ERROR_INTERNAL </th> <td class="description">server-error-internal-error</td></tr>
6426 <tr><th>IPP_STATUS_ERROR_JOB_CANCELED </th> <td class="description">server-error-job-canceled</td></tr>
6427 <tr><th>IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED </th> <td class="description">server-error-multiple-document-jobs-not-supported</td></tr>
6428 <tr><th>IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS </th> <td class="description">server-error-not-accepting-jobs</td></tr>
6429 <tr><th>IPP_STATUS_ERROR_NOT_AUTHENTICATED </th> <td class="description">client-error-not-authenticated</td></tr>
6430 <tr><th>IPP_STATUS_ERROR_NOT_AUTHORIZED </th> <td class="description">client-error-not-authorized</td></tr>
6431 <tr><th>IPP_STATUS_ERROR_NOT_FETCHABLE </th> <td class="description">client-error-not-fetchable</td></tr>
6432 <tr><th>IPP_STATUS_ERROR_NOT_FOUND </th> <td class="description">client-error-not-found</td></tr>
6433 <tr><th>IPP_STATUS_ERROR_NOT_POSSIBLE </th> <td class="description">client-error-not-possible</td></tr>
6434 <tr><th>IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED </th> <td class="description">server-error-operation-not-supported</td></tr>
6435 <tr><th>IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED </th> <td class="description">server-error-printer-is-deactivated</td></tr>
6436 <tr><th>IPP_STATUS_ERROR_REQUEST_ENTITY </th> <td class="description">client-error-request-entity-too-large</td></tr>
6437 <tr><th>IPP_STATUS_ERROR_REQUEST_VALUE </th> <td class="description">client-error-request-value-too-long</td></tr>
6438 <tr><th>IPP_STATUS_ERROR_SERVICE_UNAVAILABLE </th> <td class="description">server-error-service-unavailable</td></tr>
6439 <tr><th>IPP_STATUS_ERROR_TEMPORARY </th> <td class="description">server-error-temporary-error</td></tr>
6440 <tr><th>IPP_STATUS_ERROR_TIMEOUT </th> <td class="description">client-error-timeout</td></tr>
6441 <tr><th>IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS </th> <td class="description">server-error-too-many-documents</td></tr>
6442 <tr><th>IPP_STATUS_ERROR_TOO_MANY_JOBS </th> <td class="description">server-error-too-many-jobs</td></tr>
6443 <tr><th>IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS </th> <td class="description">client-error-too-many-subscriptions</td></tr>
6444 <tr><th>IPP_STATUS_ERROR_URI_SCHEME </th> <td class="description">client-error-uri-scheme-not-supported</td></tr>
6445 <tr><th>IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED </th> <td class="description">server-error-version-not-supported</td></tr>
6446 <tr><th>IPP_STATUS_OK </th> <td class="description">successful-ok</td></tr>
6447 <tr><th>IPP_STATUS_OK_CONFLICTING </th> <td class="description">successful-ok-conflicting-attributes</td></tr>
6448 <tr><th>IPP_STATUS_OK_EVENTS_COMPLETE </th> <td class="description">successful-ok-events-complete</td></tr>
6449 <tr><th>IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED </th> <td class="description">successful-ok-ignored-or-substituted-attributes</td></tr>
6450 <tr><th>IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS </th> <td class="description">successful-ok-ignored-subscriptions</td></tr>
6451 <tr><th>IPP_STATUS_OK_TOO_MANY_EVENTS </th> <td class="description">successful-ok-too-many-events</td></tr>
6452</tbody></table>
798d6e29 6453 <h3 class="enumeration"><a id="ipp_tag_e">ipp_tag_e</a></h3>
65bebeac 6454 <p class="description">Value and group tag values for attributes</p>
798d6e29 6455 <h4 class="constants">Constants</h4>
98d88c8d
MS
6456 <table class="list"><tbody>
6457 <tr><th>IPP_TAG_ADMINDEFINE </th> <td class="description">Admin-defined value</td></tr>
6458 <tr><th>IPP_TAG_BOOLEAN </th> <td class="description">Boolean value</td></tr>
6459 <tr><th>IPP_TAG_CHARSET </th> <td class="description">Character set value</td></tr>
6460 <tr><th>IPP_TAG_CUPS_INVALID </th> <td class="description">Invalid tag name for <a href="#ippTagValue"><code>ippTagValue</code></a></td></tr>
6461 <tr><th>IPP_TAG_DATE </th> <td class="description">Date/time value</td></tr>
6462 <tr><th>IPP_TAG_DEFAULT </th> <td class="description">Default value</td></tr>
6463 <tr><th>IPP_TAG_DELETEATTR </th> <td class="description">Delete-attribute value</td></tr>
6464 <tr><th>IPP_TAG_END </th> <td class="description">End-of-attributes</td></tr>
6465 <tr><th>IPP_TAG_ENUM </th> <td class="description">Enumeration value</td></tr>
6466 <tr><th>IPP_TAG_EVENT_NOTIFICATION </th> <td class="description">Event group</td></tr>
6467 <tr><th>IPP_TAG_INTEGER </th> <td class="description">Integer value</td></tr>
6468 <tr><th>IPP_TAG_JOB </th> <td class="description">Job group</td></tr>
6469 <tr><th>IPP_TAG_KEYWORD </th> <td class="description">Keyword value</td></tr>
6470 <tr><th>IPP_TAG_LANGUAGE </th> <td class="description">Language value</td></tr>
6471 <tr><th>IPP_TAG_MIMETYPE </th> <td class="description">MIME media type value</td></tr>
6472 <tr><th>IPP_TAG_NAME </th> <td class="description">Name value</td></tr>
6473 <tr><th>IPP_TAG_NAMELANG </th> <td class="description">Name-with-language value</td></tr>
6474 <tr><th>IPP_TAG_NOTSETTABLE </th> <td class="description">Not-settable value</td></tr>
6475 <tr><th>IPP_TAG_NOVALUE </th> <td class="description">No-value value</td></tr>
6476 <tr><th>IPP_TAG_OPERATION </th> <td class="description">Operation group</td></tr>
6477 <tr><th>IPP_TAG_PRINTER </th> <td class="description">Printer group</td></tr>
6478 <tr><th>IPP_TAG_RANGE </th> <td class="description">Range value</td></tr>
6479 <tr><th>IPP_TAG_RESOLUTION </th> <td class="description">Resolution value</td></tr>
6480 <tr><th>IPP_TAG_STRING </th> <td class="description">Octet string value</td></tr>
6481 <tr><th>IPP_TAG_SUBSCRIPTION </th> <td class="description">Subscription group</td></tr>
6482 <tr><th>IPP_TAG_TEXT </th> <td class="description">Text value</td></tr>
6483 <tr><th>IPP_TAG_TEXTLANG </th> <td class="description">Text-with-language value</td></tr>
6484 <tr><th>IPP_TAG_UNKNOWN </th> <td class="description">Unknown value</td></tr>
6485 <tr><th>IPP_TAG_UNSUPPORTED_GROUP </th> <td class="description">Unsupported attributes group</td></tr>
6486 <tr><th>IPP_TAG_UNSUPPORTED_VALUE </th> <td class="description">Unsupported value</td></tr>
6487 <tr><th>IPP_TAG_URI </th> <td class="description">URI value</td></tr>
6488 <tr><th>IPP_TAG_URISCHEME </th> <td class="description">URI scheme value</td></tr>
6489 <tr><th>IPP_TAG_ZERO </th> <td class="description">Zero tag - used for separators</td></tr>
6490</tbody></table>
798d6e29
MS
6491 </div>
6492 </body>
6493</html>