]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/cupspm.html
Add a cover image for the new programming manual.
[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">
10 <meta name="copyright" content="Copyright (c) 2007-2017 by Apple Inc. All Rights Reserved.">
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}
90blockquote {
91 border: solid thin gray;
92 box-shadow: 3px 3px 5px rgba(0,0,0,0.5);
93 padding: 0px 10px;
94 page-break-inside: avoid;
95}
96p code, li code, p.code, pre, ul.code li {
97 background: rgba(127,127,127,0.1);
98 border: thin dotted gray;
99 font-family: monospace;
100 font-size: 90%;
101 hyphens: manual;
102 -webkit-hyphens: manual;
103 page-break-inside: avoid;
104}
105p.code, pre, ul.code li {
106 padding: 10px;
107}
108p code, li code {
109 padding: 2px 5px;
110}
111a:link, a:visited {
112 text-decoration: none;
113}
114span.info {
115 background: black;
116 border: solid thin black;
117 color: white;
118 font-size: 80%;
119 font-style: italic;
120 font-weight: bold;
121 white-space: nowrap;
122}
123h3 span.info, h4 span.info {
124 float: right;
125 font-size: 100%;
126}
127ul.code, ul.contents, ul.subcontents {
128 list-style-type: none;
129 margin: 0;
130 padding-left: 0;
131}
132ul.code li {
133 margin: 0;
134}
135ul.contents > li {
136 margin-top: 1em;
137}
138ul.contents li ul.code, ul.contents li ul.subcontents {
139 padding-left: 2em;
140}
141div.body dl {
142 margin-top: 0;
143}
144div.body dt {
145 font-style: italic;
146 margin-top: 0;
147}
148div.body dd {
149 margin-bottom: 0.5em;
150}
151h1.title {
152}
153h2.title {
154 border-bottom: solid 2px black;
155}
156h3.title {
157 border-bottom: solid 2px black;
158}
159--></style>
160 </head>
161 <body>
162 <h1 class="title">CUPS Programming Manual</h1>
163 <p>Michael R Sweet</p>
164 <p>Copyright (c) 2007-2017 by Apple Inc. All Rights Reserved.</p>
165 <div class="contents">
166 <h2 class="title">Contents</h2>
167 <ul class="contents">
168 <li><a href="#Introduction">Introduction</a><ul class="subcontents">
169 <li><a href="#Guidelines">Guidelines</a></li>
170 <li><a href="#TermsUsedinThisDocument">Terms Used in This Document</a></li>
171 <li><a href="#CompilingProgramsThatUsetheCUPSAPI">Compiling Programs That Use the CUPS API</a></li>
172 </ul></li>
173 <li><a href="#WorkingwithDestinations">Working with Destinations</a><ul class="subcontents">
174 <li><a href="#FindingAvailableDestinations">Finding Available Destinations</a></li>
175 <li><a href="#BasicDestinationInformation">Basic Destination Information</a></li>
176 <li><a href="#DetailedDestinationInformation">Detailed Destination Information</a></li>
177 <li><a href="#SubmittingaPrintJob">Submitting a Print Job</a></li>
178 </ul></li>
179 <li><a href="#FUNCTIONS">Functions</a><ul class="subcontents">
180 <li><a href="#cupsAddDest">cupsAddDest</a></li>
181 <li><a href="#cupsAddOption">cupsAddOption</a></li>
182 <li><a href="#cupsArrayAdd">cupsArrayAdd</a></li>
183 <li><a href="#cupsArrayClear">cupsArrayClear</a></li>
184 <li><a href="#cupsArrayCount">cupsArrayCount</a></li>
185 <li><a href="#cupsArrayCurrent">cupsArrayCurrent</a></li>
186 <li><a href="#cupsArrayDelete">cupsArrayDelete</a></li>
187 <li><a href="#cupsArrayDup">cupsArrayDup</a></li>
188 <li><a href="#cupsArrayFind">cupsArrayFind</a></li>
189 <li><a href="#cupsArrayFirst">cupsArrayFirst</a></li>
190 <li><a href="#cupsArrayGetIndex">cupsArrayGetIndex</a></li>
191 <li><a href="#cupsArrayGetInsert">cupsArrayGetInsert</a></li>
192 <li><a href="#cupsArrayIndex">cupsArrayIndex</a></li>
193 <li><a href="#cupsArrayInsert">cupsArrayInsert</a></li>
194 <li><a href="#cupsArrayLast">cupsArrayLast</a></li>
195 <li><a href="#cupsArrayNew">cupsArrayNew</a></li>
196 <li><a href="#cupsArrayNew2">cupsArrayNew2</a></li>
197 <li><a href="#cupsArrayNew3">cupsArrayNew3</a></li>
198 <li><a href="#cupsArrayNext">cupsArrayNext</a></li>
199 <li><a href="#cupsArrayPrev">cupsArrayPrev</a></li>
200 <li><a href="#cupsArrayRemove">cupsArrayRemove</a></li>
201 <li><a href="#cupsArrayRestore">cupsArrayRestore</a></li>
202 <li><a href="#cupsArraySave">cupsArraySave</a></li>
203 <li><a href="#cupsArrayUserData">cupsArrayUserData</a></li>
204 <li><a href="#cupsCancelDestJob">cupsCancelDestJob</a></li>
205 <li><a href="#cupsCancelJob">cupsCancelJob</a></li>
206 <li><a href="#cupsCancelJob2">cupsCancelJob2</a></li>
207 <li><a href="#cupsCheckDestSupported">cupsCheckDestSupported</a></li>
208 <li><a href="#cupsCloseDestJob">cupsCloseDestJob</a></li>
209 <li><a href="#cupsConnectDest">cupsConnectDest</a></li>
210 <li><a href="#cupsConnectDestBlock">cupsConnectDestBlock</a></li>
211 <li><a href="#cupsCopyDest">cupsCopyDest</a></li>
212 <li><a href="#cupsCopyDestConflicts">cupsCopyDestConflicts</a></li>
213 <li><a href="#cupsCopyDestInfo">cupsCopyDestInfo</a></li>
214 <li><a href="#cupsCreateDestJob">cupsCreateDestJob</a></li>
215 <li><a href="#cupsCreateJob">cupsCreateJob</a></li>
216 <li><a href="#cupsDirClose">cupsDirClose</a></li>
217 <li><a href="#cupsDirOpen">cupsDirOpen</a></li>
218 <li><a href="#cupsDirRead">cupsDirRead</a></li>
219 <li><a href="#cupsDirRewind">cupsDirRewind</a></li>
220 <li><a href="#cupsDoAuthentication">cupsDoAuthentication</a></li>
221 <li><a href="#cupsEncodeOptions">cupsEncodeOptions</a></li>
222 <li><a href="#cupsEncodeOptions2">cupsEncodeOptions2</a></li>
223 <li><a href="#cupsEncryption">cupsEncryption</a></li>
224 <li><a href="#cupsEnumDests">cupsEnumDests</a></li>
225 <li><a href="#cupsEnumDestsBlock">cupsEnumDestsBlock</a></li>
226 <li><a href="#cupsFileClose">cupsFileClose</a></li>
227 <li><a href="#cupsFileCompression">cupsFileCompression</a></li>
228 <li><a href="#cupsFileEOF">cupsFileEOF</a></li>
229 <li><a href="#cupsFileFind">cupsFileFind</a></li>
230 <li><a href="#cupsFileFlush">cupsFileFlush</a></li>
231 <li><a href="#cupsFileGetChar">cupsFileGetChar</a></li>
232 <li><a href="#cupsFileGetConf">cupsFileGetConf</a></li>
233 <li><a href="#cupsFileGetLine">cupsFileGetLine</a></li>
234 <li><a href="#cupsFileGets">cupsFileGets</a></li>
235 <li><a href="#cupsFileLock">cupsFileLock</a></li>
236 <li><a href="#cupsFileNumber">cupsFileNumber</a></li>
237 <li><a href="#cupsFileOpen">cupsFileOpen</a></li>
238 <li><a href="#cupsFileOpenFd">cupsFileOpenFd</a></li>
239 <li><a href="#cupsFilePeekChar">cupsFilePeekChar</a></li>
240 <li><a href="#cupsFilePrintf">cupsFilePrintf</a></li>
241 <li><a href="#cupsFilePutChar">cupsFilePutChar</a></li>
242 <li><a href="#cupsFilePutConf">cupsFilePutConf</a></li>
243 <li><a href="#cupsFilePuts">cupsFilePuts</a></li>
244 <li><a href="#cupsFileRead">cupsFileRead</a></li>
245 <li><a href="#cupsFileRewind">cupsFileRewind</a></li>
246 <li><a href="#cupsFileSeek">cupsFileSeek</a></li>
247 <li><a href="#cupsFileStderr">cupsFileStderr</a></li>
248 <li><a href="#cupsFileStdin">cupsFileStdin</a></li>
249 <li><a href="#cupsFileStdout">cupsFileStdout</a></li>
250 <li><a href="#cupsFileTell">cupsFileTell</a></li>
251 <li><a href="#cupsFileUnlock">cupsFileUnlock</a></li>
252 <li><a href="#cupsFileWrite">cupsFileWrite</a></li>
253 <li><a href="#cupsFindDestDefault">cupsFindDestDefault</a></li>
254 <li><a href="#cupsFindDestReady">cupsFindDestReady</a></li>
255 <li><a href="#cupsFindDestSupported">cupsFindDestSupported</a></li>
256 <li><a href="#cupsFinishDestDocument">cupsFinishDestDocument</a></li>
257 <li><a href="#cupsFinishDocument">cupsFinishDocument</a></li>
258 <li><a href="#cupsFreeDestInfo">cupsFreeDestInfo</a></li>
259 <li><a href="#cupsFreeDests">cupsFreeDests</a></li>
260 <li><a href="#cupsFreeJobs">cupsFreeJobs</a></li>
261 <li><a href="#cupsFreeOptions">cupsFreeOptions</a></li>
262 <li><a href="#cupsGetClasses">cupsGetClasses</a></li>
263 <li><a href="#cupsGetDefault">cupsGetDefault</a></li>
264 <li><a href="#cupsGetDefault2">cupsGetDefault2</a></li>
265 <li><a href="#cupsGetDest">cupsGetDest</a></li>
266 <li><a href="#cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></li>
267 <li><a href="#cupsGetDestMediaByName">cupsGetDestMediaByName</a></li>
268 <li><a href="#cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></li>
269 <li><a href="#cupsGetDestMediaCount">cupsGetDestMediaCount</a></li>
270 <li><a href="#cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></li>
271 <li><a href="#cupsGetDestWithURI">cupsGetDestWithURI</a></li>
272 <li><a href="#cupsGetDests">cupsGetDests</a></li>
273 <li><a href="#cupsGetDests2">cupsGetDests2</a></li>
274 <li><a href="#cupsGetJobs">cupsGetJobs</a></li>
275 <li><a href="#cupsGetJobs2">cupsGetJobs2</a></li>
276 <li><a href="#cupsGetNamedDest">cupsGetNamedDest</a></li>
277 <li><a href="#cupsGetOption">cupsGetOption</a></li>
278 <li><a href="#cupsGetPassword">cupsGetPassword</a></li>
279 <li><a href="#cupsGetPassword2">cupsGetPassword2</a></li>
280 <li><a href="#cupsGetPrinters">cupsGetPrinters</a></li>
281 <li><a href="#cupsLangDefault">cupsLangDefault</a></li>
282 <li><a href="#cupsLangEncoding">cupsLangEncoding</a></li>
283 <li><a href="#cupsLangFlush">cupsLangFlush</a></li>
284 <li><a href="#cupsLangFree">cupsLangFree</a></li>
285 <li><a href="#cupsLangGet">cupsLangGet</a></li>
286 <li><a href="#cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></li>
287 <li><a href="#cupsLocalizeDestOption">cupsLocalizeDestOption</a></li>
288 <li><a href="#cupsLocalizeDestValue">cupsLocalizeDestValue</a></li>
289 <li><a href="#cupsMakeServerCredentials">cupsMakeServerCredentials</a></li>
290 <li><a href="#cupsNotifySubject">cupsNotifySubject</a></li>
291 <li><a href="#cupsNotifyText">cupsNotifyText</a></li>
292 <li><a href="#cupsParseOptions">cupsParseOptions</a></li>
293 <li><a href="#cupsPrintFile">cupsPrintFile</a></li>
294 <li><a href="#cupsPrintFile2">cupsPrintFile2</a></li>
295 <li><a href="#cupsPrintFiles">cupsPrintFiles</a></li>
296 <li><a href="#cupsPrintFiles2">cupsPrintFiles2</a></li>
297 <li><a href="#cupsRemoveDest">cupsRemoveDest</a></li>
298 <li><a href="#cupsRemoveOption">cupsRemoveOption</a></li>
299 <li><a href="#cupsServer">cupsServer</a></li>
300 <li><a href="#cupsSetClientCertCB">cupsSetClientCertCB</a></li>
301 <li><a href="#cupsSetCredentials">cupsSetCredentials</a></li>
302 <li><a href="#cupsSetDefaultDest">cupsSetDefaultDest</a></li>
303 <li><a href="#cupsSetDests">cupsSetDests</a></li>
304 <li><a href="#cupsSetDests2">cupsSetDests2</a></li>
305 <li><a href="#cupsSetEncryption">cupsSetEncryption</a></li>
306 <li><a href="#cupsSetPasswordCB">cupsSetPasswordCB</a></li>
307 <li><a href="#cupsSetPasswordCB2">cupsSetPasswordCB2</a></li>
308 <li><a href="#cupsSetServer">cupsSetServer</a></li>
309 <li><a href="#cupsSetServerCertCB">cupsSetServerCertCB</a></li>
310 <li><a href="#cupsSetServerCredentials">cupsSetServerCredentials</a></li>
311 <li><a href="#cupsSetUser">cupsSetUser</a></li>
312 <li><a href="#cupsSetUserAgent">cupsSetUserAgent</a></li>
313 <li><a href="#cupsStartDestDocument">cupsStartDestDocument</a></li>
314 <li><a href="#cupsStartDocument">cupsStartDocument</a></li>
315 <li><a href="#cupsTempFd">cupsTempFd</a></li>
316 <li><a href="#cupsTempFile">cupsTempFile</a></li>
317 <li><a href="#cupsTempFile2">cupsTempFile2</a></li>
318 <li><a href="#cupsUser">cupsUser</a></li>
319 <li><a href="#cupsUserAgent">cupsUserAgent</a></li>
320 <li><a href="#httpAcceptConnection">httpAcceptConnection</a></li>
321 <li><a href="#httpAddCredential">httpAddCredential</a></li>
322 <li><a href="#httpAddrAny">httpAddrAny</a></li>
323 <li><a href="#httpAddrClose">httpAddrClose</a></li>
324 <li><a href="#httpAddrConnect">httpAddrConnect</a></li>
325 <li><a href="#httpAddrConnect2">httpAddrConnect2</a></li>
326 <li><a href="#httpAddrCopyList">httpAddrCopyList</a></li>
327 <li><a href="#httpAddrEqual">httpAddrEqual</a></li>
328 <li><a href="#httpAddrFamily">httpAddrFamily</a></li>
329 <li><a href="#httpAddrFreeList">httpAddrFreeList</a></li>
330 <li><a href="#httpAddrGetList">httpAddrGetList</a></li>
331 <li><a href="#httpAddrLength">httpAddrLength</a></li>
332 <li><a href="#httpAddrListen">httpAddrListen</a></li>
333 <li><a href="#httpAddrLocalhost">httpAddrLocalhost</a></li>
334 <li><a href="#httpAddrLookup">httpAddrLookup</a></li>
335 <li><a href="#httpAddrPort">httpAddrPort</a></li>
336 <li><a href="#httpAddrString">httpAddrString</a></li>
337 <li><a href="#httpAssembleURI">httpAssembleURI</a></li>
338 <li><a href="#httpAssembleURIf">httpAssembleURIf</a></li>
339 <li><a href="#httpAssembleUUID">httpAssembleUUID</a></li>
340 <li><a href="#httpBlocking">httpBlocking</a></li>
341 <li><a href="#httpCheck">httpCheck</a></li>
342 <li><a href="#httpClearCookie">httpClearCookie</a></li>
343 <li><a href="#httpClearFields">httpClearFields</a></li>
344 <li><a href="#httpClose">httpClose</a></li>
345 <li><a href="#httpCompareCredentials">httpCompareCredentials</a></li>
346 <li><a href="#httpConnect">httpConnect</a></li>
347 <li><a href="#httpConnect2">httpConnect2</a></li>
348 <li><a href="#httpConnectEncrypt">httpConnectEncrypt</a></li>
349 <li><a href="#httpCopyCredentials">httpCopyCredentials</a></li>
350 <li><a href="#httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></li>
351 <li><a href="#httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></li>
352 <li><a href="#httpCredentialsGetTrust">httpCredentialsGetTrust</a></li>
353 <li><a href="#httpCredentialsString">httpCredentialsString</a></li>
354 <li><a href="#httpDecode64">httpDecode64</a></li>
355 <li><a href="#httpDecode64_2">httpDecode64_2</a></li>
356 <li><a href="#httpDelete">httpDelete</a></li>
357 <li><a href="#httpEncode64">httpEncode64</a></li>
358 <li><a href="#httpEncode64_2">httpEncode64_2</a></li>
359 <li><a href="#httpEncryption">httpEncryption</a></li>
360 <li><a href="#httpError">httpError</a></li>
361 <li><a href="#httpFieldValue">httpFieldValue</a></li>
362 <li><a href="#httpFlush">httpFlush</a></li>
363 <li><a href="#httpFlushWrite">httpFlushWrite</a></li>
364 <li><a href="#httpFreeCredentials">httpFreeCredentials</a></li>
365 <li><a href="#httpGet">httpGet</a></li>
366 <li><a href="#httpGetActivity">httpGetActivity</a></li>
367 <li><a href="#httpGetAddress">httpGetAddress</a></li>
368 <li><a href="#httpGetAuthString">httpGetAuthString</a></li>
369 <li><a href="#httpGetBlocking">httpGetBlocking</a></li>
370 <li><a href="#httpGetContentEncoding">httpGetContentEncoding</a></li>
371 <li><a href="#httpGetCookie">httpGetCookie</a></li>
372 <li><a href="#httpGetDateString">httpGetDateString</a></li>
373 <li><a href="#httpGetDateString2">httpGetDateString2</a></li>
374 <li><a href="#httpGetDateTime">httpGetDateTime</a></li>
375 <li><a href="#httpGetEncryption">httpGetEncryption</a></li>
376 <li><a href="#httpGetExpect">httpGetExpect</a></li>
377 <li><a href="#httpGetFd">httpGetFd</a></li>
378 <li><a href="#httpGetField">httpGetField</a></li>
379 <li><a href="#httpGetHostByName">httpGetHostByName</a></li>
380 <li><a href="#httpGetHostname">httpGetHostname</a></li>
381 <li><a href="#httpGetKeepAlive">httpGetKeepAlive</a></li>
382 <li><a href="#httpGetLength">httpGetLength</a></li>
383 <li><a href="#httpGetLength2">httpGetLength2</a></li>
384 <li><a href="#httpGetPending">httpGetPending</a></li>
385 <li><a href="#httpGetReady">httpGetReady</a></li>
386 <li><a href="#httpGetRemaining">httpGetRemaining</a></li>
387 <li><a href="#httpGetState">httpGetState</a></li>
388 <li><a href="#httpGetStatus">httpGetStatus</a></li>
389 <li><a href="#httpGetSubField">httpGetSubField</a></li>
390 <li><a href="#httpGetSubField2">httpGetSubField2</a></li>
391 <li><a href="#httpGetVersion">httpGetVersion</a></li>
392 <li><a href="#httpGets">httpGets</a></li>
393 <li><a href="#httpHead">httpHead</a></li>
394 <li><a href="#httpInitialize">httpInitialize</a></li>
395 <li><a href="#httpIsChunked">httpIsChunked</a></li>
396 <li><a href="#httpIsEncrypted">httpIsEncrypted</a></li>
397 <li><a href="#httpLoadCredentials">httpLoadCredentials</a></li>
398 <li><a href="#httpOptions">httpOptions</a></li>
399 <li><a href="#httpPeek">httpPeek</a></li>
400 <li><a href="#httpPost">httpPost</a></li>
401 <li><a href="#httpPut">httpPut</a></li>
402 <li><a href="#httpRead">httpRead</a></li>
403 <li><a href="#httpRead2">httpRead2</a></li>
404 <li><a href="#httpReadRequest">httpReadRequest</a></li>
405 <li><a href="#httpReconnect">httpReconnect</a></li>
406 <li><a href="#httpReconnect2">httpReconnect2</a></li>
407 <li><a href="#httpResolveHostname">httpResolveHostname</a></li>
408 <li><a href="#httpSaveCredentials">httpSaveCredentials</a></li>
409 <li><a href="#httpSeparate">httpSeparate</a></li>
410 <li><a href="#httpSeparate2">httpSeparate2</a></li>
411 <li><a href="#httpSeparateURI">httpSeparateURI</a></li>
412 <li><a href="#httpSetAuthString">httpSetAuthString</a></li>
413 <li><a href="#httpSetCookie">httpSetCookie</a></li>
414 <li><a href="#httpSetCredentials">httpSetCredentials</a></li>
415 <li><a href="#httpSetDefaultField">httpSetDefaultField</a></li>
416 <li><a href="#httpSetExpect">httpSetExpect</a></li>
417 <li><a href="#httpSetField">httpSetField</a></li>
418 <li><a href="#httpSetKeepAlive">httpSetKeepAlive</a></li>
419 <li><a href="#httpSetLength">httpSetLength</a></li>
420 <li><a href="#httpSetTimeout">httpSetTimeout</a></li>
421 <li><a href="#httpShutdown">httpShutdown</a></li>
422 <li><a href="#httpStateString">httpStateString</a></li>
423 <li><a href="#httpStatus">httpStatus</a></li>
424 <li><a href="#httpTrace">httpTrace</a></li>
425 <li><a href="#httpURIStatusString">httpURIStatusString</a></li>
426 <li><a href="#httpUpdate">httpUpdate</a></li>
427 <li><a href="#httpWait">httpWait</a></li>
428 <li><a href="#httpWrite">httpWrite</a></li>
429 <li><a href="#httpWrite2">httpWrite2</a></li>
430 <li><a href="#httpWriteResponse">httpWriteResponse</a></li>
431 <li><a href="#ippAddBoolean">ippAddBoolean</a></li>
432 <li><a href="#ippAddBooleans">ippAddBooleans</a></li>
433 <li><a href="#ippAddCollection">ippAddCollection</a></li>
434 <li><a href="#ippAddCollections">ippAddCollections</a></li>
435 <li><a href="#ippAddDate">ippAddDate</a></li>
436 <li><a href="#ippAddInteger">ippAddInteger</a></li>
437 <li><a href="#ippAddIntegers">ippAddIntegers</a></li>
438 <li><a href="#ippAddOctetString">ippAddOctetString</a></li>
439 <li><a href="#ippAddOutOfBand">ippAddOutOfBand</a></li>
440 <li><a href="#ippAddRange">ippAddRange</a></li>
441 <li><a href="#ippAddRanges">ippAddRanges</a></li>
442 <li><a href="#ippAddResolution">ippAddResolution</a></li>
443 <li><a href="#ippAddResolutions">ippAddResolutions</a></li>
444 <li><a href="#ippAddSeparator">ippAddSeparator</a></li>
445 <li><a href="#ippAddString">ippAddString</a></li>
446 <li><a href="#ippAddStringf">ippAddStringf</a></li>
447 <li><a href="#ippAddStringfv">ippAddStringfv</a></li>
448 <li><a href="#ippAddStrings">ippAddStrings</a></li>
449 <li><a href="#ippAttributeString">ippAttributeString</a></li>
450 <li><a href="#ippContainsInteger">ippContainsInteger</a></li>
451 <li><a href="#ippContainsString">ippContainsString</a></li>
452 <li><a href="#ippCopyAttribute">ippCopyAttribute</a></li>
453 <li><a href="#ippCopyAttributes">ippCopyAttributes</a></li>
454 <li><a href="#ippCreateRequestedArray">ippCreateRequestedArray</a></li>
455 <li><a href="#ippDateToTime">ippDateToTime</a></li>
456 <li><a href="#ippDelete">ippDelete</a></li>
457 <li><a href="#ippDeleteAttribute">ippDeleteAttribute</a></li>
458 <li><a href="#ippDeleteValues">ippDeleteValues</a></li>
459 <li><a href="#ippEnumString">ippEnumString</a></li>
460 <li><a href="#ippEnumValue">ippEnumValue</a></li>
461 <li><a href="#ippErrorString">ippErrorString</a></li>
462 <li><a href="#ippErrorValue">ippErrorValue</a></li>
463 <li><a href="#ippFindAttribute">ippFindAttribute</a></li>
464 <li><a href="#ippFindNextAttribute">ippFindNextAttribute</a></li>
465 <li><a href="#ippFirstAttribute">ippFirstAttribute</a></li>
466 <li><a href="#ippGetBoolean">ippGetBoolean</a></li>
467 <li><a href="#ippGetCollection">ippGetCollection</a></li>
468 <li><a href="#ippGetCount">ippGetCount</a></li>
469 <li><a href="#ippGetDate">ippGetDate</a></li>
470 <li><a href="#ippGetGroupTag">ippGetGroupTag</a></li>
471 <li><a href="#ippGetInteger">ippGetInteger</a></li>
472 <li><a href="#ippGetName">ippGetName</a></li>
473 <li><a href="#ippGetOctetString">ippGetOctetString</a></li>
474 <li><a href="#ippGetOperation">ippGetOperation</a></li>
475 <li><a href="#ippGetRange">ippGetRange</a></li>
476 <li><a href="#ippGetRequestId">ippGetRequestId</a></li>
477 <li><a href="#ippGetResolution">ippGetResolution</a></li>
478 <li><a href="#ippGetState">ippGetState</a></li>
479 <li><a href="#ippGetStatusCode">ippGetStatusCode</a></li>
480 <li><a href="#ippGetString">ippGetString</a></li>
481 <li><a href="#ippGetValueTag">ippGetValueTag</a></li>
482 <li><a href="#ippGetVersion">ippGetVersion</a></li>
483 <li><a href="#ippLength">ippLength</a></li>
484 <li><a href="#ippNew">ippNew</a></li>
485 <li><a href="#ippNewRequest">ippNewRequest</a></li>
486 <li><a href="#ippNewResponse">ippNewResponse</a></li>
487 <li><a href="#ippNextAttribute">ippNextAttribute</a></li>
488 <li><a href="#ippOpString">ippOpString</a></li>
489 <li><a href="#ippOpValue">ippOpValue</a></li>
490 <li><a href="#ippPort">ippPort</a></li>
491 <li><a href="#ippRead">ippRead</a></li>
492 <li><a href="#ippReadFile">ippReadFile</a></li>
493 <li><a href="#ippReadIO">ippReadIO</a></li>
494 <li><a href="#ippSetBoolean">ippSetBoolean</a></li>
495 <li><a href="#ippSetCollection">ippSetCollection</a></li>
496 <li><a href="#ippSetDate">ippSetDate</a></li>
497 <li><a href="#ippSetGroupTag">ippSetGroupTag</a></li>
498 <li><a href="#ippSetInteger">ippSetInteger</a></li>
499 <li><a href="#ippSetName">ippSetName</a></li>
500 <li><a href="#ippSetOctetString">ippSetOctetString</a></li>
501 <li><a href="#ippSetOperation">ippSetOperation</a></li>
502 <li><a href="#ippSetPort">ippSetPort</a></li>
503 <li><a href="#ippSetRange">ippSetRange</a></li>
504 <li><a href="#ippSetRequestId">ippSetRequestId</a></li>
505 <li><a href="#ippSetResolution">ippSetResolution</a></li>
506 <li><a href="#ippSetState">ippSetState</a></li>
507 <li><a href="#ippSetStatusCode">ippSetStatusCode</a></li>
508 <li><a href="#ippSetString">ippSetString</a></li>
509 <li><a href="#ippSetStringf">ippSetStringf</a></li>
510 <li><a href="#ippSetStringfv">ippSetStringfv</a></li>
511 <li><a href="#ippSetValueTag">ippSetValueTag</a></li>
512 <li><a href="#ippSetVersion">ippSetVersion</a></li>
513 <li><a href="#ippStateString">ippStateString</a></li>
514 <li><a href="#ippTagString">ippTagString</a></li>
515 <li><a href="#ippTagValue">ippTagValue</a></li>
516 <li><a href="#ippTimeToDate">ippTimeToDate</a></li>
517 <li><a href="#ippValidateAttribute">ippValidateAttribute</a></li>
518 <li><a href="#ippValidateAttributes">ippValidateAttributes</a></li>
519 <li><a href="#ippWrite">ippWrite</a></li>
520 <li><a href="#ippWriteFile">ippWriteFile</a></li>
521 <li><a href="#ippWriteIO">ippWriteIO</a></li>
522 <li><a href="#pwgFormatSizeName">pwgFormatSizeName</a></li>
523 <li><a href="#pwgInitSize">pwgInitSize</a></li>
524 <li><a href="#pwgMediaForLegacy">pwgMediaForLegacy</a></li>
525 <li><a href="#pwgMediaForPPD">pwgMediaForPPD</a></li>
526 <li><a href="#pwgMediaForPWG">pwgMediaForPWG</a></li>
527 <li><a href="#pwgMediaForSize">pwgMediaForSize</a></li>
528 </ul></li>
529 <li><a href="#TYPES">Data Types</a><ul class="subcontents">
530 <li><a href="#cups_acopy_func_t">cups_acopy_func_t</a></li>
531 <li><a href="#cups_afree_func_t">cups_afree_func_t</a></li>
532 <li><a href="#cups_ahash_func_t">cups_ahash_func_t</a></li>
533 <li><a href="#cups_array_func_t">cups_array_func_t</a></li>
534 <li><a href="#cups_array_t">cups_array_t</a></li>
535 <li><a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a></li>
536 <li><a href="#cups_dentry_t">cups_dentry_t</a></li>
537 <li><a href="#cups_dest_block_t">cups_dest_block_t</a></li>
538 <li><a href="#cups_dest_cb_t">cups_dest_cb_t</a></li>
539 <li><a href="#cups_dest_t">cups_dest_t</a></li>
540 <li><a href="#cups_dinfo_t">cups_dinfo_t</a></li>
541 <li><a href="#cups_dir_t">cups_dir_t</a></li>
542 <li><a href="#cups_encoding_t">cups_encoding_t</a></li>
543 <li><a href="#cups_file_t">cups_file_t</a></li>
544 <li><a href="#cups_job_t">cups_job_t</a></li>
545 <li><a href="#cups_lang_t">cups_lang_t</a></li>
546 <li><a href="#cups_option_t">cups_option_t</a></li>
547 <li><a href="#cups_password_cb2_t">cups_password_cb2_t</a></li>
548 <li><a href="#cups_password_cb_t">cups_password_cb_t</a></li>
549 <li><a href="#cups_ptype_t">cups_ptype_t</a></li>
550 <li><a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a></li>
551 <li><a href="#cups_size_t">cups_size_t</a></li>
552 <li><a href="#gss_auth_identity_desc">gss_auth_identity_desc</a></li>
553 <li><a href="#http_addr_t">http_addr_t</a></li>
554 <li><a href="#http_addrlist_t">http_addrlist_t</a></li>
555 <li><a href="#http_auth_t">http_auth_t</a></li>
556 <li><a href="#http_credential_t">http_credential_t</a></li>
557 <li><a href="#http_encoding_t">http_encoding_t</a></li>
558 <li><a href="#http_encryption_t">http_encryption_t</a></li>
559 <li><a href="#http_field_t">http_field_t</a></li>
560 <li><a href="#http_keepalive_t">http_keepalive_t</a></li>
561 <li><a href="#http_state_t">http_state_t</a></li>
562 <li><a href="#http_t">http_t</a></li>
563 <li><a href="#http_timeout_cb_t">http_timeout_cb_t</a></li>
564 <li><a href="#http_trust_t">http_trust_t</a></li>
565 <li><a href="#http_uri_coding_t">http_uri_coding_t</a></li>
566 <li><a href="#http_uri_status_t">http_uri_status_t</a></li>
567 <li><a href="#http_version_t">http_version_t</a></li>
568 <li><a href="#ipp_attribute_t">ipp_attribute_t</a></li>
569 <li><a href="#ipp_copycb_t">ipp_copycb_t</a></li>
570 <li><a href="#ipp_dstate_t">ipp_dstate_t</a></li>
571 <li><a href="#ipp_finish_t">ipp_finish_t</a></li>
572 <li><a href="#ipp_iocb_t">ipp_iocb_t</a></li>
573 <li><a href="#ipp_jcollate_t">ipp_jcollate_t</a></li>
574 <li><a href="#ipp_orient_t">ipp_orient_t</a></li>
575 <li><a href="#ipp_pstate_t">ipp_pstate_t</a></li>
576 <li><a href="#ipp_quality_t">ipp_quality_t</a></li>
577 <li><a href="#ipp_res_t">ipp_res_t</a></li>
578 <li><a href="#ipp_state_t">ipp_state_t</a></li>
579 <li><a href="#ipp_t">ipp_t</a></li>
580 <li><a href="#ipp_uchar_t">ipp_uchar_t</a></li>
581 <li><a href="#pwg_map_t">pwg_map_t</a></li>
582 <li><a href="#pwg_media_t">pwg_media_t</a></li>
583 <li><a href="#pwg_size_t">pwg_size_t</a></li>
584 </ul></li>
585 <li><a href="#STRUCTURES">Structures</a><ul class="subcontents">
586 <li><a href="#cups_dentry_s">cups_dentry_s</a></li>
587 <li><a href="#cups_dest_s">cups_dest_s</a></li>
588 <li><a href="#cups_job_s">cups_job_s</a></li>
589 <li><a href="#cups_lang_s">cups_lang_s</a></li>
590 <li><a href="#cups_option_s">cups_option_s</a></li>
591 <li><a href="#cups_size_s">cups_size_s</a></li>
592 <li><a href="#gss_auth_identity">gss_auth_identity</a></li>
593 <li><a href="#http_addrlist_s">http_addrlist_s</a></li>
594 <li><a href="#http_credential_s">http_credential_s</a></li>
595 <li><a href="#pollfd">pollfd</a></li>
596 <li><a href="#pwg_map_s">pwg_map_s</a></li>
597 <li><a href="#pwg_media_s">pwg_media_s</a></li>
598 <li><a href="#pwg_size_s">pwg_size_s</a></li>
599 </ul></li>
600 <li><a href="#VARIABLES">Variables</a><ul class="subcontents">
601 <li><a href="#CF_RETURNS_RETAINED">CF_RETURNS_RETAINED</a></li>
602 <li><a href="#environ">environ</a></li>
603 </ul></li>
604 <li><a href="#ENUMERATIONS">Enumerations</a><ul class="subcontents">
605 <li><a href="#cups_encoding_e">cups_encoding_e</a></li>
606 <li><a href="#cups_ptype_e">cups_ptype_e</a></li>
607 <li><a href="#http_auth_e">http_auth_e</a></li>
608 <li><a href="#http_encoding_e">http_encoding_e</a></li>
609 <li><a href="#http_encryption_e">http_encryption_e</a></li>
610 <li><a href="#http_field_e">http_field_e</a></li>
611 <li><a href="#http_keepalive_e">http_keepalive_e</a></li>
612 <li><a href="#http_state_e">http_state_e</a></li>
613 <li><a href="#http_status_e">http_status_e</a></li>
614 <li><a href="#http_trust_e">http_trust_e</a></li>
615 <li><a href="#http_uri_coding_e">http_uri_coding_e</a></li>
616 <li><a href="#http_uri_status_e">http_uri_status_e</a></li>
617 <li><a href="#http_version_e">http_version_e</a></li>
618 <li><a href="#ipp_dstate_e">ipp_dstate_e</a></li>
619 <li><a href="#ipp_finishings_e">ipp_finishings_e</a></li>
620 <li><a href="#ipp_jcollate_e">ipp_jcollate_e</a></li>
621 <li><a href="#ipp_jstate_e">ipp_jstate_e</a></li>
622 <li><a href="#ipp_op_e">ipp_op_e</a></li>
623 <li><a href="#ipp_orient_e">ipp_orient_e</a></li>
624 <li><a href="#ipp_pstate_e">ipp_pstate_e</a></li>
625 <li><a href="#ipp_quality_e">ipp_quality_e</a></li>
626 <li><a href="#ipp_res_e">ipp_res_e</a></li>
627 <li><a href="#ipp_state_e">ipp_state_e</a></li>
628 <li><a href="#ipp_status_e">ipp_status_e</a></li>
629 <li><a href="#ipp_tag_e">ipp_tag_e</a></li>
630 </ul></li>
631 </ul>
632 </div>
633 <div class="body">
634 <blockquote>
635 <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>
636</blockquote>
637 <h2><a id="Introduction">Introduction</a></h2>
638 <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>
639 <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>
640 <h3><a id="Guidelines">Guidelines</a></h3>
641 <p>When writing software that uses the &quot;cups&quot; library:</p>
642 <ul>
643 <li>Do not use undocumented or deprecated APIs,</li>
644 <li>Do not rely on pre-configured printers,</li>
645 <li>Do not assume that printers support specific features or formats, and</li>
646 <li>Do not rely on implementation details (PPDs, etc.)</li>
647</ul>
648 <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>
649 <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>
650 <h3><a id="TermsUsedinThisDocument">Terms Used in This Document</a></h3>
651 <p>A <em>Destination</em> is a printer or print queue that accepts print jobs. A <em>Print</em> Job* 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>
652 <h3><a id="CompilingProgramsThatUsetheCUPSAPI">Compiling Programs That Use the CUPS API</a></h3>
653 <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>
654 <p>The following simple program lists the available destinations:</p>
655 <pre><code>#include &lt;stdio.h&gt;
656#include &lt;cups/cups.h&gt;
657
658int print_dest(void *user_data, unsigned flags, cups_dest_t *dest)
659{
660 if (dest-&gt;instance)
661 printf(&quot;%s/%s\n&quot;, dest-&gt;name, dest-&gt;instance);
662 else
663 puts(dest-&gt;name);
664
665 return (1);
666}
667
668int main(void)
669{
670 cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, 0, 0, print_dest, NULL);
671
672 return (0);
673}
674</code></pre>
675 <h4><a id="CompilingwithXcode">Compiling with Xcode</a></h4>
676 <p>In Xcode, choose <em>New</em> Project...* from the <em>File</em> menu (or press SHIFT+CMD+N), then select the <em>Command</em> Line Tool* 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>
677 <p>In the project window, click on the <em>Build</em> Phases* group and expand the <em>Link</em> Binary with Libraries* section. Click <em>+</em>, type &quot;libcups&quot; to show the library, and then double-click on <code>libcups.tbd</code>.</p>
678 <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>
679 <h4><a id="CompilingwithGCC">Compiling with GCC</a></h4>
680 <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>
681 <pre><code>gcc -o simple `cups-config --cflags` simple.c `cups-config --libs`
682./simple
683</code></pre>
684 <p>The <code>cups-config</code> command provides the compiler flags (`cups-config --cflags`) and libraries (`cups-config --libs`) needed for the local system.</p>
685 <h2><a id="WorkingwithDestinations">Working with Destinations</a></h2>
686 <p>Destinations, which in CUPS represent individual printers or classes (collections) of printers, are represented by the <code>cups_dest_t</code> structure which includes the name (`name`), instance (`instance`, saved options/settings), whether the destination is the default for the user (`is_default`), and the options and attributes associated with that destination (`num_options` and <code>options</code>).</p>
687 <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>
688 <h3><a id="FindingAvailableDestinations">Finding Available Destinations</a></h3>
689 <p>The <code>cupsEnumDests</code> function finds all of the available destinations:</p>
690 <pre><code> int
691 cupsEnumDests(unsigned flags, int msec, int *cancel,
692 cups_ptype_t type, cups_ptype_t mask,
693 cups_dest_cb_t cb, void *user_data)
694</code></pre>
695 <p>The <code>flags</code> argument specifies enumeration options, which at present must be <code>CUPS_DEST_FLAGS_NONE</code>.</p>
696 <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>
697 <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>
698 <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_REMOTE</code> for the <code>mask</code> argument. The following constants can be used for filtering:</p>
699 <ul>
700 <li><code>CUPS_PRINTER_CLASS</code>: A collection of destinations.</li>
701 <li><code>CUPS_PRINTER_FAX</code>: A facsimile device.</li>
702 <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> constant passed in the <code>mask</code> argument.</li>
703 <li><code>CUPS_PRINTER_REMOTE</code>: A remote printer or class.</li>
704 <li><code>CUPS_PRINTER_BW</code>: Can do B&amp;W printing.</li>
705 <li><code>CUPS_PRINTER_COLOR</code>: Can do color printing.</li>
706 <li><code>CUPS_PRINTER_DUPLEX</code>: Can do two-sided printing.</li>
707 <li><code>CUPS_PRINTER_STAPLE</code>: Can staple output.</li>
708 <li><code>CUPS_PRINTER_COLLATE</code>: Can quickly collate copies.</li>
709 <li><code>CUPS_PRINTER_PUNCH</code>: Can punch output.</li>
710 <li><code>CUPS_PRINTER_COVER</code>: Can cover output.</li>
711 <li><code>CUPS_PRINTER_BIND</code>: Can bind output.</li>
712 <li><code>CUPS_PRINTER_SORT</code>: Can sort output (mailboxes, etc.)</li>
713 <li><code>CUPS_PRINTER_SMALL</code>: Can print on Letter/Legal/A4-size media.</li>
714 <li><code>CUPS_PRINTER_MEDIUM</code>: Can print on Tabloid/B/C/A3/A2-size media.</li>
715 <li><code>CUPS_PRINTER_LARGE</code>: Can print on D/E/A1/A0-size media.</li>
716 <li><code>CUPS_PRINTER_VARIABLE</code>: Can print on rolls and custom-size media.</li>
717</ul>
718 <p>The <code>cb</code> argument specifies a function to call for every destination that is found:</p>
719 <pre><code>typedef int (*cups_dest_cb_t)(void *user_data,
720 unsigned flags,
721 cups_dest_t *dest);
722</code></pre>
723 <p>The callback function receives a copy of the <code>user_data</code> argument along with a bitfield (`flags`) and the destination that was found. The <code>flags</code> argument can have any of the following constant (bit) values set:</p>
724 <ul>
725 <li><code>CUPS_DEST_FLAGS_MORE</code>: There are more destinations coming.</li>
726 <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>
727 <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>
728</ul>
729 <p>The callback function returns 0 to stop enumeration or 1 to continue.</p>
730 <p>The following example shows how to use <code>cupsEnumDests</code> to get a filtered array of destinations:</p>
731 <pre><code>typedef struct
732{
733 int num_dests;
734 cups_dest_t *dests;
735} my_user_data_t;
736
737int
738my_dest_cb(my_user_data_t *user_data, unsigned flags,
739 cups_dest_t *dest)
740{
741 if (flags &amp; CUPS_DEST_FLAGS_REMOVED)
742 {
743 /*
744 * Remove destination from array...
745 */
746
747 user_data-&gt;num_dests =
748 cupsRemoveDest(dest-&gt;name, dest-&gt;instance,
749 user_data-&gt;num_dests,
750 &amp;(user_data-&gt;dests));
751 }
752 else
753 {
754 /*
755 * Add destination to array...
756 */
757
758 user_data-&gt;num_dests =
759 cupsCopyDest(dest, user_data-&gt;num_dests,
760 &amp;(user_data-&gt;dests));
761 }
762
763 return (1);
764}
765
766int
767my_get_dests(cups_ptype_t type, cups_ptype_t mask,
768 cups_dest_t **dests)
769{
770 my_user_data_t user_data = { 0, NULL };
771
772 if (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, type,
773 mask, (cups_dest_cb_t)my_dest_cb,
774 &amp;user_data))
775 {
776 /*
777 * An error occurred, free all of the destinations and
778 * return...
779 */
780
781 cupsFreeDests(user_data.num_dests, user_dasta.dests);
782
783 *dests = NULL;
784
785 return (0);
786 }
787
788 /*
789 * Return the destination array...
790 */
791
792 *dests = user_data.dests;
793
794 return (user_data.num_dests);
795}
796</code></pre>
797 <h3><a id="BasicDestinationInformation">Basic Destination Information</a></h3>
798 <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>
799 <ul>
800 <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>
801 <li>&quot;printer-info&quot;: The human-readable description of the destination such as &quot;My Laser Printer&quot;.</li>
802 <li>&quot;printer-is-accepting-jobs&quot;: &quot;true&quot; if the destination is accepting new jobs, &quot;false&quot; otherwise.</li>
803 <li>&quot;printer-is-shared&quot;: &quot;true&quot; if the destination is being shared with other computers, &quot;false&quot; otherwise.</li>
804 <li>&quot;printer-location&quot;: The human-readable location of the destination such as &quot;Lab 4&quot;.</li>
805 <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>
806 <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>
807 <li>&quot;printer-state-change-time&quot;: The UNIX time when the destination entered the current state.</li>
808 <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>
809 <li>&quot;printer-type&quot;: The <code>cups_ptype_t</code> value associated with the destination.</li>
810</ul>
811 <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>
812 <pre><code>const char *model = cupsGetOption(&quot;printer-make-and-model&quot;,
813 dest-&gt;num_options,
814 dest-&gt;options);
815</code></pre>
816 <h3><a id="DetailedDestinationInformation">Detailed Destination Information</a></h3>
817 <p>Once a destination has been chosen, the <code>cupsCopyDestInfo</code> function can be used to gather detailed information about the destination:</p>
818 <pre><code>cups_dinfo_t *
819cupsCopyDestInfo(http_t *http, cups_dest_t *dest);
820</code></pre>
821 <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>
822 <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>
823 <h4><a id="GettingSupportedOptionsandValues">Getting Supported Options and Values</a></h4>
824 <p>The <code>cupsCheckDestSupported</code> function can be used to test whether a particular option or option and value is supported:</p>
825 <pre><code>int
826cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
827 cups_dinfo_t *info,
828 const char *option,
829 const char *value);
830</code></pre>
831 <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>
832 <ul>
833 <li><code>CUPS_COPIES</code>: Controls the number of copies that are produced.</li>
834 <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>
835 <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>
836 <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>
837 <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>
838 <li><code>CUPS_NUMBER_UP</code>: Controls the number of document pages that are placed on each media side.</li>
839 <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>
840 <li><code>CUPS_PRINT_COLOR_MODE</code>: Controls whether the output is in color (`CUPS_PRINT_COLOR_MODE_COLOR`), grayscale (`CUPS_PRINT_COLOR_MODE_MONOCHROME`), or either (`CUPS_PRINT_COLOR_MODE_AUTO`).</li>
841 <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>
842 <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>
843</ul>
844 <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>
845 <p>The <code>cupsFindDestSupported</code> function returns the IPP attribute containing the supported values for a given option:</p>
846 <pre><code> ipp_attribute_t *
847 cupsFindDestSupported(http_t *http, cups_dest_t *dest,
848 cups_dinfo_t *dinfo,
849 const char *option);
850</code></pre>
851 <p>For example, the following code prints the supported finishing processes for a destination, if any, to the standard output:</p>
852 <pre><code>cups_dinfo_t *info = cupsCopyDestInfo(CUPS_HTTP_DEFAULT,
853 dest);
854
855if (cupsCheckDestSupported(CUPS_HTTP_DEFAULT, dest, info,
856 CUPS_FINISHINGS, NULL))
857{
858 ipp_attribute_t *finishings =
859 cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
860 CUPS_FINISHINGS);
861 int i, count = ippGetCount(finishings);
862
863 puts(&quot;finishings supported:&quot;);
864 for (i = 0; i &lt; count; i ++)
865 printf(&quot; %d\n&quot;, ippGetInteger(finishings, i));
866}
867else
868 puts(&quot;finishings not supported.&quot;);
869</code></pre>
870 <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>
871 <pre><code>ipp_attribute_t *attrs =
872 cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
873 &quot;job-creation-attributes&quot;);
874int i, count = ippGetCount(attrs);
875
876for (i = 0; i &lt; count; i ++)
877 puts(ippGetString(attrs, i, NULL));
878</code></pre>
879 <h4><a id="GettingDefaultValues">Getting Default Values</a></h4>
880 <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>
881 <pre><code>ipp_attribute_t *
882cupsFindDestDefault(http_t *http, cups_dest_t *dest,
883 cups_dinfo_t *dinfo,
884 const char *option);
885</code></pre>
886 <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>
887 <pre><code>const char *def_value =
888 cupsGetOption(CUPS_FINISHINGS, dest-&gt;num_options,
889 dest-&gt;options);
890ipp_attribute_t *def_attr =
891 cupsFindDestDefault(CUPS_HTTP_DEFAULT, dest, info,
892 CUPS_FINISHINGS);
893
894if (def_value != NULL)
895{
896 printf(&quot;Default finishings: %s\n&quot;, def_value);
897}
898else
899{
900 int i, count = ippGetCount(def_attr);
901
902 printf(&quot;Default finishings: %d&quot;,
903 ippGetInteger(def_attr, 0));
904 for (i = 1; i &lt; count; i ++)
905 printf(&quot;,%d&quot;, ippGetInteger(def_attr, i));
906 putchar('\n');
907}
908</code></pre>
909 <h4><a id="GettingReadyLoadedValues">Getting Ready (Loaded) Values</a></h4>
910 <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>
911 <p>The <code>cupsFindDestReady</code> function finds the IPP attribute containing the ready values for a given option:</p>
912 <pre><code>ipp_attribute_t *
913cupsFindDestReady(http_t *http, cups_dest_t *dest,
914 cups_dinfo_t *dinfo, const char *option);
915</code></pre>
916 <p>For example, the following code lists the ready finishing processes:</p>
917 <pre><code>ipp_attribute_t *ready_finishings =
918 cupsFindDestReady(CUPS_HTTP_DEFAULT, dest, info,
919 CUPS_FINISHINGS);
920
921if (ready_finishings != NULL)
922{
923 int i, count = ippGetCount(ready_finishings);
924
925 puts(&quot;finishings ready:&quot;);
926 for (i = 0; i &lt; count; i ++)
927 printf(&quot; %d\n&quot;, ippGetInteger(ready_finishings, i));
928}
929else
930 puts(&quot;no finishings are ready.&quot;);
931</code></pre>
932 <h4><a id="MediaSizeOptions">Media Size Options</a></h4>
933 <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>
934 <pre><code>typedef struct cups_size_s
935{
936 char media[128];
937 int width, length;
938 int bottom, left, right, top;
939} cups_size_t;
940</code></pre>
941 <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>
942 <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>
943 <pre><code>int
944cupsGetDestMediaByName(http_t *http, cups_dest_t *dest,
945 cups_dinfo_t *dinfo,
946 const char *media,
947 unsigned flags, cups_size_t *size);
948
949int
950cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest,
951 cups_dinfo_t *dinfo,
952 int width, int length,
953 unsigned flags, cups_size_t *size);
954</code></pre>
955 <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>
956 <ul>
957 <li><code>CUPS_MEDIA_FLAGS_DEFAULT</code>: Find the closest size supported by the printer.</li>
958 <li><code>CUPS_MEDIA_FLAGS_BORDERLESS</code>: Find a borderless size.</li>
959 <li><code>CUPS_MEDIA_FLAGS_DUPLEX</code>: Find a size compatible with two-sided printing.</li>
960 <li><code>CUPS_MEDIA_FLAGS_EXACT</code>: Find an exact match for the size.</li>
961 <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>
962</ul>
963 <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>
964 <p>For example, the following code prints the margins for two-sided printing on US Letter media:</p>
965 <pre><code>cups_size_t size;
966
967if (cupsGetDestMediaByName(CUPS_HTTP_DEFAULT, dest, info,
968 CUPS_MEDIA_LETTER,
969 CUPS_MEDIA_FLAGS_DUPLEX, &amp;size))
970{
971 puts(&quot;Margins for duplex US Letter:&quot;);
972 printf(&quot; Bottom: %.2fin\n&quot;, size.bottom / 2540.0);
973 printf(&quot; Left: %.2fin\n&quot;, size.left / 2540.0);
974 printf(&quot; Right: %.2fin\n&quot;, size.right / 2540.0);
975 printf(&quot; Top: %.2fin\n&quot;, size.top / 2540.0);
976}
977else
978 puts(&quot;Margins for duplex US Letter are not available.&quot;);
979</code></pre>
980 <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>
981 <pre><code>int
982cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest,
983 cups_dinfo_t *dinfo, int n,
984 unsigned flags, cups_size_t *size);
985
986int
987cupsGetDestMediaCount(http_t *http, cups_dest_t *dest,
988 cups_dinfo_t *dinfo, unsigned flags);
989</code></pre>
990 <p>For example, the following code prints the list of ready media and corresponding margins:</p>
991 <pre><code>cups_size_t size;
992int i;
993int count = cupsGetDestMediaCount(CUPS_HTTP_DEFAULT,
994 dest, info,
995 CUPS_MEDIA_FLAGS_READY);
996
997for (i = 0; i &lt; count; i ++)
998{
999 if (cupsGetDestMediaByIndex(CUPS_HTTP_DEFAULT, dest, info,
1000 i, CUPS_MEDIA_FLAGS_READY,
1001 &amp;size))
1002 {
1003 printf(&quot;%s:\n&quot;, size.name);
1004 printf(&quot; Width: %.2fin\n&quot;, size.width / 2540.0);
1005 printf(&quot; Length: %.2fin\n&quot;, size.length / 2540.0);
1006 printf(&quot; Bottom: %.2fin\n&quot;, size.bottom / 2540.0);
1007 printf(&quot; Left: %.2fin\n&quot;, size.left / 2540.0);
1008 printf(&quot; Right: %.2fin\n&quot;, size.right / 2540.0);
1009 printf(&quot; Top: %.2fin\n&quot;, size.top / 2540.0);
1010 }
1011}
1012</code></pre>
1013 <p>Finally, the <code>cupsGetDestMediaDefault</code> function returns the default media size:</p>
1014 <pre><code>int
1015cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
1016 cups_dinfo_t *dinfo, unsigned flags,
1017 cups_size_t *size);
1018</code></pre>
1019 <h4><a id="LocalizingOptionsandValues">Localizing Options and Values</a></h4>
1020 <p>CUPS provides three functions to get localized versions of options and values: <code>cupsLocalizeDestMedia</code>, <code>cupsLocalizeDestOption</code>, and <code>cupsLocalizeDestValue</code>:</p>
1021 <pre><code>const char *
1022cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest,
1023 cups_dinfo_t *info, unsigned flags,
1024 cups_size_t *size);
1025
1026const char *
1027cupsLocalizeDestOption(http_t *http, cups_dest_t *dest,
1028 cups_dinfo_t *info,
1029 const char *option);
1030
1031const char *
1032cupsLocalizeDestValue(http_t *http, cups_dest_t *dest,
1033 cups_dinfo_t *info,
1034 const char *option, const char *value);
1035</code></pre>
1036 <h3><a id="SubmittingaPrintJob">Submitting a Print Job</a></h3>
1037 <p>Once you are ready to submit a print job, you create a job using the <code>cupsCreateDestJob</code> function:</p>
1038 <pre><code>ipp_status_t
1039cupsCreateDestJob(http_t *http, cups_dest_t *dest,
1040 cups_dinfo_t *info, int *job_id,
1041 const char *title, int num_options,
1042 cups_option_t *options);
1043</code></pre>
1044 <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>
1045 <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>
1046 <p>For example, the following code creates a new job that will print 42 copies of a two-sided US Letter document:</p>
1047 <pre><code>int job_id = 0;
1048int num_options = 0;
1049cups_option_t *options = NULL;
1050
1051num_options = cupsAddOption(CUPS_COPIES, &quot;42&quot;,
1052 num_options, &amp;options);
1053num_options = cupsAddOption(CUPS_MEDIA, CUPS_MEDIA_LETTER,
1054 num_options, &amp;options);
1055num_options = cupsAddOption(CUPS_SIDES,
1056 CUPS_SIDES_TWO_SIDED_PORTRAIT,
1057 num_options, &amp;options);
1058
1059if (cupsCreateDestJob(CUPS_HTTP_DEFAULT, dest, info,
1060 &amp;job_id, &quot;My Document&quot;, num_options,
1061 options) == IPP_STATUS_OK)
1062 printf(&quot;Created job: %d\n&quot;, job_id);
1063else
1064 printf(&quot;Unable to create job: %s\n&quot;,
1065 cupsLastErrorString());
1066</code></pre>
1067 <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>
1068 <pre><code>http_status_t
1069cupsStartDestDocument(http_t *http, cups_dest_t *dest,
1070 cups_dinfo_t *info, int job_id,
1071 const char *docname,
1072 const char *format,
1073 int num_options,
1074 cups_option_t *options,
1075 int last_document);
1076
1077http_status_t
1078cupsWriteRequestData(http_t *http, const char *buffer,
1079 size_t length);
1080
1081ipp_status_t
1082cupsFinishDestDocument(http_t *http, cups_dest_t *dest,
1083 cups_dinfo_t *info);
1084</code></pre>
1085 <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>
1086 <ul>
1087 <li><code>CUPS_FORMAT_JPEG</code>: &quot;image/jpeg&quot;</li>
1088 <li><code>CUPS_FORMAT_PDF</code>: &quot;application/pdf&quot;</li>
1089 <li><code>CUPS_FORMAT_POSTSCRIPT</code>: &quot;application/postscript&quot;</li>
1090 <li><code>CUPS_FORMAT_TEXT</code>: &quot;text/plain&quot;</li>
1091</ul>
1092 <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>
1093 <p>For example, the following code submits a PDF file to the job that was just created:</p>
1094 <pre><code>FILE *fp = fopen(&quot;filename.pdf&quot;, &quot;rb&quot;);
1095size_t bytes;
1096char buffer[65536];
1097
1098if (cupsStartDestDocument(CUPS_HTTP_DEFAULT, dest, info,
1099 job_id, &quot;filename.pdf&quot;, 0, NULL,
1100 1) == HTTP_STATUS_CONTINUE)
1101{
1102 while ((bytes = fread(buffer, 1, sizeof(buffer), fp)) &gt; 0)
1103 if (cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer,
1104 bytes) != HTTP_STATUS_CONTINUE)
1105 break;
1106
1107 if (cupsFinishDestDocument(CUPS_HTTP_DEFAULT, dest,
1108 info) == IPP_STATUS_OK)
1109 puts(&quot;Document send succeeded.&quot;);
1110 else
1111 printf(&quot;Document send failed: %s\n&quot;,
1112 cupsLastErrorString());
1113}
1114
1115fclose(fp);
1116</code></pre>
1117 <h2 class="title"><a id="FUNCTIONS">Functions</a></h2>
1118<h3 class="function"><a id="cupsAddDest">cupsAddDest</a></h3>
1119 <p class="description">Add a destination to the list of destinations.</p>
1120<p class="code">
1121int cupsAddDest (<br>
1122&#160;&#160;&#160;&#160;const char *name,<br>
1123&#160;&#160;&#160;&#160;const char *instance,<br>
1124&#160;&#160;&#160;&#160;int num_dests,<br>
1125&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> **dests<br>
1126);</p>
1127<h4 class="parameters">Parameters</h4>
1128<dl>
1129<dt>name</dt>
1130 <dd class="description">Destination name</dd>
1131<dt>instance</dt>
1132 <dd class="description">Instance name or <code>NULL</code> for none/primary</dd>
1133<dt>num_dests</dt>
1134 <dd class="description">Number of destinations</dd>
1135<dt>dests</dt>
1136 <dd class="description">Destinations</dd>
1137</dl>
1138<h4 class="returnvalue">Return Value</h4>
1139 <p class="description">New number of destinations</p>
1140<h4 class="discussion">Discussion</h4>
1141 <p class="discussion">This function cannot be used to add a new class or printer queue,
1142it only adds a new container of saved options for the named
1143destination or instance.<br>
1144<br>
1145If the named destination already exists, the destination list is
1146returned unchanged. Adding a new instance of a destination creates
1147a copy of that destination's options.<br>
1148<br>
1149Use the <a href="#cupsSaveDests"><code>cupsSaveDests</code></a> function to save the updated list of
1150destinations to the user's lpoptions file.</p>
1151<h3 class="function"><a id="cupsAddOption">cupsAddOption</a></h3>
1152 <p class="description">Add an option to an option array.</p>
1153<p class="code">
1154int cupsAddOption (<br>
1155&#160;&#160;&#160;&#160;const char *name,<br>
1156&#160;&#160;&#160;&#160;const char *value,<br>
1157&#160;&#160;&#160;&#160;int num_options,<br>
1158&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **options<br>
1159);</p>
1160<h4 class="parameters">Parameters</h4>
1161<dl>
1162<dt>name</dt>
1163 <dd class="description">Name of option</dd>
1164<dt>value</dt>
1165 <dd class="description">Value of option</dd>
1166<dt>num_options</dt>
1167 <dd class="description">Number of options</dd>
1168<dt>options</dt>
1169 <dd class="description">Pointer to options</dd>
1170</dl>
1171<h4 class="returnvalue">Return Value</h4>
1172 <p class="description">Number of options</p>
1173<h4 class="discussion">Discussion</h4>
1174 <p class="discussion">New option arrays can be initialized simply by passing 0 for the
1175&quot;num_options&quot; parameter.</p>
1176<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayAdd">cupsArrayAdd</a></h3>
1177 <p class="description">Add an element to the array.</p>
1178<p class="code">
1179int cupsArrayAdd (<br>
1180&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a,<br>
1181&#160;&#160;&#160;&#160;void *e<br>
1182);</p>
1183<h4 class="parameters">Parameters</h4>
1184<dl>
1185<dt>a</dt>
1186 <dd class="description">Array</dd>
1187<dt>e</dt>
1188 <dd class="description">Element</dd>
1189</dl>
1190<h4 class="returnvalue">Return Value</h4>
1191 <p class="description">1 on success, 0 on failure</p>
1192<h4 class="discussion">Discussion</h4>
1193 <p class="discussion">When adding an element to a sorted array, non-unique elements are
1194appended at the end of the run of identical elements. For unsorted arrays,
1195the element is appended to the end of the array.
1196
1197</p>
1198<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayClear">cupsArrayClear</a></h3>
1199 <p class="description">Clear the array.</p>
1200<p class="code">
1201void cupsArrayClear (<br>
1202&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a<br>
1203);</p>
1204<h4 class="parameters">Parameters</h4>
1205<dl>
1206<dt>a</dt>
1207 <dd class="description">Array</dd>
1208</dl>
1209<h4 class="discussion">Discussion</h4>
1210 <p class="discussion">This function is equivalent to removing all elements in the array.
1211The caller is responsible for freeing the memory used by the
1212elements themselves.
1213
1214</p>
1215<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayCount">cupsArrayCount</a></h3>
1216 <p class="description">Get the number of elements in the array.</p>
1217<p class="code">
1218int cupsArrayCount (<br>
1219&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a<br>
1220);</p>
1221<h4 class="parameters">Parameters</h4>
1222<dl>
1223<dt>a</dt>
1224 <dd class="description">Array</dd>
1225</dl>
1226<h4 class="returnvalue">Return Value</h4>
1227 <p class="description">Number of elements</p>
1228<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayCurrent">cupsArrayCurrent</a></h3>
1229 <p class="description">Return the current element in the array.</p>
1230<p class="code">
1231void *cupsArrayCurrent (<br>
1232&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a<br>
1233);</p>
1234<h4 class="parameters">Parameters</h4>
1235<dl>
1236<dt>a</dt>
1237 <dd class="description">Array</dd>
1238</dl>
1239<h4 class="returnvalue">Return Value</h4>
1240 <p class="description">Element</p>
1241<h4 class="discussion">Discussion</h4>
1242 <p class="discussion">The current element is undefined until you call <a href="#cupsArrayFind"><code>cupsArrayFind</code></a>,
1243<a href="#cupsArrayFirst"><code>cupsArrayFirst</code></a>, or <a href="#cupsArrayIndex"><code>cupsArrayIndex</code></a>, or <a href="#cupsArrayLast"><code>cupsArrayLast</code></a>.
1244
1245</p>
1246<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayDelete">cupsArrayDelete</a></h3>
1247 <p class="description">Free all memory used by the array.</p>
1248<p class="code">
1249void cupsArrayDelete (<br>
1250&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a<br>
1251);</p>
1252<h4 class="parameters">Parameters</h4>
1253<dl>
1254<dt>a</dt>
1255 <dd class="description">Array</dd>
1256</dl>
1257<h4 class="discussion">Discussion</h4>
1258 <p class="discussion">The caller is responsible for freeing the memory used by the
1259elements themselves.
1260
1261</p>
1262<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayDup">cupsArrayDup</a></h3>
1263 <p class="description">Duplicate the array.</p>
1264<p class="code">
1265<a href="#cups_array_t">cups_array_t</a> *cupsArrayDup (<br>
1266&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a<br>
1267);</p>
1268<h4 class="parameters">Parameters</h4>
1269<dl>
1270<dt>a</dt>
1271 <dd class="description">Array</dd>
1272</dl>
1273<h4 class="returnvalue">Return Value</h4>
1274 <p class="description">Duplicate array</p>
1275<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayFind">cupsArrayFind</a></h3>
1276 <p class="description">Find an element in the array.</p>
1277<p class="code">
1278void *cupsArrayFind (<br>
1279&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a,<br>
1280&#160;&#160;&#160;&#160;void *e<br>
1281);</p>
1282<h4 class="parameters">Parameters</h4>
1283<dl>
1284<dt>a</dt>
1285 <dd class="description">Array</dd>
1286<dt>e</dt>
1287 <dd class="description">Element</dd>
1288</dl>
1289<h4 class="returnvalue">Return Value</h4>
1290 <p class="description">Element found or <code>NULL</code></p>
1291<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayFirst">cupsArrayFirst</a></h3>
1292 <p class="description">Get the first element in the array.</p>
1293<p class="code">
1294void *cupsArrayFirst (<br>
1295&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a<br>
1296);</p>
1297<h4 class="parameters">Parameters</h4>
1298<dl>
1299<dt>a</dt>
1300 <dd class="description">Array</dd>
1301</dl>
1302<h4 class="returnvalue">Return Value</h4>
1303 <p class="description">First element or <code>NULL</code> if the array is empty</p>
1304<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsArrayGetIndex">cupsArrayGetIndex</a></h3>
1305 <p class="description">Get the index of the current element.</p>
1306<p class="code">
1307int cupsArrayGetIndex (<br>
1308&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a<br>
1309);</p>
1310<h4 class="parameters">Parameters</h4>
1311<dl>
1312<dt>a</dt>
1313 <dd class="description">Array</dd>
1314</dl>
1315<h4 class="returnvalue">Return Value</h4>
1316 <p class="description">Index of the current element, starting at 0</p>
1317<h4 class="discussion">Discussion</h4>
1318 <p class="discussion">The current element is undefined until you call <a href="#cupsArrayFind"><code>cupsArrayFind</code></a>,
1319<a href="#cupsArrayFirst"><code>cupsArrayFirst</code></a>, or <a href="#cupsArrayIndex"><code>cupsArrayIndex</code></a>, or <a href="#cupsArrayLast"><code>cupsArrayLast</code></a>.
1320
1321</p>
1322<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsArrayGetInsert">cupsArrayGetInsert</a></h3>
1323 <p class="description">Get the index of the last inserted element.</p>
1324<p class="code">
1325int cupsArrayGetInsert (<br>
1326&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a<br>
1327);</p>
1328<h4 class="parameters">Parameters</h4>
1329<dl>
1330<dt>a</dt>
1331 <dd class="description">Array</dd>
1332</dl>
1333<h4 class="returnvalue">Return Value</h4>
1334 <p class="description">Index of the last inserted element, starting at 0</p>
1335<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayIndex">cupsArrayIndex</a></h3>
1336 <p class="description">Get the N-th element in the array.</p>
1337<p class="code">
1338void *cupsArrayIndex (<br>
1339&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a,<br>
1340&#160;&#160;&#160;&#160;int n<br>
1341);</p>
1342<h4 class="parameters">Parameters</h4>
1343<dl>
1344<dt>a</dt>
1345 <dd class="description">Array</dd>
1346<dt>n</dt>
1347 <dd class="description">Index into array, starting at 0</dd>
1348</dl>
1349<h4 class="returnvalue">Return Value</h4>
1350 <p class="description">N-th element or <code>NULL</code></p>
1351<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayInsert">cupsArrayInsert</a></h3>
1352 <p class="description">Insert an element in the array.</p>
1353<p class="code">
1354int cupsArrayInsert (<br>
1355&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a,<br>
1356&#160;&#160;&#160;&#160;void *e<br>
1357);</p>
1358<h4 class="parameters">Parameters</h4>
1359<dl>
1360<dt>a</dt>
1361 <dd class="description">Array</dd>
1362<dt>e</dt>
1363 <dd class="description">Element</dd>
1364</dl>
1365<h4 class="returnvalue">Return Value</h4>
1366 <p class="description">0 on failure, 1 on success</p>
1367<h4 class="discussion">Discussion</h4>
1368 <p class="discussion">When inserting an element in a sorted array, non-unique elements are
1369inserted at the beginning of the run of identical elements. For unsorted
1370arrays, the element is inserted at the beginning of the array.
1371
1372</p>
1373<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayLast">cupsArrayLast</a></h3>
1374 <p class="description">Get the last element in the array.</p>
1375<p class="code">
1376void *cupsArrayLast (<br>
1377&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a<br>
1378);</p>
1379<h4 class="parameters">Parameters</h4>
1380<dl>
1381<dt>a</dt>
1382 <dd class="description">Array</dd>
1383</dl>
1384<h4 class="returnvalue">Return Value</h4>
1385 <p class="description">Last element or <code>NULL</code> if the array is empty</p>
1386<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayNew">cupsArrayNew</a></h3>
1387 <p class="description">Create a new array.</p>
1388<p class="code">
1389<a href="#cups_array_t">cups_array_t</a> *cupsArrayNew (<br>
1390&#160;&#160;&#160;&#160;<a href="#cups_array_func_t">cups_array_func_t</a> f,<br>
1391&#160;&#160;&#160;&#160;void *d<br>
1392);</p>
1393<h4 class="parameters">Parameters</h4>
1394<dl>
1395<dt>f</dt>
1396 <dd class="description">Comparison function or <code>NULL</code> for an unsorted array</dd>
1397<dt>d</dt>
1398 <dd class="description">User data pointer or <code>NULL</code></dd>
1399</dl>
1400<h4 class="returnvalue">Return Value</h4>
1401 <p class="description">Array</p>
1402<h4 class="discussion">Discussion</h4>
1403 <p class="discussion">The comparison function (&quot;f&quot;) is used to create a sorted array. The function
1404receives pointers to two elements and the user data pointer (&quot;d&quot;) - the user
1405data pointer argument can safely be omitted when not required so functions
1406like <code>strcmp</code> can be used for sorted string arrays.
1407
1408</p>
1409<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsArrayNew2">cupsArrayNew2</a></h3>
1410 <p class="description">Create a new array with hash.</p>
1411<p class="code">
1412<a href="#cups_array_t">cups_array_t</a> *cupsArrayNew2 (<br>
1413&#160;&#160;&#160;&#160;<a href="#cups_array_func_t">cups_array_func_t</a> f,<br>
1414&#160;&#160;&#160;&#160;void *d,<br>
1415&#160;&#160;&#160;&#160;<a href="#cups_ahash_func_t">cups_ahash_func_t</a> h,<br>
1416&#160;&#160;&#160;&#160;int hsize<br>
1417);</p>
1418<h4 class="parameters">Parameters</h4>
1419<dl>
1420<dt>f</dt>
1421 <dd class="description">Comparison function or <code>NULL</code> for an unsorted array</dd>
1422<dt>d</dt>
1423 <dd class="description">User data or <code>NULL</code></dd>
1424<dt>h</dt>
1425 <dd class="description">Hash function or <code>NULL</code> for unhashed lookups</dd>
1426<dt>hsize</dt>
1427 <dd class="description">Hash size (&gt;= 0)</dd>
1428</dl>
1429<h4 class="returnvalue">Return Value</h4>
1430 <p class="description">Array</p>
1431<h4 class="discussion">Discussion</h4>
1432 <p class="discussion">The comparison function (&quot;f&quot;) is used to create a sorted array. The function
1433receives pointers to two elements and the user data pointer (&quot;d&quot;) - the user
1434data pointer argument can safely be omitted when not required so functions
1435like <code>strcmp</code> can be used for sorted string arrays.<br>
1436<br>
1437The hash function (&quot;h&quot;) is used to implement cached lookups with the
1438specified hash size (&quot;hsize&quot;).
1439
1440</p>
1441<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsArrayNew3">cupsArrayNew3</a></h3>
1442 <p class="description">Create a new array with hash and/or free function.</p>
1443<p class="code">
1444<a href="#cups_array_t">cups_array_t</a> *cupsArrayNew3 (<br>
1445&#160;&#160;&#160;&#160;<a href="#cups_array_func_t">cups_array_func_t</a> f,<br>
1446&#160;&#160;&#160;&#160;void *d,<br>
1447&#160;&#160;&#160;&#160;<a href="#cups_ahash_func_t">cups_ahash_func_t</a> h,<br>
1448&#160;&#160;&#160;&#160;int hsize,<br>
1449&#160;&#160;&#160;&#160;<a href="#cups_acopy_func_t">cups_acopy_func_t</a> cf,<br>
1450&#160;&#160;&#160;&#160;<a href="#cups_afree_func_t">cups_afree_func_t</a> ff<br>
1451);</p>
1452<h4 class="parameters">Parameters</h4>
1453<dl>
1454<dt>f</dt>
1455 <dd class="description">Comparison function or <code>NULL</code> for an unsorted array</dd>
1456<dt>d</dt>
1457 <dd class="description">User data or <code>NULL</code></dd>
1458<dt>h</dt>
1459 <dd class="description">Hash function or <code>NULL</code> for unhashed lookups</dd>
1460<dt>hsize</dt>
1461 <dd class="description">Hash size (&gt;= 0)</dd>
1462<dt>cf</dt>
1463 <dd class="description">Copy function</dd>
1464<dt>ff</dt>
1465 <dd class="description">Free function</dd>
1466</dl>
1467<h4 class="returnvalue">Return Value</h4>
1468 <p class="description">Array</p>
1469<h4 class="discussion">Discussion</h4>
1470 <p class="discussion">The comparison function (&quot;f&quot;) is used to create a sorted array. The function
1471receives pointers to two elements and the user data pointer (&quot;d&quot;) - the user
1472data pointer argument can safely be omitted when not required so functions
1473like <code>strcmp</code> can be used for sorted string arrays.<br>
1474<br>
1475The hash function (&quot;h&quot;) is used to implement cached lookups with the
1476specified hash size (&quot;hsize&quot;).<br>
1477<br>
1478The copy function (&quot;cf&quot;) is used to automatically copy/retain elements when
1479added or the array is copied.<br>
1480<br>
1481The free function (&quot;cf&quot;) is used to automatically free/release elements when
1482removed or the array is deleted.
1483
1484</p>
1485<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayNext">cupsArrayNext</a></h3>
1486 <p class="description">Get the next element in the array.</p>
1487<p class="code">
1488void *cupsArrayNext (<br>
1489&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a<br>
1490);</p>
1491<h4 class="parameters">Parameters</h4>
1492<dl>
1493<dt>a</dt>
1494 <dd class="description">Array</dd>
1495</dl>
1496<h4 class="returnvalue">Return Value</h4>
1497 <p class="description">Next element or <code>NULL</code></p>
1498<h4 class="discussion">Discussion</h4>
1499 <p class="discussion">This function is equivalent to &quot;cupsArrayIndex(a, cupsArrayGetIndex(a) + 1)&quot;.<br>
1500<br>
1501The next element is undefined until you call <a href="#cupsArrayFind"><code>cupsArrayFind</code></a>,
1502<a href="#cupsArrayFirst"><code>cupsArrayFirst</code></a>, or <a href="#cupsArrayIndex"><code>cupsArrayIndex</code></a>, or <a href="#cupsArrayLast"><code>cupsArrayLast</code></a>
1503to set the current element.
1504
1505</p>
1506<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayPrev">cupsArrayPrev</a></h3>
1507 <p class="description">Get the previous element in the array.</p>
1508<p class="code">
1509void *cupsArrayPrev (<br>
1510&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a<br>
1511);</p>
1512<h4 class="parameters">Parameters</h4>
1513<dl>
1514<dt>a</dt>
1515 <dd class="description">Array</dd>
1516</dl>
1517<h4 class="returnvalue">Return Value</h4>
1518 <p class="description">Previous element or <code>NULL</code></p>
1519<h4 class="discussion">Discussion</h4>
1520 <p class="discussion">This function is equivalent to &quot;cupsArrayIndex(a, cupsArrayGetIndex(a) - 1)&quot;.<br>
1521<br>
1522The previous element is undefined until you call <a href="#cupsArrayFind"><code>cupsArrayFind</code></a>,
1523<a href="#cupsArrayFirst"><code>cupsArrayFirst</code></a>, or <a href="#cupsArrayIndex"><code>cupsArrayIndex</code></a>, or <a href="#cupsArrayLast"><code>cupsArrayLast</code></a>
1524to set the current element.
1525
1526</p>
1527<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayRemove">cupsArrayRemove</a></h3>
1528 <p class="description">Remove an element from the array.</p>
1529<p class="code">
1530int cupsArrayRemove (<br>
1531&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a,<br>
1532&#160;&#160;&#160;&#160;void *e<br>
1533);</p>
1534<h4 class="parameters">Parameters</h4>
1535<dl>
1536<dt>a</dt>
1537 <dd class="description">Array</dd>
1538<dt>e</dt>
1539 <dd class="description">Element</dd>
1540</dl>
1541<h4 class="returnvalue">Return Value</h4>
1542 <p class="description">1 on success, 0 on failure</p>
1543<h4 class="discussion">Discussion</h4>
1544 <p class="discussion">If more than one element matches &quot;e&quot;, only the first matching element is
1545removed.<br>
1546<br>
1547The caller is responsible for freeing the memory used by the
1548removed element.
1549
1550</p>
1551<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayRestore">cupsArrayRestore</a></h3>
1552 <p class="description">Reset the current element to the last <a href="#cupsArraySave"><code>cupsArraySave</code></a>.</p>
1553<p class="code">
1554void *cupsArrayRestore (<br>
1555&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a<br>
1556);</p>
1557<h4 class="parameters">Parameters</h4>
1558<dl>
1559<dt>a</dt>
1560 <dd class="description">Array</dd>
1561</dl>
1562<h4 class="returnvalue">Return Value</h4>
1563 <p class="description">New current element</p>
1564<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArraySave">cupsArraySave</a></h3>
1565 <p class="description">Mark the current element for a later <a href="#cupsArrayRestore"><code>cupsArrayRestore</code></a>.</p>
1566<p class="code">
1567int cupsArraySave (<br>
1568&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a<br>
1569);</p>
1570<h4 class="parameters">Parameters</h4>
1571<dl>
1572<dt>a</dt>
1573 <dd class="description">Array</dd>
1574</dl>
1575<h4 class="returnvalue">Return Value</h4>
1576 <p class="description">1 on success, 0 on failure</p>
1577<h4 class="discussion">Discussion</h4>
1578 <p class="discussion">The current element is undefined until you call <a href="#cupsArrayFind"><code>cupsArrayFind</code></a>,
1579<a href="#cupsArrayFirst"><code>cupsArrayFirst</code></a>, or <a href="#cupsArrayIndex"><code>cupsArrayIndex</code></a>, or <a href="#cupsArrayLast"><code>cupsArrayLast</code></a>
1580to set the current element.<br>
1581<br>
1582The save/restore stack is guaranteed to be at least 32 elements deep.
1583
1584</p>
1585<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsArrayUserData">cupsArrayUserData</a></h3>
1586 <p class="description">Return the user data for an array.</p>
1587<p class="code">
1588void *cupsArrayUserData (<br>
1589&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *a<br>
1590);</p>
1591<h4 class="parameters">Parameters</h4>
1592<dl>
1593<dt>a</dt>
1594 <dd class="description">Array</dd>
1595</dl>
1596<h4 class="returnvalue">Return Value</h4>
1597 <p class="description">User data</p>
1598<h3 class="function"><a id="cupsCancelDestJob">cupsCancelDestJob</a></h3>
1599 <p class="description">Include necessary headers...</p>
1600<p class="code">
1601ipp_status_t cupsCancelDestJob (<br>
1602&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1603&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1604&#160;&#160;&#160;&#160;int job_id<br>
1605);</p>
1606<h4 class="parameters">Parameters</h4>
1607<dl>
1608<dt>http</dt>
1609 <dd class="description">Connection to destination</dd>
1610<dt>dest</dt>
1611 <dd class="description">Destination</dd>
1612<dt>job_id</dt>
1613 <dd class="description">Job ID</dd>
1614</dl>
1615<h4 class="returnvalue">Return Value</h4>
1616 <p class="description">Cancel a job on a destination.</p>
1617 <p class="discussion">The &quot;job_id&quot; is the number returned by cupsCreateDestJob.<br>
1618<br>
1619Returns <code>IPP_STATUS_OK</code> on success and
1620<code>IPP_STATUS_ERRPR_NOT_AUTHORIZED</code> or
1621<code>IPP_STATUS_ERROR_FORBIDDEN</code> on failure.
1622
1623</p>
1624<h3 class="function"><a id="cupsCancelJob">cupsCancelJob</a></h3>
1625 <p class="description">Cancel a print job on the default server.</p>
1626<p class="code">
1627int cupsCancelJob (<br>
1628&#160;&#160;&#160;&#160;const char *name,<br>
1629&#160;&#160;&#160;&#160;int job_id<br>
1630);</p>
1631<h4 class="parameters">Parameters</h4>
1632<dl>
1633<dt>name</dt>
1634 <dd class="description">Name of printer or class</dd>
1635<dt>job_id</dt>
1636 <dd class="description">Job ID, <code>CUPS_JOBID_CURRENT</code> for the current job, or <code>CUPS_JOBID_ALL</code> for all jobs</dd>
1637</dl>
1638<h4 class="returnvalue">Return Value</h4>
1639 <p class="description">1 on success, 0 on failure</p>
1640<h4 class="discussion">Discussion</h4>
1641 <p class="discussion">Pass <code>CUPS_JOBID_ALL</code> to cancel all jobs or <code>CUPS_JOBID_CURRENT</code>
1642to cancel the current job on the named destination.<br>
1643<br>
1644Use the <a href="#cupsLastError"><code>cupsLastError</code></a> and <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> functions to get
1645the cause of any failure.</p>
1646<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsCancelJob2">cupsCancelJob2</a></h3>
1647 <p class="description">Cancel or purge a print job.</p>
1648<p class="code">
1649ipp_status_t cupsCancelJob2 (<br>
1650&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1651&#160;&#160;&#160;&#160;const char *name,<br>
1652&#160;&#160;&#160;&#160;int job_id,<br>
1653&#160;&#160;&#160;&#160;int purge<br>
1654);</p>
1655<h4 class="parameters">Parameters</h4>
1656<dl>
1657<dt>http</dt>
1658 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1659<dt>name</dt>
1660 <dd class="description">Name of printer or class</dd>
1661<dt>job_id</dt>
1662 <dd class="description">Job ID, <code>CUPS_JOBID_CURRENT</code> for the current job, or <code>CUPS_JOBID_ALL</code> for all jobs</dd>
1663<dt>purge</dt>
1664 <dd class="description">1 to purge, 0 to cancel</dd>
1665</dl>
1666<h4 class="returnvalue">Return Value</h4>
1667 <p class="description">IPP status</p>
1668<h4 class="discussion">Discussion</h4>
1669 <p class="discussion">Canceled jobs remain in the job history while purged jobs are removed
1670from the job history.<br>
1671<br>
1672Pass <code>CUPS_JOBID_ALL</code> to cancel all jobs or <code>CUPS_JOBID_CURRENT</code>
1673to cancel the current job on the named destination.<br>
1674<br>
1675Use the <a href="#cupsLastError"><code>cupsLastError</code></a> and <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> functions to get
1676the cause of any failure.
1677
1678</p>
1679<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCheckDestSupported">cupsCheckDestSupported</a></h3>
1680 <p class="description">Check that the option and value are supported
1681by the destination.</p>
1682<p class="code">
1683int cupsCheckDestSupported (<br>
1684&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1685&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1686&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
1687&#160;&#160;&#160;&#160;const char *option,<br>
1688&#160;&#160;&#160;&#160;const char *value<br>
1689);</p>
1690<h4 class="parameters">Parameters</h4>
1691<dl>
1692<dt>http</dt>
1693 <dd class="description">Connection to destination</dd>
1694<dt>dest</dt>
1695 <dd class="description">Destination</dd>
1696<dt>dinfo</dt>
1697 <dd class="description">Destination information</dd>
1698<dt>option</dt>
1699 <dd class="description">Option</dd>
1700<dt>value</dt>
1701 <dd class="description">Value</dd>
1702</dl>
1703<h4 class="returnvalue">Return Value</h4>
1704 <p class="description">1 if supported, 0 otherwise</p>
1705<h4 class="discussion">Discussion</h4>
1706 <p class="discussion">Returns 1 if supported, 0 otherwise.
1707
1708</p>
1709<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCloseDestJob">cupsCloseDestJob</a></h3>
1710 <p class="description">Close a job and start printing.</p>
1711<p class="code">
1712ipp_status_t cupsCloseDestJob (<br>
1713&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1714&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1715&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *info,<br>
1716&#160;&#160;&#160;&#160;int job_id<br>
1717);</p>
1718<h4 class="parameters">Parameters</h4>
1719<dl>
1720<dt>http</dt>
1721 <dd class="description">Connection to destination</dd>
1722<dt>dest</dt>
1723 <dd class="description">Destination</dd>
1724<dt>info</dt>
1725 <dd class="description">Destination information</dd>
1726<dt>job_id</dt>
1727 <dd class="description">Job ID</dd>
1728</dl>
1729<h4 class="returnvalue">Return Value</h4>
1730 <p class="description">IPP status code</p>
1731<h4 class="discussion">Discussion</h4>
1732 <p class="discussion">Use when the last call to cupsStartDocument passed 0 for &quot;last_document&quot;.
1733&quot;job_id&quot; is the job ID returned by cupsCreateDestJob. Returns <code>IPP_STATUS_OK</code>
1734on success.
1735
1736</p>
1737<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsConnectDest">cupsConnectDest</a></h3>
1738 <p class="description">Connect to the server for a destination.</p>
1739<p class="code">
1740<a href="#http_t">http_t</a> *cupsConnectDest (<br>
1741&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1742&#160;&#160;&#160;&#160;unsigned flags,<br>
1743&#160;&#160;&#160;&#160;int msec,<br>
1744&#160;&#160;&#160;&#160;int *cancel,<br>
1745&#160;&#160;&#160;&#160;char *resource,<br>
1746&#160;&#160;&#160;&#160;size_t resourcesize,<br>
1747&#160;&#160;&#160;&#160;<a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb,<br>
1748&#160;&#160;&#160;&#160;void *user_data<br>
1749);</p>
1750<h4 class="parameters">Parameters</h4>
1751<dl>
1752<dt>dest</dt>
1753 <dd class="description">Destination</dd>
1754<dt>flags</dt>
1755 <dd class="description">Connection flags</dd>
1756<dt>msec</dt>
1757 <dd class="description">Timeout in milliseconds</dd>
1758<dt>cancel</dt>
1759 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
1760<dt>resource</dt>
1761 <dd class="description">Resource buffer</dd>
1762<dt>resourcesize</dt>
1763 <dd class="description">Size of resource buffer</dd>
1764<dt>cb</dt>
1765 <dd class="description">Callback function</dd>
1766<dt>user_data</dt>
1767 <dd class="description">User data pointer</dd>
1768</dl>
1769<h4 class="returnvalue">Return Value</h4>
1770 <p class="description">Connection to server or <code>NULL</code></p>
1771<h4 class="discussion">Discussion</h4>
1772 <p class="discussion">Connect to the destination, returning a new http_t connection object and
1773optionally the resource path to use for the destination. These calls will
1774block until a connection is made, the timeout expires, the integer pointed
1775to by &quot;cancel&quot; is non-zero, or the callback function (or block) returns 0,
1776The caller is responsible for calling httpClose() on the returned object.
1777
1778</p>
1779<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsConnectDestBlock">cupsConnectDestBlock</a></h3>
1780 <p class="description">Connect to the server for a destination.</p>
1781<p class="code">
1782<a href="#http_t">http_t</a> *cupsConnectDestBlock (<br>
1783&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1784&#160;&#160;&#160;&#160;unsigned flags,<br>
1785&#160;&#160;&#160;&#160;int msec,<br>
1786&#160;&#160;&#160;&#160;int *cancel,<br>
1787&#160;&#160;&#160;&#160;char *resource,<br>
1788&#160;&#160;&#160;&#160;size_t resourcesize,<br>
1789&#160;&#160;&#160;&#160;<a href="#cups_dest_block_t">cups_dest_block_t</a> block<br>
1790);</p>
1791<h4 class="parameters">Parameters</h4>
1792<dl>
1793<dt>dest</dt>
1794 <dd class="description">Destination</dd>
1795<dt>flags</dt>
1796 <dd class="description">Connection flags</dd>
1797<dt>msec</dt>
1798 <dd class="description">Timeout in milliseconds</dd>
1799<dt>cancel</dt>
1800 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
1801<dt>resource</dt>
1802 <dd class="description">Resource buffer</dd>
1803<dt>resourcesize</dt>
1804 <dd class="description">Size of resource buffer</dd>
1805<dt>block</dt>
1806 <dd class="description">Callback block</dd>
1807</dl>
1808<h4 class="returnvalue">Return Value</h4>
1809 <p class="description">Connection to server or <code>NULL</code></p>
1810<h4 class="discussion">Discussion</h4>
1811 <p class="discussion">Connect to the destination, returning a new http_t connection object and
1812optionally the resource path to use for the destination. These calls will
1813block until a connection is made, the timeout expires, the integer pointed
1814to by &quot;cancel&quot; is non-zero, or the callback function (or block) returns 0,
1815The caller is responsible for calling httpClose() on the returned object.
1816
1817</p>
1818<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDest">cupsCopyDest</a></h3>
1819 <p class="description">Copy a destination.</p>
1820<p class="code">
1821int cupsCopyDest (<br>
1822&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1823&#160;&#160;&#160;&#160;int num_dests,<br>
1824&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> **dests<br>
1825);</p>
1826<h4 class="parameters">Parameters</h4>
1827<dl>
1828<dt>dest</dt>
1829 <dd class="description">Destination to copy</dd>
1830<dt>num_dests</dt>
1831 <dd class="description">Number of destinations</dd>
1832<dt>dests</dt>
1833 <dd class="description">Destination array</dd>
1834</dl>
1835<h4 class="returnvalue">Return Value</h4>
1836 <p class="description">New number of destinations</p>
1837<h4 class="discussion">Discussion</h4>
1838 <p class="discussion">Make a copy of the destination to an array of destinations (or just a single
1839copy) - for use with the cupsEnumDests* functions. The caller is responsible
1840for calling cupsFreeDests() on the returned object(s).
1841
1842</p>
1843<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDestConflicts">cupsCopyDestConflicts</a></h3>
1844 <p class="description">Get conflicts and resolutions for a new
1845option/value pair.</p>
1846<p class="code">
1847int cupsCopyDestConflicts (<br>
1848&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1849&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1850&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
1851&#160;&#160;&#160;&#160;int num_options,<br>
1852&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options,<br>
1853&#160;&#160;&#160;&#160;const char *new_option,<br>
1854&#160;&#160;&#160;&#160;const char *new_value,<br>
1855&#160;&#160;&#160;&#160;int *num_conflicts,<br>
1856&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **conflicts,<br>
1857&#160;&#160;&#160;&#160;int *num_resolved,<br>
1858&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **resolved<br>
1859);</p>
1860<h4 class="parameters">Parameters</h4>
1861<dl>
1862<dt>http</dt>
1863 <dd class="description">Connection to destination</dd>
1864<dt>dest</dt>
1865 <dd class="description">Destination</dd>
1866<dt>dinfo</dt>
1867 <dd class="description">Destination information</dd>
1868<dt>num_options</dt>
1869 <dd class="description">Number of current options</dd>
1870<dt>options</dt>
1871 <dd class="description">Current options</dd>
1872<dt>new_option</dt>
1873 <dd class="description">New option</dd>
1874<dt>new_value</dt>
1875 <dd class="description">New value</dd>
1876<dt>num_conflicts</dt>
1877 <dd class="description">Number of conflicting options</dd>
1878<dt>conflicts</dt>
1879 <dd class="description">Conflicting options</dd>
1880<dt>num_resolved</dt>
1881 <dd class="description">Number of options to resolve</dd>
1882<dt>resolved</dt>
1883 <dd class="description">Resolved options</dd>
1884</dl>
1885<h4 class="returnvalue">Return Value</h4>
1886 <p class="description">1 if there is a conflict, 0 if none, -1 on error</p>
1887<h4 class="discussion">Discussion</h4>
1888 <p class="discussion">&quot;num_options&quot; and &quot;options&quot; represent the currently selected options by the
1889user. &quot;new_option&quot; and &quot;new_value&quot; are the setting the user has just
1890changed.<br>
1891<br>
1892Returns 1 if there is a conflict, 0 if there are no conflicts, and -1 if
1893there was an unrecoverable error such as a resolver loop.<br>
1894<br>
1895If &quot;num_conflicts&quot; and &quot;conflicts&quot; are not <code>NULL</code>, they are set to
1896contain the list of conflicting option/value pairs. Similarly, if
1897&quot;num_resolved&quot; and &quot;resolved&quot; are not <code>NULL</code> they will be set to the
1898list of changes needed to resolve the conflict.<br>
1899<br>
1900If cupsCopyDestConflicts returns 1 but &quot;num_resolved&quot; and &quot;resolved&quot; are set
1901to 0 and <code>NULL</code>, respectively, then the conflict cannot be resolved.
1902
1903</p>
1904<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCopyDestInfo">cupsCopyDestInfo</a></h3>
1905 <p class="description">Get the supported values/capabilities for the
1906destination.</p>
1907<p class="code">
1908<a href="#cups_dinfo_t">cups_dinfo_t</a> *cupsCopyDestInfo (<br>
1909&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1910&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest<br>
1911);</p>
1912<h4 class="parameters">Parameters</h4>
1913<dl>
1914<dt>http</dt>
1915 <dd class="description">Connection to destination</dd>
1916<dt>dest</dt>
1917 <dd class="description">Destination</dd>
1918</dl>
1919<h4 class="returnvalue">Return Value</h4>
1920 <p class="description">Destination information</p>
1921<h4 class="discussion">Discussion</h4>
1922 <p class="discussion">The caller is responsible for calling <a href="#cupsFreeDestInfo"><code>cupsFreeDestInfo</code></a> on the return
1923value. <code>NULL</code> is returned on error.
1924
1925</p>
1926<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsCreateDestJob">cupsCreateDestJob</a></h3>
1927 <p class="description">Create a job on a destination.</p>
1928<p class="code">
1929ipp_status_t cupsCreateDestJob (<br>
1930&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1931&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
1932&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *info,<br>
1933&#160;&#160;&#160;&#160;int *job_id,<br>
1934&#160;&#160;&#160;&#160;const char *title,<br>
1935&#160;&#160;&#160;&#160;int num_options,<br>
1936&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br>
1937);</p>
1938<h4 class="parameters">Parameters</h4>
1939<dl>
1940<dt>http</dt>
1941 <dd class="description">Connection to destination</dd>
1942<dt>dest</dt>
1943 <dd class="description">Destination</dd>
1944<dt>info</dt>
1945 <dd class="description">Destination information</dd>
1946<dt>job_id</dt>
1947 <dd class="description">Job ID or 0 on error</dd>
1948<dt>title</dt>
1949 <dd class="description">Job name</dd>
1950<dt>num_options</dt>
1951 <dd class="description">Number of job options</dd>
1952<dt>options</dt>
1953 <dd class="description">Job options</dd>
1954</dl>
1955<h4 class="returnvalue">Return Value</h4>
1956 <p class="description">IPP status code</p>
1957<h4 class="discussion">Discussion</h4>
1958 <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success, saving the job ID
1959in the variable pointed to by &quot;job_id&quot;.
1960
1961</p>
1962<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsCreateJob">cupsCreateJob</a></h3>
1963 <p class="description">Create an empty job for streaming.</p>
1964<p class="code">
1965int cupsCreateJob (<br>
1966&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
1967&#160;&#160;&#160;&#160;const char *name,<br>
1968&#160;&#160;&#160;&#160;const char *title,<br>
1969&#160;&#160;&#160;&#160;int num_options,<br>
1970&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br>
1971);</p>
1972<h4 class="parameters">Parameters</h4>
1973<dl>
1974<dt>http</dt>
1975 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1976<dt>name</dt>
1977 <dd class="description">Destination name</dd>
1978<dt>title</dt>
1979 <dd class="description">Title of job</dd>
1980<dt>num_options</dt>
1981 <dd class="description">Number of options</dd>
1982<dt>options</dt>
1983 <dd class="description">Options</dd>
1984</dl>
1985<h4 class="returnvalue">Return Value</h4>
1986 <p class="description">Job ID or 0 on error</p>
1987<h4 class="discussion">Discussion</h4>
1988 <p class="discussion">Use this function when you want to stream print data using the
1989<a href="#cupsStartDocument"><code>cupsStartDocument</code></a>, <a href="#cupsWriteRequestData"><code>cupsWriteRequestData</code></a>, and
1990<a href="#cupsFinishDocument"><code>cupsFinishDocument</code></a> functions. If you have one or more files to
1991print, use the <a href="#cupsPrintFile2"><code>cupsPrintFile2</code></a> or <a href="#cupsPrintFiles2"><code>cupsPrintFiles2</code></a> function
1992instead.
1993
1994</p>
1995<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsDirClose">cupsDirClose</a></h3>
1996 <p class="description">Close a directory.</p>
1997<p class="code">
1998void cupsDirClose (<br>
1999&#160;&#160;&#160;&#160;<a href="#cups_dir_t">cups_dir_t</a> *dp<br>
2000);</p>
2001<h4 class="parameters">Parameters</h4>
2002<dl>
2003<dt>dp</dt>
2004 <dd class="description">Directory pointer</dd>
2005</dl>
2006<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsDirOpen">cupsDirOpen</a></h3>
2007 <p class="description">Open a directory.</p>
2008<p class="code">
2009<a href="#cups_dir_t">cups_dir_t</a> *cupsDirOpen (<br>
2010&#160;&#160;&#160;&#160;const char *directory<br>
2011);</p>
2012<h4 class="parameters">Parameters</h4>
2013<dl>
2014<dt>directory</dt>
2015 <dd class="description">Directory name</dd>
2016</dl>
2017<h4 class="returnvalue">Return Value</h4>
2018 <p class="description">Directory pointer or <code>NULL</code> if the directory could not be opened.</p>
2019<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsDirRead">cupsDirRead</a></h3>
2020 <p class="description">Read the next directory entry.</p>
2021<p class="code">
2022<a href="#cups_dentry_t">cups_dentry_t</a> *cupsDirRead (<br>
2023&#160;&#160;&#160;&#160;<a href="#cups_dir_t">cups_dir_t</a> *dp<br>
2024);</p>
2025<h4 class="parameters">Parameters</h4>
2026<dl>
2027<dt>dp</dt>
2028 <dd class="description">Directory pointer</dd>
2029</dl>
2030<h4 class="returnvalue">Return Value</h4>
2031 <p class="description">Directory entry or <code>NULL</code> when there are no more</p>
2032<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsDirRewind">cupsDirRewind</a></h3>
2033 <p class="description">Rewind to the start of the directory.</p>
2034<p class="code">
2035void cupsDirRewind (<br>
2036&#160;&#160;&#160;&#160;<a href="#cups_dir_t">cups_dir_t</a> *dp<br>
2037);</p>
2038<h4 class="parameters">Parameters</h4>
2039<dl>
2040<dt>dp</dt>
2041 <dd class="description">Directory pointer</dd>
2042</dl>
2043<h3 class="function"><span class="info">&#160;CUPS 1.1.20/macOS 10.4&#160;</span><a id="cupsDoAuthentication">cupsDoAuthentication</a></h3>
2044 <p class="description">Authenticate a request.</p>
2045<p class="code">
2046int cupsDoAuthentication (<br>
2047&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
2048&#160;&#160;&#160;&#160;const char *method,<br>
2049&#160;&#160;&#160;&#160;const char *resource<br>
2050);</p>
2051<h4 class="parameters">Parameters</h4>
2052<dl>
2053<dt>http</dt>
2054 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
2055<dt>method</dt>
2056 <dd class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</dd>
2057<dt>resource</dt>
2058 <dd class="description">Resource path</dd>
2059</dl>
2060<h4 class="returnvalue">Return Value</h4>
2061 <p class="description">0 on success, -1 on error</p>
2062<h4 class="discussion">Discussion</h4>
2063 <p class="discussion">This function should be called in response to a <code>HTTP_STATUS_UNAUTHORIZED</code>
2064status, prior to resubmitting your request.
2065
2066</p>
2067<h3 class="function"><a id="cupsEncodeOptions">cupsEncodeOptions</a></h3>
2068 <p class="description">Encode printer options into IPP attributes.</p>
2069<p class="code">
2070void cupsEncodeOptions (<br>
2071&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
2072&#160;&#160;&#160;&#160;int num_options,<br>
2073&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br>
2074);</p>
2075<h4 class="parameters">Parameters</h4>
2076<dl>
2077<dt>ipp</dt>
2078 <dd class="description">Request to add to</dd>
2079<dt>num_options</dt>
2080 <dd class="description">Number of options</dd>
2081<dt>options</dt>
2082 <dd class="description">Options</dd>
2083</dl>
2084<h4 class="discussion">Discussion</h4>
2085 <p class="discussion">This function adds operation, job, and then subscription attributes,
2086in that order. Use the cupsEncodeOptions2() function to add attributes
2087for a single group.</p>
2088<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsEncodeOptions2">cupsEncodeOptions2</a></h3>
2089 <p class="description">Encode printer options into IPP attributes for a group.</p>
2090<p class="code">
2091void cupsEncodeOptions2 (<br>
2092&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
2093&#160;&#160;&#160;&#160;int num_options,<br>
2094&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options,<br>
2095&#160;&#160;&#160;&#160;ipp_tag_t group_tag<br>
2096);</p>
2097<h4 class="parameters">Parameters</h4>
2098<dl>
2099<dt>ipp</dt>
2100 <dd class="description">Request to add to</dd>
2101<dt>num_options</dt>
2102 <dd class="description">Number of options</dd>
2103<dt>options</dt>
2104 <dd class="description">Options</dd>
2105<dt>group_tag</dt>
2106 <dd class="description">Group to encode</dd>
2107</dl>
2108<h4 class="discussion">Discussion</h4>
2109 <p class="discussion">This function only adds attributes for a single group. Call this
2110function multiple times for each group, or use cupsEncodeOptions()
2111to add the standard groups.
2112
2113</p>
2114<h3 class="function"><a id="cupsEncryption">cupsEncryption</a></h3>
2115 <p class="description">Get the current encryption settings.</p>
2116<p class="code">
2117<a href="#http_encryption_t">http_encryption_t</a> cupsEncryption (void);</p>
2118<h4 class="returnvalue">Return Value</h4>
2119 <p class="description">Encryption settings</p>
2120<h4 class="discussion">Discussion</h4>
2121 <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
2122environment variable, then the ~/.cups/client.conf file, and finally the
2123/etc/cups/client.conf file. If not set, the default is
2124<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
2125<br>
2126Note: The current encryption setting is tracked separately for each thread
2127in a program. Multi-threaded programs that override the setting via the
2128<a href="#cupsSetEncryption"><code>cupsSetEncryption</code></a> function need to do so in each thread for the same
2129setting to be used.</p>
2130<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsEnumDests">cupsEnumDests</a></h3>
2131 <p class="description">Enumerate available destinations with a callback function.</p>
2132<p class="code">
2133int cupsEnumDests (<br>
2134&#160;&#160;&#160;&#160;unsigned flags,<br>
2135&#160;&#160;&#160;&#160;int msec,<br>
2136&#160;&#160;&#160;&#160;int *cancel,<br>
2137&#160;&#160;&#160;&#160;<a href="#cups_ptype_t">cups_ptype_t</a> type,<br>
2138&#160;&#160;&#160;&#160;<a href="#cups_ptype_t">cups_ptype_t</a> mask,<br>
2139&#160;&#160;&#160;&#160;<a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb,<br>
2140&#160;&#160;&#160;&#160;void *user_data<br>
2141);</p>
2142<h4 class="parameters">Parameters</h4>
2143<dl>
2144<dt>flags</dt>
2145 <dd class="description">Enumeration flags</dd>
2146<dt>msec</dt>
2147 <dd class="description">Timeout in milliseconds, -1 for indefinite</dd>
2148<dt>cancel</dt>
2149 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
2150<dt>type</dt>
2151 <dd class="description">Printer type bits</dd>
2152<dt>mask</dt>
2153 <dd class="description">Mask for printer type bits</dd>
2154<dt>cb</dt>
2155 <dd class="description">Callback function</dd>
2156<dt>user_data</dt>
2157 <dd class="description">User data</dd>
2158</dl>
2159<h4 class="returnvalue">Return Value</h4>
2160 <p class="description">1 on success, 0 on failure</p>
2161<h4 class="discussion">Discussion</h4>
2162 <p class="discussion">Destinations are enumerated from one or more sources. The callback function
2163receives the <code>user_data</code> pointer, destination name, instance, number of
2164options, and options which can be used as input to the <a href="#cupsAddDest"><code>cupsAddDest</code></a>
2165function. The function must return 1 to continue enumeration or 0 to stop.<br>
2166<br>
2167Enumeration happens on the current thread and does not return until all
2168destinations have been enumerated or the callback function returns 0.
2169
2170</p>
2171<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsEnumDestsBlock">cupsEnumDestsBlock</a></h3>
2172 <p class="description">Enumerate available destinations with a block.</p>
2173<p class="code">
2174int cupsEnumDestsBlock (<br>
2175&#160;&#160;&#160;&#160;unsigned flags,<br>
2176&#160;&#160;&#160;&#160;int timeout,<br>
2177&#160;&#160;&#160;&#160;int *cancel,<br>
2178&#160;&#160;&#160;&#160;<a href="#cups_ptype_t">cups_ptype_t</a> type,<br>
2179&#160;&#160;&#160;&#160;<a href="#cups_ptype_t">cups_ptype_t</a> mask,<br>
2180&#160;&#160;&#160;&#160;<a href="#cups_dest_block_t">cups_dest_block_t</a> block<br>
2181);</p>
2182<h4 class="parameters">Parameters</h4>
2183<dl>
2184<dt>flags</dt>
2185 <dd class="description">Enumeration flags</dd>
2186<dt>timeout</dt>
2187 <dd class="description">Timeout in milliseconds, 0 for indefinite</dd>
2188<dt>cancel</dt>
2189 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
2190<dt>type</dt>
2191 <dd class="description">Printer type bits</dd>
2192<dt>mask</dt>
2193 <dd class="description">Mask for printer type bits</dd>
2194<dt>block</dt>
2195 <dd class="description">Block</dd>
2196</dl>
2197<h4 class="returnvalue">Return Value</h4>
2198 <p class="description">1 on success, 0 on failure</p>
2199<h4 class="discussion">Discussion</h4>
2200 <p class="discussion">Destinations are enumerated from one or more sources. The block receives the
2201destination name, instance, number of options, and options which can be used
2202as input to the <a href="#cupsAddDest"><code>cupsAddDest</code></a> function. The block must return 1 to
2203continue enumeration or 0 to stop.<br>
2204<br>
2205Enumeration happens on the current thread and does not return until all
2206destinations have been enumerated or the block returns 0.
2207
2208</p>
2209<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileClose">cupsFileClose</a></h3>
2210 <p class="description">Close a CUPS file.</p>
2211<p class="code">
2212int cupsFileClose (<br>
2213&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp<br>
2214);</p>
2215<h4 class="parameters">Parameters</h4>
2216<dl>
2217<dt>fp</dt>
2218 <dd class="description">CUPS file</dd>
2219</dl>
2220<h4 class="returnvalue">Return Value</h4>
2221 <p class="description">0 on success, -1 on error</p>
2222<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileCompression">cupsFileCompression</a></h3>
2223 <p class="description">Return whether a file is compressed.</p>
2224<p class="code">
2225int cupsFileCompression (<br>
2226&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp<br>
2227);</p>
2228<h4 class="parameters">Parameters</h4>
2229<dl>
2230<dt>fp</dt>
2231 <dd class="description">CUPS file</dd>
2232</dl>
2233<h4 class="returnvalue">Return Value</h4>
2234 <p class="description"><code>CUPS_FILE_NONE</code> or <code>CUPS_FILE_GZIP</code></p>
2235<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileEOF">cupsFileEOF</a></h3>
2236 <p class="description">Return the end-of-file status.</p>
2237<p class="code">
2238int cupsFileEOF (<br>
2239&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp<br>
2240);</p>
2241<h4 class="parameters">Parameters</h4>
2242<dl>
2243<dt>fp</dt>
2244 <dd class="description">CUPS file</dd>
2245</dl>
2246<h4 class="returnvalue">Return Value</h4>
2247 <p class="description">1 on end of file, 0 otherwise</p>
2248<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileFind">cupsFileFind</a></h3>
2249 <p class="description">Find a file using the specified path.</p>
2250<p class="code">
2251const char *cupsFileFind (<br>
2252&#160;&#160;&#160;&#160;const char *filename,<br>
2253&#160;&#160;&#160;&#160;const char *path,<br>
2254&#160;&#160;&#160;&#160;int executable,<br>
2255&#160;&#160;&#160;&#160;char *buffer,<br>
2256&#160;&#160;&#160;&#160;int bufsize<br>
2257);</p>
2258<h4 class="parameters">Parameters</h4>
2259<dl>
2260<dt>filename</dt>
2261 <dd class="description">File to find</dd>
2262<dt>path</dt>
2263 <dd class="description">Colon/semicolon-separated path</dd>
2264<dt>executable</dt>
2265 <dd class="description">1 = executable files, 0 = any file/dir</dd>
2266<dt>buffer</dt>
2267 <dd class="description">Filename buffer</dd>
2268<dt>bufsize</dt>
2269 <dd class="description">Size of filename buffer</dd>
2270</dl>
2271<h4 class="returnvalue">Return Value</h4>
2272 <p class="description">Full path to file or <code>NULL</code> if not found</p>
2273<h4 class="discussion">Discussion</h4>
2274 <p class="discussion">This function allows the paths in the path string to be separated by
2275colons (UNIX standard) or semicolons (Windows standard) and stores the
2276result in the buffer supplied. If the file cannot be found in any of
2277the supplied paths, <code>NULL</code> is returned. A <code>NULL</code> path only
2278matches the current directory.
2279
2280</p>
2281<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileFlush">cupsFileFlush</a></h3>
2282 <p class="description">Flush pending output.</p>
2283<p class="code">
2284int cupsFileFlush (<br>
2285&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp<br>
2286);</p>
2287<h4 class="parameters">Parameters</h4>
2288<dl>
2289<dt>fp</dt>
2290 <dd class="description">CUPS file</dd>
2291</dl>
2292<h4 class="returnvalue">Return Value</h4>
2293 <p class="description">0 on success, -1 on error</p>
2294<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileGetChar">cupsFileGetChar</a></h3>
2295 <p class="description">Get a single character from a file.</p>
2296<p class="code">
2297int cupsFileGetChar (<br>
2298&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp<br>
2299);</p>
2300<h4 class="parameters">Parameters</h4>
2301<dl>
2302<dt>fp</dt>
2303 <dd class="description">CUPS file</dd>
2304</dl>
2305<h4 class="returnvalue">Return Value</h4>
2306 <p class="description">Character or -1 on end of file</p>
2307<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileGetConf">cupsFileGetConf</a></h3>
2308 <p class="description">Get a line from a configuration file.</p>
2309<p class="code">
2310char *cupsFileGetConf (<br>
2311&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp,<br>
2312&#160;&#160;&#160;&#160;char *buf,<br>
2313&#160;&#160;&#160;&#160;size_t buflen,<br>
2314&#160;&#160;&#160;&#160;char **value,<br>
2315&#160;&#160;&#160;&#160;int *linenum<br>
2316);</p>
2317<h4 class="parameters">Parameters</h4>
2318<dl>
2319<dt>fp</dt>
2320 <dd class="description">CUPS file</dd>
2321<dt>buf</dt>
2322 <dd class="description">String buffer</dd>
2323<dt>buflen</dt>
2324 <dd class="description">Size of string buffer</dd>
2325<dt>value</dt>
2326 <dd class="description">Pointer to value</dd>
2327<dt>linenum</dt>
2328 <dd class="description">Current line number</dd>
2329</dl>
2330<h4 class="returnvalue">Return Value</h4>
2331 <p class="description">Line read or <code>NULL</code> on end of file or error</p>
2332<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileGetLine">cupsFileGetLine</a></h3>
2333 <p class="description">Get a CR and/or LF-terminated line that may
2334contain binary data.</p>
2335<p class="code">
2336size_t cupsFileGetLine (<br>
2337&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp,<br>
2338&#160;&#160;&#160;&#160;char *buf,<br>
2339&#160;&#160;&#160;&#160;size_t buflen<br>
2340);</p>
2341<h4 class="parameters">Parameters</h4>
2342<dl>
2343<dt>fp</dt>
2344 <dd class="description">File to read from</dd>
2345<dt>buf</dt>
2346 <dd class="description">Buffer</dd>
2347<dt>buflen</dt>
2348 <dd class="description">Size of buffer</dd>
2349</dl>
2350<h4 class="returnvalue">Return Value</h4>
2351 <p class="description">Number of bytes on line or 0 on end of file</p>
2352<h4 class="discussion">Discussion</h4>
2353 <p class="discussion">This function differs from <a href="#cupsFileGets"><code>cupsFileGets</code></a> in that the trailing CR
2354and LF are preserved, as is any binary data on the line. The buffer is
2355nul-terminated, however you should use the returned length to determine
2356the number of bytes on the line.
2357
2358</p>
2359<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileGets">cupsFileGets</a></h3>
2360 <p class="description">Get a CR and/or LF-terminated line.</p>
2361<p class="code">
2362char *cupsFileGets (<br>
2363&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp,<br>
2364&#160;&#160;&#160;&#160;char *buf,<br>
2365&#160;&#160;&#160;&#160;size_t buflen<br>
2366);</p>
2367<h4 class="parameters">Parameters</h4>
2368<dl>
2369<dt>fp</dt>
2370 <dd class="description">CUPS file</dd>
2371<dt>buf</dt>
2372 <dd class="description">String buffer</dd>
2373<dt>buflen</dt>
2374 <dd class="description">Size of string buffer</dd>
2375</dl>
2376<h4 class="returnvalue">Return Value</h4>
2377 <p class="description">Line read or <code>NULL</code> on end of file or error</p>
2378<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileLock">cupsFileLock</a></h3>
2379 <p class="description">Temporarily lock access to a file.</p>
2380<p class="code">
2381int cupsFileLock (<br>
2382&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp,<br>
2383&#160;&#160;&#160;&#160;int block<br>
2384);</p>
2385<h4 class="parameters">Parameters</h4>
2386<dl>
2387<dt>fp</dt>
2388 <dd class="description">CUPS file</dd>
2389<dt>block</dt>
2390 <dd class="description">1 to wait for the lock, 0 to fail right away</dd>
2391</dl>
2392<h4 class="returnvalue">Return Value</h4>
2393 <p class="description">0 on success, -1 on error</p>
2394<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileNumber">cupsFileNumber</a></h3>
2395 <p class="description">Return the file descriptor associated with a CUPS file.</p>
2396<p class="code">
2397int cupsFileNumber (<br>
2398&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp<br>
2399);</p>
2400<h4 class="parameters">Parameters</h4>
2401<dl>
2402<dt>fp</dt>
2403 <dd class="description">CUPS file</dd>
2404</dl>
2405<h4 class="returnvalue">Return Value</h4>
2406 <p class="description">File descriptor</p>
2407<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileOpen">cupsFileOpen</a></h3>
2408 <p class="description">Open a CUPS file.</p>
2409<p class="code">
2410<a href="#cups_file_t">cups_file_t</a> *cupsFileOpen (<br>
2411&#160;&#160;&#160;&#160;const char *filename,<br>
2412&#160;&#160;&#160;&#160;const char *mode<br>
2413);</p>
2414<h4 class="parameters">Parameters</h4>
2415<dl>
2416<dt>filename</dt>
2417 <dd class="description">Name of file</dd>
2418<dt>mode</dt>
2419 <dd class="description">Open mode</dd>
2420</dl>
2421<h4 class="returnvalue">Return Value</h4>
2422 <p class="description">CUPS file or <code>NULL</code> if the file or socket cannot be opened</p>
2423<h4 class="discussion">Discussion</h4>
2424 <p class="discussion">The &quot;mode&quot; parameter can be &quot;r&quot; to read, &quot;w&quot; to write, overwriting any
2425existing file, &quot;a&quot; to append to an existing file or create a new file,
2426or &quot;s&quot; to open a socket connection.<br>
2427<br>
2428When opening for writing (&quot;w&quot;), an optional number from 1 to 9 can be
2429supplied which enables Flate compression of the file. Compression is
2430not supported for the &quot;a&quot; (append) mode.<br>
2431<br>
2432When opening a socket connection, the filename is a string of the form
2433&quot;address:port&quot; or &quot;hostname:port&quot;. The socket will make an IPv4 or IPv6
2434connection as needed, generally preferring IPv6 connections when there is
2435a choice.
2436
2437</p>
2438<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileOpenFd">cupsFileOpenFd</a></h3>
2439 <p class="description">Open a CUPS file using a file descriptor.</p>
2440<p class="code">
2441<a href="#cups_file_t">cups_file_t</a> *cupsFileOpenFd (<br>
2442&#160;&#160;&#160;&#160;int fd,<br>
2443&#160;&#160;&#160;&#160;const char *mode<br>
2444);</p>
2445<h4 class="parameters">Parameters</h4>
2446<dl>
2447<dt>fd</dt>
2448 <dd class="description">File descriptor</dd>
2449<dt>mode</dt>
2450 <dd class="description">Open mode</dd>
2451</dl>
2452<h4 class="returnvalue">Return Value</h4>
2453 <p class="description">CUPS file or <code>NULL</code> if the file could not be opened</p>
2454<h4 class="discussion">Discussion</h4>
2455 <p class="discussion">The &quot;mode&quot; parameter can be &quot;r&quot; to read, &quot;w&quot; to write, &quot;a&quot; to append,
2456or &quot;s&quot; to treat the file descriptor as a bidirectional socket connection.<br>
2457<br>
2458When opening for writing (&quot;w&quot;), an optional number from 1 to 9 can be
2459supplied which enables Flate compression of the file. Compression is
2460not supported for the &quot;a&quot; (append) mode.
2461
2462</p>
2463<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFilePeekChar">cupsFilePeekChar</a></h3>
2464 <p class="description">Peek at the next character from a file.</p>
2465<p class="code">
2466int cupsFilePeekChar (<br>
2467&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp<br>
2468);</p>
2469<h4 class="parameters">Parameters</h4>
2470<dl>
2471<dt>fp</dt>
2472 <dd class="description">CUPS file</dd>
2473</dl>
2474<h4 class="returnvalue">Return Value</h4>
2475 <p class="description">Character or -1 on end of file</p>
2476<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFilePrintf">cupsFilePrintf</a></h3>
2477 <p class="description">Write a formatted string.</p>
2478<p class="code">
2479int cupsFilePrintf (<br>
2480&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp,<br>
2481&#160;&#160;&#160;&#160;const char *format,<br>
2482&#160;&#160;&#160;&#160;...<br>
2483);</p>
2484<h4 class="parameters">Parameters</h4>
2485<dl>
2486<dt>fp</dt>
2487 <dd class="description">CUPS file</dd>
2488<dt>format</dt>
2489 <dd class="description">Printf-style format string</dd>
2490<dt>...</dt>
2491 <dd class="description">Additional args as necessary</dd>
2492</dl>
2493<h4 class="returnvalue">Return Value</h4>
2494 <p class="description">Number of bytes written or -1 on error</p>
2495<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFilePutChar">cupsFilePutChar</a></h3>
2496 <p class="description">Write a character.</p>
2497<p class="code">
2498int cupsFilePutChar (<br>
2499&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp,<br>
2500&#160;&#160;&#160;&#160;int c<br>
2501);</p>
2502<h4 class="parameters">Parameters</h4>
2503<dl>
2504<dt>fp</dt>
2505 <dd class="description">CUPS file</dd>
2506<dt>c</dt>
2507 <dd class="description">Character to write</dd>
2508</dl>
2509<h4 class="returnvalue">Return Value</h4>
2510 <p class="description">0 on success, -1 on error</p>
2511<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsFilePutConf">cupsFilePutConf</a></h3>
2512 <p class="description">Write a configuration line.</p>
2513<p class="code">
2514ssize_t cupsFilePutConf (<br>
2515&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp,<br>
2516&#160;&#160;&#160;&#160;const char *directive,<br>
2517&#160;&#160;&#160;&#160;const char *value<br>
2518);</p>
2519<h4 class="parameters">Parameters</h4>
2520<dl>
2521<dt>fp</dt>
2522 <dd class="description">CUPS file</dd>
2523<dt>directive</dt>
2524 <dd class="description">Directive</dd>
2525<dt>value</dt>
2526 <dd class="description">Value</dd>
2527</dl>
2528<h4 class="returnvalue">Return Value</h4>
2529 <p class="description">Number of bytes written or -1 on error</p>
2530<h4 class="discussion">Discussion</h4>
2531 <p class="discussion">This function handles any comment escaping of the value.
2532
2533</p>
2534<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFilePuts">cupsFilePuts</a></h3>
2535 <p class="description">Write a string.</p>
2536<p class="code">
2537int cupsFilePuts (<br>
2538&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp,<br>
2539&#160;&#160;&#160;&#160;const char *s<br>
2540);</p>
2541<h4 class="parameters">Parameters</h4>
2542<dl>
2543<dt>fp</dt>
2544 <dd class="description">CUPS file</dd>
2545<dt>s</dt>
2546 <dd class="description">String to write</dd>
2547</dl>
2548<h4 class="returnvalue">Return Value</h4>
2549 <p class="description">Number of bytes written or -1 on error</p>
2550<h4 class="discussion">Discussion</h4>
2551 <p class="discussion">Like the <code>fputs</code> function, no newline is appended to the string.
2552
2553</p>
2554<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileRead">cupsFileRead</a></h3>
2555 <p class="description">Read from a file.</p>
2556<p class="code">
2557ssize_t cupsFileRead (<br>
2558&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp,<br>
2559&#160;&#160;&#160;&#160;char *buf,<br>
2560&#160;&#160;&#160;&#160;size_t bytes<br>
2561);</p>
2562<h4 class="parameters">Parameters</h4>
2563<dl>
2564<dt>fp</dt>
2565 <dd class="description">CUPS file</dd>
2566<dt>buf</dt>
2567 <dd class="description">Buffer</dd>
2568<dt>bytes</dt>
2569 <dd class="description">Number of bytes to read</dd>
2570</dl>
2571<h4 class="returnvalue">Return Value</h4>
2572 <p class="description">Number of bytes read or -1 on error</p>
2573<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileRewind">cupsFileRewind</a></h3>
2574 <p class="description">Set the current file position to the beginning of the
2575file.</p>
2576<p class="code">
2577off_t cupsFileRewind (<br>
2578&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp<br>
2579);</p>
2580<h4 class="parameters">Parameters</h4>
2581<dl>
2582<dt>fp</dt>
2583 <dd class="description">CUPS file</dd>
2584</dl>
2585<h4 class="returnvalue">Return Value</h4>
2586 <p class="description">New file position or -1 on error</p>
2587<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileSeek">cupsFileSeek</a></h3>
2588 <p class="description">Seek in a file.</p>
2589<p class="code">
2590off_t cupsFileSeek (<br>
2591&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp,<br>
2592&#160;&#160;&#160;&#160;off_t pos<br>
2593);</p>
2594<h4 class="parameters">Parameters</h4>
2595<dl>
2596<dt>fp</dt>
2597 <dd class="description">CUPS file</dd>
2598<dt>pos</dt>
2599 <dd class="description">Position in file</dd>
2600</dl>
2601<h4 class="returnvalue">Return Value</h4>
2602 <p class="description">New file position or -1 on error</p>
2603<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileStderr">cupsFileStderr</a></h3>
2604 <p class="description">Return a CUPS file associated with stderr.</p>
2605<p class="code">
2606<a href="#cups_file_t">cups_file_t</a> *cupsFileStderr (void);</p>
2607<h4 class="returnvalue">Return Value</h4>
2608 <p class="description">CUPS file</p>
2609<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileStdin">cupsFileStdin</a></h3>
2610 <p class="description">Return a CUPS file associated with stdin.</p>
2611<p class="code">
2612<a href="#cups_file_t">cups_file_t</a> *cupsFileStdin (void);</p>
2613<h4 class="returnvalue">Return Value</h4>
2614 <p class="description">CUPS file</p>
2615<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileStdout">cupsFileStdout</a></h3>
2616 <p class="description">Return a CUPS file associated with stdout.</p>
2617<p class="code">
2618<a href="#cups_file_t">cups_file_t</a> *cupsFileStdout (void);</p>
2619<h4 class="returnvalue">Return Value</h4>
2620 <p class="description">CUPS file</p>
2621<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileTell">cupsFileTell</a></h3>
2622 <p class="description">Return the current file position.</p>
2623<p class="code">
2624off_t cupsFileTell (<br>
2625&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp<br>
2626);</p>
2627<h4 class="parameters">Parameters</h4>
2628<dl>
2629<dt>fp</dt>
2630 <dd class="description">CUPS file</dd>
2631</dl>
2632<h4 class="returnvalue">Return Value</h4>
2633 <p class="description">File position</p>
2634<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileUnlock">cupsFileUnlock</a></h3>
2635 <p class="description">Unlock access to a file.</p>
2636<p class="code">
2637int cupsFileUnlock (<br>
2638&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp<br>
2639);</p>
2640<h4 class="parameters">Parameters</h4>
2641<dl>
2642<dt>fp</dt>
2643 <dd class="description">CUPS file</dd>
2644</dl>
2645<h4 class="returnvalue">Return Value</h4>
2646 <p class="description">0 on success, -1 on error</p>
2647<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsFileWrite">cupsFileWrite</a></h3>
2648 <p class="description">Write to a file.</p>
2649<p class="code">
2650ssize_t cupsFileWrite (<br>
2651&#160;&#160;&#160;&#160;<a href="#cups_file_t">cups_file_t</a> *fp,<br>
2652&#160;&#160;&#160;&#160;const char *buf,<br>
2653&#160;&#160;&#160;&#160;size_t bytes<br>
2654);</p>
2655<h4 class="parameters">Parameters</h4>
2656<dl>
2657<dt>fp</dt>
2658 <dd class="description">CUPS file</dd>
2659<dt>buf</dt>
2660 <dd class="description">Buffer</dd>
2661<dt>bytes</dt>
2662 <dd class="description">Number of bytes to write</dd>
2663</dl>
2664<h4 class="returnvalue">Return Value</h4>
2665 <p class="description">Number of bytes written or -1 on error</p>
2666<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestDefault">cupsFindDestDefault</a></h3>
2667 <p class="description">Find the default value(s) for the given option.</p>
2668<p class="code">
2669<a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestDefault (<br>
2670&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
2671&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
2672&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
2673&#160;&#160;&#160;&#160;const char *option<br>
2674);</p>
2675<h4 class="parameters">Parameters</h4>
2676<dl>
2677<dt>http</dt>
2678 <dd class="description">Connection to destination</dd>
2679<dt>dest</dt>
2680 <dd class="description">Destination</dd>
2681<dt>dinfo</dt>
2682 <dd class="description">Destination information</dd>
2683<dt>option</dt>
2684 <dd class="description">Option/attribute name</dd>
2685</dl>
2686<h4 class="returnvalue">Return Value</h4>
2687 <p class="description">Default attribute or <code>NULL</code> for none</p>
2688<h4 class="discussion">Discussion</h4>
2689 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
2690<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
2691<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
2692<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
2693functions to inspect the default value(s) as needed.
2694
2695</p>
2696<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestReady">cupsFindDestReady</a></h3>
2697 <p class="description">Find the default value(s) for the given option.</p>
2698<p class="code">
2699<a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestReady (<br>
2700&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
2701&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
2702&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
2703&#160;&#160;&#160;&#160;const char *option<br>
2704);</p>
2705<h4 class="parameters">Parameters</h4>
2706<dl>
2707<dt>http</dt>
2708 <dd class="description">Connection to destination</dd>
2709<dt>dest</dt>
2710 <dd class="description">Destination</dd>
2711<dt>dinfo</dt>
2712 <dd class="description">Destination information</dd>
2713<dt>option</dt>
2714 <dd class="description">Option/attribute name</dd>
2715</dl>
2716<h4 class="returnvalue">Return Value</h4>
2717 <p class="description">Default attribute or <code>NULL</code> for none</p>
2718<h4 class="discussion">Discussion</h4>
2719 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
2720<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
2721<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
2722<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
2723functions to inspect the default value(s) as needed.
2724
2725</p>
2726<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsFindDestSupported">cupsFindDestSupported</a></h3>
2727 <p class="description">Find the default value(s) for the given option.</p>
2728<p class="code">
2729<a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestSupported (<br>
2730&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
2731&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
2732&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
2733&#160;&#160;&#160;&#160;const char *option<br>
2734);</p>
2735<h4 class="parameters">Parameters</h4>
2736<dl>
2737<dt>http</dt>
2738 <dd class="description">Connection to destination</dd>
2739<dt>dest</dt>
2740 <dd class="description">Destination</dd>
2741<dt>dinfo</dt>
2742 <dd class="description">Destination information</dd>
2743<dt>option</dt>
2744 <dd class="description">Option/attribute name</dd>
2745</dl>
2746<h4 class="returnvalue">Return Value</h4>
2747 <p class="description">Default attribute or <code>NULL</code> for none</p>
2748<h4 class="discussion">Discussion</h4>
2749 <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
2750<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
2751<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
2752<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
2753functions to inspect the default value(s) as needed.
2754
2755</p>
2756<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsFinishDestDocument">cupsFinishDestDocument</a></h3>
2757 <p class="description">Finish the current document.</p>
2758<p class="code">
2759ipp_status_t cupsFinishDestDocument (<br>
2760&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
2761&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
2762&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *info<br>
2763);</p>
2764<h4 class="parameters">Parameters</h4>
2765<dl>
2766<dt>http</dt>
2767 <dd class="description">Connection to destination</dd>
2768<dt>dest</dt>
2769 <dd class="description">Destination</dd>
2770<dt>info</dt>
2771 <dd class="description">Destination information</dd>
2772</dl>
2773<h4 class="returnvalue">Return Value</h4>
2774 <p class="description">Status of document submission</p>
2775<h4 class="discussion">Discussion</h4>
2776 <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success.
2777
2778</p>
2779<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsFinishDocument">cupsFinishDocument</a></h3>
2780 <p class="description">Finish sending a document.</p>
2781<p class="code">
2782ipp_status_t cupsFinishDocument (<br>
2783&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
2784&#160;&#160;&#160;&#160;const char *name<br>
2785);</p>
2786<h4 class="parameters">Parameters</h4>
2787<dl>
2788<dt>http</dt>
2789 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
2790<dt>name</dt>
2791 <dd class="description">Destination name</dd>
2792</dl>
2793<h4 class="returnvalue">Return Value</h4>
2794 <p class="description">Status of document submission</p>
2795<h4 class="discussion">Discussion</h4>
2796 <p class="discussion">The document must have been started using <a href="#cupsStartDocument"><code>cupsStartDocument</code></a>.
2797
2798</p>
2799<h3 class="function"><a id="cupsFreeDestInfo">cupsFreeDestInfo</a></h3>
2800 <p class="description">Free destination information obtained using
2801<a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a>.</p>
2802<p class="code">
2803void cupsFreeDestInfo (<br>
2804&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo<br>
2805);</p>
2806<h4 class="parameters">Parameters</h4>
2807<dl>
2808<dt>dinfo</dt>
2809 <dd class="description">Destination information</dd>
2810</dl>
2811<h3 class="function"><a id="cupsFreeDests">cupsFreeDests</a></h3>
2812 <p class="description">Free the memory used by the list of destinations.</p>
2813<p class="code">
2814void cupsFreeDests (<br>
2815&#160;&#160;&#160;&#160;int num_dests,<br>
2816&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dests<br>
2817);</p>
2818<h4 class="parameters">Parameters</h4>
2819<dl>
2820<dt>num_dests</dt>
2821 <dd class="description">Number of destinations</dd>
2822<dt>dests</dt>
2823 <dd class="description">Destinations</dd>
2824</dl>
2825<h3 class="function"><a id="cupsFreeJobs">cupsFreeJobs</a></h3>
2826 <p class="description">Free memory used by job data.</p>
2827<p class="code">
2828void cupsFreeJobs (<br>
2829&#160;&#160;&#160;&#160;int num_jobs,<br>
2830&#160;&#160;&#160;&#160;<a href="#cups_job_t">cups_job_t</a> *jobs<br>
2831);</p>
2832<h4 class="parameters">Parameters</h4>
2833<dl>
2834<dt>num_jobs</dt>
2835 <dd class="description">Number of jobs</dd>
2836<dt>jobs</dt>
2837 <dd class="description">Jobs</dd>
2838</dl>
2839<h3 class="function"><a id="cupsFreeOptions">cupsFreeOptions</a></h3>
2840 <p class="description">Free all memory used by options.</p>
2841<p class="code">
2842void cupsFreeOptions (<br>
2843&#160;&#160;&#160;&#160;int num_options,<br>
2844&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br>
2845);</p>
2846<h4 class="parameters">Parameters</h4>
2847<dl>
2848<dt>num_options</dt>
2849 <dd class="description">Number of options</dd>
2850<dt>options</dt>
2851 <dd class="description">Pointer to options</dd>
2852</dl>
2853<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="cupsGetClasses">cupsGetClasses</a></h3>
2854 <p class="description">Get a list of printer classes from the default server.</p>
2855<p class="code">
2856int cupsGetClasses (<br>
2857&#160;&#160;&#160;&#160;char ***classes<br>
2858);</p>
2859<h4 class="parameters">Parameters</h4>
2860<dl>
2861<dt>classes</dt>
2862 <dd class="description">Classes</dd>
2863</dl>
2864<h4 class="returnvalue">Return Value</h4>
2865 <p class="description">Number of classes</p>
2866<h4 class="discussion">Discussion</h4>
2867 <p class="discussion">This function is deprecated and no longer returns a list of printer
2868classes - use <a href="#cupsGetDests"><code>cupsGetDests</code></a> instead.
2869
2870</p>
2871<h3 class="function"><a id="cupsGetDefault">cupsGetDefault</a></h3>
2872 <p class="description">Get the default printer or class for the default server.</p>
2873<p class="code">
2874const char *cupsGetDefault (void);</p>
2875<h4 class="returnvalue">Return Value</h4>
2876 <p class="description">Default printer or <code>NULL</code></p>
2877<h4 class="discussion">Discussion</h4>
2878 <p class="discussion">This function returns the default printer or class as defined by
2879the LPDEST or PRINTER environment variables. If these environment
2880variables are not set, the server default destination is returned.
2881Applications should use the <a href="#cupsGetDests"><code>cupsGetDests</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a>
2882functions to get the user-defined default printer, as this function does
2883not support the lpoptions-defined default printer.</p>
2884<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetDefault2">cupsGetDefault2</a></h3>
2885 <p class="description">Get the default printer or class for the specified server.</p>
2886<p class="code">
2887const char *cupsGetDefault2 (<br>
2888&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
2889);</p>
2890<h4 class="parameters">Parameters</h4>
2891<dl>
2892<dt>http</dt>
2893 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
2894</dl>
2895<h4 class="returnvalue">Return Value</h4>
2896 <p class="description">Default printer or <code>NULL</code></p>
2897<h4 class="discussion">Discussion</h4>
2898 <p class="discussion">This function returns the default printer or class as defined by
2899the LPDEST or PRINTER environment variables. If these environment
2900variables are not set, the server default destination is returned.
2901Applications should use the <a href="#cupsGetDests"><code>cupsGetDests</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a>
2902functions to get the user-defined default printer, as this function does
2903not support the lpoptions-defined default printer.
2904
2905</p>
2906<h3 class="function"><a id="cupsGetDest">cupsGetDest</a></h3>
2907 <p class="description">Get the named destination from the list.</p>
2908<p class="code">
2909<a href="#cups_dest_t">cups_dest_t</a> *cupsGetDest (<br>
2910&#160;&#160;&#160;&#160;const char *name,<br>
2911&#160;&#160;&#160;&#160;const char *instance,<br>
2912&#160;&#160;&#160;&#160;int num_dests,<br>
2913&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dests<br>
2914);</p>
2915<h4 class="parameters">Parameters</h4>
2916<dl>
2917<dt>name</dt>
2918 <dd class="description">Destination name or <code>NULL</code> for the default destination</dd>
2919<dt>instance</dt>
2920 <dd class="description">Instance name or <code>NULL</code></dd>
2921<dt>num_dests</dt>
2922 <dd class="description">Number of destinations</dd>
2923<dt>dests</dt>
2924 <dd class="description">Destinations</dd>
2925</dl>
2926<h4 class="returnvalue">Return Value</h4>
2927 <p class="description">Destination pointer or <code>NULL</code></p>
2928<h4 class="discussion">Discussion</h4>
2929 <p class="discussion">Use the <a href="#cupsGetDests"><code>cupsGetDests</code></a> or <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> functions to get a
2930list of supported destinations for the current user.</p>
2931<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></h3>
2932 <p class="description">Get a media name, dimension, and margins for a
2933specific size.</p>
2934<p class="code">
2935int cupsGetDestMediaByIndex (<br>
2936&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
2937&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
2938&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
2939&#160;&#160;&#160;&#160;int n,<br>
2940&#160;&#160;&#160;&#160;unsigned flags,<br>
2941&#160;&#160;&#160;&#160;<a href="#cups_size_t">cups_size_t</a> *size<br>
2942);</p>
2943<h4 class="parameters">Parameters</h4>
2944<dl>
2945<dt>http</dt>
2946 <dd class="description">Connection to destination</dd>
2947<dt>dest</dt>
2948 <dd class="description">Destination</dd>
2949<dt>dinfo</dt>
2950 <dd class="description">Destination information</dd>
2951<dt>n</dt>
2952 <dd class="description">Media size number (0-based)</dd>
2953<dt>flags</dt>
2954 <dd class="description">Media flags</dd>
2955<dt>size</dt>
2956 <dd class="description">Media size information</dd>
2957</dl>
2958<h4 class="returnvalue">Return Value</h4>
2959 <p class="description">1 on success, 0 on failure</p>
2960<h4 class="discussion">Discussion</h4>
2961 <p class="discussion">The <code>flags</code> parameter determines which set of media are indexed. For
2962example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will get the Nth
2963borderless size supported by the printer.
2964
2965</p>
2966<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsGetDestMediaByName">cupsGetDestMediaByName</a></h3>
2967 <p class="description">Get media names, dimensions, and margins.</p>
2968<p class="code">
2969int cupsGetDestMediaByName (<br>
2970&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
2971&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
2972&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
2973&#160;&#160;&#160;&#160;const char *media,<br>
2974&#160;&#160;&#160;&#160;unsigned flags,<br>
2975&#160;&#160;&#160;&#160;<a href="#cups_size_t">cups_size_t</a> *size<br>
2976);</p>
2977<h4 class="parameters">Parameters</h4>
2978<dl>
2979<dt>http</dt>
2980 <dd class="description">Connection to destination</dd>
2981<dt>dest</dt>
2982 <dd class="description">Destination</dd>
2983<dt>dinfo</dt>
2984 <dd class="description">Destination information</dd>
2985<dt>media</dt>
2986 <dd class="description">Media name</dd>
2987<dt>flags</dt>
2988 <dd class="description">Media matching flags</dd>
2989<dt>size</dt>
2990 <dd class="description">Media size information</dd>
2991</dl>
2992<h4 class="returnvalue">Return Value</h4>
2993 <p class="description">1 on match, 0 on failure</p>
2994<h4 class="discussion">Discussion</h4>
2995 <p class="discussion">The &quot;media&quot; string is a PWG media name. &quot;Flags&quot; provides some matching
2996guidance (multiple flags can be combined):<br>
2997<br>
2998CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
2999CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
3000CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
3001CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
3002CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
3003size amongst the &quot;ready&quot; media.<br>
3004<br>
3005The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
3006<br>
3007Returns 1 when there is a match and 0 if there is not a match.
3008
3009</p>
3010<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></h3>
3011 <p class="description">Get media names, dimensions, and margins.</p>
3012<p class="code">
3013int cupsGetDestMediaBySize (<br>
3014&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3015&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
3016&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
3017&#160;&#160;&#160;&#160;int width,<br>
3018&#160;&#160;&#160;&#160;int length,<br>
3019&#160;&#160;&#160;&#160;unsigned flags,<br>
3020&#160;&#160;&#160;&#160;<a href="#cups_size_t">cups_size_t</a> *size<br>
3021);</p>
3022<h4 class="parameters">Parameters</h4>
3023<dl>
3024<dt>http</dt>
3025 <dd class="description">Connection to destination</dd>
3026<dt>dest</dt>
3027 <dd class="description">Destination</dd>
3028<dt>dinfo</dt>
3029 <dd class="description">Destination information</dd>
3030<dt>width</dt>
3031 <dd class="description">Media width in hundredths of
3032of millimeters</dd>
3033<dt>length</dt>
3034 <dd class="description">Media length in hundredths of
3035of millimeters</dd>
3036<dt>flags</dt>
3037 <dd class="description">Media matching flags</dd>
3038<dt>size</dt>
3039 <dd class="description">Media size information</dd>
3040</dl>
3041<h4 class="returnvalue">Return Value</h4>
3042 <p class="description">1 on match, 0 on failure</p>
3043<h4 class="discussion">Discussion</h4>
3044 <p class="discussion">&quot;Width&quot; and &quot;length&quot; are the dimensions in hundredths of millimeters.
3045&quot;Flags&quot; provides some matching guidance (multiple flags can be combined):<br>
3046<br>
3047CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
3048CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
3049CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
3050CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
3051CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
3052size amongst the &quot;ready&quot; media.<br>
3053<br>
3054The matching result (if any) is returned in the &quot;cups_size_t&quot; structure.<br>
3055<br>
3056Returns 1 when there is a match and 0 if there is not a match.
3057
3058</p>
3059<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaCount">cupsGetDestMediaCount</a></h3>
3060 <p class="description">Get the number of sizes supported by a
3061destination.</p>
3062<p class="code">
3063int cupsGetDestMediaCount (<br>
3064&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3065&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
3066&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
3067&#160;&#160;&#160;&#160;unsigned flags<br>
3068);</p>
3069<h4 class="parameters">Parameters</h4>
3070<dl>
3071<dt>http</dt>
3072 <dd class="description">Connection to destination</dd>
3073<dt>dest</dt>
3074 <dd class="description">Destination</dd>
3075<dt>dinfo</dt>
3076 <dd class="description">Destination information</dd>
3077<dt>flags</dt>
3078 <dd class="description">Media flags</dd>
3079</dl>
3080<h4 class="returnvalue">Return Value</h4>
3081 <p class="description">Number of sizes</p>
3082<h4 class="discussion">Discussion</h4>
3083 <p class="discussion">The <code>flags</code> parameter determines the set of media sizes that are
3084counted. For example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return
3085the number of borderless sizes.
3086
3087</p>
3088<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></h3>
3089 <p class="description">Get the default size for a destination.</p>
3090<p class="code">
3091int cupsGetDestMediaDefault (<br>
3092&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3093&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
3094&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
3095&#160;&#160;&#160;&#160;unsigned flags,<br>
3096&#160;&#160;&#160;&#160;<a href="#cups_size_t">cups_size_t</a> *size<br>
3097);</p>
3098<h4 class="parameters">Parameters</h4>
3099<dl>
3100<dt>http</dt>
3101 <dd class="description">Connection to destination</dd>
3102<dt>dest</dt>
3103 <dd class="description">Destination</dd>
3104<dt>dinfo</dt>
3105 <dd class="description">Destination information</dd>
3106<dt>flags</dt>
3107 <dd class="description">Media flags</dd>
3108<dt>size</dt>
3109 <dd class="description">Media size information</dd>
3110</dl>
3111<h4 class="returnvalue">Return Value</h4>
3112 <p class="description">1 on success, 0 on failure</p>
3113<h4 class="discussion">Discussion</h4>
3114 <p class="discussion">The <code>flags</code> parameter determines which default size is returned. For
3115example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the default
3116borderless size, typically US Letter or A4, but sometimes 4x6 photo media.
3117
3118</p>
3119<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsGetDestWithURI">cupsGetDestWithURI</a></h3>
3120 <p class="description">Get a destination associated with a URI.</p>
3121<p class="code">
3122<a href="#cups_dest_t">cups_dest_t</a> *cupsGetDestWithURI (<br>
3123&#160;&#160;&#160;&#160;const char *name,<br>
3124&#160;&#160;&#160;&#160;const char *uri<br>
3125);</p>
3126<h4 class="parameters">Parameters</h4>
3127<dl>
3128<dt>name</dt>
3129 <dd class="description">Desired printer name or <code>NULL</code></dd>
3130<dt>uri</dt>
3131 <dd class="description">URI for the printer</dd>
3132</dl>
3133<h4 class="returnvalue">Return Value</h4>
3134 <p class="description">Destination or <code>NULL</code></p>
3135<h4 class="discussion">Discussion</h4>
3136 <p class="discussion">&quot;name&quot; is the desired name for the printer. If <code>NULL</code>, a name will be
3137created using the URI.<br>
3138<br>
3139&quot;uri&quot; is the &quot;ipp&quot; or &quot;ipps&quot; URI for the printer.
3140
3141</p>
3142<h3 class="function"><a id="cupsGetDests">cupsGetDests</a></h3>
3143 <p class="description">Get the list of destinations from the default server.</p>
3144<p class="code">
3145int cupsGetDests (<br>
3146&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> **dests<br>
3147);</p>
3148<h4 class="parameters">Parameters</h4>
3149<dl>
3150<dt>dests</dt>
3151 <dd class="description">Destinations</dd>
3152</dl>
3153<h4 class="returnvalue">Return Value</h4>
3154 <p class="description">Number of destinations</p>
3155<h4 class="discussion">Discussion</h4>
3156 <p class="discussion">Starting with CUPS 1.2, the returned list of destinations include the
3157printer-info, printer-is-accepting-jobs, printer-is-shared,
3158printer-make-and-model, printer-state, printer-state-change-time,
3159printer-state-reasons, and printer-type attributes as options. CUPS 1.4
3160adds the marker-change-time, marker-colors, marker-high-levels,
3161marker-levels, marker-low-levels, marker-message, marker-names,
3162marker-types, and printer-commands attributes as well.<br>
3163<br>
3164Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and
3165the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination.</p>
3166<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetDests2">cupsGetDests2</a></h3>
3167 <p class="description">Get the list of destinations from the specified server.</p>
3168<p class="code">
3169int cupsGetDests2 (<br>
3170&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3171&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> **dests<br>
3172);</p>
3173<h4 class="parameters">Parameters</h4>
3174<dl>
3175<dt>http</dt>
3176 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
3177<dt>dests</dt>
3178 <dd class="description">Destinations</dd>
3179</dl>
3180<h4 class="returnvalue">Return Value</h4>
3181 <p class="description">Number of destinations</p>
3182<h4 class="discussion">Discussion</h4>
3183 <p class="discussion">Starting with CUPS 1.2, the returned list of destinations include the
3184printer-info, printer-is-accepting-jobs, printer-is-shared,
3185printer-make-and-model, printer-state, printer-state-change-time,
3186printer-state-reasons, and printer-type attributes as options. CUPS 1.4
3187adds the marker-change-time, marker-colors, marker-high-levels,
3188marker-levels, marker-low-levels, marker-message, marker-names,
3189marker-types, and printer-commands attributes as well.<br>
3190<br>
3191Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and
3192the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination.
3193
3194</p>
3195<h3 class="function"><a id="cupsGetJobs">cupsGetJobs</a></h3>
3196 <p class="description">Get the jobs from the default server.</p>
3197<p class="code">
3198int cupsGetJobs (<br>
3199&#160;&#160;&#160;&#160;<a href="#cups_job_t">cups_job_t</a> **jobs,<br>
3200&#160;&#160;&#160;&#160;const char *name,<br>
3201&#160;&#160;&#160;&#160;int myjobs,<br>
3202&#160;&#160;&#160;&#160;int whichjobs<br>
3203);</p>
3204<h4 class="parameters">Parameters</h4>
3205<dl>
3206<dt>jobs</dt>
3207 <dd class="description">Job data</dd>
3208<dt>name</dt>
3209 <dd class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</dd>
3210<dt>myjobs</dt>
3211 <dd class="description">0 = all users, 1 = mine</dd>
3212<dt>whichjobs</dt>
3213 <dd class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></dd>
3214</dl>
3215<h4 class="returnvalue">Return Value</h4>
3216 <p class="description">Number of jobs</p>
3217<h4 class="discussion">Discussion</h4>
3218 <p class="discussion">A &quot;whichjobs&quot; value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless
3219of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are
3220pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns
3221jobs that are stopped, canceled, aborted, or completed.</p>
3222<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsGetJobs2">cupsGetJobs2</a></h3>
3223 <p class="description">Get the jobs from the specified server.</p>
3224<p class="code">
3225int cupsGetJobs2 (<br>
3226&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3227&#160;&#160;&#160;&#160;<a href="#cups_job_t">cups_job_t</a> **jobs,<br>
3228&#160;&#160;&#160;&#160;const char *name,<br>
3229&#160;&#160;&#160;&#160;int myjobs,<br>
3230&#160;&#160;&#160;&#160;int whichjobs<br>
3231);</p>
3232<h4 class="parameters">Parameters</h4>
3233<dl>
3234<dt>http</dt>
3235 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
3236<dt>jobs</dt>
3237 <dd class="description">Job data</dd>
3238<dt>name</dt>
3239 <dd class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</dd>
3240<dt>myjobs</dt>
3241 <dd class="description">0 = all users, 1 = mine</dd>
3242<dt>whichjobs</dt>
3243 <dd class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></dd>
3244</dl>
3245<h4 class="returnvalue">Return Value</h4>
3246 <p class="description">Number of jobs</p>
3247<h4 class="discussion">Discussion</h4>
3248 <p class="discussion">A &quot;whichjobs&quot; value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless
3249of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are
3250pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns
3251jobs that are stopped, canceled, aborted, or completed.
3252
3253</p>
3254<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsGetNamedDest">cupsGetNamedDest</a></h3>
3255 <p class="description">Get options for the named destination.</p>
3256<p class="code">
3257<a href="#cups_dest_t">cups_dest_t</a> *cupsGetNamedDest (<br>
3258&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3259&#160;&#160;&#160;&#160;const char *name,<br>
3260&#160;&#160;&#160;&#160;const char *instance<br>
3261);</p>
3262<h4 class="parameters">Parameters</h4>
3263<dl>
3264<dt>http</dt>
3265 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
3266<dt>name</dt>
3267 <dd class="description">Destination name or <code>NULL</code> for the default destination</dd>
3268<dt>instance</dt>
3269 <dd class="description">Instance name or <code>NULL</code></dd>
3270</dl>
3271<h4 class="returnvalue">Return Value</h4>
3272 <p class="description">Destination or <code>NULL</code></p>
3273<h4 class="discussion">Discussion</h4>
3274 <p class="discussion">This function is optimized for retrieving a single destination and should
3275be used instead of <a href="#cupsGetDests"><code>cupsGetDests</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> when you either
3276know the name of the destination or want to print to the default destination.
3277If <code>NULL</code> is returned, the destination does not exist or there is no
3278default destination.<br>
3279<br>
3280If &quot;http&quot; is <code>CUPS_HTTP_DEFAULT</code>, the connection to the default print
3281server will be used.<br>
3282<br>
3283If &quot;name&quot; is <code>NULL</code>, the default printer for the current user will be
3284returned.<br>
3285<br>
3286The returned destination must be freed using <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> with a
3287&quot;num_dests&quot; value of 1.
3288
3289</p>
3290<h3 class="function"><a id="cupsGetOption">cupsGetOption</a></h3>
3291 <p class="description">Get an option value.</p>
3292<p class="code">
3293const char *cupsGetOption (<br>
3294&#160;&#160;&#160;&#160;const char *name,<br>
3295&#160;&#160;&#160;&#160;int num_options,<br>
3296&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br>
3297);</p>
3298<h4 class="parameters">Parameters</h4>
3299<dl>
3300<dt>name</dt>
3301 <dd class="description">Name of option</dd>
3302<dt>num_options</dt>
3303 <dd class="description">Number of options</dd>
3304<dt>options</dt>
3305 <dd class="description">Options</dd>
3306</dl>
3307<h4 class="returnvalue">Return Value</h4>
3308 <p class="description">Option value or <code>NULL</code></p>
3309<h3 class="function"><a id="cupsGetPassword">cupsGetPassword</a></h3>
3310 <p class="description">Get a password from the user.</p>
3311<p class="code">
3312const char *cupsGetPassword (<br>
3313&#160;&#160;&#160;&#160;const char *prompt<br>
3314);</p>
3315<h4 class="parameters">Parameters</h4>
3316<dl>
3317<dt>prompt</dt>
3318 <dd class="description">Prompt string</dd>
3319</dl>
3320<h4 class="returnvalue">Return Value</h4>
3321 <p class="description">Password</p>
3322<h4 class="discussion">Discussion</h4>
3323 <p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the
3324user does not provide a password.<br>
3325<br>
3326Note: The current password callback function is tracked separately for each
3327thread in a program. Multi-threaded programs that override the setting via
3328the <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a> or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> functions need to
3329do so in each thread for the same function to be used.</p>
3330<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsGetPassword2">cupsGetPassword2</a></h3>
3331 <p class="description">Get a password from the user using the advanced
3332password callback.</p>
3333<p class="code">
3334const char *cupsGetPassword2 (<br>
3335&#160;&#160;&#160;&#160;const char *prompt,<br>
3336&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3337&#160;&#160;&#160;&#160;const char *method,<br>
3338&#160;&#160;&#160;&#160;const char *resource<br>
3339);</p>
3340<h4 class="parameters">Parameters</h4>
3341<dl>
3342<dt>prompt</dt>
3343 <dd class="description">Prompt string</dd>
3344<dt>http</dt>
3345 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
3346<dt>method</dt>
3347 <dd class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</dd>
3348<dt>resource</dt>
3349 <dd class="description">Resource path</dd>
3350</dl>
3351<h4 class="returnvalue">Return Value</h4>
3352 <p class="description">Password</p>
3353<h4 class="discussion">Discussion</h4>
3354 <p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the
3355user does not provide a password.<br>
3356<br>
3357Note: The current password callback function is tracked separately for each
3358thread in a program. Multi-threaded programs that override the setting via
3359the <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a> or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> functions need to
3360do so in each thread for the same function to be used.
3361
3362</p>
3363<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="cupsGetPrinters">cupsGetPrinters</a></h3>
3364 <p class="description">Get a list of printers from the default server.</p>
3365<p class="code">
3366int cupsGetPrinters (<br>
3367&#160;&#160;&#160;&#160;char ***printers<br>
3368);</p>
3369<h4 class="parameters">Parameters</h4>
3370<dl>
3371<dt>printers</dt>
3372 <dd class="description">Printers</dd>
3373</dl>
3374<h4 class="returnvalue">Return Value</h4>
3375 <p class="description">Number of printers</p>
3376<h4 class="discussion">Discussion</h4>
3377 <p class="discussion">This function is deprecated and no longer returns a list of printers - use
3378<a href="#cupsGetDests"><code>cupsGetDests</code></a> instead.
3379
3380</p>
3381<h3 class="function"><a id="cupsLangDefault">cupsLangDefault</a></h3>
3382 <p class="description">Return the default language.</p>
3383<p class="code">
3384<a href="#cups_lang_t">cups_lang_t</a> *cupsLangDefault (void);</p>
3385<h4 class="returnvalue">Return Value</h4>
3386 <p class="description">Language data</p>
3387<h3 class="function"><a id="cupsLangEncoding">cupsLangEncoding</a></h3>
3388 <p class="description">Return the character encoding (us-ascii, etc.)
3389for the given language.</p>
3390<p class="code">
3391const char *cupsLangEncoding (<br>
3392&#160;&#160;&#160;&#160;<a href="#cups_lang_t">cups_lang_t</a> *lang<br>
3393);</p>
3394<h4 class="parameters">Parameters</h4>
3395<dl>
3396<dt>lang</dt>
3397 <dd class="description">Language data</dd>
3398</dl>
3399<h4 class="returnvalue">Return Value</h4>
3400 <p class="description">Character encoding</p>
3401<h3 class="function"><a id="cupsLangFlush">cupsLangFlush</a></h3>
3402 <p class="description">Flush all language data out of the cache.</p>
3403<p class="code">
3404void cupsLangFlush (void);</p>
3405<h3 class="function"><a id="cupsLangFree">cupsLangFree</a></h3>
3406 <p class="description">Free language data.</p>
3407<p class="code">
3408void cupsLangFree (<br>
3409&#160;&#160;&#160;&#160;<a href="#cups_lang_t">cups_lang_t</a> *lang<br>
3410);</p>
3411<h4 class="parameters">Parameters</h4>
3412<dl>
3413<dt>lang</dt>
3414 <dd class="description">Language to free</dd>
3415</dl>
3416<h4 class="discussion">Discussion</h4>
3417 <p class="discussion">This does not actually free anything; use <a href="#cupsLangFlush"><code>cupsLangFlush</code></a> for that.</p>
3418<h3 class="function"><a id="cupsLangGet">cupsLangGet</a></h3>
3419 <p class="description">Get a language.</p>
3420<p class="code">
3421<a href="#cups_lang_t">cups_lang_t</a> *cupsLangGet (<br>
3422&#160;&#160;&#160;&#160;const char *language<br>
3423);</p>
3424<h4 class="parameters">Parameters</h4>
3425<dl>
3426<dt>language</dt>
3427 <dd class="description">Language or locale</dd>
3428</dl>
3429<h4 class="returnvalue">Return Value</h4>
3430 <p class="description">Language data</p>
3431<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></h3>
3432 <p class="description">Get the localized string for a destination media
3433size.</p>
3434<p class="code">
3435const char *cupsLocalizeDestMedia (<br>
3436&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3437&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
3438&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
3439&#160;&#160;&#160;&#160;unsigned flags,<br>
3440&#160;&#160;&#160;&#160;<a href="#cups_size_t">cups_size_t</a> *size<br>
3441);</p>
3442<h4 class="parameters">Parameters</h4>
3443<dl>
3444<dt>http</dt>
3445 <dd class="description">Connection to destination</dd>
3446<dt>dest</dt>
3447 <dd class="description">Destination</dd>
3448<dt>dinfo</dt>
3449 <dd class="description">Destination information</dd>
3450<dt>flags</dt>
3451 <dd class="description">Media flags</dd>
3452<dt>size</dt>
3453 <dd class="description">Media size</dd>
3454</dl>
3455<h4 class="returnvalue">Return Value</h4>
3456 <p class="description">Localized string</p>
3457<h4 class="discussion">Discussion</h4>
3458 <p class="discussion">The returned string is stored in the destination information and will become
3459invalid if the destination information is deleted.
3460
3461</p>
3462<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsLocalizeDestOption">cupsLocalizeDestOption</a></h3>
3463 <p class="description">Get the localized string for a destination
3464option.</p>
3465<p class="code">
3466const char *cupsLocalizeDestOption (<br>
3467&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3468&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
3469&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
3470&#160;&#160;&#160;&#160;const char *option<br>
3471);</p>
3472<h4 class="parameters">Parameters</h4>
3473<dl>
3474<dt>http</dt>
3475 <dd class="description">Connection to destination</dd>
3476<dt>dest</dt>
3477 <dd class="description">Destination</dd>
3478<dt>dinfo</dt>
3479 <dd class="description">Destination information</dd>
3480<dt>option</dt>
3481 <dd class="description">Option to localize</dd>
3482</dl>
3483<h4 class="returnvalue">Return Value</h4>
3484 <p class="description">Localized string</p>
3485<h4 class="discussion">Discussion</h4>
3486 <p class="discussion">The returned string is stored in the destination information and will become
3487invalid if the destination information is deleted.
3488
3489</p>
3490<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsLocalizeDestValue">cupsLocalizeDestValue</a></h3>
3491 <p class="description">Get the localized string for a destination
3492option+value pair.</p>
3493<p class="code">
3494const char *cupsLocalizeDestValue (<br>
3495&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3496&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
3497&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo,<br>
3498&#160;&#160;&#160;&#160;const char *option,<br>
3499&#160;&#160;&#160;&#160;const char *value<br>
3500);</p>
3501<h4 class="parameters">Parameters</h4>
3502<dl>
3503<dt>http</dt>
3504 <dd class="description">Connection to destination</dd>
3505<dt>dest</dt>
3506 <dd class="description">Destination</dd>
3507<dt>dinfo</dt>
3508 <dd class="description">Destination information</dd>
3509<dt>option</dt>
3510 <dd class="description">Option to localize</dd>
3511<dt>value</dt>
3512 <dd class="description">Value to localize</dd>
3513</dl>
3514<h4 class="returnvalue">Return Value</h4>
3515 <p class="description">Localized string</p>
3516<h4 class="discussion">Discussion</h4>
3517 <p class="discussion">The returned string is stored in the destination information and will become
3518invalid if the destination information is deleted.
3519
3520</p>
3521<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="cupsMakeServerCredentials">cupsMakeServerCredentials</a></h3>
3522 <p class="description">Make a self-signed certificate and private key pair.</p>
3523<p class="code">
3524int cupsMakeServerCredentials (<br>
3525&#160;&#160;&#160;&#160;const char *path,<br>
3526&#160;&#160;&#160;&#160;const char *common_name,<br>
3527&#160;&#160;&#160;&#160;int num_alt_names,<br>
3528&#160;&#160;&#160;&#160;const char **alt_names,<br>
3529&#160;&#160;&#160;&#160;time_t expiration_date<br>
3530);</p>
3531<h4 class="parameters">Parameters</h4>
3532<dl>
3533<dt>path</dt>
3534 <dd class="description">Keychain path or <code>NULL</code> for default</dd>
3535<dt>common_name</dt>
3536 <dd class="description">Common name</dd>
3537<dt>num_alt_names</dt>
3538 <dd class="description">Number of subject alternate names</dd>
3539<dt>alt_names</dt>
3540 <dd class="description">Subject Alternate Names</dd>
3541<dt>expiration_date</dt>
3542 <dd class="description">Expiration date</dd>
3543</dl>
3544<h4 class="returnvalue">Return Value</h4>
3545 <p class="description">1 on success, 0 on failure</p>
3546<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsNotifySubject">cupsNotifySubject</a></h3>
3547 <p class="description">Return the subject for the given notification message.</p>
3548<p class="code">
3549char *cupsNotifySubject (<br>
3550&#160;&#160;&#160;&#160;<a href="#cups_lang_t">cups_lang_t</a> *lang,<br>
3551&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *event<br>
3552);</p>
3553<h4 class="parameters">Parameters</h4>
3554<dl>
3555<dt>lang</dt>
3556 <dd class="description">Language data</dd>
3557<dt>event</dt>
3558 <dd class="description">Event data</dd>
3559</dl>
3560<h4 class="returnvalue">Return Value</h4>
3561 <p class="description">Subject string or <code>NULL</code></p>
3562<h4 class="discussion">Discussion</h4>
3563 <p class="discussion">The returned string must be freed by the caller using <code>free</code>.
3564
3565</p>
3566<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsNotifyText">cupsNotifyText</a></h3>
3567 <p class="description">Return the text for the given notification message.</p>
3568<p class="code">
3569char *cupsNotifyText (<br>
3570&#160;&#160;&#160;&#160;<a href="#cups_lang_t">cups_lang_t</a> *lang,<br>
3571&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *event<br>
3572);</p>
3573<h4 class="parameters">Parameters</h4>
3574<dl>
3575<dt>lang</dt>
3576 <dd class="description">Language data</dd>
3577<dt>event</dt>
3578 <dd class="description">Event data</dd>
3579</dl>
3580<h4 class="returnvalue">Return Value</h4>
3581 <p class="description">Message text or <code>NULL</code></p>
3582<h4 class="discussion">Discussion</h4>
3583 <p class="discussion">The returned string must be freed by the caller using <code>free</code>.
3584
3585</p>
3586<h3 class="function"><a id="cupsParseOptions">cupsParseOptions</a></h3>
3587 <p class="description">Parse options from a command-line argument.</p>
3588<p class="code">
3589int cupsParseOptions (<br>
3590&#160;&#160;&#160;&#160;const char *arg,<br>
3591&#160;&#160;&#160;&#160;int num_options,<br>
3592&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **options<br>
3593);</p>
3594<h4 class="parameters">Parameters</h4>
3595<dl>
3596<dt>arg</dt>
3597 <dd class="description">Argument to parse</dd>
3598<dt>num_options</dt>
3599 <dd class="description">Number of options</dd>
3600<dt>options</dt>
3601 <dd class="description">Options found</dd>
3602</dl>
3603<h4 class="returnvalue">Return Value</h4>
3604 <p class="description">Number of options found</p>
3605<h4 class="discussion">Discussion</h4>
3606 <p class="discussion">This function converts space-delimited name/value pairs according
3607to the PAPI text option ABNF specification. Collection values
3608(&quot;name={a=... b=... c=...}&quot;) are stored with the curley brackets
3609intact - use <code>cupsParseOptions</code> on the value to extract the
3610collection attributes.</p>
3611<h3 class="function"><a id="cupsPrintFile">cupsPrintFile</a></h3>
3612 <p class="description">Print a file to a printer or class on the default server.</p>
3613<p class="code">
3614int cupsPrintFile (<br>
3615&#160;&#160;&#160;&#160;const char *name,<br>
3616&#160;&#160;&#160;&#160;const char *filename,<br>
3617&#160;&#160;&#160;&#160;const char *title,<br>
3618&#160;&#160;&#160;&#160;int num_options,<br>
3619&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br>
3620);</p>
3621<h4 class="parameters">Parameters</h4>
3622<dl>
3623<dt>name</dt>
3624 <dd class="description">Destination name</dd>
3625<dt>filename</dt>
3626 <dd class="description">File to print</dd>
3627<dt>title</dt>
3628 <dd class="description">Title of job</dd>
3629<dt>num_options</dt>
3630 <dd class="description">Number of options</dd>
3631<dt>options</dt>
3632 <dd class="description">Options</dd>
3633</dl>
3634<h4 class="returnvalue">Return Value</h4>
3635 <p class="description">Job ID or 0 on error</p>
3636<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsPrintFile2">cupsPrintFile2</a></h3>
3637 <p class="description">Print a file to a printer or class on the specified
3638server.</p>
3639<p class="code">
3640int cupsPrintFile2 (<br>
3641&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3642&#160;&#160;&#160;&#160;const char *name,<br>
3643&#160;&#160;&#160;&#160;const char *filename,<br>
3644&#160;&#160;&#160;&#160;const char *title,<br>
3645&#160;&#160;&#160;&#160;int num_options,<br>
3646&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br>
3647);</p>
3648<h4 class="parameters">Parameters</h4>
3649<dl>
3650<dt>http</dt>
3651 <dd class="description">Connection to server</dd>
3652<dt>name</dt>
3653 <dd class="description">Destination name</dd>
3654<dt>filename</dt>
3655 <dd class="description">File to print</dd>
3656<dt>title</dt>
3657 <dd class="description">Title of job</dd>
3658<dt>num_options</dt>
3659 <dd class="description">Number of options</dd>
3660<dt>options</dt>
3661 <dd class="description">Options</dd>
3662</dl>
3663<h4 class="returnvalue">Return Value</h4>
3664 <p class="description">Job ID or 0 on error</p>
3665<h3 class="function"><a id="cupsPrintFiles">cupsPrintFiles</a></h3>
3666 <p class="description">Print one or more files to a printer or class on the
3667default server.</p>
3668<p class="code">
3669int cupsPrintFiles (<br>
3670&#160;&#160;&#160;&#160;const char *name,<br>
3671&#160;&#160;&#160;&#160;int num_files,<br>
3672&#160;&#160;&#160;&#160;const char **files,<br>
3673&#160;&#160;&#160;&#160;const char *title,<br>
3674&#160;&#160;&#160;&#160;int num_options,<br>
3675&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br>
3676);</p>
3677<h4 class="parameters">Parameters</h4>
3678<dl>
3679<dt>name</dt>
3680 <dd class="description">Destination name</dd>
3681<dt>num_files</dt>
3682 <dd class="description">Number of files</dd>
3683<dt>files</dt>
3684 <dd class="description">File(s) to print</dd>
3685<dt>title</dt>
3686 <dd class="description">Title of job</dd>
3687<dt>num_options</dt>
3688 <dd class="description">Number of options</dd>
3689<dt>options</dt>
3690 <dd class="description">Options</dd>
3691</dl>
3692<h4 class="returnvalue">Return Value</h4>
3693 <p class="description">Job ID or 0 on error</p>
3694<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsPrintFiles2">cupsPrintFiles2</a></h3>
3695 <p class="description">Print one or more files to a printer or class on the
3696specified server.</p>
3697<p class="code">
3698int cupsPrintFiles2 (<br>
3699&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3700&#160;&#160;&#160;&#160;const char *name,<br>
3701&#160;&#160;&#160;&#160;int num_files,<br>
3702&#160;&#160;&#160;&#160;const char **files,<br>
3703&#160;&#160;&#160;&#160;const char *title,<br>
3704&#160;&#160;&#160;&#160;int num_options,<br>
3705&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options<br>
3706);</p>
3707<h4 class="parameters">Parameters</h4>
3708<dl>
3709<dt>http</dt>
3710 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
3711<dt>name</dt>
3712 <dd class="description">Destination name</dd>
3713<dt>num_files</dt>
3714 <dd class="description">Number of files</dd>
3715<dt>files</dt>
3716 <dd class="description">File(s) to print</dd>
3717<dt>title</dt>
3718 <dd class="description">Title of job</dd>
3719<dt>num_options</dt>
3720 <dd class="description">Number of options</dd>
3721<dt>options</dt>
3722 <dd class="description">Options</dd>
3723</dl>
3724<h4 class="returnvalue">Return Value</h4>
3725 <p class="description">Job ID or 0 on error</p>
3726<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsRemoveDest">cupsRemoveDest</a></h3>
3727 <p class="description">Remove a destination from the destination list.</p>
3728<p class="code">
3729int cupsRemoveDest (<br>
3730&#160;&#160;&#160;&#160;const char *name,<br>
3731&#160;&#160;&#160;&#160;const char *instance,<br>
3732&#160;&#160;&#160;&#160;int num_dests,<br>
3733&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> **dests<br>
3734);</p>
3735<h4 class="parameters">Parameters</h4>
3736<dl>
3737<dt>name</dt>
3738 <dd class="description">Destination name</dd>
3739<dt>instance</dt>
3740 <dd class="description">Instance name or <code>NULL</code></dd>
3741<dt>num_dests</dt>
3742 <dd class="description">Number of destinations</dd>
3743<dt>dests</dt>
3744 <dd class="description">Destinations</dd>
3745</dl>
3746<h4 class="returnvalue">Return Value</h4>
3747 <p class="description">New number of destinations</p>
3748<h4 class="discussion">Discussion</h4>
3749 <p class="discussion">Removing a destination/instance does not delete the class or printer
3750queue, merely the lpoptions for that destination/instance. Use the
3751<a href="#cupsSetDests"><code>cupsSetDests</code></a> or <a href="#cupsSetDests2"><code>cupsSetDests2</code></a> functions to save the new
3752options for the user.
3753
3754</p>
3755<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsRemoveOption">cupsRemoveOption</a></h3>
3756 <p class="description">Remove an option from an option array.</p>
3757<p class="code">
3758int cupsRemoveOption (<br>
3759&#160;&#160;&#160;&#160;const char *name,<br>
3760&#160;&#160;&#160;&#160;int num_options,<br>
3761&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> **options<br>
3762);</p>
3763<h4 class="parameters">Parameters</h4>
3764<dl>
3765<dt>name</dt>
3766 <dd class="description">Option name</dd>
3767<dt>num_options</dt>
3768 <dd class="description">Current number of options</dd>
3769<dt>options</dt>
3770 <dd class="description">Options</dd>
3771</dl>
3772<h4 class="returnvalue">Return Value</h4>
3773 <p class="description">New number of options</p>
3774<h3 class="function"><a id="cupsServer">cupsServer</a></h3>
3775 <p class="description">Return the hostname/address of the current server.</p>
3776<p class="code">
3777const char *cupsServer (void);</p>
3778<h4 class="returnvalue">Return Value</h4>
3779 <p class="description">Server name</p>
3780<h4 class="discussion">Discussion</h4>
3781 <p class="discussion">The default server comes from the CUPS_SERVER environment variable, then the
3782~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not
3783set, the default is the local system - either &quot;localhost&quot; or a domain socket
3784path.<br>
3785<br>
3786The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6
3787address, or a domain socket pathname.<br>
3788<br>
3789Note: The current server is tracked separately for each thread in a program.
3790Multi-threaded programs that override the server via the
3791<a href="#cupsSetServer"><code>cupsSetServer</code></a> function need to do so in each thread for the same
3792server to be used.</p>
3793<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetClientCertCB">cupsSetClientCertCB</a></h3>
3794 <p class="description">Set the client certificate callback.</p>
3795<p class="code">
3796void cupsSetClientCertCB (<br>
3797&#160;&#160;&#160;&#160;<a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a> cb,<br>
3798&#160;&#160;&#160;&#160;void *user_data<br>
3799);</p>
3800<h4 class="parameters">Parameters</h4>
3801<dl>
3802<dt>cb</dt>
3803 <dd class="description">Callback function</dd>
3804<dt>user_data</dt>
3805 <dd class="description">User data pointer</dd>
3806</dl>
3807<h4 class="discussion">Discussion</h4>
3808 <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
3809<br>
3810Note: The current certificate callback is tracked separately for each thread
3811in a program. Multi-threaded programs that override the callback need to do
3812so in each thread for the same callback to be used.
3813
3814</p>
3815<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetCredentials">cupsSetCredentials</a></h3>
3816 <p class="description">Set the default credentials to be used for SSL/TLS
3817connections.</p>
3818<p class="code">
3819int cupsSetCredentials (<br>
3820&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *credentials<br>
3821);</p>
3822<h4 class="parameters">Parameters</h4>
3823<dl>
3824<dt>credentials</dt>
3825 <dd class="description">Array of credentials</dd>
3826</dl>
3827<h4 class="returnvalue">Return Value</h4>
3828 <p class="description">Status of call (0 = success)</p>
3829<h4 class="discussion">Discussion</h4>
3830 <p class="discussion">Note: The default credentials are tracked separately for each thread in a
3831program. Multi-threaded programs that override the setting need to do so in
3832each thread for the same setting to be used.
3833
3834</p>
3835<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="cupsSetDefaultDest">cupsSetDefaultDest</a></h3>
3836 <p class="description">Set the default destination.</p>
3837<p class="code">
3838void cupsSetDefaultDest (<br>
3839&#160;&#160;&#160;&#160;const char *name,<br>
3840&#160;&#160;&#160;&#160;const char *instance,<br>
3841&#160;&#160;&#160;&#160;int num_dests,<br>
3842&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dests<br>
3843);</p>
3844<h4 class="parameters">Parameters</h4>
3845<dl>
3846<dt>name</dt>
3847 <dd class="description">Destination name</dd>
3848<dt>instance</dt>
3849 <dd class="description">Instance name or <code>NULL</code></dd>
3850<dt>num_dests</dt>
3851 <dd class="description">Number of destinations</dd>
3852<dt>dests</dt>
3853 <dd class="description">Destinations</dd>
3854</dl>
3855<h3 class="function"><a id="cupsSetDests">cupsSetDests</a></h3>
3856 <p class="description">Save the list of destinations for the default server.</p>
3857<p class="code">
3858void cupsSetDests (<br>
3859&#160;&#160;&#160;&#160;int num_dests,<br>
3860&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dests<br>
3861);</p>
3862<h4 class="parameters">Parameters</h4>
3863<dl>
3864<dt>num_dests</dt>
3865 <dd class="description">Number of destinations</dd>
3866<dt>dests</dt>
3867 <dd class="description">Destinations</dd>
3868</dl>
3869<h4 class="discussion">Discussion</h4>
3870 <p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run
3871as root and ~/.cups/lpoptions when run as a normal user.</p>
3872<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="cupsSetDests2">cupsSetDests2</a></h3>
3873 <p class="description">Save the list of destinations for the specified server.</p>
3874<p class="code">
3875int cupsSetDests2 (<br>
3876&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
3877&#160;&#160;&#160;&#160;int num_dests,<br>
3878&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dests<br>
3879);</p>
3880<h4 class="parameters">Parameters</h4>
3881<dl>
3882<dt>http</dt>
3883 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
3884<dt>num_dests</dt>
3885 <dd class="description">Number of destinations</dd>
3886<dt>dests</dt>
3887 <dd class="description">Destinations</dd>
3888</dl>
3889<h4 class="returnvalue">Return Value</h4>
3890 <p class="description">0 on success, -1 on error</p>
3891<h4 class="discussion">Discussion</h4>
3892 <p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run
3893as root and ~/.cups/lpoptions when run as a normal user.
3894
3895</p>
3896<h3 class="function"><a id="cupsSetEncryption">cupsSetEncryption</a></h3>
3897 <p class="description">Set the encryption preference.</p>
3898<p class="code">
3899void cupsSetEncryption (<br>
3900&#160;&#160;&#160;&#160;<a href="#http_encryption_t">http_encryption_t</a> e<br>
3901);</p>
3902<h4 class="parameters">Parameters</h4>
3903<dl>
3904<dt>e</dt>
3905 <dd class="description">New encryption preference</dd>
3906</dl>
3907<h4 class="discussion">Discussion</h4>
3908 <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
3909environment variable, then the ~/.cups/client.conf file, and finally the
3910/etc/cups/client.conf file. If not set, the default is
3911<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
3912<br>
3913Note: The current encryption setting is tracked separately for each thread
3914in a program. Multi-threaded programs that override the setting need to do
3915so in each thread for the same setting to be used.</p>
3916<h3 class="function"><a id="cupsSetPasswordCB">cupsSetPasswordCB</a></h3>
3917 <p class="description">Set the password callback for CUPS.</p>
3918<p class="code">
3919void cupsSetPasswordCB (<br>
3920&#160;&#160;&#160;&#160;<a href="#cups_password_cb_t">cups_password_cb_t</a> cb<br>
3921);</p>
3922<h4 class="parameters">Parameters</h4>
3923<dl>
3924<dt>cb</dt>
3925 <dd class="description">Callback function</dd>
3926</dl>
3927<h4 class="discussion">Discussion</h4>
3928 <p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which
3929reads the password from the console. Programs should call either this
3930function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered
3931by a program per thread.<br>
3932<br>
3933Note: The current password callback is tracked separately for each thread
3934in a program. Multi-threaded programs that override the callback need to do
3935so in each thread for the same callback to be used.</p>
3936<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsSetPasswordCB2">cupsSetPasswordCB2</a></h3>
3937 <p class="description">Set the advanced password callback for CUPS.</p>
3938<p class="code">
3939void cupsSetPasswordCB2 (<br>
3940&#160;&#160;&#160;&#160;<a href="#cups_password_cb2_t">cups_password_cb2_t</a> cb,<br>
3941&#160;&#160;&#160;&#160;void *user_data<br>
3942);</p>
3943<h4 class="parameters">Parameters</h4>
3944<dl>
3945<dt>cb</dt>
3946 <dd class="description">Callback function</dd>
3947<dt>user_data</dt>
3948 <dd class="description">User data pointer</dd>
3949</dl>
3950<h4 class="discussion">Discussion</h4>
3951 <p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which
3952reads the password from the console. Programs should call either this
3953function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered
3954by a program per thread.<br>
3955<br>
3956Note: The current password callback is tracked separately for each thread
3957in a program. Multi-threaded programs that override the callback need to do
3958so in each thread for the same callback to be used.
3959
3960</p>
3961<h3 class="function"><a id="cupsSetServer">cupsSetServer</a></h3>
3962 <p class="description">Set the default server name and port.</p>
3963<p class="code">
3964void cupsSetServer (<br>
3965&#160;&#160;&#160;&#160;const char *server<br>
3966);</p>
3967<h4 class="parameters">Parameters</h4>
3968<dl>
3969<dt>server</dt>
3970 <dd class="description">Server name</dd>
3971</dl>
3972<h4 class="discussion">Discussion</h4>
3973 <p class="discussion">The &quot;server&quot; string can be a fully-qualified hostname, a numeric
3974IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP
3975addresses can be optionally followed by a colon and port number to override
3976the default port 631, e.g. &quot;hostname:8631&quot;. Pass <code>NULL</code> to restore the
3977default server name and port.<br>
3978<br>
3979Note: The current server is tracked separately for each thread in a program.
3980Multi-threaded programs that override the server need to do so in each
3981thread for the same server to be used.</p>
3982<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="cupsSetServerCertCB">cupsSetServerCertCB</a></h3>
3983 <p class="description">Set the server certificate callback.</p>
3984<p class="code">
3985void cupsSetServerCertCB (<br>
3986&#160;&#160;&#160;&#160;<a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a> cb,<br>
3987&#160;&#160;&#160;&#160;void *user_data<br>
3988);</p>
3989<h4 class="parameters">Parameters</h4>
3990<dl>
3991<dt>cb</dt>
3992 <dd class="description">Callback function</dd>
3993<dt>user_data</dt>
3994 <dd class="description">User data pointer</dd>
3995</dl>
3996<h4 class="discussion">Discussion</h4>
3997 <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
3998<br>
3999Note: The current credentials callback is tracked separately for each thread
4000in a program. Multi-threaded programs that override the callback need to do
4001so in each thread for the same callback to be used.
4002
4003</p>
4004<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="cupsSetServerCredentials">cupsSetServerCredentials</a></h3>
4005 <p class="description">Set the default server credentials.</p>
4006<p class="code">
4007int cupsSetServerCredentials (<br>
4008&#160;&#160;&#160;&#160;const char *path,<br>
4009&#160;&#160;&#160;&#160;const char *common_name,<br>
4010&#160;&#160;&#160;&#160;int auto_create<br>
4011);</p>
4012<h4 class="parameters">Parameters</h4>
4013<dl>
4014<dt>path</dt>
4015 <dd class="description">Keychain path or <code>NULL</code> for default</dd>
4016<dt>common_name</dt>
4017 <dd class="description">Default common name for server</dd>
4018<dt>auto_create</dt>
4019 <dd class="description">1 = automatically create self-signed certificates</dd>
4020</dl>
4021<h4 class="returnvalue">Return Value</h4>
4022 <p class="description">1 on success, 0 on failure</p>
4023<h4 class="discussion">Discussion</h4>
4024 <p class="discussion">Note: The server credentials are used by all threads in the running process.
4025This function is threadsafe.
4026
4027</p>
4028<h3 class="function"><a id="cupsSetUser">cupsSetUser</a></h3>
4029 <p class="description">Set the default user name.</p>
4030<p class="code">
4031void cupsSetUser (<br>
4032&#160;&#160;&#160;&#160;const char *user<br>
4033);</p>
4034<h4 class="parameters">Parameters</h4>
4035<dl>
4036<dt>user</dt>
4037 <dd class="description">User name</dd>
4038</dl>
4039<h4 class="discussion">Discussion</h4>
4040 <p class="discussion">Pass <code>NULL</code> to restore the default user name.<br>
4041<br>
4042Note: The current user name is tracked separately for each thread in a
4043program. Multi-threaded programs that override the user name need to do so
4044in each thread for the same user name to be used.</p>
4045<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsSetUserAgent">cupsSetUserAgent</a></h3>
4046 <p class="description">Set the default HTTP User-Agent string.</p>
4047<p class="code">
4048void cupsSetUserAgent (<br>
4049&#160;&#160;&#160;&#160;const char *user_agent<br>
4050);</p>
4051<h4 class="parameters">Parameters</h4>
4052<dl>
4053<dt>user_agent</dt>
4054 <dd class="description">User-Agent string or <code>NULL</code></dd>
4055</dl>
4056<h4 class="discussion">Discussion</h4>
4057 <p class="discussion">Setting the string to NULL forces the default value containing the CUPS
4058version, IPP version, and operating system version and architecture.
4059
4060</p>
4061<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="cupsStartDestDocument">cupsStartDestDocument</a></h3>
4062 <p class="description">Start a new document.</p>
4063<p class="code">
4064http_status_t cupsStartDestDocument (<br>
4065&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4066&#160;&#160;&#160;&#160;<a href="#cups_dest_t">cups_dest_t</a> *dest,<br>
4067&#160;&#160;&#160;&#160;<a href="#cups_dinfo_t">cups_dinfo_t</a> *info,<br>
4068&#160;&#160;&#160;&#160;int job_id,<br>
4069&#160;&#160;&#160;&#160;const char *docname,<br>
4070&#160;&#160;&#160;&#160;const char *format,<br>
4071&#160;&#160;&#160;&#160;int num_options,<br>
4072&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options,<br>
4073&#160;&#160;&#160;&#160;int last_document<br>
4074);</p>
4075<h4 class="parameters">Parameters</h4>
4076<dl>
4077<dt>http</dt>
4078 <dd class="description">Connection to destination</dd>
4079<dt>dest</dt>
4080 <dd class="description">Destination</dd>
4081<dt>info</dt>
4082 <dd class="description">Destination information</dd>
4083<dt>job_id</dt>
4084 <dd class="description">Job ID</dd>
4085<dt>docname</dt>
4086 <dd class="description">Document name</dd>
4087<dt>format</dt>
4088 <dd class="description">Document format</dd>
4089<dt>num_options</dt>
4090 <dd class="description">Number of document options</dd>
4091<dt>options</dt>
4092 <dd class="description">Document options</dd>
4093<dt>last_document</dt>
4094 <dd class="description">1 if this is the last document</dd>
4095</dl>
4096<h4 class="returnvalue">Return Value</h4>
4097 <p class="description">Status of document creation</p>
4098<h4 class="discussion">Discussion</h4>
4099 <p class="discussion">&quot;job_id&quot; is the job ID returned by cupsCreateDestJob. &quot;docname&quot; is the name
4100of the document/file being printed, &quot;format&quot; is the MIME media type for the
4101document (see CUPS_FORMAT_xxx constants), and &quot;num_options&quot; and &quot;options&quot;
4102are the options do be applied to the document. &quot;last_document&quot; should be 1
4103if this is the last document to be submitted in the job. Returns
4104<code>HTTP_CONTINUE</code> on success.
4105
4106</p>
4107<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="cupsStartDocument">cupsStartDocument</a></h3>
4108 <p class="description">Add a document to a job created with cupsCreateJob().</p>
4109<p class="code">
4110http_status_t cupsStartDocument (<br>
4111&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4112&#160;&#160;&#160;&#160;const char *name,<br>
4113&#160;&#160;&#160;&#160;int job_id,<br>
4114&#160;&#160;&#160;&#160;const char *docname,<br>
4115&#160;&#160;&#160;&#160;const char *format,<br>
4116&#160;&#160;&#160;&#160;int last_document<br>
4117);</p>
4118<h4 class="parameters">Parameters</h4>
4119<dl>
4120<dt>http</dt>
4121 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
4122<dt>name</dt>
4123 <dd class="description">Destination name</dd>
4124<dt>job_id</dt>
4125 <dd class="description">Job ID from <a href="#cupsCreateJob"><code>cupsCreateJob</code></a></dd>
4126<dt>docname</dt>
4127 <dd class="description">Name of document</dd>
4128<dt>format</dt>
4129 <dd class="description">MIME type or <code>CUPS_FORMAT_foo</code></dd>
4130<dt>last_document</dt>
4131 <dd class="description">1 for last document in job, 0 otherwise</dd>
4132</dl>
4133<h4 class="returnvalue">Return Value</h4>
4134 <p class="description">HTTP status of request</p>
4135<h4 class="discussion">Discussion</h4>
4136 <p class="discussion">Use <a href="#cupsWriteRequestData"><code>cupsWriteRequestData</code></a> to write data for the document and
4137<a href="#cupsFinishDocument"><code>cupsFinishDocument</code></a> to finish the document and get the submission status.<br>
4138<br>
4139The MIME type constants <code>CUPS_FORMAT_AUTO</code>, <code>CUPS_FORMAT_PDF</code>,
4140<code>CUPS_FORMAT_POSTSCRIPT</code>, <code>CUPS_FORMAT_RAW</code>, and
4141<code>CUPS_FORMAT_TEXT</code> are provided for the &quot;format&quot; argument, although
4142any supported MIME type string can be supplied.
4143
4144</p>
4145<h3 class="function"><a id="cupsTempFd">cupsTempFd</a></h3>
4146 <p class="description">Creates a temporary file.</p>
4147<p class="code">
4148int cupsTempFd (<br>
4149&#160;&#160;&#160;&#160;char *filename,<br>
4150&#160;&#160;&#160;&#160;int len<br>
4151);</p>
4152<h4 class="parameters">Parameters</h4>
4153<dl>
4154<dt>filename</dt>
4155 <dd class="description">Pointer to buffer</dd>
4156<dt>len</dt>
4157 <dd class="description">Size of buffer</dd>
4158</dl>
4159<h4 class="returnvalue">Return Value</h4>
4160 <p class="description">New file descriptor or -1 on error</p>
4161<h4 class="discussion">Discussion</h4>
4162 <p class="discussion">The temporary filename is returned in the filename buffer.
4163The temporary file is opened for reading and writing.</p>
4164<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="cupsTempFile">cupsTempFile</a></h3>
4165 <p class="description">Generates a temporary filename.</p>
4166<p class="code">
4167char *cupsTempFile (<br>
4168&#160;&#160;&#160;&#160;char *filename,<br>
4169&#160;&#160;&#160;&#160;int len<br>
4170);</p>
4171<h4 class="parameters">Parameters</h4>
4172<dl>
4173<dt>filename</dt>
4174 <dd class="description">Pointer to buffer</dd>
4175<dt>len</dt>
4176 <dd class="description">Size of buffer</dd>
4177</dl>
4178<h4 class="returnvalue">Return Value</h4>
4179 <p class="description">Filename or <code>NULL</code> on error</p>
4180<h4 class="discussion">Discussion</h4>
4181 <p class="discussion">The temporary filename is returned in the filename buffer.
4182This function is deprecated and will no longer generate a temporary
4183filename - use <a href="#cupsTempFd"><code>cupsTempFd</code></a> or <a href="#cupsTempFile2"><code>cupsTempFile2</code></a> instead.
4184
4185</p>
4186<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="cupsTempFile2">cupsTempFile2</a></h3>
4187 <p class="description">Creates a temporary CUPS file.</p>
4188<p class="code">
4189<a href="#cups_file_t">cups_file_t</a> *cupsTempFile2 (<br>
4190&#160;&#160;&#160;&#160;char *filename,<br>
4191&#160;&#160;&#160;&#160;int len<br>
4192);</p>
4193<h4 class="parameters">Parameters</h4>
4194<dl>
4195<dt>filename</dt>
4196 <dd class="description">Pointer to buffer</dd>
4197<dt>len</dt>
4198 <dd class="description">Size of buffer</dd>
4199</dl>
4200<h4 class="returnvalue">Return Value</h4>
4201 <p class="description">CUPS file or <code>NULL</code> on error</p>
4202<h4 class="discussion">Discussion</h4>
4203 <p class="discussion">The temporary filename is returned in the filename buffer.
4204The temporary file is opened for writing.
4205
4206</p>
4207<h3 class="function"><a id="cupsUser">cupsUser</a></h3>
4208 <p class="description">Return the current user's name.</p>
4209<p class="code">
4210const char *cupsUser (void);</p>
4211<h4 class="returnvalue">Return Value</h4>
4212 <p class="description">User name</p>
4213<h4 class="discussion">Discussion</h4>
4214 <p class="discussion">Note: The current user name is tracked separately for each thread in a
4215program. Multi-threaded programs that override the user name with the
4216<a href="#cupsSetUser"><code>cupsSetUser</code></a> function need to do so in each thread for the same user
4217name to be used.</p>
4218<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="cupsUserAgent">cupsUserAgent</a></h3>
4219 <p class="description">Return the default HTTP User-Agent string.</p>
4220<p class="code">
4221const char *cupsUserAgent (void);</p>
4222<h4 class="returnvalue">Return Value</h4>
4223 <p class="description">User-Agent string</p>
4224<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAcceptConnection">httpAcceptConnection</a></h3>
4225 <p class="description">Accept a new HTTP client connection from the
4226specified listening socket.</p>
4227<p class="code">
4228<a href="#http_t">http_t</a> *httpAcceptConnection (<br>
4229&#160;&#160;&#160;&#160;int fd,<br>
4230&#160;&#160;&#160;&#160;int blocking<br>
4231);</p>
4232<h4 class="parameters">Parameters</h4>
4233<dl>
4234<dt>fd</dt>
4235 <dd class="description">Listen socket file descriptor</dd>
4236<dt>blocking</dt>
4237 <dd class="description">1 if the connection should be
4238blocking, 0 otherwise</dd>
4239</dl>
4240<h4 class="returnvalue">Return Value</h4>
4241 <p class="description">HTTP connection or <code>NULL</code></p>
4242<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpAddCredential">httpAddCredential</a></h3>
4243 <p class="description">Allocates and adds a single credential to an array.</p>
4244<p class="code">
4245int httpAddCredential (<br>
4246&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *credentials,<br>
4247&#160;&#160;&#160;&#160;const void *data,<br>
4248&#160;&#160;&#160;&#160;size_t datalen<br>
4249);</p>
4250<h4 class="parameters">Parameters</h4>
4251<dl>
4252<dt>credentials</dt>
4253 <dd class="description">Credentials array</dd>
4254<dt>data</dt>
4255 <dd class="description">PEM-encoded X.509 data</dd>
4256<dt>datalen</dt>
4257 <dd class="description">Length of data</dd>
4258</dl>
4259<h4 class="returnvalue">Return Value</h4>
4260 <p class="description">0 on success, -1 on error</p>
4261<h4 class="discussion">Discussion</h4>
4262 <p class="discussion">Use <code>cupsArrayNew(NULL, NULL)</code> to create a credentials array.
4263
4264</p>
4265<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrAny">httpAddrAny</a></h3>
4266 <p class="description">Check for the &quot;any&quot; address.</p>
4267<p class="code">
4268int httpAddrAny (<br>
4269&#160;&#160;&#160;&#160;const <a href="#http_addr_t">http_addr_t</a> *addr<br>
4270);</p>
4271<h4 class="parameters">Parameters</h4>
4272<dl>
4273<dt>addr</dt>
4274 <dd class="description">Address to check</dd>
4275</dl>
4276<h4 class="returnvalue">Return Value</h4>
4277 <p class="description">1 if &quot;any&quot;, 0 otherwise</p>
4278<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpAddrClose">httpAddrClose</a></h3>
4279 <p class="description">Close a socket created by <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> or
4280<a href="#httpAddrListen"><code>httpAddrListen</code></a>.</p>
4281<p class="code">
4282int httpAddrClose (<br>
4283&#160;&#160;&#160;&#160;<a href="#http_addr_t">http_addr_t</a> *addr,<br>
4284&#160;&#160;&#160;&#160;int fd<br>
4285);</p>
4286<h4 class="parameters">Parameters</h4>
4287<dl>
4288<dt>addr</dt>
4289 <dd class="description">Listen address or <code>NULL</code></dd>
4290<dt>fd</dt>
4291 <dd class="description">Socket file descriptor</dd>
4292</dl>
4293<h4 class="returnvalue">Return Value</h4>
4294 <p class="description">0 on success, -1 on failure</p>
4295<h4 class="discussion">Discussion</h4>
4296 <p class="discussion">Pass <code>NULL</code> for sockets created with <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> and the
4297listen address for sockets created with <a href="#httpAddrListen"><code>httpAddrListen</code></a>. This will
4298ensure that domain sockets are removed when closed.
4299
4300</p>
4301<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrConnect">httpAddrConnect</a></h3>
4302 <p class="description">Connect to any of the addresses in the list.</p>
4303<p class="code">
4304<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrConnect (<br>
4305&#160;&#160;&#160;&#160;<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist,<br>
4306&#160;&#160;&#160;&#160;int *sock<br>
4307);</p>
4308<h4 class="parameters">Parameters</h4>
4309<dl>
4310<dt>addrlist</dt>
4311 <dd class="description">List of potential addresses</dd>
4312<dt>sock</dt>
4313 <dd class="description">Socket</dd>
4314</dl>
4315<h4 class="returnvalue">Return Value</h4>
4316 <p class="description">Connected address or NULL on failure</p>
4317<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrConnect2">httpAddrConnect2</a></h3>
4318 <p class="description">Connect to any of the addresses in the list with a
4319timeout and optional cancel.</p>
4320<p class="code">
4321<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrConnect2 (<br>
4322&#160;&#160;&#160;&#160;<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist,<br>
4323&#160;&#160;&#160;&#160;int *sock,<br>
4324&#160;&#160;&#160;&#160;int msec,<br>
4325&#160;&#160;&#160;&#160;int *cancel<br>
4326);</p>
4327<h4 class="parameters">Parameters</h4>
4328<dl>
4329<dt>addrlist</dt>
4330 <dd class="description">List of potential addresses</dd>
4331<dt>sock</dt>
4332 <dd class="description">Socket</dd>
4333<dt>msec</dt>
4334 <dd class="description">Timeout in milliseconds</dd>
4335<dt>cancel</dt>
4336 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
4337</dl>
4338<h4 class="returnvalue">Return Value</h4>
4339 <p class="description">Connected address or NULL on failure</p>
4340<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrCopyList">httpAddrCopyList</a></h3>
4341 <p class="description">Copy an address list.</p>
4342<p class="code">
4343<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrCopyList (<br>
4344&#160;&#160;&#160;&#160;<a href="#http_addrlist_t">http_addrlist_t</a> *src<br>
4345);</p>
4346<h4 class="parameters">Parameters</h4>
4347<dl>
4348<dt>src</dt>
4349 <dd class="description">Source address list</dd>
4350</dl>
4351<h4 class="returnvalue">Return Value</h4>
4352 <p class="description">New address list or <code>NULL</code> on error</p>
4353<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrEqual">httpAddrEqual</a></h3>
4354 <p class="description">Compare two addresses.</p>
4355<p class="code">
4356int httpAddrEqual (<br>
4357&#160;&#160;&#160;&#160;const <a href="#http_addr_t">http_addr_t</a> *addr1,<br>
4358&#160;&#160;&#160;&#160;const <a href="#http_addr_t">http_addr_t</a> *addr2<br>
4359);</p>
4360<h4 class="parameters">Parameters</h4>
4361<dl>
4362<dt>addr1</dt>
4363 <dd class="description">First address</dd>
4364<dt>addr2</dt>
4365 <dd class="description">Second address</dd>
4366</dl>
4367<h4 class="returnvalue">Return Value</h4>
4368 <p class="description">1 if equal, 0 if not</p>
4369<h3 class="function"><a id="httpAddrFamily">httpAddrFamily</a></h3>
4370 <p class="description">Get the address family of an address.</p>
4371<p class="code">
4372int httpAddrFamily (<br>
4373&#160;&#160;&#160;&#160;<a href="#http_addr_t">http_addr_t</a> *addr<br>
4374);</p>
4375<h4 class="parameters">Parameters</h4>
4376<dl>
4377<dt>addr</dt>
4378 <dd class="description">Address</dd>
4379</dl>
4380<h4 class="returnvalue">Return Value</h4>
4381 <p class="description">Address family</p>
4382<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrFreeList">httpAddrFreeList</a></h3>
4383 <p class="description">Free an address list.</p>
4384<p class="code">
4385void httpAddrFreeList (<br>
4386&#160;&#160;&#160;&#160;<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist<br>
4387);</p>
4388<h4 class="parameters">Parameters</h4>
4389<dl>
4390<dt>addrlist</dt>
4391 <dd class="description">Address list to free</dd>
4392</dl>
4393<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrGetList">httpAddrGetList</a></h3>
4394 <p class="description">Get a list of addresses for a hostname.</p>
4395<p class="code">
4396<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrGetList (<br>
4397&#160;&#160;&#160;&#160;const char *hostname,<br>
4398&#160;&#160;&#160;&#160;int family,<br>
4399&#160;&#160;&#160;&#160;const char *service<br>
4400);</p>
4401<h4 class="parameters">Parameters</h4>
4402<dl>
4403<dt>hostname</dt>
4404 <dd class="description">Hostname, IP address, or NULL for passive listen address</dd>
4405<dt>family</dt>
4406 <dd class="description">Address family or AF_UNSPEC</dd>
4407<dt>service</dt>
4408 <dd class="description">Service name or port number</dd>
4409</dl>
4410<h4 class="returnvalue">Return Value</h4>
4411 <p class="description">List of addresses or NULL</p>
4412<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLength">httpAddrLength</a></h3>
4413 <p class="description">Return the length of the address in bytes.</p>
4414<p class="code">
4415int httpAddrLength (<br>
4416&#160;&#160;&#160;&#160;const <a href="#http_addr_t">http_addr_t</a> *addr<br>
4417);</p>
4418<h4 class="parameters">Parameters</h4>
4419<dl>
4420<dt>addr</dt>
4421 <dd class="description">Address</dd>
4422</dl>
4423<h4 class="returnvalue">Return Value</h4>
4424 <p class="description">Length in bytes</p>
4425<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrListen">httpAddrListen</a></h3>
4426 <p class="description">Create a listening socket bound to the specified
4427address and port.</p>
4428<p class="code">
4429int httpAddrListen (<br>
4430&#160;&#160;&#160;&#160;<a href="#http_addr_t">http_addr_t</a> *addr,<br>
4431&#160;&#160;&#160;&#160;int port<br>
4432);</p>
4433<h4 class="parameters">Parameters</h4>
4434<dl>
4435<dt>addr</dt>
4436 <dd class="description">Address to bind to</dd>
4437<dt>port</dt>
4438 <dd class="description">Port number to bind to</dd>
4439</dl>
4440<h4 class="returnvalue">Return Value</h4>
4441 <p class="description">Socket or -1 on error</p>
4442<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLocalhost">httpAddrLocalhost</a></h3>
4443 <p class="description">Check for the local loopback address.</p>
4444<p class="code">
4445int httpAddrLocalhost (<br>
4446&#160;&#160;&#160;&#160;const <a href="#http_addr_t">http_addr_t</a> *addr<br>
4447);</p>
4448<h4 class="parameters">Parameters</h4>
4449<dl>
4450<dt>addr</dt>
4451 <dd class="description">Address to check</dd>
4452</dl>
4453<h4 class="returnvalue">Return Value</h4>
4454 <p class="description">1 if local host, 0 otherwise</p>
4455<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrLookup">httpAddrLookup</a></h3>
4456 <p class="description">Lookup the hostname associated with the address.</p>
4457<p class="code">
4458char *httpAddrLookup (<br>
4459&#160;&#160;&#160;&#160;const <a href="#http_addr_t">http_addr_t</a> *addr,<br>
4460&#160;&#160;&#160;&#160;char *name,<br>
4461&#160;&#160;&#160;&#160;int namelen<br>
4462);</p>
4463<h4 class="parameters">Parameters</h4>
4464<dl>
4465<dt>addr</dt>
4466 <dd class="description">Address to lookup</dd>
4467<dt>name</dt>
4468 <dd class="description">Host name buffer</dd>
4469<dt>namelen</dt>
4470 <dd class="description">Size of name buffer</dd>
4471</dl>
4472<h4 class="returnvalue">Return Value</h4>
4473 <p class="description">Host name</p>
4474<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAddrPort">httpAddrPort</a></h3>
4475 <p class="description">Get the port number associated with an address.</p>
4476<p class="code">
4477int httpAddrPort (<br>
4478&#160;&#160;&#160;&#160;<a href="#http_addr_t">http_addr_t</a> *addr<br>
4479);</p>
4480<h4 class="parameters">Parameters</h4>
4481<dl>
4482<dt>addr</dt>
4483 <dd class="description">Address</dd>
4484</dl>
4485<h4 class="returnvalue">Return Value</h4>
4486 <p class="description">Port number</p>
4487<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAddrString">httpAddrString</a></h3>
4488 <p class="description">Convert an address to a numeric string.</p>
4489<p class="code">
4490char *httpAddrString (<br>
4491&#160;&#160;&#160;&#160;const <a href="#http_addr_t">http_addr_t</a> *addr,<br>
4492&#160;&#160;&#160;&#160;char *s,<br>
4493&#160;&#160;&#160;&#160;int slen<br>
4494);</p>
4495<h4 class="parameters">Parameters</h4>
4496<dl>
4497<dt>addr</dt>
4498 <dd class="description">Address to convert</dd>
4499<dt>s</dt>
4500 <dd class="description">String buffer</dd>
4501<dt>slen</dt>
4502 <dd class="description">Length of string</dd>
4503</dl>
4504<h4 class="returnvalue">Return Value</h4>
4505 <p class="description">Numeric address string</p>
4506<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAssembleURI">httpAssembleURI</a></h3>
4507 <p class="description">Assemble a uniform resource identifier from its
4508components.</p>
4509<p class="code">
4510<a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURI (<br>
4511&#160;&#160;&#160;&#160;<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding,<br>
4512&#160;&#160;&#160;&#160;char *uri,<br>
4513&#160;&#160;&#160;&#160;int urilen,<br>
4514&#160;&#160;&#160;&#160;const char *scheme,<br>
4515&#160;&#160;&#160;&#160;const char *username,<br>
4516&#160;&#160;&#160;&#160;const char *host,<br>
4517&#160;&#160;&#160;&#160;int port,<br>
4518&#160;&#160;&#160;&#160;const char *resource<br>
4519);</p>
4520<h4 class="parameters">Parameters</h4>
4521<dl>
4522<dt>encoding</dt>
4523 <dd class="description">Encoding flags</dd>
4524<dt>uri</dt>
4525 <dd class="description">URI buffer</dd>
4526<dt>urilen</dt>
4527 <dd class="description">Size of URI buffer</dd>
4528<dt>scheme</dt>
4529 <dd class="description">Scheme name</dd>
4530<dt>username</dt>
4531 <dd class="description">Username</dd>
4532<dt>host</dt>
4533 <dd class="description">Hostname or address</dd>
4534<dt>port</dt>
4535 <dd class="description">Port number</dd>
4536<dt>resource</dt>
4537 <dd class="description">Resource</dd>
4538</dl>
4539<h4 class="returnvalue">Return Value</h4>
4540 <p class="description">URI status</p>
4541<h4 class="discussion">Discussion</h4>
4542 <p class="discussion">This function escapes reserved characters in the URI depending on the
4543value of the &quot;encoding&quot; argument. You should use this function in
4544place of traditional string functions whenever you need to create a
4545URI string.
4546
4547</p>
4548<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpAssembleURIf">httpAssembleURIf</a></h3>
4549 <p class="description">Assemble a uniform resource identifier from its
4550components with a formatted resource.</p>
4551<p class="code">
4552<a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURIf (<br>
4553&#160;&#160;&#160;&#160;<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding,<br>
4554&#160;&#160;&#160;&#160;char *uri,<br>
4555&#160;&#160;&#160;&#160;int urilen,<br>
4556&#160;&#160;&#160;&#160;const char *scheme,<br>
4557&#160;&#160;&#160;&#160;const char *username,<br>
4558&#160;&#160;&#160;&#160;const char *host,<br>
4559&#160;&#160;&#160;&#160;int port,<br>
4560&#160;&#160;&#160;&#160;const char *resourcef,<br>
4561&#160;&#160;&#160;&#160;...<br>
4562);</p>
4563<h4 class="parameters">Parameters</h4>
4564<dl>
4565<dt>encoding</dt>
4566 <dd class="description">Encoding flags</dd>
4567<dt>uri</dt>
4568 <dd class="description">URI buffer</dd>
4569<dt>urilen</dt>
4570 <dd class="description">Size of URI buffer</dd>
4571<dt>scheme</dt>
4572 <dd class="description">Scheme name</dd>
4573<dt>username</dt>
4574 <dd class="description">Username</dd>
4575<dt>host</dt>
4576 <dd class="description">Hostname or address</dd>
4577<dt>port</dt>
4578 <dd class="description">Port number</dd>
4579<dt>resourcef</dt>
4580 <dd class="description">Printf-style resource</dd>
4581<dt>...</dt>
4582 <dd class="description">Additional arguments as needed</dd>
4583</dl>
4584<h4 class="returnvalue">Return Value</h4>
4585 <p class="description">URI status</p>
4586<h4 class="discussion">Discussion</h4>
4587 <p class="discussion">This function creates a formatted version of the resource string
4588argument &quot;resourcef&quot; and escapes reserved characters in the URI
4589depending on the value of the &quot;encoding&quot; argument. You should use
4590this function in place of traditional string functions whenever
4591you need to create a URI string.
4592
4593</p>
4594<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpAssembleUUID">httpAssembleUUID</a></h3>
4595 <p class="description">Assemble a name-based UUID URN conforming to RFC 4122.</p>
4596<p class="code">
4597char *httpAssembleUUID (<br>
4598&#160;&#160;&#160;&#160;const char *server,<br>
4599&#160;&#160;&#160;&#160;int port,<br>
4600&#160;&#160;&#160;&#160;const char *name,<br>
4601&#160;&#160;&#160;&#160;int number,<br>
4602&#160;&#160;&#160;&#160;char *buffer,<br>
4603&#160;&#160;&#160;&#160;size_t bufsize<br>
4604);</p>
4605<h4 class="parameters">Parameters</h4>
4606<dl>
4607<dt>server</dt>
4608 <dd class="description">Server name</dd>
4609<dt>port</dt>
4610 <dd class="description">Port number</dd>
4611<dt>name</dt>
4612 <dd class="description">Object name or NULL</dd>
4613<dt>number</dt>
4614 <dd class="description">Object number or 0</dd>
4615<dt>buffer</dt>
4616 <dd class="description">String buffer</dd>
4617<dt>bufsize</dt>
4618 <dd class="description">Size of buffer</dd>
4619</dl>
4620<h4 class="returnvalue">Return Value</h4>
4621 <p class="description">UUID string</p>
4622<h4 class="discussion">Discussion</h4>
4623 <p class="discussion">This function creates a unique 128-bit identifying number using the server
4624name, port number, random data, and optionally an object name and/or object
4625number. The result is formatted as a UUID URN as defined in RFC 4122.<br>
4626<br>
4627The buffer needs to be at least 46 bytes in size.
4628
4629</p>
4630<h3 class="function"><a id="httpBlocking">httpBlocking</a></h3>
4631 <p class="description">Set blocking/non-blocking behavior on a connection.</p>
4632<p class="code">
4633void httpBlocking (<br>
4634&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4635&#160;&#160;&#160;&#160;int b<br>
4636);</p>
4637<h4 class="parameters">Parameters</h4>
4638<dl>
4639<dt>http</dt>
4640 <dd class="description">HTTP connection</dd>
4641<dt>b</dt>
4642 <dd class="description">1 = blocking, 0 = non-blocking</dd>
4643</dl>
4644<h3 class="function"><a id="httpCheck">httpCheck</a></h3>
4645 <p class="description">Check to see if there is a pending response from the server.</p>
4646<p class="code">
4647int httpCheck (<br>
4648&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
4649);</p>
4650<h4 class="parameters">Parameters</h4>
4651<dl>
4652<dt>http</dt>
4653 <dd class="description">HTTP connection</dd>
4654</dl>
4655<h4 class="returnvalue">Return Value</h4>
4656 <p class="description">0 = no data, 1 = data available</p>
4657<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpClearCookie">httpClearCookie</a></h3>
4658 <p class="description">Clear the cookie value(s).</p>
4659<p class="code">
4660void httpClearCookie (<br>
4661&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
4662);</p>
4663<h4 class="parameters">Parameters</h4>
4664<dl>
4665<dt>http</dt>
4666 <dd class="description">HTTP connection</dd>
4667</dl>
4668<h3 class="function"><a id="httpClearFields">httpClearFields</a></h3>
4669 <p class="description">Clear HTTP request fields.</p>
4670<p class="code">
4671void httpClearFields (<br>
4672&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
4673);</p>
4674<h4 class="parameters">Parameters</h4>
4675<dl>
4676<dt>http</dt>
4677 <dd class="description">HTTP connection</dd>
4678</dl>
4679<h3 class="function"><a id="httpClose">httpClose</a></h3>
4680 <p class="description">Close an HTTP connection.</p>
4681<p class="code">
4682void httpClose (<br>
4683&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
4684);</p>
4685<h4 class="parameters">Parameters</h4>
4686<dl>
4687<dt>http</dt>
4688 <dd class="description">HTTP connection</dd>
4689</dl>
4690<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpCompareCredentials">httpCompareCredentials</a></h3>
4691 <p class="description">Compare two sets of X.509 credentials.</p>
4692<p class="code">
4693int httpCompareCredentials (<br>
4694&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *cred1,<br>
4695&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *cred2<br>
4696);</p>
4697<h4 class="parameters">Parameters</h4>
4698<dl>
4699<dt>cred1</dt>
4700 <dd class="description">First set of X.509 credentials</dd>
4701<dt>cred2</dt>
4702 <dd class="description">Second set of X.509 credentials</dd>
4703</dl>
4704<h4 class="returnvalue">Return Value</h4>
4705 <p class="description">1 if they match, 0 if they do not</p>
4706<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="httpConnect">httpConnect</a></h3>
4707 <p class="description">Connect to a HTTP server.</p>
4708<p class="code">
4709<a href="#http_t">http_t</a> *httpConnect (<br>
4710&#160;&#160;&#160;&#160;const char *host,<br>
4711&#160;&#160;&#160;&#160;int port<br>
4712);</p>
4713<h4 class="parameters">Parameters</h4>
4714<dl>
4715<dt>host</dt>
4716 <dd class="description">Host to connect to</dd>
4717<dt>port</dt>
4718 <dd class="description">Port number</dd>
4719</dl>
4720<h4 class="returnvalue">Return Value</h4>
4721 <p class="description">New HTTP connection</p>
4722<h4 class="discussion">Discussion</h4>
4723 <p class="discussion">This function is deprecated - use <a href="#httpConnect2"><code>httpConnect2</code></a> instead.
4724
4725</p>
4726<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpConnect2">httpConnect2</a></h3>
4727 <p class="description">Connect to a HTTP server.</p>
4728<p class="code">
4729<a href="#http_t">http_t</a> *httpConnect2 (<br>
4730&#160;&#160;&#160;&#160;const char *host,<br>
4731&#160;&#160;&#160;&#160;int port,<br>
4732&#160;&#160;&#160;&#160;<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist,<br>
4733&#160;&#160;&#160;&#160;int family,<br>
4734&#160;&#160;&#160;&#160;<a href="#http_encryption_t">http_encryption_t</a> encryption,<br>
4735&#160;&#160;&#160;&#160;int blocking,<br>
4736&#160;&#160;&#160;&#160;int msec,<br>
4737&#160;&#160;&#160;&#160;int *cancel<br>
4738);</p>
4739<h4 class="parameters">Parameters</h4>
4740<dl>
4741<dt>host</dt>
4742 <dd class="description">Host to connect to</dd>
4743<dt>port</dt>
4744 <dd class="description">Port number</dd>
4745<dt>addrlist</dt>
4746 <dd class="description">List of addresses or NULL to lookup</dd>
4747<dt>family</dt>
4748 <dd class="description">Address family to use or <code>AF_UNSPEC</code> for any</dd>
4749<dt>encryption</dt>
4750 <dd class="description">Type of encryption to use</dd>
4751<dt>blocking</dt>
4752 <dd class="description">1 for blocking connection, 0 for non-blocking</dd>
4753<dt>msec</dt>
4754 <dd class="description">Connection timeout in milliseconds, 0 means don't connect</dd>
4755<dt>cancel</dt>
4756 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
4757</dl>
4758<h4 class="returnvalue">Return Value</h4>
4759 <p class="description">New HTTP connection</p>
4760<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="httpConnectEncrypt">httpConnectEncrypt</a></h3>
4761 <p class="description">Connect to a HTTP server using encryption.</p>
4762<p class="code">
4763<a href="#http_t">http_t</a> *httpConnectEncrypt (<br>
4764&#160;&#160;&#160;&#160;const char *host,<br>
4765&#160;&#160;&#160;&#160;int port,<br>
4766&#160;&#160;&#160;&#160;<a href="#http_encryption_t">http_encryption_t</a> encryption<br>
4767);</p>
4768<h4 class="parameters">Parameters</h4>
4769<dl>
4770<dt>host</dt>
4771 <dd class="description">Host to connect to</dd>
4772<dt>port</dt>
4773 <dd class="description">Port number</dd>
4774<dt>encryption</dt>
4775 <dd class="description">Type of encryption to use</dd>
4776</dl>
4777<h4 class="returnvalue">Return Value</h4>
4778 <p class="description">New HTTP connection</p>
4779<h4 class="discussion">Discussion</h4>
4780 <p class="discussion">This function is now deprecated. Please use the <a href="#httpConnect2"><code>httpConnect2</code></a> function
4781instead.
4782
4783</p>
4784<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpCopyCredentials">httpCopyCredentials</a></h3>
4785 <p class="description">Copy the credentials associated with the peer in
4786an encrypted connection.</p>
4787<p class="code">
4788int httpCopyCredentials (<br>
4789&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4790&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> **credentials<br>
4791);</p>
4792<h4 class="parameters">Parameters</h4>
4793<dl>
4794<dt>http</dt>
4795 <dd class="description">Connection to server</dd>
4796<dt>credentials</dt>
4797 <dd class="description">Array of credentials</dd>
4798</dl>
4799<h4 class="returnvalue">Return Value</h4>
4800 <p class="description">Status of call (0 = success)</p>
4801<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></h3>
4802 <p class="description">Return whether the credentials are valid for the given name.</p>
4803<p class="code">
4804int httpCredentialsAreValidForName (<br>
4805&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *credentials,<br>
4806&#160;&#160;&#160;&#160;const char *common_name<br>
4807);</p>
4808<h4 class="parameters">Parameters</h4>
4809<dl>
4810<dt>credentials</dt>
4811 <dd class="description">Credentials</dd>
4812<dt>common_name</dt>
4813 <dd class="description">Name to check</dd>
4814</dl>
4815<h4 class="returnvalue">Return Value</h4>
4816 <p class="description">1 if valid, 0 otherwise</p>
4817<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></h3>
4818 <p class="description">Return the expiration date of the credentials.</p>
4819<p class="code">
4820time_t httpCredentialsGetExpiration (<br>
4821&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *credentials<br>
4822);</p>
4823<h4 class="parameters">Parameters</h4>
4824<dl>
4825<dt>credentials</dt>
4826 <dd class="description">Credentials</dd>
4827</dl>
4828<h4 class="returnvalue">Return Value</h4>
4829 <p class="description">Expiration date of credentials</p>
4830<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsGetTrust">httpCredentialsGetTrust</a></h3>
4831 <p class="description">Return the trust of credentials.</p>
4832<p class="code">
4833<a href="#http_trust_t">http_trust_t</a> httpCredentialsGetTrust (<br>
4834&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *credentials,<br>
4835&#160;&#160;&#160;&#160;const char *common_name<br>
4836);</p>
4837<h4 class="parameters">Parameters</h4>
4838<dl>
4839<dt>credentials</dt>
4840 <dd class="description">Credentials</dd>
4841<dt>common_name</dt>
4842 <dd class="description">Common name for trust lookup</dd>
4843</dl>
4844<h4 class="returnvalue">Return Value</h4>
4845 <p class="description">Level of trust</p>
4846<h3 class="function"><span class="info">&#160;CUPS 2.0/macOS 10.10&#160;</span><a id="httpCredentialsString">httpCredentialsString</a></h3>
4847 <p class="description">Return a string representing the credentials.</p>
4848<p class="code">
4849size_t httpCredentialsString (<br>
4850&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *credentials,<br>
4851&#160;&#160;&#160;&#160;char *buffer,<br>
4852&#160;&#160;&#160;&#160;size_t bufsize<br>
4853);</p>
4854<h4 class="parameters">Parameters</h4>
4855<dl>
4856<dt>credentials</dt>
4857 <dd class="description">Credentials</dd>
4858<dt>buffer</dt>
4859 <dd class="description">Buffer or <code>NULL</code></dd>
4860<dt>bufsize</dt>
4861 <dd class="description">Size of buffer</dd>
4862</dl>
4863<h4 class="returnvalue">Return Value</h4>
4864 <p class="description">Total size of credentials string</p>
4865<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="httpDecode64">httpDecode64</a></h3>
4866 <p class="description">Base64-decode a string.</p>
4867<p class="code">
4868char *httpDecode64 (<br>
4869&#160;&#160;&#160;&#160;char *out,<br>
4870&#160;&#160;&#160;&#160;const char *in<br>
4871);</p>
4872<h4 class="parameters">Parameters</h4>
4873<dl>
4874<dt>out</dt>
4875 <dd class="description">String to write to</dd>
4876<dt>in</dt>
4877 <dd class="description">String to read from</dd>
4878</dl>
4879<h4 class="returnvalue">Return Value</h4>
4880 <p class="description">Decoded string</p>
4881<h4 class="discussion">Discussion</h4>
4882 <p class="discussion">This function is deprecated. Use the httpDecode64_2() function instead
4883which provides buffer length arguments.
4884
4885</p>
4886<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="httpDecode64_2">httpDecode64_2</a></h3>
4887 <p class="description">Base64-decode a string.</p>
4888<p class="code">
4889char *httpDecode64_2 (<br>
4890&#160;&#160;&#160;&#160;char *out,<br>
4891&#160;&#160;&#160;&#160;int *outlen,<br>
4892&#160;&#160;&#160;&#160;const char *in<br>
4893);</p>
4894<h4 class="parameters">Parameters</h4>
4895<dl>
4896<dt>out</dt>
4897 <dd class="description">String to write to</dd>
4898<dt>outlen</dt>
4899 <dd class="description">Size of output string</dd>
4900<dt>in</dt>
4901 <dd class="description">String to read from</dd>
4902</dl>
4903<h4 class="returnvalue">Return Value</h4>
4904 <p class="description">Decoded string</p>
4905<h3 class="function"><a id="httpDelete">httpDelete</a></h3>
4906 <p class="description">Send a DELETE request to the server.</p>
4907<p class="code">
4908int httpDelete (<br>
4909&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4910&#160;&#160;&#160;&#160;const char *uri<br>
4911);</p>
4912<h4 class="parameters">Parameters</h4>
4913<dl>
4914<dt>http</dt>
4915 <dd class="description">HTTP connection</dd>
4916<dt>uri</dt>
4917 <dd class="description">URI to delete</dd>
4918</dl>
4919<h4 class="returnvalue">Return Value</h4>
4920 <p class="description">Status of call (0 = success)</p>
4921<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="httpEncode64">httpEncode64</a></h3>
4922 <p class="description">Base64-encode a string.</p>
4923<p class="code">
4924char *httpEncode64 (<br>
4925&#160;&#160;&#160;&#160;char *out,<br>
4926&#160;&#160;&#160;&#160;const char *in<br>
4927);</p>
4928<h4 class="parameters">Parameters</h4>
4929<dl>
4930<dt>out</dt>
4931 <dd class="description">String to write to</dd>
4932<dt>in</dt>
4933 <dd class="description">String to read from</dd>
4934</dl>
4935<h4 class="returnvalue">Return Value</h4>
4936 <p class="description">Encoded string</p>
4937<h4 class="discussion">Discussion</h4>
4938 <p class="discussion">This function is deprecated. Use the httpEncode64_2() function instead
4939which provides buffer length arguments.
4940
4941</p>
4942<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="httpEncode64_2">httpEncode64_2</a></h3>
4943 <p class="description">Base64-encode a string.</p>
4944<p class="code">
4945char *httpEncode64_2 (<br>
4946&#160;&#160;&#160;&#160;char *out,<br>
4947&#160;&#160;&#160;&#160;int outlen,<br>
4948&#160;&#160;&#160;&#160;const char *in,<br>
4949&#160;&#160;&#160;&#160;int inlen<br>
4950);</p>
4951<h4 class="parameters">Parameters</h4>
4952<dl>
4953<dt>out</dt>
4954 <dd class="description">String to write to</dd>
4955<dt>outlen</dt>
4956 <dd class="description">Size of output string</dd>
4957<dt>in</dt>
4958 <dd class="description">String to read from</dd>
4959<dt>inlen</dt>
4960 <dd class="description">Size of input string</dd>
4961</dl>
4962<h4 class="returnvalue">Return Value</h4>
4963 <p class="description">Encoded string</p>
4964<h3 class="function"><a id="httpEncryption">httpEncryption</a></h3>
4965 <p class="description">Set the required encryption on the link.</p>
4966<p class="code">
4967int httpEncryption (<br>
4968&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
4969&#160;&#160;&#160;&#160;<a href="#http_encryption_t">http_encryption_t</a> e<br>
4970);</p>
4971<h4 class="parameters">Parameters</h4>
4972<dl>
4973<dt>http</dt>
4974 <dd class="description">HTTP connection</dd>
4975<dt>e</dt>
4976 <dd class="description">New encryption preference</dd>
4977</dl>
4978<h4 class="returnvalue">Return Value</h4>
4979 <p class="description">-1 on error, 0 on success</p>
4980<h3 class="function"><a id="httpError">httpError</a></h3>
4981 <p class="description">Get the last error on a connection.</p>
4982<p class="code">
4983int httpError (<br>
4984&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
4985);</p>
4986<h4 class="parameters">Parameters</h4>
4987<dl>
4988<dt>http</dt>
4989 <dd class="description">HTTP connection</dd>
4990</dl>
4991<h4 class="returnvalue">Return Value</h4>
4992 <p class="description">Error code (errno) value</p>
4993<h3 class="function"><a id="httpFieldValue">httpFieldValue</a></h3>
4994 <p class="description">Return the HTTP field enumeration value for a field
4995name.</p>
4996<p class="code">
4997<a href="#http_field_t">http_field_t</a> httpFieldValue (<br>
4998&#160;&#160;&#160;&#160;const char *name<br>
4999);</p>
5000<h4 class="parameters">Parameters</h4>
5001<dl>
5002<dt>name</dt>
5003 <dd class="description">String name</dd>
5004</dl>
5005<h4 class="returnvalue">Return Value</h4>
5006 <p class="description">Field index</p>
5007<h3 class="function"><a id="httpFlush">httpFlush</a></h3>
5008 <p class="description">Flush data from a HTTP connection.</p>
5009<p class="code">
5010void httpFlush (<br>
5011&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5012);</p>
5013<h4 class="parameters">Parameters</h4>
5014<dl>
5015<dt>http</dt>
5016 <dd class="description">HTTP connection</dd>
5017</dl>
5018<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpFlushWrite">httpFlushWrite</a></h3>
5019 <p class="description">Flush data in write buffer.</p>
5020<p class="code">
5021int httpFlushWrite (<br>
5022&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5023);</p>
5024<h4 class="parameters">Parameters</h4>
5025<dl>
5026<dt>http</dt>
5027 <dd class="description">HTTP connection</dd>
5028</dl>
5029<h4 class="returnvalue">Return Value</h4>
5030 <p class="description">Bytes written or -1 on error</p>
5031<h3 class="function"><a id="httpFreeCredentials">httpFreeCredentials</a></h3>
5032 <p class="description">Free an array of credentials.</p>
5033<p class="code">
5034void httpFreeCredentials (<br>
5035&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *credentials<br>
5036);</p>
5037<h4 class="parameters">Parameters</h4>
5038<dl>
5039<dt>credentials</dt>
5040 <dd class="description">Array of credentials</dd>
5041</dl>
5042<h3 class="function"><a id="httpGet">httpGet</a></h3>
5043 <p class="description">Send a GET request to the server.</p>
5044<p class="code">
5045int httpGet (<br>
5046&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5047&#160;&#160;&#160;&#160;const char *uri<br>
5048);</p>
5049<h4 class="parameters">Parameters</h4>
5050<dl>
5051<dt>http</dt>
5052 <dd class="description">HTTP connection</dd>
5053<dt>uri</dt>
5054 <dd class="description">URI to get</dd>
5055</dl>
5056<h4 class="returnvalue">Return Value</h4>
5057 <p class="description">Status of call (0 = success)</p>
5058<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetActivity">httpGetActivity</a></h3>
5059 <p class="description">Get the most recent activity for a connection.</p>
5060<p class="code">
5061time_t httpGetActivity (<br>
5062&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5063);</p>
5064<h4 class="parameters">Parameters</h4>
5065<dl>
5066<dt>http</dt>
5067 <dd class="description">HTTP connection</dd>
5068</dl>
5069<h4 class="returnvalue">Return Value</h4>
5070 <p class="description">Time of last read or write</p>
5071<h4 class="discussion">Discussion</h4>
5072 <p class="discussion">The return value is the UNIX time of the last read or write.
5073
5074</p>
5075<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetAddress">httpGetAddress</a></h3>
5076 <p class="description">Get the address of the connected peer of a connection.</p>
5077<p class="code">
5078<a href="#http_addr_t">http_addr_t</a> *httpGetAddress (<br>
5079&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5080);</p>
5081<h4 class="parameters">Parameters</h4>
5082<dl>
5083<dt>http</dt>
5084 <dd class="description">HTTP connection</dd>
5085</dl>
5086<h4 class="returnvalue">Return Value</h4>
5087 <p class="description">Connected address or <code>NULL</code></p>
5088<h4 class="discussion">Discussion</h4>
5089 <p class="discussion">Returns <code>NULL</code> if the socket is currently unconnected.
5090
5091</p>
5092<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="httpGetAuthString">httpGetAuthString</a></h3>
5093 <p class="description">Get the current authorization string.</p>
5094<p class="code">
5095char *httpGetAuthString (<br>
5096&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5097);</p>
5098<h4 class="parameters">Parameters</h4>
5099<dl>
5100<dt>http</dt>
5101 <dd class="description">HTTP connection</dd>
5102</dl>
5103<h4 class="returnvalue">Return Value</h4>
5104 <p class="description">Authorization string</p>
5105<h4 class="discussion">Discussion</h4>
5106 <p class="discussion">The authorization string is set by cupsDoAuthentication() and
5107httpSetAuthString(). Use httpGetAuthString() to retrieve the
5108string to use with httpSetField() for the HTTP_FIELD_AUTHORIZATION
5109value.
5110
5111</p>
5112<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetBlocking">httpGetBlocking</a></h3>
5113 <p class="description">Get the blocking/non-block state of a connection.</p>
5114<p class="code">
5115int httpGetBlocking (<br>
5116&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5117);</p>
5118<h4 class="parameters">Parameters</h4>
5119<dl>
5120<dt>http</dt>
5121 <dd class="description">HTTP connection</dd>
5122</dl>
5123<h4 class="returnvalue">Return Value</h4>
5124 <p class="description">1 if blocking, 0 if non-blocking</p>
5125<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpGetContentEncoding">httpGetContentEncoding</a></h3>
5126 <p class="description">Get a common content encoding, if any, between
5127the client and server.</p>
5128<p class="code">
5129const char *httpGetContentEncoding (<br>
5130&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5131);</p>
5132<h4 class="parameters">Parameters</h4>
5133<dl>
5134<dt>http</dt>
5135 <dd class="description">HTTP connection</dd>
5136</dl>
5137<h4 class="returnvalue">Return Value</h4>
5138 <p class="description">Content-Coding value or
5139<code>NULL</code> for the identity
5140coding.</p>
5141<h4 class="discussion">Discussion</h4>
5142 <p class="discussion">This function uses the value of the Accepts-Encoding HTTP header and must be
5143called after receiving a response from the server or a request from the
5144client. The value returned can be use in subsequent requests (for clients)
5145or in the response (for servers) in order to compress the content stream.
5146
5147</p>
5148<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpGetCookie">httpGetCookie</a></h3>
5149 <p class="description">Get any cookie data from the response.</p>
5150<p class="code">
5151const char *httpGetCookie (<br>
5152&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5153);</p>
5154<h4 class="parameters">Parameters</h4>
5155<dl>
5156<dt>http</dt>
5157 <dd class="description">HTTP connection</dd>
5158</dl>
5159<h4 class="returnvalue">Return Value</h4>
5160 <p class="description">Cookie data or NULL</p>
5161<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="httpGetDateString">httpGetDateString</a></h3>
5162 <p class="description">Get a formatted date/time string from a time value.</p>
5163<p class="code">
5164const char *httpGetDateString (<br>
5165&#160;&#160;&#160;&#160;time_t t<br>
5166);</p>
5167<h4 class="parameters">Parameters</h4>
5168<dl>
5169<dt>t</dt>
5170 <dd class="description">UNIX time</dd>
5171</dl>
5172<h4 class="returnvalue">Return Value</h4>
5173 <p class="description">Date/time string</p>
5174<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetDateString2">httpGetDateString2</a></h3>
5175 <p class="description">Get a formatted date/time string from a time value.</p>
5176<p class="code">
5177const char *httpGetDateString2 (<br>
5178&#160;&#160;&#160;&#160;time_t t,<br>
5179&#160;&#160;&#160;&#160;char *s,<br>
5180&#160;&#160;&#160;&#160;int slen<br>
5181);</p>
5182<h4 class="parameters">Parameters</h4>
5183<dl>
5184<dt>t</dt>
5185 <dd class="description">UNIX time</dd>
5186<dt>s</dt>
5187 <dd class="description">String buffer</dd>
5188<dt>slen</dt>
5189 <dd class="description">Size of string buffer</dd>
5190</dl>
5191<h4 class="returnvalue">Return Value</h4>
5192 <p class="description">Date/time string</p>
5193<h3 class="function"><a id="httpGetDateTime">httpGetDateTime</a></h3>
5194 <p class="description">Get a time value from a formatted date/time string.</p>
5195<p class="code">
5196time_t httpGetDateTime (<br>
5197&#160;&#160;&#160;&#160;const char *s<br>
5198);</p>
5199<h4 class="parameters">Parameters</h4>
5200<dl>
5201<dt>s</dt>
5202 <dd class="description">Date/time string</dd>
5203</dl>
5204<h4 class="returnvalue">Return Value</h4>
5205 <p class="description">UNIX time</p>
5206<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetEncryption">httpGetEncryption</a></h3>
5207 <p class="description">Get the current encryption mode of a connection.</p>
5208<p class="code">
5209<a href="#http_encryption_t">http_encryption_t</a> httpGetEncryption (<br>
5210&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5211);</p>
5212<h4 class="parameters">Parameters</h4>
5213<dl>
5214<dt>http</dt>
5215 <dd class="description">HTTP connection</dd>
5216</dl>
5217<h4 class="returnvalue">Return Value</h4>
5218 <p class="description">Current encryption mode</p>
5219<h4 class="discussion">Discussion</h4>
5220 <p class="discussion">This function returns the encryption mode for the connection. Use the
5221<a href="#httpIsEncrypted"><code>httpIsEncrypted</code></a> function to determine whether a TLS session has
5222been established.
5223
5224</p>
5225<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpGetExpect">httpGetExpect</a></h3>
5226 <p class="description">Get the value of the Expect header, if any.</p>
5227<p class="code">
5228http_status_t httpGetExpect (<br>
5229&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5230);</p>
5231<h4 class="parameters">Parameters</h4>
5232<dl>
5233<dt>http</dt>
5234 <dd class="description">HTTP connection</dd>
5235</dl>
5236<h4 class="returnvalue">Return Value</h4>
5237 <p class="description">Expect: status, if any</p>
5238<h4 class="discussion">Discussion</h4>
5239 <p class="discussion">Returns <code>HTTP_STATUS_NONE</code> if there is no Expect header, otherwise
5240returns the expected HTTP status code, typically <code>HTTP_STATUS_CONTINUE</code>.
5241
5242</p>
5243<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetFd">httpGetFd</a></h3>
5244 <p class="description">Get the file descriptor associated with a connection.</p>
5245<p class="code">
5246int httpGetFd (<br>
5247&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5248);</p>
5249<h4 class="parameters">Parameters</h4>
5250<dl>
5251<dt>http</dt>
5252 <dd class="description">HTTP connection</dd>
5253</dl>
5254<h4 class="returnvalue">Return Value</h4>
5255 <p class="description">File descriptor or -1 if none</p>
5256<h3 class="function"><a id="httpGetField">httpGetField</a></h3>
5257 <p class="description">Get a field value from a request/response.</p>
5258<p class="code">
5259const char *httpGetField (<br>
5260&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5261&#160;&#160;&#160;&#160;<a href="#http_field_t">http_field_t</a> field<br>
5262);</p>
5263<h4 class="parameters">Parameters</h4>
5264<dl>
5265<dt>http</dt>
5266 <dd class="description">HTTP connection</dd>
5267<dt>field</dt>
5268 <dd class="description">Field to get</dd>
5269</dl>
5270<h4 class="returnvalue">Return Value</h4>
5271 <p class="description">Field value</p>
5272<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="httpGetHostByName">httpGetHostByName</a></h3>
5273 <p class="description">Lookup a hostname or IPv4 address, and return
5274address records for the specified name.</p>
5275<p class="code">
5276struct hostent *httpGetHostByName (<br>
5277&#160;&#160;&#160;&#160;const char *name<br>
5278);</p>
5279<h4 class="parameters">Parameters</h4>
5280<dl>
5281<dt>name</dt>
5282 <dd class="description">Hostname or IP address</dd>
5283</dl>
5284<h4 class="returnvalue">Return Value</h4>
5285 <p class="description">Host entry</p>
5286<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetHostname">httpGetHostname</a></h3>
5287 <p class="description">Get the FQDN for the connection or local system.</p>
5288<p class="code">
5289const char *httpGetHostname (<br>
5290&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5291&#160;&#160;&#160;&#160;char *s,<br>
5292&#160;&#160;&#160;&#160;int slen<br>
5293);</p>
5294<h4 class="parameters">Parameters</h4>
5295<dl>
5296<dt>http</dt>
5297 <dd class="description">HTTP connection or NULL</dd>
5298<dt>s</dt>
5299 <dd class="description">String buffer for name</dd>
5300<dt>slen</dt>
5301 <dd class="description">Size of buffer</dd>
5302</dl>
5303<h4 class="returnvalue">Return Value</h4>
5304 <p class="description">FQDN for connection or system</p>
5305<h4 class="discussion">Discussion</h4>
5306 <p class="discussion">When &quot;http&quot; points to a connected socket, return the hostname or
5307address that was used in the call to httpConnect() or httpConnectEncrypt(),
5308or the address of the client for the connection from httpAcceptConnection().
5309Otherwise, return the FQDN for the local system using both gethostname()
5310and gethostbyname() to get the local hostname with domain.
5311
5312</p>
5313<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetKeepAlive">httpGetKeepAlive</a></h3>
5314 <p class="description">Get the current Keep-Alive state of the connection.</p>
5315<p class="code">
5316<a href="#http_keepalive_t">http_keepalive_t</a> httpGetKeepAlive (<br>
5317&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5318);</p>
5319<h4 class="parameters">Parameters</h4>
5320<dl>
5321<dt>http</dt>
5322 <dd class="description">HTTP connection</dd>
5323</dl>
5324<h4 class="returnvalue">Return Value</h4>
5325 <p class="description">Keep-Alive state</p>
5326<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="httpGetLength">httpGetLength</a></h3>
5327 <p class="description">Get the amount of data remaining from the
5328content-length or transfer-encoding fields.</p>
5329<p class="code">
5330int httpGetLength (<br>
5331&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5332);</p>
5333<h4 class="parameters">Parameters</h4>
5334<dl>
5335<dt>http</dt>
5336 <dd class="description">HTTP connection</dd>
5337</dl>
5338<h4 class="returnvalue">Return Value</h4>
5339 <p class="description">Content length</p>
5340<h4 class="discussion">Discussion</h4>
5341 <p class="discussion">This function is deprecated and will not return lengths larger than
53422^31 - 1; use httpGetLength2() instead.
5343
5344</p>
5345<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetLength2">httpGetLength2</a></h3>
5346 <p class="description">Get the amount of data remaining from the
5347content-length or transfer-encoding fields.</p>
5348<p class="code">
5349off_t httpGetLength2 (<br>
5350&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5351);</p>
5352<h4 class="parameters">Parameters</h4>
5353<dl>
5354<dt>http</dt>
5355 <dd class="description">HTTP connection</dd>
5356</dl>
5357<h4 class="returnvalue">Return Value</h4>
5358 <p class="description">Content length</p>
5359<h4 class="discussion">Discussion</h4>
5360 <p class="discussion">This function returns the complete content length, even for
5361content larger than 2^31 - 1.
5362
5363</p>
5364<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetPending">httpGetPending</a></h3>
5365 <p class="description">Get the number of bytes that are buffered for writing.</p>
5366<p class="code">
5367size_t httpGetPending (<br>
5368&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5369);</p>
5370<h4 class="parameters">Parameters</h4>
5371<dl>
5372<dt>http</dt>
5373 <dd class="description">HTTP connection</dd>
5374</dl>
5375<h4 class="returnvalue">Return Value</h4>
5376 <p class="description">Number of bytes buffered</p>
5377<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetReady">httpGetReady</a></h3>
5378 <p class="description">Get the number of bytes that can be read without blocking.</p>
5379<p class="code">
5380size_t httpGetReady (<br>
5381&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5382);</p>
5383<h4 class="parameters">Parameters</h4>
5384<dl>
5385<dt>http</dt>
5386 <dd class="description">HTTP connection</dd>
5387</dl>
5388<h4 class="returnvalue">Return Value</h4>
5389 <p class="description">Number of bytes available</p>
5390<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpGetRemaining">httpGetRemaining</a></h3>
5391 <p class="description">Get the number of remaining bytes in the message
5392body or current chunk.</p>
5393<p class="code">
5394size_t httpGetRemaining (<br>
5395&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5396);</p>
5397<h4 class="parameters">Parameters</h4>
5398<dl>
5399<dt>http</dt>
5400 <dd class="description">HTTP connection</dd>
5401</dl>
5402<h4 class="returnvalue">Return Value</h4>
5403 <p class="description">Remaining bytes</p>
5404<h4 class="discussion">Discussion</h4>
5405 <p class="discussion">The <a href="#httpIsChunked"><code>httpIsChunked</code></a> function can be used to determine whether the
5406message body is chunked or fixed-length.
5407
5408</p>
5409<h3 class="function"><a id="httpGetState">httpGetState</a></h3>
5410 <p class="description">Get the current state of the HTTP request.</p>
5411<p class="code">
5412<a href="#http_state_t">http_state_t</a> httpGetState (<br>
5413&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5414);</p>
5415<h4 class="parameters">Parameters</h4>
5416<dl>
5417<dt>http</dt>
5418 <dd class="description">HTTP connection</dd>
5419</dl>
5420<h4 class="returnvalue">Return Value</h4>
5421 <p class="description">HTTP state</p>
5422<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetStatus">httpGetStatus</a></h3>
5423 <p class="description">Get the status of the last HTTP request.</p>
5424<p class="code">
5425http_status_t httpGetStatus (<br>
5426&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5427);</p>
5428<h4 class="parameters">Parameters</h4>
5429<dl>
5430<dt>http</dt>
5431 <dd class="description">HTTP connection</dd>
5432</dl>
5433<h4 class="returnvalue">Return Value</h4>
5434 <p class="description">HTTP status</p>
5435<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="httpGetSubField">httpGetSubField</a></h3>
5436 <p class="description">Get a sub-field value.</p>
5437<p class="code">
5438char *httpGetSubField (<br>
5439&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5440&#160;&#160;&#160;&#160;<a href="#http_field_t">http_field_t</a> field,<br>
5441&#160;&#160;&#160;&#160;const char *name,<br>
5442&#160;&#160;&#160;&#160;char *value<br>
5443);</p>
5444<h4 class="parameters">Parameters</h4>
5445<dl>
5446<dt>http</dt>
5447 <dd class="description">HTTP connection</dd>
5448<dt>field</dt>
5449 <dd class="description">Field index</dd>
5450<dt>name</dt>
5451 <dd class="description">Name of sub-field</dd>
5452<dt>value</dt>
5453 <dd class="description">Value string</dd>
5454</dl>
5455<h4 class="returnvalue">Return Value</h4>
5456 <p class="description">Value or NULL</p>
5457<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpGetSubField2">httpGetSubField2</a></h3>
5458 <p class="description">Get a sub-field value.</p>
5459<p class="code">
5460char *httpGetSubField2 (<br>
5461&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5462&#160;&#160;&#160;&#160;<a href="#http_field_t">http_field_t</a> field,<br>
5463&#160;&#160;&#160;&#160;const char *name,<br>
5464&#160;&#160;&#160;&#160;char *value,<br>
5465&#160;&#160;&#160;&#160;int valuelen<br>
5466);</p>
5467<h4 class="parameters">Parameters</h4>
5468<dl>
5469<dt>http</dt>
5470 <dd class="description">HTTP connection</dd>
5471<dt>field</dt>
5472 <dd class="description">Field index</dd>
5473<dt>name</dt>
5474 <dd class="description">Name of sub-field</dd>
5475<dt>value</dt>
5476 <dd class="description">Value string</dd>
5477<dt>valuelen</dt>
5478 <dd class="description">Size of value buffer</dd>
5479</dl>
5480<h4 class="returnvalue">Return Value</h4>
5481 <p class="description">Value or NULL</p>
5482<h3 class="function"><a id="httpGetVersion">httpGetVersion</a></h3>
5483 <p class="description">Get the HTTP version at the other end.</p>
5484<p class="code">
5485<a href="#http_version_t">http_version_t</a> httpGetVersion (<br>
5486&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5487);</p>
5488<h4 class="parameters">Parameters</h4>
5489<dl>
5490<dt>http</dt>
5491 <dd class="description">HTTP connection</dd>
5492</dl>
5493<h4 class="returnvalue">Return Value</h4>
5494 <p class="description">Version number</p>
5495<h3 class="function"><a id="httpGets">httpGets</a></h3>
5496 <p class="description">Get a line of text from a HTTP connection.</p>
5497<p class="code">
5498char *httpGets (<br>
5499&#160;&#160;&#160;&#160;char *line,<br>
5500&#160;&#160;&#160;&#160;int length,<br>
5501&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5502);</p>
5503<h4 class="parameters">Parameters</h4>
5504<dl>
5505<dt>line</dt>
5506 <dd class="description">Line to read into</dd>
5507<dt>length</dt>
5508 <dd class="description">Max length of buffer</dd>
5509<dt>http</dt>
5510 <dd class="description">HTTP connection</dd>
5511</dl>
5512<h4 class="returnvalue">Return Value</h4>
5513 <p class="description">Line or NULL</p>
5514<h3 class="function"><a id="httpHead">httpHead</a></h3>
5515 <p class="description">Send a HEAD request to the server.</p>
5516<p class="code">
5517int httpHead (<br>
5518&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5519&#160;&#160;&#160;&#160;const char *uri<br>
5520);</p>
5521<h4 class="parameters">Parameters</h4>
5522<dl>
5523<dt>http</dt>
5524 <dd class="description">HTTP connection</dd>
5525<dt>uri</dt>
5526 <dd class="description">URI for head</dd>
5527</dl>
5528<h4 class="returnvalue">Return Value</h4>
5529 <p class="description">Status of call (0 = success)</p>
5530<h3 class="function"><a id="httpInitialize">httpInitialize</a></h3>
5531 <p class="description">Initialize the HTTP interface library and set the
5532default HTTP proxy (if any).</p>
5533<p class="code">
5534void httpInitialize (void);</p>
5535<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpIsChunked">httpIsChunked</a></h3>
5536 <p class="description">Report whether a message body is chunked.</p>
5537<p class="code">
5538int httpIsChunked (<br>
5539&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5540);</p>
5541<h4 class="parameters">Parameters</h4>
5542<dl>
5543<dt>http</dt>
5544 <dd class="description">HTTP connection</dd>
5545</dl>
5546<h4 class="returnvalue">Return Value</h4>
5547 <p class="description">1 if chunked, 0 if not</p>
5548<h4 class="discussion">Discussion</h4>
5549 <p class="discussion">This function returns non-zero if the message body is composed of
5550variable-length chunks.
5551
5552</p>
5553<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpIsEncrypted">httpIsEncrypted</a></h3>
5554 <p class="description">Report whether a connection is encrypted.</p>
5555<p class="code">
5556int httpIsEncrypted (<br>
5557&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5558);</p>
5559<h4 class="parameters">Parameters</h4>
5560<dl>
5561<dt>http</dt>
5562 <dd class="description">HTTP connection</dd>
5563</dl>
5564<h4 class="returnvalue">Return Value</h4>
5565 <p class="description">1 if encrypted, 0 if not</p>
5566<h4 class="discussion">Discussion</h4>
5567 <p class="discussion">This function returns non-zero if the connection is currently encrypted.
5568
5569</p>
5570<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpLoadCredentials">httpLoadCredentials</a></h3>
5571 <p class="description">Load X.509 credentials from a keychain file.</p>
5572<p class="code">
5573int httpLoadCredentials (<br>
5574&#160;&#160;&#160;&#160;const char *path,<br>
5575&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> **credentials,<br>
5576&#160;&#160;&#160;&#160;const char *common_name<br>
5577);</p>
5578<h4 class="parameters">Parameters</h4>
5579<dl>
5580<dt>path</dt>
5581 <dd class="description">Keychain path or <code>NULL</code> for default</dd>
5582<dt>credentials</dt>
5583 <dd class="description">Credentials</dd>
5584<dt>common_name</dt>
5585 <dd class="description">Common name for credentials</dd>
5586</dl>
5587<h4 class="returnvalue">Return Value</h4>
5588 <p class="description">0 on success, -1 on error</p>
5589<h3 class="function"><a id="httpOptions">httpOptions</a></h3>
5590 <p class="description">Send an OPTIONS request to the server.</p>
5591<p class="code">
5592int httpOptions (<br>
5593&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5594&#160;&#160;&#160;&#160;const char *uri<br>
5595);</p>
5596<h4 class="parameters">Parameters</h4>
5597<dl>
5598<dt>http</dt>
5599 <dd class="description">HTTP connection</dd>
5600<dt>uri</dt>
5601 <dd class="description">URI for options</dd>
5602</dl>
5603<h4 class="returnvalue">Return Value</h4>
5604 <p class="description">Status of call (0 = success)</p>
5605<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpPeek">httpPeek</a></h3>
5606 <p class="description">Peek at data from a HTTP connection.</p>
5607<p class="code">
5608ssize_t httpPeek (<br>
5609&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5610&#160;&#160;&#160;&#160;char *buffer,<br>
5611&#160;&#160;&#160;&#160;size_t length<br>
5612);</p>
5613<h4 class="parameters">Parameters</h4>
5614<dl>
5615<dt>http</dt>
5616 <dd class="description">HTTP connection</dd>
5617<dt>buffer</dt>
5618 <dd class="description">Buffer for data</dd>
5619<dt>length</dt>
5620 <dd class="description">Maximum number of bytes</dd>
5621</dl>
5622<h4 class="returnvalue">Return Value</h4>
5623 <p class="description">Number of bytes copied</p>
5624<h4 class="discussion">Discussion</h4>
5625 <p class="discussion">This function copies available data from the given HTTP connection, reading
5626a buffer as needed. The data is still available for reading using
5627<a href="#httpRead"><code>httpRead</code></a> or <a href="#httpRead2"><code>httpRead2</code></a>.<br>
5628<br>
5629For non-blocking connections the usual timeouts apply.
5630
5631</p>
5632<h3 class="function"><a id="httpPost">httpPost</a></h3>
5633 <p class="description">Send a POST request to the server.</p>
5634<p class="code">
5635int httpPost (<br>
5636&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5637&#160;&#160;&#160;&#160;const char *uri<br>
5638);</p>
5639<h4 class="parameters">Parameters</h4>
5640<dl>
5641<dt>http</dt>
5642 <dd class="description">HTTP connection</dd>
5643<dt>uri</dt>
5644 <dd class="description">URI for post</dd>
5645</dl>
5646<h4 class="returnvalue">Return Value</h4>
5647 <p class="description">Status of call (0 = success)</p>
5648<h3 class="function"><a id="httpPut">httpPut</a></h3>
5649 <p class="description">Send a PUT request to the server.</p>
5650<p class="code">
5651int httpPut (<br>
5652&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5653&#160;&#160;&#160;&#160;const char *uri<br>
5654);</p>
5655<h4 class="parameters">Parameters</h4>
5656<dl>
5657<dt>http</dt>
5658 <dd class="description">HTTP connection</dd>
5659<dt>uri</dt>
5660 <dd class="description">URI to put</dd>
5661</dl>
5662<h4 class="returnvalue">Return Value</h4>
5663 <p class="description">Status of call (0 = success)</p>
5664<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="httpRead">httpRead</a></h3>
5665 <p class="description">Read data from a HTTP connection.</p>
5666<p class="code">
5667int httpRead (<br>
5668&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5669&#160;&#160;&#160;&#160;char *buffer,<br>
5670&#160;&#160;&#160;&#160;int length<br>
5671);</p>
5672<h4 class="parameters">Parameters</h4>
5673<dl>
5674<dt>http</dt>
5675 <dd class="description">HTTP connection</dd>
5676<dt>buffer</dt>
5677 <dd class="description">Buffer for data</dd>
5678<dt>length</dt>
5679 <dd class="description">Maximum number of bytes</dd>
5680</dl>
5681<h4 class="returnvalue">Return Value</h4>
5682 <p class="description">Number of bytes read</p>
5683<h4 class="discussion">Discussion</h4>
5684 <p class="discussion">This function is deprecated. Use the httpRead2() function which can
5685read more than 2GB of data.
5686
5687</p>
5688<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpRead2">httpRead2</a></h3>
5689 <p class="description">Read data from a HTTP connection.</p>
5690<p class="code">
5691ssize_t httpRead2 (<br>
5692&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5693&#160;&#160;&#160;&#160;char *buffer,<br>
5694&#160;&#160;&#160;&#160;size_t length<br>
5695);</p>
5696<h4 class="parameters">Parameters</h4>
5697<dl>
5698<dt>http</dt>
5699 <dd class="description">HTTP connection</dd>
5700<dt>buffer</dt>
5701 <dd class="description">Buffer for data</dd>
5702<dt>length</dt>
5703 <dd class="description">Maximum number of bytes</dd>
5704</dl>
5705<h4 class="returnvalue">Return Value</h4>
5706 <p class="description">Number of bytes read</p>
5707<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpReadRequest">httpReadRequest</a></h3>
5708 <p class="description">Read a HTTP request from a connection.</p>
5709<p class="code">
5710<a href="#http_state_t">http_state_t</a> httpReadRequest (<br>
5711&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5712&#160;&#160;&#160;&#160;char *uri,<br>
5713&#160;&#160;&#160;&#160;size_t urilen<br>
5714);</p>
5715<h4 class="parameters">Parameters</h4>
5716<dl>
5717<dt>http</dt>
5718 <dd class="description">HTTP connection</dd>
5719<dt>uri</dt>
5720 <dd class="description">URI buffer</dd>
5721<dt>urilen</dt>
5722 <dd class="description">Size of URI buffer</dd>
5723</dl>
5724<h4 class="returnvalue">Return Value</h4>
5725 <p class="description">New state of connection</p>
5726<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="httpReconnect">httpReconnect</a></h3>
5727 <p class="description">Reconnect to a HTTP server.</p>
5728<p class="code">
5729int httpReconnect (<br>
5730&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
5731);</p>
5732<h4 class="parameters">Parameters</h4>
5733<dl>
5734<dt>http</dt>
5735 <dd class="description">HTTP connection</dd>
5736</dl>
5737<h4 class="returnvalue">Return Value</h4>
5738 <p class="description">0 on success, non-zero on failure</p>
5739<h4 class="discussion">Discussion</h4>
5740 <p class="discussion">This function is deprecated. Please use the <a href="#httpReconnect2"><code>httpReconnect2</code></a> function
5741instead.
5742
5743</p>
5744<h3 class="function"><a id="httpReconnect2">httpReconnect2</a></h3>
5745 <p class="description">Reconnect to a HTTP server with timeout and optional
5746cancel.</p>
5747<p class="code">
5748int httpReconnect2 (<br>
5749&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5750&#160;&#160;&#160;&#160;int msec,<br>
5751&#160;&#160;&#160;&#160;int *cancel<br>
5752);</p>
5753<h4 class="parameters">Parameters</h4>
5754<dl>
5755<dt>http</dt>
5756 <dd class="description">HTTP connection</dd>
5757<dt>msec</dt>
5758 <dd class="description">Timeout in milliseconds</dd>
5759<dt>cancel</dt>
5760 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
5761</dl>
5762<h4 class="returnvalue">Return Value</h4>
5763 <p class="description">0 on success, non-zero on failure</p>
5764<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpResolveHostname">httpResolveHostname</a></h3>
5765 <p class="description">Resolve the hostname of the HTTP connection
5766address.</p>
5767<p class="code">
5768const char *httpResolveHostname (<br>
5769&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5770&#160;&#160;&#160;&#160;char *buffer,<br>
5771&#160;&#160;&#160;&#160;size_t bufsize<br>
5772);</p>
5773<h4 class="parameters">Parameters</h4>
5774<dl>
5775<dt>http</dt>
5776 <dd class="description">HTTP connection</dd>
5777<dt>buffer</dt>
5778 <dd class="description">Hostname buffer</dd>
5779<dt>bufsize</dt>
5780 <dd class="description">Size of buffer</dd>
5781</dl>
5782<h4 class="returnvalue">Return Value</h4>
5783 <p class="description">Resolved hostname or <code>NULL</code></p>
5784<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpSaveCredentials">httpSaveCredentials</a></h3>
5785 <p class="description">Save X.509 credentials to a keychain file.</p>
5786<p class="code">
5787int httpSaveCredentials (<br>
5788&#160;&#160;&#160;&#160;const char *path,<br>
5789&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *credentials,<br>
5790&#160;&#160;&#160;&#160;const char *common_name<br>
5791);</p>
5792<h4 class="parameters">Parameters</h4>
5793<dl>
5794<dt>path</dt>
5795 <dd class="description">Keychain path or <code>NULL</code> for default</dd>
5796<dt>credentials</dt>
5797 <dd class="description">Credentials</dd>
5798<dt>common_name</dt>
5799 <dd class="description">Common name for credentials</dd>
5800</dl>
5801<h4 class="returnvalue">Return Value</h4>
5802 <p class="description">-1 on error, 0 on success</p>
5803<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="httpSeparate">httpSeparate</a></h3>
5804 <p class="description">Separate a Universal Resource Identifier into its
5805components.</p>
5806<p class="code">
5807void httpSeparate (<br>
5808&#160;&#160;&#160;&#160;const char *uri,<br>
5809&#160;&#160;&#160;&#160;char *scheme,<br>
5810&#160;&#160;&#160;&#160;char *username,<br>
5811&#160;&#160;&#160;&#160;char *host,<br>
5812&#160;&#160;&#160;&#160;int *port,<br>
5813&#160;&#160;&#160;&#160;char *resource<br>
5814);</p>
5815<h4 class="parameters">Parameters</h4>
5816<dl>
5817<dt>uri</dt>
5818 <dd class="description">Universal Resource Identifier</dd>
5819<dt>scheme</dt>
5820 <dd class="description">Scheme [32] (http, https, etc.)</dd>
5821<dt>username</dt>
5822 <dd class="description">Username [1024]</dd>
5823<dt>host</dt>
5824 <dd class="description">Hostname [1024]</dd>
5825<dt>port</dt>
5826 <dd class="description">Port number to use</dd>
5827<dt>resource</dt>
5828 <dd class="description">Resource/filename [1024]</dd>
5829</dl>
5830<h4 class="discussion">Discussion</h4>
5831 <p class="discussion">This function is deprecated; use the httpSeparateURI() function instead.
5832
5833</p>
5834<h3 class="function"><span class="info">&#160;CUPS 1.1.21/macOS 10.4&#160;</span><a id="httpSeparate2">httpSeparate2</a></h3>
5835 <p class="description">Separate a Universal Resource Identifier into its
5836components.</p>
5837<p class="code">
5838void httpSeparate2 (<br>
5839&#160;&#160;&#160;&#160;const char *uri,<br>
5840&#160;&#160;&#160;&#160;char *scheme,<br>
5841&#160;&#160;&#160;&#160;int schemelen,<br>
5842&#160;&#160;&#160;&#160;char *username,<br>
5843&#160;&#160;&#160;&#160;int usernamelen,<br>
5844&#160;&#160;&#160;&#160;char *host,<br>
5845&#160;&#160;&#160;&#160;int hostlen,<br>
5846&#160;&#160;&#160;&#160;int *port,<br>
5847&#160;&#160;&#160;&#160;char *resource,<br>
5848&#160;&#160;&#160;&#160;int resourcelen<br>
5849);</p>
5850<h4 class="parameters">Parameters</h4>
5851<dl>
5852<dt>uri</dt>
5853 <dd class="description">Universal Resource Identifier</dd>
5854<dt>scheme</dt>
5855 <dd class="description">Scheme (http, https, etc.)</dd>
5856<dt>schemelen</dt>
5857 <dd class="description">Size of scheme buffer</dd>
5858<dt>username</dt>
5859 <dd class="description">Username</dd>
5860<dt>usernamelen</dt>
5861 <dd class="description">Size of username buffer</dd>
5862<dt>host</dt>
5863 <dd class="description">Hostname</dd>
5864<dt>hostlen</dt>
5865 <dd class="description">Size of hostname buffer</dd>
5866<dt>port</dt>
5867 <dd class="description">Port number to use</dd>
5868<dt>resource</dt>
5869 <dd class="description">Resource/filename</dd>
5870<dt>resourcelen</dt>
5871 <dd class="description">Size of resource buffer</dd>
5872</dl>
5873<h4 class="discussion">Discussion</h4>
5874 <p class="discussion">This function is deprecated; use the httpSeparateURI() function instead.
5875
5876
5877</p>
5878<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSeparateURI">httpSeparateURI</a></h3>
5879 <p class="description">Separate a Universal Resource Identifier into its
5880components.</p>
5881<p class="code">
5882<a href="#http_uri_status_t">http_uri_status_t</a> httpSeparateURI (<br>
5883&#160;&#160;&#160;&#160;<a href="#http_uri_coding_t">http_uri_coding_t</a> decoding,<br>
5884&#160;&#160;&#160;&#160;const char *uri,<br>
5885&#160;&#160;&#160;&#160;char *scheme,<br>
5886&#160;&#160;&#160;&#160;int schemelen,<br>
5887&#160;&#160;&#160;&#160;char *username,<br>
5888&#160;&#160;&#160;&#160;int usernamelen,<br>
5889&#160;&#160;&#160;&#160;char *host,<br>
5890&#160;&#160;&#160;&#160;int hostlen,<br>
5891&#160;&#160;&#160;&#160;int *port,<br>
5892&#160;&#160;&#160;&#160;char *resource,<br>
5893&#160;&#160;&#160;&#160;int resourcelen<br>
5894);</p>
5895<h4 class="parameters">Parameters</h4>
5896<dl>
5897<dt>decoding</dt>
5898 <dd class="description">Decoding flags</dd>
5899<dt>uri</dt>
5900 <dd class="description">Universal Resource Identifier</dd>
5901<dt>scheme</dt>
5902 <dd class="description">Scheme (http, https, etc.)</dd>
5903<dt>schemelen</dt>
5904 <dd class="description">Size of scheme buffer</dd>
5905<dt>username</dt>
5906 <dd class="description">Username</dd>
5907<dt>usernamelen</dt>
5908 <dd class="description">Size of username buffer</dd>
5909<dt>host</dt>
5910 <dd class="description">Hostname</dd>
5911<dt>hostlen</dt>
5912 <dd class="description">Size of hostname buffer</dd>
5913<dt>port</dt>
5914 <dd class="description">Port number to use</dd>
5915<dt>resource</dt>
5916 <dd class="description">Resource/filename</dd>
5917<dt>resourcelen</dt>
5918 <dd class="description">Size of resource buffer</dd>
5919</dl>
5920<h4 class="returnvalue">Return Value</h4>
5921 <p class="description">Result of separation</p>
5922<h3 class="function"><span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span><a id="httpSetAuthString">httpSetAuthString</a></h3>
5923 <p class="description">Set the current authorization string.</p>
5924<p class="code">
5925void httpSetAuthString (<br>
5926&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5927&#160;&#160;&#160;&#160;const char *scheme,<br>
5928&#160;&#160;&#160;&#160;const char *data<br>
5929);</p>
5930<h4 class="parameters">Parameters</h4>
5931<dl>
5932<dt>http</dt>
5933 <dd class="description">HTTP connection</dd>
5934<dt>scheme</dt>
5935 <dd class="description">Auth scheme (NULL to clear it)</dd>
5936<dt>data</dt>
5937 <dd class="description">Auth data (NULL for none)</dd>
5938</dl>
5939<h4 class="discussion">Discussion</h4>
5940 <p class="discussion">This function just stores a copy of the current authorization string in
5941the HTTP connection object. You must still call httpSetField() to set
5942HTTP_FIELD_AUTHORIZATION prior to issuing a HTTP request using httpGet(),
5943httpHead(), httpOptions(), httpPost, or httpPut().
5944
5945</p>
5946<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpSetCookie">httpSetCookie</a></h3>
5947 <p class="description">Set the cookie value(s).</p>
5948<p class="code">
5949void httpSetCookie (<br>
5950&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5951&#160;&#160;&#160;&#160;const char *cookie<br>
5952);</p>
5953<h4 class="parameters">Parameters</h4>
5954<dl>
5955<dt>http</dt>
5956 <dd class="description">Connection</dd>
5957<dt>cookie</dt>
5958 <dd class="description">Cookie string</dd>
5959</dl>
5960<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpSetCredentials">httpSetCredentials</a></h3>
5961 <p class="description">Set the credentials associated with an encrypted
5962connection.</p>
5963<p class="code">
5964int httpSetCredentials (<br>
5965&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5966&#160;&#160;&#160;&#160;<a href="#cups_array_t">cups_array_t</a> *credentials<br>
5967);</p>
5968<h4 class="parameters">Parameters</h4>
5969<dl>
5970<dt>http</dt>
5971 <dd class="description">HTTP connection</dd>
5972<dt>credentials</dt>
5973 <dd class="description">Array of credentials</dd>
5974</dl>
5975<h4 class="returnvalue">Return Value</h4>
5976 <p class="description">Status of call (0 = success)</p>
5977<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpSetDefaultField">httpSetDefaultField</a></h3>
5978 <p class="description">Set the default value of an HTTP header.</p>
5979<p class="code">
5980void httpSetDefaultField (<br>
5981&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
5982&#160;&#160;&#160;&#160;<a href="#http_field_t">http_field_t</a> field,<br>
5983&#160;&#160;&#160;&#160;const char *value<br>
5984);</p>
5985<h4 class="parameters">Parameters</h4>
5986<dl>
5987<dt>http</dt>
5988 <dd class="description">HTTP connection</dd>
5989<dt>field</dt>
5990 <dd class="description">Field index</dd>
5991<dt>value</dt>
5992 <dd class="description">Value</dd>
5993</dl>
5994<h4 class="discussion">Discussion</h4>
5995 <p class="discussion">Currently only <code>HTTP_FIELD_ACCEPT_ENCODING</code>, <code>HTTP_FIELD_SERVER</code>,
5996and <code>HTTP_FIELD_USER_AGENT</code> can be set.
5997
5998</p>
5999<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSetExpect">httpSetExpect</a></h3>
6000 <p class="description">Set the Expect: header in a request.</p>
6001<p class="code">
6002void httpSetExpect (<br>
6003&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
6004&#160;&#160;&#160;&#160;http_status_t expect<br>
6005);</p>
6006<h4 class="parameters">Parameters</h4>
6007<dl>
6008<dt>http</dt>
6009 <dd class="description">HTTP connection</dd>
6010<dt>expect</dt>
6011 <dd class="description">HTTP status to expect
6012(<code>HTTP_STATUS_CONTINUE</code>)</dd>
6013</dl>
6014<h4 class="discussion">Discussion</h4>
6015 <p class="discussion">Currently only <code>HTTP_STATUS_CONTINUE</code> is supported for the &quot;expect&quot;
6016argument.
6017
6018</p>
6019<h3 class="function"><a id="httpSetField">httpSetField</a></h3>
6020 <p class="description">Set the value of an HTTP header.</p>
6021<p class="code">
6022void httpSetField (<br>
6023&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
6024&#160;&#160;&#160;&#160;<a href="#http_field_t">http_field_t</a> field,<br>
6025&#160;&#160;&#160;&#160;const char *value<br>
6026);</p>
6027<h4 class="parameters">Parameters</h4>
6028<dl>
6029<dt>http</dt>
6030 <dd class="description">HTTP connection</dd>
6031<dt>field</dt>
6032 <dd class="description">Field index</dd>
6033<dt>value</dt>
6034 <dd class="description">Value</dd>
6035</dl>
6036<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpSetKeepAlive">httpSetKeepAlive</a></h3>
6037 <p class="description">Set the current Keep-Alive state of a connection.</p>
6038<p class="code">
6039void httpSetKeepAlive (<br>
6040&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
6041&#160;&#160;&#160;&#160;<a href="#http_keepalive_t">http_keepalive_t</a> keep_alive<br>
6042);</p>
6043<h4 class="parameters">Parameters</h4>
6044<dl>
6045<dt>http</dt>
6046 <dd class="description">HTTP connection</dd>
6047<dt>keep_alive</dt>
6048 <dd class="description">New Keep-Alive value</dd>
6049</dl>
6050<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpSetLength">httpSetLength</a></h3>
6051 <p class="description">Set the content-length and content-encoding.</p>
6052<p class="code">
6053void httpSetLength (<br>
6054&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
6055&#160;&#160;&#160;&#160;size_t length<br>
6056);</p>
6057<h4 class="parameters">Parameters</h4>
6058<dl>
6059<dt>http</dt>
6060 <dd class="description">HTTP connection</dd>
6061<dt>length</dt>
6062 <dd class="description">Length (0 for chunked)</dd>
6063</dl>
6064<h3 class="function"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="httpSetTimeout">httpSetTimeout</a></h3>
6065 <p class="description">Set read/write timeouts and an optional callback.</p>
6066<p class="code">
6067void httpSetTimeout (<br>
6068&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
6069&#160;&#160;&#160;&#160;double timeout,<br>
6070&#160;&#160;&#160;&#160;<a href="#http_timeout_cb_t">http_timeout_cb_t</a> cb,<br>
6071&#160;&#160;&#160;&#160;void *user_data<br>
6072);</p>
6073<h4 class="parameters">Parameters</h4>
6074<dl>
6075<dt>http</dt>
6076 <dd class="description">HTTP connection</dd>
6077<dt>timeout</dt>
6078 <dd class="description">Number of seconds for timeout,
6079must be greater than 0</dd>
6080<dt>cb</dt>
6081 <dd class="description">Callback function or NULL</dd>
6082<dt>user_data</dt>
6083 <dd class="description">User data pointer</dd>
6084</dl>
6085<h4 class="discussion">Discussion</h4>
6086 <p class="discussion">The optional timeout callback receives both the HTTP connection and a user
6087data pointer and must return 1 to continue or 0 to error (time) out.
6088
6089</p>
6090<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpShutdown">httpShutdown</a></h3>
6091 <p class="description">Shutdown one side of an HTTP connection.</p>
6092<p class="code">
6093void httpShutdown (<br>
6094&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
6095);</p>
6096<h4 class="parameters">Parameters</h4>
6097<dl>
6098<dt>http</dt>
6099 <dd class="description">HTTP connection</dd>
6100</dl>
6101<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpStateString">httpStateString</a></h3>
6102 <p class="description">Return the string describing a HTTP state value.</p>
6103<p class="code">
6104const char *httpStateString (<br>
6105&#160;&#160;&#160;&#160;<a href="#http_state_t">http_state_t</a> state<br>
6106);</p>
6107<h4 class="parameters">Parameters</h4>
6108<dl>
6109<dt>state</dt>
6110 <dd class="description">HTTP state value</dd>
6111</dl>
6112<h4 class="returnvalue">Return Value</h4>
6113 <p class="description">State string</p>
6114<h3 class="function"><a id="httpStatus">httpStatus</a></h3>
6115 <p class="description">Return a short string describing a HTTP status code.</p>
6116<p class="code">
6117const char *httpStatus (<br>
6118&#160;&#160;&#160;&#160;http_status_t status<br>
6119);</p>
6120<h4 class="parameters">Parameters</h4>
6121<dl>
6122<dt>status</dt>
6123 <dd class="description">HTTP status code</dd>
6124</dl>
6125<h4 class="returnvalue">Return Value</h4>
6126 <p class="description">Localized status string</p>
6127<h4 class="discussion">Discussion</h4>
6128 <p class="discussion">The returned string is localized to the current POSIX locale and is based
6129on the status strings defined in RFC 2616.</p>
6130<h3 class="function"><a id="httpTrace">httpTrace</a></h3>
6131 <p class="description">Send an TRACE request to the server.</p>
6132<p class="code">
6133int httpTrace (<br>
6134&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
6135&#160;&#160;&#160;&#160;const char *uri<br>
6136);</p>
6137<h4 class="parameters">Parameters</h4>
6138<dl>
6139<dt>http</dt>
6140 <dd class="description">HTTP connection</dd>
6141<dt>uri</dt>
6142 <dd class="description">URI for trace</dd>
6143</dl>
6144<h4 class="returnvalue">Return Value</h4>
6145 <p class="description">Status of call (0 = success)</p>
6146<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="httpURIStatusString">httpURIStatusString</a></h3>
6147 <p class="description">Return a string describing a URI status code.</p>
6148<p class="code">
6149const char *httpURIStatusString (<br>
6150&#160;&#160;&#160;&#160;<a href="#http_uri_status_t">http_uri_status_t</a> status<br>
6151);</p>
6152<h4 class="parameters">Parameters</h4>
6153<dl>
6154<dt>status</dt>
6155 <dd class="description">URI status code</dd>
6156</dl>
6157<h4 class="returnvalue">Return Value</h4>
6158 <p class="description">Localized status string</p>
6159<h3 class="function"><a id="httpUpdate">httpUpdate</a></h3>
6160 <p class="description">Update the current HTTP state for incoming data.</p>
6161<p class="code">
6162http_status_t httpUpdate (<br>
6163&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http<br>
6164);</p>
6165<h4 class="parameters">Parameters</h4>
6166<dl>
6167<dt>http</dt>
6168 <dd class="description">HTTP connection</dd>
6169</dl>
6170<h4 class="returnvalue">Return Value</h4>
6171 <p class="description">HTTP status</p>
6172<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="httpWait">httpWait</a></h3>
6173 <p class="description">Wait for data available on a connection.</p>
6174<p class="code">
6175int httpWait (<br>
6176&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
6177&#160;&#160;&#160;&#160;int msec<br>
6178);</p>
6179<h4 class="parameters">Parameters</h4>
6180<dl>
6181<dt>http</dt>
6182 <dd class="description">HTTP connection</dd>
6183<dt>msec</dt>
6184 <dd class="description">Milliseconds to wait</dd>
6185</dl>
6186<h4 class="returnvalue">Return Value</h4>
6187 <p class="description">1 if data is available, 0 otherwise</p>
6188<h3 class="function"><span class="info">&#160;DEPRECATED&#160;</span><a id="httpWrite">httpWrite</a></h3>
6189 <p class="description">Write data to a HTTP connection.</p>
6190<p class="code">
6191int httpWrite (<br>
6192&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
6193&#160;&#160;&#160;&#160;const char *buffer,<br>
6194&#160;&#160;&#160;&#160;int length<br>
6195);</p>
6196<h4 class="parameters">Parameters</h4>
6197<dl>
6198<dt>http</dt>
6199 <dd class="description">HTTP connection</dd>
6200<dt>buffer</dt>
6201 <dd class="description">Buffer for data</dd>
6202<dt>length</dt>
6203 <dd class="description">Number of bytes to write</dd>
6204</dl>
6205<h4 class="returnvalue">Return Value</h4>
6206 <p class="description">Number of bytes written</p>
6207<h4 class="discussion">Discussion</h4>
6208 <p class="discussion">This function is deprecated. Use the httpWrite2() function which can
6209write more than 2GB of data.
6210
6211</p>
6212<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="httpWrite2">httpWrite2</a></h3>
6213 <p class="description">Write data to a HTTP connection.</p>
6214<p class="code">
6215ssize_t httpWrite2 (<br>
6216&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
6217&#160;&#160;&#160;&#160;const char *buffer,<br>
6218&#160;&#160;&#160;&#160;size_t length<br>
6219);</p>
6220<h4 class="parameters">Parameters</h4>
6221<dl>
6222<dt>http</dt>
6223 <dd class="description">HTTP connection</dd>
6224<dt>buffer</dt>
6225 <dd class="description">Buffer for data</dd>
6226<dt>length</dt>
6227 <dd class="description">Number of bytes to write</dd>
6228</dl>
6229<h4 class="returnvalue">Return Value</h4>
6230 <p class="description">Number of bytes written</p>
6231<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="httpWriteResponse">httpWriteResponse</a></h3>
6232 <p class="description">Write a HTTP response to a client connection.</p>
6233<p class="code">
6234int httpWriteResponse (<br>
6235&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
6236&#160;&#160;&#160;&#160;http_status_t status<br>
6237);</p>
6238<h4 class="parameters">Parameters</h4>
6239<dl>
6240<dt>http</dt>
6241 <dd class="description">HTTP connection</dd>
6242<dt>status</dt>
6243 <dd class="description">Status code</dd>
6244</dl>
6245<h4 class="returnvalue">Return Value</h4>
6246 <p class="description">0 on success, -1 on error</p>
6247<h3 class="function"><a id="ippAddBoolean">ippAddBoolean</a></h3>
6248 <p class="description">Add a boolean attribute to an IPP message.</p>
6249<p class="code">
6250<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBoolean (<br>
6251&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6252&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6253&#160;&#160;&#160;&#160;const char *name,<br>
6254&#160;&#160;&#160;&#160;char value<br>
6255);</p>
6256<h4 class="parameters">Parameters</h4>
6257<dl>
6258<dt>ipp</dt>
6259 <dd class="description">IPP message</dd>
6260<dt>group</dt>
6261 <dd class="description">IPP group</dd>
6262<dt>name</dt>
6263 <dd class="description">Name of attribute</dd>
6264<dt>value</dt>
6265 <dd class="description">Value of attribute</dd>
6266</dl>
6267<h4 class="returnvalue">Return Value</h4>
6268 <p class="description">New attribute</p>
6269<h4 class="discussion">Discussion</h4>
6270 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6271the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6272<br>
6273The <code>group</code> parameter specifies the IPP attribute group tag: none
6274(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
6275event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
6276(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
6277(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
6278<h3 class="function"><a id="ippAddBooleans">ippAddBooleans</a></h3>
6279 <p class="description">Add an array of boolean values.</p>
6280<p class="code">
6281<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBooleans (<br>
6282&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6283&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6284&#160;&#160;&#160;&#160;const char *name,<br>
6285&#160;&#160;&#160;&#160;int num_values,<br>
6286&#160;&#160;&#160;&#160;const char *values<br>
6287);</p>
6288<h4 class="parameters">Parameters</h4>
6289<dl>
6290<dt>ipp</dt>
6291 <dd class="description">IPP message</dd>
6292<dt>group</dt>
6293 <dd class="description">IPP group</dd>
6294<dt>name</dt>
6295 <dd class="description">Name of attribute</dd>
6296<dt>num_values</dt>
6297 <dd class="description">Number of values</dd>
6298<dt>values</dt>
6299 <dd class="description">Values</dd>
6300</dl>
6301<h4 class="returnvalue">Return Value</h4>
6302 <p class="description">New attribute</p>
6303<h4 class="discussion">Discussion</h4>
6304 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6305the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6306<br>
6307The <code>group</code> parameter specifies the IPP attribute group tag: none
6308(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
6309event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
6310(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
6311(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
6312<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippAddCollection">ippAddCollection</a></h3>
6313 <p class="description">Add a collection value.</p>
6314<p class="code">
6315<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollection (<br>
6316&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6317&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6318&#160;&#160;&#160;&#160;const char *name,<br>
6319&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *value<br>
6320);</p>
6321<h4 class="parameters">Parameters</h4>
6322<dl>
6323<dt>ipp</dt>
6324 <dd class="description">IPP message</dd>
6325<dt>group</dt>
6326 <dd class="description">IPP group</dd>
6327<dt>name</dt>
6328 <dd class="description">Name of attribute</dd>
6329<dt>value</dt>
6330 <dd class="description">Value</dd>
6331</dl>
6332<h4 class="returnvalue">Return Value</h4>
6333 <p class="description">New attribute</p>
6334<h4 class="discussion">Discussion</h4>
6335 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6336the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6337<br>
6338The <code>group</code> parameter specifies the IPP attribute group tag: none
6339(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
6340event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
6341(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
6342(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
6343
6344</p>
6345<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippAddCollections">ippAddCollections</a></h3>
6346 <p class="description">Add an array of collection values.</p>
6347<p class="code">
6348<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollections (<br>
6349&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6350&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6351&#160;&#160;&#160;&#160;const char *name,<br>
6352&#160;&#160;&#160;&#160;int num_values,<br>
6353&#160;&#160;&#160;&#160;const <a href="#ipp_t">ipp_t</a> **values<br>
6354);</p>
6355<h4 class="parameters">Parameters</h4>
6356<dl>
6357<dt>ipp</dt>
6358 <dd class="description">IPP message</dd>
6359<dt>group</dt>
6360 <dd class="description">IPP group</dd>
6361<dt>name</dt>
6362 <dd class="description">Name of attribute</dd>
6363<dt>num_values</dt>
6364 <dd class="description">Number of values</dd>
6365<dt>values</dt>
6366 <dd class="description">Values</dd>
6367</dl>
6368<h4 class="returnvalue">Return Value</h4>
6369 <p class="description">New attribute</p>
6370<h4 class="discussion">Discussion</h4>
6371 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6372the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6373<br>
6374The <code>group</code> parameter specifies the IPP attribute group tag: none
6375(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
6376event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
6377(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
6378(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
6379
6380</p>
6381<h3 class="function"><a id="ippAddDate">ippAddDate</a></h3>
6382 <p class="description">Add a date attribute to an IPP message.</p>
6383<p class="code">
6384<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddDate (<br>
6385&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6386&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6387&#160;&#160;&#160;&#160;const char *name,<br>
6388&#160;&#160;&#160;&#160;const <a href="#ipp_uchar_t">ipp_uchar_t</a> *value<br>
6389);</p>
6390<h4 class="parameters">Parameters</h4>
6391<dl>
6392<dt>ipp</dt>
6393 <dd class="description">IPP message</dd>
6394<dt>group</dt>
6395 <dd class="description">IPP group</dd>
6396<dt>name</dt>
6397 <dd class="description">Name of attribute</dd>
6398<dt>value</dt>
6399 <dd class="description">Value</dd>
6400</dl>
6401<h4 class="returnvalue">Return Value</h4>
6402 <p class="description">New attribute</p>
6403<h4 class="discussion">Discussion</h4>
6404 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6405the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6406<br>
6407The <code>group</code> parameter specifies the IPP attribute group tag: none
6408(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
6409event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
6410(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
6411(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
6412<h3 class="function"><a id="ippAddInteger">ippAddInteger</a></h3>
6413 <p class="description">Add a integer attribute to an IPP message.</p>
6414<p class="code">
6415<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddInteger (<br>
6416&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6417&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6418&#160;&#160;&#160;&#160;ipp_tag_t value_tag,<br>
6419&#160;&#160;&#160;&#160;const char *name,<br>
6420&#160;&#160;&#160;&#160;int value<br>
6421);</p>
6422<h4 class="parameters">Parameters</h4>
6423<dl>
6424<dt>ipp</dt>
6425 <dd class="description">IPP message</dd>
6426<dt>group</dt>
6427 <dd class="description">IPP group</dd>
6428<dt>value_tag</dt>
6429 <dd class="description">Type of attribute</dd>
6430<dt>name</dt>
6431 <dd class="description">Name of attribute</dd>
6432<dt>value</dt>
6433 <dd class="description">Value of attribute</dd>
6434</dl>
6435<h4 class="returnvalue">Return Value</h4>
6436 <p class="description">New attribute</p>
6437<h4 class="discussion">Discussion</h4>
6438 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6439the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6440<br>
6441The <code>group</code> parameter specifies the IPP attribute group tag: none
6442(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
6443event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
6444(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
6445(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
6446<br>
6447Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
6448(<code>IPP_TAG_INTEGER</code>).</p>
6449<h3 class="function"><a id="ippAddIntegers">ippAddIntegers</a></h3>
6450 <p class="description">Add an array of integer values.</p>
6451<p class="code">
6452<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddIntegers (<br>
6453&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6454&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6455&#160;&#160;&#160;&#160;ipp_tag_t value_tag,<br>
6456&#160;&#160;&#160;&#160;const char *name,<br>
6457&#160;&#160;&#160;&#160;int num_values,<br>
6458&#160;&#160;&#160;&#160;const int *values<br>
6459);</p>
6460<h4 class="parameters">Parameters</h4>
6461<dl>
6462<dt>ipp</dt>
6463 <dd class="description">IPP message</dd>
6464<dt>group</dt>
6465 <dd class="description">IPP group</dd>
6466<dt>value_tag</dt>
6467 <dd class="description">Type of attribute</dd>
6468<dt>name</dt>
6469 <dd class="description">Name of attribute</dd>
6470<dt>num_values</dt>
6471 <dd class="description">Number of values</dd>
6472<dt>values</dt>
6473 <dd class="description">Values</dd>
6474</dl>
6475<h4 class="returnvalue">Return Value</h4>
6476 <p class="description">New attribute</p>
6477<h4 class="discussion">Discussion</h4>
6478 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6479the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6480<br>
6481The <code>group</code> parameter specifies the IPP attribute group tag: none
6482(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
6483event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
6484(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
6485(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
6486<br>
6487Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
6488(<code>IPP_TAG_INTEGER</code>).</p>
6489<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippAddOctetString">ippAddOctetString</a></h3>
6490 <p class="description">Add an octetString value to an IPP message.</p>
6491<p class="code">
6492<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOctetString (<br>
6493&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6494&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6495&#160;&#160;&#160;&#160;const char *name,<br>
6496&#160;&#160;&#160;&#160;const void *data,<br>
6497&#160;&#160;&#160;&#160;int datalen<br>
6498);</p>
6499<h4 class="parameters">Parameters</h4>
6500<dl>
6501<dt>ipp</dt>
6502 <dd class="description">IPP message</dd>
6503<dt>group</dt>
6504 <dd class="description">IPP group</dd>
6505<dt>name</dt>
6506 <dd class="description">Name of attribute</dd>
6507<dt>data</dt>
6508 <dd class="description">octetString data</dd>
6509<dt>datalen</dt>
6510 <dd class="description">Length of data in bytes</dd>
6511</dl>
6512<h4 class="returnvalue">Return Value</h4>
6513 <p class="description">New attribute</p>
6514<h4 class="discussion">Discussion</h4>
6515 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6516the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6517<br>
6518The <code>group</code> parameter specifies the IPP attribute group tag: none
6519(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
6520event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
6521(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
6522(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
6523
6524</p>
6525<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippAddOutOfBand">ippAddOutOfBand</a></h3>
6526 <p class="description">Add an out-of-band value to an IPP message.</p>
6527<p class="code">
6528<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOutOfBand (<br>
6529&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6530&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6531&#160;&#160;&#160;&#160;ipp_tag_t value_tag,<br>
6532&#160;&#160;&#160;&#160;const char *name<br>
6533);</p>
6534<h4 class="parameters">Parameters</h4>
6535<dl>
6536<dt>ipp</dt>
6537 <dd class="description">IPP message</dd>
6538<dt>group</dt>
6539 <dd class="description">IPP group</dd>
6540<dt>value_tag</dt>
6541 <dd class="description">Type of attribute</dd>
6542<dt>name</dt>
6543 <dd class="description">Name of attribute</dd>
6544</dl>
6545<h4 class="returnvalue">Return Value</h4>
6546 <p class="description">New attribute</p>
6547<h4 class="discussion">Discussion</h4>
6548 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6549the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6550<br>
6551The <code>group</code> parameter specifies the IPP attribute group tag: none
6552(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
6553event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
6554(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
6555(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
6556<br>
6557Supported out-of-band values include unsupported-value
6558(<code>IPP_TAG_UNSUPPORTED_VALUE</code>), default (<code>IPP_TAG_DEFAULT</code>), unknown
6559(<code>IPP_TAG_UNKNOWN</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable
6560(<code>IPP_TAG_NOTSETTABLE</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), and
6561admin-define (<code>IPP_TAG_ADMINDEFINE</code>).
6562
6563</p>
6564<h3 class="function"><a id="ippAddRange">ippAddRange</a></h3>
6565 <p class="description">Add a range of values to an IPP message.</p>
6566<p class="code">
6567<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRange (<br>
6568&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6569&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6570&#160;&#160;&#160;&#160;const char *name,<br>
6571&#160;&#160;&#160;&#160;int lower,<br>
6572&#160;&#160;&#160;&#160;int upper<br>
6573);</p>
6574<h4 class="parameters">Parameters</h4>
6575<dl>
6576<dt>ipp</dt>
6577 <dd class="description">IPP message</dd>
6578<dt>group</dt>
6579 <dd class="description">IPP group</dd>
6580<dt>name</dt>
6581 <dd class="description">Name of attribute</dd>
6582<dt>lower</dt>
6583 <dd class="description">Lower value</dd>
6584<dt>upper</dt>
6585 <dd class="description">Upper value</dd>
6586</dl>
6587<h4 class="returnvalue">Return Value</h4>
6588 <p class="description">New attribute</p>
6589<h4 class="discussion">Discussion</h4>
6590 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6591the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6592<br>
6593The <code>group</code> parameter specifies the IPP attribute group tag: none
6594(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
6595event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
6596(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
6597(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
6598<br>
6599The <code>lower</code> parameter must be less than or equal to the <code>upper</code> parameter.</p>
6600<h3 class="function"><a id="ippAddRanges">ippAddRanges</a></h3>
6601 <p class="description">Add ranges of values to an IPP message.</p>
6602<p class="code">
6603<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRanges (<br>
6604&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6605&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6606&#160;&#160;&#160;&#160;const char *name,<br>
6607&#160;&#160;&#160;&#160;int num_values,<br>
6608&#160;&#160;&#160;&#160;const int *lower,<br>
6609&#160;&#160;&#160;&#160;const int *upper<br>
6610);</p>
6611<h4 class="parameters">Parameters</h4>
6612<dl>
6613<dt>ipp</dt>
6614 <dd class="description">IPP message</dd>
6615<dt>group</dt>
6616 <dd class="description">IPP group</dd>
6617<dt>name</dt>
6618 <dd class="description">Name of attribute</dd>
6619<dt>num_values</dt>
6620 <dd class="description">Number of values</dd>
6621<dt>lower</dt>
6622 <dd class="description">Lower values</dd>
6623<dt>upper</dt>
6624 <dd class="description">Upper values</dd>
6625</dl>
6626<h4 class="returnvalue">Return Value</h4>
6627 <p class="description">New attribute</p>
6628<h4 class="discussion">Discussion</h4>
6629 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6630the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6631<br>
6632The <code>group</code> parameter specifies the IPP attribute group tag: none
6633(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
6634event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
6635(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
6636(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
6637<h3 class="function"><a id="ippAddResolution">ippAddResolution</a></h3>
6638 <p class="description">Add a resolution value to an IPP message.</p>
6639<p class="code">
6640<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolution (<br>
6641&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6642&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6643&#160;&#160;&#160;&#160;const char *name,<br>
6644&#160;&#160;&#160;&#160;<a href="#ipp_res_t">ipp_res_t</a> units,<br>
6645&#160;&#160;&#160;&#160;int xres,<br>
6646&#160;&#160;&#160;&#160;int yres<br>
6647);</p>
6648<h4 class="parameters">Parameters</h4>
6649<dl>
6650<dt>ipp</dt>
6651 <dd class="description">IPP message</dd>
6652<dt>group</dt>
6653 <dd class="description">IPP group</dd>
6654<dt>name</dt>
6655 <dd class="description">Name of attribute</dd>
6656<dt>units</dt>
6657 <dd class="description">Units for resolution</dd>
6658<dt>xres</dt>
6659 <dd class="description">X resolution</dd>
6660<dt>yres</dt>
6661 <dd class="description">Y resolution</dd>
6662</dl>
6663<h4 class="returnvalue">Return Value</h4>
6664 <p class="description">New attribute</p>
6665<h4 class="discussion">Discussion</h4>
6666 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6667the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6668<br>
6669The <code>group</code> parameter specifies the IPP attribute group tag: none
6670(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
6671event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
6672(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
6673(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
6674<h3 class="function"><a id="ippAddResolutions">ippAddResolutions</a></h3>
6675 <p class="description">Add resolution values to an IPP message.</p>
6676<p class="code">
6677<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolutions (<br>
6678&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6679&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6680&#160;&#160;&#160;&#160;const char *name,<br>
6681&#160;&#160;&#160;&#160;int num_values,<br>
6682&#160;&#160;&#160;&#160;<a href="#ipp_res_t">ipp_res_t</a> units,<br>
6683&#160;&#160;&#160;&#160;const int *xres,<br>
6684&#160;&#160;&#160;&#160;const int *yres<br>
6685);</p>
6686<h4 class="parameters">Parameters</h4>
6687<dl>
6688<dt>ipp</dt>
6689 <dd class="description">IPP message</dd>
6690<dt>group</dt>
6691 <dd class="description">IPP group</dd>
6692<dt>name</dt>
6693 <dd class="description">Name of attribute</dd>
6694<dt>num_values</dt>
6695 <dd class="description">Number of values</dd>
6696<dt>units</dt>
6697 <dd class="description">Units for resolution</dd>
6698<dt>xres</dt>
6699 <dd class="description">X resolutions</dd>
6700<dt>yres</dt>
6701 <dd class="description">Y resolutions</dd>
6702</dl>
6703<h4 class="returnvalue">Return Value</h4>
6704 <p class="description">New attribute</p>
6705<h4 class="discussion">Discussion</h4>
6706 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6707the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6708<br>
6709The <code>group</code> parameter specifies the IPP attribute group tag: none
6710(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
6711event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
6712(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
6713(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
6714<h3 class="function"><a id="ippAddSeparator">ippAddSeparator</a></h3>
6715 <p class="description">Add a group separator to an IPP message.</p>
6716<p class="code">
6717<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddSeparator (<br>
6718&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
6719);</p>
6720<h4 class="parameters">Parameters</h4>
6721<dl>
6722<dt>ipp</dt>
6723 <dd class="description">IPP message</dd>
6724</dl>
6725<h4 class="returnvalue">Return Value</h4>
6726 <p class="description">New attribute</p>
6727<h4 class="discussion">Discussion</h4>
6728 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6729the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.</p>
6730<h3 class="function"><a id="ippAddString">ippAddString</a></h3>
6731 <p class="description">Add a language-encoded string to an IPP message.</p>
6732<p class="code">
6733<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddString (<br>
6734&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6735&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6736&#160;&#160;&#160;&#160;ipp_tag_t value_tag,<br>
6737&#160;&#160;&#160;&#160;const char *name,<br>
6738&#160;&#160;&#160;&#160;const char *language,<br>
6739&#160;&#160;&#160;&#160;const char *value<br>
6740);</p>
6741<h4 class="parameters">Parameters</h4>
6742<dl>
6743<dt>ipp</dt>
6744 <dd class="description">IPP message</dd>
6745<dt>group</dt>
6746 <dd class="description">IPP group</dd>
6747<dt>value_tag</dt>
6748 <dd class="description">Type of attribute</dd>
6749<dt>name</dt>
6750 <dd class="description">Name of attribute</dd>
6751<dt>language</dt>
6752 <dd class="description">Language code</dd>
6753<dt>value</dt>
6754 <dd class="description">Value</dd>
6755</dl>
6756<h4 class="returnvalue">Return Value</h4>
6757 <p class="description">New attribute</p>
6758<h4 class="discussion">Discussion</h4>
6759 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6760the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6761<br>
6762The <code>group</code> parameter specifies the IPP attribute group tag: none
6763(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
6764event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
6765(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
6766(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
6767<br>
6768Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
6769(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
6770(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
6771(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
6772(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
6773(<code>IPP_TAG_URISCHEME</code>).<br>
6774<br>
6775The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
6776textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
6777<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippAddStringf">ippAddStringf</a></h3>
6778 <p class="description">Add a formatted string to an IPP message.</p>
6779<p class="code">
6780<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStringf (<br>
6781&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6782&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6783&#160;&#160;&#160;&#160;ipp_tag_t value_tag,<br>
6784&#160;&#160;&#160;&#160;const char *name,<br>
6785&#160;&#160;&#160;&#160;const char *language,<br>
6786&#160;&#160;&#160;&#160;const char *format,<br>
6787&#160;&#160;&#160;&#160;...<br>
6788);</p>
6789<h4 class="parameters">Parameters</h4>
6790<dl>
6791<dt>ipp</dt>
6792 <dd class="description">IPP message</dd>
6793<dt>group</dt>
6794 <dd class="description">IPP group</dd>
6795<dt>value_tag</dt>
6796 <dd class="description">Type of attribute</dd>
6797<dt>name</dt>
6798 <dd class="description">Name of attribute</dd>
6799<dt>language</dt>
6800 <dd class="description">Language code (<code>NULL</code> for default)</dd>
6801<dt>format</dt>
6802 <dd class="description">Printf-style format string</dd>
6803<dt>...</dt>
6804 <dd class="description">Additional arguments as needed</dd>
6805</dl>
6806<h4 class="returnvalue">Return Value</h4>
6807 <p class="description">New attribute</p>
6808<h4 class="discussion">Discussion</h4>
6809 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6810the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6811<br>
6812The <code>group</code> parameter specifies the IPP attribute group tag: none
6813(<code>IPP_TAG_ZERO</code>, for member attributes), document
6814(<code>IPP_TAG_DOCUMENT</code>), event notification
6815(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
6816printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
6817or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
6818<br>
6819Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
6820(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
6821(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
6822(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
6823(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
6824(<code>IPP_TAG_URISCHEME</code>).<br>
6825<br>
6826The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
6827and textWithLanguage string values and must be <code>NULL</code> for all other
6828string values.<br>
6829<br>
6830The <code>format</code> parameter uses formatting characters compatible with the
6831printf family of standard functions. Additional arguments follow it as
6832needed. The formatted string is truncated as needed to the maximum length of
6833the corresponding value type.
6834
6835</p>
6836<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippAddStringfv">ippAddStringfv</a></h3>
6837 <p class="description">Add a formatted string to an IPP message.</p>
6838<p class="code">
6839<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStringfv (<br>
6840&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6841&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6842&#160;&#160;&#160;&#160;ipp_tag_t value_tag,<br>
6843&#160;&#160;&#160;&#160;const char *name,<br>
6844&#160;&#160;&#160;&#160;const char *language,<br>
6845&#160;&#160;&#160;&#160;const char *format,<br>
6846&#160;&#160;&#160;&#160;va_list ap<br>
6847);</p>
6848<h4 class="parameters">Parameters</h4>
6849<dl>
6850<dt>ipp</dt>
6851 <dd class="description">IPP message</dd>
6852<dt>group</dt>
6853 <dd class="description">IPP group</dd>
6854<dt>value_tag</dt>
6855 <dd class="description">Type of attribute</dd>
6856<dt>name</dt>
6857 <dd class="description">Name of attribute</dd>
6858<dt>language</dt>
6859 <dd class="description">Language code (<code>NULL</code> for default)</dd>
6860<dt>format</dt>
6861 <dd class="description">Printf-style format string</dd>
6862<dt>ap</dt>
6863 <dd class="description">Additional arguments</dd>
6864</dl>
6865<h4 class="returnvalue">Return Value</h4>
6866 <p class="description">New attribute</p>
6867<h4 class="discussion">Discussion</h4>
6868 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6869the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6870<br>
6871The <code>group</code> parameter specifies the IPP attribute group tag: none
6872(<code>IPP_TAG_ZERO</code>, for member attributes), document
6873(<code>IPP_TAG_DOCUMENT</code>), event notification
6874(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
6875printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
6876or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
6877<br>
6878Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
6879(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
6880(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
6881(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
6882(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
6883(<code>IPP_TAG_URISCHEME</code>).<br>
6884<br>
6885The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
6886and textWithLanguage string values and must be <code>NULL</code> for all other
6887string values.<br>
6888<br>
6889The <code>format</code> parameter uses formatting characters compatible with the
6890printf family of standard functions. Additional arguments are passed in the
6891stdarg pointer <code>ap</code>. The formatted string is truncated as needed to the
6892maximum length of the corresponding value type.
6893
6894</p>
6895<h3 class="function"><a id="ippAddStrings">ippAddStrings</a></h3>
6896 <p class="description">Add language-encoded strings to an IPP message.</p>
6897<p class="code">
6898<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStrings (<br>
6899&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
6900&#160;&#160;&#160;&#160;ipp_tag_t group,<br>
6901&#160;&#160;&#160;&#160;ipp_tag_t value_tag,<br>
6902&#160;&#160;&#160;&#160;const char *name,<br>
6903&#160;&#160;&#160;&#160;int num_values,<br>
6904&#160;&#160;&#160;&#160;const char *language,<br>
6905&#160;&#160;&#160;&#160;const char *const *values<br>
6906);</p>
6907<h4 class="parameters">Parameters</h4>
6908<dl>
6909<dt>ipp</dt>
6910 <dd class="description">IPP message</dd>
6911<dt>group</dt>
6912 <dd class="description">IPP group</dd>
6913<dt>value_tag</dt>
6914 <dd class="description">Type of attribute</dd>
6915<dt>name</dt>
6916 <dd class="description">Name of attribute</dd>
6917<dt>num_values</dt>
6918 <dd class="description">Number of values</dd>
6919<dt>language</dt>
6920 <dd class="description">Language code (<code>NULL</code> for default)</dd>
6921<dt>values</dt>
6922 <dd class="description">Values</dd>
6923</dl>
6924<h4 class="returnvalue">Return Value</h4>
6925 <p class="description">New attribute</p>
6926<h4 class="discussion">Discussion</h4>
6927 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
6928the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
6929<br>
6930The <code>group</code> parameter specifies the IPP attribute group tag: none
6931(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
6932event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
6933(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
6934(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
6935<br>
6936Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
6937(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
6938(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
6939(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
6940(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
6941(<code>IPP_TAG_URISCHEME</code>).<br>
6942<br>
6943The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
6944textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
6945<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippAttributeString">ippAttributeString</a></h3>
6946 <p class="description">Convert the attribute's value to a string.</p>
6947<p class="code">
6948size_t ippAttributeString (<br>
6949&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
6950&#160;&#160;&#160;&#160;char *buffer,<br>
6951&#160;&#160;&#160;&#160;size_t bufsize<br>
6952);</p>
6953<h4 class="parameters">Parameters</h4>
6954<dl>
6955<dt>attr</dt>
6956 <dd class="description">Attribute</dd>
6957<dt>buffer</dt>
6958 <dd class="description">String buffer or NULL</dd>
6959<dt>bufsize</dt>
6960 <dd class="description">Size of string buffer</dd>
6961</dl>
6962<h4 class="returnvalue">Return Value</h4>
6963 <p class="description">Number of bytes less nul</p>
6964<h4 class="discussion">Discussion</h4>
6965 <p class="discussion">Returns the number of bytes that would be written, not including the
6966trailing nul. The buffer pointer can be NULL to get the required length,
6967just like (v)snprintf.
6968
6969</p>
6970<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippContainsInteger">ippContainsInteger</a></h3>
6971 <p class="description">Determine whether an attribute contains the
6972specified value or is within the list of ranges.</p>
6973<p class="code">
6974int ippContainsInteger (<br>
6975&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
6976&#160;&#160;&#160;&#160;int value<br>
6977);</p>
6978<h4 class="parameters">Parameters</h4>
6979<dl>
6980<dt>attr</dt>
6981 <dd class="description">Attribute</dd>
6982<dt>value</dt>
6983 <dd class="description">Integer/enum value</dd>
6984</dl>
6985<h4 class="returnvalue">Return Value</h4>
6986 <p class="description">1 on a match, 0 on no match</p>
6987<h4 class="discussion">Discussion</h4>
6988 <p class="discussion">Returns non-zero when the attribute contains either a matching integer or
6989enum value, or the value falls within one of the rangeOfInteger values for
6990the attribute.
6991
6992</p>
6993<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippContainsString">ippContainsString</a></h3>
6994 <p class="description">Determine whether an attribute contains the
6995specified string value.</p>
6996<p class="code">
6997int ippContainsString (<br>
6998&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
6999&#160;&#160;&#160;&#160;const char *value<br>
7000);</p>
7001<h4 class="parameters">Parameters</h4>
7002<dl>
7003<dt>attr</dt>
7004 <dd class="description">Attribute</dd>
7005<dt>value</dt>
7006 <dd class="description">String value</dd>
7007</dl>
7008<h4 class="returnvalue">Return Value</h4>
7009 <p class="description">1 on a match, 0 on no match</p>
7010<h4 class="discussion">Discussion</h4>
7011 <p class="discussion">Returns non-zero when the attribute contains a matching charset, keyword,
7012language, mimeMediaType, name, text, URI, or URI scheme value.
7013
7014</p>
7015<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippCopyAttribute">ippCopyAttribute</a></h3>
7016 <p class="description">Copy an attribute.</p>
7017<p class="code">
7018<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippCopyAttribute (<br>
7019&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *dst,<br>
7020&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *srcattr,<br>
7021&#160;&#160;&#160;&#160;int quickcopy<br>
7022);</p>
7023<h4 class="parameters">Parameters</h4>
7024<dl>
7025<dt>dst</dt>
7026 <dd class="description">Destination IPP message</dd>
7027<dt>srcattr</dt>
7028 <dd class="description">Attribute to copy</dd>
7029<dt>quickcopy</dt>
7030 <dd class="description">1 for a referenced copy, 0 for normal</dd>
7031</dl>
7032<h4 class="returnvalue">Return Value</h4>
7033 <p class="description">New attribute</p>
7034<h4 class="discussion">Discussion</h4>
7035 <p class="discussion">The specified attribute, <code>attr</code>, is copied to the destination IPP message.
7036When <code>quickcopy</code> is non-zero, a &quot;shallow&quot; reference copy of the attribute is
7037created - this should only be done as long as the original source IPP message will
7038not be freed for the life of the destination.
7039
7040</p>
7041<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippCopyAttributes">ippCopyAttributes</a></h3>
7042 <p class="description">Copy attributes from one IPP message to another.</p>
7043<p class="code">
7044int ippCopyAttributes (<br>
7045&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *dst,<br>
7046&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *src,<br>
7047&#160;&#160;&#160;&#160;int quickcopy,<br>
7048&#160;&#160;&#160;&#160;<a href="#ipp_copycb_t">ipp_copycb_t</a> cb,<br>
7049&#160;&#160;&#160;&#160;void *context<br>
7050);</p>
7051<h4 class="parameters">Parameters</h4>
7052<dl>
7053<dt>dst</dt>
7054 <dd class="description">Destination IPP message</dd>
7055<dt>src</dt>
7056 <dd class="description">Source IPP message</dd>
7057<dt>quickcopy</dt>
7058 <dd class="description">1 for a referenced copy, 0 for normal</dd>
7059<dt>cb</dt>
7060 <dd class="description">Copy callback or <code>NULL</code> for none</dd>
7061<dt>context</dt>
7062 <dd class="description">Context pointer</dd>
7063</dl>
7064<h4 class="returnvalue">Return Value</h4>
7065 <p class="description">1 on success, 0 on error</p>
7066<h4 class="discussion">Discussion</h4>
7067 <p class="discussion">Zero or more attributes are copied from the source IPP message, <code>src</code>, to the
7068destination IPP message, <code>dst</code>. When <code>quickcopy</code> is non-zero, a &quot;shallow&quot;
7069reference copy of the attribute is created - this should only be done as long as the
7070original source IPP message will not be freed for the life of the destination.<br>
7071<br>
7072The <code>cb</code> and <code>context</code> parameters provide a generic way to &quot;filter&quot; the
7073attributes that are copied - the function must return 1 to copy the attribute or
70740 to skip it. The function may also choose to do a partial copy of the source attribute
7075itself.
7076
7077</p>
7078<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippCreateRequestedArray">ippCreateRequestedArray</a></h3>
7079 <p class="description">Create a CUPS array of attribute names from the
7080given requested-attributes attribute.</p>
7081<p class="code">
7082<a href="#cups_array_t">cups_array_t</a> *ippCreateRequestedArray (<br>
7083&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *request<br>
7084);</p>
7085<h4 class="parameters">Parameters</h4>
7086<dl>
7087<dt>request</dt>
7088 <dd class="description">IPP request</dd>
7089</dl>
7090<h4 class="returnvalue">Return Value</h4>
7091 <p class="description">CUPS array or <code>NULL</code> if all</p>
7092<h4 class="discussion">Discussion</h4>
7093 <p class="discussion">This function creates a (sorted) CUPS array of attribute names matching the
7094list of &quot;requested-attribute&quot; values supplied in an IPP request. All IANA-
7095registered values are supported in addition to the CUPS IPP extension
7096attributes.<br>
7097<br>
7098The <code>request</code> parameter specifies the request message that was read from
7099the client.
7100
7101<code>NULL</code> is returned if all attributes should be returned. Otherwise, the
7102result is a sorted array of attribute names, where <code>cupsArrayFind(array,
7103"attribute-name")</code> will return a non-NULL pointer. The array must be freed
7104using the <code>cupsArrayDelete</code> function.
7105
7106</p>
7107<h3 class="function"><a id="ippDateToTime">ippDateToTime</a></h3>
7108 <p class="description">Convert from RFC 1903 Date/Time format to UNIX time
7109in seconds.</p>
7110<p class="code">
7111time_t ippDateToTime (<br>
7112&#160;&#160;&#160;&#160;const <a href="#ipp_uchar_t">ipp_uchar_t</a> *date<br>
7113);</p>
7114<h4 class="parameters">Parameters</h4>
7115<dl>
7116<dt>date</dt>
7117 <dd class="description">RFC 1903 date info</dd>
7118</dl>
7119<h4 class="returnvalue">Return Value</h4>
7120 <p class="description">UNIX time value</p>
7121<h3 class="function"><a id="ippDelete">ippDelete</a></h3>
7122 <p class="description">Delete an IPP message.</p>
7123<p class="code">
7124void ippDelete (<br>
7125&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
7126);</p>
7127<h4 class="parameters">Parameters</h4>
7128<dl>
7129<dt>ipp</dt>
7130 <dd class="description">IPP message</dd>
7131</dl>
7132<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippDeleteAttribute">ippDeleteAttribute</a></h3>
7133 <p class="description">Delete a single attribute in an IPP message.</p>
7134<p class="code">
7135void ippDeleteAttribute (<br>
7136&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
7137&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
7138);</p>
7139<h4 class="parameters">Parameters</h4>
7140<dl>
7141<dt>ipp</dt>
7142 <dd class="description">IPP message</dd>
7143<dt>attr</dt>
7144 <dd class="description">Attribute to delete</dd>
7145</dl>
7146<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippDeleteValues">ippDeleteValues</a></h3>
7147 <p class="description">Delete values in an attribute.</p>
7148<p class="code">
7149int ippDeleteValues (<br>
7150&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
7151&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
7152&#160;&#160;&#160;&#160;int element,<br>
7153&#160;&#160;&#160;&#160;int count<br>
7154);</p>
7155<h4 class="parameters">Parameters</h4>
7156<dl>
7157<dt>ipp</dt>
7158 <dd class="description">IPP message</dd>
7159<dt>attr</dt>
7160 <dd class="description">Attribute</dd>
7161<dt>element</dt>
7162 <dd class="description">Index of first value to delete (0-based)</dd>
7163<dt>count</dt>
7164 <dd class="description">Number of values to delete</dd>
7165</dl>
7166<h4 class="returnvalue">Return Value</h4>
7167 <p class="description">1 on success, 0 on failure</p>
7168<h4 class="discussion">Discussion</h4>
7169 <p class="discussion">The <code>element</code> parameter specifies the first value to delete, starting at
71700. It must be less than the number of values returned by <a href="#ippGetCount"><code>ippGetCount</code></a>.<br>
7171<br>
7172The <code>attr</code> parameter may be modified as a result of setting the value.<br>
7173<br>
7174Deleting all values in an attribute deletes the attribute.
7175
7176</p>
7177<h3 class="function"><a id="ippEnumString">ippEnumString</a></h3>
7178 <p class="description">Return a string corresponding to the enum value.</p>
7179<p class="code">
7180const char *ippEnumString (<br>
7181&#160;&#160;&#160;&#160;const char *attrname,<br>
7182&#160;&#160;&#160;&#160;int enumvalue<br>
7183);</p>
7184<h4 class="parameters">Parameters</h4>
7185<dl>
7186<dt>attrname</dt>
7187 <dd class="description">Attribute name</dd>
7188<dt>enumvalue</dt>
7189 <dd class="description">Enum value</dd>
7190</dl>
7191<h4 class="returnvalue">Return Value</h4>
7192 <p class="description">Enum string</p>
7193<h3 class="function"><a id="ippEnumValue">ippEnumValue</a></h3>
7194 <p class="description">Return the value associated with a given enum string.</p>
7195<p class="code">
7196int ippEnumValue (<br>
7197&#160;&#160;&#160;&#160;const char *attrname,<br>
7198&#160;&#160;&#160;&#160;const char *enumstring<br>
7199);</p>
7200<h4 class="parameters">Parameters</h4>
7201<dl>
7202<dt>attrname</dt>
7203 <dd class="description">Attribute name</dd>
7204<dt>enumstring</dt>
7205 <dd class="description">Enum string</dd>
7206</dl>
7207<h4 class="returnvalue">Return Value</h4>
7208 <p class="description">Enum value or -1 if unknown</p>
7209<h3 class="function"><a id="ippErrorString">ippErrorString</a></h3>
7210 <p class="description">Return a name for the given status code.</p>
7211<p class="code">
7212const char *ippErrorString (<br>
7213&#160;&#160;&#160;&#160;ipp_status_t error<br>
7214);</p>
7215<h4 class="parameters">Parameters</h4>
7216<dl>
7217<dt>error</dt>
7218 <dd class="description">Error status</dd>
7219</dl>
7220<h4 class="returnvalue">Return Value</h4>
7221 <p class="description">Text string</p>
7222<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippErrorValue">ippErrorValue</a></h3>
7223 <p class="description">Return a status code for the given name.</p>
7224<p class="code">
7225ipp_status_t ippErrorValue (<br>
7226&#160;&#160;&#160;&#160;const char *name<br>
7227);</p>
7228<h4 class="parameters">Parameters</h4>
7229<dl>
7230<dt>name</dt>
7231 <dd class="description">Name</dd>
7232</dl>
7233<h4 class="returnvalue">Return Value</h4>
7234 <p class="description">IPP status code</p>
7235<h3 class="function"><a id="ippFindAttribute">ippFindAttribute</a></h3>
7236 <p class="description">Find a named attribute in a request.</p>
7237<p class="code">
7238<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindAttribute (<br>
7239&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
7240&#160;&#160;&#160;&#160;const char *name,<br>
7241&#160;&#160;&#160;&#160;ipp_tag_t type<br>
7242);</p>
7243<h4 class="parameters">Parameters</h4>
7244<dl>
7245<dt>ipp</dt>
7246 <dd class="description">IPP message</dd>
7247<dt>name</dt>
7248 <dd class="description">Name of attribute</dd>
7249<dt>type</dt>
7250 <dd class="description">Type of attribute</dd>
7251</dl>
7252<h4 class="returnvalue">Return Value</h4>
7253 <p class="description">Matching attribute</p>
7254<h4 class="discussion">Discussion</h4>
7255 <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
7256of attribute and member names separated by slashes, for example
7257&quot;media-col/media-size&quot;.</p>
7258<h3 class="function"><a id="ippFindNextAttribute">ippFindNextAttribute</a></h3>
7259 <p class="description">Find the next named attribute in a request.</p>
7260<p class="code">
7261<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindNextAttribute (<br>
7262&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
7263&#160;&#160;&#160;&#160;const char *name,<br>
7264&#160;&#160;&#160;&#160;ipp_tag_t type<br>
7265);</p>
7266<h4 class="parameters">Parameters</h4>
7267<dl>
7268<dt>ipp</dt>
7269 <dd class="description">IPP message</dd>
7270<dt>name</dt>
7271 <dd class="description">Name of attribute</dd>
7272<dt>type</dt>
7273 <dd class="description">Type of attribute</dd>
7274</dl>
7275<h4 class="returnvalue">Return Value</h4>
7276 <p class="description">Matching attribute</p>
7277<h4 class="discussion">Discussion</h4>
7278 <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
7279of attribute and member names separated by slashes, for example
7280&quot;media-col/media-size&quot;.</p>
7281<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippFirstAttribute">ippFirstAttribute</a></h3>
7282 <p class="description">Return the first attribute in the message.</p>
7283<p class="code">
7284<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFirstAttribute (<br>
7285&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
7286);</p>
7287<h4 class="parameters">Parameters</h4>
7288<dl>
7289<dt>ipp</dt>
7290 <dd class="description">IPP message</dd>
7291</dl>
7292<h4 class="returnvalue">Return Value</h4>
7293 <p class="description">First attribute or <code>NULL</code> if none</p>
7294<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetBoolean">ippGetBoolean</a></h3>
7295 <p class="description">Get a boolean value for an attribute.</p>
7296<p class="code">
7297int ippGetBoolean (<br>
7298&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
7299&#160;&#160;&#160;&#160;int element<br>
7300);</p>
7301<h4 class="parameters">Parameters</h4>
7302<dl>
7303<dt>attr</dt>
7304 <dd class="description">IPP attribute</dd>
7305<dt>element</dt>
7306 <dd class="description">Value number (0-based)</dd>
7307</dl>
7308<h4 class="returnvalue">Return Value</h4>
7309 <p class="description">Boolean value or 0 on error</p>
7310<h4 class="discussion">Discussion</h4>
7311 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
7312<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
7313
7314</p>
7315<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetCollection">ippGetCollection</a></h3>
7316 <p class="description">Get a collection value for an attribute.</p>
7317<p class="code">
7318<a href="#ipp_t">ipp_t</a> *ippGetCollection (<br>
7319&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
7320&#160;&#160;&#160;&#160;int element<br>
7321);</p>
7322<h4 class="parameters">Parameters</h4>
7323<dl>
7324<dt>attr</dt>
7325 <dd class="description">IPP attribute</dd>
7326<dt>element</dt>
7327 <dd class="description">Value number (0-based)</dd>
7328</dl>
7329<h4 class="returnvalue">Return Value</h4>
7330 <p class="description">Collection value or <code>NULL</code> on error</p>
7331<h4 class="discussion">Discussion</h4>
7332 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
7333<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
7334
7335</p>
7336<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetCount">ippGetCount</a></h3>
7337 <p class="description">Get the number of values in an attribute.</p>
7338<p class="code">
7339int ippGetCount (<br>
7340&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
7341);</p>
7342<h4 class="parameters">Parameters</h4>
7343<dl>
7344<dt>attr</dt>
7345 <dd class="description">IPP attribute</dd>
7346</dl>
7347<h4 class="returnvalue">Return Value</h4>
7348 <p class="description">Number of values or 0 on error</p>
7349<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetDate">ippGetDate</a></h3>
7350 <p class="description">Get a date value for an attribute.</p>
7351<p class="code">
7352const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippGetDate (<br>
7353&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
7354&#160;&#160;&#160;&#160;int element<br>
7355);</p>
7356<h4 class="parameters">Parameters</h4>
7357<dl>
7358<dt>attr</dt>
7359 <dd class="description">IPP attribute</dd>
7360<dt>element</dt>
7361 <dd class="description">Value number (0-based)</dd>
7362</dl>
7363<h4 class="returnvalue">Return Value</h4>
7364 <p class="description">Date value or <code>NULL</code></p>
7365<h4 class="discussion">Discussion</h4>
7366 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
7367<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
7368
7369</p>
7370<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetGroupTag">ippGetGroupTag</a></h3>
7371 <p class="description">Get the group associated with an attribute.</p>
7372<p class="code">
7373ipp_tag_t ippGetGroupTag (<br>
7374&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
7375);</p>
7376<h4 class="parameters">Parameters</h4>
7377<dl>
7378<dt>attr</dt>
7379 <dd class="description">IPP attribute</dd>
7380</dl>
7381<h4 class="returnvalue">Return Value</h4>
7382 <p class="description">Group tag or <code>IPP_TAG_ZERO</code> on error</p>
7383<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetInteger">ippGetInteger</a></h3>
7384 <p class="description">Get the integer/enum value for an attribute.</p>
7385<p class="code">
7386int ippGetInteger (<br>
7387&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
7388&#160;&#160;&#160;&#160;int element<br>
7389);</p>
7390<h4 class="parameters">Parameters</h4>
7391<dl>
7392<dt>attr</dt>
7393 <dd class="description">IPP attribute</dd>
7394<dt>element</dt>
7395 <dd class="description">Value number (0-based)</dd>
7396</dl>
7397<h4 class="returnvalue">Return Value</h4>
7398 <p class="description">Value or 0 on error</p>
7399<h4 class="discussion">Discussion</h4>
7400 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
7401<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
7402
7403</p>
7404<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetName">ippGetName</a></h3>
7405 <p class="description">Get the attribute name.</p>
7406<p class="code">
7407const char *ippGetName (<br>
7408&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
7409);</p>
7410<h4 class="parameters">Parameters</h4>
7411<dl>
7412<dt>attr</dt>
7413 <dd class="description">IPP attribute</dd>
7414</dl>
7415<h4 class="returnvalue">Return Value</h4>
7416 <p class="description">Attribute name or <code>NULL</code> for separators</p>
7417<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippGetOctetString">ippGetOctetString</a></h3>
7418 <p class="description">Get an octetString value from an IPP attribute.</p>
7419<p class="code">
7420void *ippGetOctetString (<br>
7421&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
7422&#160;&#160;&#160;&#160;int element,<br>
7423&#160;&#160;&#160;&#160;int *datalen<br>
7424);</p>
7425<h4 class="parameters">Parameters</h4>
7426<dl>
7427<dt>attr</dt>
7428 <dd class="description">IPP attribute</dd>
7429<dt>element</dt>
7430 <dd class="description">Value number (0-based)</dd>
7431<dt>datalen</dt>
7432 <dd class="description">Length of octetString data</dd>
7433</dl>
7434<h4 class="returnvalue">Return Value</h4>
7435 <p class="description">Pointer to octetString data</p>
7436<h4 class="discussion">Discussion</h4>
7437 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
7438<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
7439
7440</p>
7441<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetOperation">ippGetOperation</a></h3>
7442 <p class="description">Get the operation ID in an IPP message.</p>
7443<p class="code">
7444ipp_op_t ippGetOperation (<br>
7445&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
7446);</p>
7447<h4 class="parameters">Parameters</h4>
7448<dl>
7449<dt>ipp</dt>
7450 <dd class="description">IPP request message</dd>
7451</dl>
7452<h4 class="returnvalue">Return Value</h4>
7453 <p class="description">Operation ID or 0 on error</p>
7454<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetRange">ippGetRange</a></h3>
7455 <p class="description">Get a rangeOfInteger value from an attribute.</p>
7456<p class="code">
7457int ippGetRange (<br>
7458&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
7459&#160;&#160;&#160;&#160;int element,<br>
7460&#160;&#160;&#160;&#160;int *uppervalue<br>
7461);</p>
7462<h4 class="parameters">Parameters</h4>
7463<dl>
7464<dt>attr</dt>
7465 <dd class="description">IPP attribute</dd>
7466<dt>element</dt>
7467 <dd class="description">Value number (0-based)</dd>
7468<dt>uppervalue</dt>
7469 <dd class="description">Upper value of range</dd>
7470</dl>
7471<h4 class="returnvalue">Return Value</h4>
7472 <p class="description">Lower value of range or 0</p>
7473<h4 class="discussion">Discussion</h4>
7474 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
7475<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
7476
7477</p>
7478<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetRequestId">ippGetRequestId</a></h3>
7479 <p class="description">Get the request ID from an IPP message.</p>
7480<p class="code">
7481int ippGetRequestId (<br>
7482&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
7483);</p>
7484<h4 class="parameters">Parameters</h4>
7485<dl>
7486<dt>ipp</dt>
7487 <dd class="description">IPP message</dd>
7488</dl>
7489<h4 class="returnvalue">Return Value</h4>
7490 <p class="description">Request ID or 0 on error</p>
7491<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetResolution">ippGetResolution</a></h3>
7492 <p class="description">Get a resolution value for an attribute.</p>
7493<p class="code">
7494int ippGetResolution (<br>
7495&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
7496&#160;&#160;&#160;&#160;int element,<br>
7497&#160;&#160;&#160;&#160;int *yres,<br>
7498&#160;&#160;&#160;&#160;<a href="#ipp_res_t">ipp_res_t</a> *units<br>
7499);</p>
7500<h4 class="parameters">Parameters</h4>
7501<dl>
7502<dt>attr</dt>
7503 <dd class="description">IPP attribute</dd>
7504<dt>element</dt>
7505 <dd class="description">Value number (0-based)</dd>
7506<dt>yres</dt>
7507 <dd class="description">Vertical/feed resolution</dd>
7508<dt>units</dt>
7509 <dd class="description">Units for resolution</dd>
7510</dl>
7511<h4 class="returnvalue">Return Value</h4>
7512 <p class="description">Horizontal/cross feed resolution or 0</p>
7513<h4 class="discussion">Discussion</h4>
7514 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
7515<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
7516
7517</p>
7518<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetState">ippGetState</a></h3>
7519 <p class="description">Get the IPP message state.</p>
7520<p class="code">
7521<a href="#ipp_state_t">ipp_state_t</a> ippGetState (<br>
7522&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
7523);</p>
7524<h4 class="parameters">Parameters</h4>
7525<dl>
7526<dt>ipp</dt>
7527 <dd class="description">IPP message</dd>
7528</dl>
7529<h4 class="returnvalue">Return Value</h4>
7530 <p class="description">IPP message state value</p>
7531<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetStatusCode">ippGetStatusCode</a></h3>
7532 <p class="description">Get the status code from an IPP response or event message.</p>
7533<p class="code">
7534ipp_status_t ippGetStatusCode (<br>
7535&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
7536);</p>
7537<h4 class="parameters">Parameters</h4>
7538<dl>
7539<dt>ipp</dt>
7540 <dd class="description">IPP response or event message</dd>
7541</dl>
7542<h4 class="returnvalue">Return Value</h4>
7543 <p class="description">Status code in IPP message</p>
7544<h3 class="function"><a id="ippGetString">ippGetString</a></h3>
7545 <p class="description">Return the value...</p>
7546<p class="code">
7547const char *ippGetString (<br>
7548&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
7549&#160;&#160;&#160;&#160;int element,<br>
7550&#160;&#160;&#160;&#160;const char **language<br>
7551);</p>
7552<h4 class="parameters">Parameters</h4>
7553<dl>
7554<dt>attr</dt>
7555 <dd class="description">IPP attribute</dd>
7556<dt>element</dt>
7557 <dd class="description">Value number (0-based)</dd>
7558<dt>language</dt>
7559 <dd class="description">Language code (<code>NULL</code> for don't care)</dd>
7560</dl>
7561<h4 class="returnvalue">Return Value</h4>
7562 <p class="description">Get the string and optionally the language code for an attribute.</p>
7563 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
7564<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
7565
7566</p>
7567<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetValueTag">ippGetValueTag</a></h3>
7568 <p class="description">Get the value tag for an attribute.</p>
7569<p class="code">
7570ipp_tag_t ippGetValueTag (<br>
7571&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
7572);</p>
7573<h4 class="parameters">Parameters</h4>
7574<dl>
7575<dt>attr</dt>
7576 <dd class="description">IPP attribute</dd>
7577</dl>
7578<h4 class="returnvalue">Return Value</h4>
7579 <p class="description">Value tag or <code>IPP_TAG_ZERO</code> on error</p>
7580<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippGetVersion">ippGetVersion</a></h3>
7581 <p class="description">Get the major and minor version number from an IPP message.</p>
7582<p class="code">
7583int ippGetVersion (<br>
7584&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
7585&#160;&#160;&#160;&#160;int *minor<br>
7586);</p>
7587<h4 class="parameters">Parameters</h4>
7588<dl>
7589<dt>ipp</dt>
7590 <dd class="description">IPP message</dd>
7591<dt>minor</dt>
7592 <dd class="description">Minor version number or <code>NULL</code></dd>
7593</dl>
7594<h4 class="returnvalue">Return Value</h4>
7595 <p class="description">Major version number or 0 on error</p>
7596<h3 class="function"><a id="ippLength">ippLength</a></h3>
7597 <p class="description">Compute the length of an IPP message.</p>
7598<p class="code">
7599size_t ippLength (<br>
7600&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
7601);</p>
7602<h4 class="parameters">Parameters</h4>
7603<dl>
7604<dt>ipp</dt>
7605 <dd class="description">IPP message</dd>
7606</dl>
7607<h4 class="returnvalue">Return Value</h4>
7608 <p class="description">Size of IPP message</p>
7609<h3 class="function"><a id="ippNew">ippNew</a></h3>
7610 <p class="description">Allocate a new IPP message.</p>
7611<p class="code">
7612<a href="#ipp_t">ipp_t</a> *ippNew (void);</p>
7613<h4 class="returnvalue">Return Value</h4>
7614 <p class="description">New IPP message</p>
7615<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippNewRequest">ippNewRequest</a></h3>
7616 <p class="description">Allocate a new IPP request message.</p>
7617<p class="code">
7618<a href="#ipp_t">ipp_t</a> *ippNewRequest (<br>
7619&#160;&#160;&#160;&#160;ipp_op_t op<br>
7620);</p>
7621<h4 class="parameters">Parameters</h4>
7622<dl>
7623<dt>op</dt>
7624 <dd class="description">Operation code</dd>
7625</dl>
7626<h4 class="returnvalue">Return Value</h4>
7627 <p class="description">IPP request message</p>
7628<h4 class="discussion">Discussion</h4>
7629 <p class="discussion">The new request message is initialized with the attributes-charset and
7630attributes-natural-language attributes added. The
7631attributes-natural-language value is derived from the current locale.
7632
7633</p>
7634<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippNewResponse">ippNewResponse</a></h3>
7635 <p class="description">Allocate a new IPP response message.</p>
7636<p class="code">
7637<a href="#ipp_t">ipp_t</a> *ippNewResponse (<br>
7638&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *request<br>
7639);</p>
7640<h4 class="parameters">Parameters</h4>
7641<dl>
7642<dt>request</dt>
7643 <dd class="description">IPP request message</dd>
7644</dl>
7645<h4 class="returnvalue">Return Value</h4>
7646 <p class="description">IPP response message</p>
7647<h4 class="discussion">Discussion</h4>
7648 <p class="discussion">The new response message is initialized with the same version-number,
7649request-id, attributes-charset, and attributes-natural-language as the
7650provided request message. If the attributes-charset or
7651attributes-natural-language attributes are missing from the request,
7652&quot;utf-8&quot; and a value derived from the current locale are substituted,
7653respectively.
7654
7655</p>
7656<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippNextAttribute">ippNextAttribute</a></h3>
7657 <p class="description">Return the next attribute in the message.</p>
7658<p class="code">
7659<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippNextAttribute (<br>
7660&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
7661);</p>
7662<h4 class="parameters">Parameters</h4>
7663<dl>
7664<dt>ipp</dt>
7665 <dd class="description">IPP message</dd>
7666</dl>
7667<h4 class="returnvalue">Return Value</h4>
7668 <p class="description">Next attribute or <code>NULL</code> if none</p>
7669<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippOpString">ippOpString</a></h3>
7670 <p class="description">Return a name for the given operation id.</p>
7671<p class="code">
7672const char *ippOpString (<br>
7673&#160;&#160;&#160;&#160;ipp_op_t op<br>
7674);</p>
7675<h4 class="parameters">Parameters</h4>
7676<dl>
7677<dt>op</dt>
7678 <dd class="description">Operation ID</dd>
7679</dl>
7680<h4 class="returnvalue">Return Value</h4>
7681 <p class="description">Name</p>
7682<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippOpValue">ippOpValue</a></h3>
7683 <p class="description">Return an operation id for the given name.</p>
7684<p class="code">
7685ipp_op_t ippOpValue (<br>
7686&#160;&#160;&#160;&#160;const char *name<br>
7687);</p>
7688<h4 class="parameters">Parameters</h4>
7689<dl>
7690<dt>name</dt>
7691 <dd class="description">Textual name</dd>
7692</dl>
7693<h4 class="returnvalue">Return Value</h4>
7694 <p class="description">Operation ID</p>
7695<h3 class="function"><a id="ippPort">ippPort</a></h3>
7696 <p class="description">Return the default IPP port number.</p>
7697<p class="code">
7698int ippPort (void);</p>
7699<h4 class="returnvalue">Return Value</h4>
7700 <p class="description">Port number</p>
7701<h3 class="function"><a id="ippRead">ippRead</a></h3>
7702 <p class="description">Read data for an IPP message from a HTTP connection.</p>
7703<p class="code">
7704<a href="#ipp_state_t">ipp_state_t</a> ippRead (<br>
7705&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
7706&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
7707);</p>
7708<h4 class="parameters">Parameters</h4>
7709<dl>
7710<dt>http</dt>
7711 <dd class="description">HTTP connection</dd>
7712<dt>ipp</dt>
7713 <dd class="description">IPP data</dd>
7714</dl>
7715<h4 class="returnvalue">Return Value</h4>
7716 <p class="description">Current state</p>
7717<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippReadFile">ippReadFile</a></h3>
7718 <p class="description">Read data for an IPP message from a file.</p>
7719<p class="code">
7720<a href="#ipp_state_t">ipp_state_t</a> ippReadFile (<br>
7721&#160;&#160;&#160;&#160;int fd,<br>
7722&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
7723);</p>
7724<h4 class="parameters">Parameters</h4>
7725<dl>
7726<dt>fd</dt>
7727 <dd class="description">HTTP data</dd>
7728<dt>ipp</dt>
7729 <dd class="description">IPP data</dd>
7730</dl>
7731<h4 class="returnvalue">Return Value</h4>
7732 <p class="description">Current state</p>
7733<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippReadIO">ippReadIO</a></h3>
7734 <p class="description">Read data for an IPP message.</p>
7735<p class="code">
7736<a href="#ipp_state_t">ipp_state_t</a> ippReadIO (<br>
7737&#160;&#160;&#160;&#160;void *src,<br>
7738&#160;&#160;&#160;&#160;<a href="#ipp_iocb_t">ipp_iocb_t</a> cb,<br>
7739&#160;&#160;&#160;&#160;int blocking,<br>
7740&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *parent,<br>
7741&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
7742);</p>
7743<h4 class="parameters">Parameters</h4>
7744<dl>
7745<dt>src</dt>
7746 <dd class="description">Data source</dd>
7747<dt>cb</dt>
7748 <dd class="description">Read callback function</dd>
7749<dt>blocking</dt>
7750 <dd class="description">Use blocking IO?</dd>
7751<dt>parent</dt>
7752 <dd class="description">Parent request, if any</dd>
7753<dt>ipp</dt>
7754 <dd class="description">IPP data</dd>
7755</dl>
7756<h4 class="returnvalue">Return Value</h4>
7757 <p class="description">Current state</p>
7758<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetBoolean">ippSetBoolean</a></h3>
7759 <p class="description">Set a boolean value in an attribute.</p>
7760<p class="code">
7761int ippSetBoolean (<br>
7762&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
7763&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
7764&#160;&#160;&#160;&#160;int element,<br>
7765&#160;&#160;&#160;&#160;int boolvalue<br>
7766);</p>
7767<h4 class="parameters">Parameters</h4>
7768<dl>
7769<dt>ipp</dt>
7770 <dd class="description">IPP message</dd>
7771<dt>attr</dt>
7772 <dd class="description">IPP attribute</dd>
7773<dt>element</dt>
7774 <dd class="description">Value number (0-based)</dd>
7775<dt>boolvalue</dt>
7776 <dd class="description">Boolean value</dd>
7777</dl>
7778<h4 class="returnvalue">Return Value</h4>
7779 <p class="description">1 on success, 0 on failure</p>
7780<h4 class="discussion">Discussion</h4>
7781 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
7782the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
7783<br>
7784The <code>attr</code> parameter may be modified as a result of setting the value.<br>
7785<br>
7786The <code>element</code> parameter specifies which value to set from 0 to
7787<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
7788
7789</p>
7790<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetCollection">ippSetCollection</a></h3>
7791 <p class="description">Set a collection value in an attribute.</p>
7792<p class="code">
7793int ippSetCollection (<br>
7794&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
7795&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
7796&#160;&#160;&#160;&#160;int element,<br>
7797&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *colvalue<br>
7798);</p>
7799<h4 class="parameters">Parameters</h4>
7800<dl>
7801<dt>ipp</dt>
7802 <dd class="description">IPP message</dd>
7803<dt>attr</dt>
7804 <dd class="description">IPP attribute</dd>
7805<dt>element</dt>
7806 <dd class="description">Value number (0-based)</dd>
7807<dt>colvalue</dt>
7808 <dd class="description">Collection value</dd>
7809</dl>
7810<h4 class="returnvalue">Return Value</h4>
7811 <p class="description">1 on success, 0 on failure</p>
7812<h4 class="discussion">Discussion</h4>
7813 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
7814the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
7815<br>
7816The <code>attr</code> parameter may be modified as a result of setting the value.<br>
7817<br>
7818The <code>element</code> parameter specifies which value to set from 0 to
7819<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
7820
7821</p>
7822<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetDate">ippSetDate</a></h3>
7823 <p class="description">Set a date value in an attribute.</p>
7824<p class="code">
7825int ippSetDate (<br>
7826&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
7827&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
7828&#160;&#160;&#160;&#160;int element,<br>
7829&#160;&#160;&#160;&#160;const <a href="#ipp_uchar_t">ipp_uchar_t</a> *datevalue<br>
7830);</p>
7831<h4 class="parameters">Parameters</h4>
7832<dl>
7833<dt>ipp</dt>
7834 <dd class="description">IPP message</dd>
7835<dt>attr</dt>
7836 <dd class="description">IPP attribute</dd>
7837<dt>element</dt>
7838 <dd class="description">Value number (0-based)</dd>
7839<dt>datevalue</dt>
7840 <dd class="description">Date value</dd>
7841</dl>
7842<h4 class="returnvalue">Return Value</h4>
7843 <p class="description">1 on success, 0 on failure</p>
7844<h4 class="discussion">Discussion</h4>
7845 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
7846the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
7847<br>
7848The <code>attr</code> parameter may be modified as a result of setting the value.<br>
7849<br>
7850The <code>element</code> parameter specifies which value to set from 0 to
7851<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
7852
7853</p>
7854<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetGroupTag">ippSetGroupTag</a></h3>
7855 <p class="description">Set the group tag of an attribute.</p>
7856<p class="code">
7857int ippSetGroupTag (<br>
7858&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
7859&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
7860&#160;&#160;&#160;&#160;ipp_tag_t group_tag<br>
7861);</p>
7862<h4 class="parameters">Parameters</h4>
7863<dl>
7864<dt>ipp</dt>
7865 <dd class="description">IPP message</dd>
7866<dt>attr</dt>
7867 <dd class="description">Attribute</dd>
7868<dt>group_tag</dt>
7869 <dd class="description">Group tag</dd>
7870</dl>
7871<h4 class="returnvalue">Return Value</h4>
7872 <p class="description">1 on success, 0 on failure</p>
7873<h4 class="discussion">Discussion</h4>
7874 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
7875the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
7876<br>
7877The <code>attr</code> parameter may be modified as a result of setting the value.<br>
7878<br>
7879The <code>group</code> parameter specifies the IPP attribute group tag: none
7880(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
7881event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
7882(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
7883(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
7884
7885</p>
7886<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetInteger">ippSetInteger</a></h3>
7887 <p class="description">Set an integer or enum value in an attribute.</p>
7888<p class="code">
7889int ippSetInteger (<br>
7890&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
7891&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
7892&#160;&#160;&#160;&#160;int element,<br>
7893&#160;&#160;&#160;&#160;int intvalue<br>
7894);</p>
7895<h4 class="parameters">Parameters</h4>
7896<dl>
7897<dt>ipp</dt>
7898 <dd class="description">IPP message</dd>
7899<dt>attr</dt>
7900 <dd class="description">IPP attribute</dd>
7901<dt>element</dt>
7902 <dd class="description">Value number (0-based)</dd>
7903<dt>intvalue</dt>
7904 <dd class="description">Integer/enum value</dd>
7905</dl>
7906<h4 class="returnvalue">Return Value</h4>
7907 <p class="description">1 on success, 0 on failure</p>
7908<h4 class="discussion">Discussion</h4>
7909 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
7910the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
7911<br>
7912The <code>attr</code> parameter may be modified as a result of setting the value.<br>
7913<br>
7914The <code>element</code> parameter specifies which value to set from 0 to
7915<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
7916
7917</p>
7918<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetName">ippSetName</a></h3>
7919 <p class="description">Set the name of an attribute.</p>
7920<p class="code">
7921int ippSetName (<br>
7922&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
7923&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
7924&#160;&#160;&#160;&#160;const char *name<br>
7925);</p>
7926<h4 class="parameters">Parameters</h4>
7927<dl>
7928<dt>ipp</dt>
7929 <dd class="description">IPP message</dd>
7930<dt>attr</dt>
7931 <dd class="description">IPP attribute</dd>
7932<dt>name</dt>
7933 <dd class="description">Attribute name</dd>
7934</dl>
7935<h4 class="returnvalue">Return Value</h4>
7936 <p class="description">1 on success, 0 on failure</p>
7937<h4 class="discussion">Discussion</h4>
7938 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
7939the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
7940<br>
7941The <code>attr</code> parameter may be modified as a result of setting the value.
7942
7943</p>
7944<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetOctetString">ippSetOctetString</a></h3>
7945 <p class="description">Set an octetString value in an IPP attribute.</p>
7946<p class="code">
7947int ippSetOctetString (<br>
7948&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
7949&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
7950&#160;&#160;&#160;&#160;int element,<br>
7951&#160;&#160;&#160;&#160;const void *data,<br>
7952&#160;&#160;&#160;&#160;int datalen<br>
7953);</p>
7954<h4 class="parameters">Parameters</h4>
7955<dl>
7956<dt>ipp</dt>
7957 <dd class="description">IPP message</dd>
7958<dt>attr</dt>
7959 <dd class="description">IPP attribute</dd>
7960<dt>element</dt>
7961 <dd class="description">Value number (0-based)</dd>
7962<dt>data</dt>
7963 <dd class="description">Pointer to octetString data</dd>
7964<dt>datalen</dt>
7965 <dd class="description">Length of octetString data</dd>
7966</dl>
7967<h4 class="returnvalue">Return Value</h4>
7968 <p class="description">1 on success, 0 on failure</p>
7969<h4 class="discussion">Discussion</h4>
7970 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
7971the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
7972<br>
7973The <code>attr</code> parameter may be modified as a result of setting the value.<br>
7974<br>
7975The <code>element</code> parameter specifies which value to set from 0 to
7976<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
7977
7978</p>
7979<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetOperation">ippSetOperation</a></h3>
7980 <p class="description">Set the operation ID in an IPP request message.</p>
7981<p class="code">
7982int ippSetOperation (<br>
7983&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
7984&#160;&#160;&#160;&#160;ipp_op_t op<br>
7985);</p>
7986<h4 class="parameters">Parameters</h4>
7987<dl>
7988<dt>ipp</dt>
7989 <dd class="description">IPP request message</dd>
7990<dt>op</dt>
7991 <dd class="description">Operation ID</dd>
7992</dl>
7993<h4 class="returnvalue">Return Value</h4>
7994 <p class="description">1 on success, 0 on failure</p>
7995<h4 class="discussion">Discussion</h4>
7996 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
7997the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
7998
7999</p>
8000<h3 class="function"><a id="ippSetPort">ippSetPort</a></h3>
8001 <p class="description">Set the default port number.</p>
8002<p class="code">
8003void ippSetPort (<br>
8004&#160;&#160;&#160;&#160;int p<br>
8005);</p>
8006<h4 class="parameters">Parameters</h4>
8007<dl>
8008<dt>p</dt>
8009 <dd class="description">Port number to use</dd>
8010</dl>
8011<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetRange">ippSetRange</a></h3>
8012 <p class="description">Set a rangeOfInteger value in an attribute.</p>
8013<p class="code">
8014int ippSetRange (<br>
8015&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
8016&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
8017&#160;&#160;&#160;&#160;int element,<br>
8018&#160;&#160;&#160;&#160;int lowervalue,<br>
8019&#160;&#160;&#160;&#160;int uppervalue<br>
8020);</p>
8021<h4 class="parameters">Parameters</h4>
8022<dl>
8023<dt>ipp</dt>
8024 <dd class="description">IPP message</dd>
8025<dt>attr</dt>
8026 <dd class="description">IPP attribute</dd>
8027<dt>element</dt>
8028 <dd class="description">Value number (0-based)</dd>
8029<dt>lowervalue</dt>
8030 <dd class="description">Lower bound for range</dd>
8031<dt>uppervalue</dt>
8032 <dd class="description">Upper bound for range</dd>
8033</dl>
8034<h4 class="returnvalue">Return Value</h4>
8035 <p class="description">1 on success, 0 on failure</p>
8036<h4 class="discussion">Discussion</h4>
8037 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
8038the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
8039<br>
8040The <code>attr</code> parameter may be modified as a result of setting the value.<br>
8041<br>
8042The <code>element</code> parameter specifies which value to set from 0 to
8043<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
8044
8045</p>
8046<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetRequestId">ippSetRequestId</a></h3>
8047 <p class="description">Set the request ID in an IPP message.</p>
8048<p class="code">
8049int ippSetRequestId (<br>
8050&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
8051&#160;&#160;&#160;&#160;int request_id<br>
8052);</p>
8053<h4 class="parameters">Parameters</h4>
8054<dl>
8055<dt>ipp</dt>
8056 <dd class="description">IPP message</dd>
8057<dt>request_id</dt>
8058 <dd class="description">Request ID</dd>
8059</dl>
8060<h4 class="returnvalue">Return Value</h4>
8061 <p class="description">1 on success, 0 on failure</p>
8062<h4 class="discussion">Discussion</h4>
8063 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
8064the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
8065<br>
8066The <code>request_id</code> parameter must be greater than 0.
8067
8068</p>
8069<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetResolution">ippSetResolution</a></h3>
8070 <p class="description">Set a resolution value in an attribute.</p>
8071<p class="code">
8072int ippSetResolution (<br>
8073&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
8074&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
8075&#160;&#160;&#160;&#160;int element,<br>
8076&#160;&#160;&#160;&#160;<a href="#ipp_res_t">ipp_res_t</a> unitsvalue,<br>
8077&#160;&#160;&#160;&#160;int xresvalue,<br>
8078&#160;&#160;&#160;&#160;int yresvalue<br>
8079);</p>
8080<h4 class="parameters">Parameters</h4>
8081<dl>
8082<dt>ipp</dt>
8083 <dd class="description">IPP message</dd>
8084<dt>attr</dt>
8085 <dd class="description">IPP attribute</dd>
8086<dt>element</dt>
8087 <dd class="description">Value number (0-based)</dd>
8088<dt>unitsvalue</dt>
8089 <dd class="description">Resolution units</dd>
8090<dt>xresvalue</dt>
8091 <dd class="description">Horizontal/cross feed resolution</dd>
8092<dt>yresvalue</dt>
8093 <dd class="description">Vertical/feed resolution</dd>
8094</dl>
8095<h4 class="returnvalue">Return Value</h4>
8096 <p class="description">1 on success, 0 on failure</p>
8097<h4 class="discussion">Discussion</h4>
8098 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
8099the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
8100<br>
8101The <code>attr</code> parameter may be modified as a result of setting the value.<br>
8102<br>
8103The <code>element</code> parameter specifies which value to set from 0 to
8104<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
8105
8106</p>
8107<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetState">ippSetState</a></h3>
8108 <p class="description">Set the current state of the IPP message.</p>
8109<p class="code">
8110int ippSetState (<br>
8111&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
8112&#160;&#160;&#160;&#160;<a href="#ipp_state_t">ipp_state_t</a> state<br>
8113);</p>
8114<h4 class="parameters">Parameters</h4>
8115<dl>
8116<dt>ipp</dt>
8117 <dd class="description">IPP message</dd>
8118<dt>state</dt>
8119 <dd class="description">IPP state value</dd>
8120</dl>
8121<h4 class="returnvalue">Return Value</h4>
8122 <p class="description">1 on success, 0 on failure</p>
8123<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetStatusCode">ippSetStatusCode</a></h3>
8124 <p class="description">Set the status code in an IPP response or event message.</p>
8125<p class="code">
8126int ippSetStatusCode (<br>
8127&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
8128&#160;&#160;&#160;&#160;ipp_status_t status<br>
8129);</p>
8130<h4 class="parameters">Parameters</h4>
8131<dl>
8132<dt>ipp</dt>
8133 <dd class="description">IPP response or event message</dd>
8134<dt>status</dt>
8135 <dd class="description">Status code</dd>
8136</dl>
8137<h4 class="returnvalue">Return Value</h4>
8138 <p class="description">1 on success, 0 on failure</p>
8139<h4 class="discussion">Discussion</h4>
8140 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
8141the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
8142
8143</p>
8144<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetString">ippSetString</a></h3>
8145 <p class="description">Set a string value in an attribute.</p>
8146<p class="code">
8147int ippSetString (<br>
8148&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
8149&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
8150&#160;&#160;&#160;&#160;int element,<br>
8151&#160;&#160;&#160;&#160;const char *strvalue<br>
8152);</p>
8153<h4 class="parameters">Parameters</h4>
8154<dl>
8155<dt>ipp</dt>
8156 <dd class="description">IPP message</dd>
8157<dt>attr</dt>
8158 <dd class="description">IPP attribute</dd>
8159<dt>element</dt>
8160 <dd class="description">Value number (0-based)</dd>
8161<dt>strvalue</dt>
8162 <dd class="description">String value</dd>
8163</dl>
8164<h4 class="returnvalue">Return Value</h4>
8165 <p class="description">1 on success, 0 on failure</p>
8166<h4 class="discussion">Discussion</h4>
8167 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
8168the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
8169<br>
8170The <code>attr</code> parameter may be modified as a result of setting the value.<br>
8171<br>
8172The <code>element</code> parameter specifies which value to set from 0 to
8173<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
8174
8175</p>
8176<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetStringf">ippSetStringf</a></h3>
8177 <p class="description">Set a formatted string value of an attribute.</p>
8178<p class="code">
8179int ippSetStringf (<br>
8180&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
8181&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
8182&#160;&#160;&#160;&#160;int element,<br>
8183&#160;&#160;&#160;&#160;const char *format,<br>
8184&#160;&#160;&#160;&#160;...<br>
8185);</p>
8186<h4 class="parameters">Parameters</h4>
8187<dl>
8188<dt>ipp</dt>
8189 <dd class="description">IPP message</dd>
8190<dt>attr</dt>
8191 <dd class="description">IPP attribute</dd>
8192<dt>element</dt>
8193 <dd class="description">Value number (0-based)</dd>
8194<dt>format</dt>
8195 <dd class="description">Printf-style format string</dd>
8196<dt>...</dt>
8197 <dd class="description">Additional arguments as needed</dd>
8198</dl>
8199<h4 class="returnvalue">Return Value</h4>
8200 <p class="description">1 on success, 0 on failure</p>
8201<h4 class="discussion">Discussion</h4>
8202 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
8203the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
8204<br>
8205The <code>attr</code> parameter may be modified as a result of setting the value.<br>
8206<br>
8207The <code>element</code> parameter specifies which value to set from 0 to
8208<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.<br>
8209<br>
8210The <code>format</code> parameter uses formatting characters compatible with the
8211printf family of standard functions. Additional arguments follow it as
8212needed. The formatted string is truncated as needed to the maximum length of
8213the corresponding value type.
8214
8215</p>
8216<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippSetStringfv">ippSetStringfv</a></h3>
8217 <p class="description">Set a formatted string value of an attribute.</p>
8218<p class="code">
8219int ippSetStringfv (<br>
8220&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
8221&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
8222&#160;&#160;&#160;&#160;int element,<br>
8223&#160;&#160;&#160;&#160;const char *format,<br>
8224&#160;&#160;&#160;&#160;va_list ap<br>
8225);</p>
8226<h4 class="parameters">Parameters</h4>
8227<dl>
8228<dt>ipp</dt>
8229 <dd class="description">IPP message</dd>
8230<dt>attr</dt>
8231 <dd class="description">IPP attribute</dd>
8232<dt>element</dt>
8233 <dd class="description">Value number (0-based)</dd>
8234<dt>format</dt>
8235 <dd class="description">Printf-style format string</dd>
8236<dt>ap</dt>
8237 <dd class="description">Pointer to additional arguments</dd>
8238</dl>
8239<h4 class="returnvalue">Return Value</h4>
8240 <p class="description">1 on success, 0 on failure</p>
8241<h4 class="discussion">Discussion</h4>
8242 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
8243the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
8244<br>
8245The <code>attr</code> parameter may be modified as a result of setting the value.<br>
8246<br>
8247The <code>element</code> parameter specifies which value to set from 0 to
8248<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.<br>
8249<br>
8250The <code>format</code> parameter uses formatting characters compatible with the
8251printf family of standard functions. Additional arguments follow it as
8252needed. The formatted string is truncated as needed to the maximum length of
8253the corresponding value type.
8254
8255</p>
8256<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetValueTag">ippSetValueTag</a></h3>
8257 <p class="description">Set the value tag of an attribute.</p>
8258<p class="code">
8259int ippSetValueTag (<br>
8260&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
8261&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
8262&#160;&#160;&#160;&#160;ipp_tag_t value_tag<br>
8263);</p>
8264<h4 class="parameters">Parameters</h4>
8265<dl>
8266<dt>ipp</dt>
8267 <dd class="description">IPP message</dd>
8268<dt>attr</dt>
8269 <dd class="description">IPP attribute</dd>
8270<dt>value_tag</dt>
8271 <dd class="description">Value tag</dd>
8272</dl>
8273<h4 class="returnvalue">Return Value</h4>
8274 <p class="description">1 on success, 0 on failure</p>
8275<h4 class="discussion">Discussion</h4>
8276 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
8277the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
8278<br>
8279The <code>attr</code> parameter may be modified as a result of setting the value.<br>
8280<br>
8281Integer (<code>IPP_TAG_INTEGER</code>) values can be promoted to rangeOfInteger
8282(<code>IPP_TAG_RANGE</code>) values, the various string tags can be promoted to name
8283(<code>IPP_TAG_NAME</code>) or nameWithLanguage (<code>IPP_TAG_NAMELANG</code>) values, text
8284(<code>IPP_TAG_TEXT</code>) values can be promoted to textWithLanguage
8285(<code>IPP_TAG_TEXTLANG</code>) values, and all values can be demoted to the various
8286out-of-band value tags such as no-value (<code>IPP_TAG_NOVALUE</code>). All other changes
8287will be rejected.<br>
8288<br>
8289Promoting a string attribute to nameWithLanguage or textWithLanguage adds the language
8290code in the &quot;attributes-natural-language&quot; attribute or, if not present, the language
8291code for the current locale.
8292
8293</p>
8294<h3 class="function"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span><a id="ippSetVersion">ippSetVersion</a></h3>
8295 <p class="description">Set the version number in an IPP message.</p>
8296<p class="code">
8297int ippSetVersion (<br>
8298&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp,<br>
8299&#160;&#160;&#160;&#160;int major,<br>
8300&#160;&#160;&#160;&#160;int minor<br>
8301);</p>
8302<h4 class="parameters">Parameters</h4>
8303<dl>
8304<dt>ipp</dt>
8305 <dd class="description">IPP message</dd>
8306<dt>major</dt>
8307 <dd class="description">Major version number (major.minor)</dd>
8308<dt>minor</dt>
8309 <dd class="description">Minor version number (major.minor)</dd>
8310</dl>
8311<h4 class="returnvalue">Return Value</h4>
8312 <p class="description">1 on success, 0 on failure</p>
8313<h4 class="discussion">Discussion</h4>
8314 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
8315the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
8316<br>
8317The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2.
8318
8319</p>
8320<h3 class="function"><span class="info">&#160;CUPS 2.0/OS 10.10&#160;</span><a id="ippStateString">ippStateString</a></h3>
8321 <p class="description">Return the name corresponding to a state value.</p>
8322<p class="code">
8323const char *ippStateString (<br>
8324&#160;&#160;&#160;&#160;<a href="#ipp_state_t">ipp_state_t</a> state<br>
8325);</p>
8326<h4 class="parameters">Parameters</h4>
8327<dl>
8328<dt>state</dt>
8329 <dd class="description">State value</dd>
8330</dl>
8331<h4 class="returnvalue">Return Value</h4>
8332 <p class="description">State name</p>
8333<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="ippTagString">ippTagString</a></h3>
8334 <p class="description">Return the tag name corresponding to a tag value.</p>
8335<p class="code">
8336const char *ippTagString (<br>
8337&#160;&#160;&#160;&#160;ipp_tag_t tag<br>
8338);</p>
8339<h4 class="parameters">Parameters</h4>
8340<dl>
8341<dt>tag</dt>
8342 <dd class="description">Tag value</dd>
8343</dl>
8344<h4 class="returnvalue">Return Value</h4>
8345 <p class="description">Tag name</p>
8346<h4 class="discussion">Discussion</h4>
8347 <p class="discussion">The returned names are defined in RFC 2911 and 3382.
8348
8349</p>
8350<h3 class="function"><span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span><a id="ippTagValue">ippTagValue</a></h3>
8351 <p class="description">Return the tag value corresponding to a tag name.</p>
8352<p class="code">
8353ipp_tag_t ippTagValue (<br>
8354&#160;&#160;&#160;&#160;const char *name<br>
8355);</p>
8356<h4 class="parameters">Parameters</h4>
8357<dl>
8358<dt>name</dt>
8359 <dd class="description">Tag name</dd>
8360</dl>
8361<h4 class="returnvalue">Return Value</h4>
8362 <p class="description">Tag value</p>
8363<h4 class="discussion">Discussion</h4>
8364 <p class="discussion">The tag names are defined in RFC 2911 and 3382.
8365
8366</p>
8367<h3 class="function"><a id="ippTimeToDate">ippTimeToDate</a></h3>
8368 <p class="description">Convert from UNIX time to RFC 1903 format.</p>
8369<p class="code">
8370const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippTimeToDate (<br>
8371&#160;&#160;&#160;&#160;time_t t<br>
8372);</p>
8373<h4 class="parameters">Parameters</h4>
8374<dl>
8375<dt>t</dt>
8376 <dd class="description">UNIX time value</dd>
8377</dl>
8378<h4 class="returnvalue">Return Value</h4>
8379 <p class="description">RFC-1903 date/time data</p>
8380<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippValidateAttribute">ippValidateAttribute</a></h3>
8381 <p class="description">Validate the contents of an attribute.</p>
8382<p class="code">
8383int ippValidateAttribute (<br>
8384&#160;&#160;&#160;&#160;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
8385);</p>
8386<h4 class="parameters">Parameters</h4>
8387<dl>
8388<dt>attr</dt>
8389 <dd class="description">Attribute</dd>
8390</dl>
8391<h4 class="returnvalue">Return Value</h4>
8392 <p class="description">1 if valid, 0 otherwise</p>
8393<h4 class="discussion">Discussion</h4>
8394 <p class="discussion">This function validates the contents of an attribute based on the name and
8395value tag. 1 is returned if the attribute is valid, 0 otherwise. On
8396failure, cupsLastErrorString() is set to a human-readable message.
8397
8398</p>
8399<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="ippValidateAttributes">ippValidateAttributes</a></h3>
8400 <p class="description">Validate all attributes in an IPP message.</p>
8401<p class="code">
8402int ippValidateAttributes (<br>
8403&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
8404);</p>
8405<h4 class="parameters">Parameters</h4>
8406<dl>
8407<dt>ipp</dt>
8408 <dd class="description">IPP message</dd>
8409</dl>
8410<h4 class="returnvalue">Return Value</h4>
8411 <p class="description">1 if valid, 0 otherwise</p>
8412<h4 class="discussion">Discussion</h4>
8413 <p class="discussion">This function validates the contents of the IPP message, including each
8414attribute. Like <a href="#ippValidateAttribute"><code>ippValidateAttribute</code></a>, cupsLastErrorString() is set
8415to a human-readable message on failure.
8416
8417</p>
8418<h3 class="function"><a id="ippWrite">ippWrite</a></h3>
8419 <p class="description">Write data for an IPP message to a HTTP connection.</p>
8420<p class="code">
8421<a href="#ipp_state_t">ipp_state_t</a> ippWrite (<br>
8422&#160;&#160;&#160;&#160;<a href="#http_t">http_t</a> *http,<br>
8423&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
8424);</p>
8425<h4 class="parameters">Parameters</h4>
8426<dl>
8427<dt>http</dt>
8428 <dd class="description">HTTP connection</dd>
8429<dt>ipp</dt>
8430 <dd class="description">IPP data</dd>
8431</dl>
8432<h4 class="returnvalue">Return Value</h4>
8433 <p class="description">Current state</p>
8434<h3 class="function"><span class="info">&#160;CUPS 1.1.19/macOS 10.3&#160;</span><a id="ippWriteFile">ippWriteFile</a></h3>
8435 <p class="description">Write data for an IPP message to a file.</p>
8436<p class="code">
8437<a href="#ipp_state_t">ipp_state_t</a> ippWriteFile (<br>
8438&#160;&#160;&#160;&#160;int fd,<br>
8439&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
8440);</p>
8441<h4 class="parameters">Parameters</h4>
8442<dl>
8443<dt>fd</dt>
8444 <dd class="description">HTTP data</dd>
8445<dt>ipp</dt>
8446 <dd class="description">IPP data</dd>
8447</dl>
8448<h4 class="returnvalue">Return Value</h4>
8449 <p class="description">Current state</p>
8450<h3 class="function"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="ippWriteIO">ippWriteIO</a></h3>
8451 <p class="description">Write data for an IPP message.</p>
8452<p class="code">
8453<a href="#ipp_state_t">ipp_state_t</a> ippWriteIO (<br>
8454&#160;&#160;&#160;&#160;void *dst,<br>
8455&#160;&#160;&#160;&#160;<a href="#ipp_iocb_t">ipp_iocb_t</a> cb,<br>
8456&#160;&#160;&#160;&#160;int blocking,<br>
8457&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *parent,<br>
8458&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *ipp<br>
8459);</p>
8460<h4 class="parameters">Parameters</h4>
8461<dl>
8462<dt>dst</dt>
8463 <dd class="description">Destination</dd>
8464<dt>cb</dt>
8465 <dd class="description">Write callback function</dd>
8466<dt>blocking</dt>
8467 <dd class="description">Use blocking IO?</dd>
8468<dt>parent</dt>
8469 <dd class="description">Parent IPP message</dd>
8470<dt>ipp</dt>
8471 <dd class="description">IPP data</dd>
8472</dl>
8473<h4 class="returnvalue">Return Value</h4>
8474 <p class="description">Current state</p>
8475<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="pwgFormatSizeName">pwgFormatSizeName</a></h3>
8476 <p class="description">Generate a PWG self-describing media size name.</p>
8477<p class="code">
8478int pwgFormatSizeName (<br>
8479&#160;&#160;&#160;&#160;char *keyword,<br>
8480&#160;&#160;&#160;&#160;size_t keysize,<br>
8481&#160;&#160;&#160;&#160;const char *prefix,<br>
8482&#160;&#160;&#160;&#160;const char *name,<br>
8483&#160;&#160;&#160;&#160;int width,<br>
8484&#160;&#160;&#160;&#160;int length,<br>
8485&#160;&#160;&#160;&#160;const char *units<br>
8486);</p>
8487<h4 class="parameters">Parameters</h4>
8488<dl>
8489<dt>keyword</dt>
8490 <dd class="description">Keyword buffer</dd>
8491<dt>keysize</dt>
8492 <dd class="description">Size of keyword buffer</dd>
8493<dt>prefix</dt>
8494 <dd class="description">Prefix for PWG size or <code>NULL</code> for automatic</dd>
8495<dt>name</dt>
8496 <dd class="description">Size name or <code>NULL</code></dd>
8497<dt>width</dt>
8498 <dd class="description">Width of page in 2540ths</dd>
8499<dt>length</dt>
8500 <dd class="description">Length of page in 2540ths</dd>
8501<dt>units</dt>
8502 <dd class="description">Units - &quot;in&quot;, &quot;mm&quot;, or <code>NULL</code> for automatic</dd>
8503</dl>
8504<h4 class="returnvalue">Return Value</h4>
8505 <p class="description">1 on success, 0 on failure</p>
8506<h4 class="discussion">Discussion</h4>
8507 <p class="discussion">This function generates a PWG self-describing media size name of the form
8508&quot;prefix_name_WIDTHxLENGTHunits&quot;. The prefix is typically &quot;custom&quot; or &quot;roll&quot;
8509for user-supplied sizes but can also be &quot;disc&quot;, &quot;iso&quot;, &quot;jis&quot;, &quot;jpn&quot;, &quot;na&quot;,
8510&quot;oe&quot;, &quot;om&quot;, &quot;prc&quot;, or &quot;roc&quot;. A value of <code>NULL</code> automatically chooses
8511&quot;oe&quot; or &quot;om&quot; depending on the units.<br>
8512<br>
8513The size name may only contain lowercase letters, numbers, &quot;-&quot;, and &quot;.&quot;. If
8514<code>NULL</code> is passed, the size name will contain the formatted dimensions.<br>
8515<br>
8516The width and length are specified in hundredths of millimeters, equivalent
8517to 1/100000th of a meter or 1/2540th of an inch. The width, length, and
8518units used for the generated size name are calculated automatically if the
8519units string is <code>NULL</code>, otherwise inches (&quot;in&quot;) or millimeters (&quot;mm&quot;)
8520are used.
8521
8522</p>
8523<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="pwgInitSize">pwgInitSize</a></h3>
8524 <p class="description">Initialize a pwg_size_t structure using IPP Job Template
8525attributes.</p>
8526<p class="code">
8527int pwgInitSize (<br>
8528&#160;&#160;&#160;&#160;<a href="#pwg_size_t">pwg_size_t</a> *size,<br>
8529&#160;&#160;&#160;&#160;<a href="#ipp_t">ipp_t</a> *job,<br>
8530&#160;&#160;&#160;&#160;int *margins_set<br>
8531);</p>
8532<h4 class="parameters">Parameters</h4>
8533<dl>
8534<dt>size</dt>
8535 <dd class="description">Size to initialize</dd>
8536<dt>job</dt>
8537 <dd class="description">Job template attributes</dd>
8538<dt>margins_set</dt>
8539 <dd class="description">1 if margins were set, 0 otherwise</dd>
8540</dl>
8541<h4 class="returnvalue">Return Value</h4>
8542 <p class="description">1 if size was initialized, 0 otherwise</p>
8543<h4 class="discussion">Discussion</h4>
8544 <p class="discussion">This function initializes a pwg_size_t structure from an IPP &quot;media&quot; or
8545&quot;media-col&quot; attribute in the specified IPP message. 0 is returned if neither
8546attribute is found in the message or the values are not valid.<br>
8547<br>
8548The &quot;margins_set&quot; variable is initialized to 1 if any &quot;media-xxx-margin&quot;
8549member attribute was specified in the &quot;media-col&quot; Job Template attribute,
8550otherwise it is initialized to 0.
8551
8552</p>
8553<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="pwgMediaForLegacy">pwgMediaForLegacy</a></h3>
8554 <p class="description">Find a PWG media size by ISO/IPP legacy name.</p>
8555<p class="code">
8556<a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForLegacy (<br>
8557&#160;&#160;&#160;&#160;const char *legacy<br>
8558);</p>
8559<h4 class="parameters">Parameters</h4>
8560<dl>
8561<dt>legacy</dt>
8562 <dd class="description">Legacy size name</dd>
8563</dl>
8564<h4 class="returnvalue">Return Value</h4>
8565 <p class="description">Matching size or NULL</p>
8566<h4 class="discussion">Discussion</h4>
8567 <p class="discussion">The &quot;name&quot; argument specifies the legacy ISO media size name, for example
8568&quot;iso-a4&quot; or &quot;na-letter&quot;.
8569
8570</p>
8571<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="pwgMediaForPPD">pwgMediaForPPD</a></h3>
8572 <p class="description">Find a PWG media size by Adobe PPD name.</p>
8573<p class="code">
8574<a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForPPD (<br>
8575&#160;&#160;&#160;&#160;const char *ppd<br>
8576);</p>
8577<h4 class="parameters">Parameters</h4>
8578<dl>
8579<dt>ppd</dt>
8580 <dd class="description">PPD size name</dd>
8581</dl>
8582<h4 class="returnvalue">Return Value</h4>
8583 <p class="description">Matching size or NULL</p>
8584<h4 class="discussion">Discussion</h4>
8585 <p class="discussion">The &quot;ppd&quot; argument specifies an Adobe page size name as defined in Table B.1
8586of the Adobe PostScript Printer Description File Format Specification Version
85874.3.<br>
8588<br>
8589If the name is non-standard, the returned PWG media size is stored in
8590thread-local storage and is overwritten by each call to the function in the
8591thread. Custom names can be of the form &quot;Custom.WIDTHxLENGTH[units]&quot; or
8592&quot;WIDTHxLENGTH[units]&quot;.
8593
8594</p>
8595<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="pwgMediaForPWG">pwgMediaForPWG</a></h3>
8596 <p class="description">Find a PWG media size by 5101.1 self-describing name.</p>
8597<p class="code">
8598<a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForPWG (<br>
8599&#160;&#160;&#160;&#160;const char *pwg<br>
8600);</p>
8601<h4 class="parameters">Parameters</h4>
8602<dl>
8603<dt>pwg</dt>
8604 <dd class="description">PWG size name</dd>
8605</dl>
8606<h4 class="returnvalue">Return Value</h4>
8607 <p class="description">Matching size or NULL</p>
8608<h4 class="discussion">Discussion</h4>
8609 <p class="discussion">The &quot;pwg&quot; argument specifies a self-describing media size name of the form
8610&quot;prefix_name_WIDTHxLENGTHunits&quot; as defined in PWG 5101.1.<br>
8611<br>
8612If the name is non-standard, the returned PWG media size is stored in
8613thread-local storage and is overwritten by each call to the function in the
8614thread.
8615
8616</p>
8617<h3 class="function"><span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span><a id="pwgMediaForSize">pwgMediaForSize</a></h3>
8618 <p class="description">Get the PWG media size for the given dimensions.</p>
8619<p class="code">
8620<a href="#pwg_media_t">pwg_media_t</a> *pwgMediaForSize (<br>
8621&#160;&#160;&#160;&#160;int width,<br>
8622&#160;&#160;&#160;&#160;int length<br>
8623);</p>
8624<h4 class="parameters">Parameters</h4>
8625<dl>
8626<dt>width</dt>
8627 <dd class="description">Width in hundredths of millimeters</dd>
8628<dt>length</dt>
8629 <dd class="description">Length in hundredths of millimeters</dd>
8630</dl>
8631<h4 class="returnvalue">Return Value</h4>
8632 <p class="description">PWG media name</p>
8633<h4 class="discussion">Discussion</h4>
8634 <p class="discussion">The &quot;width&quot; and &quot;length&quot; are in hundredths of millimeters, equivalent to
86351/100000th of a meter or 1/2540th of an inch.<br>
8636<br>
8637If the dimensions are non-standard, the returned PWG media size is stored in
8638thread-local storage and is overwritten by each call to the function in the
8639thread.
8640
8641</p>
8642 <h2 class="title"><a id="TYPES">Data Types</a></h2>
8643 <h3 class="typedef"><a id="cups_acopy_func_t">cups_acopy_func_t</a></h3>
8644 <p class="description">Array element copy function</p>
8645 <p class="code">
8646typedef void *(*)(void *element, void *data)cups_acopy_func_t;
8647</p>
8648 <h3 class="typedef"><a id="cups_afree_func_t">cups_afree_func_t</a></h3>
8649 <p class="description">Array element free function</p>
8650 <p class="code">
8651typedef void(*)(void *element, void *data)cups_afree_func_t;
8652</p>
8653 <h3 class="typedef"><a id="cups_ahash_func_t">cups_ahash_func_t</a></h3>
8654 <p class="description">Array hash function</p>
8655 <p class="code">
8656typedef int(*)(void *element, void *data)cups_ahash_func_t;
8657</p>
8658 <h3 class="typedef"><a id="cups_array_func_t">cups_array_func_t</a></h3>
8659 <p class="description">Array comparison function</p>
8660 <p class="code">
8661typedef int(*)(void *first, void *second, void *data)cups_array_func_t;
8662</p>
8663 <h3 class="typedef"><a id="cups_array_t">cups_array_t</a></h3>
8664 <p class="description">CUPS array type</p>
8665 <p class="code">
8666typedef struct _cups_array_s cups_array_t;
8667</p>
8668 <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>
8669 <p class="description">Client credentials callback
8670</p>
8671 <p class="code">
8672typedef int(*)(http_t *http, void *tls, <a href="#cups_array_t">cups_array_t</a> *distinguished_names, void *user_data)cups_client_cert_cb_t;
8673</p>
8674 <h3 class="typedef"><a id="cups_dentry_t">cups_dentry_t</a></h3>
8675 <p class="description">Directory entry type</p>
8676 <p class="code">
8677typedef struct <a href="#cups_dentry_s">cups_dentry_s</a> cups_dentry_t;
8678</p>
8679 <h3 class="typedef"><a id="cups_dest_block_t"><span class="info">&#160;CUPS 1.6/macOS 10.8&#160;</span>cups_dest_block_t</a></h3>
8680 <p class="description">Destination enumeration block
8681</p>
8682 <p class="code">
8683typedef int()(unsigned flags, <a href="#cups_dest_t">cups_dest_t</a> *dest)cups_dest_block_t;
8684</p>
8685 <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>
8686 <p class="description">Destination enumeration callback
8687</p>
8688 <p class="code">
8689typedef int(*)(void *user_data, unsigned flags, <a href="#cups_dest_t">cups_dest_t</a> *dest)cups_dest_cb_t;
8690</p>
8691 <h3 class="typedef"><a id="cups_dest_t">cups_dest_t</a></h3>
8692 <p class="description">Destination</p>
8693 <p class="code">
8694typedef struct <a href="#cups_dest_s">cups_dest_s</a> cups_dest_t;
8695</p>
8696 <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>
8697 <p class="description">Destination capability and status
8698information </p>
8699 <p class="code">
8700typedef struct _cups_dinfo_s cups_dinfo_t;
8701</p>
8702 <h3 class="typedef"><a id="cups_dir_t">cups_dir_t</a></h3>
8703 <p class="description">Directory type</p>
8704 <p class="code">
8705typedef struct _cups_dir_s cups_dir_t;
8706</p>
8707 <h3 class="typedef"><a id="cups_encoding_t">cups_encoding_t</a></h3>
8708 <p class="description">Language Encodings</p>
8709 <p class="code">
8710typedef enum <a href="#cups_encoding_e">cups_encoding_e</a> cups_encoding_t;
8711</p>
8712 <h3 class="typedef"><a id="cups_file_t">cups_file_t</a></h3>
8713 <p class="description">CUPS file type</p>
8714 <p class="code">
8715typedef struct _cups_file_s cups_file_t;
8716</p>
8717 <h3 class="typedef"><a id="cups_job_t">cups_job_t</a></h3>
8718 <p class="description">Job</p>
8719 <p class="code">
8720typedef struct <a href="#cups_job_s">cups_job_s</a> cups_job_t;
8721</p>
8722 <h3 class="typedef"><a id="cups_lang_t">cups_lang_t</a></h3>
8723 <p class="description">Language Cache Structure</p>
8724 <p class="code">
8725typedef struct <a href="#cups_lang_s">cups_lang_s</a> cups_lang_t;
8726</p>
8727 <h3 class="typedef"><a id="cups_option_t">cups_option_t</a></h3>
8728 <p class="description">Printer Options</p>
8729 <p class="code">
8730typedef struct <a href="#cups_option_s">cups_option_s</a> cups_option_t;
8731</p>
8732 <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>
8733 <p class="description">New password callback
8734</p>
8735 <p class="code">
8736typedef 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;
8737</p>
8738 <h3 class="typedef"><a id="cups_password_cb_t">cups_password_cb_t</a></h3>
8739 <p class="description">Password callback</p>
8740 <p class="code">
8741typedef const char *(*)(const char *prompt)cups_password_cb_t;
8742</p>
8743 <h3 class="typedef"><a id="cups_ptype_t">cups_ptype_t</a></h3>
8744 <p class="description">Printer type/capability bits</p>
8745 <p class="code">
8746typedef unsigned cups_ptype_t;
8747</p>
8748 <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>
8749 <p class="description">Server credentials callback
8750</p>
8751 <p class="code">
8752typedef int(*)(http_t *http, void *tls, <a href="#cups_array_t">cups_array_t</a> *certs, void *user_data)cups_server_cert_cb_t;
8753</p>
8754 <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>
8755 <p class="description">Media Size </p>
8756 <p class="code">
8757typedef struct <a href="#cups_size_s">cups_size_s</a> cups_size_t;
8758</p>
8759 <h3 class="typedef"><a id="gss_auth_identity_desc">gss_auth_identity_desc</a></h3>
8760 <p class="description">Local functions...</p>
8761 <p class="code">
8762typedef struct <a href="#gss_auth_identity">gss_auth_identity</a> gss_auth_identity_desc;
8763</p>
8764 <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>
8765 <p class="description">Socket address union, which
8766makes using IPv6 and other
8767address types easier and
8768more portable. </p>
8769 <p class="code">
8770typedef union _http_addr_u / http_addr_t;
8771</p>
8772 <h3 class="typedef"><a id="http_addrlist_t"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span>http_addrlist_t</a></h3>
8773 <p class="description">Socket address list, which is
8774used to enumerate all of the
8775addresses that are associated
8776with a hostname. </p>
8777 <p class="code">
8778typedef struct <a href="#http_addrlist_s">http_addrlist_s</a> / http_addrlist_t;
8779</p>
8780 <h3 class="typedef"><a id="http_auth_t">http_auth_t</a></h3>
8781 <p class="description">HTTP authentication types</p>
8782 <p class="code">
8783typedef enum <a href="#http_auth_e">http_auth_e</a> http_auth_t;
8784</p>
8785 <h3 class="typedef"><a id="http_credential_t"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span>http_credential_t</a></h3>
8786 <p class="description">HTTP credential data </p>
8787 <p class="code">
8788typedef struct <a href="#http_credential_s">http_credential_s</a> http_credential_t;
8789</p>
8790 <h3 class="typedef"><a id="http_encoding_t">http_encoding_t</a></h3>
8791 <p class="description">HTTP transfer encoding values</p>
8792 <p class="code">
8793typedef enum <a href="#http_encoding_e">http_encoding_e</a> http_encoding_t;
8794</p>
8795 <h3 class="typedef"><a id="http_encryption_t">http_encryption_t</a></h3>
8796 <p class="description">HTTP encryption values</p>
8797 <p class="code">
8798typedef enum <a href="#http_encryption_e">http_encryption_e</a> http_encryption_t;
8799</p>
8800 <h3 class="typedef"><a id="http_field_t">http_field_t</a></h3>
8801 <p class="description">HTTP field names</p>
8802 <p class="code">
8803typedef enum <a href="#http_field_e">http_field_e</a> http_field_t;
8804</p>
8805 <h3 class="typedef"><a id="http_keepalive_t">http_keepalive_t</a></h3>
8806 <p class="description">HTTP keep-alive values</p>
8807 <p class="code">
8808typedef enum <a href="#http_keepalive_e">http_keepalive_e</a> http_keepalive_t;
8809</p>
8810 <h3 class="typedef"><a id="http_state_t">http_state_t</a></h3>
8811 <p class="description">HTTP state values; states
8812are server-oriented...</p>
8813 <p class="code">
8814typedef enum <a href="#http_state_e">http_state_e</a> http_state_t;
8815</p>
8816 <h3 class="typedef"><a id="http_t">http_t</a></h3>
8817 <p class="description">HTTP connection type</p>
8818 <p class="code">
8819typedef struct _http_s http_t;
8820</p>
8821 <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>
8822 <p class="description">HTTP timeout callback </p>
8823 <p class="code">
8824typedef int(*)(http_t *http, void *user_data)http_timeout_cb_t;
8825</p>
8826 <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>
8827 <p class="description">Level of trust for credentials </p>
8828 <p class="code">
8829typedef enum <a href="#http_trust_e">http_trust_e</a> http_trust_t;
8830</p>
8831 <h3 class="typedef"><a id="http_uri_coding_t">http_uri_coding_t</a></h3>
8832 <p class="description">URI en/decode flags</p>
8833 <p class="code">
8834typedef enum <a href="#http_uri_coding_e">http_uri_coding_e</a> http_uri_coding_t;
8835</p>
8836 <h3 class="typedef"><a id="http_uri_status_t"><span class="info">&#160;CUPS 1.2&#160;</span>http_uri_status_t</a></h3>
8837 <p class="description">URI separation status </p>
8838 <p class="code">
8839typedef enum <a href="#http_uri_status_e">http_uri_status_e</a> http_uri_status_t;
8840</p>
8841 <h3 class="typedef"><a id="http_version_t">http_version_t</a></h3>
8842 <p class="description">HTTP version numbers</p>
8843 <p class="code">
8844typedef enum <a href="#http_version_e">http_version_e</a> http_version_t;
8845</p>
8846 <h3 class="typedef"><a id="ipp_attribute_t">ipp_attribute_t</a></h3>
8847 <p class="description">IPP attribute</p>
8848 <p class="code">
8849typedef struct _ipp_attribute_s ipp_attribute_t;
8850</p>
8851 <h3 class="typedef"><a id="ipp_copycb_t">ipp_copycb_t</a></h3>
8852 <p class="description">The following structures are PRIVATE starting with CUPS 1.6/macOS 10.8.
8853Please use the new accessor functions available in CUPS 1.6 and later, as
8854these definitions will be moved to a private header file in a future release.</p>
8855 <p class="code">
8856typedef int(*)(void *context, <a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr)ipp_copycb_t;
8857</p>
8858 <h3 class="typedef"><a id="ipp_dstate_t">ipp_dstate_t</a></h3>
8859 <p class="description">Document states</p>
8860 <p class="code">
8861typedef enum <a href="#ipp_dstate_e">ipp_dstate_e</a> ipp_dstate_t;
8862</p>
8863 <h3 class="typedef"><a id="ipp_finish_t">ipp_finish_t</a></h3>
8864 <p class="description">Job collation types</p>
8865 <p class="code">
8866typedef enum <a href="#ipp_finishings_e">ipp_finishings_e</a> ipp_finish_t;
8867</p>
8868 <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>
8869 <p class="description">IPP IO Callback Function </p>
8870 <p class="code">
8871typedef ssize_t(*)(void *context, <a href="#ipp_uchar_t">ipp_uchar_t</a> *buffer, size_t bytes) ipp_iocb_t;
8872</p>
8873 <h3 class="typedef"><a id="ipp_jcollate_t">ipp_jcollate_t</a></h3>
8874 <p class="description">Job collation types</p>
8875 <p class="code">
8876typedef enum <a href="#ipp_jcollate_e">ipp_jcollate_e</a> ipp_jcollate_t;
8877</p>
8878 <h3 class="typedef"><a id="ipp_orient_t">ipp_orient_t</a></h3>
8879 <p class="description">Orientation values</p>
8880 <p class="code">
8881typedef enum <a href="#ipp_orient_e">ipp_orient_e</a> ipp_orient_t;
8882</p>
8883 <h3 class="typedef"><a id="ipp_pstate_t">ipp_pstate_t</a></h3>
8884 <p class="description">Printer states</p>
8885 <p class="code">
8886typedef enum <a href="#ipp_pstate_e">ipp_pstate_e</a> ipp_pstate_t;
8887</p>
8888 <h3 class="typedef"><a id="ipp_quality_t">ipp_quality_t</a></h3>
8889 <p class="description">Qualities</p>
8890 <p class="code">
8891typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t;
8892</p>
8893 <h3 class="typedef"><a id="ipp_res_t">ipp_res_t</a></h3>
8894 <p class="description">Resolution units</p>
8895 <p class="code">
8896typedef enum <a href="#ipp_res_e">ipp_res_e</a> ipp_res_t;
8897</p>
8898 <h3 class="typedef"><a id="ipp_state_t">ipp_state_t</a></h3>
8899 <p class="description">IPP states</p>
8900 <p class="code">
8901typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t;
8902</p>
8903 <h3 class="typedef"><a id="ipp_t">ipp_t</a></h3>
8904 <p class="description">IPP request/response data</p>
8905 <p class="code">
8906typedef struct _ipp_s ipp_t;
8907</p>
8908 <h3 class="typedef"><a id="ipp_uchar_t">ipp_uchar_t</a></h3>
8909 <p class="description">Unsigned 8-bit integer/character</p>
8910 <p class="code">
8911typedef unsigned char ipp_uchar_t;
8912</p>
8913 <h3 class="typedef"><a id="pwg_map_t">pwg_map_t</a></h3>
8914 <p class="description">Map element - PPD to/from PWG</p>
8915 <p class="code">
8916typedef struct <a href="#pwg_map_s">pwg_map_s</a> pwg_map_t;
8917</p>
8918 <h3 class="typedef"><a id="pwg_media_t">pwg_media_t</a></h3>
8919 <p class="description">Common media size data</p>
8920 <p class="code">
8921typedef struct <a href="#pwg_media_s">pwg_media_s</a> pwg_media_t;
8922</p>
8923 <h3 class="typedef"><a id="pwg_size_t">pwg_size_t</a></h3>
8924 <p class="description">Size element - PPD to/from PWG</p>
8925 <p class="code">
8926typedef struct <a href="#pwg_size_s">pwg_size_s</a> pwg_size_t;
8927</p>
8928 <h2 class="title"><a id="STRUCTURES">Structures</a></h2>
8929<h3 class="struct"><a id="cups_dentry_s">cups_dentry_s</a></h3>
8930 <p class="description">Directory entry type</p>
8931<p class="code">struct cups_dentry_s {<br>
8932&#160;&#160;&#160;&#160;struct stat fileinfo;<br>
8933&#160;&#160;&#160;&#160;char filename[260];<br>
8934};</p>
8935<h4 class="members">Members</h4>
8936<dl>
8937<dt>fileinfo </dt>
8938 <dd class="description">File information</dd>
8939<dt>filename[260] </dt>
8940 <dd class="description">File name</dd>
8941</dl>
8942<h3 class="struct"><a id="cups_dest_s">cups_dest_s</a></h3>
8943 <p class="description">Destination</p>
8944<p class="code">struct cups_dest_s {<br>
8945&#160;&#160;&#160;&#160;char *name, *instance;<br>
8946&#160;&#160;&#160;&#160;int is_default;<br>
8947&#160;&#160;&#160;&#160;int num_options;<br>
8948&#160;&#160;&#160;&#160;<a href="#cups_option_t">cups_option_t</a> *options;<br>
8949};</p>
8950<h4 class="members">Members</h4>
8951<dl>
8952<dt>instance </dt>
8953 <dd class="description">Local instance name or NULL</dd>
8954<dt>is_default </dt>
8955 <dd class="description">Is this printer the default?</dd>
8956<dt>num_options </dt>
8957 <dd class="description">Number of options</dd>
8958<dt>options </dt>
8959 <dd class="description">Options</dd>
8960</dl>
8961<h3 class="struct"><a id="cups_job_s">cups_job_s</a></h3>
8962 <p class="description">Job</p>
8963<p class="code">struct cups_job_s {<br>
8964&#160;&#160;&#160;&#160;time_t completed_time;<br>
8965&#160;&#160;&#160;&#160;time_t creation_time;<br>
8966&#160;&#160;&#160;&#160;char *dest;<br>
8967&#160;&#160;&#160;&#160;char *format;<br>
8968&#160;&#160;&#160;&#160;int id;<br>
8969&#160;&#160;&#160;&#160;int priority;<br>
8970&#160;&#160;&#160;&#160;time_t processing_time;<br>
8971&#160;&#160;&#160;&#160;int size;<br>
8972&#160;&#160;&#160;&#160;ipp_jstate_t state;<br>
8973&#160;&#160;&#160;&#160;char *title;<br>
8974&#160;&#160;&#160;&#160;char *user;<br>
8975};</p>
8976<h4 class="members">Members</h4>
8977<dl>
8978<dt>completed_time </dt>
8979 <dd class="description">Time the job was completed</dd>
8980<dt>creation_time </dt>
8981 <dd class="description">Time the job was created</dd>
8982<dt>dest </dt>
8983 <dd class="description">Printer or class name</dd>
8984<dt>format </dt>
8985 <dd class="description">Document format</dd>
8986<dt>id </dt>
8987 <dd class="description">The job ID</dd>
8988<dt>priority </dt>
8989 <dd class="description">Priority (1-100)</dd>
8990<dt>processing_time </dt>
8991 <dd class="description">Time the job was processed</dd>
8992<dt>size </dt>
8993 <dd class="description">Size in kilobytes</dd>
8994<dt>state </dt>
8995 <dd class="description">Job state</dd>
8996<dt>title </dt>
8997 <dd class="description">Title/job name</dd>
8998<dt>user </dt>
8999 <dd class="description">User that submitted the job</dd>
9000</dl>
9001<h3 class="struct"><a id="cups_lang_s">cups_lang_s</a></h3>
9002 <p class="description">Language Cache Structure</p>
9003<p class="code">struct cups_lang_s {<br>
9004&#160;&#160;&#160;&#160;<a href="#cups_encoding_t">cups_encoding_t</a> encoding;<br>
9005&#160;&#160;&#160;&#160;char language[16];<br>
9006&#160;&#160;&#160;&#160;struct <a href="#cups_lang_s">cups_lang_s</a> *next;<br>
9007&#160;&#160;&#160;&#160;int used;<br>
9008};</p>
9009<h4 class="members">Members</h4>
9010<dl>
9011<dt>encoding </dt>
9012 <dd class="description">Text encoding</dd>
9013<dt>language[16] </dt>
9014 <dd class="description">Language/locale name</dd>
9015<dt>next </dt>
9016 <dd class="description">Next language in cache</dd>
9017<dt>used </dt>
9018 <dd class="description">Number of times this entry has been used.</dd>
9019</dl>
9020<h3 class="struct"><a id="cups_option_s">cups_option_s</a></h3>
9021 <p class="description">Printer Options</p>
9022<p class="code">struct cups_option_s {<br>
9023&#160;&#160;&#160;&#160;char *name;<br>
9024&#160;&#160;&#160;&#160;char *value;<br>
9025};</p>
9026<h4 class="members">Members</h4>
9027<dl>
9028<dt>name </dt>
9029 <dd class="description">Name of option</dd>
9030<dt>value </dt>
9031 <dd class="description">Value of option</dd>
9032</dl>
9033<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>
9034 <p class="description">Media Size </p>
9035<p class="code">struct cups_size_s {<br>
9036&#160;&#160;&#160;&#160;char media[128];<br>
9037&#160;&#160;&#160;&#160;int width, length, bottom, left, right, top;<br>
9038};</p>
9039<h4 class="members">Members</h4>
9040<dl>
9041<dt>media[128] </dt>
9042 <dd class="description">Media name to use</dd>
9043<dt>top </dt>
9044 <dd class="description">Top margin in hundredths of
9045millimeters</dd>
9046</dl>
9047<h3 class="struct"><a id="gss_auth_identity">gss_auth_identity</a></h3>
9048 <p class="description">Local functions...</p>
9049<p class="code">struct gss_auth_identity {<br>
9050&#160;&#160;&#160;&#160;gss_buffer_t *credentialsRef;<br>
9051&#160;&#160;&#160;&#160;uint32_t flags;<br>
9052&#160;&#160;&#160;&#160;char *password;<br>
9053&#160;&#160;&#160;&#160;char *realm;<br>
9054&#160;&#160;&#160;&#160;uint32_t type;<br>
9055&#160;&#160;&#160;&#160;char *username;<br>
9056};</p>
9057<h4 class="members">Members</h4>
9058<dl>
9059<dt>credentialsRef </dt>
9060<dt>flags </dt>
9061<dt>password </dt>
9062<dt>realm </dt>
9063<dt>type </dt>
9064<dt>username </dt>
9065</dl>
9066<h3 class="struct"><span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span><a id="http_addrlist_s">http_addrlist_s</a></h3>
9067 <p class="description">Socket address list, which is
9068used to enumerate all of the
9069addresses that are associated
9070with a hostname. </p>
9071<p class="code">struct http_addrlist_s {<br>
9072&#160;&#160;&#160;&#160;<a href="#http_addr_t">http_addr_t</a> addr;<br>
9073&#160;&#160;&#160;&#160;struct <a href="#http_addrlist_s">http_addrlist_s</a> *next;<br>
9074};</p>
9075<h4 class="members">Members</h4>
9076<dl>
9077<dt>addr </dt>
9078 <dd class="description">Address</dd>
9079<dt>next </dt>
9080 <dd class="description">Pointer to next address in list</dd>
9081</dl>
9082<h3 class="struct"><span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span><a id="http_credential_s">http_credential_s</a></h3>
9083 <p class="description">HTTP credential data </p>
9084<p class="code">struct http_credential_s {<br>
9085&#160;&#160;&#160;&#160;void *data;<br>
9086&#160;&#160;&#160;&#160;size_t datalen;<br>
9087};</p>
9088<h4 class="members">Members</h4>
9089<dl>
9090<dt>data </dt>
9091 <dd class="description">Pointer to credential data</dd>
9092<dt>datalen </dt>
9093 <dd class="description">Credential length</dd>
9094</dl>
9095<h3 class="struct"><a id="pollfd">pollfd</a></h3>
9096 <p class="description">User data (unused)</p>
9097<p class="code">struct pollfd *pollfds, unsigned int num_pollfds, int timeout, void *context) {<br>
9098&#160;&#160;&#160;&#160;void) context;<br>
9099&#160;&#160;&#160;&#160;void) timeout;<br>
9100};</p>
9101<h4 class="members">Members</h4>
9102<dl>
9103<dt>context </dt>
9104<dt>timeout </dt>
9105</dl>
9106<h3 class="struct"><a id="pwg_map_s">pwg_map_s</a></h3>
9107 <p class="description">Map element - PPD to/from PWG</p>
9108<p class="code">struct pwg_map_s {<br>
9109&#160;&#160;&#160;&#160;char *pwg, *ppd;<br>
9110};</p>
9111<h4 class="members">Members</h4>
9112<dl>
9113<dt>ppd </dt>
9114 <dd class="description">PPD option keyword</dd>
9115</dl>
9116<h3 class="struct"><a id="pwg_media_s">pwg_media_s</a></h3>
9117 <p class="description">Common media size data</p>
9118<p class="code">struct pwg_media_s {<br>
9119&#160;&#160;&#160;&#160;int width, length;<br>
9120&#160;&#160;&#160;&#160;const char *pwg, *legacy, *ppd;<br>
9121};</p>
9122<h4 class="members">Members</h4>
9123<dl>
9124<dt>length </dt>
9125 <dd class="description">Length in 2540ths</dd>
9126<dt>ppd </dt>
9127 <dd class="description">Standard Adobe PPD name</dd>
9128</dl>
9129<h3 class="struct"><a id="pwg_size_s">pwg_size_s</a></h3>
9130 <p class="description">Size element - PPD to/from PWG</p>
9131<p class="code">struct pwg_size_s {<br>
9132&#160;&#160;&#160;&#160;<a href="#pwg_map_t">pwg_map_t</a> map;<br>
9133&#160;&#160;&#160;&#160;int width, length, left, bottom, right, top;<br>
9134};</p>
9135<h4 class="members">Members</h4>
9136<dl>
9137<dt>map </dt>
9138 <dd class="description">Map element</dd>
9139<dt>top </dt>
9140 <dd class="description">Top margin in 2540ths</dd>
9141</dl>
9142 <h2 class="title"><a id="VARIABLES">Variables</a></h2>
9143 <h3 class="variable"><a id="CF_RETURNS_RETAINED">CF_RETURNS_RETAINED</a></h3>
9144 <p class="description">Get the Apple language identifier associated with a
9145locale ID.</p>
9146 <p class="code">const char *locale)CF_RETURNS_RETAINED;</p>
9147 <h3 class="variable"><a id="environ">environ</a></h3>
9148 <p class="description">Constants, very secure stuff...</p>
9149 <p class="code">extern char **environ;</p>
9150 <h2 class="title"><a id="ENUMERATIONS">Constants</a></h2>
9151 <h3 class="enumeration"><a id="cups_encoding_e">cups_encoding_e</a></h3>
9152 <p class="description">Language Encodings</p>
9153 <h4 class="constants">Constants</h4>
9154 <dl>
9155 <dt>CUPS_EUC_CN </dt>
9156 <dd class="description">EUC Simplified Chinese</dd>
9157 <dt>CUPS_EUC_JP </dt>
9158 <dd class="description">EUC Japanese</dd>
9159 <dt>CUPS_EUC_KR </dt>
9160 <dd class="description">EUC Korean</dd>
9161 <dt>CUPS_EUC_TW </dt>
9162 <dd class="description">EUC Traditional Chinese</dd>
9163 <dt>CUPS_ISO8859_1 </dt>
9164 <dd class="description">ISO-8859-1</dd>
9165 <dt>CUPS_ISO8859_10 </dt>
9166 <dd class="description">ISO-8859-10</dd>
9167 <dt>CUPS_ISO8859_11 </dt>
9168 <dd class="description">ISO-8859-11</dd>
9169 <dt>CUPS_ISO8859_13 </dt>
9170 <dd class="description">ISO-8859-13</dd>
9171 <dt>CUPS_ISO8859_14 </dt>
9172 <dd class="description">ISO-8859-14</dd>
9173 <dt>CUPS_ISO8859_15 </dt>
9174 <dd class="description">ISO-8859-15</dd>
9175 <dt>CUPS_ISO8859_16 </dt>
9176 <dd class="description">ISO-8859-16</dd>
9177 <dt>CUPS_ISO8859_2 </dt>
9178 <dd class="description">ISO-8859-2</dd>
9179 <dt>CUPS_ISO8859_3 </dt>
9180 <dd class="description">ISO-8859-3</dd>
9181 <dt>CUPS_ISO8859_4 </dt>
9182 <dd class="description">ISO-8859-4</dd>
9183 <dt>CUPS_ISO8859_5 </dt>
9184 <dd class="description">ISO-8859-5</dd>
9185 <dt>CUPS_ISO8859_6 </dt>
9186 <dd class="description">ISO-8859-6</dd>
9187 <dt>CUPS_ISO8859_7 </dt>
9188 <dd class="description">ISO-8859-7</dd>
9189 <dt>CUPS_ISO8859_8 </dt>
9190 <dd class="description">ISO-8859-8</dd>
9191 <dt>CUPS_ISO8859_9 </dt>
9192 <dd class="description">ISO-8859-9</dd>
9193 <dt>CUPS_JIS_X0213 </dt>
9194 <dd class="description">JIS X0213 aka Shift JIS</dd>
9195 <dt>CUPS_KOI8_R </dt>
9196 <dd class="description">KOI-8-R</dd>
9197 <dt>CUPS_KOI8_U </dt>
9198 <dd class="description">KOI-8-U</dd>
9199 <dt>CUPS_MAC_ROMAN </dt>
9200 <dd class="description">MacRoman</dd>
9201 <dt>CUPS_US_ASCII </dt>
9202 <dd class="description">US ASCII</dd>
9203 <dt>CUPS_UTF8 </dt>
9204 <dd class="description">UTF-8</dd>
9205 <dt>CUPS_WINDOWS_1250 </dt>
9206 <dd class="description">CP-1250</dd>
9207 <dt>CUPS_WINDOWS_1251 </dt>
9208 <dd class="description">CP-1251</dd>
9209 <dt>CUPS_WINDOWS_1252 </dt>
9210 <dd class="description">CP-1252</dd>
9211 <dt>CUPS_WINDOWS_1253 </dt>
9212 <dd class="description">CP-1253</dd>
9213 <dt>CUPS_WINDOWS_1254 </dt>
9214 <dd class="description">CP-1254</dd>
9215 <dt>CUPS_WINDOWS_1255 </dt>
9216 <dd class="description">CP-1255</dd>
9217 <dt>CUPS_WINDOWS_1256 </dt>
9218 <dd class="description">CP-1256</dd>
9219 <dt>CUPS_WINDOWS_1257 </dt>
9220 <dd class="description">CP-1257</dd>
9221 <dt>CUPS_WINDOWS_1258 </dt>
9222 <dd class="description">CP-1258</dd>
9223 <dt>CUPS_WINDOWS_1361 </dt>
9224 <dd class="description">Korean Johab</dd>
9225 <dt>CUPS_WINDOWS_874 </dt>
9226 <dd class="description">CP-874</dd>
9227 <dt>CUPS_WINDOWS_932 </dt>
9228 <dd class="description">Japanese JIS X0208-1990</dd>
9229 <dt>CUPS_WINDOWS_936 </dt>
9230 <dd class="description">Simplified Chinese GB 2312-80</dd>
9231 <dt>CUPS_WINDOWS_949 </dt>
9232 <dd class="description">Korean KS C5601-1992</dd>
9233 <dt>CUPS_WINDOWS_950 </dt>
9234 <dd class="description">Traditional Chinese Big Five</dd>
9235</dl>
9236 <h3 class="enumeration"><a id="cups_ptype_e">cups_ptype_e</a></h3>
9237 <p class="description">Printer type/capability bit
9238constants</p>
9239 <h4 class="constants">Constants</h4>
9240 <dl>
9241 <dt>CUPS_PRINTER_AUTHENTICATED <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
9242 <dd class="description">Printer requires authentication
9243</dd>
9244 <dt>CUPS_PRINTER_BIND </dt>
9245 <dd class="description">Can bind output</dd>
9246 <dt>CUPS_PRINTER_BW </dt>
9247 <dd class="description">Can do B&amp;W printing</dd>
9248 <dt>CUPS_PRINTER_CLASS </dt>
9249 <dd class="description">Printer class</dd>
9250 <dt>CUPS_PRINTER_COLLATE </dt>
9251 <dd class="description">Can quickly collate copies</dd>
9252 <dt>CUPS_PRINTER_COLOR </dt>
9253 <dd class="description">Can do color printing</dd>
9254 <dt>CUPS_PRINTER_COMMANDS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
9255 <dd class="description">Printer supports maintenance commands
9256</dd>
9257 <dt>CUPS_PRINTER_COPIES </dt>
9258 <dd class="description">Can do copies in hardware</dd>
9259 <dt>CUPS_PRINTER_COVER </dt>
9260 <dd class="description">Can cover output</dd>
9261 <dt>CUPS_PRINTER_DEFAULT </dt>
9262 <dd class="description">Default printer on network</dd>
9263 <dt>CUPS_PRINTER_DELETE <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
9264 <dd class="description">Delete printer
9265</dd>
9266 <dt>CUPS_PRINTER_DUPLEX </dt>
9267 <dd class="description">Can do two-sided printing</dd>
9268 <dt>CUPS_PRINTER_FAX </dt>
9269 <dd class="description">Fax queue</dd>
9270 <dt>CUPS_PRINTER_LARGE </dt>
9271 <dd class="description">Can print on D/E/A1/A0-size media</dd>
9272 <dt>CUPS_PRINTER_LOCAL </dt>
9273 <dd class="description">Local printer or class</dd>
9274 <dt>CUPS_PRINTER_MEDIUM </dt>
9275 <dd class="description">Can print on Tabloid/B/C/A3/A2-size media</dd>
9276 <dt>CUPS_PRINTER_MFP <span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span></dt>
9277 <dd class="description">Printer with scanning capabilities
9278</dd>
9279 <dt>CUPS_PRINTER_NOT_SHARED <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
9280 <dd class="description">Printer is not shared
9281</dd>
9282 <dt>CUPS_PRINTER_PUNCH </dt>
9283 <dd class="description">Can punch output</dd>
9284 <dt>CUPS_PRINTER_REJECTING </dt>
9285 <dd class="description">Printer is rejecting jobs</dd>
9286 <dt>CUPS_PRINTER_REMOTE </dt>
9287 <dd class="description">Remote printer or class</dd>
9288 <dt>CUPS_PRINTER_SCANNER <span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span></dt>
9289 <dd class="description">Scanner-only device
9290</dd>
9291 <dt>CUPS_PRINTER_SMALL </dt>
9292 <dd class="description">Can print on Letter/Legal/A4-size media</dd>
9293 <dt>CUPS_PRINTER_SORT </dt>
9294 <dd class="description">Can sort output</dd>
9295 <dt>CUPS_PRINTER_STAPLE </dt>
9296 <dd class="description">Can staple output</dd>
9297 <dt>CUPS_PRINTER_VARIABLE </dt>
9298 <dd class="description">Can print on rolls and custom-size media</dd>
9299</dl>
9300 <h3 class="enumeration"><a id="http_auth_e">http_auth_e</a></h3>
9301 <p class="description">HTTP authentication types</p>
9302 <h4 class="constants">Constants</h4>
9303 <dl>
9304 <dt>HTTP_AUTH_BASIC </dt>
9305 <dd class="description">Basic authentication in use</dd>
9306 <dt>HTTP_AUTH_MD5 </dt>
9307 <dd class="description">Digest authentication in use</dd>
9308 <dt>HTTP_AUTH_MD5_INT </dt>
9309 <dd class="description">Digest authentication in use for body</dd>
9310 <dt>HTTP_AUTH_MD5_SESS </dt>
9311 <dd class="description">MD5-session authentication in use</dd>
9312 <dt>HTTP_AUTH_MD5_SESS_INT </dt>
9313 <dd class="description">MD5-session authentication in use for body</dd>
9314 <dt>HTTP_AUTH_NEGOTIATE <span class="info">&#160;CUPS 1.3/macOS 10.5&#160;</span></dt>
9315 <dd class="description">GSSAPI authentication in use </dd>
9316 <dt>HTTP_AUTH_NONE </dt>
9317 <dd class="description">No authentication in use</dd>
9318</dl>
9319 <h3 class="enumeration"><a id="http_encoding_e">http_encoding_e</a></h3>
9320 <p class="description">HTTP transfer encoding values</p>
9321 <h4 class="constants">Constants</h4>
9322 <dl>
9323 <dt>HTTP_ENCODING_CHUNKED </dt>
9324 <dd class="description">Data is chunked</dd>
9325 <dt>HTTP_ENCODING_FIELDS </dt>
9326 <dd class="description">Sending HTTP fields</dd>
9327 <dt>HTTP_ENCODING_LENGTH </dt>
9328 <dd class="description">Data is sent with Content-Length</dd>
9329</dl>
9330 <h3 class="enumeration"><a id="http_encryption_e">http_encryption_e</a></h3>
9331 <p class="description">HTTP encryption values</p>
9332 <h4 class="constants">Constants</h4>
9333 <dl>
9334 <dt>HTTP_ENCRYPTION_ALWAYS </dt>
9335 <dd class="description">Always encrypt (SSL)</dd>
9336 <dt>HTTP_ENCRYPTION_IF_REQUESTED </dt>
9337 <dd class="description">Encrypt if requested (TLS upgrade)</dd>
9338 <dt>HTTP_ENCRYPTION_NEVER </dt>
9339 <dd class="description">Never encrypt</dd>
9340 <dt>HTTP_ENCRYPTION_REQUIRED </dt>
9341 <dd class="description">Encryption is required (TLS upgrade)</dd>
9342</dl>
9343 <h3 class="enumeration"><a id="http_field_e">http_field_e</a></h3>
9344 <p class="description">HTTP field names</p>
9345 <h4 class="constants">Constants</h4>
9346 <dl>
9347 <dt>HTTP_FIELD_ACCEPT_ENCODING <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></dt>
9348 <dd class="description">Accepting-Encoding field </dd>
9349 <dt>HTTP_FIELD_ACCEPT_LANGUAGE </dt>
9350 <dd class="description">Accept-Language field</dd>
9351 <dt>HTTP_FIELD_ACCEPT_RANGES </dt>
9352 <dd class="description">Accept-Ranges field</dd>
9353 <dt>HTTP_FIELD_ALLOW <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></dt>
9354 <dd class="description">Allow field </dd>
9355 <dt>HTTP_FIELD_AUTHORIZATION </dt>
9356 <dd class="description">Authorization field</dd>
9357 <dt>HTTP_FIELD_CONNECTION </dt>
9358 <dd class="description">Connection field</dd>
9359 <dt>HTTP_FIELD_CONTENT_ENCODING </dt>
9360 <dd class="description">Content-Encoding field</dd>
9361 <dt>HTTP_FIELD_CONTENT_LANGUAGE </dt>
9362 <dd class="description">Content-Language field</dd>
9363 <dt>HTTP_FIELD_CONTENT_LENGTH </dt>
9364 <dd class="description">Content-Length field</dd>
9365 <dt>HTTP_FIELD_CONTENT_LOCATION </dt>
9366 <dd class="description">Content-Location field</dd>
9367 <dt>HTTP_FIELD_CONTENT_MD5 </dt>
9368 <dd class="description">Content-MD5 field</dd>
9369 <dt>HTTP_FIELD_CONTENT_RANGE </dt>
9370 <dd class="description">Content-Range field</dd>
9371 <dt>HTTP_FIELD_CONTENT_TYPE </dt>
9372 <dd class="description">Content-Type field</dd>
9373 <dt>HTTP_FIELD_CONTENT_VERSION </dt>
9374 <dd class="description">Content-Version field</dd>
9375 <dt>HTTP_FIELD_DATE </dt>
9376 <dd class="description">Date field</dd>
9377 <dt>HTTP_FIELD_HOST </dt>
9378 <dd class="description">Host field</dd>
9379 <dt>HTTP_FIELD_IF_MODIFIED_SINCE </dt>
9380 <dd class="description">If-Modified-Since field</dd>
9381 <dt>HTTP_FIELD_IF_UNMODIFIED_SINCE </dt>
9382 <dd class="description">If-Unmodified-Since field</dd>
9383 <dt>HTTP_FIELD_KEEP_ALIVE </dt>
9384 <dd class="description">Keep-Alive field</dd>
9385 <dt>HTTP_FIELD_LAST_MODIFIED </dt>
9386 <dd class="description">Last-Modified field</dd>
9387 <dt>HTTP_FIELD_LINK </dt>
9388 <dd class="description">Link field</dd>
9389 <dt>HTTP_FIELD_LOCATION </dt>
9390 <dd class="description">Location field</dd>
9391 <dt>HTTP_FIELD_MAX </dt>
9392 <dd class="description">Maximum field index</dd>
9393 <dt>HTTP_FIELD_RANGE </dt>
9394 <dd class="description">Range field</dd>
9395 <dt>HTTP_FIELD_REFERER </dt>
9396 <dd class="description">Referer field</dd>
9397 <dt>HTTP_FIELD_RETRY_AFTER </dt>
9398 <dd class="description">Retry-After field</dd>
9399 <dt>HTTP_FIELD_SERVER <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></dt>
9400 <dd class="description">Server field </dd>
9401 <dt>HTTP_FIELD_TRANSFER_ENCODING </dt>
9402 <dd class="description">Transfer-Encoding field</dd>
9403 <dt>HTTP_FIELD_UNKNOWN </dt>
9404 <dd class="description">Unknown field</dd>
9405 <dt>HTTP_FIELD_UPGRADE </dt>
9406 <dd class="description">Upgrade field</dd>
9407 <dt>HTTP_FIELD_USER_AGENT </dt>
9408 <dd class="description">User-Agent field</dd>
9409 <dt>HTTP_FIELD_WWW_AUTHENTICATE </dt>
9410 <dd class="description">WWW-Authenticate field</dd>
9411</dl>
9412 <h3 class="enumeration"><a id="http_keepalive_e">http_keepalive_e</a></h3>
9413 <p class="description">HTTP keep-alive values</p>
9414 <h4 class="constants">Constants</h4>
9415 <dl>
9416 <dt>HTTP_KEEPALIVE_OFF </dt>
9417 <dd class="description">No keep alive support</dd>
9418 <dt>HTTP_KEEPALIVE_ON </dt>
9419 <dd class="description">Use keep alive</dd>
9420</dl>
9421 <h3 class="enumeration"><a id="http_state_e">http_state_e</a></h3>
9422 <p class="description">HTTP state values; states
9423are server-oriented...</p>
9424 <h4 class="constants">Constants</h4>
9425 <dl>
9426 <dt>HTTP_STATE_CONNECT </dt>
9427 <dd class="description">CONNECT command, waiting for blank line</dd>
9428 <dt>HTTP_STATE_DELETE </dt>
9429 <dd class="description">DELETE command, waiting for blank line</dd>
9430 <dt>HTTP_STATE_ERROR </dt>
9431 <dd class="description">Error on socket</dd>
9432 <dt>HTTP_STATE_GET </dt>
9433 <dd class="description">GET command, waiting for blank line</dd>
9434 <dt>HTTP_STATE_GET_SEND </dt>
9435 <dd class="description">GET command, sending data</dd>
9436 <dt>HTTP_STATE_HEAD </dt>
9437 <dd class="description">HEAD command, waiting for blank line</dd>
9438 <dt>HTTP_STATE_OPTIONS </dt>
9439 <dd class="description">OPTIONS command, waiting for blank line</dd>
9440 <dt>HTTP_STATE_POST </dt>
9441 <dd class="description">POST command, waiting for blank line</dd>
9442 <dt>HTTP_STATE_POST_RECV </dt>
9443 <dd class="description">POST command, receiving data</dd>
9444 <dt>HTTP_STATE_POST_SEND </dt>
9445 <dd class="description">POST command, sending data</dd>
9446 <dt>HTTP_STATE_PUT </dt>
9447 <dd class="description">PUT command, waiting for blank line</dd>
9448 <dt>HTTP_STATE_PUT_RECV </dt>
9449 <dd class="description">PUT command, receiving data</dd>
9450 <dt>HTTP_STATE_STATUS </dt>
9451 <dd class="description">Command complete, sending status</dd>
9452 <dt>HTTP_STATE_TRACE </dt>
9453 <dd class="description">TRACE command, waiting for blank line</dd>
9454 <dt>HTTP_STATE_UNKNOWN_METHOD <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></dt>
9455 <dd class="description">Unknown request method, waiting for blank line </dd>
9456 <dt>HTTP_STATE_UNKNOWN_VERSION <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></dt>
9457 <dd class="description">Unknown request method, waiting for blank line </dd>
9458 <dt>HTTP_STATE_WAITING </dt>
9459 <dd class="description">Waiting for command</dd>
9460</dl>
9461 <h3 class="enumeration"><a id="http_status_e">http_status_e</a></h3>
9462 <p class="description">HTTP status codes</p>
9463 <h4 class="constants">Constants</h4>
9464 <dl>
9465 <dt>HTTP_STATUS_ACCEPTED </dt>
9466 <dd class="description">DELETE command was successful</dd>
9467 <dt>HTTP_STATUS_BAD_GATEWAY </dt>
9468 <dd class="description">Bad gateway</dd>
9469 <dt>HTTP_STATUS_BAD_REQUEST </dt>
9470 <dd class="description">Bad request</dd>
9471 <dt>HTTP_STATUS_CONFLICT </dt>
9472 <dd class="description">Request is self-conflicting</dd>
9473 <dt>HTTP_STATUS_CONTINUE </dt>
9474 <dd class="description">Everything OK, keep going...</dd>
9475 <dt>HTTP_STATUS_CREATED </dt>
9476 <dd class="description">PUT command was successful</dd>
9477 <dt>HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED <span class="info">&#160;CUPS 1.4&#160;</span></dt>
9478 <dd class="description">User canceled authorization </dd>
9479 <dt>HTTP_STATUS_CUPS_PKI_ERROR <span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span></dt>
9480 <dd class="description">Error negotiating a secure connection </dd>
9481 <dt>HTTP_STATUS_ERROR </dt>
9482 <dd class="description">An error response from httpXxxx()</dd>
9483 <dt>HTTP_STATUS_EXPECTATION_FAILED </dt>
9484 <dd class="description">The expectation given in an Expect header field was not met</dd>
9485 <dt>HTTP_STATUS_FORBIDDEN </dt>
9486 <dd class="description">Forbidden to access this URI</dd>
9487 <dt>HTTP_STATUS_GATEWAY_TIMEOUT </dt>
9488 <dd class="description">Gateway connection timed out</dd>
9489 <dt>HTTP_STATUS_GONE </dt>
9490 <dd class="description">Server has gone away</dd>
9491 <dt>HTTP_STATUS_LENGTH_REQUIRED </dt>
9492 <dd class="description">A content length or encoding is required</dd>
9493 <dt>HTTP_STATUS_METHOD_NOT_ALLOWED </dt>
9494 <dd class="description">Method is not allowed</dd>
9495 <dt>HTTP_STATUS_MOVED_PERMANENTLY </dt>
9496 <dd class="description">Document has moved permanently</dd>
9497 <dt>HTTP_STATUS_MOVED_TEMPORARILY </dt>
9498 <dd class="description">Document has moved temporarily</dd>
9499 <dt>HTTP_STATUS_MULTIPLE_CHOICES </dt>
9500 <dd class="description">Multiple files match request</dd>
9501 <dt>HTTP_STATUS_NONE <span class="info">&#160;CUPS 1.7/macOS 10.9&#160;</span></dt>
9502 <dd class="description">No Expect value </dd>
9503 <dt>HTTP_STATUS_NOT_ACCEPTABLE </dt>
9504 <dd class="description">Not Acceptable</dd>
9505 <dt>HTTP_STATUS_NOT_AUTHORITATIVE </dt>
9506 <dd class="description">Information isn't authoritative</dd>
9507 <dt>HTTP_STATUS_NOT_FOUND </dt>
9508 <dd class="description">URI was not found</dd>
9509 <dt>HTTP_STATUS_NOT_IMPLEMENTED </dt>
9510 <dd class="description">Feature not implemented</dd>
9511 <dt>HTTP_STATUS_NOT_MODIFIED </dt>
9512 <dd class="description">File not modified</dd>
9513 <dt>HTTP_STATUS_NOT_SUPPORTED </dt>
9514 <dd class="description">HTTP version not supported</dd>
9515 <dt>HTTP_STATUS_NO_CONTENT </dt>
9516 <dd class="description">Successful command, no new data</dd>
9517 <dt>HTTP_STATUS_OK </dt>
9518 <dd class="description">OPTIONS/GET/HEAD/POST/TRACE command was successful</dd>
9519 <dt>HTTP_STATUS_PARTIAL_CONTENT </dt>
9520 <dd class="description">Only a partial file was received/sent</dd>
9521 <dt>HTTP_STATUS_PAYMENT_REQUIRED </dt>
9522 <dd class="description">Payment required</dd>
9523 <dt>HTTP_STATUS_PRECONDITION </dt>
9524 <dd class="description">Precondition failed</dd>
9525 <dt>HTTP_STATUS_PROXY_AUTHENTICATION </dt>
9526 <dd class="description">Proxy Authentication is Required</dd>
9527 <dt>HTTP_STATUS_REQUESTED_RANGE </dt>
9528 <dd class="description">The requested range is not satisfiable</dd>
9529 <dt>HTTP_STATUS_REQUEST_TIMEOUT </dt>
9530 <dd class="description">Request timed out</dd>
9531 <dt>HTTP_STATUS_REQUEST_TOO_LARGE </dt>
9532 <dd class="description">Request entity too large</dd>
9533 <dt>HTTP_STATUS_RESET_CONTENT </dt>
9534 <dd class="description">Content was reset/recreated</dd>
9535 <dt>HTTP_STATUS_SEE_OTHER </dt>
9536 <dd class="description">See this other link...</dd>
9537 <dt>HTTP_STATUS_SERVER_ERROR </dt>
9538 <dd class="description">Internal server error</dd>
9539 <dt>HTTP_STATUS_SERVICE_UNAVAILABLE </dt>
9540 <dd class="description">Service is unavailable</dd>
9541 <dt>HTTP_STATUS_SWITCHING_PROTOCOLS </dt>
9542 <dd class="description">HTTP upgrade to TLS/SSL</dd>
9543 <dt>HTTP_STATUS_UNAUTHORIZED </dt>
9544 <dd class="description">Unauthorized to access host</dd>
9545 <dt>HTTP_STATUS_UNSUPPORTED_MEDIATYPE </dt>
9546 <dd class="description">The requested media type is unsupported</dd>
9547 <dt>HTTP_STATUS_UPGRADE_REQUIRED </dt>
9548 <dd class="description">Upgrade to SSL/TLS required</dd>
9549 <dt>HTTP_STATUS_URI_TOO_LONG </dt>
9550 <dd class="description">URI too long</dd>
9551 <dt>HTTP_STATUS_USE_PROXY </dt>
9552 <dd class="description">Must use a proxy to access this URI</dd>
9553</dl>
9554 <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>
9555 <p class="description">Level of trust for credentials </p>
9556 <h4 class="constants">Constants</h4>
9557 <dl>
9558 <dt>HTTP_TRUST_CHANGED </dt>
9559 <dd class="description">Credentials have changed</dd>
9560 <dt>HTTP_TRUST_EXPIRED </dt>
9561 <dd class="description">Credentials are expired</dd>
9562 <dt>HTTP_TRUST_INVALID </dt>
9563 <dd class="description">Credentials are invalid</dd>
9564 <dt>HTTP_TRUST_OK </dt>
9565 <dd class="description">Credentials are OK/trusted</dd>
9566 <dt>HTTP_TRUST_RENEWED </dt>
9567 <dd class="description">Credentials have been renewed</dd>
9568 <dt>HTTP_TRUST_UNKNOWN </dt>
9569 <dd class="description">Credentials are unknown/new</dd>
9570</dl>
9571 <h3 class="enumeration"><a id="http_uri_coding_e">http_uri_coding_e</a></h3>
9572 <p class="description">URI en/decode flags</p>
9573 <h4 class="constants">Constants</h4>
9574 <dl>
9575 <dt>HTTP_URI_CODING_ALL </dt>
9576 <dd class="description">En/decode everything</dd>
9577 <dt>HTTP_URI_CODING_HOSTNAME </dt>
9578 <dd class="description">En/decode the hostname portion</dd>
9579 <dt>HTTP_URI_CODING_MOST </dt>
9580 <dd class="description">En/decode all but the query</dd>
9581 <dt>HTTP_URI_CODING_NONE </dt>
9582 <dd class="description">Don't en/decode anything</dd>
9583 <dt>HTTP_URI_CODING_QUERY </dt>
9584 <dd class="description">En/decode the query portion</dd>
9585 <dt>HTTP_URI_CODING_RESOURCE </dt>
9586 <dd class="description">En/decode the resource portion</dd>
9587 <dt>HTTP_URI_CODING_RFC6874 </dt>
9588 <dd class="description">Use RFC 6874 address format</dd>
9589 <dt>HTTP_URI_CODING_USERNAME </dt>
9590 <dd class="description">En/decode the username portion</dd>
9591</dl>
9592 <h3 class="enumeration"><a id="http_uri_status_e"><span class="info">&#160;CUPS 1.2&#160;</span>http_uri_status_e</a></h3>
9593 <p class="description">URI separation status </p>
9594 <h4 class="constants">Constants</h4>
9595 <dl>
9596 <dt>HTTP_URI_STATUS_BAD_ARGUMENTS </dt>
9597 <dd class="description">Bad arguments to function (error)</dd>
9598 <dt>HTTP_URI_STATUS_BAD_HOSTNAME </dt>
9599 <dd class="description">Bad hostname in URI (error)</dd>
9600 <dt>HTTP_URI_STATUS_BAD_PORT </dt>
9601 <dd class="description">Bad port number in URI (error)</dd>
9602 <dt>HTTP_URI_STATUS_BAD_RESOURCE </dt>
9603 <dd class="description">Bad resource in URI (error)</dd>
9604 <dt>HTTP_URI_STATUS_BAD_SCHEME </dt>
9605 <dd class="description">Bad scheme in URI (error)</dd>
9606 <dt>HTTP_URI_STATUS_BAD_URI </dt>
9607 <dd class="description">Bad/empty URI (error)</dd>
9608 <dt>HTTP_URI_STATUS_BAD_USERNAME </dt>
9609 <dd class="description">Bad username in URI (error)</dd>
9610 <dt>HTTP_URI_STATUS_MISSING_RESOURCE </dt>
9611 <dd class="description">Missing resource in URI (warning)</dd>
9612 <dt>HTTP_URI_STATUS_MISSING_SCHEME </dt>
9613 <dd class="description">Missing scheme in URI (warning)</dd>
9614 <dt>HTTP_URI_STATUS_OK </dt>
9615 <dd class="description">URI decoded OK</dd>
9616 <dt>HTTP_URI_STATUS_OVERFLOW </dt>
9617 <dd class="description">URI buffer for httpAssembleURI is too small</dd>
9618 <dt>HTTP_URI_STATUS_UNKNOWN_SCHEME </dt>
9619 <dd class="description">Unknown scheme in URI (warning)</dd>
9620</dl>
9621 <h3 class="enumeration"><a id="http_version_e">http_version_e</a></h3>
9622 <p class="description">HTTP version numbers</p>
9623 <h4 class="constants">Constants</h4>
9624 <dl>
9625 <dt>HTTP_VERSION_0_9 </dt>
9626 <dd class="description">HTTP/0.9</dd>
9627 <dt>HTTP_VERSION_1_0 </dt>
9628 <dd class="description">HTTP/1.0</dd>
9629 <dt>HTTP_VERSION_1_1 </dt>
9630 <dd class="description">HTTP/1.1</dd>
9631</dl>
9632 <h3 class="enumeration"><a id="ipp_dstate_e">ipp_dstate_e</a></h3>
9633 <p class="description">Document states</p>
9634 <h4 class="constants">Constants</h4>
9635 <dl>
9636 <dt>IPP_DOCUMENT_ABORTED </dt>
9637 <dd class="description">Document is aborted</dd>
9638 <dt>IPP_DOCUMENT_CANCELED </dt>
9639 <dd class="description">Document is canceled</dd>
9640 <dt>IPP_DOCUMENT_COMPLETED </dt>
9641 <dd class="description">Document is completed</dd>
9642 <dt>IPP_DOCUMENT_PENDING </dt>
9643 <dd class="description">Document is pending</dd>
9644 <dt>IPP_DOCUMENT_PROCESSING </dt>
9645 <dd class="description">Document is processing</dd>
9646</dl>
9647 <h3 class="enumeration"><a id="ipp_finishings_e">ipp_finishings_e</a></h3>
9648 <p class="description">Finishings</p>
9649 <h4 class="constants">Constants</h4>
9650 <dl>
9651 <dt>IPP_FINISHINGS_BALE </dt>
9652 <dd class="description">Bale (any type)</dd>
9653 <dt>IPP_FINISHINGS_BIND </dt>
9654 <dd class="description">Bind</dd>
9655 <dt>IPP_FINISHINGS_BIND_BOTTOM </dt>
9656 <dd class="description">Bind on bottom</dd>
9657 <dt>IPP_FINISHINGS_BIND_LEFT </dt>
9658 <dd class="description">Bind on left</dd>
9659 <dt>IPP_FINISHINGS_BIND_RIGHT </dt>
9660 <dd class="description">Bind on right</dd>
9661 <dt>IPP_FINISHINGS_BIND_TOP </dt>
9662 <dd class="description">Bind on top</dd>
9663 <dt>IPP_FINISHINGS_BOOKLET_MAKER </dt>
9664 <dd class="description">Fold to make booklet</dd>
9665 <dt>IPP_FINISHINGS_COAT </dt>
9666 <dd class="description">Apply protective liquid or powder coating</dd>
9667 <dt>IPP_FINISHINGS_COVER </dt>
9668 <dd class="description">Add cover</dd>
9669 <dt>IPP_FINISHINGS_CUPS_FOLD_ACCORDIAN </dt>
9670 <dd class="description">Accordian-fold the paper vertically into four sections</dd>
9671 <dt>IPP_FINISHINGS_CUPS_FOLD_DOUBLE_GATE </dt>
9672 <dd class="description">Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically</dd>
9673 <dt>IPP_FINISHINGS_CUPS_FOLD_GATE </dt>
9674 <dd class="description">Fold the top and bottom quarters of the paper towards the midline</dd>
9675 <dt>IPP_FINISHINGS_CUPS_FOLD_HALF </dt>
9676 <dd class="description">Fold the paper in half vertically</dd>
9677 <dt>IPP_FINISHINGS_CUPS_FOLD_HALF_Z </dt>
9678 <dd class="description">Fold the paper in half horizontally, then Z-fold the paper vertically</dd>
9679 <dt>IPP_FINISHINGS_CUPS_FOLD_LEFT_GATE </dt>
9680 <dd class="description">Fold the top quarter of the paper towards the midline</dd>
9681 <dt>IPP_FINISHINGS_CUPS_FOLD_LETTER </dt>
9682 <dd class="description">Fold the paper into three sections vertically; sometimes also known as a C fold</dd>
9683 <dt>IPP_FINISHINGS_CUPS_FOLD_PARALLEL </dt>
9684 <dd class="description">Fold the paper in half vertically two times, yielding four sections</dd>
9685 <dt>IPP_FINISHINGS_CUPS_FOLD_POSTER </dt>
9686 <dd class="description">Fold the paper in half horizontally and vertically; sometimes also called a cross fold</dd>
9687 <dt>IPP_FINISHINGS_CUPS_FOLD_RIGHT_GATE </dt>
9688 <dd class="description">Fold the bottom quarter of the paper towards the midline</dd>
9689 <dt>IPP_FINISHINGS_CUPS_FOLD_Z </dt>
9690 <dd class="description">Fold the paper vertically into three sections, forming a Z</dd>
9691 <dt>IPP_FINISHINGS_CUPS_PUNCH_BOTTOM_LEFT </dt>
9692 <dd class="description">Punch 1 hole bottom left</dd>
9693 <dt>IPP_FINISHINGS_CUPS_PUNCH_BOTTOM_RIGHT </dt>
9694 <dd class="description">Punch 1 hole bottom right</dd>
9695 <dt>IPP_FINISHINGS_CUPS_PUNCH_DUAL_BOTTOM </dt>
9696 <dd class="description">Punch 2 holes bottom edge</dd>
9697 <dt>IPP_FINISHINGS_CUPS_PUNCH_DUAL_LEFT </dt>
9698 <dd class="description">Punch 2 holes left side</dd>
9699 <dt>IPP_FINISHINGS_CUPS_PUNCH_DUAL_RIGHT </dt>
9700 <dd class="description">Punch 2 holes right side</dd>
9701 <dt>IPP_FINISHINGS_CUPS_PUNCH_DUAL_TOP </dt>
9702 <dd class="description">Punch 2 holes top edge</dd>
9703 <dt>IPP_FINISHINGS_CUPS_PUNCH_QUAD_BOTTOM </dt>
9704 <dd class="description">Punch 4 holes bottom edge</dd>
9705 <dt>IPP_FINISHINGS_CUPS_PUNCH_QUAD_LEFT </dt>
9706 <dd class="description">Punch 4 holes left side</dd>
9707 <dt>IPP_FINISHINGS_CUPS_PUNCH_QUAD_RIGHT </dt>
9708 <dd class="description">Punch 4 holes right side</dd>
9709 <dt>IPP_FINISHINGS_CUPS_PUNCH_QUAD_TOP </dt>
9710 <dd class="description">Punch 4 holes top edge</dd>
9711 <dt>IPP_FINISHINGS_CUPS_PUNCH_TOP_LEFT </dt>
9712 <dd class="description">Punch 1 hole top left</dd>
9713 <dt>IPP_FINISHINGS_CUPS_PUNCH_TOP_RIGHT </dt>
9714 <dd class="description">Punch 1 hole top right</dd>
9715 <dt>IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_BOTTOM </dt>
9716 <dd class="description">Punch 3 holes bottom edge</dd>
9717 <dt>IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_LEFT </dt>
9718 <dd class="description">Punch 3 holes left side</dd>
9719 <dt>IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_RIGHT </dt>
9720 <dd class="description">Punch 3 holes right side</dd>
9721 <dt>IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_TOP </dt>
9722 <dd class="description">Punch 3 holes top edge</dd>
9723 <dt>IPP_FINISHINGS_EDGE_STITCH </dt>
9724 <dd class="description">Stitch along any side</dd>
9725 <dt>IPP_FINISHINGS_EDGE_STITCH_BOTTOM </dt>
9726 <dd class="description">Stitch along bottom edge</dd>
9727 <dt>IPP_FINISHINGS_EDGE_STITCH_LEFT </dt>
9728 <dd class="description">Stitch along left side</dd>
9729 <dt>IPP_FINISHINGS_EDGE_STITCH_RIGHT </dt>
9730 <dd class="description">Stitch along right side</dd>
9731 <dt>IPP_FINISHINGS_EDGE_STITCH_TOP </dt>
9732 <dd class="description">Stitch along top edge</dd>
9733 <dt>IPP_FINISHINGS_FOLD </dt>
9734 <dd class="description">Fold (any type)</dd>
9735 <dt>IPP_FINISHINGS_FOLD_ACCORDIAN </dt>
9736 <dd class="description">Accordian-fold the paper vertically into four sections</dd>
9737 <dt>IPP_FINISHINGS_FOLD_DOUBLE_GATE </dt>
9738 <dd class="description">Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically</dd>
9739 <dt>IPP_FINISHINGS_FOLD_ENGINEERING_Z </dt>
9740 <dd class="description">Fold the paper vertically into two small sections and one larger, forming an elongated Z</dd>
9741 <dt>IPP_FINISHINGS_FOLD_GATE </dt>
9742 <dd class="description">Fold the top and bottom quarters of the paper towards the midline</dd>
9743 <dt>IPP_FINISHINGS_FOLD_HALF </dt>
9744 <dd class="description">Fold the paper in half vertically</dd>
9745 <dt>IPP_FINISHINGS_FOLD_HALF_Z </dt>
9746 <dd class="description">Fold the paper in half horizontally, then Z-fold the paper vertically</dd>
9747 <dt>IPP_FINISHINGS_FOLD_LEFT_GATE </dt>
9748 <dd class="description">Fold the top quarter of the paper towards the midline</dd>
9749 <dt>IPP_FINISHINGS_FOLD_LETTER </dt>
9750 <dd class="description">Fold the paper into three sections vertically; sometimes also known as a C fold</dd>
9751 <dt>IPP_FINISHINGS_FOLD_PARALLEL </dt>
9752 <dd class="description">Fold the paper in half vertically two times, yielding four sections</dd>
9753 <dt>IPP_FINISHINGS_FOLD_POSTER </dt>
9754 <dd class="description">Fold the paper in half horizontally and vertically; sometimes also called a cross fold</dd>
9755 <dt>IPP_FINISHINGS_FOLD_RIGHT_GATE </dt>
9756 <dd class="description">Fold the bottom quarter of the paper towards the midline</dd>
9757 <dt>IPP_FINISHINGS_FOLD_Z </dt>
9758 <dd class="description">Fold the paper vertically into three sections, forming a Z</dd>
9759 <dt>IPP_FINISHINGS_JOG_OFFSET </dt>
9760 <dd class="description">Offset for binding (any type)</dd>
9761 <dt>IPP_FINISHINGS_LAMINATE </dt>
9762 <dd class="description">Apply protective (solid) material</dd>
9763 <dt>IPP_FINISHINGS_NONE </dt>
9764 <dd class="description">No finishing</dd>
9765 <dt>IPP_FINISHINGS_PUNCH </dt>
9766 <dd class="description">Punch (any location/count)</dd>
9767 <dt>IPP_FINISHINGS_PUNCH_BOTTOM_LEFT </dt>
9768 <dd class="description">Punch 1 hole bottom left</dd>
9769 <dt>IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT </dt>
9770 <dd class="description">Punch 1 hole bottom right</dd>
9771 <dt>IPP_FINISHINGS_PUNCH_DUAL_BOTTOM </dt>
9772 <dd class="description">Punch 2 holes bottom edge</dd>
9773 <dt>IPP_FINISHINGS_PUNCH_DUAL_LEFT </dt>
9774 <dd class="description">Punch 2 holes left side</dd>
9775 <dt>IPP_FINISHINGS_PUNCH_DUAL_RIGHT </dt>
9776 <dd class="description">Punch 2 holes right side</dd>
9777 <dt>IPP_FINISHINGS_PUNCH_DUAL_TOP </dt>
9778 <dd class="description">Punch 2 holes top edge</dd>
9779 <dt>IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM </dt>
9780 <dd class="description">Pucnh multiple holes bottom edge</dd>
9781 <dt>IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT </dt>
9782 <dd class="description">Pucnh multiple holes left side</dd>
9783 <dt>IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT </dt>
9784 <dd class="description">Pucnh multiple holes right side</dd>
9785 <dt>IPP_FINISHINGS_PUNCH_MULTIPLE_TOP </dt>
9786 <dd class="description">Pucnh multiple holes top edge</dd>
9787 <dt>IPP_FINISHINGS_PUNCH_QUAD_BOTTOM </dt>
9788 <dd class="description">Punch 4 holes bottom edge</dd>
9789 <dt>IPP_FINISHINGS_PUNCH_QUAD_LEFT </dt>
9790 <dd class="description">Punch 4 holes left side</dd>
9791 <dt>IPP_FINISHINGS_PUNCH_QUAD_RIGHT </dt>
9792 <dd class="description">Punch 4 holes right side</dd>
9793 <dt>IPP_FINISHINGS_PUNCH_QUAD_TOP </dt>
9794 <dd class="description">Punch 4 holes top edge</dd>
9795 <dt>IPP_FINISHINGS_PUNCH_TOP_LEFT </dt>
9796 <dd class="description">Punch 1 hole top left</dd>
9797 <dt>IPP_FINISHINGS_PUNCH_TOP_RIGHT </dt>
9798 <dd class="description">Punch 1 hole top right</dd>
9799 <dt>IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM </dt>
9800 <dd class="description">Punch 3 holes bottom edge</dd>
9801 <dt>IPP_FINISHINGS_PUNCH_TRIPLE_LEFT </dt>
9802 <dd class="description">Punch 3 holes left side</dd>
9803 <dt>IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT </dt>
9804 <dd class="description">Punch 3 holes right side</dd>
9805 <dt>IPP_FINISHINGS_PUNCH_TRIPLE_TOP </dt>
9806 <dd class="description">Punch 3 holes top edge</dd>
9807 <dt>IPP_FINISHINGS_SADDLE_STITCH </dt>
9808 <dd class="description">Staple interior</dd>
9809 <dt>IPP_FINISHINGS_STAPLE </dt>
9810 <dd class="description">Staple (any location)</dd>
9811 <dt>IPP_FINISHINGS_STAPLE_BOTTOM_LEFT </dt>
9812 <dd class="description">Staple bottom left corner</dd>
9813 <dt>IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT </dt>
9814 <dd class="description">Staple bottom right corner</dd>
9815 <dt>IPP_FINISHINGS_STAPLE_DUAL_BOTTOM </dt>
9816 <dd class="description">Two staples on bottom</dd>
9817 <dt>IPP_FINISHINGS_STAPLE_DUAL_LEFT </dt>
9818 <dd class="description">Two staples on left</dd>
9819 <dt>IPP_FINISHINGS_STAPLE_DUAL_RIGHT </dt>
9820 <dd class="description">Two staples on right</dd>
9821 <dt>IPP_FINISHINGS_STAPLE_DUAL_TOP </dt>
9822 <dd class="description">Two staples on top</dd>
9823 <dt>IPP_FINISHINGS_STAPLE_TOP_LEFT </dt>
9824 <dd class="description">Staple top left corner</dd>
9825 <dt>IPP_FINISHINGS_STAPLE_TOP_RIGHT </dt>
9826 <dd class="description">Staple top right corner</dd>
9827 <dt>IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM </dt>
9828 <dd class="description">Three staples on bottom</dd>
9829 <dt>IPP_FINISHINGS_STAPLE_TRIPLE_LEFT </dt>
9830 <dd class="description">Three staples on left</dd>
9831 <dt>IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT </dt>
9832 <dd class="description">Three staples on right</dd>
9833 <dt>IPP_FINISHINGS_STAPLE_TRIPLE_TOP </dt>
9834 <dd class="description">Three staples on top</dd>
9835 <dt>IPP_FINISHINGS_TRIM </dt>
9836 <dd class="description">Trim (any type)</dd>
9837 <dt>IPP_FINISHINGS_TRIM_AFTER_COPIES </dt>
9838 <dd class="description">Trim output after each copy</dd>
9839 <dt>IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS </dt>
9840 <dd class="description">Trim output after each document</dd>
9841 <dt>IPP_FINISHINGS_TRIM_AFTER_JOB </dt>
9842 <dd class="description">Trim output after job</dd>
9843 <dt>IPP_FINISHINGS_TRIM_AFTER_PAGES </dt>
9844 <dd class="description">Trim output after each page</dd>
9845</dl>
9846 <h3 class="enumeration"><a id="ipp_jcollate_e">ipp_jcollate_e</a></h3>
9847 <p class="description">Job collation types</p>
9848 <h4 class="constants">Constants</h4>
9849 <dl>
9850 <dt>IPP_JCOLLATE_COLLATED_DOCUMENTS </dt>
9851 <dt>IPP_JCOLLATE_UNCOLLATED_DOCUMENTS </dt>
9852 <dt>IPP_JCOLLATE_UNCOLLATED_SHEETS </dt>
9853</dl>
9854 <h3 class="enumeration"><a id="ipp_jstate_e">ipp_jstate_e</a></h3>
9855 <p class="description">Job states</p>
9856 <h4 class="constants">Constants</h4>
9857 <dl>
9858 <dt>IPP_JSTATE_ABORTED </dt>
9859 <dd class="description">Job has aborted due to error</dd>
9860 <dt>IPP_JSTATE_CANCELED </dt>
9861 <dd class="description">Job has been canceled</dd>
9862 <dt>IPP_JSTATE_COMPLETED </dt>
9863 <dd class="description">Job has completed successfully</dd>
9864 <dt>IPP_JSTATE_HELD </dt>
9865 <dd class="description">Job is held for printing</dd>
9866 <dt>IPP_JSTATE_PENDING </dt>
9867 <dd class="description">Job is waiting to be printed</dd>
9868 <dt>IPP_JSTATE_PROCESSING </dt>
9869 <dd class="description">Job is currently printing</dd>
9870 <dt>IPP_JSTATE_STOPPED </dt>
9871 <dd class="description">Job has been stopped</dd>
9872</dl>
9873 <h3 class="enumeration"><a id="ipp_op_e">ipp_op_e</a></h3>
9874 <p class="description">IPP operations</p>
9875 <h4 class="constants">Constants</h4>
9876 <dl>
9877 <dt>IPP_OP_ACKNOWLEDGE_DOCUMENT </dt>
9878 <dd class="description">Acknowledge-Document</dd>
9879 <dt>IPP_OP_ACKNOWLEDGE_IDENTIFY_PRINTER </dt>
9880 <dd class="description">Acknowledge-Identify-Printer</dd>
9881 <dt>IPP_OP_ACKNOWLEDGE_JOB </dt>
9882 <dd class="description">Acknowledge-Job</dd>
9883 <dt>IPP_OP_ACTIVATE_PRINTER </dt>
9884 <dd class="description">Start a printer</dd>
9885 <dt>IPP_OP_ADD_DOCUMENT_IMAGES </dt>
9886 <dd class="description">Add-Document-Images</dd>
9887 <dt>IPP_OP_CANCEL_CURRENT_JOB </dt>
9888 <dd class="description">Cancel the current job</dd>
9889 <dt>IPP_OP_CANCEL_DOCUMENT </dt>
9890 <dd class="description">Cancel-Document</dd>
9891 <dt>IPP_OP_CANCEL_JOB </dt>
9892 <dd class="description">Cancel a job</dd>
9893 <dt>IPP_OP_CANCEL_JOBS </dt>
9894 <dd class="description">Cancel-Jobs</dd>
9895 <dt>IPP_OP_CANCEL_MY_JOBS </dt>
9896 <dd class="description">Cancel-My-Jobs</dd>
9897 <dt>IPP_OP_CANCEL_SUBSCRIPTION <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
9898 <dd class="description">Cancel a subscription </dd>
9899 <dt>IPP_OP_CLOSE_JOB </dt>
9900 <dd class="description">Close-Job</dd>
9901 <dt>IPP_OP_CREATE_JOB </dt>
9902 <dd class="description">Create an empty print job</dd>
9903 <dt>IPP_OP_CREATE_JOB_SUBSCRIPTIONS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
9904 <dd class="description">Create one of more job subscriptions </dd>
9905 <dt>IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
9906 <dd class="description">Create one or more printer subscriptions </dd>
9907 <dt>IPP_OP_CUPS_ACCEPT_JOBS </dt>
9908 <dd class="description">Accept new jobs on a printer</dd>
9909 <dt>IPP_OP_CUPS_ADD_MODIFY_CLASS </dt>
9910 <dd class="description">Add or modify a class</dd>
9911 <dt>IPP_OP_CUPS_ADD_MODIFY_PRINTER </dt>
9912 <dd class="description">Add or modify a printer</dd>
9913 <dt>IPP_OP_CUPS_AUTHENTICATE_JOB <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
9914 <dd class="description">Authenticate a job </dd>
9915 <dt>IPP_OP_CUPS_CREATE_LOCAL_PRINTER <span class="info">&#160;CUPS 2.2&#160;</span></dt>
869c2060
MS
9916 <dd class="description">Create a local (temporary) printer </dd>
9917 <dt>IPP_OP_CUPS_DELETE_CLASS </dt>
798d6e29
MS
9918 <dd class="description">Delete a class</dd>
9919 <dt>IPP_OP_CUPS_DELETE_PRINTER </dt>
9920 <dd class="description">Delete a printer</dd>
9921 <dt>IPP_OP_CUPS_GET_CLASSES <span class="info">&#160;DEPRECATED&#160;</span></dt>
9922 <dd class="description">Get a list of classes </dd>
9923 <dt>IPP_OP_CUPS_GET_DEFAULT </dt>
9924 <dd class="description">Get the default printer</dd>
9925 <dt>IPP_OP_CUPS_GET_DEVICES <span class="info">&#160;DEPRECATED&#160;</span></dt>
9926 <dd class="description">Get a list of supported devices </dd>
9927 <dt>IPP_OP_CUPS_GET_DOCUMENT <span class="info">&#160;CUPS 1.4/macOS 10.6&#160;</span></dt>
9928 <dd class="description">Get a document file </dd>
9929 <dt>IPP_OP_CUPS_GET_PPD <span class="info">&#160;DEPRECATED&#160;</span></dt>
9930 <dd class="description">Get a PPD file </dd>
9931 <dt>IPP_OP_CUPS_GET_PPDS <span class="info">&#160;DEPRECATED&#160;</span></dt>
9932 <dd class="description">Get a list of supported drivers </dd>
9933 <dt>IPP_OP_CUPS_GET_PRINTERS </dt>
9934 <dd class="description">Get a list of printers and/or classes</dd>
9935 <dt>IPP_OP_CUPS_INVALID </dt>
9936 <dd class="description">Invalid operation name for <a href="#ippOpValue"><code>ippOpValue</code></a></dd>
9937 <dt>IPP_OP_CUPS_MOVE_JOB </dt>
9938 <dd class="description">Move a job to a different printer</dd>
9939 <dt>IPP_OP_CUPS_REJECT_JOBS </dt>
9940 <dd class="description">Reject new jobs on a printer</dd>
9941 <dt>IPP_OP_CUPS_SET_DEFAULT </dt>
9942 <dd class="description">Set the default printer</dd>
9943 <dt>IPP_OP_DEACTIVATE_PRINTER </dt>
9944 <dd class="description">Stop a printer</dd>
9945 <dt>IPP_OP_DELETE_DOCUMENT </dt>
9946 <dd class="description">Delete-Document</dd>
9947 <dt>IPP_OP_DEREGISTER_OUTPUT_DEVICE </dt>
9948 <dd class="description">Deregister-Output-Device</dd>
9949 <dt>IPP_OP_DISABLE_PRINTER </dt>
9950 <dd class="description">Stop a printer</dd>
9951 <dt>IPP_OP_ENABLE_PRINTER </dt>
9952 <dd class="description">Start a printer</dd>
9953 <dt>IPP_OP_FETCH_DOCUMENT </dt>
9954 <dd class="description">Fetch-Document</dd>
9955 <dt>IPP_OP_FETCH_JOB </dt>
9956 <dd class="description">Fetch-Job</dd>
9957 <dt>IPP_OP_GET_DOCUMENTS </dt>
9958 <dd class="description">Get-Documents</dd>
9959 <dt>IPP_OP_GET_DOCUMENT_ATTRIBUTES </dt>
9960 <dd class="description">Get-Document-Attributes</dd>
9961 <dt>IPP_OP_GET_JOBS </dt>
9962 <dd class="description">Get a list of jobs</dd>
9963 <dt>IPP_OP_GET_JOB_ATTRIBUTES </dt>
9964 <dd class="description">Get job attributes</dd>
9965 <dt>IPP_OP_GET_NEXT_DOCUMENT_DATA </dt>
9966 <dd class="description">Get-Next-Document-Data</dd>
9967 <dt>IPP_OP_GET_NOTIFICATIONS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
9968 <dd class="description">Get notification events </dd>
9969 <dt>IPP_OP_GET_OUTPUT_DEVICE_ATTRIBUTES </dt>
9970 <dd class="description">Get-Output-Device-Attributes</dd>
9971 <dt>IPP_OP_GET_PRINTER_ATTRIBUTES </dt>
9972 <dd class="description">Get printer attributes</dd>
9973 <dt>IPP_OP_GET_PRINTER_SUPPORTED_VALUES </dt>
9974 <dd class="description">Get supported attribute values</dd>
9975 <dt>IPP_OP_GET_SUBSCRIPTIONS <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
9976 <dd class="description">Get list of subscriptions </dd>
9977 <dt>IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
9978 <dd class="description">Get subscription attributes </dd>
9979 <dt>IPP_OP_HOLD_JOB </dt>
9980 <dd class="description">Hold a job for printing</dd>
9981 <dt>IPP_OP_HOLD_NEW_JOBS </dt>
9982 <dd class="description">Hold new jobs</dd>
9983 <dt>IPP_OP_IDENTIFY_PRINTER </dt>
9984 <dd class="description">Identify-Printer</dd>
9985 <dt>IPP_OP_PAUSE_PRINTER </dt>
9986 <dd class="description">Stop a printer</dd>
9987 <dt>IPP_OP_PAUSE_PRINTER_AFTER_CURRENT_JOB </dt>
9988 <dd class="description">Stop printer after the current job</dd>
9989 <dt>IPP_OP_PRINT_JOB </dt>
9990 <dd class="description">Print a single file</dd>
9991 <dt>IPP_OP_PRINT_URI </dt>
9992 <dd class="description">Print a single URL</dd>
9993 <dt>IPP_OP_PROMOTE_JOB </dt>
9994 <dd class="description">Promote a job to print sooner</dd>
9995 <dt>IPP_OP_PURGE_JOBS </dt>
9996 <dd class="description">Cancel all jobs</dd>
9997 <dt>IPP_OP_RELEASE_HELD_NEW_JOBS </dt>
9998 <dd class="description">Release new jobs</dd>
9999 <dt>IPP_OP_RELEASE_JOB </dt>
10000 <dd class="description">Release a job for printing</dd>
10001 <dt>IPP_OP_RENEW_SUBSCRIPTION <span class="info">&#160;CUPS 1.2/macOS 10.5&#160;</span></dt>
10002 <dd class="description">Renew a printer subscription </dd>
10003 <dt>IPP_OP_REPROCESS_JOB </dt>
10004 <dd class="description">Reprint a job</dd>
10005 <dt>IPP_OP_RESTART_JOB </dt>
10006 <dd class="description">Reprint a job</dd>
10007 <dt>IPP_OP_RESTART_PRINTER </dt>
10008 <dd class="description">Restart a printer</dd>
10009 <dt>IPP_OP_RESUBMIT_JOB </dt>
10010 <dd class="description">Resubmit-Job</dd>
10011 <dt>IPP_OP_RESUME_JOB </dt>
10012 <dd class="description">Resume the current job</dd>
10013 <dt>IPP_OP_RESUME_PRINTER </dt>
10014 <dd class="description">Start a printer</dd>
10015 <dt>IPP_OP_SCHEDULE_JOB_AFTER </dt>
10016 <dd class="description">Schedule a job to print after another</dd>
10017 <dt>IPP_OP_SEND_DOCUMENT </dt>
10018 <dd class="description">Add a file to a job</dd>
10019 <dt>IPP_OP_SEND_URI </dt>
10020 <dd class="description">Add a URL to a job</dd>
10021 <dt>IPP_OP_SET_DOCUMENT_ATTRIBUTES </dt>
10022 <dd class="description">Set-Document-Attributes</dd>
10023 <dt>IPP_OP_SET_JOB_ATTRIBUTES </dt>
10024 <dd class="description">Set job attributes</dd>
10025 <dt>IPP_OP_SET_PRINTER_ATTRIBUTES </dt>
10026 <dd class="description">Set printer attributes</dd>
10027 <dt>IPP_OP_SHUTDOWN_PRINTER </dt>
10028 <dd class="description">Turn a printer off</dd>
10029 <dt>IPP_OP_STARTUP_PRINTER </dt>
10030 <dd class="description">Turn a printer on</dd>
10031 <dt>IPP_OP_SUSPEND_CURRENT_JOB </dt>
10032 <dd class="description">Suspend the current job</dd>
10033 <dt>IPP_OP_UPDATE_ACTIVE_JOBS </dt>
10034 <dd class="description">Update-Active-Jobs</dd>
10035 <dt>IPP_OP_UPDATE_DOCUMENT_STATUS </dt>
10036 <dd class="description">Update-Document-Status</dd>
10037 <dt>IPP_OP_UPDATE_JOB_STATUS </dt>
10038 <dd class="description">Update-Job-Status</dd>
10039 <dt>IPP_OP_UPDATE_OUTPUT_DEVICE_ATTRIBUTES </dt>
10040 <dd class="description">Update-Output-Device-Attributes</dd>
10041 <dt>IPP_OP_VALIDATE_DOCUMENT </dt>
10042 <dd class="description">Validate-Document</dd>
10043 <dt>IPP_OP_VALIDATE_JOB </dt>
10044 <dd class="description">Validate job options</dd>
10045</dl>
10046 <h3 class="enumeration"><a id="ipp_orient_e">ipp_orient_e</a></h3>
10047 <p class="description">Orientation values</p>
10048 <h4 class="constants">Constants</h4>
10049 <dl>
10050 <dt>IPP_ORIENT_LANDSCAPE </dt>
10051 <dd class="description">90 degrees counter-clockwise</dd>
10052 <dt>IPP_ORIENT_NONE </dt>
10053 <dd class="description">No rotation</dd>
10054 <dt>IPP_ORIENT_PORTRAIT </dt>
10055 <dd class="description">No rotation</dd>
10056 <dt>IPP_ORIENT_REVERSE_LANDSCAPE </dt>
10057 <dd class="description">90 degrees clockwise</dd>
10058 <dt>IPP_ORIENT_REVERSE_PORTRAIT </dt>
10059 <dd class="description">180 degrees</dd>
10060</dl>
10061 <h3 class="enumeration"><a id="ipp_pstate_e">ipp_pstate_e</a></h3>
10062 <p class="description">Printer states</p>
10063 <h4 class="constants">Constants</h4>
10064 <dl>
10065 <dt>IPP_PSTATE_IDLE </dt>
10066 <dd class="description">Printer is idle</dd>
10067 <dt>IPP_PSTATE_PROCESSING </dt>
10068 <dd class="description">Printer is working</dd>
10069 <dt>IPP_PSTATE_STOPPED </dt>
10070 <dd class="description">Printer is stopped</dd>
10071</dl>
10072 <h3 class="enumeration"><a id="ipp_quality_e">ipp_quality_e</a></h3>
10073 <p class="description">Qualities</p>
10074 <h4 class="constants">Constants</h4>
10075 <dl>
10076 <dt>IPP_QUALITY_DRAFT </dt>
10077 <dd class="description">Draft quality</dd>
10078 <dt>IPP_QUALITY_HIGH </dt>
10079 <dd class="description">High quality</dd>
10080 <dt>IPP_QUALITY_NORMAL </dt>
10081 <dd class="description">Normal quality</dd>
10082</dl>
10083 <h3 class="enumeration"><a id="ipp_res_e">ipp_res_e</a></h3>
10084 <p class="description">Resolution units</p>
10085 <h4 class="constants">Constants</h4>
10086 <dl>
10087 <dt>IPP_RES_PER_CM </dt>
10088 <dd class="description">Pixels per centimeter</dd>
10089 <dt>IPP_RES_PER_INCH </dt>
10090 <dd class="description">Pixels per inch</dd>
10091</dl>
10092 <h3 class="enumeration"><a id="ipp_state_e">ipp_state_e</a></h3>
10093 <p class="description">IPP states</p>
10094 <h4 class="constants">Constants</h4>
10095 <dl>
10096 <dt>IPP_STATE_ATTRIBUTE </dt>
10097 <dd class="description">One or more attributes need to be sent/received</dd>
10098 <dt>IPP_STATE_DATA </dt>
10099 <dd class="description">IPP request data needs to be sent/received</dd>
10100 <dt>IPP_STATE_ERROR </dt>
10101 <dd class="description">An error occurred</dd>
10102 <dt>IPP_STATE_HEADER </dt>
10103 <dd class="description">The request header needs to be sent/received</dd>
10104 <dt>IPP_STATE_IDLE </dt>
10105 <dd class="description">Nothing is happening/request completed</dd>
10106</dl>
10107 <h3 class="enumeration"><a id="ipp_status_e">ipp_status_e</a></h3>
10108 <p class="description">IPP status codes</p>
10109 <h4 class="constants">Constants</h4>
10110 <dl>
10111 <dt>IPP_STATUS_CUPS_INVALID </dt>
10112 <dd class="description">Invalid status name for <a href="#ippErrorValue"><code>ippErrorValue</code></a></dd>
10113 <dt>IPP_STATUS_CUPS_SEE_OTHER </dt>
10114 <dd class="description">cups-see-other</dd>
10115 <dt>IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED </dt>
10116 <dd class="description">client-error-account-authorization-failed</dd>
10117 <dt>IPP_STATUS_ERROR_ACCOUNT_CLOSED </dt>
10118 <dd class="description">client-error-account-closed</dd>
10119 <dt>IPP_STATUS_ERROR_ACCOUNT_INFO_NEEDED </dt>
10120 <dd class="description">client-error-account-info-needed</dd>
10121 <dt>IPP_STATUS_ERROR_ACCOUNT_LIMIT_REACHED </dt>
10122 <dd class="description">client-error-account-limit-reached</dd>
10123 <dt>IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE </dt>
10124 <dd class="description">client-error-attributes-not-settable</dd>
10125 <dt>IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES </dt>
10126 <dd class="description">client-error-attributes-or-values-not-supported</dd>
10127 <dt>IPP_STATUS_ERROR_BAD_REQUEST </dt>
10128 <dd class="description">client-error-bad-request</dd>
10129 <dt>IPP_STATUS_ERROR_BUSY </dt>
10130 <dd class="description">server-error-busy</dd>
10131 <dt>IPP_STATUS_ERROR_CHARSET </dt>
10132 <dd class="description">client-error-charset-not-supported</dd>
10133 <dt>IPP_STATUS_ERROR_COMPRESSION_ERROR </dt>
10134 <dd class="description">client-error-compression-error</dd>
10135 <dt>IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED </dt>
10136 <dd class="description">client-error-compression-not-supported</dd>
10137 <dt>IPP_STATUS_ERROR_CONFLICTING </dt>
10138 <dd class="description">client-error-conflicting-attributes</dd>
10139 <dt>IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED <span class="info">&#160;DEPRECATED&#160;</span></dt>
10140 <dd class="description">cups-error-account-authorization-failed </dd>
10141 <dt>IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED </dt>
10142 <dd class="description">cups-error-account-closed @deprecate@</dd>
10143 <dt>IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED <span class="info">&#160;DEPRECATED&#160;</span></dt>
10144 <dd class="description">cups-error-account-info-needed </dd>
10145 <dt>IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED <span class="info">&#160;DEPRECATED&#160;</span></dt>
10146 <dd class="description">cups-error-account-limit-reached </dd>
10147 <dt>IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED <span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span></dt>
10148 <dd class="description">cups-authentication-canceled - Authentication canceled by user </dd>
10149 <dt>IPP_STATUS_ERROR_CUPS_PKI <span class="info">&#160;CUPS 1.5/macOS 10.7&#160;</span></dt>
10150 <dd class="description">cups-pki-error - Error negotiating a secure connection </dd>
10151 <dt>IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED </dt>
10152 <dd class="description">cups-upgrade-required - TLS upgrade required</dd>
10153 <dt>IPP_STATUS_ERROR_DEVICE </dt>
10154 <dd class="description">server-error-device-error</dd>
10155 <dt>IPP_STATUS_ERROR_DOCUMENT_ACCESS </dt>
10156 <dd class="description">client-error-document-access-error</dd>
10157 <dt>IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR </dt>
10158 <dd class="description">client-error-document-format-error</dd>
10159 <dt>IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED </dt>
10160 <dd class="description">client-error-document-format-not-supported</dd>
10161 <dt>IPP_STATUS_ERROR_DOCUMENT_PASSWORD </dt>
10162 <dd class="description">client-error-document-password-error</dd>
10163 <dt>IPP_STATUS_ERROR_DOCUMENT_PERMISSION </dt>
10164 <dd class="description">client-error-document-permission-error</dd>
10165 <dt>IPP_STATUS_ERROR_DOCUMENT_SECURITY </dt>
10166 <dd class="description">client-error-document-security-error</dd>
10167 <dt>IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE </dt>
10168 <dd class="description">client-error-document-unprintable-error</dd>
10169 <dt>IPP_STATUS_ERROR_FORBIDDEN </dt>
10170 <dd class="description">client-error-forbidden</dd>
10171 <dt>IPP_STATUS_ERROR_GONE </dt>
10172 <dd class="description">client-error-gone</dd>
10173 <dt>IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS </dt>
10174 <dd class="description">client-error-ignored-all-subscriptions</dd>
10175 <dt>IPP_STATUS_ERROR_INTERNAL </dt>
10176 <dd class="description">server-error-internal-error</dd>
10177 <dt>IPP_STATUS_ERROR_JOB_CANCELED </dt>
10178 <dd class="description">server-error-job-canceled</dd>
10179 <dt>IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED </dt>
10180 <dd class="description">server-error-multiple-document-jobs-not-supported</dd>
10181 <dt>IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS </dt>
10182 <dd class="description">server-error-not-accepting-jobs</dd>
10183 <dt>IPP_STATUS_ERROR_NOT_AUTHENTICATED </dt>
10184 <dd class="description">client-error-not-authenticated</dd>
10185 <dt>IPP_STATUS_ERROR_NOT_AUTHORIZED </dt>
10186 <dd class="description">client-error-not-authorized</dd>
10187 <dt>IPP_STATUS_ERROR_NOT_FETCHABLE </dt>
10188 <dd class="description">client-error-not-fetchable</dd>
10189 <dt>IPP_STATUS_ERROR_NOT_FOUND </dt>
10190 <dd class="description">client-error-not-found</dd>
10191 <dt>IPP_STATUS_ERROR_NOT_POSSIBLE </dt>
10192 <dd class="description">client-error-not-possible</dd>
10193 <dt>IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED </dt>
10194 <dd class="description">server-error-operation-not-supported</dd>
10195 <dt>IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED </dt>
10196 <dd class="description">server-error-printer-is-deactivated</dd>
10197 <dt>IPP_STATUS_ERROR_REQUEST_ENTITY </dt>
10198 <dd class="description">client-error-request-entity-too-large</dd>
10199 <dt>IPP_STATUS_ERROR_REQUEST_VALUE </dt>
10200 <dd class="description">client-error-request-value-too-long</dd>
10201 <dt>IPP_STATUS_ERROR_SERVICE_UNAVAILABLE </dt>
10202 <dd class="description">server-error-service-unavailable</dd>
10203 <dt>IPP_STATUS_ERROR_TEMPORARY </dt>
10204 <dd class="description">server-error-temporary-error</dd>
10205 <dt>IPP_STATUS_ERROR_TIMEOUT </dt>
10206 <dd class="description">client-error-timeout</dd>
10207 <dt>IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS </dt>
10208 <dd class="description">server-error-too-many-documents</dd>
10209 <dt>IPP_STATUS_ERROR_TOO_MANY_JOBS </dt>
10210 <dd class="description">server-error-too-many-jobs</dd>
10211 <dt>IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS </dt>
10212 <dd class="description">client-error-too-many-subscriptions</dd>
10213 <dt>IPP_STATUS_ERROR_URI_SCHEME </dt>
10214 <dd class="description">client-error-uri-scheme-not-supported</dd>
10215 <dt>IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED </dt>
10216 <dd class="description">server-error-version-not-supported</dd>
10217 <dt>IPP_STATUS_OK </dt>
10218 <dd class="description">successful-ok</dd>
10219 <dt>IPP_STATUS_OK_CONFLICTING </dt>
10220 <dd class="description">successful-ok-conflicting-attributes</dd>
10221 <dt>IPP_STATUS_OK_EVENTS_COMPLETE </dt>
10222 <dd class="description">successful-ok-events-complete</dd>
10223 <dt>IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED </dt>
10224 <dd class="description">successful-ok-ignored-or-substituted-attributes</dd>
10225 <dt>IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS </dt>
10226 <dd class="description">successful-ok-ignored-subscriptions</dd>
10227 <dt>IPP_STATUS_OK_TOO_MANY_EVENTS </dt>
10228 <dd class="description">successful-ok-too-many-events</dd>
10229</dl>
10230 <h3 class="enumeration"><a id="ipp_tag_e">ipp_tag_e</a></h3>
10231 <p class="description">Format tags for attributes</p>
10232 <h4 class="constants">Constants</h4>
10233 <dl>
10234 <dt>IPP_TAG_ADMINDEFINE </dt>
10235 <dd class="description">Admin-defined value</dd>
10236 <dt>IPP_TAG_BEGIN_COLLECTION </dt>
10237 <dd class="description">Beginning of collection value</dd>
10238 <dt>IPP_TAG_BOOLEAN </dt>
10239 <dd class="description">Boolean value</dd>
10240 <dt>IPP_TAG_CHARSET </dt>
10241 <dd class="description">Character set value</dd>
10242 <dt>IPP_TAG_CUPS_INVALID </dt>
10243 <dd class="description">Invalid tag name for <a href="#ippTagValue"><code>ippTagValue</code></a></dd>
10244 <dt>IPP_TAG_DATE </dt>
10245 <dd class="description">Date/time value</dd>
10246 <dt>IPP_TAG_DEFAULT </dt>
10247 <dd class="description">Default value</dd>
10248 <dt>IPP_TAG_DELETEATTR </dt>
10249 <dd class="description">Delete-attribute value</dd>
10250 <dt>IPP_TAG_DOCUMENT </dt>
10251 <dd class="description">Document group</dd>
10252 <dt>IPP_TAG_END </dt>
10253 <dd class="description">End-of-attributes</dd>
10254 <dt>IPP_TAG_END_COLLECTION </dt>
10255 <dd class="description">End of collection value</dd>
10256 <dt>IPP_TAG_ENUM </dt>
10257 <dd class="description">Enumeration value</dd>
10258 <dt>IPP_TAG_EVENT_NOTIFICATION </dt>
10259 <dd class="description">Event group</dd>
10260 <dt>IPP_TAG_EXTENSION </dt>
10261 <dd class="description">Extension point for 32-bit tags</dd>
10262 <dt>IPP_TAG_INTEGER </dt>
10263 <dd class="description">Integer value</dd>
10264 <dt>IPP_TAG_JOB </dt>
10265 <dd class="description">Job group</dd>
10266 <dt>IPP_TAG_KEYWORD </dt>
10267 <dd class="description">Keyword value</dd>
10268 <dt>IPP_TAG_LANGUAGE </dt>
10269 <dd class="description">Language value</dd>
10270 <dt>IPP_TAG_MEMBERNAME </dt>
10271 <dd class="description">Collection member name value</dd>
10272 <dt>IPP_TAG_MIMETYPE </dt>
10273 <dd class="description">MIME media type value</dd>
10274 <dt>IPP_TAG_NAME </dt>
10275 <dd class="description">Name value</dd>
10276 <dt>IPP_TAG_NAMELANG </dt>
10277 <dd class="description">Name-with-language value</dd>
10278 <dt>IPP_TAG_NOTSETTABLE </dt>
10279 <dd class="description">Not-settable value</dd>
10280 <dt>IPP_TAG_NOVALUE </dt>
10281 <dd class="description">No-value value</dd>
10282 <dt>IPP_TAG_OPERATION </dt>
10283 <dd class="description">Operation group</dd>
10284 <dt>IPP_TAG_PRINTER </dt>
10285 <dd class="description">Printer group</dd>
10286 <dt>IPP_TAG_RANGE </dt>
10287 <dd class="description">Range value</dd>
10288 <dt>IPP_TAG_RESOLUTION </dt>
10289 <dd class="description">Resolution value</dd>
10290 <dt>IPP_TAG_STRING </dt>
10291 <dd class="description">Octet string value</dd>
10292 <dt>IPP_TAG_SUBSCRIPTION </dt>
10293 <dd class="description">Subscription group</dd>
10294 <dt>IPP_TAG_TEXT </dt>
10295 <dd class="description">Text value</dd>
10296 <dt>IPP_TAG_TEXTLANG </dt>
10297 <dd class="description">Text-with-language value</dd>
10298 <dt>IPP_TAG_UNKNOWN </dt>
10299 <dd class="description">Unknown value</dd>
10300 <dt>IPP_TAG_UNSUPPORTED_GROUP </dt>
10301 <dd class="description">Unsupported attributes group</dd>
10302 <dt>IPP_TAG_UNSUPPORTED_VALUE </dt>
10303 <dd class="description">Unsupported value</dd>
10304 <dt>IPP_TAG_URI </dt>
10305 <dd class="description">URI value</dd>
10306 <dt>IPP_TAG_URISCHEME </dt>
10307 <dd class="description">URI scheme value</dd>
10308 <dt>IPP_TAG_ZERO </dt>
10309 <dd class="description">Zero tag - used for separators</dd>
10310</dl>
10311 </div>
10312 </body>
10313</html>