]>
Commit | Line | Data |
---|---|---|
73721e3e | 1 | <!DOCTYPE html> |
798d6e29 MS |
2 | <html> |
3 | <!-- SECTION: Programming --> | |
4 | <head> | |
5 | <title>CUPS Programming Manual</title> | |
6 | <meta name="keywords" content="Programming"> | |
7 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
bea505c3 | 8 | <meta name="creator" content="codedoc v3.1"> |
798d6e29 | 9 | <meta name="author" content="Michael R Sweet"> |
859ea448 SA |
10 | <meta name="copyright" content="Copyright © 2007-2022 by Apple Inc. All Rights Reserved."> |
11 | <meta name="version" content="2.3.6"> | |
798d6e29 | 12 | <style type="text/css"><!-- |
bea505c3 | 13 | body, p, h1, h2, h3, h4 { |
798d6e29 MS |
14 | font-family: sans-serif; |
15 | } | |
bea505c3 | 16 | div.body h1 { |
93d79201 | 17 | font-size: 250%; |
bea505c3 | 18 | font-weight: bold; |
798d6e29 MS |
19 | margin: 0; |
20 | } | |
bea505c3 | 21 | div.body h2 { |
798d6e29 MS |
22 | font-size: 250%; |
23 | margin-top: 1.5em; | |
24 | } | |
bea505c3 MS |
25 | div.body h3 { |
26 | font-size: 150%; | |
798d6e29 MS |
27 | margin-bottom: 0.5em; |
28 | margin-top: 1.5em; | |
29 | } | |
bea505c3 MS |
30 | div.body h4 { |
31 | font-size: 110%; | |
798d6e29 MS |
32 | margin-bottom: 0.5em; |
33 | margin-top: 1.5em; | |
34 | } | |
bea505c3 MS |
35 | div.body h5 { |
36 | font-size: 100%; | |
798d6e29 MS |
37 | margin-bottom: 0.5em; |
38 | margin-top: 1.5em; | |
39 | } | |
bea505c3 MS |
40 | div.contents { |
41 | background: #e8e8e8; | |
42 | border: solid thin black; | |
43 | padding: 10px; | |
44 | } | |
45 | div.contents h1 { | |
798d6e29 MS |
46 | font-size: 110%; |
47 | } | |
bea505c3 MS |
48 | div.contents h2 { |
49 | font-size: 100%; | |
798d6e29 | 50 | } |
bea505c3 MS |
51 | div.contents ul.contents { |
52 | font-size: 80%; | |
798d6e29 | 53 | } |
bea505c3 | 54 | .class { |
798d6e29 MS |
55 | border-bottom: solid 2px gray; |
56 | } | |
bea505c3 MS |
57 | .constants { |
58 | } | |
798d6e29 MS |
59 | .description { |
60 | margin-top: 0.5em; | |
61 | } | |
bea505c3 MS |
62 | .discussion { |
63 | } | |
64 | .enumeration { | |
65 | border-bottom: solid 2px gray; | |
66 | } | |
798d6e29 | 67 | .function { |
bea505c3 | 68 | border-bottom: solid 2px gray; |
798d6e29 MS |
69 | margin-bottom: 0; |
70 | } | |
bea505c3 MS |
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 | } | |
90 | h1, h2, h3, h4, h5, h6 { | |
91 | page-break-inside: avoid; | |
92 | } | |
798d6e29 MS |
93 | blockquote { |
94 | border: solid thin gray; | |
95 | box-shadow: 3px 3px 5px rgba(0,0,0,0.5); | |
96 | padding: 0px 10px; | |
97 | page-break-inside: avoid; | |
98 | } | |
99 | p code, li code, p.code, pre, ul.code li { | |
bea505c3 MS |
100 | background: rgba(127,127,127,0.1); |
101 | border: thin dotted gray; | |
798d6e29 | 102 | font-family: monospace; |
bea505c3 | 103 | font-size: 90%; |
798d6e29 MS |
104 | hyphens: manual; |
105 | -webkit-hyphens: manual; | |
bea505c3 | 106 | page-break-inside: avoid; |
798d6e29 MS |
107 | } |
108 | p.code, pre, ul.code li { | |
109 | padding: 10px; | |
bea505c3 MS |
110 | } |
111 | p code, li code { | |
112 | padding: 2px 5px; | |
798d6e29 MS |
113 | } |
114 | a:link, a:visited { | |
115 | text-decoration: none; | |
116 | } | |
117 | span.info { | |
118 | background: black; | |
119 | border: solid thin black; | |
120 | color: white; | |
121 | font-size: 80%; | |
122 | font-style: italic; | |
123 | font-weight: bold; | |
124 | white-space: nowrap; | |
125 | } | |
bea505c3 | 126 | h3 span.info, h4 span.info { |
98d88c8d MS |
127 | border-top-left-radius: 10px; |
128 | border-top-right-radius: 10px; | |
798d6e29 | 129 | float: right; |
98d88c8d | 130 | padding: 3px 6px; |
798d6e29 MS |
131 | } |
132 | ul.code, ul.contents, ul.subcontents { | |
133 | list-style-type: none; | |
134 | margin: 0; | |
135 | padding-left: 0; | |
136 | } | |
137 | ul.code li { | |
138 | margin: 0; | |
139 | } | |
140 | ul.contents > li { | |
141 | margin-top: 1em; | |
142 | } | |
143 | ul.contents li ul.code, ul.contents li ul.subcontents { | |
144 | padding-left: 2em; | |
145 | } | |
98d88c8d MS |
146 | table.list { |
147 | border-collapse: collapse; | |
148 | width: 100%; | |
798d6e29 | 149 | } |
bea505c3 MS |
150 | table.list tr:nth-child(even) { |
151 | background: rgba(127,127,127,0.1);]n} | |
98d88c8d MS |
152 | table.list th { |
153 | border-right: 2px solid gray; | |
154 | font-family: monospace; | |
155 | padding: 5px 10px 5px 2px; | |
156 | text-align: right; | |
157 | vertical-align: top; | |
798d6e29 | 158 | } |
98d88c8d MS |
159 | table.list td { |
160 | padding: 5px 2px 5px 10px; | |
161 | text-align: left; | |
162 | vertical-align: top; | |
798d6e29 | 163 | } |
bea505c3 MS |
164 | h1.title { |
165 | } | |
166 | h2.title { | |
167 | border-bottom: solid 2px black; | |
168 | } | |
169 | h3.title { | |
798d6e29 MS |
170 | border-bottom: solid 2px black; |
171 | } | |
172 | --></style> | |
173 | </head> | |
174 | <body> | |
bea505c3 MS |
175 | <h1 class="title">CUPS Programming Manual</h1> |
176 | <p>Michael R Sweet</p> | |
6918883f | 177 | <p>Copyright © 2007-2020 by Apple Inc. All Rights Reserved.</p> |
798d6e29 MS |
178 | <div class="contents"> |
179 | <h2 class="title">Contents</h2> | |
180 | <ul class="contents"> | |
53af7f21 MS |
181 | <li><a href="#introduction">Introduction</a><ul class="subcontents"> |
182 | <li><a href="#guidelines">Guidelines</a></li> | |
183 | <li><a href="#terms-used-in-this-document">Terms Used in This Document</a></li> | |
184 | <li><a href="#compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></li> | |
798d6e29 | 185 | </ul></li> |
53af7f21 MS |
186 | <li><a href="#working-with-destinations">Working with Destinations</a><ul class="subcontents"> |
187 | <li><a href="#finding-available-destinations">Finding Available Destinations</a></li> | |
188 | <li><a href="#basic-destination-information">Basic Destination Information</a></li> | |
189 | <li><a href="#detailed-destination-information">Detailed Destination Information</a></li> | |
190 | <li><a href="#submitting-a-print-job">Submitting a Print Job</a></li> | |
798d6e29 | 191 | </ul></li> |
b0fb2d75 MS |
192 | <li><a href="#sending-ipp-requests">Sending IPP Requests</a><ul class="subcontents"> |
193 | <li><a href="#connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</a></li> | |
194 | <li><a href="#creating-an-ipp-request">Creating an IPP Request</a></li> | |
195 | <li><a href="#sending-the-ipp-request">Sending the IPP Request</a></li> | |
196 | <li><a href="#processing-the-ipp-response">Processing the IPP Response</a></li> | |
197 | <li><a href="#authentication">Authentication</a></li> | |
198 | </ul></li> | |
798d6e29 MS |
199 | <li><a href="#FUNCTIONS">Functions</a><ul class="subcontents"> |
200 | <li><a href="#cupsAddDest">cupsAddDest</a></li> | |
63b75fbe | 201 | <li><a href="#cupsAddDestMediaOptions">cupsAddDestMediaOptions</a></li> |
53af7f21 | 202 | <li><a href="#cupsAddIntegerOption">cupsAddIntegerOption</a></li> |
798d6e29 | 203 | <li><a href="#cupsAddOption">cupsAddOption</a></li> |
798d6e29 | 204 | <li><a href="#cupsCancelDestJob">cupsCancelDestJob</a></li> |
798d6e29 MS |
205 | <li><a href="#cupsCheckDestSupported">cupsCheckDestSupported</a></li> |
206 | <li><a href="#cupsCloseDestJob">cupsCloseDestJob</a></li> | |
207 | <li><a href="#cupsConnectDest">cupsConnectDest</a></li> | |
798d6e29 MS |
208 | <li><a href="#cupsCopyDest">cupsCopyDest</a></li> |
209 | <li><a href="#cupsCopyDestConflicts">cupsCopyDestConflicts</a></li> | |
210 | <li><a href="#cupsCopyDestInfo">cupsCopyDestInfo</a></li> | |
211 | <li><a href="#cupsCreateDestJob">cupsCreateDestJob</a></li> | |
798d6e29 | 212 | <li><a href="#cupsDoAuthentication">cupsDoAuthentication</a></li> |
ddf2ec73 | 213 | <li><a href="#cupsEncodeOption">cupsEncodeOption</a></li> |
798d6e29 MS |
214 | <li><a href="#cupsEncodeOptions">cupsEncodeOptions</a></li> |
215 | <li><a href="#cupsEncodeOptions2">cupsEncodeOptions2</a></li> | |
216 | <li><a href="#cupsEncryption">cupsEncryption</a></li> | |
217 | <li><a href="#cupsEnumDests">cupsEnumDests</a></li> | |
798d6e29 MS |
218 | <li><a href="#cupsFindDestDefault">cupsFindDestDefault</a></li> |
219 | <li><a href="#cupsFindDestReady">cupsFindDestReady</a></li> | |
220 | <li><a href="#cupsFindDestSupported">cupsFindDestSupported</a></li> | |
221 | <li><a href="#cupsFinishDestDocument">cupsFinishDestDocument</a></li> | |
798d6e29 MS |
222 | <li><a href="#cupsFreeDestInfo">cupsFreeDestInfo</a></li> |
223 | <li><a href="#cupsFreeDests">cupsFreeDests</a></li> | |
224 | <li><a href="#cupsFreeJobs">cupsFreeJobs</a></li> | |
225 | <li><a href="#cupsFreeOptions">cupsFreeOptions</a></li> | |
798d6e29 MS |
226 | <li><a href="#cupsGetDest">cupsGetDest</a></li> |
227 | <li><a href="#cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></li> | |
228 | <li><a href="#cupsGetDestMediaByName">cupsGetDestMediaByName</a></li> | |
229 | <li><a href="#cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></li> | |
230 | <li><a href="#cupsGetDestMediaCount">cupsGetDestMediaCount</a></li> | |
231 | <li><a href="#cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></li> | |
232 | <li><a href="#cupsGetDestWithURI">cupsGetDestWithURI</a></li> | |
98d88c8d | 233 | <li><a href="#cupsGetDests2">cupsGetDests2</a></li> |
53af7f21 | 234 | <li><a href="#cupsGetIntegerOption">cupsGetIntegerOption</a></li> |
798d6e29 MS |
235 | <li><a href="#cupsGetJobs2">cupsGetJobs2</a></li> |
236 | <li><a href="#cupsGetNamedDest">cupsGetNamedDest</a></li> | |
237 | <li><a href="#cupsGetOption">cupsGetOption</a></li> | |
798d6e29 | 238 | <li><a href="#cupsGetPassword2">cupsGetPassword2</a></li> |
798d6e29 MS |
239 | <li><a href="#cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></li> |
240 | <li><a href="#cupsLocalizeDestOption">cupsLocalizeDestOption</a></li> | |
241 | <li><a href="#cupsLocalizeDestValue">cupsLocalizeDestValue</a></li> | |
242 | <li><a href="#cupsMakeServerCredentials">cupsMakeServerCredentials</a></li> | |
798d6e29 | 243 | <li><a href="#cupsParseOptions">cupsParseOptions</a></li> |
798d6e29 MS |
244 | <li><a href="#cupsRemoveDest">cupsRemoveDest</a></li> |
245 | <li><a href="#cupsRemoveOption">cupsRemoveOption</a></li> | |
246 | <li><a href="#cupsServer">cupsServer</a></li> | |
247 | <li><a href="#cupsSetClientCertCB">cupsSetClientCertCB</a></li> | |
248 | <li><a href="#cupsSetCredentials">cupsSetCredentials</a></li> | |
249 | <li><a href="#cupsSetDefaultDest">cupsSetDefaultDest</a></li> | |
798d6e29 MS |
250 | <li><a href="#cupsSetDests2">cupsSetDests2</a></li> |
251 | <li><a href="#cupsSetEncryption">cupsSetEncryption</a></li> | |
798d6e29 MS |
252 | <li><a href="#cupsSetPasswordCB2">cupsSetPasswordCB2</a></li> |
253 | <li><a href="#cupsSetServer">cupsSetServer</a></li> | |
254 | <li><a href="#cupsSetServerCertCB">cupsSetServerCertCB</a></li> | |
255 | <li><a href="#cupsSetServerCredentials">cupsSetServerCredentials</a></li> | |
256 | <li><a href="#cupsSetUser">cupsSetUser</a></li> | |
257 | <li><a href="#cupsSetUserAgent">cupsSetUserAgent</a></li> | |
258 | <li><a href="#cupsStartDestDocument">cupsStartDestDocument</a></li> | |
798d6e29 MS |
259 | <li><a href="#cupsUser">cupsUser</a></li> |
260 | <li><a href="#cupsUserAgent">cupsUserAgent</a></li> | |
261 | <li><a href="#httpAcceptConnection">httpAcceptConnection</a></li> | |
262 | <li><a href="#httpAddCredential">httpAddCredential</a></li> | |
263 | <li><a href="#httpAddrAny">httpAddrAny</a></li> | |
264 | <li><a href="#httpAddrClose">httpAddrClose</a></li> | |
798d6e29 MS |
265 | <li><a href="#httpAddrConnect2">httpAddrConnect2</a></li> |
266 | <li><a href="#httpAddrCopyList">httpAddrCopyList</a></li> | |
267 | <li><a href="#httpAddrEqual">httpAddrEqual</a></li> | |
268 | <li><a href="#httpAddrFamily">httpAddrFamily</a></li> | |
269 | <li><a href="#httpAddrFreeList">httpAddrFreeList</a></li> | |
270 | <li><a href="#httpAddrGetList">httpAddrGetList</a></li> | |
271 | <li><a href="#httpAddrLength">httpAddrLength</a></li> | |
272 | <li><a href="#httpAddrListen">httpAddrListen</a></li> | |
273 | <li><a href="#httpAddrLocalhost">httpAddrLocalhost</a></li> | |
274 | <li><a href="#httpAddrLookup">httpAddrLookup</a></li> | |
275 | <li><a href="#httpAddrPort">httpAddrPort</a></li> | |
276 | <li><a href="#httpAddrString">httpAddrString</a></li> | |
277 | <li><a href="#httpAssembleURI">httpAssembleURI</a></li> | |
278 | <li><a href="#httpAssembleURIf">httpAssembleURIf</a></li> | |
279 | <li><a href="#httpAssembleUUID">httpAssembleUUID</a></li> | |
280 | <li><a href="#httpBlocking">httpBlocking</a></li> | |
281 | <li><a href="#httpCheck">httpCheck</a></li> | |
282 | <li><a href="#httpClearCookie">httpClearCookie</a></li> | |
283 | <li><a href="#httpClearFields">httpClearFields</a></li> | |
284 | <li><a href="#httpClose">httpClose</a></li> | |
285 | <li><a href="#httpCompareCredentials">httpCompareCredentials</a></li> | |
798d6e29 | 286 | <li><a href="#httpConnect2">httpConnect2</a></li> |
798d6e29 MS |
287 | <li><a href="#httpCopyCredentials">httpCopyCredentials</a></li> |
288 | <li><a href="#httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></li> | |
289 | <li><a href="#httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></li> | |
290 | <li><a href="#httpCredentialsGetTrust">httpCredentialsGetTrust</a></li> | |
291 | <li><a href="#httpCredentialsString">httpCredentialsString</a></li> | |
798d6e29 MS |
292 | <li><a href="#httpDecode64_2">httpDecode64_2</a></li> |
293 | <li><a href="#httpDelete">httpDelete</a></li> | |
798d6e29 MS |
294 | <li><a href="#httpEncode64_2">httpEncode64_2</a></li> |
295 | <li><a href="#httpEncryption">httpEncryption</a></li> | |
296 | <li><a href="#httpError">httpError</a></li> | |
297 | <li><a href="#httpFieldValue">httpFieldValue</a></li> | |
298 | <li><a href="#httpFlush">httpFlush</a></li> | |
299 | <li><a href="#httpFlushWrite">httpFlushWrite</a></li> | |
300 | <li><a href="#httpFreeCredentials">httpFreeCredentials</a></li> | |
301 | <li><a href="#httpGet">httpGet</a></li> | |
302 | <li><a href="#httpGetActivity">httpGetActivity</a></li> | |
303 | <li><a href="#httpGetAddress">httpGetAddress</a></li> | |
304 | <li><a href="#httpGetAuthString">httpGetAuthString</a></li> | |
305 | <li><a href="#httpGetBlocking">httpGetBlocking</a></li> | |
306 | <li><a href="#httpGetContentEncoding">httpGetContentEncoding</a></li> | |
307 | <li><a href="#httpGetCookie">httpGetCookie</a></li> | |
798d6e29 MS |
308 | <li><a href="#httpGetDateString2">httpGetDateString2</a></li> |
309 | <li><a href="#httpGetDateTime">httpGetDateTime</a></li> | |
310 | <li><a href="#httpGetEncryption">httpGetEncryption</a></li> | |
311 | <li><a href="#httpGetExpect">httpGetExpect</a></li> | |
312 | <li><a href="#httpGetFd">httpGetFd</a></li> | |
313 | <li><a href="#httpGetField">httpGetField</a></li> | |
798d6e29 MS |
314 | <li><a href="#httpGetHostname">httpGetHostname</a></li> |
315 | <li><a href="#httpGetKeepAlive">httpGetKeepAlive</a></li> | |
798d6e29 MS |
316 | <li><a href="#httpGetLength2">httpGetLength2</a></li> |
317 | <li><a href="#httpGetPending">httpGetPending</a></li> | |
318 | <li><a href="#httpGetReady">httpGetReady</a></li> | |
319 | <li><a href="#httpGetRemaining">httpGetRemaining</a></li> | |
320 | <li><a href="#httpGetState">httpGetState</a></li> | |
321 | <li><a href="#httpGetStatus">httpGetStatus</a></li> | |
798d6e29 MS |
322 | <li><a href="#httpGetSubField2">httpGetSubField2</a></li> |
323 | <li><a href="#httpGetVersion">httpGetVersion</a></li> | |
324 | <li><a href="#httpGets">httpGets</a></li> | |
325 | <li><a href="#httpHead">httpHead</a></li> | |
326 | <li><a href="#httpInitialize">httpInitialize</a></li> | |
327 | <li><a href="#httpIsChunked">httpIsChunked</a></li> | |
328 | <li><a href="#httpIsEncrypted">httpIsEncrypted</a></li> | |
329 | <li><a href="#httpLoadCredentials">httpLoadCredentials</a></li> | |
330 | <li><a href="#httpOptions">httpOptions</a></li> | |
331 | <li><a href="#httpPeek">httpPeek</a></li> | |
332 | <li><a href="#httpPost">httpPost</a></li> | |
333 | <li><a href="#httpPut">httpPut</a></li> | |
798d6e29 MS |
334 | <li><a href="#httpRead2">httpRead2</a></li> |
335 | <li><a href="#httpReadRequest">httpReadRequest</a></li> | |
798d6e29 MS |
336 | <li><a href="#httpReconnect2">httpReconnect2</a></li> |
337 | <li><a href="#httpResolveHostname">httpResolveHostname</a></li> | |
338 | <li><a href="#httpSaveCredentials">httpSaveCredentials</a></li> | |
798d6e29 MS |
339 | <li><a href="#httpSeparateURI">httpSeparateURI</a></li> |
340 | <li><a href="#httpSetAuthString">httpSetAuthString</a></li> | |
341 | <li><a href="#httpSetCookie">httpSetCookie</a></li> | |
342 | <li><a href="#httpSetCredentials">httpSetCredentials</a></li> | |
343 | <li><a href="#httpSetDefaultField">httpSetDefaultField</a></li> | |
344 | <li><a href="#httpSetExpect">httpSetExpect</a></li> | |
345 | <li><a href="#httpSetField">httpSetField</a></li> | |
346 | <li><a href="#httpSetKeepAlive">httpSetKeepAlive</a></li> | |
347 | <li><a href="#httpSetLength">httpSetLength</a></li> | |
348 | <li><a href="#httpSetTimeout">httpSetTimeout</a></li> | |
349 | <li><a href="#httpShutdown">httpShutdown</a></li> | |
350 | <li><a href="#httpStateString">httpStateString</a></li> | |
351 | <li><a href="#httpStatus">httpStatus</a></li> | |
798d6e29 MS |
352 | <li><a href="#httpURIStatusString">httpURIStatusString</a></li> |
353 | <li><a href="#httpUpdate">httpUpdate</a></li> | |
354 | <li><a href="#httpWait">httpWait</a></li> | |
798d6e29 MS |
355 | <li><a href="#httpWrite2">httpWrite2</a></li> |
356 | <li><a href="#httpWriteResponse">httpWriteResponse</a></li> | |
357 | <li><a href="#ippAddBoolean">ippAddBoolean</a></li> | |
358 | <li><a href="#ippAddBooleans">ippAddBooleans</a></li> | |
359 | <li><a href="#ippAddCollection">ippAddCollection</a></li> | |
360 | <li><a href="#ippAddCollections">ippAddCollections</a></li> | |
361 | <li><a href="#ippAddDate">ippAddDate</a></li> | |
362 | <li><a href="#ippAddInteger">ippAddInteger</a></li> | |
363 | <li><a href="#ippAddIntegers">ippAddIntegers</a></li> | |
364 | <li><a href="#ippAddOctetString">ippAddOctetString</a></li> | |
365 | <li><a href="#ippAddOutOfBand">ippAddOutOfBand</a></li> | |
366 | <li><a href="#ippAddRange">ippAddRange</a></li> | |
367 | <li><a href="#ippAddRanges">ippAddRanges</a></li> | |
368 | <li><a href="#ippAddResolution">ippAddResolution</a></li> | |
369 | <li><a href="#ippAddResolutions">ippAddResolutions</a></li> | |
370 | <li><a href="#ippAddSeparator">ippAddSeparator</a></li> | |
371 | <li><a href="#ippAddString">ippAddString</a></li> | |
372 | <li><a href="#ippAddStringf">ippAddStringf</a></li> | |
373 | <li><a href="#ippAddStringfv">ippAddStringfv</a></li> | |
374 | <li><a href="#ippAddStrings">ippAddStrings</a></li> | |
375 | <li><a href="#ippAttributeString">ippAttributeString</a></li> | |
376 | <li><a href="#ippContainsInteger">ippContainsInteger</a></li> | |
377 | <li><a href="#ippContainsString">ippContainsString</a></li> | |
378 | <li><a href="#ippCopyAttribute">ippCopyAttribute</a></li> | |
379 | <li><a href="#ippCopyAttributes">ippCopyAttributes</a></li> | |
380 | <li><a href="#ippCreateRequestedArray">ippCreateRequestedArray</a></li> | |
381 | <li><a href="#ippDateToTime">ippDateToTime</a></li> | |
382 | <li><a href="#ippDelete">ippDelete</a></li> | |
383 | <li><a href="#ippDeleteAttribute">ippDeleteAttribute</a></li> | |
384 | <li><a href="#ippDeleteValues">ippDeleteValues</a></li> | |
385 | <li><a href="#ippEnumString">ippEnumString</a></li> | |
386 | <li><a href="#ippEnumValue">ippEnumValue</a></li> | |
387 | <li><a href="#ippErrorString">ippErrorString</a></li> | |
388 | <li><a href="#ippErrorValue">ippErrorValue</a></li> | |
389 | <li><a href="#ippFindAttribute">ippFindAttribute</a></li> | |
390 | <li><a href="#ippFindNextAttribute">ippFindNextAttribute</a></li> | |
391 | <li><a href="#ippFirstAttribute">ippFirstAttribute</a></li> | |
392 | <li><a href="#ippGetBoolean">ippGetBoolean</a></li> | |
393 | <li><a href="#ippGetCollection">ippGetCollection</a></li> | |
394 | <li><a href="#ippGetCount">ippGetCount</a></li> | |
395 | <li><a href="#ippGetDate">ippGetDate</a></li> | |
396 | <li><a href="#ippGetGroupTag">ippGetGroupTag</a></li> | |
397 | <li><a href="#ippGetInteger">ippGetInteger</a></li> | |
398 | <li><a href="#ippGetName">ippGetName</a></li> | |
399 | <li><a href="#ippGetOctetString">ippGetOctetString</a></li> | |
400 | <li><a href="#ippGetOperation">ippGetOperation</a></li> | |
401 | <li><a href="#ippGetRange">ippGetRange</a></li> | |
402 | <li><a href="#ippGetRequestId">ippGetRequestId</a></li> | |
403 | <li><a href="#ippGetResolution">ippGetResolution</a></li> | |
404 | <li><a href="#ippGetState">ippGetState</a></li> | |
405 | <li><a href="#ippGetStatusCode">ippGetStatusCode</a></li> | |
406 | <li><a href="#ippGetString">ippGetString</a></li> | |
407 | <li><a href="#ippGetValueTag">ippGetValueTag</a></li> | |
408 | <li><a href="#ippGetVersion">ippGetVersion</a></li> | |
409 | <li><a href="#ippLength">ippLength</a></li> | |
410 | <li><a href="#ippNew">ippNew</a></li> | |
411 | <li><a href="#ippNewRequest">ippNewRequest</a></li> | |
412 | <li><a href="#ippNewResponse">ippNewResponse</a></li> | |
413 | <li><a href="#ippNextAttribute">ippNextAttribute</a></li> | |
414 | <li><a href="#ippOpString">ippOpString</a></li> | |
415 | <li><a href="#ippOpValue">ippOpValue</a></li> | |
416 | <li><a href="#ippPort">ippPort</a></li> | |
417 | <li><a href="#ippRead">ippRead</a></li> | |
418 | <li><a href="#ippReadFile">ippReadFile</a></li> | |
419 | <li><a href="#ippReadIO">ippReadIO</a></li> | |
420 | <li><a href="#ippSetBoolean">ippSetBoolean</a></li> | |
421 | <li><a href="#ippSetCollection">ippSetCollection</a></li> | |
422 | <li><a href="#ippSetDate">ippSetDate</a></li> | |
423 | <li><a href="#ippSetGroupTag">ippSetGroupTag</a></li> | |
424 | <li><a href="#ippSetInteger">ippSetInteger</a></li> | |
425 | <li><a href="#ippSetName">ippSetName</a></li> | |
426 | <li><a href="#ippSetOctetString">ippSetOctetString</a></li> | |
427 | <li><a href="#ippSetOperation">ippSetOperation</a></li> | |
428 | <li><a href="#ippSetPort">ippSetPort</a></li> | |
429 | <li><a href="#ippSetRange">ippSetRange</a></li> | |
430 | <li><a href="#ippSetRequestId">ippSetRequestId</a></li> | |
431 | <li><a href="#ippSetResolution">ippSetResolution</a></li> | |
432 | <li><a href="#ippSetState">ippSetState</a></li> | |
433 | <li><a href="#ippSetStatusCode">ippSetStatusCode</a></li> | |
434 | <li><a href="#ippSetString">ippSetString</a></li> | |
435 | <li><a href="#ippSetStringf">ippSetStringf</a></li> | |
436 | <li><a href="#ippSetStringfv">ippSetStringfv</a></li> | |
437 | <li><a href="#ippSetValueTag">ippSetValueTag</a></li> | |
438 | <li><a href="#ippSetVersion">ippSetVersion</a></li> | |
439 | <li><a href="#ippStateString">ippStateString</a></li> | |
440 | <li><a href="#ippTagString">ippTagString</a></li> | |
441 | <li><a href="#ippTagValue">ippTagValue</a></li> | |
442 | <li><a href="#ippTimeToDate">ippTimeToDate</a></li> | |
443 | <li><a href="#ippValidateAttribute">ippValidateAttribute</a></li> | |
444 | <li><a href="#ippValidateAttributes">ippValidateAttributes</a></li> | |
445 | <li><a href="#ippWrite">ippWrite</a></li> | |
446 | <li><a href="#ippWriteFile">ippWriteFile</a></li> | |
447 | <li><a href="#ippWriteIO">ippWriteIO</a></li> | |
798d6e29 MS |
448 | </ul></li> |
449 | <li><a href="#TYPES">Data Types</a><ul class="subcontents"> | |
798d6e29 | 450 | <li><a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a></li> |
798d6e29 MS |
451 | <li><a href="#cups_dest_cb_t">cups_dest_cb_t</a></li> |
452 | <li><a href="#cups_dest_t">cups_dest_t</a></li> | |
453 | <li><a href="#cups_dinfo_t">cups_dinfo_t</a></li> | |
798d6e29 | 454 | <li><a href="#cups_job_t">cups_job_t</a></li> |
798d6e29 MS |
455 | <li><a href="#cups_option_t">cups_option_t</a></li> |
456 | <li><a href="#cups_password_cb2_t">cups_password_cb2_t</a></li> | |
798d6e29 MS |
457 | <li><a href="#cups_ptype_t">cups_ptype_t</a></li> |
458 | <li><a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a></li> | |
459 | <li><a href="#cups_size_t">cups_size_t</a></li> | |
798d6e29 | 460 | <li><a href="#http_addr_t">http_addr_t</a></li> |
798d6e29 MS |
461 | <li><a href="#http_encoding_t">http_encoding_t</a></li> |
462 | <li><a href="#http_encryption_t">http_encryption_t</a></li> | |
463 | <li><a href="#http_field_t">http_field_t</a></li> | |
464 | <li><a href="#http_keepalive_t">http_keepalive_t</a></li> | |
465 | <li><a href="#http_state_t">http_state_t</a></li> | |
466 | <li><a href="#http_t">http_t</a></li> | |
467 | <li><a href="#http_timeout_cb_t">http_timeout_cb_t</a></li> | |
468 | <li><a href="#http_trust_t">http_trust_t</a></li> | |
469 | <li><a href="#http_uri_coding_t">http_uri_coding_t</a></li> | |
470 | <li><a href="#http_uri_status_t">http_uri_status_t</a></li> | |
798d6e29 MS |
471 | <li><a href="#ipp_attribute_t">ipp_attribute_t</a></li> |
472 | <li><a href="#ipp_copycb_t">ipp_copycb_t</a></li> | |
798d6e29 | 473 | <li><a href="#ipp_iocb_t">ipp_iocb_t</a></li> |
798d6e29 MS |
474 | <li><a href="#ipp_orient_t">ipp_orient_t</a></li> |
475 | <li><a href="#ipp_pstate_t">ipp_pstate_t</a></li> | |
476 | <li><a href="#ipp_quality_t">ipp_quality_t</a></li> | |
477 | <li><a href="#ipp_res_t">ipp_res_t</a></li> | |
06a5a4d3 MS |
478 | <li><a href="#ipp_rstate_t">ipp_rstate_t</a></li> |
479 | <li><a href="#ipp_sstate_t">ipp_sstate_t</a></li> | |
798d6e29 MS |
480 | <li><a href="#ipp_state_t">ipp_state_t</a></li> |
481 | <li><a href="#ipp_t">ipp_t</a></li> | |
798d6e29 MS |
482 | </ul></li> |
483 | <li><a href="#STRUCTURES">Structures</a><ul class="subcontents"> | |
798d6e29 MS |
484 | <li><a href="#cups_dest_s">cups_dest_s</a></li> |
485 | <li><a href="#cups_job_s">cups_job_s</a></li> | |
798d6e29 MS |
486 | <li><a href="#cups_option_s">cups_option_s</a></li> |
487 | <li><a href="#cups_size_s">cups_size_s</a></li> | |
798d6e29 | 488 | </ul></li> |
798d6e29 | 489 | <li><a href="#ENUMERATIONS">Enumerations</a><ul class="subcontents"> |
798d6e29 | 490 | <li><a href="#cups_ptype_e">cups_ptype_e</a></li> |
798d6e29 MS |
491 | <li><a href="#http_encoding_e">http_encoding_e</a></li> |
492 | <li><a href="#http_encryption_e">http_encryption_e</a></li> | |
493 | <li><a href="#http_field_e">http_field_e</a></li> | |
494 | <li><a href="#http_keepalive_e">http_keepalive_e</a></li> | |
495 | <li><a href="#http_state_e">http_state_e</a></li> | |
496 | <li><a href="#http_status_e">http_status_e</a></li> | |
497 | <li><a href="#http_trust_e">http_trust_e</a></li> | |
498 | <li><a href="#http_uri_coding_e">http_uri_coding_e</a></li> | |
499 | <li><a href="#http_uri_status_e">http_uri_status_e</a></li> | |
798d6e29 | 500 | <li><a href="#ipp_finishings_e">ipp_finishings_e</a></li> |
798d6e29 MS |
501 | <li><a href="#ipp_jstate_e">ipp_jstate_e</a></li> |
502 | <li><a href="#ipp_op_e">ipp_op_e</a></li> | |
503 | <li><a href="#ipp_orient_e">ipp_orient_e</a></li> | |
504 | <li><a href="#ipp_pstate_e">ipp_pstate_e</a></li> | |
505 | <li><a href="#ipp_quality_e">ipp_quality_e</a></li> | |
506 | <li><a href="#ipp_res_e">ipp_res_e</a></li> | |
06a5a4d3 MS |
507 | <li><a href="#ipp_rstate_e">ipp_rstate_e</a></li> |
508 | <li><a href="#ipp_sstate_e">ipp_sstate_e</a></li> | |
798d6e29 MS |
509 | <li><a href="#ipp_state_e">ipp_state_e</a></li> |
510 | <li><a href="#ipp_status_e">ipp_status_e</a></li> | |
511 | <li><a href="#ipp_tag_e">ipp_tag_e</a></li> | |
512 | </ul></li> | |
513 | </ul> | |
514 | </div> | |
515 | <div class="body"> | |
516 | <blockquote> | |
1da024d1 | 517 | <p>Please <a href="https://github.com/apple/cups/issues">file issues on Github</a> to provide feedback on this document.</p> |
798d6e29 | 518 | </blockquote> |
bea505c3 | 519 | <h2><a id="introduction">Introduction</a></h2> |
798d6e29 MS |
520 | <p>CUPS provides the "cups" library to talk to the different parts of CUPS and with Internet Printing Protocol (IPP) printers. The "cups" library functions are accessed by including the <code><cups/cups.h></code> header.</p> |
521 | <p>CUPS is based on the Internet Printing Protocol ("IPP"), 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> | |
bea505c3 | 522 | <h3><a id="guidelines">Guidelines</a></h3> |
73721e3e | 523 | <p>When writing software (other than printer drivers) that uses the "cups" library:</p> |
798d6e29 | 524 | <ul> |
bea505c3 MS |
525 | <li>Do not use undocumented or deprecated APIs,</li> |
526 | <li>Do not rely on pre-configured printers,</li> | |
527 | <li>Do not assume that printers support specific features or formats, and</li> | |
528 | <li>Do not rely on implementation details (PPDs, etc.)</li> | |
798d6e29 MS |
529 | </ul> |
530 | <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 ("print four copies, two-sided on A4 media, and staple each copy") and have the printing system manage the printer communication and format conversion needed.</p> | |
531 | <p>Similarly, printer and job management applications can use standard query operations to obtain the status information in a common, generic form and use standard management operations to control the state of those printers and jobs.</p> | |
73721e3e MS |
532 | <blockquote> |
533 | <p><strong>Note:</strong></p> | |
534 | <p>CUPS printer drivers necessarily depend on specific file formats and certain implementation details of the CUPS software. Please consult the Postscript and raster printer driver developer documentation on <a href="https://www.cups.org/documentation.html">CUPS.org</a> for more information.</p> | |
535 | </blockquote> | |
bea505c3 MS |
536 | <h3><a id="terms-used-in-this-document">Terms Used in This Document</a></h3> |
537 | <p>A <em>Destination</em> is a printer or print queue that accepts print jobs. A <em>Print</em> <em>Job</em> is a collection of one or more documents that are processed by a destination using options supplied when creating the job. A <em>Document</em> is a file (JPEG image, PDF file, etc.) suitable for printing. An <em>Option</em> controls some aspect of printing, such as the media used. <em>Media</em> is the sheets or roll that is printed on. An <em>Attribute</em> is an option encoded for an Internet Printing Protocol (IPP) request.</p> | |
538 | <h3><a id="compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></h3> | |
798d6e29 MS |
539 | <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> |
540 | <p>The following simple program lists the available destinations:</p> | |
541 | <pre><code>#include <stdio.h> | |
542 | #include <cups/cups.h> | |
543 | ||
544 | int print_dest(void *user_data, unsigned flags, cups_dest_t *dest) | |
545 | { | |
546 | if (dest->instance) | |
547 | printf("%s/%s\n", dest->name, dest->instance); | |
548 | else | |
549 | puts(dest->name); | |
550 | ||
551 | return (1); | |
552 | } | |
553 | ||
554 | int main(void) | |
555 | { | |
556 | cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, 0, 0, print_dest, NULL); | |
557 | ||
558 | return (0); | |
559 | } | |
560 | </code></pre> | |
bea505c3 MS |
561 | <h4><a id="compiling-with-xcode">Compiling with Xcode</a></h4> |
562 | <p>In Xcode, choose <em>New</em> <em>Project...</em> from the <em>File</em> menu (or press SHIFT+CMD+N), then select the <em>Command</em> <em>Line</em> <em>Tool</em> under the macOS Application project type. Click <em>Next</em> and enter a name for the project, for example "firstcups". Click <em>Next</em> and choose a project directory. The click <em>Next</em> to create the project.</p> | |
563 | <p>In the project window, click on the <em>Build</em> <em>Phases</em> group and expand the <em>Link</em> <em>Binary</em> <em>with</em> <em>Libraries</em> section. Click <em>+</em>, type "libcups" to show the library, and then double-click on <code>libcups.tbd</code>.</p> | |
798d6e29 | 564 | <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> |
bea505c3 MS |
565 | <h4><a id="compiling-with-gcc">Compiling with GCC</a></h4> |
566 | <p>From the command-line, create a file called <code>simple.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> | |
798d6e29 MS |
567 | <pre><code>gcc -o simple `cups-config --cflags` simple.c `cups-config --libs` |
568 | ./simple | |
569 | </code></pre> | |
9c44e2cb | 570 | <p>The <code>cups-config</code> command provides the compiler flags (<code>cups-config --cflags</code>) and libraries (<code>cups-config --libs</code>) needed for the local system.</p> |
bea505c3 | 571 | <h2><a id="working-with-destinations">Working with Destinations</a></h2> |
9c44e2cb | 572 | <p>Destinations, which in CUPS represent individual printers or classes (collections or pools) of printers, are represented by the <code>cups_dest_t</code> structure which includes the name (<code>name</code>), instance (<code>instance</code>, saved options/settings), whether the destination is the default for the user (<code>is_default</code>), and the options and basic information associated with that destination (<code>num_options</code> and <code>options</code>).</p> |
798d6e29 | 573 | <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> |
bea505c3 | 574 | <h3><a id="finding-available-destinations">Finding Available Destinations</a></h3> |
798d6e29 MS |
575 | <p>The <code>cupsEnumDests</code> function finds all of the available destinations:</p> |
576 | <pre><code> int | |
577 | cupsEnumDests(unsigned flags, int msec, int *cancel, | |
578 | cups_ptype_t type, cups_ptype_t mask, | |
579 | cups_dest_cb_t cb, void *user_data) | |
580 | </code></pre> | |
581 | <p>The <code>flags</code> argument specifies enumeration options, which at present must be <code>CUPS_DEST_FLAGS_NONE</code>.</p> | |
582 | <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> | |
583 | <p>The <code>cancel</code> argument points to an integer variable that, when set to a non-zero value, will cause enumeration to stop as soon as possible. It can be <code>NULL</code> if not needed.</p> | |
53af7f21 | 584 | <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 "printer-type" value is masked by the <code>mask</code> value and compared to the <code>type</code> value when filtering. For example, to only enumerate destinations that are hosted on the local system, pass <code>CUPS_PRINTER_LOCAL</code> for the <code>type</code> argument and <code>CUPS_PRINTER_DISCOVERED</code> for the <code>mask</code> argument. The following constants can be used for filtering:</p> |
798d6e29 | 585 | <ul> |
bea505c3 MS |
586 | <li><code>CUPS_PRINTER_CLASS</code>: A collection of destinations.</li> |
587 | <li><code>CUPS_PRINTER_FAX</code>: A facsimile device.</li> | |
588 | <li><code>CUPS_PRINTER_LOCAL</code>: A local printer or class. This constant has the value 0 (no bits set) and is only used for the <code>type</code> argument and is paired with the <code>CUPS_PRINTER_REMOTE</code> or <code>CUPS_PRINTER_DISCOVERED</code> constant passed in the <code>mask</code> argument.</li> | |
589 | <li><code>CUPS_PRINTER_REMOTE</code>: A remote (shared) printer or class.</li> | |
590 | <li><code>CUPS_PRINTER_DISCOVERED</code>: An available network printer or class.</li> | |
591 | <li><code>CUPS_PRINTER_BW</code>: Can do B&W printing.</li> | |
592 | <li><code>CUPS_PRINTER_COLOR</code>: Can do color printing.</li> | |
593 | <li><code>CUPS_PRINTER_DUPLEX</code>: Can do two-sided printing.</li> | |
594 | <li><code>CUPS_PRINTER_STAPLE</code>: Can staple output.</li> | |
595 | <li><code>CUPS_PRINTER_COLLATE</code>: Can quickly collate copies.</li> | |
596 | <li><code>CUPS_PRINTER_PUNCH</code>: Can punch output.</li> | |
597 | <li><code>CUPS_PRINTER_COVER</code>: Can cover output.</li> | |
598 | <li><code>CUPS_PRINTER_BIND</code>: Can bind output.</li> | |
599 | <li><code>CUPS_PRINTER_SORT</code>: Can sort output (mailboxes, etc.)</li> | |
600 | <li><code>CUPS_PRINTER_SMALL</code>: Can print on Letter/Legal/A4-size media.</li> | |
601 | <li><code>CUPS_PRINTER_MEDIUM</code>: Can print on Tabloid/B/C/A3/A2-size media.</li> | |
602 | <li><code>CUPS_PRINTER_LARGE</code>: Can print on D/E/A1/A0-size media.</li> | |
603 | <li><code>CUPS_PRINTER_VARIABLE</code>: Can print on rolls and custom-size media.</li> | |
798d6e29 MS |
604 | </ul> |
605 | <p>The <code>cb</code> argument specifies a function to call for every destination that is found:</p> | |
606 | <pre><code>typedef int (*cups_dest_cb_t)(void *user_data, | |
607 | unsigned flags, | |
608 | cups_dest_t *dest); | |
609 | </code></pre> | |
9c44e2cb | 610 | <p>The callback function receives a copy of the <code>user_data</code> argument along with a bitfield (<code>flags</code>) and the destination that was found. The <code>flags</code> argument can have any of the following constant (bit) values set:</p> |
798d6e29 | 611 | <ul> |
bea505c3 MS |
612 | <li><code>CUPS_DEST_FLAGS_MORE</code>: There are more destinations coming.</li> |
613 | <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> | |
614 | <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> | |
798d6e29 MS |
615 | </ul> |
616 | <p>The callback function returns 0 to stop enumeration or 1 to continue.</p> | |
718ee2ff | 617 | <blockquote> |
73721e3e MS |
618 | <p><strong>Note:</strong></p> |
619 | <p>The callback function will likely be called multiple times for the same destination, so it is up to the caller to suppress any duplicate destinations.</p> | |
718ee2ff | 620 | </blockquote> |
798d6e29 MS |
621 | <p>The following example shows how to use <code>cupsEnumDests</code> to get a filtered array of destinations:</p> |
622 | <pre><code>typedef struct | |
623 | { | |
624 | int num_dests; | |
625 | cups_dest_t *dests; | |
626 | } my_user_data_t; | |
627 | ||
628 | int | |
629 | my_dest_cb(my_user_data_t *user_data, unsigned flags, | |
630 | cups_dest_t *dest) | |
631 | { | |
632 | if (flags & CUPS_DEST_FLAGS_REMOVED) | |
633 | { | |
634 | /* | |
635 | * Remove destination from array... | |
636 | */ | |
637 | ||
638 | user_data->num_dests = | |
639 | cupsRemoveDest(dest->name, dest->instance, | |
640 | user_data->num_dests, | |
641 | &(user_data->dests)); | |
642 | } | |
643 | else | |
644 | { | |
645 | /* | |
646 | * Add destination to array... | |
647 | */ | |
648 | ||
649 | user_data->num_dests = | |
650 | cupsCopyDest(dest, user_data->num_dests, | |
651 | &(user_data->dests)); | |
652 | } | |
653 | ||
654 | return (1); | |
655 | } | |
656 | ||
657 | int | |
658 | my_get_dests(cups_ptype_t type, cups_ptype_t mask, | |
659 | cups_dest_t **dests) | |
660 | { | |
661 | my_user_data_t user_data = { 0, NULL }; | |
662 | ||
663 | if (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, type, | |
664 | mask, (cups_dest_cb_t)my_dest_cb, | |
665 | &user_data)) | |
666 | { | |
667 | /* | |
668 | * An error occurred, free all of the destinations and | |
669 | * return... | |
670 | */ | |
671 | ||
672 | cupsFreeDests(user_data.num_dests, user_dasta.dests); | |
673 | ||
674 | *dests = NULL; | |
675 | ||
676 | return (0); | |
677 | } | |
678 | ||
679 | /* | |
680 | * Return the destination array... | |
681 | */ | |
682 | ||
683 | *dests = user_data.dests; | |
684 | ||
685 | return (user_data.num_dests); | |
686 | } | |
687 | </code></pre> | |
bea505c3 | 688 | <h3><a id="basic-destination-information">Basic Destination Information</a></h3> |
798d6e29 MS |
689 | <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> |
690 | <ul> | |
bea505c3 MS |
691 | <li>"auth-info-required": The type of authentication required for printing to this destination: "none", "username,password", "domain,username,password", or "negotiate" (Kerberos).</li> |
692 | <li>"printer-info": The human-readable description of the destination such as "My Laser Printer".</li> | |
693 | <li>"printer-is-accepting-jobs": "true" if the destination is accepting new jobs, "false" otherwise.</li> | |
694 | <li>"printer-is-shared": "true" if the destination is being shared with other computers, "false" otherwise.</li> | |
695 | <li>"printer-location": The human-readable location of the destination such as "Lab 4".</li> | |
696 | <li>"printer-make-and-model": The human-readable make and model of the destination such as "ExampleCorp LaserPrinter 4000 Series".</li> | |
697 | <li>"printer-state": "3" if the destination is idle, "4" if the destination is printing a job, and "5" if the destination is stopped.</li> | |
698 | <li>"printer-state-change-time": The UNIX time when the destination entered the current state.</li> | |
699 | <li>"printer-state-reasons": Additional comma-delimited state keywords for the destination such as "media-tray-empty-error" and "toner-low-warning".</li> | |
700 | <li>"printer-type": The <code>cups_ptype_t</code> value associated with the destination.</li> | |
701 | <li>"printer-uri-supported": The URI associated with the destination; if not set, this destination was discovered but is not yet setup as a local printer.</li> | |
798d6e29 MS |
702 | </ul> |
703 | <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> | |
704 | <pre><code>const char *model = cupsGetOption("printer-make-and-model", | |
705 | dest->num_options, | |
706 | dest->options); | |
707 | </code></pre> | |
bea505c3 | 708 | <h3><a id="detailed-destination-information">Detailed Destination Information</a></h3> |
798d6e29 MS |
709 | <p>Once a destination has been chosen, the <code>cupsCopyDestInfo</code> function can be used to gather detailed information about the destination:</p> |
710 | <pre><code>cups_dinfo_t * | |
711 | cupsCopyDestInfo(http_t *http, cups_dest_t *dest); | |
712 | </code></pre> | |
713 | <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> | |
714 | <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> | |
bea505c3 | 715 | <h4><a id="getting-supported-options-and-values">Getting Supported Options and Values</a></h4> |
798d6e29 MS |
716 | <p>The <code>cupsCheckDestSupported</code> function can be used to test whether a particular option or option and value is supported:</p> |
717 | <pre><code>int | |
718 | cupsCheckDestSupported(http_t *http, cups_dest_t *dest, | |
719 | cups_dinfo_t *info, | |
720 | const char *option, | |
721 | const char *value); | |
722 | </code></pre> | |
723 | <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> | |
724 | <ul> | |
bea505c3 MS |
725 | <li><code>CUPS_COPIES</code>: Controls the number of copies that are produced.</li> |
726 | <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> | |
727 | <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> | |
728 | <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> | |
729 | <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> | |
730 | <li><code>CUPS_NUMBER_UP</code>: Controls the number of document pages that are placed on each media side.</li> | |
731 | <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> | |
732 | <li><code>CUPS_PRINT_COLOR_MODE</code>: Controls whether the output is in color (<code>CUPS_PRINT_COLOR_MODE_COLOR</code>), grayscale (<code>CUPS_PRINT_COLOR_MODE_MONOCHROME</code>), or either (<code>CUPS_PRINT_COLOR_MODE_AUTO</code>).</li> | |
733 | <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> | |
734 | <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> | |
798d6e29 MS |
735 | </ul> |
736 | <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> | |
737 | <p>The <code>cupsFindDestSupported</code> function returns the IPP attribute containing the supported values for a given option:</p> | |
738 | <pre><code> ipp_attribute_t * | |
739 | cupsFindDestSupported(http_t *http, cups_dest_t *dest, | |
740 | cups_dinfo_t *dinfo, | |
741 | const char *option); | |
742 | </code></pre> | |
743 | <p>For example, the following code prints the supported finishing processes for a destination, if any, to the standard output:</p> | |
744 | <pre><code>cups_dinfo_t *info = cupsCopyDestInfo(CUPS_HTTP_DEFAULT, | |
745 | dest); | |
746 | ||
747 | if (cupsCheckDestSupported(CUPS_HTTP_DEFAULT, dest, info, | |
748 | CUPS_FINISHINGS, NULL)) | |
749 | { | |
750 | ipp_attribute_t *finishings = | |
751 | cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info, | |
752 | CUPS_FINISHINGS); | |
753 | int i, count = ippGetCount(finishings); | |
754 | ||
755 | puts("finishings supported:"); | |
756 | for (i = 0; i < count; i ++) | |
757 | printf(" %d\n", ippGetInteger(finishings, i)); | |
758 | } | |
759 | else | |
760 | puts("finishings not supported."); | |
761 | </code></pre> | |
762 | <p>The "job-creation-attributes" 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> | |
763 | <pre><code>ipp_attribute_t *attrs = | |
764 | cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info, | |
765 | "job-creation-attributes"); | |
766 | int i, count = ippGetCount(attrs); | |
767 | ||
768 | for (i = 0; i < count; i ++) | |
769 | puts(ippGetString(attrs, i, NULL)); | |
770 | </code></pre> | |
bea505c3 | 771 | <h4><a id="getting-default-values">Getting Default Values</a></h4> |
798d6e29 MS |
772 | <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> |
773 | <pre><code>ipp_attribute_t * | |
774 | cupsFindDestDefault(http_t *http, cups_dest_t *dest, | |
775 | cups_dinfo_t *dinfo, | |
776 | const char *option); | |
777 | </code></pre> | |
778 | <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> | |
779 | <pre><code>const char *def_value = | |
780 | cupsGetOption(CUPS_FINISHINGS, dest->num_options, | |
781 | dest->options); | |
782 | ipp_attribute_t *def_attr = | |
783 | cupsFindDestDefault(CUPS_HTTP_DEFAULT, dest, info, | |
784 | CUPS_FINISHINGS); | |
785 | ||
786 | if (def_value != NULL) | |
787 | { | |
788 | printf("Default finishings: %s\n", def_value); | |
789 | } | |
790 | else | |
791 | { | |
792 | int i, count = ippGetCount(def_attr); | |
793 | ||
794 | printf("Default finishings: %d", | |
795 | ippGetInteger(def_attr, 0)); | |
796 | for (i = 1; i < count; i ++) | |
797 | printf(",%d", ippGetInteger(def_attr, i)); | |
798 | putchar('\n'); | |
799 | } | |
800 | </code></pre> | |
bea505c3 | 801 | <h4><a id="getting-ready-loaded-values">Getting Ready (Loaded) Values</a></h4> |
798d6e29 MS |
802 | <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> |
803 | <p>The <code>cupsFindDestReady</code> function finds the IPP attribute containing the ready values for a given option:</p> | |
804 | <pre><code>ipp_attribute_t * | |
805 | cupsFindDestReady(http_t *http, cups_dest_t *dest, | |
806 | cups_dinfo_t *dinfo, const char *option); | |
807 | </code></pre> | |
808 | <p>For example, the following code lists the ready finishing processes:</p> | |
809 | <pre><code>ipp_attribute_t *ready_finishings = | |
810 | cupsFindDestReady(CUPS_HTTP_DEFAULT, dest, info, | |
811 | CUPS_FINISHINGS); | |
812 | ||
813 | if (ready_finishings != NULL) | |
814 | { | |
815 | int i, count = ippGetCount(ready_finishings); | |
816 | ||
817 | puts("finishings ready:"); | |
818 | for (i = 0; i < count; i ++) | |
819 | printf(" %d\n", ippGetInteger(ready_finishings, i)); | |
820 | } | |
821 | else | |
822 | puts("no finishings are ready."); | |
823 | </code></pre> | |
bea505c3 | 824 | <h4><a id="media-size-options">Media Size Options</a></h4> |
798d6e29 MS |
825 | <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> |
826 | <pre><code>typedef struct cups_size_s | |
827 | { | |
828 | char media[128]; | |
829 | int width, length; | |
830 | int bottom, left, right, top; | |
831 | } cups_size_t; | |
832 | </code></pre> | |
833 | <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> | |
834 | <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> | |
835 | <pre><code>int | |
836 | cupsGetDestMediaByName(http_t *http, cups_dest_t *dest, | |
837 | cups_dinfo_t *dinfo, | |
838 | const char *media, | |
839 | unsigned flags, cups_size_t *size); | |
840 | ||
841 | int | |
842 | cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest, | |
843 | cups_dinfo_t *dinfo, | |
844 | int width, int length, | |
845 | unsigned flags, cups_size_t *size); | |
846 | </code></pre> | |
847 | <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> | |
848 | <ul> | |
bea505c3 MS |
849 | <li><code>CUPS_MEDIA_FLAGS_DEFAULT</code>: Find the closest size supported by the printer.</li> |
850 | <li><code>CUPS_MEDIA_FLAGS_BORDERLESS</code>: Find a borderless size.</li> | |
851 | <li><code>CUPS_MEDIA_FLAGS_DUPLEX</code>: Find a size compatible with two-sided printing.</li> | |
852 | <li><code>CUPS_MEDIA_FLAGS_EXACT</code>: Find an exact match for the size.</li> | |
853 | <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 "ready" media.</li> | |
798d6e29 MS |
854 | </ul> |
855 | <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> | |
856 | <p>For example, the following code prints the margins for two-sided printing on US Letter media:</p> | |
857 | <pre><code>cups_size_t size; | |
858 | ||
859 | if (cupsGetDestMediaByName(CUPS_HTTP_DEFAULT, dest, info, | |
860 | CUPS_MEDIA_LETTER, | |
861 | CUPS_MEDIA_FLAGS_DUPLEX, &size)) | |
862 | { | |
863 | puts("Margins for duplex US Letter:"); | |
864 | printf(" Bottom: %.2fin\n", size.bottom / 2540.0); | |
865 | printf(" Left: %.2fin\n", size.left / 2540.0); | |
866 | printf(" Right: %.2fin\n", size.right / 2540.0); | |
867 | printf(" Top: %.2fin\n", size.top / 2540.0); | |
868 | } | |
869 | else | |
870 | puts("Margins for duplex US Letter are not available."); | |
871 | </code></pre> | |
872 | <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> | |
873 | <pre><code>int | |
874 | cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest, | |
875 | cups_dinfo_t *dinfo, int n, | |
876 | unsigned flags, cups_size_t *size); | |
877 | ||
878 | int | |
879 | cupsGetDestMediaCount(http_t *http, cups_dest_t *dest, | |
880 | cups_dinfo_t *dinfo, unsigned flags); | |
881 | </code></pre> | |
882 | <p>For example, the following code prints the list of ready media and corresponding margins:</p> | |
883 | <pre><code>cups_size_t size; | |
884 | int i; | |
885 | int count = cupsGetDestMediaCount(CUPS_HTTP_DEFAULT, | |
886 | dest, info, | |
887 | CUPS_MEDIA_FLAGS_READY); | |
888 | ||
889 | for (i = 0; i < count; i ++) | |
890 | { | |
891 | if (cupsGetDestMediaByIndex(CUPS_HTTP_DEFAULT, dest, info, | |
892 | i, CUPS_MEDIA_FLAGS_READY, | |
893 | &size)) | |
894 | { | |
895 | printf("%s:\n", size.name); | |
896 | printf(" Width: %.2fin\n", size.width / 2540.0); | |
897 | printf(" Length: %.2fin\n", size.length / 2540.0); | |
898 | printf(" Bottom: %.2fin\n", size.bottom / 2540.0); | |
899 | printf(" Left: %.2fin\n", size.left / 2540.0); | |
900 | printf(" Right: %.2fin\n", size.right / 2540.0); | |
901 | printf(" Top: %.2fin\n", size.top / 2540.0); | |
902 | } | |
903 | } | |
904 | </code></pre> | |
905 | <p>Finally, the <code>cupsGetDestMediaDefault</code> function returns the default media size:</p> | |
906 | <pre><code>int | |
907 | cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest, | |
908 | cups_dinfo_t *dinfo, unsigned flags, | |
909 | cups_size_t *size); | |
910 | </code></pre> | |
bea505c3 | 911 | <h4><a id="localizing-options-and-values">Localizing Options and Values</a></h4> |
6ad44eeb | 912 | <p>CUPS provides three functions to get localized, human-readable strings in the user's current locale for options and values: <code>cupsLocalizeDestMedia</code>, <code>cupsLocalizeDestOption</code>, and <code>cupsLocalizeDestValue</code>:</p> |
798d6e29 MS |
913 | <pre><code>const char * |
914 | cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest, | |
915 | cups_dinfo_t *info, unsigned flags, | |
916 | cups_size_t *size); | |
917 | ||
918 | const char * | |
919 | cupsLocalizeDestOption(http_t *http, cups_dest_t *dest, | |
920 | cups_dinfo_t *info, | |
921 | const char *option); | |
922 | ||
923 | const char * | |
924 | cupsLocalizeDestValue(http_t *http, cups_dest_t *dest, | |
925 | cups_dinfo_t *info, | |
926 | const char *option, const char *value); | |
927 | </code></pre> | |
bea505c3 | 928 | <h3><a id="submitting-a-print-job">Submitting a Print Job</a></h3> |
798d6e29 MS |
929 | <p>Once you are ready to submit a print job, you create a job using the <code>cupsCreateDestJob</code> function:</p> |
930 | <pre><code>ipp_status_t | |
931 | cupsCreateDestJob(http_t *http, cups_dest_t *dest, | |
932 | cups_dinfo_t *info, int *job_id, | |
933 | const char *title, int num_options, | |
934 | cups_option_t *options); | |
935 | </code></pre> | |
936 | <p>The <code>title</code> argument specifies a name for the print job such as "My Document". 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> | |
937 | <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> | |
938 | <p>For example, the following code creates a new job that will print 42 copies of a two-sided US Letter document:</p> | |
939 | <pre><code>int job_id = 0; | |
940 | int num_options = 0; | |
941 | cups_option_t *options = NULL; | |
942 | ||
943 | num_options = cupsAddOption(CUPS_COPIES, "42", | |
944 | num_options, &options); | |
945 | num_options = cupsAddOption(CUPS_MEDIA, CUPS_MEDIA_LETTER, | |
946 | num_options, &options); | |
947 | num_options = cupsAddOption(CUPS_SIDES, | |
948 | CUPS_SIDES_TWO_SIDED_PORTRAIT, | |
949 | num_options, &options); | |
950 | ||
951 | if (cupsCreateDestJob(CUPS_HTTP_DEFAULT, dest, info, | |
952 | &job_id, "My Document", num_options, | |
953 | options) == IPP_STATUS_OK) | |
954 | printf("Created job: %d\n", job_id); | |
955 | else | |
956 | printf("Unable to create job: %s\n", | |
957 | cupsLastErrorString()); | |
958 | </code></pre> | |
959 | <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> | |
960 | <pre><code>http_status_t | |
961 | cupsStartDestDocument(http_t *http, cups_dest_t *dest, | |
962 | cups_dinfo_t *info, int job_id, | |
963 | const char *docname, | |
964 | const char *format, | |
965 | int num_options, | |
966 | cups_option_t *options, | |
967 | int last_document); | |
968 | ||
969 | http_status_t | |
970 | cupsWriteRequestData(http_t *http, const char *buffer, | |
971 | size_t length); | |
972 | ||
973 | ipp_status_t | |
974 | cupsFinishDestDocument(http_t *http, cups_dest_t *dest, | |
975 | cups_dinfo_t *info); | |
976 | </code></pre> | |
977 | <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> | |
978 | <ul> | |
bea505c3 MS |
979 | <li><code>CUPS_FORMAT_JPEG</code>: "image/jpeg"</li> |
980 | <li><code>CUPS_FORMAT_PDF</code>: "application/pdf"</li> | |
981 | <li><code>CUPS_FORMAT_POSTSCRIPT</code>: "application/postscript"</li> | |
982 | <li><code>CUPS_FORMAT_TEXT</code>: "text/plain"</li> | |
798d6e29 MS |
983 | </ul> |
984 | <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> | |
985 | <p>For example, the following code submits a PDF file to the job that was just created:</p> | |
986 | <pre><code>FILE *fp = fopen("filename.pdf", "rb"); | |
987 | size_t bytes; | |
988 | char buffer[65536]; | |
989 | ||
990 | if (cupsStartDestDocument(CUPS_HTTP_DEFAULT, dest, info, | |
991 | job_id, "filename.pdf", 0, NULL, | |
992 | 1) == HTTP_STATUS_CONTINUE) | |
993 | { | |
994 | while ((bytes = fread(buffer, 1, sizeof(buffer), fp)) > 0) | |
995 | if (cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer, | |
996 | bytes) != HTTP_STATUS_CONTINUE) | |
997 | break; | |
998 | ||
999 | if (cupsFinishDestDocument(CUPS_HTTP_DEFAULT, dest, | |
1000 | info) == IPP_STATUS_OK) | |
1001 | puts("Document send succeeded."); | |
1002 | else | |
1003 | printf("Document send failed: %s\n", | |
1004 | cupsLastErrorString()); | |
1005 | } | |
1006 | ||
1007 | fclose(fp); | |
1008 | </code></pre> | |
bea505c3 | 1009 | <h2><a id="sending-ipp-requests">Sending IPP Requests</a></h2> |
b0fb2d75 | 1010 | <p>CUPS provides a rich API for sending IPP requests to the scheduler or printers, typically from management or utility applications whose primary purpose is not to send print jobs.</p> |
bea505c3 | 1011 | <h3><a id="connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</a></h3> |
b0fb2d75 MS |
1012 | <p>The connection to the scheduler or printer is represented by the HTTP connection type <code>http_t</code>. The <code>cupsConnectDest</code> function connects to the scheduler or printer associated with the destination:</p> |
1013 | <pre><code>http_t * | |
1014 | cupsConnectDest(cups_dest_t *dest, unsigned flags, int msec, | |
1015 | int *cancel, char *resource, | |
1016 | size_t resourcesize, cups_dest_cb_t cb, | |
1017 | void *user_data); | |
1018 | </code></pre> | |
1019 | <p>The <code>dest</code> argument specifies the destination to connect to.</p> | |
1020 | <p>The <code>flags</code> argument specifies whether you want to connect to the scheduler (<code>CUPS_DEST_FLAGS_NONE</code>) or device/printer (<code>CUPS_DEST_FLAGS_DEVICE</code>) associated with the destination.</p> | |
1021 | <p>The <code>msec</code> argument specifies how long you are willing to wait for the connection to be established in milliseconds. Specify a value of <code>-1</code> to wait indefinitely.</p> | |
1022 | <p>The <code>cancel</code> argument specifies the address of an integer variable that can be set to a non-zero value to cancel the connection. Specify a value of <code>NULL</code> to not provide a cancel variable.</p> | |
1023 | <p>The <code>resource</code> and <code>resourcesize</code> arguments specify the address and size of a character string array to hold the path to use when sending an IPP request.</p> | |
1024 | <p>The <code>cb</code> and <code>user_data</code> arguments specify a destination callback function that returns 1 to continue connecting or 0 to stop. The destination callback work the same way as the one used for the <code>cupsEnumDests</code> function.</p> | |
1025 | <p>On success, a HTTP connection is returned that can be used to send IPP requests and get IPP responses.</p> | |
1026 | <p>For example, the following code connects to the printer associated with a destination with a 30 second timeout:</p> | |
1027 | <pre><code>char resource[256]; | |
1028 | http_t *http = cupsConnectDest(dest, CUPS_DEST_FLAGS_DEVICE, | |
1029 | 30000, NULL, resource, | |
1030 | sizeof(resource), NULL, NULL); | |
1031 | </code></pre> | |
bea505c3 | 1032 | <h3><a id="creating-an-ipp-request">Creating an IPP Request</a></h3> |
b0fb2d75 MS |
1033 | <p>IPP requests are represented by the IPP message type <code>ipp_t</code> and each IPP attribute in the request is representing using the type <code>ipp_attribute_t</code>. Each IPP request includes an operation code (<code>IPP_OP_CREATE_JOB</code>, <code>IPP_OP_GET_PRINTER_ATTRIBUTES</code>, etc.) and a 32-bit integer identifier.</p> |
1034 | <p>The <code>ippNewRequest</code> function creates a new IPP request:</p> | |
1035 | <pre><code>ipp_t * | |
1036 | ippNewRequest(ipp_op_t op); | |
1037 | </code></pre> | |
1038 | <p>The <code>op</code> argument specifies the IPP operation code for the request. For example, the following code creates an IPP Get-Printer-Attributes request:</p> | |
1039 | <pre><code>ipp_t *request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES); | |
1040 | </code></pre> | |
1041 | <p>The request identifier is automatically set to a unique value for the current process.</p> | |
1042 | <p>Each IPP request starts with two IPP attributes, "attributes-charset" and "attributes-natural-language", followed by IPP attribute(s) that specify the target of the operation. The <code>ippNewRequest</code> automatically adds the correct "attributes-charset" and "attributes-natural-language" attributes, but you must add the target attribute(s). For example, the following code adds the "printer-uri" attribute to the IPP Get-Printer-Attributes request to specify which printer is being queried:</p> | |
1043 | <pre><code>const char *printer_uri = cupsGetOption("device-uri", | |
1044 | dest->num_options, | |
1045 | dest->options); | |
1046 | ||
1047 | ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, | |
1048 | "printer-uri", NULL, printer_uri); | |
1049 | </code></pre> | |
1050 | <blockquote> | |
73721e3e MS |
1051 | <p><strong>Note:</strong></p> |
1052 | <p>If we wanted to query the scheduler instead of the device, we would look up the "printer-uri-supported" option instead of the "device-uri" value.</p> | |
b0fb2d75 MS |
1053 | </blockquote> |
1054 | <p>The <code>ippAddString</code> function adds the "printer-uri" attribute the the IPP request. The <code>IPP_TAG_OPERATION</code> argument specifies that the attribute is part of the operation. The <code>IPP_TAG_URI</code> argument specifies that the value is a Universal Resource Identifier (URI) string. The <code>NULL</code> argument specifies there is no language (English, French, Japanese, etc.) associated with the string, and the <code>printer_uri</code> argument specifies the string value.</p> | |
1055 | <p>The IPP Get-Printer-Attributes request also supports an IPP attribute called "requested-attributes" that lists the attributes and values you are interested in. For example, the following code requests the printer state attributes:</p> | |
1056 | <pre><code>static const char * const requested_attributes[] = | |
1057 | { | |
1058 | "printer-state", | |
1059 | "printer-state-message", | |
1060 | "printer-state-reasons" | |
1061 | }; | |
1062 | ||
1063 | ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, | |
1064 | "requested-attributes", 3, NULL, | |
1065 | requested_attributes); | |
1066 | </code></pre> | |
1067 | <p>The <code>ippAddStrings</code> function adds an attribute with one or more strings, in this case three. The <code>IPP_TAG_KEYWORD</code> argument specifies that the strings are keyword values, which are used for attribute names. All strings use the same language (<code>NULL</code>), and the attribute will contain the three strings in the array <code>requested_attributes</code>.</p> | |
1068 | <p>CUPS provides many functions to adding attributes of different types:</p> | |
1069 | <ul> | |
bea505c3 MS |
1070 | <li><code>ippAddBoolean</code> adds a boolean (<code>IPP_TAG_BOOLEAN</code>) attribute with one value.</li> |
1071 | <li><code>ippAddInteger</code> adds an enum (<code>IPP_TAG_ENUM</code>) or integer (<code>IPP_TAG_INTEGER</code>) attribute with one value.</li> | |
1072 | <li><code>ippAddIntegers</code> adds an enum or integer attribute with one or more values.</li> | |
1073 | <li><code>ippAddOctetString</code> adds an octetString attribute with one value.</li> | |
1074 | <li><code>ippAddOutOfBand</code> adds a admin-defined (<code>IPP_TAG_ADMINDEFINE</code>), default (<code>IPP_TAG_DEFAULT</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable (<code>IPP_TAG_NOTSETTABLE</code>), unknown (<code>IPP_TAG_UNKNOWN</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_VALUE</code>) out-of-band attribute.</li> | |
1075 | <li><code>ippAddRange</code> adds a rangeOfInteger attribute with one range.</li> | |
1076 | <li><code>ippAddRanges</code> adds a rangeOfInteger attribute with one or more ranges.</li> | |
1077 | <li><code>ippAddResolution</code> adds a resolution attribute with one resolution.</li> | |
1078 | <li><code>ippAddResolutions</code> adds a resolution attribute with one or more resolutions.</li> | |
1079 | <li><code>ippAddString</code> adds a charset (<code>IPP_TAG_CHARSET</code>), keyword (<code>IPP_TAG_KEYWORD</code>), mimeMediaType (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code> and <code>IPP_TAG_NAMELANG</code>), naturalLanguage (<code>IPP_TAG_NATURAL_LANGUAGE</code>), text (<code>IPP_TAG_TEXT</code> and <code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), or uriScheme (<code>IPP_TAG_URISCHEME</code>) attribute with one value.</li> | |
1080 | <li><code>ippAddStrings</code> adds a charset, keyword, mimeMediaType, name, naturalLanguage, text, uri, or uriScheme attribute with one or more values.</li> | |
b0fb2d75 | 1081 | </ul> |
bea505c3 | 1082 | <h3><a id="sending-the-ipp-request">Sending the IPP Request</a></h3> |
b0fb2d75 MS |
1083 | <p>Once you have created the IPP request, you can send it using the <code>cupsDoRequest</code> function. For example, the following code sends the IPP Get-Printer-Attributes request to the destination and saves the response:</p> |
1084 | <pre><code>ipp_t *response = cupsDoRequest(http, request, resource); | |
1085 | </code></pre> | |
1086 | <p>For requests like Send-Document that include a file, the <code>cupsDoFileRequest</code> function should be used:</p> | |
1087 | <pre><code>ipp_t *response = cupsDoFileRequest(http, request, resource, | |
1088 | filename); | |
1089 | </code></pre> | |
1090 | <p>Both <code>cupsDoRequest</code> and <code>cupsDoFileRequest</code> free the IPP request. If a valid IPP response is received, it is stored in a new IPP message (<code>ipp_t</code>) and returned to the caller. Otherwise <code>NULL</code> is returned.</p> | |
1091 | <p>The status from the most recent request can be queried using the <code>cupsLastError</code> function, for example:</p> | |
1092 | <pre><code>if (cupsLastError() >= IPP_STATUS_ERROR_BAD_REQUEST) | |
1093 | { | |
1094 | /* request failed */ | |
1095 | } | |
1096 | </code></pre> | |
1097 | <p>A human-readable error message is also available using the <code>cupsLastErrorString</code> function:</p> | |
1098 | <pre><code>if (cupsLastError() >= IPP_STATUS_ERROR_BAD_REQUEST) | |
1099 | { | |
1100 | /* request failed */ | |
1101 | printf("Request failed: %s\n", cupsLastErrorString()); | |
1102 | } | |
1103 | </code></pre> | |
bea505c3 | 1104 | <h3><a id="processing-the-ipp-response">Processing the IPP Response</a></h3> |
b0fb2d75 MS |
1105 | <p>Each response to an IPP request is also an IPP message (<code>ipp_t</code>) with its own IPP attributes (<code>ipp_attribute_t</code>) that includes a status code (<code>IPP_STATUS_OK</code>, <code>IPP_STATUS_ERROR_BAD_REQUEST</code>, etc.) and the corresponding 32-bit integer identifier from the request.</p> |
1106 | <p>For example, the following code finds the printer state attributes and prints their values:</p> | |
1107 | <pre><code>ipp_attribute_t *attr; | |
1108 | ||
1109 | if ((attr = ippFindAttribute(response, "printer-state", | |
1110 | IPP_TAG_ENUM)) != NULL) | |
1111 | { | |
1112 | printf("printer-state=%s\n", | |
db5424ea | 1113 | ippEnumString("printer-state", ippGetInteger(attr, 0))); |
b0fb2d75 MS |
1114 | } |
1115 | else | |
1116 | puts("printer-state=unknown"); | |
1117 | ||
1118 | if ((attr = ippFindAttribute(response, "printer-state-message", | |
1119 | IPP_TAG_TEXT)) != NULL) | |
1120 | { | |
1121 | printf("printer-state-message=\"%s\"\n", | |
1122 | ippGetString(attr, 0, NULL))); | |
1123 | } | |
1124 | ||
1125 | if ((attr = ippFindAttribute(response, "printer-state-reasons", | |
1126 | IPP_TAG_KEYWORD)) != NULL) | |
1127 | { | |
1128 | int i, count = ippGetCount(attr); | |
1129 | ||
1130 | puts("printer-state-reasons="); | |
1131 | for (i = 0; i < count; i ++) | |
1132 | printf(" %s\n", ippGetString(attr, i, NULL))); | |
1133 | } | |
1134 | </code></pre> | |
1135 | <p>The <code>ippGetCount</code> function returns the number of values in an attribute.</p> | |
1136 | <p>The <code>ippGetInteger</code> and <code>ippGetString</code> functions return a single integer or string value from an attribute.</p> | |
db5424ea | 1137 | <p>The <code>ippEnumString</code> function converts a enum value to its keyword (string) equivalent.</p> |
b0fb2d75 MS |
1138 | <p>Once you are done using the IPP response message, free it using the <code>ippDelete</code> function:</p> |
1139 | <pre><code>ippDelete(response); | |
1140 | </code></pre> | |
bea505c3 | 1141 | <h3><a id="authentication">Authentication</a></h3> |
b0fb2d75 MS |
1142 | <p>CUPS normally handles authentication through the console. GUI applications should set a password callback using the <code>cupsSetPasswordCB2</code> function:</p> |
1143 | <pre><code>void | |
1144 | cupsSetPasswordCB2(cups_password_cb2_t cb, void *user_data); | |
1145 | </code></pre> | |
1146 | <p>The password callback will be called when needed and is responsible for setting the current user name using <code>cupsSetUser</code> and returning a string:</p> | |
1147 | <pre><code>const char * | |
1148 | cups_password_cb2(const char *prompt, http_t *http, | |
1149 | const char *method, const char *resource, | |
1150 | void *user_data); | |
1151 | </code></pre> | |
1152 | <p>The <code>prompt</code> argument is a string from CUPS that should be displayed to the user.</p> | |
1153 | <p>The <code>http</code> argument is the connection hosting the request that is being authenticated. The password callback can call the <code>httpGetField</code> and <code>httpGetSubField</code> functions to look for additional details concerning the authentication challenge.</p> | |
1154 | <p>The <code>method</code> argument specifies the HTTP method used for the request and is typically "POST".</p> | |
1155 | <p>The <code>resource</code> argument specifies the path used for the request.</p> | |
1156 | <p>The <code>user_data</code> argument provides the user data pointer from the <code>cupsSetPasswordCB2</code> call.</p> | |
798d6e29 MS |
1157 | <h2 class="title"><a id="FUNCTIONS">Functions</a></h2> |
1158 | <h3 class="function"><a id="cupsAddDest">cupsAddDest</a></h3> | |
1159 | <p class="description">Add a destination to the list of destinations.</p> | |
1160 | <p class="code"> | |
98d88c8d MS |
1161 | int cupsAddDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p> |
1162 | <h4 class="parameters">Parameters</h4> | |
1163 | <table class="list"><tbody> | |
1164 | <tr><th>name</th> | |
1165 | <td class="description">Destination name</td></tr> | |
1166 | <tr><th>instance</th> | |
1167 | <td class="description">Instance name or <code>NULL</code> for none/primary</td></tr> | |
1168 | <tr><th>num_dests</th> | |
1169 | <td class="description">Number of destinations</td></tr> | |
1170 | <tr><th>dests</th> | |
1171 | <td class="description">Destinations</td></tr> | |
1172 | </tbody></table> | |
798d6e29 MS |
1173 | <h4 class="returnvalue">Return Value</h4> |
1174 | <p class="description">New number of destinations</p> | |
1175 | <h4 class="discussion">Discussion</h4> | |
1176 | <p class="discussion">This function cannot be used to add a new class or printer queue, | |
1177 | it only adds a new container of saved options for the named | |
1178 | destination or instance.<br> | |
1179 | <br> | |
1180 | If the named destination already exists, the destination list is | |
1181 | returned unchanged. Adding a new instance of a destination creates | |
1182 | a copy of that destination's options.<br> | |
1183 | <br> | |
1184 | Use the <a href="#cupsSaveDests"><code>cupsSaveDests</code></a> function to save the updated list of | |
1185 | destinations to the user's lpoptions file.</p> | |
c669a17e | 1186 | <h3 class="function"><span class="info"> CUPS 2.3/macOS 10.14 </span><a id="cupsAddDestMediaOptions">cupsAddDestMediaOptions</a></h3> |
63b75fbe MS |
1187 | <p class="description">Add the option corresponding to the specified media size.</p> |
1188 | <p class="code"> | |
1189 | int cupsAddDestMediaOptions(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p> | |
1190 | <h4 class="parameters">Parameters</h4> | |
1191 | <table class="list"><tbody> | |
1192 | <tr><th>http</th> | |
1193 | <td class="description">Connection to destination</td></tr> | |
1194 | <tr><th>dest</th> | |
1195 | <td class="description">Destination</td></tr> | |
1196 | <tr><th>dinfo</th> | |
1197 | <td class="description">Destination information</td></tr> | |
1198 | <tr><th>flags</th> | |
1199 | <td class="description">Media matching flags</td></tr> | |
1200 | <tr><th>size</th> | |
1201 | <td class="description">Media size</td></tr> | |
1202 | <tr><th>num_options</th> | |
1203 | <td class="description">Current number of options</td></tr> | |
1204 | <tr><th>options</th> | |
1205 | <td class="description">Options</td></tr> | |
1206 | </tbody></table> | |
1207 | <h4 class="returnvalue">Return Value</h4> | |
1208 | <p class="description">New number of options</p> | |
98d88c8d | 1209 | <h3 class="function"><span class="info"> CUPS 2.2.4/macOS 10.13 </span><a id="cupsAddIntegerOption">cupsAddIntegerOption</a></h3> |
53af7f21 | 1210 | <p class="description">Add an integer option to an option array.</p> |
798d6e29 | 1211 | <p class="code"> |
98d88c8d MS |
1212 | int cupsAddIntegerOption(const char *name, int value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p> |
1213 | <h4 class="parameters">Parameters</h4> | |
1214 | <table class="list"><tbody> | |
1215 | <tr><th>name</th> | |
1216 | <td class="description">Name of option</td></tr> | |
1217 | <tr><th>value</th> | |
1218 | <td class="description">Value of option</td></tr> | |
1219 | <tr><th>num_options</th> | |
1220 | <td class="description">Number of options</td></tr> | |
1221 | <tr><th>options</th> | |
1222 | <td class="description">Pointer to options</td></tr> | |
1223 | </tbody></table> | |
798d6e29 MS |
1224 | <h4 class="returnvalue">Return Value</h4> |
1225 | <p class="description">Number of options</p> | |
1226 | <h4 class="discussion">Discussion</h4> | |
1227 | <p class="discussion">New option arrays can be initialized simply by passing 0 for the | |
53af7f21 | 1228 | "num_options" parameter. |
798d6e29 MS |
1229 | |
1230 | </p> | |
53af7f21 MS |
1231 | <h3 class="function"><a id="cupsAddOption">cupsAddOption</a></h3> |
1232 | <p class="description">Add an option to an option array.</p> | |
798d6e29 | 1233 | <p class="code"> |
98d88c8d MS |
1234 | int cupsAddOption(const char *name, const char *value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p> |
1235 | <h4 class="parameters">Parameters</h4> | |
1236 | <table class="list"><tbody> | |
1237 | <tr><th>name</th> | |
1238 | <td class="description">Name of option</td></tr> | |
1239 | <tr><th>value</th> | |
1240 | <td class="description">Value of option</td></tr> | |
1241 | <tr><th>num_options</th> | |
1242 | <td class="description">Number of options</td></tr> | |
1243 | <tr><th>options</th> | |
1244 | <td class="description">Pointer to options</td></tr> | |
1245 | </tbody></table> | |
798d6e29 | 1246 | <h4 class="returnvalue">Return Value</h4> |
53af7f21 | 1247 | <p class="description">Number of options</p> |
798d6e29 | 1248 | <h4 class="discussion">Discussion</h4> |
53af7f21 MS |
1249 | <p class="discussion">New option arrays can be initialized simply by passing 0 for the |
1250 | "num_options" parameter.</p> | |
98d88c8d | 1251 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCancelDestJob">cupsCancelDestJob</a></h3> |
798d6e29 | 1252 | <p class="description">Cancel a job on a destination.</p> |
98d88c8d MS |
1253 | <p class="code"> |
1254 | ipp_status_t cupsCancelDestJob(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, int job_id);</p> | |
1255 | <h4 class="parameters">Parameters</h4> | |
1256 | <table class="list"><tbody> | |
1257 | <tr><th>http</th> | |
1258 | <td class="description">Connection to destination</td></tr> | |
1259 | <tr><th>dest</th> | |
1260 | <td class="description">Destination</td></tr> | |
1261 | <tr><th>job_id</th> | |
1262 | <td class="description">Job ID</td></tr> | |
1263 | </tbody></table> | |
1264 | <h4 class="returnvalue">Return Value</h4> | |
1265 | <p class="description">Status of cancel operation</p> | |
1266 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
1267 | <p class="discussion">The "job_id" is the number returned by cupsCreateDestJob.<br> |
1268 | <br> | |
1269 | Returns <code>IPP_STATUS_OK</code> on success and | |
98d88c8d | 1270 | <code>IPP_STATUS_ERROR_NOT_AUTHORIZED</code> or |
798d6e29 MS |
1271 | <code>IPP_STATUS_ERROR_FORBIDDEN</code> on failure. |
1272 | ||
798d6e29 MS |
1273 | </p> |
1274 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCheckDestSupported">cupsCheckDestSupported</a></h3> | |
1275 | <p class="description">Check that the option and value are supported | |
1276 | by the destination.</p> | |
1277 | <p class="code"> | |
98d88c8d MS |
1278 | int cupsCheckDestSupported(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option, const char *value);</p> |
1279 | <h4 class="parameters">Parameters</h4> | |
1280 | <table class="list"><tbody> | |
1281 | <tr><th>http</th> | |
1282 | <td class="description">Connection to destination</td></tr> | |
1283 | <tr><th>dest</th> | |
1284 | <td class="description">Destination</td></tr> | |
1285 | <tr><th>dinfo</th> | |
1286 | <td class="description">Destination information</td></tr> | |
1287 | <tr><th>option</th> | |
1288 | <td class="description">Option</td></tr> | |
1289 | <tr><th>value</th> | |
b0fb2d75 | 1290 | <td class="description">Value or <code>NULL</code></td></tr> |
98d88c8d | 1291 | </tbody></table> |
798d6e29 MS |
1292 | <h4 class="returnvalue">Return Value</h4> |
1293 | <p class="description">1 if supported, 0 otherwise</p> | |
1294 | <h4 class="discussion">Discussion</h4> | |
1295 | <p class="discussion">Returns 1 if supported, 0 otherwise. | |
1296 | ||
1297 | </p> | |
1298 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCloseDestJob">cupsCloseDestJob</a></h3> | |
1299 | <p class="description">Close a job and start printing.</p> | |
1300 | <p class="code"> | |
98d88c8d MS |
1301 | ipp_status_t cupsCloseDestJob(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info, int job_id);</p> |
1302 | <h4 class="parameters">Parameters</h4> | |
1303 | <table class="list"><tbody> | |
1304 | <tr><th>http</th> | |
1305 | <td class="description">Connection to destination</td></tr> | |
1306 | <tr><th>dest</th> | |
1307 | <td class="description">Destination</td></tr> | |
1308 | <tr><th>info</th> | |
1309 | <td class="description">Destination information</td></tr> | |
1310 | <tr><th>job_id</th> | |
1311 | <td class="description">Job ID</td></tr> | |
1312 | </tbody></table> | |
798d6e29 MS |
1313 | <h4 class="returnvalue">Return Value</h4> |
1314 | <p class="description">IPP status code</p> | |
1315 | <h4 class="discussion">Discussion</h4> | |
1316 | <p class="discussion">Use when the last call to cupsStartDocument passed 0 for "last_document". | |
1317 | "job_id" is the job ID returned by cupsCreateDestJob. Returns <code>IPP_STATUS_OK</code> | |
1318 | on success. | |
1319 | ||
1320 | </p> | |
1321 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsConnectDest">cupsConnectDest</a></h3> | |
699fe020 | 1322 | <p class="description">Open a connection to the destination.</p> |
98d88c8d MS |
1323 | <p class="code"> |
1324 | <a href="#http_t">http_t</a> *cupsConnectDest(<a href="#cups_dest_t">cups_dest_t</a> *dest, unsigned flags, int msec, int *cancel, char *resource, size_t resourcesize, <a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb, void *user_data);</p> | |
1325 | <h4 class="parameters">Parameters</h4> | |
1326 | <table class="list"><tbody> | |
1327 | <tr><th>dest</th> | |
1328 | <td class="description">Destination</td></tr> | |
1329 | <tr><th>flags</th> | |
1330 | <td class="description">Connection flags</td></tr> | |
1331 | <tr><th>msec</th> | |
1332 | <td class="description">Timeout in milliseconds</td></tr> | |
1333 | <tr><th>cancel</th> | |
1334 | <td class="description">Pointer to "cancel" variable</td></tr> | |
1335 | <tr><th>resource</th> | |
1336 | <td class="description">Resource buffer</td></tr> | |
1337 | <tr><th>resourcesize</th> | |
1338 | <td class="description">Size of resource buffer</td></tr> | |
1339 | <tr><th>cb</th> | |
1340 | <td class="description">Callback function</td></tr> | |
1341 | <tr><th>user_data</th> | |
1342 | <td class="description">User data pointer</td></tr> | |
1343 | </tbody></table> | |
1344 | <h4 class="returnvalue">Return Value</h4> | |
1345 | <p class="description">Connection to destination or <code>NULL</code></p> | |
1346 | <h4 class="discussion">Discussion</h4> | |
1347 | <p class="discussion">Connect to the destination, returning a new <code>http_t</code> connection object | |
1348 | and optionally the resource path to use for the destination. These calls | |
1349 | will block until a connection is made, the timeout expires, the integer | |
1350 | pointed to by "cancel" is non-zero, or the callback function (or block) | |
1351 | returns 0. The caller is responsible for calling <a href="#httpClose"><code>httpClose</code></a> on the | |
b0fb2d75 MS |
1352 | returned connection.<br> |
1353 | <br> | |
699fe020 | 1354 | Starting with CUPS 2.2.4, the caller can pass <code>CUPS_DEST_FLAGS_DEVICE</code> |
b0fb2d75 MS |
1355 | for the "flags" argument to connect directly to the device associated with |
1356 | the destination. Otherwise, the connection is made to the CUPS scheduler | |
1357 | associated with the destination. | |
798d6e29 MS |
1358 | |
1359 | </p> | |
53af7f21 MS |
1360 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCopyDest">cupsCopyDest</a></h3> |
1361 | <p class="description">Copy a destination.</p> | |
798d6e29 | 1362 | <p class="code"> |
98d88c8d MS |
1363 | int cupsCopyDest(<a href="#cups_dest_t">cups_dest_t</a> *dest, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p> |
1364 | <h4 class="parameters">Parameters</h4> | |
1365 | <table class="list"><tbody> | |
1366 | <tr><th>dest</th> | |
1367 | <td class="description">Destination to copy</td></tr> | |
1368 | <tr><th>num_dests</th> | |
1369 | <td class="description">Number of destinations</td></tr> | |
1370 | <tr><th>dests</th> | |
1371 | <td class="description">Destination array</td></tr> | |
1372 | </tbody></table> | |
798d6e29 MS |
1373 | <h4 class="returnvalue">Return Value</h4> |
1374 | <p class="description">New number of destinations</p> | |
1375 | <h4 class="discussion">Discussion</h4> | |
1376 | <p class="discussion">Make a copy of the destination to an array of destinations (or just a single | |
1377 | copy) - for use with the cupsEnumDests* functions. The caller is responsible | |
1378 | for calling cupsFreeDests() on the returned object(s). | |
1379 | ||
1380 | </p> | |
1381 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCopyDestConflicts">cupsCopyDestConflicts</a></h3> | |
1382 | <p class="description">Get conflicts and resolutions for a new | |
1383 | option/value pair.</p> | |
1384 | <p class="code"> | |
98d88c8d MS |
1385 | int cupsCopyDestConflicts(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, int num_options, <a href="#cups_option_t">cups_option_t</a> *options, const char *new_option, const char *new_value, int *num_conflicts, <a href="#cups_option_t">cups_option_t</a> **conflicts, int *num_resolved, <a href="#cups_option_t">cups_option_t</a> **resolved);</p> |
1386 | <h4 class="parameters">Parameters</h4> | |
1387 | <table class="list"><tbody> | |
1388 | <tr><th>http</th> | |
1389 | <td class="description">Connection to destination</td></tr> | |
1390 | <tr><th>dest</th> | |
1391 | <td class="description">Destination</td></tr> | |
1392 | <tr><th>dinfo</th> | |
1393 | <td class="description">Destination information</td></tr> | |
1394 | <tr><th>num_options</th> | |
1395 | <td class="description">Number of current options</td></tr> | |
1396 | <tr><th>options</th> | |
1397 | <td class="description">Current options</td></tr> | |
1398 | <tr><th>new_option</th> | |
1399 | <td class="description">New option</td></tr> | |
1400 | <tr><th>new_value</th> | |
1401 | <td class="description">New value</td></tr> | |
1402 | <tr><th>num_conflicts</th> | |
1403 | <td class="description">Number of conflicting options</td></tr> | |
1404 | <tr><th>conflicts</th> | |
1405 | <td class="description">Conflicting options</td></tr> | |
1406 | <tr><th>num_resolved</th> | |
1407 | <td class="description">Number of options to resolve</td></tr> | |
1408 | <tr><th>resolved</th> | |
1409 | <td class="description">Resolved options</td></tr> | |
1410 | </tbody></table> | |
798d6e29 MS |
1411 | <h4 class="returnvalue">Return Value</h4> |
1412 | <p class="description">1 if there is a conflict, 0 if none, -1 on error</p> | |
1413 | <h4 class="discussion">Discussion</h4> | |
1414 | <p class="discussion">"num_options" and "options" represent the currently selected options by the | |
1415 | user. "new_option" and "new_value" are the setting the user has just | |
1416 | changed.<br> | |
1417 | <br> | |
1418 | Returns 1 if there is a conflict, 0 if there are no conflicts, and -1 if | |
1419 | there was an unrecoverable error such as a resolver loop.<br> | |
1420 | <br> | |
1421 | If "num_conflicts" and "conflicts" are not <code>NULL</code>, they are set to | |
1422 | contain the list of conflicting option/value pairs. Similarly, if | |
1423 | "num_resolved" and "resolved" are not <code>NULL</code> they will be set to the | |
1424 | list of changes needed to resolve the conflict.<br> | |
1425 | <br> | |
1426 | If cupsCopyDestConflicts returns 1 but "num_resolved" and "resolved" are set | |
1427 | to 0 and <code>NULL</code>, respectively, then the conflict cannot be resolved. | |
1428 | ||
1429 | </p> | |
1430 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCopyDestInfo">cupsCopyDestInfo</a></h3> | |
1431 | <p class="description">Get the supported values/capabilities for the | |
1432 | destination.</p> | |
1433 | <p class="code"> | |
98d88c8d | 1434 | <a href="#cups_dinfo_t">cups_dinfo_t</a> *cupsCopyDestInfo(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest);</p> |
798d6e29 | 1435 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
1436 | <table class="list"><tbody> |
1437 | <tr><th>http</th> | |
1438 | <td class="description">Connection to destination</td></tr> | |
1439 | <tr><th>dest</th> | |
1440 | <td class="description">Destination</td></tr> | |
1441 | </tbody></table> | |
798d6e29 MS |
1442 | <h4 class="returnvalue">Return Value</h4> |
1443 | <p class="description">Destination information</p> | |
1444 | <h4 class="discussion">Discussion</h4> | |
1445 | <p class="discussion">The caller is responsible for calling <a href="#cupsFreeDestInfo"><code>cupsFreeDestInfo</code></a> on the return | |
1446 | value. <code>NULL</code> is returned on error. | |
1447 | ||
1448 | </p> | |
1449 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCreateDestJob">cupsCreateDestJob</a></h3> | |
1450 | <p class="description">Create a job on a destination.</p> | |
1451 | <p class="code"> | |
98d88c8d MS |
1452 | ipp_status_t cupsCreateDestJob(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info, int *job_id, const char *title, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p> |
1453 | <h4 class="parameters">Parameters</h4> | |
1454 | <table class="list"><tbody> | |
1455 | <tr><th>http</th> | |
1456 | <td class="description">Connection to destination</td></tr> | |
1457 | <tr><th>dest</th> | |
1458 | <td class="description">Destination</td></tr> | |
1459 | <tr><th>info</th> | |
1460 | <td class="description">Destination information</td></tr> | |
1461 | <tr><th>job_id</th> | |
1462 | <td class="description">Job ID or 0 on error</td></tr> | |
1463 | <tr><th>title</th> | |
1464 | <td class="description">Job name</td></tr> | |
1465 | <tr><th>num_options</th> | |
1466 | <td class="description">Number of job options</td></tr> | |
1467 | <tr><th>options</th> | |
1468 | <td class="description">Job options</td></tr> | |
1469 | </tbody></table> | |
798d6e29 MS |
1470 | <h4 class="returnvalue">Return Value</h4> |
1471 | <p class="description">IPP status code</p> | |
1472 | <h4 class="discussion">Discussion</h4> | |
1473 | <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success, saving the job ID | |
1474 | in the variable pointed to by "job_id". | |
1475 | ||
1476 | </p> | |
798d6e29 MS |
1477 | <h3 class="function"><span class="info"> CUPS 1.1.20/macOS 10.4 </span><a id="cupsDoAuthentication">cupsDoAuthentication</a></h3> |
1478 | <p class="description">Authenticate a request.</p> | |
1479 | <p class="code"> | |
98d88c8d MS |
1480 | int cupsDoAuthentication(<a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p> |
1481 | <h4 class="parameters">Parameters</h4> | |
1482 | <table class="list"><tbody> | |
1483 | <tr><th>http</th> | |
1484 | <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> | |
1485 | <tr><th>method</th> | |
1486 | <td class="description">Request method ("GET", "POST", "PUT")</td></tr> | |
1487 | <tr><th>resource</th> | |
1488 | <td class="description">Resource path</td></tr> | |
1489 | </tbody></table> | |
798d6e29 MS |
1490 | <h4 class="returnvalue">Return Value</h4> |
1491 | <p class="description">0 on success, -1 on error</p> | |
1492 | <h4 class="discussion">Discussion</h4> | |
1493 | <p class="discussion">This function should be called in response to a <code>HTTP_STATUS_UNAUTHORIZED</code> | |
1494 | status, prior to resubmitting your request. | |
1495 | ||
1496 | </p> | |
c669a17e | 1497 | <h3 class="function"><span class="info"> CUPS 2.3/macOS 10.14 </span><a id="cupsEncodeOption">cupsEncodeOption</a></h3> |
ddf2ec73 MS |
1498 | <p class="description">Encode a single option into an IPP attribute.</p> |
1499 | <p class="code"> | |
1500 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsEncodeOption(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group_tag, const char *name, const char *value);</p> | |
1501 | <h4 class="parameters">Parameters</h4> | |
1502 | <table class="list"><tbody> | |
1503 | <tr><th>ipp</th> | |
1504 | <td class="description">IPP request/response</td></tr> | |
1505 | <tr><th>group_tag</th> | |
1506 | <td class="description">Attribute group</td></tr> | |
1507 | <tr><th>name</th> | |
1508 | <td class="description">Option name</td></tr> | |
1509 | <tr><th>value</th> | |
1510 | <td class="description">Option string value</td></tr> | |
1511 | </tbody></table> | |
1512 | <h4 class="returnvalue">Return Value</h4> | |
1513 | <p class="description">New attribute or <code>NULL</code> on error</p> | |
798d6e29 | 1514 | <h3 class="function"><a id="cupsEncodeOptions">cupsEncodeOptions</a></h3> |
53af7f21 | 1515 | <p class="description">Encode printer options into IPP attributes.</p> |
98d88c8d MS |
1516 | <p class="code"> |
1517 | void cupsEncodeOptions(<a href="#ipp_t">ipp_t</a> *ipp, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p> | |
1518 | <h4 class="parameters">Parameters</h4> | |
1519 | <table class="list"><tbody> | |
1520 | <tr><th>ipp</th> | |
ddf2ec73 | 1521 | <td class="description">IPP request/response</td></tr> |
98d88c8d MS |
1522 | <tr><th>num_options</th> |
1523 | <td class="description">Number of options</td></tr> | |
1524 | <tr><th>options</th> | |
1525 | <td class="description">Options</td></tr> | |
1526 | </tbody></table> | |
1527 | <h4 class="discussion">Discussion</h4> | |
798d6e29 | 1528 | <p class="discussion">This function adds operation, job, and then subscription attributes, |
98d88c8d MS |
1529 | in that order. Use the <a href="#cupsEncodeOptions2"><code>cupsEncodeOptions2</code></a> function to add attributes |
1530 | for a single group.</p> | |
1531 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsEncodeOptions2">cupsEncodeOptions2</a></h3> | |
53af7f21 | 1532 | <p class="description">Encode printer options into IPP attributes for a group.</p> |
98d88c8d MS |
1533 | <p class="code"> |
1534 | void cupsEncodeOptions2(<a href="#ipp_t">ipp_t</a> *ipp, int num_options, <a href="#cups_option_t">cups_option_t</a> *options, ipp_tag_t group_tag);</p> | |
1535 | <h4 class="parameters">Parameters</h4> | |
1536 | <table class="list"><tbody> | |
1537 | <tr><th>ipp</th> | |
ddf2ec73 | 1538 | <td class="description">IPP request/response</td></tr> |
98d88c8d MS |
1539 | <tr><th>num_options</th> |
1540 | <td class="description">Number of options</td></tr> | |
1541 | <tr><th>options</th> | |
1542 | <td class="description">Options</td></tr> | |
1543 | <tr><th>group_tag</th> | |
1544 | <td class="description">Group to encode</td></tr> | |
1545 | </tbody></table> | |
1546 | <h4 class="discussion">Discussion</h4> | |
798d6e29 | 1547 | <p class="discussion">This function only adds attributes for a single group. Call this |
98d88c8d | 1548 | function multiple times for each group, or use <a href="#cupsEncodeOptions"><code>cupsEncodeOptions</code></a> |
798d6e29 MS |
1549 | to add the standard groups. |
1550 | ||
1551 | </p> | |
1552 | <h3 class="function"><a id="cupsEncryption">cupsEncryption</a></h3> | |
1553 | <p class="description">Get the current encryption settings.</p> | |
1554 | <p class="code"> | |
98d88c8d | 1555 | <a href="#http_encryption_t">http_encryption_t</a> cupsEncryption(void);</p> |
798d6e29 MS |
1556 | <h4 class="returnvalue">Return Value</h4> |
1557 | <p class="description">Encryption settings</p> | |
1558 | <h4 class="discussion">Discussion</h4> | |
1559 | <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION | |
1560 | environment variable, then the ~/.cups/client.conf file, and finally the | |
1561 | /etc/cups/client.conf file. If not set, the default is | |
1562 | <code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br> | |
1563 | <br> | |
1564 | Note: The current encryption setting is tracked separately for each thread | |
1565 | in a program. Multi-threaded programs that override the setting via the | |
1566 | <a href="#cupsSetEncryption"><code>cupsSetEncryption</code></a> function need to do so in each thread for the same | |
1567 | setting to be used.</p> | |
1568 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsEnumDests">cupsEnumDests</a></h3> | |
1569 | <p class="description">Enumerate available destinations with a callback function.</p> | |
1570 | <p class="code"> | |
98d88c8d MS |
1571 | int cupsEnumDests(unsigned flags, int msec, int *cancel, <a href="#cups_ptype_t">cups_ptype_t</a> type, <a href="#cups_ptype_t">cups_ptype_t</a> mask, <a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb, void *user_data);</p> |
1572 | <h4 class="parameters">Parameters</h4> | |
1573 | <table class="list"><tbody> | |
1574 | <tr><th>flags</th> | |
1575 | <td class="description">Enumeration flags</td></tr> | |
1576 | <tr><th>msec</th> | |
1577 | <td class="description">Timeout in milliseconds, -1 for indefinite</td></tr> | |
1578 | <tr><th>cancel</th> | |
1579 | <td class="description">Pointer to "cancel" variable</td></tr> | |
1580 | <tr><th>type</th> | |
1581 | <td class="description">Printer type bits</td></tr> | |
1582 | <tr><th>mask</th> | |
1583 | <td class="description">Mask for printer type bits</td></tr> | |
1584 | <tr><th>cb</th> | |
1585 | <td class="description">Callback function</td></tr> | |
1586 | <tr><th>user_data</th> | |
1587 | <td class="description">User data</td></tr> | |
1588 | </tbody></table> | |
798d6e29 MS |
1589 | <h4 class="returnvalue">Return Value</h4> |
1590 | <p class="description">1 on success, 0 on failure</p> | |
1591 | <h4 class="discussion">Discussion</h4> | |
53af7f21 MS |
1592 | <p class="discussion">Destinations are enumerated from one or more sources. The callback function |
1593 | receives the <code>user_data</code> pointer and the destination pointer which can | |
1594 | be used as input to the <a href="#cupsCopyDest"><code>cupsCopyDest</code></a> function. The function must | |
1595 | return 1 to continue enumeration or 0 to stop.<br> | |
798d6e29 | 1596 | <br> |
53af7f21 MS |
1597 | The <code>type</code> and <code>mask</code> arguments allow the caller to filter the |
1598 | destinations that are enumerated. Passing 0 for both will enumerate all | |
1599 | printers. The constant <code>CUPS_PRINTER_DISCOVERED</code> is used to filter on | |
1600 | destinations that are available but have not yet been added locally.<br> | |
798d6e29 MS |
1601 | <br> |
1602 | Enumeration happens on the current thread and does not return until all | |
718ee2ff MS |
1603 | destinations have been enumerated or the callback function returns 0.<br> |
1604 | <br> | |
1605 | Note: The callback function will likely receive multiple updates for the same | |
1606 | destinations - it is up to the caller to suppress any duplicate destinations. | |
798d6e29 MS |
1607 | |
1608 | </p> | |
798d6e29 MS |
1609 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsFindDestDefault">cupsFindDestDefault</a></h3> |
1610 | <p class="description">Find the default value(s) for the given option.</p> | |
1611 | <p class="code"> | |
98d88c8d MS |
1612 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestDefault(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option);</p> |
1613 | <h4 class="parameters">Parameters</h4> | |
1614 | <table class="list"><tbody> | |
1615 | <tr><th>http</th> | |
1616 | <td class="description">Connection to destination</td></tr> | |
1617 | <tr><th>dest</th> | |
1618 | <td class="description">Destination</td></tr> | |
1619 | <tr><th>dinfo</th> | |
1620 | <td class="description">Destination information</td></tr> | |
1621 | <tr><th>option</th> | |
1622 | <td class="description">Option/attribute name</td></tr> | |
1623 | </tbody></table> | |
798d6e29 MS |
1624 | <h4 class="returnvalue">Return Value</h4> |
1625 | <p class="description">Default attribute or <code>NULL</code> for none</p> | |
1626 | <h4 class="discussion">Discussion</h4> | |
1627 | <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>, | |
1628 | <code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>, | |
1629 | <code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>, | |
1630 | <code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code> | |
1631 | functions to inspect the default value(s) as needed. | |
1632 | ||
1633 | </p> | |
1634 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsFindDestReady">cupsFindDestReady</a></h3> | |
1635 | <p class="description">Find the default value(s) for the given option.</p> | |
1636 | <p class="code"> | |
98d88c8d MS |
1637 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestReady(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option);</p> |
1638 | <h4 class="parameters">Parameters</h4> | |
1639 | <table class="list"><tbody> | |
1640 | <tr><th>http</th> | |
1641 | <td class="description">Connection to destination</td></tr> | |
1642 | <tr><th>dest</th> | |
1643 | <td class="description">Destination</td></tr> | |
1644 | <tr><th>dinfo</th> | |
1645 | <td class="description">Destination information</td></tr> | |
1646 | <tr><th>option</th> | |
1647 | <td class="description">Option/attribute name</td></tr> | |
1648 | </tbody></table> | |
798d6e29 MS |
1649 | <h4 class="returnvalue">Return Value</h4> |
1650 | <p class="description">Default attribute or <code>NULL</code> for none</p> | |
1651 | <h4 class="discussion">Discussion</h4> | |
1652 | <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>, | |
1653 | <code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>, | |
1654 | <code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>, | |
1655 | <code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code> | |
1656 | functions to inspect the default value(s) as needed. | |
1657 | ||
1658 | </p> | |
1659 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsFindDestSupported">cupsFindDestSupported</a></h3> | |
1660 | <p class="description">Find the default value(s) for the given option.</p> | |
1661 | <p class="code"> | |
98d88c8d MS |
1662 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestSupported(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option);</p> |
1663 | <h4 class="parameters">Parameters</h4> | |
1664 | <table class="list"><tbody> | |
1665 | <tr><th>http</th> | |
1666 | <td class="description">Connection to destination</td></tr> | |
1667 | <tr><th>dest</th> | |
1668 | <td class="description">Destination</td></tr> | |
1669 | <tr><th>dinfo</th> | |
1670 | <td class="description">Destination information</td></tr> | |
1671 | <tr><th>option</th> | |
1672 | <td class="description">Option/attribute name</td></tr> | |
1673 | </tbody></table> | |
798d6e29 MS |
1674 | <h4 class="returnvalue">Return Value</h4> |
1675 | <p class="description">Default attribute or <code>NULL</code> for none</p> | |
1676 | <h4 class="discussion">Discussion</h4> | |
1677 | <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>, | |
1678 | <code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>, | |
1679 | <code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>, | |
1680 | <code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code> | |
1681 | functions to inspect the default value(s) as needed. | |
1682 | ||
1683 | </p> | |
1684 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsFinishDestDocument">cupsFinishDestDocument</a></h3> | |
1685 | <p class="description">Finish the current document.</p> | |
1686 | <p class="code"> | |
98d88c8d MS |
1687 | ipp_status_t cupsFinishDestDocument(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info);</p> |
1688 | <h4 class="parameters">Parameters</h4> | |
1689 | <table class="list"><tbody> | |
1690 | <tr><th>http</th> | |
1691 | <td class="description">Connection to destination</td></tr> | |
1692 | <tr><th>dest</th> | |
1693 | <td class="description">Destination</td></tr> | |
1694 | <tr><th>info</th> | |
1695 | <td class="description">Destination information</td></tr> | |
1696 | </tbody></table> | |
798d6e29 MS |
1697 | <h4 class="returnvalue">Return Value</h4> |
1698 | <p class="description">Status of document submission</p> | |
1699 | <h4 class="discussion">Discussion</h4> | |
1700 | <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success. | |
1701 | ||
798d6e29 | 1702 | </p> |
98d88c8d | 1703 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsFreeDestInfo">cupsFreeDestInfo</a></h3> |
53af7f21 MS |
1704 | <p class="description">Free destination information obtained using |
1705 | <a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a>.</p> | |
798d6e29 | 1706 | <p class="code"> |
98d88c8d | 1707 | void cupsFreeDestInfo(<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo);</p> |
798d6e29 | 1708 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
1709 | <table class="list"><tbody> |
1710 | <tr><th>dinfo</th> | |
1711 | <td class="description">Destination information</td></tr> | |
1712 | </tbody></table> | |
1713 | <h3 class="function"><a id="cupsFreeDests">cupsFreeDests</a></h3> | |
53af7f21 | 1714 | <p class="description">Free the memory used by the list of destinations.</p> |
798d6e29 | 1715 | <p class="code"> |
98d88c8d | 1716 | void cupsFreeDests(int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p> |
798d6e29 | 1717 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
1718 | <table class="list"><tbody> |
1719 | <tr><th>num_dests</th> | |
1720 | <td class="description">Number of destinations</td></tr> | |
1721 | <tr><th>dests</th> | |
1722 | <td class="description">Destinations</td></tr> | |
1723 | </tbody></table> | |
1724 | <h3 class="function"><a id="cupsFreeJobs">cupsFreeJobs</a></h3> | |
53af7f21 | 1725 | <p class="description">Free memory used by job data.</p> |
798d6e29 | 1726 | <p class="code"> |
98d88c8d | 1727 | void cupsFreeJobs(int num_jobs, <a href="#cups_job_t">cups_job_t</a> *jobs);</p> |
798d6e29 | 1728 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
1729 | <table class="list"><tbody> |
1730 | <tr><th>num_jobs</th> | |
1731 | <td class="description">Number of jobs</td></tr> | |
1732 | <tr><th>jobs</th> | |
1733 | <td class="description">Jobs</td></tr> | |
1734 | </tbody></table> | |
1735 | <h3 class="function"><a id="cupsFreeOptions">cupsFreeOptions</a></h3> | |
53af7f21 | 1736 | <p class="description">Free all memory used by options.</p> |
98d88c8d MS |
1737 | <p class="code"> |
1738 | void cupsFreeOptions(int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p> | |
1739 | <h4 class="parameters">Parameters</h4> | |
1740 | <table class="list"><tbody> | |
1741 | <tr><th>num_options</th> | |
1742 | <td class="description">Number of options</td></tr> | |
1743 | <tr><th>options</th> | |
1744 | <td class="description">Pointer to options</td></tr> | |
1745 | </tbody></table> | |
798d6e29 MS |
1746 | <h3 class="function"><a id="cupsGetDest">cupsGetDest</a></h3> |
1747 | <p class="description">Get the named destination from the list.</p> | |
1748 | <p class="code"> | |
98d88c8d MS |
1749 | <a href="#cups_dest_t">cups_dest_t</a> *cupsGetDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p> |
1750 | <h4 class="parameters">Parameters</h4> | |
1751 | <table class="list"><tbody> | |
1752 | <tr><th>name</th> | |
1753 | <td class="description">Destination name or <code>NULL</code> for the default destination</td></tr> | |
1754 | <tr><th>instance</th> | |
1755 | <td class="description">Instance name or <code>NULL</code></td></tr> | |
1756 | <tr><th>num_dests</th> | |
1757 | <td class="description">Number of destinations</td></tr> | |
1758 | <tr><th>dests</th> | |
1759 | <td class="description">Destinations</td></tr> | |
1760 | </tbody></table> | |
798d6e29 MS |
1761 | <h4 class="returnvalue">Return Value</h4> |
1762 | <p class="description">Destination pointer or <code>NULL</code></p> | |
1763 | <h4 class="discussion">Discussion</h4> | |
98d88c8d | 1764 | <p class="discussion">Use the <a href="#cupsEnumDests"><code>cupsEnumDests</code></a> or <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> functions to get a |
798d6e29 MS |
1765 | list of supported destinations for the current user.</p> |
1766 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></h3> | |
1767 | <p class="description">Get a media name, dimension, and margins for a | |
1768 | specific size.</p> | |
1769 | <p class="code"> | |
98d88c8d MS |
1770 | int cupsGetDestMediaByIndex(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, int n, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p> |
1771 | <h4 class="parameters">Parameters</h4> | |
1772 | <table class="list"><tbody> | |
1773 | <tr><th>http</th> | |
1774 | <td class="description">Connection to destination</td></tr> | |
1775 | <tr><th>dest</th> | |
1776 | <td class="description">Destination</td></tr> | |
1777 | <tr><th>dinfo</th> | |
1778 | <td class="description">Destination information</td></tr> | |
1779 | <tr><th>n</th> | |
1780 | <td class="description">Media size number (0-based)</td></tr> | |
1781 | <tr><th>flags</th> | |
1782 | <td class="description">Media flags</td></tr> | |
1783 | <tr><th>size</th> | |
1784 | <td class="description">Media size information</td></tr> | |
1785 | </tbody></table> | |
798d6e29 MS |
1786 | <h4 class="returnvalue">Return Value</h4> |
1787 | <p class="description">1 on success, 0 on failure</p> | |
1788 | <h4 class="discussion">Discussion</h4> | |
1789 | <p class="discussion">The <code>flags</code> parameter determines which set of media are indexed. For | |
1790 | example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will get the Nth | |
1791 | borderless size supported by the printer. | |
1792 | ||
1793 | </p> | |
1794 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsGetDestMediaByName">cupsGetDestMediaByName</a></h3> | |
1795 | <p class="description">Get media names, dimensions, and margins.</p> | |
1796 | <p class="code"> | |
98d88c8d MS |
1797 | int cupsGetDestMediaByName(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *media, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p> |
1798 | <h4 class="parameters">Parameters</h4> | |
1799 | <table class="list"><tbody> | |
1800 | <tr><th>http</th> | |
1801 | <td class="description">Connection to destination</td></tr> | |
1802 | <tr><th>dest</th> | |
1803 | <td class="description">Destination</td></tr> | |
1804 | <tr><th>dinfo</th> | |
1805 | <td class="description">Destination information</td></tr> | |
1806 | <tr><th>media</th> | |
1807 | <td class="description">Media name</td></tr> | |
1808 | <tr><th>flags</th> | |
1809 | <td class="description">Media matching flags</td></tr> | |
1810 | <tr><th>size</th> | |
1811 | <td class="description">Media size information</td></tr> | |
1812 | </tbody></table> | |
798d6e29 MS |
1813 | <h4 class="returnvalue">Return Value</h4> |
1814 | <p class="description">1 on match, 0 on failure</p> | |
1815 | <h4 class="discussion">Discussion</h4> | |
1816 | <p class="discussion">The "media" string is a PWG media name. "Flags" provides some matching | |
1817 | guidance (multiple flags can be combined):<br> | |
1818 | <br> | |
1819 | CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer, | |
1820 | CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size, | |
1821 | CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing, | |
1822 | CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and | |
1823 | CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the | |
1824 | size amongst the "ready" media.<br> | |
1825 | <br> | |
1826 | The matching result (if any) is returned in the "cups_size_t" structure.<br> | |
1827 | <br> | |
1828 | Returns 1 when there is a match and 0 if there is not a match. | |
1829 | ||
1830 | </p> | |
1831 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></h3> | |
1832 | <p class="description">Get media names, dimensions, and margins.</p> | |
1833 | <p class="code"> | |
98d88c8d MS |
1834 | int cupsGetDestMediaBySize(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, int width, int length, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p> |
1835 | <h4 class="parameters">Parameters</h4> | |
1836 | <table class="list"><tbody> | |
1837 | <tr><th>http</th> | |
1838 | <td class="description">Connection to destination</td></tr> | |
1839 | <tr><th>dest</th> | |
1840 | <td class="description">Destination</td></tr> | |
1841 | <tr><th>dinfo</th> | |
1842 | <td class="description">Destination information</td></tr> | |
1843 | <tr><th>width</th> | |
1844 | <td class="description">Media width in hundredths of | |
1845 | of millimeters</td></tr> | |
1846 | <tr><th>length</th> | |
1847 | <td class="description">Media length in hundredths of | |
1848 | of millimeters</td></tr> | |
1849 | <tr><th>flags</th> | |
1850 | <td class="description">Media matching flags</td></tr> | |
1851 | <tr><th>size</th> | |
1852 | <td class="description">Media size information</td></tr> | |
1853 | </tbody></table> | |
798d6e29 MS |
1854 | <h4 class="returnvalue">Return Value</h4> |
1855 | <p class="description">1 on match, 0 on failure</p> | |
1856 | <h4 class="discussion">Discussion</h4> | |
1857 | <p class="discussion">"Width" and "length" are the dimensions in hundredths of millimeters. | |
1858 | "Flags" provides some matching guidance (multiple flags can be combined):<br> | |
1859 | <br> | |
1860 | CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer, | |
1861 | CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size, | |
1862 | CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing, | |
1863 | CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and | |
1864 | CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the | |
1865 | size amongst the "ready" media.<br> | |
1866 | <br> | |
1867 | The matching result (if any) is returned in the "cups_size_t" structure.<br> | |
1868 | <br> | |
1869 | Returns 1 when there is a match and 0 if there is not a match. | |
1870 | ||
1871 | </p> | |
1872 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsGetDestMediaCount">cupsGetDestMediaCount</a></h3> | |
1873 | <p class="description">Get the number of sizes supported by a | |
1874 | destination.</p> | |
1875 | <p class="code"> | |
98d88c8d MS |
1876 | int cupsGetDestMediaCount(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags);</p> |
1877 | <h4 class="parameters">Parameters</h4> | |
1878 | <table class="list"><tbody> | |
1879 | <tr><th>http</th> | |
1880 | <td class="description">Connection to destination</td></tr> | |
1881 | <tr><th>dest</th> | |
1882 | <td class="description">Destination</td></tr> | |
1883 | <tr><th>dinfo</th> | |
1884 | <td class="description">Destination information</td></tr> | |
1885 | <tr><th>flags</th> | |
1886 | <td class="description">Media flags</td></tr> | |
1887 | </tbody></table> | |
798d6e29 MS |
1888 | <h4 class="returnvalue">Return Value</h4> |
1889 | <p class="description">Number of sizes</p> | |
1890 | <h4 class="discussion">Discussion</h4> | |
1891 | <p class="discussion">The <code>flags</code> parameter determines the set of media sizes that are | |
1892 | counted. For example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return | |
1893 | the number of borderless sizes. | |
1894 | ||
1895 | </p> | |
1896 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></h3> | |
1897 | <p class="description">Get the default size for a destination.</p> | |
1898 | <p class="code"> | |
98d88c8d MS |
1899 | int cupsGetDestMediaDefault(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p> |
1900 | <h4 class="parameters">Parameters</h4> | |
1901 | <table class="list"><tbody> | |
1902 | <tr><th>http</th> | |
1903 | <td class="description">Connection to destination</td></tr> | |
1904 | <tr><th>dest</th> | |
1905 | <td class="description">Destination</td></tr> | |
1906 | <tr><th>dinfo</th> | |
1907 | <td class="description">Destination information</td></tr> | |
1908 | <tr><th>flags</th> | |
1909 | <td class="description">Media flags</td></tr> | |
1910 | <tr><th>size</th> | |
1911 | <td class="description">Media size information</td></tr> | |
1912 | </tbody></table> | |
798d6e29 MS |
1913 | <h4 class="returnvalue">Return Value</h4> |
1914 | <p class="description">1 on success, 0 on failure</p> | |
1915 | <h4 class="discussion">Discussion</h4> | |
1916 | <p class="discussion">The <code>flags</code> parameter determines which default size is returned. For | |
1917 | example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the default | |
1918 | borderless size, typically US Letter or A4, but sometimes 4x6 photo media. | |
1919 | ||
1920 | </p> | |
1921 | <h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="cupsGetDestWithURI">cupsGetDestWithURI</a></h3> | |
1922 | <p class="description">Get a destination associated with a URI.</p> | |
1923 | <p class="code"> | |
98d88c8d | 1924 | <a href="#cups_dest_t">cups_dest_t</a> *cupsGetDestWithURI(const char *name, const char *uri);</p> |
798d6e29 | 1925 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
1926 | <table class="list"><tbody> |
1927 | <tr><th>name</th> | |
1928 | <td class="description">Desired printer name or <code>NULL</code></td></tr> | |
1929 | <tr><th>uri</th> | |
1930 | <td class="description">URI for the printer</td></tr> | |
1931 | </tbody></table> | |
798d6e29 MS |
1932 | <h4 class="returnvalue">Return Value</h4> |
1933 | <p class="description">Destination or <code>NULL</code></p> | |
1934 | <h4 class="discussion">Discussion</h4> | |
1935 | <p class="discussion">"name" is the desired name for the printer. If <code>NULL</code>, a name will be | |
1936 | created using the URI.<br> | |
1937 | <br> | |
1938 | "uri" is the "ipp" or "ipps" URI for the printer. | |
1939 | ||
1940 | </p> | |
98d88c8d MS |
1941 | <h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsGetDests2">cupsGetDests2</a></h3> |
1942 | <p class="description">Get the list of destinations from the specified server.</p> | |
1943 | <p class="code"> | |
1944 | int cupsGetDests2(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p> | |
1945 | <h4 class="parameters">Parameters</h4> | |
1946 | <table class="list"><tbody> | |
1947 | <tr><th>http</th> | |
1948 | <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> | |
1949 | <tr><th>dests</th> | |
1950 | <td class="description">Destinations</td></tr> | |
1951 | </tbody></table> | |
1952 | <h4 class="returnvalue">Return Value</h4> | |
1953 | <p class="description">Number of destinations</p> | |
1954 | <h4 class="discussion">Discussion</h4> | |
1955 | <p class="discussion">Starting with CUPS 1.2, the returned list of destinations include the | |
1956 | "printer-info", "printer-is-accepting-jobs", "printer-is-shared", | |
1957 | "printer-make-and-model", "printer-state", "printer-state-change-time", | |
1958 | "printer-state-reasons", "printer-type", and "printer-uri-supported" | |
1959 | attributes as options.<br> | |
1960 | <br> | |
1961 | CUPS 1.4 adds the "marker-change-time", "marker-colors", | |
1962 | "marker-high-levels", "marker-levels", "marker-low-levels", "marker-message", | |
1963 | "marker-names", "marker-types", and "printer-commands" attributes as options.<br> | |
1964 | <br> | |
1965 | CUPS 2.2 adds accessible IPP printers to the list of destinations that can | |
1966 | be used. The "printer-uri-supported" option will be present for those IPP | |
1967 | printers that have been recently used.<br> | |
1968 | <br> | |
1969 | Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and | |
1970 | the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination. | |
1971 | ||
1972 | </p> | |
1973 | <h3 class="function"><span class="info"> CUPS 2.2.4/macOS 10.13 </span><a id="cupsGetIntegerOption">cupsGetIntegerOption</a></h3> | |
53af7f21 | 1974 | <p class="description">Get an integer option value.</p> |
798d6e29 | 1975 | <p class="code"> |
98d88c8d MS |
1976 | int cupsGetIntegerOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p> |
1977 | <h4 class="parameters">Parameters</h4> | |
1978 | <table class="list"><tbody> | |
1979 | <tr><th>name</th> | |
1980 | <td class="description">Name of option</td></tr> | |
1981 | <tr><th>num_options</th> | |
1982 | <td class="description">Number of options</td></tr> | |
1983 | <tr><th>options</th> | |
1984 | <td class="description">Options</td></tr> | |
1985 | </tbody></table> | |
798d6e29 | 1986 | <h4 class="returnvalue">Return Value</h4> |
53af7f21 | 1987 | <p class="description">Option value or <code>INT_MIN</code></p> |
798d6e29 | 1988 | <h4 class="discussion">Discussion</h4> |
53af7f21 MS |
1989 | <p class="discussion">INT_MIN is returned when the option does not exist, is not an integer, or |
1990 | exceeds the range of values for the "int" type. | |
1991 | ||
1992 | </p> | |
798d6e29 MS |
1993 | <h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsGetJobs2">cupsGetJobs2</a></h3> |
1994 | <p class="description">Get the jobs from the specified server.</p> | |
1995 | <p class="code"> | |
98d88c8d MS |
1996 | int cupsGetJobs2(<a href="#http_t">http_t</a> *http, <a href="#cups_job_t">cups_job_t</a> **jobs, const char *name, int myjobs, int whichjobs);</p> |
1997 | <h4 class="parameters">Parameters</h4> | |
1998 | <table class="list"><tbody> | |
1999 | <tr><th>http</th> | |
2000 | <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> | |
2001 | <tr><th>jobs</th> | |
2002 | <td class="description">Job data</td></tr> | |
2003 | <tr><th>name</th> | |
2004 | <td class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</td></tr> | |
2005 | <tr><th>myjobs</th> | |
2006 | <td class="description">0 = all users, 1 = mine</td></tr> | |
2007 | <tr><th>whichjobs</th> | |
2008 | <td class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></td></tr> | |
2009 | </tbody></table> | |
798d6e29 MS |
2010 | <h4 class="returnvalue">Return Value</h4> |
2011 | <p class="description">Number of jobs</p> | |
2012 | <h4 class="discussion">Discussion</h4> | |
2013 | <p class="discussion">A "whichjobs" value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless | |
2014 | of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are | |
2015 | pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns | |
2016 | jobs that are stopped, canceled, aborted, or completed. | |
2017 | ||
2018 | </p> | |
2019 | <h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsGetNamedDest">cupsGetNamedDest</a></h3> | |
2020 | <p class="description">Get options for the named destination.</p> | |
2021 | <p class="code"> | |
98d88c8d MS |
2022 | <a href="#cups_dest_t">cups_dest_t</a> *cupsGetNamedDest(<a href="#http_t">http_t</a> *http, const char *name, const char *instance);</p> |
2023 | <h4 class="parameters">Parameters</h4> | |
2024 | <table class="list"><tbody> | |
2025 | <tr><th>http</th> | |
2026 | <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> | |
2027 | <tr><th>name</th> | |
2028 | <td class="description">Destination name or <code>NULL</code> for the default destination</td></tr> | |
2029 | <tr><th>instance</th> | |
2030 | <td class="description">Instance name or <code>NULL</code></td></tr> | |
2031 | </tbody></table> | |
798d6e29 MS |
2032 | <h4 class="returnvalue">Return Value</h4> |
2033 | <p class="description">Destination or <code>NULL</code></p> | |
2034 | <h4 class="discussion">Discussion</h4> | |
2035 | <p class="discussion">This function is optimized for retrieving a single destination and should | |
98d88c8d MS |
2036 | be used instead of <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> when you |
2037 | either know the name of the destination or want to print to the default | |
2038 | destination. If <code>NULL</code> is returned, the destination does not exist or | |
2039 | there is no default destination.<br> | |
798d6e29 MS |
2040 | <br> |
2041 | If "http" is <code>CUPS_HTTP_DEFAULT</code>, the connection to the default print | |
2042 | server will be used.<br> | |
2043 | <br> | |
2044 | If "name" is <code>NULL</code>, the default printer for the current user will be | |
2045 | returned.<br> | |
2046 | <br> | |
2047 | The returned destination must be freed using <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> with a | |
2048 | "num_dests" value of 1. | |
2049 | ||
2050 | </p> | |
2051 | <h3 class="function"><a id="cupsGetOption">cupsGetOption</a></h3> | |
2052 | <p class="description">Get an option value.</p> | |
2053 | <p class="code"> | |
98d88c8d MS |
2054 | const char *cupsGetOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p> |
2055 | <h4 class="parameters">Parameters</h4> | |
2056 | <table class="list"><tbody> | |
2057 | <tr><th>name</th> | |
2058 | <td class="description">Name of option</td></tr> | |
2059 | <tr><th>num_options</th> | |
2060 | <td class="description">Number of options</td></tr> | |
2061 | <tr><th>options</th> | |
2062 | <td class="description">Options</td></tr> | |
2063 | </tbody></table> | |
798d6e29 MS |
2064 | <h4 class="returnvalue">Return Value</h4> |
2065 | <p class="description">Option value or <code>NULL</code></p> | |
798d6e29 | 2066 | <h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsGetPassword2">cupsGetPassword2</a></h3> |
98d88c8d | 2067 | <p class="description">Get a password from the user using the current |
798d6e29 MS |
2068 | password callback.</p> |
2069 | <p class="code"> | |
98d88c8d MS |
2070 | const char *cupsGetPassword2(const char *prompt, <a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p> |
2071 | <h4 class="parameters">Parameters</h4> | |
2072 | <table class="list"><tbody> | |
2073 | <tr><th>prompt</th> | |
2074 | <td class="description">Prompt string</td></tr> | |
2075 | <tr><th>http</th> | |
2076 | <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> | |
2077 | <tr><th>method</th> | |
2078 | <td class="description">Request method ("GET", "POST", "PUT")</td></tr> | |
2079 | <tr><th>resource</th> | |
2080 | <td class="description">Resource path</td></tr> | |
2081 | </tbody></table> | |
798d6e29 MS |
2082 | <h4 class="returnvalue">Return Value</h4> |
2083 | <p class="description">Password</p> | |
2084 | <h4 class="discussion">Discussion</h4> | |
2085 | <p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the | |
2086 | user does not provide a password.<br> | |
2087 | <br> | |
2088 | Note: The current password callback function is tracked separately for each | |
2089 | thread in a program. Multi-threaded programs that override the setting via | |
98d88c8d MS |
2090 | the <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> function need to do so in each thread for the |
2091 | same function to be used. | |
798d6e29 | 2092 | |
798d6e29 | 2093 | </p> |
798d6e29 MS |
2094 | <h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></h3> |
2095 | <p class="description">Get the localized string for a destination media | |
2096 | size.</p> | |
2097 | <p class="code"> | |
98d88c8d MS |
2098 | const char *cupsLocalizeDestMedia(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p> |
2099 | <h4 class="parameters">Parameters</h4> | |
2100 | <table class="list"><tbody> | |
2101 | <tr><th>http</th> | |
2102 | <td class="description">Connection to destination</td></tr> | |
2103 | <tr><th>dest</th> | |
2104 | <td class="description">Destination</td></tr> | |
2105 | <tr><th>dinfo</th> | |
2106 | <td class="description">Destination information</td></tr> | |
2107 | <tr><th>flags</th> | |
2108 | <td class="description">Media flags</td></tr> | |
2109 | <tr><th>size</th> | |
2110 | <td class="description">Media size</td></tr> | |
2111 | </tbody></table> | |
798d6e29 MS |
2112 | <h4 class="returnvalue">Return Value</h4> |
2113 | <p class="description">Localized string</p> | |
2114 | <h4 class="discussion">Discussion</h4> | |
2115 | <p class="discussion">The returned string is stored in the destination information and will become | |
2116 | invalid if the destination information is deleted. | |
2117 | ||
2118 | </p> | |
2119 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsLocalizeDestOption">cupsLocalizeDestOption</a></h3> | |
2120 | <p class="description">Get the localized string for a destination | |
2121 | option.</p> | |
2122 | <p class="code"> | |
98d88c8d MS |
2123 | const char *cupsLocalizeDestOption(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option);</p> |
2124 | <h4 class="parameters">Parameters</h4> | |
2125 | <table class="list"><tbody> | |
2126 | <tr><th>http</th> | |
2127 | <td class="description">Connection to destination</td></tr> | |
2128 | <tr><th>dest</th> | |
2129 | <td class="description">Destination</td></tr> | |
2130 | <tr><th>dinfo</th> | |
2131 | <td class="description">Destination information</td></tr> | |
2132 | <tr><th>option</th> | |
2133 | <td class="description">Option to localize</td></tr> | |
2134 | </tbody></table> | |
798d6e29 MS |
2135 | <h4 class="returnvalue">Return Value</h4> |
2136 | <p class="description">Localized string</p> | |
2137 | <h4 class="discussion">Discussion</h4> | |
2138 | <p class="discussion">The returned string is stored in the destination information and will become | |
2139 | invalid if the destination information is deleted. | |
2140 | ||
2141 | </p> | |
2142 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsLocalizeDestValue">cupsLocalizeDestValue</a></h3> | |
2143 | <p class="description">Get the localized string for a destination | |
2144 | option+value pair.</p> | |
2145 | <p class="code"> | |
98d88c8d MS |
2146 | const char *cupsLocalizeDestValue(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option, const char *value);</p> |
2147 | <h4 class="parameters">Parameters</h4> | |
2148 | <table class="list"><tbody> | |
2149 | <tr><th>http</th> | |
2150 | <td class="description">Connection to destination</td></tr> | |
2151 | <tr><th>dest</th> | |
2152 | <td class="description">Destination</td></tr> | |
2153 | <tr><th>dinfo</th> | |
2154 | <td class="description">Destination information</td></tr> | |
2155 | <tr><th>option</th> | |
2156 | <td class="description">Option to localize</td></tr> | |
2157 | <tr><th>value</th> | |
2158 | <td class="description">Value to localize</td></tr> | |
2159 | </tbody></table> | |
798d6e29 MS |
2160 | <h4 class="returnvalue">Return Value</h4> |
2161 | <p class="description">Localized string</p> | |
2162 | <h4 class="discussion">Discussion</h4> | |
2163 | <p class="discussion">The returned string is stored in the destination information and will become | |
2164 | invalid if the destination information is deleted. | |
2165 | ||
2166 | </p> | |
2167 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="cupsMakeServerCredentials">cupsMakeServerCredentials</a></h3> | |
2168 | <p class="description">Make a self-signed certificate and private key pair.</p> | |
2169 | <p class="code"> | |
98d88c8d MS |
2170 | int cupsMakeServerCredentials(const char *path, const char *common_name, int num_alt_names, const char **alt_names, time_t expiration_date);</p> |
2171 | <h4 class="parameters">Parameters</h4> | |
2172 | <table class="list"><tbody> | |
2173 | <tr><th>path</th> | |
2174 | <td class="description">Keychain path or <code>NULL</code> for default</td></tr> | |
2175 | <tr><th>common_name</th> | |
2176 | <td class="description">Common name</td></tr> | |
2177 | <tr><th>num_alt_names</th> | |
2178 | <td class="description">Number of subject alternate names</td></tr> | |
2179 | <tr><th>alt_names</th> | |
2180 | <td class="description">Subject Alternate Names</td></tr> | |
2181 | <tr><th>expiration_date</th> | |
2182 | <td class="description">Expiration date</td></tr> | |
2183 | </tbody></table> | |
798d6e29 MS |
2184 | <h4 class="returnvalue">Return Value</h4> |
2185 | <p class="description">1 on success, 0 on failure</p> | |
798d6e29 MS |
2186 | <h3 class="function"><a id="cupsParseOptions">cupsParseOptions</a></h3> |
2187 | <p class="description">Parse options from a command-line argument.</p> | |
2188 | <p class="code"> | |
98d88c8d MS |
2189 | int cupsParseOptions(const char *arg, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p> |
2190 | <h4 class="parameters">Parameters</h4> | |
2191 | <table class="list"><tbody> | |
2192 | <tr><th>arg</th> | |
2193 | <td class="description">Argument to parse</td></tr> | |
2194 | <tr><th>num_options</th> | |
2195 | <td class="description">Number of options</td></tr> | |
2196 | <tr><th>options</th> | |
2197 | <td class="description">Options found</td></tr> | |
2198 | </tbody></table> | |
798d6e29 MS |
2199 | <h4 class="returnvalue">Return Value</h4> |
2200 | <p class="description">Number of options found</p> | |
2201 | <h4 class="discussion">Discussion</h4> | |
2202 | <p class="discussion">This function converts space-delimited name/value pairs according | |
2203 | to the PAPI text option ABNF specification. Collection values | |
2204 | ("name={a=... b=... c=...}") are stored with the curley brackets | |
2205 | intact - use <code>cupsParseOptions</code> on the value to extract the | |
2206 | collection attributes.</p> | |
798d6e29 MS |
2207 | <h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="cupsRemoveDest">cupsRemoveDest</a></h3> |
2208 | <p class="description">Remove a destination from the destination list.</p> | |
2209 | <p class="code"> | |
98d88c8d MS |
2210 | int cupsRemoveDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p> |
2211 | <h4 class="parameters">Parameters</h4> | |
2212 | <table class="list"><tbody> | |
2213 | <tr><th>name</th> | |
2214 | <td class="description">Destination name</td></tr> | |
2215 | <tr><th>instance</th> | |
2216 | <td class="description">Instance name or <code>NULL</code></td></tr> | |
2217 | <tr><th>num_dests</th> | |
2218 | <td class="description">Number of destinations</td></tr> | |
2219 | <tr><th>dests</th> | |
2220 | <td class="description">Destinations</td></tr> | |
2221 | </tbody></table> | |
798d6e29 MS |
2222 | <h4 class="returnvalue">Return Value</h4> |
2223 | <p class="description">New number of destinations</p> | |
2224 | <h4 class="discussion">Discussion</h4> | |
2225 | <p class="discussion">Removing a destination/instance does not delete the class or printer | |
2226 | queue, merely the lpoptions for that destination/instance. Use the | |
2227 | <a href="#cupsSetDests"><code>cupsSetDests</code></a> or <a href="#cupsSetDests2"><code>cupsSetDests2</code></a> functions to save the new | |
2228 | options for the user. | |
2229 | ||
2230 | </p> | |
2231 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsRemoveOption">cupsRemoveOption</a></h3> | |
2232 | <p class="description">Remove an option from an option array.</p> | |
2233 | <p class="code"> | |
98d88c8d MS |
2234 | int cupsRemoveOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p> |
2235 | <h4 class="parameters">Parameters</h4> | |
2236 | <table class="list"><tbody> | |
2237 | <tr><th>name</th> | |
2238 | <td class="description">Option name</td></tr> | |
2239 | <tr><th>num_options</th> | |
2240 | <td class="description">Current number of options</td></tr> | |
2241 | <tr><th>options</th> | |
2242 | <td class="description">Options</td></tr> | |
2243 | </tbody></table> | |
798d6e29 MS |
2244 | <h4 class="returnvalue">Return Value</h4> |
2245 | <p class="description">New number of options</p> | |
2246 | <h3 class="function"><a id="cupsServer">cupsServer</a></h3> | |
2247 | <p class="description">Return the hostname/address of the current server.</p> | |
2248 | <p class="code"> | |
98d88c8d | 2249 | const char *cupsServer(void);</p> |
798d6e29 MS |
2250 | <h4 class="returnvalue">Return Value</h4> |
2251 | <p class="description">Server name</p> | |
2252 | <h4 class="discussion">Discussion</h4> | |
2253 | <p class="discussion">The default server comes from the CUPS_SERVER environment variable, then the | |
2254 | ~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not | |
2255 | set, the default is the local system - either "localhost" or a domain socket | |
2256 | path.<br> | |
2257 | <br> | |
2258 | The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6 | |
2259 | address, or a domain socket pathname.<br> | |
2260 | <br> | |
2261 | Note: The current server is tracked separately for each thread in a program. | |
2262 | Multi-threaded programs that override the server via the | |
2263 | <a href="#cupsSetServer"><code>cupsSetServer</code></a> function need to do so in each thread for the same | |
2264 | server to be used.</p> | |
98d88c8d MS |
2265 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="cupsSetClientCertCB">cupsSetClientCertCB</a></h3> |
2266 | <p class="description">Set the client certificate callback.</p> | |
798d6e29 | 2267 | <p class="code"> |
98d88c8d | 2268 | void cupsSetClientCertCB(<a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a> cb, void *user_data);</p> |
798d6e29 | 2269 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2270 | <table class="list"><tbody> |
2271 | <tr><th>cb</th> | |
2272 | <td class="description">Callback function</td></tr> | |
2273 | <tr><th>user_data</th> | |
2274 | <td class="description">User data pointer</td></tr> | |
2275 | </tbody></table> | |
2276 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
2277 | <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br> |
2278 | <br> | |
2279 | Note: The current certificate callback is tracked separately for each thread | |
2280 | in a program. Multi-threaded programs that override the callback need to do | |
2281 | so in each thread for the same callback to be used. | |
2282 | ||
2283 | </p> | |
2284 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="cupsSetCredentials">cupsSetCredentials</a></h3> | |
2285 | <p class="description">Set the default credentials to be used for SSL/TLS | |
2286 | connections.</p> | |
2287 | <p class="code"> | |
98d88c8d | 2288 | int cupsSetCredentials(cups_array_t *credentials);</p> |
798d6e29 | 2289 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2290 | <table class="list"><tbody> |
2291 | <tr><th>credentials</th> | |
2292 | <td class="description">Array of credentials</td></tr> | |
2293 | </tbody></table> | |
798d6e29 MS |
2294 | <h4 class="returnvalue">Return Value</h4> |
2295 | <p class="description">Status of call (0 = success)</p> | |
2296 | <h4 class="discussion">Discussion</h4> | |
2297 | <p class="discussion">Note: The default credentials are tracked separately for each thread in a | |
2298 | program. Multi-threaded programs that override the setting need to do so in | |
2299 | each thread for the same setting to be used. | |
2300 | ||
2301 | </p> | |
98d88c8d | 2302 | <h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="cupsSetDefaultDest">cupsSetDefaultDest</a></h3> |
53af7f21 | 2303 | <p class="description">Set the default destination.</p> |
98d88c8d MS |
2304 | <p class="code"> |
2305 | void cupsSetDefaultDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p> | |
2306 | <h4 class="parameters">Parameters</h4> | |
2307 | <table class="list"><tbody> | |
2308 | <tr><th>name</th> | |
2309 | <td class="description">Destination name</td></tr> | |
2310 | <tr><th>instance</th> | |
2311 | <td class="description">Instance name or <code>NULL</code></td></tr> | |
2312 | <tr><th>num_dests</th> | |
2313 | <td class="description">Number of destinations</td></tr> | |
2314 | <tr><th>dests</th> | |
2315 | <td class="description">Destinations</td></tr> | |
2316 | </tbody></table> | |
798d6e29 MS |
2317 | <h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsSetDests2">cupsSetDests2</a></h3> |
2318 | <p class="description">Save the list of destinations for the specified server.</p> | |
2319 | <p class="code"> | |
98d88c8d MS |
2320 | int cupsSetDests2(<a href="#http_t">http_t</a> *http, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p> |
2321 | <h4 class="parameters">Parameters</h4> | |
2322 | <table class="list"><tbody> | |
2323 | <tr><th>http</th> | |
2324 | <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> | |
2325 | <tr><th>num_dests</th> | |
2326 | <td class="description">Number of destinations</td></tr> | |
2327 | <tr><th>dests</th> | |
2328 | <td class="description">Destinations</td></tr> | |
2329 | </tbody></table> | |
798d6e29 MS |
2330 | <h4 class="returnvalue">Return Value</h4> |
2331 | <p class="description">0 on success, -1 on error</p> | |
2332 | <h4 class="discussion">Discussion</h4> | |
2333 | <p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run | |
2334 | as root and ~/.cups/lpoptions when run as a normal user. | |
2335 | ||
2336 | </p> | |
2337 | <h3 class="function"><a id="cupsSetEncryption">cupsSetEncryption</a></h3> | |
98d88c8d | 2338 | <p class="description">Set the encryption preference.</p> |
798d6e29 | 2339 | <p class="code"> |
98d88c8d | 2340 | void cupsSetEncryption(<a href="#http_encryption_t">http_encryption_t</a> e);</p> |
798d6e29 | 2341 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2342 | <table class="list"><tbody> |
2343 | <tr><th>e</th> | |
2344 | <td class="description">New encryption preference</td></tr> | |
2345 | </tbody></table> | |
2346 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
2347 | <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION |
2348 | environment variable, then the ~/.cups/client.conf file, and finally the | |
2349 | /etc/cups/client.conf file. If not set, the default is | |
2350 | <code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br> | |
2351 | <br> | |
2352 | Note: The current encryption setting is tracked separately for each thread | |
2353 | in a program. Multi-threaded programs that override the setting need to do | |
2354 | so in each thread for the same setting to be used.</p> | |
98d88c8d MS |
2355 | <h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsSetPasswordCB2">cupsSetPasswordCB2</a></h3> |
2356 | <p class="description">Set the advanced password callback for CUPS.</p> | |
798d6e29 | 2357 | <p class="code"> |
98d88c8d | 2358 | void cupsSetPasswordCB2(<a href="#cups_password_cb2_t">cups_password_cb2_t</a> cb, void *user_data);</p> |
798d6e29 | 2359 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2360 | <table class="list"><tbody> |
2361 | <tr><th>cb</th> | |
2362 | <td class="description">Callback function</td></tr> | |
2363 | <tr><th>user_data</th> | |
2364 | <td class="description">User data pointer</td></tr> | |
2365 | </tbody></table> | |
2366 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
2367 | <p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which |
2368 | reads the password from the console. Programs should call either this | |
2369 | function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered | |
2370 | by a program per thread.<br> | |
2371 | <br> | |
2372 | Note: The current password callback is tracked separately for each thread | |
2373 | in a program. Multi-threaded programs that override the callback need to do | |
2374 | so in each thread for the same callback to be used. | |
2375 | ||
2376 | </p> | |
2377 | <h3 class="function"><a id="cupsSetServer">cupsSetServer</a></h3> | |
98d88c8d | 2378 | <p class="description">Set the default server name and port.</p> |
798d6e29 | 2379 | <p class="code"> |
98d88c8d | 2380 | void cupsSetServer(const char *server);</p> |
798d6e29 | 2381 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2382 | <table class="list"><tbody> |
2383 | <tr><th>server</th> | |
2384 | <td class="description">Server name</td></tr> | |
2385 | </tbody></table> | |
2386 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
2387 | <p class="discussion">The "server" string can be a fully-qualified hostname, a numeric |
2388 | IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP | |
2389 | addresses can be optionally followed by a colon and port number to override | |
2390 | the default port 631, e.g. "hostname:8631". Pass <code>NULL</code> to restore the | |
2391 | default server name and port.<br> | |
2392 | <br> | |
2393 | Note: The current server is tracked separately for each thread in a program. | |
2394 | Multi-threaded programs that override the server need to do so in each | |
2395 | thread for the same server to be used.</p> | |
98d88c8d MS |
2396 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="cupsSetServerCertCB">cupsSetServerCertCB</a></h3> |
2397 | <p class="description">Set the server certificate callback.</p> | |
798d6e29 | 2398 | <p class="code"> |
98d88c8d | 2399 | void cupsSetServerCertCB(<a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a> cb, void *user_data);</p> |
798d6e29 | 2400 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2401 | <table class="list"><tbody> |
2402 | <tr><th>cb</th> | |
2403 | <td class="description">Callback function</td></tr> | |
2404 | <tr><th>user_data</th> | |
2405 | <td class="description">User data pointer</td></tr> | |
2406 | </tbody></table> | |
2407 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
2408 | <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br> |
2409 | <br> | |
2410 | Note: The current credentials callback is tracked separately for each thread | |
2411 | in a program. Multi-threaded programs that override the callback need to do | |
2412 | so in each thread for the same callback to be used. | |
2413 | ||
2414 | </p> | |
2415 | <h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="cupsSetServerCredentials">cupsSetServerCredentials</a></h3> | |
2416 | <p class="description">Set the default server credentials.</p> | |
2417 | <p class="code"> | |
98d88c8d MS |
2418 | int cupsSetServerCredentials(const char *path, const char *common_name, int auto_create);</p> |
2419 | <h4 class="parameters">Parameters</h4> | |
2420 | <table class="list"><tbody> | |
2421 | <tr><th>path</th> | |
2422 | <td class="description">Keychain path or <code>NULL</code> for default</td></tr> | |
2423 | <tr><th>common_name</th> | |
2424 | <td class="description">Default common name for server</td></tr> | |
2425 | <tr><th>auto_create</th> | |
2426 | <td class="description">1 = automatically create self-signed certificates</td></tr> | |
2427 | </tbody></table> | |
798d6e29 MS |
2428 | <h4 class="returnvalue">Return Value</h4> |
2429 | <p class="description">1 on success, 0 on failure</p> | |
2430 | <h4 class="discussion">Discussion</h4> | |
2431 | <p class="discussion">Note: The server credentials are used by all threads in the running process. | |
2432 | This function is threadsafe. | |
2433 | ||
2434 | </p> | |
2435 | <h3 class="function"><a id="cupsSetUser">cupsSetUser</a></h3> | |
98d88c8d | 2436 | <p class="description">Set the default user name.</p> |
798d6e29 | 2437 | <p class="code"> |
98d88c8d | 2438 | void cupsSetUser(const char *user);</p> |
798d6e29 | 2439 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2440 | <table class="list"><tbody> |
2441 | <tr><th>user</th> | |
2442 | <td class="description">User name</td></tr> | |
2443 | </tbody></table> | |
2444 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
2445 | <p class="discussion">Pass <code>NULL</code> to restore the default user name.<br> |
2446 | <br> | |
2447 | Note: The current user name is tracked separately for each thread in a | |
2448 | program. Multi-threaded programs that override the user name need to do so | |
2449 | in each thread for the same user name to be used.</p> | |
98d88c8d MS |
2450 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsSetUserAgent">cupsSetUserAgent</a></h3> |
2451 | <p class="description">Set the default HTTP User-Agent string.</p> | |
798d6e29 | 2452 | <p class="code"> |
98d88c8d | 2453 | void cupsSetUserAgent(const char *user_agent);</p> |
798d6e29 | 2454 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2455 | <table class="list"><tbody> |
2456 | <tr><th>user_agent</th> | |
2457 | <td class="description">User-Agent string or <code>NULL</code></td></tr> | |
2458 | </tbody></table> | |
2459 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
2460 | <p class="discussion">Setting the string to NULL forces the default value containing the CUPS |
2461 | version, IPP version, and operating system version and architecture. | |
2462 | ||
2463 | </p> | |
2464 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsStartDestDocument">cupsStartDestDocument</a></h3> | |
2465 | <p class="description">Start a new document.</p> | |
2466 | <p class="code"> | |
98d88c8d MS |
2467 | http_status_t cupsStartDestDocument(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info, int job_id, const char *docname, const char *format, int num_options, <a href="#cups_option_t">cups_option_t</a> *options, int last_document);</p> |
2468 | <h4 class="parameters">Parameters</h4> | |
2469 | <table class="list"><tbody> | |
2470 | <tr><th>http</th> | |
2471 | <td class="description">Connection to destination</td></tr> | |
2472 | <tr><th>dest</th> | |
2473 | <td class="description">Destination</td></tr> | |
2474 | <tr><th>info</th> | |
2475 | <td class="description">Destination information</td></tr> | |
2476 | <tr><th>job_id</th> | |
2477 | <td class="description">Job ID</td></tr> | |
2478 | <tr><th>docname</th> | |
2479 | <td class="description">Document name</td></tr> | |
2480 | <tr><th>format</th> | |
2481 | <td class="description">Document format</td></tr> | |
2482 | <tr><th>num_options</th> | |
2483 | <td class="description">Number of document options</td></tr> | |
2484 | <tr><th>options</th> | |
2485 | <td class="description">Document options</td></tr> | |
2486 | <tr><th>last_document</th> | |
2487 | <td class="description">1 if this is the last document</td></tr> | |
2488 | </tbody></table> | |
798d6e29 MS |
2489 | <h4 class="returnvalue">Return Value</h4> |
2490 | <p class="description">Status of document creation</p> | |
2491 | <h4 class="discussion">Discussion</h4> | |
2492 | <p class="discussion">"job_id" is the job ID returned by cupsCreateDestJob. "docname" is the name | |
2493 | of the document/file being printed, "format" is the MIME media type for the | |
2494 | document (see CUPS_FORMAT_xxx constants), and "num_options" and "options" | |
2495 | are the options do be applied to the document. "last_document" should be 1 | |
2496 | if this is the last document to be submitted in the job. Returns | |
2497 | <code>HTTP_CONTINUE</code> on success. | |
2498 | ||
798d6e29 MS |
2499 | </p> |
2500 | <h3 class="function"><a id="cupsUser">cupsUser</a></h3> | |
2501 | <p class="description">Return the current user's name.</p> | |
2502 | <p class="code"> | |
98d88c8d | 2503 | const char *cupsUser(void);</p> |
798d6e29 MS |
2504 | <h4 class="returnvalue">Return Value</h4> |
2505 | <p class="description">User name</p> | |
2506 | <h4 class="discussion">Discussion</h4> | |
2507 | <p class="discussion">Note: The current user name is tracked separately for each thread in a | |
2508 | program. Multi-threaded programs that override the user name with the | |
2509 | <a href="#cupsSetUser"><code>cupsSetUser</code></a> function need to do so in each thread for the same user | |
2510 | name to be used.</p> | |
2511 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsUserAgent">cupsUserAgent</a></h3> | |
2512 | <p class="description">Return the default HTTP User-Agent string.</p> | |
2513 | <p class="code"> | |
98d88c8d | 2514 | const char *cupsUserAgent(void);</p> |
798d6e29 MS |
2515 | <h4 class="returnvalue">Return Value</h4> |
2516 | <p class="description">User-Agent string</p> | |
2517 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAcceptConnection">httpAcceptConnection</a></h3> | |
2518 | <p class="description">Accept a new HTTP client connection from the | |
2519 | specified listening socket.</p> | |
2520 | <p class="code"> | |
98d88c8d | 2521 | <a href="#http_t">http_t</a> *httpAcceptConnection(int fd, int blocking);</p> |
798d6e29 | 2522 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2523 | <table class="list"><tbody> |
2524 | <tr><th>fd</th> | |
2525 | <td class="description">Listen socket file descriptor</td></tr> | |
2526 | <tr><th>blocking</th> | |
2527 | <td class="description">1 if the connection should be | |
2528 | blocking, 0 otherwise</td></tr> | |
2529 | </tbody></table> | |
798d6e29 MS |
2530 | <h4 class="returnvalue">Return Value</h4> |
2531 | <p class="description">HTTP connection or <code>NULL</code></p> | |
2532 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="httpAddCredential">httpAddCredential</a></h3> | |
2533 | <p class="description">Allocates and adds a single credential to an array.</p> | |
2534 | <p class="code"> | |
98d88c8d MS |
2535 | int httpAddCredential(cups_array_t *credentials, const void *data, size_t datalen);</p> |
2536 | <h4 class="parameters">Parameters</h4> | |
2537 | <table class="list"><tbody> | |
2538 | <tr><th>credentials</th> | |
2539 | <td class="description">Credentials array</td></tr> | |
2540 | <tr><th>data</th> | |
2541 | <td class="description">PEM-encoded X.509 data</td></tr> | |
2542 | <tr><th>datalen</th> | |
2543 | <td class="description">Length of data</td></tr> | |
2544 | </tbody></table> | |
798d6e29 MS |
2545 | <h4 class="returnvalue">Return Value</h4> |
2546 | <p class="description">0 on success, -1 on error</p> | |
2547 | <h4 class="discussion">Discussion</h4> | |
2548 | <p class="discussion">Use <code>cupsArrayNew(NULL, NULL)</code> to create a credentials array. | |
2549 | ||
2550 | </p> | |
2551 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrAny">httpAddrAny</a></h3> | |
2552 | <p class="description">Check for the "any" address.</p> | |
2553 | <p class="code"> | |
98d88c8d | 2554 | int httpAddrAny(const <a href="#http_addr_t">http_addr_t</a> *addr);</p> |
798d6e29 | 2555 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2556 | <table class="list"><tbody> |
2557 | <tr><th>addr</th> | |
2558 | <td class="description">Address to check</td></tr> | |
2559 | </tbody></table> | |
798d6e29 MS |
2560 | <h4 class="returnvalue">Return Value</h4> |
2561 | <p class="description">1 if "any", 0 otherwise</p> | |
2562 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpAddrClose">httpAddrClose</a></h3> | |
2563 | <p class="description">Close a socket created by <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> or | |
2564 | <a href="#httpAddrListen"><code>httpAddrListen</code></a>.</p> | |
2565 | <p class="code"> | |
98d88c8d | 2566 | int httpAddrClose(<a href="#http_addr_t">http_addr_t</a> *addr, int fd);</p> |
798d6e29 | 2567 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2568 | <table class="list"><tbody> |
2569 | <tr><th>addr</th> | |
2570 | <td class="description">Listen address or <code>NULL</code></td></tr> | |
2571 | <tr><th>fd</th> | |
2572 | <td class="description">Socket file descriptor</td></tr> | |
2573 | </tbody></table> | |
798d6e29 MS |
2574 | <h4 class="returnvalue">Return Value</h4> |
2575 | <p class="description">0 on success, -1 on failure</p> | |
2576 | <h4 class="discussion">Discussion</h4> | |
98d88c8d MS |
2577 | <p class="discussion">Pass <code>NULL</code> for sockets created with <a href="#httpAddrConnect2"><code>httpAddrConnect2</code></a> and the |
2578 | listen address for sockets created with <a href="#httpAddrListen"><code>httpAddrListen</code></a>. This function | |
2579 | ensures that domain sockets are removed when closed. | |
798d6e29 MS |
2580 | |
2581 | </p> | |
798d6e29 MS |
2582 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAddrConnect2">httpAddrConnect2</a></h3> |
2583 | <p class="description">Connect to any of the addresses in the list with a | |
2584 | timeout and optional cancel.</p> | |
2585 | <p class="code"> | |
98d88c8d MS |
2586 | <a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrConnect2(<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist, int *sock, int msec, int *cancel);</p> |
2587 | <h4 class="parameters">Parameters</h4> | |
2588 | <table class="list"><tbody> | |
2589 | <tr><th>addrlist</th> | |
2590 | <td class="description">List of potential addresses</td></tr> | |
2591 | <tr><th>sock</th> | |
2592 | <td class="description">Socket</td></tr> | |
2593 | <tr><th>msec</th> | |
2594 | <td class="description">Timeout in milliseconds</td></tr> | |
2595 | <tr><th>cancel</th> | |
2596 | <td class="description">Pointer to "cancel" variable</td></tr> | |
2597 | </tbody></table> | |
798d6e29 MS |
2598 | <h4 class="returnvalue">Return Value</h4> |
2599 | <p class="description">Connected address or NULL on failure</p> | |
2600 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAddrCopyList">httpAddrCopyList</a></h3> | |
2601 | <p class="description">Copy an address list.</p> | |
2602 | <p class="code"> | |
98d88c8d | 2603 | <a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrCopyList(<a href="#http_addrlist_t">http_addrlist_t</a> *src);</p> |
798d6e29 | 2604 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2605 | <table class="list"><tbody> |
2606 | <tr><th>src</th> | |
2607 | <td class="description">Source address list</td></tr> | |
2608 | </tbody></table> | |
798d6e29 MS |
2609 | <h4 class="returnvalue">Return Value</h4> |
2610 | <p class="description">New address list or <code>NULL</code> on error</p> | |
2611 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrEqual">httpAddrEqual</a></h3> | |
2612 | <p class="description">Compare two addresses.</p> | |
2613 | <p class="code"> | |
98d88c8d | 2614 | int httpAddrEqual(const <a href="#http_addr_t">http_addr_t</a> *addr1, const <a href="#http_addr_t">http_addr_t</a> *addr2);</p> |
798d6e29 | 2615 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2616 | <table class="list"><tbody> |
2617 | <tr><th>addr1</th> | |
2618 | <td class="description">First address</td></tr> | |
2619 | <tr><th>addr2</th> | |
2620 | <td class="description">Second address</td></tr> | |
2621 | </tbody></table> | |
798d6e29 MS |
2622 | <h4 class="returnvalue">Return Value</h4> |
2623 | <p class="description">1 if equal, 0 if not</p> | |
2624 | <h3 class="function"><a id="httpAddrFamily">httpAddrFamily</a></h3> | |
2625 | <p class="description">Get the address family of an address.</p> | |
2626 | <p class="code"> | |
98d88c8d | 2627 | int httpAddrFamily(<a href="#http_addr_t">http_addr_t</a> *addr);</p> |
798d6e29 | 2628 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2629 | <table class="list"><tbody> |
2630 | <tr><th>addr</th> | |
2631 | <td class="description">Address</td></tr> | |
2632 | </tbody></table> | |
798d6e29 MS |
2633 | <h4 class="returnvalue">Return Value</h4> |
2634 | <p class="description">Address family</p> | |
98d88c8d MS |
2635 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrFreeList">httpAddrFreeList</a></h3> |
2636 | <p class="description">Free an address list.</p> | |
798d6e29 | 2637 | <p class="code"> |
98d88c8d | 2638 | void httpAddrFreeList(<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist);</p> |
798d6e29 | 2639 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2640 | <table class="list"><tbody> |
2641 | <tr><th>addrlist</th> | |
2642 | <td class="description">Address list to free</td></tr> | |
2643 | </tbody></table> | |
798d6e29 MS |
2644 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrGetList">httpAddrGetList</a></h3> |
2645 | <p class="description">Get a list of addresses for a hostname.</p> | |
2646 | <p class="code"> | |
98d88c8d MS |
2647 | <a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrGetList(const char *hostname, int family, const char *service);</p> |
2648 | <h4 class="parameters">Parameters</h4> | |
2649 | <table class="list"><tbody> | |
2650 | <tr><th>hostname</th> | |
2651 | <td class="description">Hostname, IP address, or NULL for passive listen address</td></tr> | |
2652 | <tr><th>family</th> | |
2653 | <td class="description">Address family or AF_UNSPEC</td></tr> | |
2654 | <tr><th>service</th> | |
2655 | <td class="description">Service name or port number</td></tr> | |
2656 | </tbody></table> | |
798d6e29 MS |
2657 | <h4 class="returnvalue">Return Value</h4> |
2658 | <p class="description">List of addresses or NULL</p> | |
2659 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrLength">httpAddrLength</a></h3> | |
2660 | <p class="description">Return the length of the address in bytes.</p> | |
2661 | <p class="code"> | |
98d88c8d | 2662 | int httpAddrLength(const <a href="#http_addr_t">http_addr_t</a> *addr);</p> |
798d6e29 | 2663 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2664 | <table class="list"><tbody> |
2665 | <tr><th>addr</th> | |
2666 | <td class="description">Address</td></tr> | |
2667 | </tbody></table> | |
798d6e29 MS |
2668 | <h4 class="returnvalue">Return Value</h4> |
2669 | <p class="description">Length in bytes</p> | |
2670 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAddrListen">httpAddrListen</a></h3> | |
2671 | <p class="description">Create a listening socket bound to the specified | |
2672 | address and port.</p> | |
2673 | <p class="code"> | |
98d88c8d | 2674 | int httpAddrListen(<a href="#http_addr_t">http_addr_t</a> *addr, int port);</p> |
798d6e29 | 2675 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2676 | <table class="list"><tbody> |
2677 | <tr><th>addr</th> | |
2678 | <td class="description">Address to bind to</td></tr> | |
2679 | <tr><th>port</th> | |
2680 | <td class="description">Port number to bind to</td></tr> | |
2681 | </tbody></table> | |
798d6e29 MS |
2682 | <h4 class="returnvalue">Return Value</h4> |
2683 | <p class="description">Socket or -1 on error</p> | |
2684 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrLocalhost">httpAddrLocalhost</a></h3> | |
2685 | <p class="description">Check for the local loopback address.</p> | |
2686 | <p class="code"> | |
98d88c8d | 2687 | int httpAddrLocalhost(const <a href="#http_addr_t">http_addr_t</a> *addr);</p> |
798d6e29 | 2688 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2689 | <table class="list"><tbody> |
2690 | <tr><th>addr</th> | |
2691 | <td class="description">Address to check</td></tr> | |
2692 | </tbody></table> | |
798d6e29 MS |
2693 | <h4 class="returnvalue">Return Value</h4> |
2694 | <p class="description">1 if local host, 0 otherwise</p> | |
2695 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrLookup">httpAddrLookup</a></h3> | |
2696 | <p class="description">Lookup the hostname associated with the address.</p> | |
2697 | <p class="code"> | |
98d88c8d MS |
2698 | char *httpAddrLookup(const <a href="#http_addr_t">http_addr_t</a> *addr, char *name, int namelen);</p> |
2699 | <h4 class="parameters">Parameters</h4> | |
2700 | <table class="list"><tbody> | |
2701 | <tr><th>addr</th> | |
2702 | <td class="description">Address to lookup</td></tr> | |
2703 | <tr><th>name</th> | |
2704 | <td class="description">Host name buffer</td></tr> | |
2705 | <tr><th>namelen</th> | |
2706 | <td class="description">Size of name buffer</td></tr> | |
2707 | </tbody></table> | |
798d6e29 MS |
2708 | <h4 class="returnvalue">Return Value</h4> |
2709 | <p class="description">Host name</p> | |
2710 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAddrPort">httpAddrPort</a></h3> | |
2711 | <p class="description">Get the port number associated with an address.</p> | |
2712 | <p class="code"> | |
98d88c8d | 2713 | int httpAddrPort(<a href="#http_addr_t">http_addr_t</a> *addr);</p> |
798d6e29 | 2714 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2715 | <table class="list"><tbody> |
2716 | <tr><th>addr</th> | |
2717 | <td class="description">Address</td></tr> | |
2718 | </tbody></table> | |
798d6e29 MS |
2719 | <h4 class="returnvalue">Return Value</h4> |
2720 | <p class="description">Port number</p> | |
2721 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrString">httpAddrString</a></h3> | |
2722 | <p class="description">Convert an address to a numeric string.</p> | |
2723 | <p class="code"> | |
98d88c8d MS |
2724 | char *httpAddrString(const <a href="#http_addr_t">http_addr_t</a> *addr, char *s, int slen);</p> |
2725 | <h4 class="parameters">Parameters</h4> | |
2726 | <table class="list"><tbody> | |
2727 | <tr><th>addr</th> | |
2728 | <td class="description">Address to convert</td></tr> | |
2729 | <tr><th>s</th> | |
2730 | <td class="description">String buffer</td></tr> | |
2731 | <tr><th>slen</th> | |
2732 | <td class="description">Length of string</td></tr> | |
2733 | </tbody></table> | |
798d6e29 MS |
2734 | <h4 class="returnvalue">Return Value</h4> |
2735 | <p class="description">Numeric address string</p> | |
2736 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAssembleURI">httpAssembleURI</a></h3> | |
2737 | <p class="description">Assemble a uniform resource identifier from its | |
2738 | components.</p> | |
2739 | <p class="code"> | |
98d88c8d MS |
2740 | <a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURI(<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding, char *uri, int urilen, const char *scheme, const char *username, const char *host, int port, const char *resource);</p> |
2741 | <h4 class="parameters">Parameters</h4> | |
2742 | <table class="list"><tbody> | |
2743 | <tr><th>encoding</th> | |
2744 | <td class="description">Encoding flags</td></tr> | |
2745 | <tr><th>uri</th> | |
2746 | <td class="description">URI buffer</td></tr> | |
2747 | <tr><th>urilen</th> | |
2748 | <td class="description">Size of URI buffer</td></tr> | |
2749 | <tr><th>scheme</th> | |
2750 | <td class="description">Scheme name</td></tr> | |
2751 | <tr><th>username</th> | |
2752 | <td class="description">Username</td></tr> | |
2753 | <tr><th>host</th> | |
2754 | <td class="description">Hostname or address</td></tr> | |
2755 | <tr><th>port</th> | |
2756 | <td class="description">Port number</td></tr> | |
2757 | <tr><th>resource</th> | |
2758 | <td class="description">Resource</td></tr> | |
2759 | </tbody></table> | |
798d6e29 MS |
2760 | <h4 class="returnvalue">Return Value</h4> |
2761 | <p class="description">URI status</p> | |
2762 | <h4 class="discussion">Discussion</h4> | |
2763 | <p class="discussion">This function escapes reserved characters in the URI depending on the | |
2764 | value of the "encoding" argument. You should use this function in | |
2765 | place of traditional string functions whenever you need to create a | |
2766 | URI string. | |
2767 | ||
2768 | </p> | |
2769 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAssembleURIf">httpAssembleURIf</a></h3> | |
2770 | <p class="description">Assemble a uniform resource identifier from its | |
2771 | components with a formatted resource.</p> | |
2772 | <p class="code"> | |
98d88c8d MS |
2773 | <a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURIf(<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding, char *uri, int urilen, const char *scheme, const char *username, const char *host, int port, const char *resourcef, ...);</p> |
2774 | <h4 class="parameters">Parameters</h4> | |
2775 | <table class="list"><tbody> | |
2776 | <tr><th>encoding</th> | |
2777 | <td class="description">Encoding flags</td></tr> | |
2778 | <tr><th>uri</th> | |
2779 | <td class="description">URI buffer</td></tr> | |
2780 | <tr><th>urilen</th> | |
2781 | <td class="description">Size of URI buffer</td></tr> | |
2782 | <tr><th>scheme</th> | |
2783 | <td class="description">Scheme name</td></tr> | |
2784 | <tr><th>username</th> | |
2785 | <td class="description">Username</td></tr> | |
2786 | <tr><th>host</th> | |
2787 | <td class="description">Hostname or address</td></tr> | |
2788 | <tr><th>port</th> | |
2789 | <td class="description">Port number</td></tr> | |
2790 | <tr><th>resourcef</th> | |
2791 | <td class="description">Printf-style resource</td></tr> | |
2792 | <tr><th>...</th> | |
2793 | <td class="description">Additional arguments as needed</td></tr> | |
2794 | </tbody></table> | |
798d6e29 MS |
2795 | <h4 class="returnvalue">Return Value</h4> |
2796 | <p class="description">URI status</p> | |
2797 | <h4 class="discussion">Discussion</h4> | |
2798 | <p class="discussion">This function creates a formatted version of the resource string | |
2799 | argument "resourcef" and escapes reserved characters in the URI | |
2800 | depending on the value of the "encoding" argument. You should use | |
2801 | this function in place of traditional string functions whenever | |
2802 | you need to create a URI string. | |
2803 | ||
2804 | </p> | |
2805 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAssembleUUID">httpAssembleUUID</a></h3> | |
2806 | <p class="description">Assemble a name-based UUID URN conforming to RFC 4122.</p> | |
2807 | <p class="code"> | |
98d88c8d MS |
2808 | char *httpAssembleUUID(const char *server, int port, const char *name, int number, char *buffer, size_t bufsize);</p> |
2809 | <h4 class="parameters">Parameters</h4> | |
2810 | <table class="list"><tbody> | |
2811 | <tr><th>server</th> | |
2812 | <td class="description">Server name</td></tr> | |
2813 | <tr><th>port</th> | |
2814 | <td class="description">Port number</td></tr> | |
2815 | <tr><th>name</th> | |
2816 | <td class="description">Object name or NULL</td></tr> | |
2817 | <tr><th>number</th> | |
2818 | <td class="description">Object number or 0</td></tr> | |
2819 | <tr><th>buffer</th> | |
2820 | <td class="description">String buffer</td></tr> | |
2821 | <tr><th>bufsize</th> | |
2822 | <td class="description">Size of buffer</td></tr> | |
2823 | </tbody></table> | |
798d6e29 MS |
2824 | <h4 class="returnvalue">Return Value</h4> |
2825 | <p class="description">UUID string</p> | |
2826 | <h4 class="discussion">Discussion</h4> | |
2827 | <p class="discussion">This function creates a unique 128-bit identifying number using the server | |
2828 | name, port number, random data, and optionally an object name and/or object | |
2829 | number. The result is formatted as a UUID URN as defined in RFC 4122.<br> | |
2830 | <br> | |
2831 | The buffer needs to be at least 46 bytes in size. | |
2832 | ||
2833 | </p> | |
2834 | <h3 class="function"><a id="httpBlocking">httpBlocking</a></h3> | |
98d88c8d | 2835 | <p class="description">Set blocking/non-blocking behavior on a connection.</p> |
798d6e29 | 2836 | <p class="code"> |
98d88c8d | 2837 | void httpBlocking(<a href="#http_t">http_t</a> *http, int b);</p> |
798d6e29 | 2838 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2839 | <table class="list"><tbody> |
2840 | <tr><th>http</th> | |
2841 | <td class="description">HTTP connection</td></tr> | |
2842 | <tr><th>b</th> | |
2843 | <td class="description">1 = blocking, 0 = non-blocking</td></tr> | |
2844 | </tbody></table> | |
798d6e29 MS |
2845 | <h3 class="function"><a id="httpCheck">httpCheck</a></h3> |
2846 | <p class="description">Check to see if there is a pending response from the server.</p> | |
2847 | <p class="code"> | |
98d88c8d | 2848 | int httpCheck(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 2849 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2850 | <table class="list"><tbody> |
2851 | <tr><th>http</th> | |
2852 | <td class="description">HTTP connection</td></tr> | |
2853 | </tbody></table> | |
798d6e29 MS |
2854 | <h4 class="returnvalue">Return Value</h4> |
2855 | <p class="description">0 = no data, 1 = data available</p> | |
98d88c8d MS |
2856 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="httpClearCookie">httpClearCookie</a></h3> |
2857 | <p class="description">Clear the cookie value(s).</p> | |
798d6e29 | 2858 | <p class="code"> |
98d88c8d | 2859 | void httpClearCookie(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 2860 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2861 | <table class="list"><tbody> |
2862 | <tr><th>http</th> | |
2863 | <td class="description">HTTP connection</td></tr> | |
2864 | </tbody></table> | |
798d6e29 | 2865 | <h3 class="function"><a id="httpClearFields">httpClearFields</a></h3> |
98d88c8d | 2866 | <p class="description">Clear HTTP request fields.</p> |
798d6e29 | 2867 | <p class="code"> |
98d88c8d | 2868 | void httpClearFields(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 2869 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2870 | <table class="list"><tbody> |
2871 | <tr><th>http</th> | |
2872 | <td class="description">HTTP connection</td></tr> | |
2873 | </tbody></table> | |
798d6e29 | 2874 | <h3 class="function"><a id="httpClose">httpClose</a></h3> |
98d88c8d | 2875 | <p class="description">Close an HTTP connection.</p> |
798d6e29 | 2876 | <p class="code"> |
98d88c8d | 2877 | void httpClose(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 2878 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2879 | <table class="list"><tbody> |
2880 | <tr><th>http</th> | |
2881 | <td class="description">HTTP connection</td></tr> | |
2882 | </tbody></table> | |
798d6e29 MS |
2883 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpCompareCredentials">httpCompareCredentials</a></h3> |
2884 | <p class="description">Compare two sets of X.509 credentials.</p> | |
2885 | <p class="code"> | |
98d88c8d | 2886 | int httpCompareCredentials(cups_array_t *cred1, cups_array_t *cred2);</p> |
798d6e29 | 2887 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2888 | <table class="list"><tbody> |
2889 | <tr><th>cred1</th> | |
2890 | <td class="description">First set of X.509 credentials</td></tr> | |
2891 | <tr><th>cred2</th> | |
2892 | <td class="description">Second set of X.509 credentials</td></tr> | |
2893 | </tbody></table> | |
53af7f21 MS |
2894 | <h4 class="returnvalue">Return Value</h4> |
2895 | <p class="description">1 if they match, 0 if they do not</p> | |
798d6e29 MS |
2896 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpConnect2">httpConnect2</a></h3> |
2897 | <p class="description">Connect to a HTTP server.</p> | |
2898 | <p class="code"> | |
98d88c8d MS |
2899 | <a href="#http_t">http_t</a> *httpConnect2(const char *host, int port, <a href="#http_addrlist_t">http_addrlist_t</a> *addrlist, int family, <a href="#http_encryption_t">http_encryption_t</a> encryption, int blocking, int msec, int *cancel);</p> |
2900 | <h4 class="parameters">Parameters</h4> | |
2901 | <table class="list"><tbody> | |
2902 | <tr><th>host</th> | |
2903 | <td class="description">Host to connect to</td></tr> | |
2904 | <tr><th>port</th> | |
2905 | <td class="description">Port number</td></tr> | |
2906 | <tr><th>addrlist</th> | |
65bebeac | 2907 | <td class="description">List of addresses or <code>NULL</code> to lookup</td></tr> |
98d88c8d MS |
2908 | <tr><th>family</th> |
2909 | <td class="description">Address family to use or <code>AF_UNSPEC</code> for any</td></tr> | |
2910 | <tr><th>encryption</th> | |
2911 | <td class="description">Type of encryption to use</td></tr> | |
2912 | <tr><th>blocking</th> | |
2913 | <td class="description">1 for blocking connection, 0 for non-blocking</td></tr> | |
2914 | <tr><th>msec</th> | |
2915 | <td class="description">Connection timeout in milliseconds, 0 means don't connect</td></tr> | |
2916 | <tr><th>cancel</th> | |
2917 | <td class="description">Pointer to "cancel" variable</td></tr> | |
2918 | </tbody></table> | |
798d6e29 MS |
2919 | <h4 class="returnvalue">Return Value</h4> |
2920 | <p class="description">New HTTP connection</p> | |
798d6e29 MS |
2921 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="httpCopyCredentials">httpCopyCredentials</a></h3> |
2922 | <p class="description">Copy the credentials associated with the peer in | |
2923 | an encrypted connection.</p> | |
2924 | <p class="code"> | |
98d88c8d | 2925 | int httpCopyCredentials(<a href="#http_t">http_t</a> *http, cups_array_t **credentials);</p> |
798d6e29 | 2926 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2927 | <table class="list"><tbody> |
2928 | <tr><th>http</th> | |
2929 | <td class="description">Connection to server</td></tr> | |
2930 | <tr><th>credentials</th> | |
2931 | <td class="description">Array of credentials</td></tr> | |
2932 | </tbody></table> | |
798d6e29 MS |
2933 | <h4 class="returnvalue">Return Value</h4> |
2934 | <p class="description">Status of call (0 = success)</p> | |
2935 | <h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></h3> | |
2936 | <p class="description">Return whether the credentials are valid for the given name.</p> | |
2937 | <p class="code"> | |
98d88c8d | 2938 | int httpCredentialsAreValidForName(cups_array_t *credentials, const char *common_name);</p> |
798d6e29 | 2939 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2940 | <table class="list"><tbody> |
2941 | <tr><th>credentials</th> | |
2942 | <td class="description">Credentials</td></tr> | |
2943 | <tr><th>common_name</th> | |
2944 | <td class="description">Name to check</td></tr> | |
2945 | </tbody></table> | |
798d6e29 MS |
2946 | <h4 class="returnvalue">Return Value</h4> |
2947 | <p class="description">1 if valid, 0 otherwise</p> | |
2948 | <h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></h3> | |
2949 | <p class="description">Return the expiration date of the credentials.</p> | |
2950 | <p class="code"> | |
98d88c8d | 2951 | time_t httpCredentialsGetExpiration(cups_array_t *credentials);</p> |
798d6e29 | 2952 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2953 | <table class="list"><tbody> |
2954 | <tr><th>credentials</th> | |
2955 | <td class="description">Credentials</td></tr> | |
2956 | </tbody></table> | |
798d6e29 MS |
2957 | <h4 class="returnvalue">Return Value</h4> |
2958 | <p class="description">Expiration date of credentials</p> | |
2959 | <h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="httpCredentialsGetTrust">httpCredentialsGetTrust</a></h3> | |
2960 | <p class="description">Return the trust of credentials.</p> | |
2961 | <p class="code"> | |
98d88c8d | 2962 | <a href="#http_trust_t">http_trust_t</a> httpCredentialsGetTrust(cups_array_t *credentials, const char *common_name);</p> |
798d6e29 | 2963 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2964 | <table class="list"><tbody> |
2965 | <tr><th>credentials</th> | |
2966 | <td class="description">Credentials</td></tr> | |
2967 | <tr><th>common_name</th> | |
2968 | <td class="description">Common name for trust lookup</td></tr> | |
2969 | </tbody></table> | |
798d6e29 MS |
2970 | <h4 class="returnvalue">Return Value</h4> |
2971 | <p class="description">Level of trust</p> | |
2972 | <h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="httpCredentialsString">httpCredentialsString</a></h3> | |
2973 | <p class="description">Return a string representing the credentials.</p> | |
2974 | <p class="code"> | |
98d88c8d MS |
2975 | size_t httpCredentialsString(cups_array_t *credentials, char *buffer, size_t bufsize);</p> |
2976 | <h4 class="parameters">Parameters</h4> | |
2977 | <table class="list"><tbody> | |
2978 | <tr><th>credentials</th> | |
2979 | <td class="description">Credentials</td></tr> | |
2980 | <tr><th>buffer</th> | |
2981 | <td class="description">Buffer or <code>NULL</code></td></tr> | |
2982 | <tr><th>bufsize</th> | |
2983 | <td class="description">Size of buffer</td></tr> | |
2984 | </tbody></table> | |
798d6e29 MS |
2985 | <h4 class="returnvalue">Return Value</h4> |
2986 | <p class="description">Total size of credentials string</p> | |
798d6e29 MS |
2987 | <h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="httpDecode64_2">httpDecode64_2</a></h3> |
2988 | <p class="description">Base64-decode a string.</p> | |
2989 | <p class="code"> | |
98d88c8d MS |
2990 | char *httpDecode64_2(char *out, int *outlen, const char *in);</p> |
2991 | <h4 class="parameters">Parameters</h4> | |
2992 | <table class="list"><tbody> | |
2993 | <tr><th>out</th> | |
2994 | <td class="description">String to write to</td></tr> | |
2995 | <tr><th>outlen</th> | |
2996 | <td class="description">Size of output string</td></tr> | |
2997 | <tr><th>in</th> | |
2998 | <td class="description">String to read from</td></tr> | |
2999 | </tbody></table> | |
798d6e29 MS |
3000 | <h4 class="returnvalue">Return Value</h4> |
3001 | <p class="description">Decoded string</p> | |
98d88c8d MS |
3002 | <h4 class="discussion">Discussion</h4> |
3003 | <p class="discussion">The caller must initialize "outlen" to the maximum size of the decoded | |
65bebeac | 3004 | string before calling <code>httpDecode64_2</code>. On return "outlen" contains the |
98d88c8d MS |
3005 | decoded length of the string. |
3006 | ||
3007 | </p> | |
798d6e29 MS |
3008 | <h3 class="function"><a id="httpDelete">httpDelete</a></h3> |
3009 | <p class="description">Send a DELETE request to the server.</p> | |
3010 | <p class="code"> | |
98d88c8d | 3011 | int httpDelete(<a href="#http_t">http_t</a> *http, const char *uri);</p> |
798d6e29 | 3012 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3013 | <table class="list"><tbody> |
3014 | <tr><th>http</th> | |
3015 | <td class="description">HTTP connection</td></tr> | |
3016 | <tr><th>uri</th> | |
3017 | <td class="description">URI to delete</td></tr> | |
3018 | </tbody></table> | |
798d6e29 MS |
3019 | <h4 class="returnvalue">Return Value</h4> |
3020 | <p class="description">Status of call (0 = success)</p> | |
798d6e29 MS |
3021 | <h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="httpEncode64_2">httpEncode64_2</a></h3> |
3022 | <p class="description">Base64-encode a string.</p> | |
3023 | <p class="code"> | |
98d88c8d MS |
3024 | char *httpEncode64_2(char *out, int outlen, const char *in, int inlen);</p> |
3025 | <h4 class="parameters">Parameters</h4> | |
3026 | <table class="list"><tbody> | |
3027 | <tr><th>out</th> | |
3028 | <td class="description">String to write to</td></tr> | |
3029 | <tr><th>outlen</th> | |
3030 | <td class="description">Maximum size of output string</td></tr> | |
3031 | <tr><th>in</th> | |
3032 | <td class="description">String to read from</td></tr> | |
3033 | <tr><th>inlen</th> | |
3034 | <td class="description">Size of input string</td></tr> | |
3035 | </tbody></table> | |
798d6e29 MS |
3036 | <h4 class="returnvalue">Return Value</h4> |
3037 | <p class="description">Encoded string</p> | |
3038 | <h3 class="function"><a id="httpEncryption">httpEncryption</a></h3> | |
3039 | <p class="description">Set the required encryption on the link.</p> | |
3040 | <p class="code"> | |
98d88c8d | 3041 | int httpEncryption(<a href="#http_t">http_t</a> *http, <a href="#http_encryption_t">http_encryption_t</a> e);</p> |
798d6e29 | 3042 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3043 | <table class="list"><tbody> |
3044 | <tr><th>http</th> | |
3045 | <td class="description">HTTP connection</td></tr> | |
3046 | <tr><th>e</th> | |
3047 | <td class="description">New encryption preference</td></tr> | |
3048 | </tbody></table> | |
798d6e29 MS |
3049 | <h4 class="returnvalue">Return Value</h4> |
3050 | <p class="description">-1 on error, 0 on success</p> | |
3051 | <h3 class="function"><a id="httpError">httpError</a></h3> | |
3052 | <p class="description">Get the last error on a connection.</p> | |
3053 | <p class="code"> | |
98d88c8d | 3054 | int httpError(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3055 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3056 | <table class="list"><tbody> |
3057 | <tr><th>http</th> | |
3058 | <td class="description">HTTP connection</td></tr> | |
3059 | </tbody></table> | |
798d6e29 MS |
3060 | <h4 class="returnvalue">Return Value</h4> |
3061 | <p class="description">Error code (errno) value</p> | |
3062 | <h3 class="function"><a id="httpFieldValue">httpFieldValue</a></h3> | |
3063 | <p class="description">Return the HTTP field enumeration value for a field | |
3064 | name.</p> | |
3065 | <p class="code"> | |
98d88c8d | 3066 | <a href="#http_field_t">http_field_t</a> httpFieldValue(const char *name);</p> |
798d6e29 | 3067 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3068 | <table class="list"><tbody> |
3069 | <tr><th>name</th> | |
3070 | <td class="description">String name</td></tr> | |
3071 | </tbody></table> | |
798d6e29 MS |
3072 | <h4 class="returnvalue">Return Value</h4> |
3073 | <p class="description">Field index</p> | |
3074 | <h3 class="function"><a id="httpFlush">httpFlush</a></h3> | |
65bebeac | 3075 | <p class="description">Flush data read from a HTTP connection.</p> |
798d6e29 | 3076 | <p class="code"> |
98d88c8d | 3077 | void httpFlush(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3078 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3079 | <table class="list"><tbody> |
3080 | <tr><th>http</th> | |
3081 | <td class="description">HTTP connection</td></tr> | |
3082 | </tbody></table> | |
798d6e29 | 3083 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpFlushWrite">httpFlushWrite</a></h3> |
65bebeac | 3084 | <p class="description">Flush data written to a HTTP connection.</p> |
798d6e29 | 3085 | <p class="code"> |
98d88c8d | 3086 | int httpFlushWrite(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3087 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3088 | <table class="list"><tbody> |
3089 | <tr><th>http</th> | |
3090 | <td class="description">HTTP connection</td></tr> | |
3091 | </tbody></table> | |
798d6e29 MS |
3092 | <h4 class="returnvalue">Return Value</h4> |
3093 | <p class="description">Bytes written or -1 on error</p> | |
3094 | <h3 class="function"><a id="httpFreeCredentials">httpFreeCredentials</a></h3> | |
98d88c8d | 3095 | <p class="description">Free an array of credentials.</p> |
798d6e29 | 3096 | <p class="code"> |
98d88c8d | 3097 | void httpFreeCredentials(cups_array_t *credentials);</p> |
798d6e29 | 3098 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3099 | <table class="list"><tbody> |
3100 | <tr><th>credentials</th> | |
3101 | <td class="description">Array of credentials</td></tr> | |
3102 | </tbody></table> | |
798d6e29 MS |
3103 | <h3 class="function"><a id="httpGet">httpGet</a></h3> |
3104 | <p class="description">Send a GET request to the server.</p> | |
3105 | <p class="code"> | |
98d88c8d | 3106 | int httpGet(<a href="#http_t">http_t</a> *http, const char *uri);</p> |
798d6e29 | 3107 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3108 | <table class="list"><tbody> |
3109 | <tr><th>http</th> | |
3110 | <td class="description">HTTP connection</td></tr> | |
3111 | <tr><th>uri</th> | |
3112 | <td class="description">URI to get</td></tr> | |
3113 | </tbody></table> | |
798d6e29 MS |
3114 | <h4 class="returnvalue">Return Value</h4> |
3115 | <p class="description">Status of call (0 = success)</p> | |
3116 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetActivity">httpGetActivity</a></h3> | |
3117 | <p class="description">Get the most recent activity for a connection.</p> | |
3118 | <p class="code"> | |
98d88c8d | 3119 | time_t httpGetActivity(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3120 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3121 | <table class="list"><tbody> |
3122 | <tr><th>http</th> | |
3123 | <td class="description">HTTP connection</td></tr> | |
3124 | </tbody></table> | |
798d6e29 MS |
3125 | <h4 class="returnvalue">Return Value</h4> |
3126 | <p class="description">Time of last read or write</p> | |
3127 | <h4 class="discussion">Discussion</h4> | |
65bebeac | 3128 | <p class="discussion">The return value is the time in seconds of the last read or write. |
798d6e29 MS |
3129 | |
3130 | </p> | |
3131 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetAddress">httpGetAddress</a></h3> | |
3132 | <p class="description">Get the address of the connected peer of a connection.</p> | |
3133 | <p class="code"> | |
98d88c8d | 3134 | <a href="#http_addr_t">http_addr_t</a> *httpGetAddress(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3135 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3136 | <table class="list"><tbody> |
3137 | <tr><th>http</th> | |
3138 | <td class="description">HTTP connection</td></tr> | |
3139 | </tbody></table> | |
798d6e29 MS |
3140 | <h4 class="returnvalue">Return Value</h4> |
3141 | <p class="description">Connected address or <code>NULL</code></p> | |
3142 | <h4 class="discussion">Discussion</h4> | |
65bebeac MS |
3143 | <p class="discussion">For connections created with <a href="#httpConnect2"><code>httpConnect2</code></a>, the address is for the |
3144 | server. For connections created with <a href="#httpAccept"><code>httpAccept</code></a>, the address is for | |
3145 | the client.<br> | |
3146 | <br> | |
3147 | Returns <code>NULL</code> if the socket is currently unconnected. | |
798d6e29 MS |
3148 | |
3149 | </p> | |
3150 | <h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="httpGetAuthString">httpGetAuthString</a></h3> | |
3151 | <p class="description">Get the current authorization string.</p> | |
3152 | <p class="code"> | |
98d88c8d | 3153 | char *httpGetAuthString(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3154 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3155 | <table class="list"><tbody> |
3156 | <tr><th>http</th> | |
3157 | <td class="description">HTTP connection</td></tr> | |
3158 | </tbody></table> | |
798d6e29 MS |
3159 | <h4 class="returnvalue">Return Value</h4> |
3160 | <p class="description">Authorization string</p> | |
3161 | <h4 class="discussion">Discussion</h4> | |
65bebeac MS |
3162 | <p class="discussion">The authorization string is set by <a href="#cupsDoAuthentication"><code>cupsDoAuthentication</code></a> and |
3163 | <a href="#httpSetAuthString"><code>httpSetAuthString</code></a>. Use <a href="#httpGetAuthString"><code>httpGetAuthString</code></a> to retrieve the | |
3164 | string to use with <a href="#httpSetField"><code>httpSetField</code></a> for the | |
3165 | <code>HTTP_FIELD_AUTHORIZATION</code> value. | |
798d6e29 MS |
3166 | |
3167 | </p> | |
3168 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetBlocking">httpGetBlocking</a></h3> | |
3169 | <p class="description">Get the blocking/non-block state of a connection.</p> | |
3170 | <p class="code"> | |
98d88c8d | 3171 | int httpGetBlocking(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3172 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3173 | <table class="list"><tbody> |
3174 | <tr><th>http</th> | |
3175 | <td class="description">HTTP connection</td></tr> | |
3176 | </tbody></table> | |
798d6e29 MS |
3177 | <h4 class="returnvalue">Return Value</h4> |
3178 | <p class="description">1 if blocking, 0 if non-blocking</p> | |
3179 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpGetContentEncoding">httpGetContentEncoding</a></h3> | |
3180 | <p class="description">Get a common content encoding, if any, between | |
3181 | the client and server.</p> | |
3182 | <p class="code"> | |
98d88c8d | 3183 | const char *httpGetContentEncoding(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3184 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3185 | <table class="list"><tbody> |
3186 | <tr><th>http</th> | |
3187 | <td class="description">HTTP connection</td></tr> | |
3188 | </tbody></table> | |
798d6e29 MS |
3189 | <h4 class="returnvalue">Return Value</h4> |
3190 | <p class="description">Content-Coding value or | |
3191 | <code>NULL</code> for the identity | |
3192 | coding.</p> | |
3193 | <h4 class="discussion">Discussion</h4> | |
3194 | <p class="discussion">This function uses the value of the Accepts-Encoding HTTP header and must be | |
3195 | called after receiving a response from the server or a request from the | |
3196 | client. The value returned can be use in subsequent requests (for clients) | |
3197 | or in the response (for servers) in order to compress the content stream. | |
3198 | ||
3199 | </p> | |
3200 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="httpGetCookie">httpGetCookie</a></h3> | |
3201 | <p class="description">Get any cookie data from the response.</p> | |
3202 | <p class="code"> | |
98d88c8d | 3203 | const char *httpGetCookie(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3204 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3205 | <table class="list"><tbody> |
3206 | <tr><th>http</th> | |
3207 | <td class="description">HTTP connection</td></tr> | |
3208 | </tbody></table> | |
798d6e29 | 3209 | <h4 class="returnvalue">Return Value</h4> |
65bebeac | 3210 | <p class="description">Cookie data or <code>NULL</code></p> |
798d6e29 MS |
3211 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetDateString2">httpGetDateString2</a></h3> |
3212 | <p class="description">Get a formatted date/time string from a time value.</p> | |
3213 | <p class="code"> | |
98d88c8d MS |
3214 | const char *httpGetDateString2(time_t t, char *s, int slen);</p> |
3215 | <h4 class="parameters">Parameters</h4> | |
3216 | <table class="list"><tbody> | |
3217 | <tr><th>t</th> | |
65bebeac | 3218 | <td class="description">Time in seconds</td></tr> |
98d88c8d MS |
3219 | <tr><th>s</th> |
3220 | <td class="description">String buffer</td></tr> | |
3221 | <tr><th>slen</th> | |
3222 | <td class="description">Size of string buffer</td></tr> | |
3223 | </tbody></table> | |
798d6e29 MS |
3224 | <h4 class="returnvalue">Return Value</h4> |
3225 | <p class="description">Date/time string</p> | |
3226 | <h3 class="function"><a id="httpGetDateTime">httpGetDateTime</a></h3> | |
3227 | <p class="description">Get a time value from a formatted date/time string.</p> | |
3228 | <p class="code"> | |
98d88c8d | 3229 | time_t httpGetDateTime(const char *s);</p> |
798d6e29 | 3230 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3231 | <table class="list"><tbody> |
3232 | <tr><th>s</th> | |
3233 | <td class="description">Date/time string</td></tr> | |
3234 | </tbody></table> | |
798d6e29 | 3235 | <h4 class="returnvalue">Return Value</h4> |
65bebeac | 3236 | <p class="description">Time in seconds</p> |
798d6e29 MS |
3237 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetEncryption">httpGetEncryption</a></h3> |
3238 | <p class="description">Get the current encryption mode of a connection.</p> | |
3239 | <p class="code"> | |
98d88c8d | 3240 | <a href="#http_encryption_t">http_encryption_t</a> httpGetEncryption(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3241 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3242 | <table class="list"><tbody> |
3243 | <tr><th>http</th> | |
3244 | <td class="description">HTTP connection</td></tr> | |
3245 | </tbody></table> | |
798d6e29 MS |
3246 | <h4 class="returnvalue">Return Value</h4> |
3247 | <p class="description">Current encryption mode</p> | |
3248 | <h4 class="discussion">Discussion</h4> | |
3249 | <p class="discussion">This function returns the encryption mode for the connection. Use the | |
3250 | <a href="#httpIsEncrypted"><code>httpIsEncrypted</code></a> function to determine whether a TLS session has | |
3251 | been established. | |
3252 | ||
3253 | </p> | |
3254 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpGetExpect">httpGetExpect</a></h3> | |
3255 | <p class="description">Get the value of the Expect header, if any.</p> | |
3256 | <p class="code"> | |
98d88c8d | 3257 | http_status_t httpGetExpect(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3258 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3259 | <table class="list"><tbody> |
3260 | <tr><th>http</th> | |
3261 | <td class="description">HTTP connection</td></tr> | |
3262 | </tbody></table> | |
798d6e29 MS |
3263 | <h4 class="returnvalue">Return Value</h4> |
3264 | <p class="description">Expect: status, if any</p> | |
3265 | <h4 class="discussion">Discussion</h4> | |
3266 | <p class="discussion">Returns <code>HTTP_STATUS_NONE</code> if there is no Expect header, otherwise | |
3267 | returns the expected HTTP status code, typically <code>HTTP_STATUS_CONTINUE</code>. | |
3268 | ||
3269 | </p> | |
3270 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetFd">httpGetFd</a></h3> | |
3271 | <p class="description">Get the file descriptor associated with a connection.</p> | |
3272 | <p class="code"> | |
98d88c8d | 3273 | int httpGetFd(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3274 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3275 | <table class="list"><tbody> |
3276 | <tr><th>http</th> | |
3277 | <td class="description">HTTP connection</td></tr> | |
3278 | </tbody></table> | |
798d6e29 MS |
3279 | <h4 class="returnvalue">Return Value</h4> |
3280 | <p class="description">File descriptor or -1 if none</p> | |
3281 | <h3 class="function"><a id="httpGetField">httpGetField</a></h3> | |
3282 | <p class="description">Get a field value from a request/response.</p> | |
3283 | <p class="code"> | |
98d88c8d | 3284 | const char *httpGetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field);</p> |
798d6e29 | 3285 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3286 | <table class="list"><tbody> |
3287 | <tr><th>http</th> | |
3288 | <td class="description">HTTP connection</td></tr> | |
3289 | <tr><th>field</th> | |
3290 | <td class="description">Field to get</td></tr> | |
3291 | </tbody></table> | |
798d6e29 MS |
3292 | <h4 class="returnvalue">Return Value</h4> |
3293 | <p class="description">Field value</p> | |
798d6e29 MS |
3294 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetHostname">httpGetHostname</a></h3> |
3295 | <p class="description">Get the FQDN for the connection or local system.</p> | |
3296 | <p class="code"> | |
98d88c8d MS |
3297 | const char *httpGetHostname(<a href="#http_t">http_t</a> *http, char *s, int slen);</p> |
3298 | <h4 class="parameters">Parameters</h4> | |
3299 | <table class="list"><tbody> | |
3300 | <tr><th>http</th> | |
3301 | <td class="description">HTTP connection or NULL</td></tr> | |
3302 | <tr><th>s</th> | |
3303 | <td class="description">String buffer for name</td></tr> | |
3304 | <tr><th>slen</th> | |
3305 | <td class="description">Size of buffer</td></tr> | |
3306 | </tbody></table> | |
798d6e29 MS |
3307 | <h4 class="returnvalue">Return Value</h4> |
3308 | <p class="description">FQDN for connection or system</p> | |
3309 | <h4 class="discussion">Discussion</h4> | |
3310 | <p class="discussion">When "http" points to a connected socket, return the hostname or | |
3311 | address that was used in the call to httpConnect() or httpConnectEncrypt(), | |
3312 | or the address of the client for the connection from httpAcceptConnection(). | |
3313 | Otherwise, return the FQDN for the local system using both gethostname() | |
3314 | and gethostbyname() to get the local hostname with domain. | |
3315 | ||
3316 | </p> | |
3317 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetKeepAlive">httpGetKeepAlive</a></h3> | |
3318 | <p class="description">Get the current Keep-Alive state of the connection.</p> | |
3319 | <p class="code"> | |
98d88c8d | 3320 | <a href="#http_keepalive_t">http_keepalive_t</a> httpGetKeepAlive(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3321 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3322 | <table class="list"><tbody> |
3323 | <tr><th>http</th> | |
3324 | <td class="description">HTTP connection</td></tr> | |
3325 | </tbody></table> | |
798d6e29 MS |
3326 | <h4 class="returnvalue">Return Value</h4> |
3327 | <p class="description">Keep-Alive state</p> | |
798d6e29 MS |
3328 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetLength2">httpGetLength2</a></h3> |
3329 | <p class="description">Get the amount of data remaining from the | |
3330 | content-length or transfer-encoding fields.</p> | |
3331 | <p class="code"> | |
98d88c8d | 3332 | off_t httpGetLength2(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3333 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3334 | <table class="list"><tbody> |
3335 | <tr><th>http</th> | |
3336 | <td class="description">HTTP connection</td></tr> | |
3337 | </tbody></table> | |
798d6e29 MS |
3338 | <h4 class="returnvalue">Return Value</h4> |
3339 | <p class="description">Content length</p> | |
3340 | <h4 class="discussion">Discussion</h4> | |
3341 | <p class="discussion">This function returns the complete content length, even for | |
3342 | content larger than 2^31 - 1. | |
3343 | ||
3344 | </p> | |
3345 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetPending">httpGetPending</a></h3> | |
3346 | <p class="description">Get the number of bytes that are buffered for writing.</p> | |
3347 | <p class="code"> | |
98d88c8d | 3348 | size_t httpGetPending(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3349 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3350 | <table class="list"><tbody> |
3351 | <tr><th>http</th> | |
3352 | <td class="description">HTTP connection</td></tr> | |
3353 | </tbody></table> | |
798d6e29 MS |
3354 | <h4 class="returnvalue">Return Value</h4> |
3355 | <p class="description">Number of bytes buffered</p> | |
3356 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetReady">httpGetReady</a></h3> | |
3357 | <p class="description">Get the number of bytes that can be read without blocking.</p> | |
3358 | <p class="code"> | |
98d88c8d | 3359 | size_t httpGetReady(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3360 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3361 | <table class="list"><tbody> |
3362 | <tr><th>http</th> | |
3363 | <td class="description">HTTP connection</td></tr> | |
3364 | </tbody></table> | |
798d6e29 MS |
3365 | <h4 class="returnvalue">Return Value</h4> |
3366 | <p class="description">Number of bytes available</p> | |
3367 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetRemaining">httpGetRemaining</a></h3> | |
3368 | <p class="description">Get the number of remaining bytes in the message | |
3369 | body or current chunk.</p> | |
3370 | <p class="code"> | |
98d88c8d | 3371 | size_t httpGetRemaining(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3372 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3373 | <table class="list"><tbody> |
3374 | <tr><th>http</th> | |
3375 | <td class="description">HTTP connection</td></tr> | |
3376 | </tbody></table> | |
798d6e29 MS |
3377 | <h4 class="returnvalue">Return Value</h4> |
3378 | <p class="description">Remaining bytes</p> | |
3379 | <h4 class="discussion">Discussion</h4> | |
3380 | <p class="discussion">The <a href="#httpIsChunked"><code>httpIsChunked</code></a> function can be used to determine whether the | |
3381 | message body is chunked or fixed-length. | |
3382 | ||
3383 | </p> | |
3384 | <h3 class="function"><a id="httpGetState">httpGetState</a></h3> | |
3385 | <p class="description">Get the current state of the HTTP request.</p> | |
3386 | <p class="code"> | |
98d88c8d | 3387 | <a href="#http_state_t">http_state_t</a> httpGetState(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3388 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3389 | <table class="list"><tbody> |
3390 | <tr><th>http</th> | |
3391 | <td class="description">HTTP connection</td></tr> | |
3392 | </tbody></table> | |
798d6e29 MS |
3393 | <h4 class="returnvalue">Return Value</h4> |
3394 | <p class="description">HTTP state</p> | |
3395 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetStatus">httpGetStatus</a></h3> | |
3396 | <p class="description">Get the status of the last HTTP request.</p> | |
3397 | <p class="code"> | |
98d88c8d | 3398 | http_status_t httpGetStatus(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3399 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3400 | <table class="list"><tbody> |
3401 | <tr><th>http</th> | |
3402 | <td class="description">HTTP connection</td></tr> | |
3403 | </tbody></table> | |
798d6e29 MS |
3404 | <h4 class="returnvalue">Return Value</h4> |
3405 | <p class="description">HTTP status</p> | |
798d6e29 MS |
3406 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetSubField2">httpGetSubField2</a></h3> |
3407 | <p class="description">Get a sub-field value.</p> | |
3408 | <p class="code"> | |
98d88c8d MS |
3409 | char *httpGetSubField2(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *name, char *value, int valuelen);</p> |
3410 | <h4 class="parameters">Parameters</h4> | |
3411 | <table class="list"><tbody> | |
3412 | <tr><th>http</th> | |
3413 | <td class="description">HTTP connection</td></tr> | |
3414 | <tr><th>field</th> | |
3415 | <td class="description">Field index</td></tr> | |
3416 | <tr><th>name</th> | |
3417 | <td class="description">Name of sub-field</td></tr> | |
3418 | <tr><th>value</th> | |
3419 | <td class="description">Value string</td></tr> | |
3420 | <tr><th>valuelen</th> | |
3421 | <td class="description">Size of value buffer</td></tr> | |
3422 | </tbody></table> | |
798d6e29 | 3423 | <h4 class="returnvalue">Return Value</h4> |
65bebeac | 3424 | <p class="description">Value or <code>NULL</code></p> |
798d6e29 MS |
3425 | <h3 class="function"><a id="httpGetVersion">httpGetVersion</a></h3> |
3426 | <p class="description">Get the HTTP version at the other end.</p> | |
3427 | <p class="code"> | |
98d88c8d | 3428 | <a href="#http_version_t">http_version_t</a> httpGetVersion(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3429 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3430 | <table class="list"><tbody> |
3431 | <tr><th>http</th> | |
3432 | <td class="description">HTTP connection</td></tr> | |
3433 | </tbody></table> | |
798d6e29 MS |
3434 | <h4 class="returnvalue">Return Value</h4> |
3435 | <p class="description">Version number</p> | |
3436 | <h3 class="function"><a id="httpGets">httpGets</a></h3> | |
3437 | <p class="description">Get a line of text from a HTTP connection.</p> | |
3438 | <p class="code"> | |
98d88c8d MS |
3439 | char *httpGets(char *line, int length, <a href="#http_t">http_t</a> *http);</p> |
3440 | <h4 class="parameters">Parameters</h4> | |
3441 | <table class="list"><tbody> | |
3442 | <tr><th>line</th> | |
3443 | <td class="description">Line to read into</td></tr> | |
3444 | <tr><th>length</th> | |
3445 | <td class="description">Max length of buffer</td></tr> | |
3446 | <tr><th>http</th> | |
3447 | <td class="description">HTTP connection</td></tr> | |
3448 | </tbody></table> | |
798d6e29 | 3449 | <h4 class="returnvalue">Return Value</h4> |
65bebeac | 3450 | <p class="description">Line or <code>NULL</code></p> |
798d6e29 MS |
3451 | <h3 class="function"><a id="httpHead">httpHead</a></h3> |
3452 | <p class="description">Send a HEAD request to the server.</p> | |
3453 | <p class="code"> | |
98d88c8d | 3454 | int httpHead(<a href="#http_t">http_t</a> *http, const char *uri);</p> |
798d6e29 | 3455 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3456 | <table class="list"><tbody> |
3457 | <tr><th>http</th> | |
3458 | <td class="description">HTTP connection</td></tr> | |
3459 | <tr><th>uri</th> | |
3460 | <td class="description">URI for head</td></tr> | |
3461 | </tbody></table> | |
798d6e29 MS |
3462 | <h4 class="returnvalue">Return Value</h4> |
3463 | <p class="description">Status of call (0 = success)</p> | |
3464 | <h3 class="function"><a id="httpInitialize">httpInitialize</a></h3> | |
53af7f21 MS |
3465 | <p class="description">Initialize the HTTP interface library and set the |
3466 | default HTTP proxy (if any).</p> | |
98d88c8d MS |
3467 | <p class="code"> |
3468 | void httpInitialize(void);</p> | |
798d6e29 MS |
3469 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpIsChunked">httpIsChunked</a></h3> |
3470 | <p class="description">Report whether a message body is chunked.</p> | |
3471 | <p class="code"> | |
98d88c8d | 3472 | int httpIsChunked(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3473 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3474 | <table class="list"><tbody> |
3475 | <tr><th>http</th> | |
3476 | <td class="description">HTTP connection</td></tr> | |
3477 | </tbody></table> | |
798d6e29 MS |
3478 | <h4 class="returnvalue">Return Value</h4> |
3479 | <p class="description">1 if chunked, 0 if not</p> | |
3480 | <h4 class="discussion">Discussion</h4> | |
3481 | <p class="discussion">This function returns non-zero if the message body is composed of | |
3482 | variable-length chunks. | |
3483 | ||
3484 | </p> | |
3485 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpIsEncrypted">httpIsEncrypted</a></h3> | |
3486 | <p class="description">Report whether a connection is encrypted.</p> | |
3487 | <p class="code"> | |
98d88c8d | 3488 | int httpIsEncrypted(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3489 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3490 | <table class="list"><tbody> |
3491 | <tr><th>http</th> | |
3492 | <td class="description">HTTP connection</td></tr> | |
3493 | </tbody></table> | |
798d6e29 MS |
3494 | <h4 class="returnvalue">Return Value</h4> |
3495 | <p class="description">1 if encrypted, 0 if not</p> | |
3496 | <h4 class="discussion">Discussion</h4> | |
3497 | <p class="discussion">This function returns non-zero if the connection is currently encrypted. | |
3498 | ||
3499 | </p> | |
3500 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpLoadCredentials">httpLoadCredentials</a></h3> | |
3501 | <p class="description">Load X.509 credentials from a keychain file.</p> | |
3502 | <p class="code"> | |
98d88c8d MS |
3503 | int httpLoadCredentials(const char *path, cups_array_t **credentials, const char *common_name);</p> |
3504 | <h4 class="parameters">Parameters</h4> | |
3505 | <table class="list"><tbody> | |
3506 | <tr><th>path</th> | |
3507 | <td class="description">Keychain path or <code>NULL</code> for default</td></tr> | |
3508 | <tr><th>credentials</th> | |
3509 | <td class="description">Credentials</td></tr> | |
3510 | <tr><th>common_name</th> | |
3511 | <td class="description">Common name for credentials</td></tr> | |
3512 | </tbody></table> | |
798d6e29 MS |
3513 | <h4 class="returnvalue">Return Value</h4> |
3514 | <p class="description">0 on success, -1 on error</p> | |
3515 | <h3 class="function"><a id="httpOptions">httpOptions</a></h3> | |
3516 | <p class="description">Send an OPTIONS request to the server.</p> | |
3517 | <p class="code"> | |
98d88c8d | 3518 | int httpOptions(<a href="#http_t">http_t</a> *http, const char *uri);</p> |
798d6e29 | 3519 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3520 | <table class="list"><tbody> |
3521 | <tr><th>http</th> | |
3522 | <td class="description">HTTP connection</td></tr> | |
3523 | <tr><th>uri</th> | |
3524 | <td class="description">URI for options</td></tr> | |
3525 | </tbody></table> | |
798d6e29 MS |
3526 | <h4 class="returnvalue">Return Value</h4> |
3527 | <p class="description">Status of call (0 = success)</p> | |
3528 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpPeek">httpPeek</a></h3> | |
3529 | <p class="description">Peek at data from a HTTP connection.</p> | |
3530 | <p class="code"> | |
98d88c8d MS |
3531 | ssize_t httpPeek(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p> |
3532 | <h4 class="parameters">Parameters</h4> | |
3533 | <table class="list"><tbody> | |
3534 | <tr><th>http</th> | |
3535 | <td class="description">HTTP connection</td></tr> | |
3536 | <tr><th>buffer</th> | |
3537 | <td class="description">Buffer for data</td></tr> | |
3538 | <tr><th>length</th> | |
3539 | <td class="description">Maximum number of bytes</td></tr> | |
3540 | </tbody></table> | |
798d6e29 MS |
3541 | <h4 class="returnvalue">Return Value</h4> |
3542 | <p class="description">Number of bytes copied</p> | |
3543 | <h4 class="discussion">Discussion</h4> | |
3544 | <p class="discussion">This function copies available data from the given HTTP connection, reading | |
3545 | a buffer as needed. The data is still available for reading using | |
65bebeac | 3546 | <a href="#httpRead2"><code>httpRead2</code></a>.<br> |
798d6e29 MS |
3547 | <br> |
3548 | For non-blocking connections the usual timeouts apply. | |
3549 | ||
3550 | </p> | |
3551 | <h3 class="function"><a id="httpPost">httpPost</a></h3> | |
3552 | <p class="description">Send a POST request to the server.</p> | |
3553 | <p class="code"> | |
98d88c8d | 3554 | int httpPost(<a href="#http_t">http_t</a> *http, const char *uri);</p> |
798d6e29 | 3555 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3556 | <table class="list"><tbody> |
3557 | <tr><th>http</th> | |
3558 | <td class="description">HTTP connection</td></tr> | |
3559 | <tr><th>uri</th> | |
3560 | <td class="description">URI for post</td></tr> | |
3561 | </tbody></table> | |
798d6e29 MS |
3562 | <h4 class="returnvalue">Return Value</h4> |
3563 | <p class="description">Status of call (0 = success)</p> | |
3564 | <h3 class="function"><a id="httpPut">httpPut</a></h3> | |
3565 | <p class="description">Send a PUT request to the server.</p> | |
3566 | <p class="code"> | |
98d88c8d | 3567 | int httpPut(<a href="#http_t">http_t</a> *http, const char *uri);</p> |
798d6e29 | 3568 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3569 | <table class="list"><tbody> |
3570 | <tr><th>http</th> | |
3571 | <td class="description">HTTP connection</td></tr> | |
3572 | <tr><th>uri</th> | |
3573 | <td class="description">URI to put</td></tr> | |
3574 | </tbody></table> | |
798d6e29 MS |
3575 | <h4 class="returnvalue">Return Value</h4> |
3576 | <p class="description">Status of call (0 = success)</p> | |
798d6e29 MS |
3577 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpRead2">httpRead2</a></h3> |
3578 | <p class="description">Read data from a HTTP connection.</p> | |
3579 | <p class="code"> | |
98d88c8d MS |
3580 | ssize_t httpRead2(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p> |
3581 | <h4 class="parameters">Parameters</h4> | |
3582 | <table class="list"><tbody> | |
3583 | <tr><th>http</th> | |
3584 | <td class="description">HTTP connection</td></tr> | |
3585 | <tr><th>buffer</th> | |
3586 | <td class="description">Buffer for data</td></tr> | |
3587 | <tr><th>length</th> | |
3588 | <td class="description">Maximum number of bytes</td></tr> | |
3589 | </tbody></table> | |
798d6e29 MS |
3590 | <h4 class="returnvalue">Return Value</h4> |
3591 | <p class="description">Number of bytes read</p> | |
3592 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpReadRequest">httpReadRequest</a></h3> | |
3593 | <p class="description">Read a HTTP request from a connection.</p> | |
3594 | <p class="code"> | |
98d88c8d MS |
3595 | <a href="#http_state_t">http_state_t</a> httpReadRequest(<a href="#http_t">http_t</a> *http, char *uri, size_t urilen);</p> |
3596 | <h4 class="parameters">Parameters</h4> | |
3597 | <table class="list"><tbody> | |
3598 | <tr><th>http</th> | |
3599 | <td class="description">HTTP connection</td></tr> | |
3600 | <tr><th>uri</th> | |
3601 | <td class="description">URI buffer</td></tr> | |
3602 | <tr><th>urilen</th> | |
3603 | <td class="description">Size of URI buffer</td></tr> | |
3604 | </tbody></table> | |
798d6e29 MS |
3605 | <h4 class="returnvalue">Return Value</h4> |
3606 | <p class="description">New state of connection</p> | |
798d6e29 MS |
3607 | <h3 class="function"><a id="httpReconnect2">httpReconnect2</a></h3> |
3608 | <p class="description">Reconnect to a HTTP server with timeout and optional | |
3609 | cancel.</p> | |
3610 | <p class="code"> | |
98d88c8d MS |
3611 | int httpReconnect2(<a href="#http_t">http_t</a> *http, int msec, int *cancel);</p> |
3612 | <h4 class="parameters">Parameters</h4> | |
3613 | <table class="list"><tbody> | |
3614 | <tr><th>http</th> | |
3615 | <td class="description">HTTP connection</td></tr> | |
3616 | <tr><th>msec</th> | |
3617 | <td class="description">Timeout in milliseconds</td></tr> | |
3618 | <tr><th>cancel</th> | |
3619 | <td class="description">Pointer to "cancel" variable</td></tr> | |
3620 | </tbody></table> | |
798d6e29 MS |
3621 | <h4 class="returnvalue">Return Value</h4> |
3622 | <p class="description">0 on success, non-zero on failure</p> | |
3623 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpResolveHostname">httpResolveHostname</a></h3> | |
3624 | <p class="description">Resolve the hostname of the HTTP connection | |
3625 | address.</p> | |
3626 | <p class="code"> | |
98d88c8d MS |
3627 | const char *httpResolveHostname(<a href="#http_t">http_t</a> *http, char *buffer, size_t bufsize);</p> |
3628 | <h4 class="parameters">Parameters</h4> | |
3629 | <table class="list"><tbody> | |
3630 | <tr><th>http</th> | |
3631 | <td class="description">HTTP connection</td></tr> | |
3632 | <tr><th>buffer</th> | |
3633 | <td class="description">Hostname buffer</td></tr> | |
3634 | <tr><th>bufsize</th> | |
3635 | <td class="description">Size of buffer</td></tr> | |
3636 | </tbody></table> | |
798d6e29 MS |
3637 | <h4 class="returnvalue">Return Value</h4> |
3638 | <p class="description">Resolved hostname or <code>NULL</code></p> | |
3639 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpSaveCredentials">httpSaveCredentials</a></h3> | |
3640 | <p class="description">Save X.509 credentials to a keychain file.</p> | |
3641 | <p class="code"> | |
98d88c8d MS |
3642 | int httpSaveCredentials(const char *path, cups_array_t *credentials, const char *common_name);</p> |
3643 | <h4 class="parameters">Parameters</h4> | |
3644 | <table class="list"><tbody> | |
3645 | <tr><th>path</th> | |
3646 | <td class="description">Keychain path or <code>NULL</code> for default</td></tr> | |
3647 | <tr><th>credentials</th> | |
3648 | <td class="description">Credentials</td></tr> | |
3649 | <tr><th>common_name</th> | |
3650 | <td class="description">Common name for credentials</td></tr> | |
3651 | </tbody></table> | |
798d6e29 MS |
3652 | <h4 class="returnvalue">Return Value</h4> |
3653 | <p class="description">-1 on error, 0 on success</p> | |
798d6e29 MS |
3654 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpSeparateURI">httpSeparateURI</a></h3> |
3655 | <p class="description">Separate a Universal Resource Identifier into its | |
3656 | components.</p> | |
3657 | <p class="code"> | |
98d88c8d MS |
3658 | <a href="#http_uri_status_t">http_uri_status_t</a> httpSeparateURI(<a href="#http_uri_coding_t">http_uri_coding_t</a> decoding, const char *uri, char *scheme, int schemelen, char *username, int usernamelen, char *host, int hostlen, int *port, char *resource, int resourcelen);</p> |
3659 | <h4 class="parameters">Parameters</h4> | |
3660 | <table class="list"><tbody> | |
3661 | <tr><th>decoding</th> | |
3662 | <td class="description">Decoding flags</td></tr> | |
3663 | <tr><th>uri</th> | |
3664 | <td class="description">Universal Resource Identifier</td></tr> | |
3665 | <tr><th>scheme</th> | |
3666 | <td class="description">Scheme (http, https, etc.)</td></tr> | |
3667 | <tr><th>schemelen</th> | |
3668 | <td class="description">Size of scheme buffer</td></tr> | |
3669 | <tr><th>username</th> | |
3670 | <td class="description">Username</td></tr> | |
3671 | <tr><th>usernamelen</th> | |
3672 | <td class="description">Size of username buffer</td></tr> | |
3673 | <tr><th>host</th> | |
3674 | <td class="description">Hostname</td></tr> | |
3675 | <tr><th>hostlen</th> | |
3676 | <td class="description">Size of hostname buffer</td></tr> | |
3677 | <tr><th>port</th> | |
3678 | <td class="description">Port number to use</td></tr> | |
3679 | <tr><th>resource</th> | |
3680 | <td class="description">Resource/filename</td></tr> | |
3681 | <tr><th>resourcelen</th> | |
3682 | <td class="description">Size of resource buffer</td></tr> | |
3683 | </tbody></table> | |
798d6e29 MS |
3684 | <h4 class="returnvalue">Return Value</h4> |
3685 | <p class="description">Result of separation</p> | |
98d88c8d | 3686 | <h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="httpSetAuthString">httpSetAuthString</a></h3> |
53af7f21 | 3687 | <p class="description">Set the current authorization string.</p> |
98d88c8d MS |
3688 | <p class="code"> |
3689 | void httpSetAuthString(<a href="#http_t">http_t</a> *http, const char *scheme, const char *data);</p> | |
3690 | <h4 class="parameters">Parameters</h4> | |
3691 | <table class="list"><tbody> | |
3692 | <tr><th>http</th> | |
3693 | <td class="description">HTTP connection</td></tr> | |
3694 | <tr><th>scheme</th> | |
3695 | <td class="description">Auth scheme (NULL to clear it)</td></tr> | |
3696 | <tr><th>data</th> | |
3697 | <td class="description">Auth data (NULL for none)</td></tr> | |
3698 | </tbody></table> | |
3699 | <h4 class="discussion">Discussion</h4> | |
798d6e29 | 3700 | <p class="discussion">This function just stores a copy of the current authorization string in |
65bebeac MS |
3701 | the HTTP connection object. You must still call <a href="#httpSetField"><code>httpSetField</code></a> to set |
3702 | <code>HTTP_FIELD_AUTHORIZATION</code> prior to issuing a HTTP request using | |
3703 | <a href="#httpGet"><code>httpGet</code></a>, <a href="#httpHead"><code>httpHead</code></a>, <a href="#httpOptions"><code>httpOptions</code></a>, <a href="#httpPost"><code>httpPost</code></a>, or | |
3704 | <a href="#httpPut"><code>httpPut</code></a>. | |
798d6e29 MS |
3705 | |
3706 | </p> | |
98d88c8d MS |
3707 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="httpSetCookie">httpSetCookie</a></h3> |
3708 | <p class="description">Set the cookie value(s).</p> | |
798d6e29 | 3709 | <p class="code"> |
98d88c8d | 3710 | void httpSetCookie(<a href="#http_t">http_t</a> *http, const char *cookie);</p> |
798d6e29 | 3711 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3712 | <table class="list"><tbody> |
3713 | <tr><th>http</th> | |
3714 | <td class="description">Connection</td></tr> | |
3715 | <tr><th>cookie</th> | |
3716 | <td class="description">Cookie string</td></tr> | |
3717 | </tbody></table> | |
798d6e29 MS |
3718 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="httpSetCredentials">httpSetCredentials</a></h3> |
3719 | <p class="description">Set the credentials associated with an encrypted | |
3720 | connection.</p> | |
3721 | <p class="code"> | |
98d88c8d | 3722 | int httpSetCredentials(<a href="#http_t">http_t</a> *http, cups_array_t *credentials);</p> |
798d6e29 | 3723 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3724 | <table class="list"><tbody> |
3725 | <tr><th>http</th> | |
3726 | <td class="description">HTTP connection</td></tr> | |
3727 | <tr><th>credentials</th> | |
3728 | <td class="description">Array of credentials</td></tr> | |
3729 | </tbody></table> | |
798d6e29 MS |
3730 | <h4 class="returnvalue">Return Value</h4> |
3731 | <p class="description">Status of call (0 = success)</p> | |
98d88c8d | 3732 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpSetDefaultField">httpSetDefaultField</a></h3> |
53af7f21 | 3733 | <p class="description">Set the default value of an HTTP header.</p> |
98d88c8d MS |
3734 | <p class="code"> |
3735 | void httpSetDefaultField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p> | |
3736 | <h4 class="parameters">Parameters</h4> | |
3737 | <table class="list"><tbody> | |
3738 | <tr><th>http</th> | |
3739 | <td class="description">HTTP connection</td></tr> | |
3740 | <tr><th>field</th> | |
3741 | <td class="description">Field index</td></tr> | |
3742 | <tr><th>value</th> | |
3743 | <td class="description">Value</td></tr> | |
3744 | </tbody></table> | |
3745 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
3746 | <p class="discussion">Currently only <code>HTTP_FIELD_ACCEPT_ENCODING</code>, <code>HTTP_FIELD_SERVER</code>, |
3747 | and <code>HTTP_FIELD_USER_AGENT</code> can be set. | |
3748 | ||
3749 | </p> | |
98d88c8d MS |
3750 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpSetExpect">httpSetExpect</a></h3> |
3751 | <p class="description">Set the Expect: header in a request.</p> | |
798d6e29 | 3752 | <p class="code"> |
98d88c8d | 3753 | void httpSetExpect(<a href="#http_t">http_t</a> *http, http_status_t expect);</p> |
798d6e29 | 3754 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3755 | <table class="list"><tbody> |
3756 | <tr><th>http</th> | |
3757 | <td class="description">HTTP connection</td></tr> | |
3758 | <tr><th>expect</th> | |
3759 | <td class="description">HTTP status to expect | |
3760 | (<code>HTTP_STATUS_CONTINUE</code>)</td></tr> | |
3761 | </tbody></table> | |
3762 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
3763 | <p class="discussion">Currently only <code>HTTP_STATUS_CONTINUE</code> is supported for the "expect" |
3764 | argument. | |
3765 | ||
3766 | </p> | |
3767 | <h3 class="function"><a id="httpSetField">httpSetField</a></h3> | |
53af7f21 | 3768 | <p class="description">Set the value of an HTTP header.</p> |
798d6e29 | 3769 | <p class="code"> |
98d88c8d MS |
3770 | void httpSetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p> |
3771 | <h4 class="parameters">Parameters</h4> | |
3772 | <table class="list"><tbody> | |
3773 | <tr><th>http</th> | |
3774 | <td class="description">HTTP connection</td></tr> | |
3775 | <tr><th>field</th> | |
3776 | <td class="description">Field index</td></tr> | |
3777 | <tr><th>value</th> | |
3778 | <td class="description">Value</td></tr> | |
3779 | </tbody></table> | |
3780 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpSetKeepAlive">httpSetKeepAlive</a></h3> | |
53af7f21 | 3781 | <p class="description">Set the current Keep-Alive state of a connection.</p> |
98d88c8d MS |
3782 | <p class="code"> |
3783 | void httpSetKeepAlive(<a href="#http_t">http_t</a> *http, <a href="#http_keepalive_t">http_keepalive_t</a> keep_alive);</p> | |
3784 | <h4 class="parameters">Parameters</h4> | |
3785 | <table class="list"><tbody> | |
3786 | <tr><th>http</th> | |
3787 | <td class="description">HTTP connection</td></tr> | |
3788 | <tr><th>keep_alive</th> | |
3789 | <td class="description">New Keep-Alive value</td></tr> | |
3790 | </tbody></table> | |
3791 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpSetLength">httpSetLength</a></h3> | |
53af7f21 | 3792 | <p class="description">Set the content-length and content-encoding.</p> |
98d88c8d MS |
3793 | <p class="code"> |
3794 | void httpSetLength(<a href="#http_t">http_t</a> *http, size_t length);</p> | |
3795 | <h4 class="parameters">Parameters</h4> | |
3796 | <table class="list"><tbody> | |
3797 | <tr><th>http</th> | |
3798 | <td class="description">HTTP connection</td></tr> | |
3799 | <tr><th>length</th> | |
3800 | <td class="description">Length (0 for chunked)</td></tr> | |
3801 | </tbody></table> | |
3802 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="httpSetTimeout">httpSetTimeout</a></h3> | |
53af7f21 | 3803 | <p class="description">Set read/write timeouts and an optional callback.</p> |
98d88c8d MS |
3804 | <p class="code"> |
3805 | void httpSetTimeout(<a href="#http_t">http_t</a> *http, double timeout, <a href="#http_timeout_cb_t">http_timeout_cb_t</a> cb, void *user_data);</p> | |
3806 | <h4 class="parameters">Parameters</h4> | |
3807 | <table class="list"><tbody> | |
3808 | <tr><th>http</th> | |
3809 | <td class="description">HTTP connection</td></tr> | |
3810 | <tr><th>timeout</th> | |
3811 | <td class="description">Number of seconds for timeout, | |
3812 | must be greater than 0</td></tr> | |
3813 | <tr><th>cb</th> | |
65bebeac | 3814 | <td class="description">Callback function or <code>NULL</code></td></tr> |
98d88c8d MS |
3815 | <tr><th>user_data</th> |
3816 | <td class="description">User data pointer</td></tr> | |
3817 | </tbody></table> | |
3818 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
3819 | <p class="discussion">The optional timeout callback receives both the HTTP connection and a user |
3820 | data pointer and must return 1 to continue or 0 to error (time) out. | |
3821 | ||
3822 | </p> | |
98d88c8d MS |
3823 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpShutdown">httpShutdown</a></h3> |
3824 | <p class="description">Shutdown one side of an HTTP connection.</p> | |
798d6e29 | 3825 | <p class="code"> |
98d88c8d | 3826 | void httpShutdown(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3827 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3828 | <table class="list"><tbody> |
3829 | <tr><th>http</th> | |
3830 | <td class="description">HTTP connection</td></tr> | |
3831 | </tbody></table> | |
798d6e29 MS |
3832 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpStateString">httpStateString</a></h3> |
3833 | <p class="description">Return the string describing a HTTP state value.</p> | |
3834 | <p class="code"> | |
98d88c8d | 3835 | const char *httpStateString(<a href="#http_state_t">http_state_t</a> state);</p> |
798d6e29 | 3836 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3837 | <table class="list"><tbody> |
3838 | <tr><th>state</th> | |
3839 | <td class="description">HTTP state value</td></tr> | |
3840 | </tbody></table> | |
798d6e29 MS |
3841 | <h4 class="returnvalue">Return Value</h4> |
3842 | <p class="description">State string</p> | |
3843 | <h3 class="function"><a id="httpStatus">httpStatus</a></h3> | |
3844 | <p class="description">Return a short string describing a HTTP status code.</p> | |
3845 | <p class="code"> | |
98d88c8d | 3846 | const char *httpStatus(http_status_t status);</p> |
798d6e29 | 3847 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3848 | <table class="list"><tbody> |
3849 | <tr><th>status</th> | |
3850 | <td class="description">HTTP status code</td></tr> | |
3851 | </tbody></table> | |
798d6e29 MS |
3852 | <h4 class="returnvalue">Return Value</h4> |
3853 | <p class="description">Localized status string</p> | |
3854 | <h4 class="discussion">Discussion</h4> | |
3855 | <p class="discussion">The returned string is localized to the current POSIX locale and is based | |
65bebeac | 3856 | on the status strings defined in RFC 7231.</p> |
798d6e29 MS |
3857 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpURIStatusString">httpURIStatusString</a></h3> |
3858 | <p class="description">Return a string describing a URI status code.</p> | |
3859 | <p class="code"> | |
98d88c8d | 3860 | const char *httpURIStatusString(<a href="#http_uri_status_t">http_uri_status_t</a> status);</p> |
798d6e29 | 3861 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3862 | <table class="list"><tbody> |
3863 | <tr><th>status</th> | |
3864 | <td class="description">URI status code</td></tr> | |
3865 | </tbody></table> | |
798d6e29 MS |
3866 | <h4 class="returnvalue">Return Value</h4> |
3867 | <p class="description">Localized status string</p> | |
3868 | <h3 class="function"><a id="httpUpdate">httpUpdate</a></h3> | |
3869 | <p class="description">Update the current HTTP state for incoming data.</p> | |
3870 | <p class="code"> | |
98d88c8d | 3871 | http_status_t httpUpdate(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3872 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3873 | <table class="list"><tbody> |
3874 | <tr><th>http</th> | |
3875 | <td class="description">HTTP connection</td></tr> | |
3876 | </tbody></table> | |
798d6e29 MS |
3877 | <h4 class="returnvalue">Return Value</h4> |
3878 | <p class="description">HTTP status</p> | |
3879 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="httpWait">httpWait</a></h3> | |
3880 | <p class="description">Wait for data available on a connection.</p> | |
3881 | <p class="code"> | |
98d88c8d | 3882 | int httpWait(<a href="#http_t">http_t</a> *http, int msec);</p> |
798d6e29 | 3883 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3884 | <table class="list"><tbody> |
3885 | <tr><th>http</th> | |
3886 | <td class="description">HTTP connection</td></tr> | |
3887 | <tr><th>msec</th> | |
3888 | <td class="description">Milliseconds to wait</td></tr> | |
3889 | </tbody></table> | |
798d6e29 MS |
3890 | <h4 class="returnvalue">Return Value</h4> |
3891 | <p class="description">1 if data is available, 0 otherwise</p> | |
798d6e29 MS |
3892 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpWrite2">httpWrite2</a></h3> |
3893 | <p class="description">Write data to a HTTP connection.</p> | |
3894 | <p class="code"> | |
98d88c8d MS |
3895 | ssize_t httpWrite2(<a href="#http_t">http_t</a> *http, const char *buffer, size_t length);</p> |
3896 | <h4 class="parameters">Parameters</h4> | |
3897 | <table class="list"><tbody> | |
3898 | <tr><th>http</th> | |
3899 | <td class="description">HTTP connection</td></tr> | |
3900 | <tr><th>buffer</th> | |
3901 | <td class="description">Buffer for data</td></tr> | |
3902 | <tr><th>length</th> | |
3903 | <td class="description">Number of bytes to write</td></tr> | |
3904 | </tbody></table> | |
798d6e29 MS |
3905 | <h4 class="returnvalue">Return Value</h4> |
3906 | <p class="description">Number of bytes written</p> | |
3907 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpWriteResponse">httpWriteResponse</a></h3> | |
3908 | <p class="description">Write a HTTP response to a client connection.</p> | |
3909 | <p class="code"> | |
98d88c8d | 3910 | int httpWriteResponse(<a href="#http_t">http_t</a> *http, http_status_t status);</p> |
798d6e29 | 3911 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3912 | <table class="list"><tbody> |
3913 | <tr><th>http</th> | |
3914 | <td class="description">HTTP connection</td></tr> | |
3915 | <tr><th>status</th> | |
3916 | <td class="description">Status code</td></tr> | |
3917 | </tbody></table> | |
798d6e29 MS |
3918 | <h4 class="returnvalue">Return Value</h4> |
3919 | <p class="description">0 on success, -1 on error</p> | |
3920 | <h3 class="function"><a id="ippAddBoolean">ippAddBoolean</a></h3> | |
3921 | <p class="description">Add a boolean attribute to an IPP message.</p> | |
3922 | <p class="code"> | |
98d88c8d MS |
3923 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBoolean(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, char value);</p> |
3924 | <h4 class="parameters">Parameters</h4> | |
3925 | <table class="list"><tbody> | |
3926 | <tr><th>ipp</th> | |
3927 | <td class="description">IPP message</td></tr> | |
3928 | <tr><th>group</th> | |
3929 | <td class="description">IPP group</td></tr> | |
3930 | <tr><th>name</th> | |
3931 | <td class="description">Name of attribute</td></tr> | |
3932 | <tr><th>value</th> | |
3933 | <td class="description">Value of attribute</td></tr> | |
3934 | </tbody></table> | |
798d6e29 MS |
3935 | <h4 class="returnvalue">Return Value</h4> |
3936 | <p class="description">New attribute</p> | |
3937 | <h4 class="discussion">Discussion</h4> | |
3938 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
3939 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
3940 | <br> | |
3941 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
3942 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
3943 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
3944 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
3945 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p> | |
3946 | <h3 class="function"><a id="ippAddBooleans">ippAddBooleans</a></h3> | |
3947 | <p class="description">Add an array of boolean values.</p> | |
3948 | <p class="code"> | |
98d88c8d MS |
3949 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBooleans(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int num_values, const char *values);</p> |
3950 | <h4 class="parameters">Parameters</h4> | |
3951 | <table class="list"><tbody> | |
3952 | <tr><th>ipp</th> | |
3953 | <td class="description">IPP message</td></tr> | |
3954 | <tr><th>group</th> | |
3955 | <td class="description">IPP group</td></tr> | |
3956 | <tr><th>name</th> | |
3957 | <td class="description">Name of attribute</td></tr> | |
3958 | <tr><th>num_values</th> | |
3959 | <td class="description">Number of values</td></tr> | |
3960 | <tr><th>values</th> | |
3961 | <td class="description">Values</td></tr> | |
3962 | </tbody></table> | |
798d6e29 MS |
3963 | <h4 class="returnvalue">Return Value</h4> |
3964 | <p class="description">New attribute</p> | |
3965 | <h4 class="discussion">Discussion</h4> | |
3966 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
3967 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
3968 | <br> | |
3969 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
3970 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
3971 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
3972 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
3973 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p> | |
3974 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippAddCollection">ippAddCollection</a></h3> | |
3975 | <p class="description">Add a collection value.</p> | |
3976 | <p class="code"> | |
98d88c8d MS |
3977 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollection(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, <a href="#ipp_t">ipp_t</a> *value);</p> |
3978 | <h4 class="parameters">Parameters</h4> | |
3979 | <table class="list"><tbody> | |
3980 | <tr><th>ipp</th> | |
3981 | <td class="description">IPP message</td></tr> | |
3982 | <tr><th>group</th> | |
3983 | <td class="description">IPP group</td></tr> | |
3984 | <tr><th>name</th> | |
3985 | <td class="description">Name of attribute</td></tr> | |
3986 | <tr><th>value</th> | |
3987 | <td class="description">Value</td></tr> | |
3988 | </tbody></table> | |
798d6e29 MS |
3989 | <h4 class="returnvalue">Return Value</h4> |
3990 | <p class="description">New attribute</p> | |
3991 | <h4 class="discussion">Discussion</h4> | |
3992 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
3993 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
3994 | <br> | |
3995 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
3996 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
3997 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
3998 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
3999 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>). | |
4000 | ||
4001 | </p> | |
4002 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippAddCollections">ippAddCollections</a></h3> | |
4003 | <p class="description">Add an array of collection values.</p> | |
4004 | <p class="code"> | |
98d88c8d MS |
4005 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollections(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int num_values, const <a href="#ipp_t">ipp_t</a> **values);</p> |
4006 | <h4 class="parameters">Parameters</h4> | |
4007 | <table class="list"><tbody> | |
4008 | <tr><th>ipp</th> | |
4009 | <td class="description">IPP message</td></tr> | |
4010 | <tr><th>group</th> | |
4011 | <td class="description">IPP group</td></tr> | |
4012 | <tr><th>name</th> | |
4013 | <td class="description">Name of attribute</td></tr> | |
4014 | <tr><th>num_values</th> | |
4015 | <td class="description">Number of values</td></tr> | |
4016 | <tr><th>values</th> | |
4017 | <td class="description">Values</td></tr> | |
4018 | </tbody></table> | |
798d6e29 MS |
4019 | <h4 class="returnvalue">Return Value</h4> |
4020 | <p class="description">New attribute</p> | |
4021 | <h4 class="discussion">Discussion</h4> | |
4022 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4023 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
4024 | <br> | |
4025 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4026 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4027 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4028 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4029 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>). | |
4030 | ||
4031 | </p> | |
4032 | <h3 class="function"><a id="ippAddDate">ippAddDate</a></h3> | |
65bebeac | 4033 | <p class="description">Add a dateTime attribute to an IPP message.</p> |
798d6e29 | 4034 | <p class="code"> |
98d88c8d MS |
4035 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddDate(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, const <a href="#ipp_uchar_t">ipp_uchar_t</a> *value);</p> |
4036 | <h4 class="parameters">Parameters</h4> | |
4037 | <table class="list"><tbody> | |
4038 | <tr><th>ipp</th> | |
4039 | <td class="description">IPP message</td></tr> | |
4040 | <tr><th>group</th> | |
4041 | <td class="description">IPP group</td></tr> | |
4042 | <tr><th>name</th> | |
4043 | <td class="description">Name of attribute</td></tr> | |
4044 | <tr><th>value</th> | |
4045 | <td class="description">Value</td></tr> | |
4046 | </tbody></table> | |
798d6e29 MS |
4047 | <h4 class="returnvalue">Return Value</h4> |
4048 | <p class="description">New attribute</p> | |
4049 | <h4 class="discussion">Discussion</h4> | |
4050 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4051 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
4052 | <br> | |
4053 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4054 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4055 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4056 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4057 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p> | |
4058 | <h3 class="function"><a id="ippAddInteger">ippAddInteger</a></h3> | |
4059 | <p class="description">Add a integer attribute to an IPP message.</p> | |
4060 | <p class="code"> | |
98d88c8d MS |
4061 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddInteger(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, int value);</p> |
4062 | <h4 class="parameters">Parameters</h4> | |
4063 | <table class="list"><tbody> | |
4064 | <tr><th>ipp</th> | |
4065 | <td class="description">IPP message</td></tr> | |
4066 | <tr><th>group</th> | |
4067 | <td class="description">IPP group</td></tr> | |
4068 | <tr><th>value_tag</th> | |
4069 | <td class="description">Type of attribute</td></tr> | |
4070 | <tr><th>name</th> | |
4071 | <td class="description">Name of attribute</td></tr> | |
4072 | <tr><th>value</th> | |
4073 | <td class="description">Value of attribute</td></tr> | |
4074 | </tbody></table> | |
798d6e29 MS |
4075 | <h4 class="returnvalue">Return Value</h4> |
4076 | <p class="description">New attribute</p> | |
4077 | <h4 class="discussion">Discussion</h4> | |
4078 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4079 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
4080 | <br> | |
4081 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4082 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4083 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4084 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4085 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> | |
4086 | <br> | |
4087 | Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer | |
4088 | (<code>IPP_TAG_INTEGER</code>).</p> | |
4089 | <h3 class="function"><a id="ippAddIntegers">ippAddIntegers</a></h3> | |
4090 | <p class="description">Add an array of integer values.</p> | |
4091 | <p class="code"> | |
98d88c8d MS |
4092 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddIntegers(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, int num_values, const int *values);</p> |
4093 | <h4 class="parameters">Parameters</h4> | |
4094 | <table class="list"><tbody> | |
4095 | <tr><th>ipp</th> | |
4096 | <td class="description">IPP message</td></tr> | |
4097 | <tr><th>group</th> | |
4098 | <td class="description">IPP group</td></tr> | |
4099 | <tr><th>value_tag</th> | |
4100 | <td class="description">Type of attribute</td></tr> | |
4101 | <tr><th>name</th> | |
4102 | <td class="description">Name of attribute</td></tr> | |
4103 | <tr><th>num_values</th> | |
4104 | <td class="description">Number of values</td></tr> | |
4105 | <tr><th>values</th> | |
4106 | <td class="description">Values</td></tr> | |
4107 | </tbody></table> | |
798d6e29 MS |
4108 | <h4 class="returnvalue">Return Value</h4> |
4109 | <p class="description">New attribute</p> | |
4110 | <h4 class="discussion">Discussion</h4> | |
4111 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4112 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
4113 | <br> | |
4114 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4115 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4116 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4117 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4118 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> | |
4119 | <br> | |
4120 | Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer | |
4121 | (<code>IPP_TAG_INTEGER</code>).</p> | |
4122 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippAddOctetString">ippAddOctetString</a></h3> | |
4123 | <p class="description">Add an octetString value to an IPP message.</p> | |
4124 | <p class="code"> | |
98d88c8d MS |
4125 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOctetString(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, const void *data, int datalen);</p> |
4126 | <h4 class="parameters">Parameters</h4> | |
4127 | <table class="list"><tbody> | |
4128 | <tr><th>ipp</th> | |
4129 | <td class="description">IPP message</td></tr> | |
4130 | <tr><th>group</th> | |
4131 | <td class="description">IPP group</td></tr> | |
4132 | <tr><th>name</th> | |
4133 | <td class="description">Name of attribute</td></tr> | |
4134 | <tr><th>data</th> | |
4135 | <td class="description">octetString data</td></tr> | |
4136 | <tr><th>datalen</th> | |
4137 | <td class="description">Length of data in bytes</td></tr> | |
4138 | </tbody></table> | |
798d6e29 MS |
4139 | <h4 class="returnvalue">Return Value</h4> |
4140 | <p class="description">New attribute</p> | |
4141 | <h4 class="discussion">Discussion</h4> | |
4142 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4143 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
4144 | <br> | |
4145 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4146 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4147 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4148 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4149 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>). | |
4150 | ||
4151 | </p> | |
4152 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippAddOutOfBand">ippAddOutOfBand</a></h3> | |
4153 | <p class="description">Add an out-of-band value to an IPP message.</p> | |
4154 | <p class="code"> | |
98d88c8d MS |
4155 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOutOfBand(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name);</p> |
4156 | <h4 class="parameters">Parameters</h4> | |
4157 | <table class="list"><tbody> | |
4158 | <tr><th>ipp</th> | |
4159 | <td class="description">IPP message</td></tr> | |
4160 | <tr><th>group</th> | |
4161 | <td class="description">IPP group</td></tr> | |
4162 | <tr><th>value_tag</th> | |
4163 | <td class="description">Type of attribute</td></tr> | |
4164 | <tr><th>name</th> | |
4165 | <td class="description">Name of attribute</td></tr> | |
4166 | </tbody></table> | |
798d6e29 MS |
4167 | <h4 class="returnvalue">Return Value</h4> |
4168 | <p class="description">New attribute</p> | |
4169 | <h4 class="discussion">Discussion</h4> | |
4170 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4171 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
4172 | <br> | |
4173 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4174 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4175 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4176 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4177 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> | |
4178 | <br> | |
4179 | Supported out-of-band values include unsupported-value | |
4180 | (<code>IPP_TAG_UNSUPPORTED_VALUE</code>), default (<code>IPP_TAG_DEFAULT</code>), unknown | |
4181 | (<code>IPP_TAG_UNKNOWN</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable | |
4182 | (<code>IPP_TAG_NOTSETTABLE</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), and | |
4183 | admin-define (<code>IPP_TAG_ADMINDEFINE</code>). | |
4184 | ||
4185 | </p> | |
4186 | <h3 class="function"><a id="ippAddRange">ippAddRange</a></h3> | |
4187 | <p class="description">Add a range of values to an IPP message.</p> | |
4188 | <p class="code"> | |
98d88c8d MS |
4189 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRange(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int lower, int upper);</p> |
4190 | <h4 class="parameters">Parameters</h4> | |
4191 | <table class="list"><tbody> | |
4192 | <tr><th>ipp</th> | |
4193 | <td class="description">IPP message</td></tr> | |
4194 | <tr><th>group</th> | |
4195 | <td class="description">IPP group</td></tr> | |
4196 | <tr><th>name</th> | |
4197 | <td class="description">Name of attribute</td></tr> | |
4198 | <tr><th>lower</th> | |
4199 | <td class="description">Lower value</td></tr> | |
4200 | <tr><th>upper</th> | |
4201 | <td class="description">Upper value</td></tr> | |
4202 | </tbody></table> | |
798d6e29 MS |
4203 | <h4 class="returnvalue">Return Value</h4> |
4204 | <p class="description">New attribute</p> | |
4205 | <h4 class="discussion">Discussion</h4> | |
4206 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4207 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
4208 | <br> | |
4209 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4210 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4211 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4212 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4213 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> | |
4214 | <br> | |
4215 | The <code>lower</code> parameter must be less than or equal to the <code>upper</code> parameter.</p> | |
4216 | <h3 class="function"><a id="ippAddRanges">ippAddRanges</a></h3> | |
4217 | <p class="description">Add ranges of values to an IPP message.</p> | |
4218 | <p class="code"> | |
98d88c8d MS |
4219 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRanges(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int num_values, const int *lower, const int *upper);</p> |
4220 | <h4 class="parameters">Parameters</h4> | |
4221 | <table class="list"><tbody> | |
4222 | <tr><th>ipp</th> | |
4223 | <td class="description">IPP message</td></tr> | |
4224 | <tr><th>group</th> | |
4225 | <td class="description">IPP group</td></tr> | |
4226 | <tr><th>name</th> | |
4227 | <td class="description">Name of attribute</td></tr> | |
4228 | <tr><th>num_values</th> | |
4229 | <td class="description">Number of values</td></tr> | |
4230 | <tr><th>lower</th> | |
4231 | <td class="description">Lower values</td></tr> | |
4232 | <tr><th>upper</th> | |
4233 | <td class="description">Upper values</td></tr> | |
4234 | </tbody></table> | |
798d6e29 MS |
4235 | <h4 class="returnvalue">Return Value</h4> |
4236 | <p class="description">New attribute</p> | |
4237 | <h4 class="discussion">Discussion</h4> | |
4238 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4239 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
4240 | <br> | |
4241 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4242 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4243 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4244 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4245 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p> | |
4246 | <h3 class="function"><a id="ippAddResolution">ippAddResolution</a></h3> | |
4247 | <p class="description">Add a resolution value to an IPP message.</p> | |
4248 | <p class="code"> | |
98d88c8d MS |
4249 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolution(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, <a href="#ipp_res_t">ipp_res_t</a> units, int xres, int yres);</p> |
4250 | <h4 class="parameters">Parameters</h4> | |
4251 | <table class="list"><tbody> | |
4252 | <tr><th>ipp</th> | |
4253 | <td class="description">IPP message</td></tr> | |
4254 | <tr><th>group</th> | |
4255 | <td class="description">IPP group</td></tr> | |
4256 | <tr><th>name</th> | |
4257 | <td class="description">Name of attribute</td></tr> | |
4258 | <tr><th>units</th> | |
4259 | <td class="description">Units for resolution</td></tr> | |
4260 | <tr><th>xres</th> | |
4261 | <td class="description">X resolution</td></tr> | |
4262 | <tr><th>yres</th> | |
4263 | <td class="description">Y resolution</td></tr> | |
4264 | </tbody></table> | |
798d6e29 MS |
4265 | <h4 class="returnvalue">Return Value</h4> |
4266 | <p class="description">New attribute</p> | |
4267 | <h4 class="discussion">Discussion</h4> | |
4268 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4269 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
4270 | <br> | |
4271 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4272 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4273 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4274 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4275 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p> | |
4276 | <h3 class="function"><a id="ippAddResolutions">ippAddResolutions</a></h3> | |
4277 | <p class="description">Add resolution values to an IPP message.</p> | |
4278 | <p class="code"> | |
98d88c8d MS |
4279 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolutions(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int num_values, <a href="#ipp_res_t">ipp_res_t</a> units, const int *xres, const int *yres);</p> |
4280 | <h4 class="parameters">Parameters</h4> | |
4281 | <table class="list"><tbody> | |
4282 | <tr><th>ipp</th> | |
4283 | <td class="description">IPP message</td></tr> | |
4284 | <tr><th>group</th> | |
4285 | <td class="description">IPP group</td></tr> | |
4286 | <tr><th>name</th> | |
4287 | <td class="description">Name of attribute</td></tr> | |
4288 | <tr><th>num_values</th> | |
4289 | <td class="description">Number of values</td></tr> | |
4290 | <tr><th>units</th> | |
4291 | <td class="description">Units for resolution</td></tr> | |
4292 | <tr><th>xres</th> | |
4293 | <td class="description">X resolutions</td></tr> | |
4294 | <tr><th>yres</th> | |
4295 | <td class="description">Y resolutions</td></tr> | |
4296 | </tbody></table> | |
798d6e29 MS |
4297 | <h4 class="returnvalue">Return Value</h4> |
4298 | <p class="description">New attribute</p> | |
4299 | <h4 class="discussion">Discussion</h4> | |
4300 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4301 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
4302 | <br> | |
4303 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4304 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4305 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4306 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4307 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p> | |
4308 | <h3 class="function"><a id="ippAddSeparator">ippAddSeparator</a></h3> | |
4309 | <p class="description">Add a group separator to an IPP message.</p> | |
4310 | <p class="code"> | |
98d88c8d | 4311 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddSeparator(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 4312 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4313 | <table class="list"><tbody> |
4314 | <tr><th>ipp</th> | |
4315 | <td class="description">IPP message</td></tr> | |
4316 | </tbody></table> | |
798d6e29 MS |
4317 | <h4 class="returnvalue">Return Value</h4> |
4318 | <p class="description">New attribute</p> | |
4319 | <h4 class="discussion">Discussion</h4> | |
4320 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4321 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.</p> | |
4322 | <h3 class="function"><a id="ippAddString">ippAddString</a></h3> | |
4323 | <p class="description">Add a language-encoded string to an IPP message.</p> | |
4324 | <p class="code"> | |
98d88c8d MS |
4325 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddString(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, const char *language, const char *value);</p> |
4326 | <h4 class="parameters">Parameters</h4> | |
4327 | <table class="list"><tbody> | |
4328 | <tr><th>ipp</th> | |
4329 | <td class="description">IPP message</td></tr> | |
4330 | <tr><th>group</th> | |
4331 | <td class="description">IPP group</td></tr> | |
4332 | <tr><th>value_tag</th> | |
4333 | <td class="description">Type of attribute</td></tr> | |
4334 | <tr><th>name</th> | |
4335 | <td class="description">Name of attribute</td></tr> | |
4336 | <tr><th>language</th> | |
4337 | <td class="description">Language code</td></tr> | |
4338 | <tr><th>value</th> | |
4339 | <td class="description">Value</td></tr> | |
4340 | </tbody></table> | |
798d6e29 MS |
4341 | <h4 class="returnvalue">Return Value</h4> |
4342 | <p class="description">New attribute</p> | |
4343 | <h4 class="discussion">Discussion</h4> | |
4344 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4345 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
4346 | <br> | |
4347 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4348 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4349 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4350 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4351 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> | |
4352 | <br> | |
4353 | Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword | |
4354 | (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType | |
4355 | (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage | |
4356 | (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage | |
4357 | (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme | |
4358 | (<code>IPP_TAG_URISCHEME</code>).<br> | |
4359 | <br> | |
4360 | The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and | |
4361 | textWithLanguage string values and must be <code>NULL</code> for all other string values.</p> | |
4362 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippAddStringf">ippAddStringf</a></h3> | |
4363 | <p class="description">Add a formatted string to an IPP message.</p> | |
4364 | <p class="code"> | |
98d88c8d MS |
4365 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStringf(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, const char *language, const char *format, ...);</p> |
4366 | <h4 class="parameters">Parameters</h4> | |
4367 | <table class="list"><tbody> | |
4368 | <tr><th>ipp</th> | |
4369 | <td class="description">IPP message</td></tr> | |
4370 | <tr><th>group</th> | |
4371 | <td class="description">IPP group</td></tr> | |
4372 | <tr><th>value_tag</th> | |
4373 | <td class="description">Type of attribute</td></tr> | |
4374 | <tr><th>name</th> | |
4375 | <td class="description">Name of attribute</td></tr> | |
4376 | <tr><th>language</th> | |
4377 | <td class="description">Language code (<code>NULL</code> for default)</td></tr> | |
4378 | <tr><th>format</th> | |
4379 | <td class="description">Printf-style format string</td></tr> | |
4380 | <tr><th>...</th> | |
4381 | <td class="description">Additional arguments as needed</td></tr> | |
4382 | </tbody></table> | |
798d6e29 MS |
4383 | <h4 class="returnvalue">Return Value</h4> |
4384 | <p class="description">New attribute</p> | |
4385 | <h4 class="discussion">Discussion</h4> | |
4386 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4387 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
4388 | <br> | |
4389 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4390 | (<code>IPP_TAG_ZERO</code>, for member attributes), document | |
4391 | (<code>IPP_TAG_DOCUMENT</code>), event notification | |
4392 | (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>), | |
4393 | printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>), | |
4394 | or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> | |
4395 | <br> | |
4396 | Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword | |
4397 | (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType | |
4398 | (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage | |
4399 | (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage | |
4400 | (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme | |
4401 | (<code>IPP_TAG_URISCHEME</code>).<br> | |
4402 | <br> | |
4403 | The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage | |
4404 | and textWithLanguage string values and must be <code>NULL</code> for all other | |
4405 | string values.<br> | |
4406 | <br> | |
4407 | The <code>format</code> parameter uses formatting characters compatible with the | |
4408 | printf family of standard functions. Additional arguments follow it as | |
4409 | needed. The formatted string is truncated as needed to the maximum length of | |
4410 | the corresponding value type. | |
4411 | ||
4412 | </p> | |
4413 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippAddStringfv">ippAddStringfv</a></h3> | |
4414 | <p class="description">Add a formatted string to an IPP message.</p> | |
4415 | <p class="code"> | |
98d88c8d MS |
4416 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStringfv(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, const char *language, const char *format, va_list ap);</p> |
4417 | <h4 class="parameters">Parameters</h4> | |
4418 | <table class="list"><tbody> | |
4419 | <tr><th>ipp</th> | |
4420 | <td class="description">IPP message</td></tr> | |
4421 | <tr><th>group</th> | |
4422 | <td class="description">IPP group</td></tr> | |
4423 | <tr><th>value_tag</th> | |
4424 | <td class="description">Type of attribute</td></tr> | |
4425 | <tr><th>name</th> | |
4426 | <td class="description">Name of attribute</td></tr> | |
4427 | <tr><th>language</th> | |
4428 | <td class="description">Language code (<code>NULL</code> for default)</td></tr> | |
4429 | <tr><th>format</th> | |
4430 | <td class="description">Printf-style format string</td></tr> | |
4431 | <tr><th>ap</th> | |
4432 | <td class="description">Additional arguments</td></tr> | |
4433 | </tbody></table> | |
798d6e29 MS |
4434 | <h4 class="returnvalue">Return Value</h4> |
4435 | <p class="description">New attribute</p> | |
4436 | <h4 class="discussion">Discussion</h4> | |
4437 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4438 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
4439 | <br> | |
4440 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4441 | (<code>IPP_TAG_ZERO</code>, for member attributes), document | |
4442 | (<code>IPP_TAG_DOCUMENT</code>), event notification | |
4443 | (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>), | |
4444 | printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>), | |
4445 | or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> | |
4446 | <br> | |
4447 | Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword | |
4448 | (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType | |
4449 | (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage | |
4450 | (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage | |
4451 | (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme | |
4452 | (<code>IPP_TAG_URISCHEME</code>).<br> | |
4453 | <br> | |
4454 | The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage | |
4455 | and textWithLanguage string values and must be <code>NULL</code> for all other | |
4456 | string values.<br> | |
4457 | <br> | |
4458 | The <code>format</code> parameter uses formatting characters compatible with the | |
4459 | printf family of standard functions. Additional arguments are passed in the | |
4460 | stdarg pointer <code>ap</code>. The formatted string is truncated as needed to the | |
4461 | maximum length of the corresponding value type. | |
4462 | ||
4463 | </p> | |
4464 | <h3 class="function"><a id="ippAddStrings">ippAddStrings</a></h3> | |
4465 | <p class="description">Add language-encoded strings to an IPP message.</p> | |
4466 | <p class="code"> | |
98d88c8d MS |
4467 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStrings(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, int num_values, const char *language, const char *const *values);</p> |
4468 | <h4 class="parameters">Parameters</h4> | |
4469 | <table class="list"><tbody> | |
4470 | <tr><th>ipp</th> | |
4471 | <td class="description">IPP message</td></tr> | |
4472 | <tr><th>group</th> | |
4473 | <td class="description">IPP group</td></tr> | |
4474 | <tr><th>value_tag</th> | |
4475 | <td class="description">Type of attribute</td></tr> | |
4476 | <tr><th>name</th> | |
4477 | <td class="description">Name of attribute</td></tr> | |
4478 | <tr><th>num_values</th> | |
4479 | <td class="description">Number of values</td></tr> | |
4480 | <tr><th>language</th> | |
4481 | <td class="description">Language code (<code>NULL</code> for default)</td></tr> | |
4482 | <tr><th>values</th> | |
4483 | <td class="description">Values</td></tr> | |
4484 | </tbody></table> | |
798d6e29 MS |
4485 | <h4 class="returnvalue">Return Value</h4> |
4486 | <p class="description">New attribute</p> | |
4487 | <h4 class="discussion">Discussion</h4> | |
4488 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4489 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
4490 | <br> | |
4491 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4492 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4493 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4494 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4495 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> | |
4496 | <br> | |
4497 | Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword | |
4498 | (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType | |
4499 | (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage | |
4500 | (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage | |
4501 | (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme | |
4502 | (<code>IPP_TAG_URISCHEME</code>).<br> | |
4503 | <br> | |
4504 | The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and | |
4505 | textWithLanguage string values and must be <code>NULL</code> for all other string values.</p> | |
4506 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippAttributeString">ippAttributeString</a></h3> | |
4507 | <p class="description">Convert the attribute's value to a string.</p> | |
4508 | <p class="code"> | |
98d88c8d MS |
4509 | size_t ippAttributeString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, char *buffer, size_t bufsize);</p> |
4510 | <h4 class="parameters">Parameters</h4> | |
4511 | <table class="list"><tbody> | |
4512 | <tr><th>attr</th> | |
4513 | <td class="description">Attribute</td></tr> | |
4514 | <tr><th>buffer</th> | |
4515 | <td class="description">String buffer or NULL</td></tr> | |
4516 | <tr><th>bufsize</th> | |
4517 | <td class="description">Size of string buffer</td></tr> | |
4518 | </tbody></table> | |
798d6e29 MS |
4519 | <h4 class="returnvalue">Return Value</h4> |
4520 | <p class="description">Number of bytes less nul</p> | |
4521 | <h4 class="discussion">Discussion</h4> | |
4522 | <p class="discussion">Returns the number of bytes that would be written, not including the | |
4523 | trailing nul. The buffer pointer can be NULL to get the required length, | |
4524 | just like (v)snprintf. | |
4525 | ||
4526 | </p> | |
4527 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippContainsInteger">ippContainsInteger</a></h3> | |
4528 | <p class="description">Determine whether an attribute contains the | |
4529 | specified value or is within the list of ranges.</p> | |
4530 | <p class="code"> | |
98d88c8d | 4531 | int ippContainsInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int value);</p> |
798d6e29 | 4532 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4533 | <table class="list"><tbody> |
4534 | <tr><th>attr</th> | |
4535 | <td class="description">Attribute</td></tr> | |
4536 | <tr><th>value</th> | |
4537 | <td class="description">Integer/enum value</td></tr> | |
4538 | </tbody></table> | |
798d6e29 MS |
4539 | <h4 class="returnvalue">Return Value</h4> |
4540 | <p class="description">1 on a match, 0 on no match</p> | |
4541 | <h4 class="discussion">Discussion</h4> | |
4542 | <p class="discussion">Returns non-zero when the attribute contains either a matching integer or | |
4543 | enum value, or the value falls within one of the rangeOfInteger values for | |
4544 | the attribute. | |
4545 | ||
4546 | </p> | |
4547 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippContainsString">ippContainsString</a></h3> | |
4548 | <p class="description">Determine whether an attribute contains the | |
4549 | specified string value.</p> | |
4550 | <p class="code"> | |
98d88c8d | 4551 | int ippContainsString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, const char *value);</p> |
798d6e29 | 4552 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4553 | <table class="list"><tbody> |
4554 | <tr><th>attr</th> | |
4555 | <td class="description">Attribute</td></tr> | |
4556 | <tr><th>value</th> | |
4557 | <td class="description">String value</td></tr> | |
4558 | </tbody></table> | |
798d6e29 MS |
4559 | <h4 class="returnvalue">Return Value</h4> |
4560 | <p class="description">1 on a match, 0 on no match</p> | |
4561 | <h4 class="discussion">Discussion</h4> | |
4562 | <p class="discussion">Returns non-zero when the attribute contains a matching charset, keyword, | |
65bebeac | 4563 | naturalLanguage, mimeMediaType, name, text, uri, or uriScheme value. |
798d6e29 MS |
4564 | |
4565 | </p> | |
4566 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippCopyAttribute">ippCopyAttribute</a></h3> | |
4567 | <p class="description">Copy an attribute.</p> | |
4568 | <p class="code"> | |
98d88c8d MS |
4569 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippCopyAttribute(<a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_attribute_t">ipp_attribute_t</a> *srcattr, int quickcopy);</p> |
4570 | <h4 class="parameters">Parameters</h4> | |
4571 | <table class="list"><tbody> | |
4572 | <tr><th>dst</th> | |
4573 | <td class="description">Destination IPP message</td></tr> | |
4574 | <tr><th>srcattr</th> | |
4575 | <td class="description">Attribute to copy</td></tr> | |
4576 | <tr><th>quickcopy</th> | |
4577 | <td class="description">1 for a referenced copy, 0 for normal</td></tr> | |
4578 | </tbody></table> | |
798d6e29 MS |
4579 | <h4 class="returnvalue">Return Value</h4> |
4580 | <p class="description">New attribute</p> | |
4581 | <h4 class="discussion">Discussion</h4> | |
4582 | <p class="discussion">The specified attribute, <code>attr</code>, is copied to the destination IPP message. | |
4583 | When <code>quickcopy</code> is non-zero, a "shallow" reference copy of the attribute is | |
4584 | created - this should only be done as long as the original source IPP message will | |
4585 | not be freed for the life of the destination. | |
4586 | ||
4587 | </p> | |
4588 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippCopyAttributes">ippCopyAttributes</a></h3> | |
4589 | <p class="description">Copy attributes from one IPP message to another.</p> | |
4590 | <p class="code"> | |
98d88c8d MS |
4591 | int ippCopyAttributes(<a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_t">ipp_t</a> *src, int quickcopy, <a href="#ipp_copycb_t">ipp_copycb_t</a> cb, void *context);</p> |
4592 | <h4 class="parameters">Parameters</h4> | |
4593 | <table class="list"><tbody> | |
4594 | <tr><th>dst</th> | |
4595 | <td class="description">Destination IPP message</td></tr> | |
4596 | <tr><th>src</th> | |
4597 | <td class="description">Source IPP message</td></tr> | |
4598 | <tr><th>quickcopy</th> | |
4599 | <td class="description">1 for a referenced copy, 0 for normal</td></tr> | |
4600 | <tr><th>cb</th> | |
4601 | <td class="description">Copy callback or <code>NULL</code> for none</td></tr> | |
4602 | <tr><th>context</th> | |
4603 | <td class="description">Context pointer</td></tr> | |
4604 | </tbody></table> | |
798d6e29 MS |
4605 | <h4 class="returnvalue">Return Value</h4> |
4606 | <p class="description">1 on success, 0 on error</p> | |
4607 | <h4 class="discussion">Discussion</h4> | |
4608 | <p class="discussion">Zero or more attributes are copied from the source IPP message, <code>src</code>, to the | |
4609 | destination IPP message, <code>dst</code>. When <code>quickcopy</code> is non-zero, a "shallow" | |
4610 | reference copy of the attribute is created - this should only be done as long as the | |
4611 | original source IPP message will not be freed for the life of the destination.<br> | |
4612 | <br> | |
4613 | The <code>cb</code> and <code>context</code> parameters provide a generic way to "filter" the | |
4614 | attributes that are copied - the function must return 1 to copy the attribute or | |
4615 | 0 to skip it. The function may also choose to do a partial copy of the source attribute | |
4616 | itself. | |
4617 | ||
4618 | </p> | |
4619 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippCreateRequestedArray">ippCreateRequestedArray</a></h3> | |
4620 | <p class="description">Create a CUPS array of attribute names from the | |
4621 | given requested-attributes attribute.</p> | |
4622 | <p class="code"> | |
98d88c8d | 4623 | cups_array_t *ippCreateRequestedArray(<a href="#ipp_t">ipp_t</a> *request);</p> |
798d6e29 | 4624 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4625 | <table class="list"><tbody> |
4626 | <tr><th>request</th> | |
4627 | <td class="description">IPP request</td></tr> | |
4628 | </tbody></table> | |
798d6e29 MS |
4629 | <h4 class="returnvalue">Return Value</h4> |
4630 | <p class="description">CUPS array or <code>NULL</code> if all</p> | |
4631 | <h4 class="discussion">Discussion</h4> | |
4632 | <p class="discussion">This function creates a (sorted) CUPS array of attribute names matching the | |
4633 | list of "requested-attribute" values supplied in an IPP request. All IANA- | |
4634 | registered values are supported in addition to the CUPS IPP extension | |
4635 | attributes.<br> | |
4636 | <br> | |
4637 | The <code>request</code> parameter specifies the request message that was read from | |
4638 | the client. | |
4639 | ||
4640 | <code>NULL</code> is returned if all attributes should be returned. Otherwise, the | |
4641 | result is a sorted array of attribute names, where <code>cupsArrayFind(array, | |
4642 | "attribute-name")</code> will return a non-NULL pointer. The array must be freed | |
4643 | using the <code>cupsArrayDelete</code> function. | |
4644 | ||
4645 | </p> | |
4646 | <h3 class="function"><a id="ippDateToTime">ippDateToTime</a></h3> | |
65bebeac MS |
4647 | <p class="description">Convert from RFC 2579 Date/Time format to time in |
4648 | seconds.</p> | |
798d6e29 | 4649 | <p class="code"> |
98d88c8d | 4650 | time_t ippDateToTime(const <a href="#ipp_uchar_t">ipp_uchar_t</a> *date);</p> |
798d6e29 | 4651 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4652 | <table class="list"><tbody> |
4653 | <tr><th>date</th> | |
65bebeac | 4654 | <td class="description">RFC 2579 date info</td></tr> |
98d88c8d | 4655 | </tbody></table> |
798d6e29 MS |
4656 | <h4 class="returnvalue">Return Value</h4> |
4657 | <p class="description">UNIX time value</p> | |
4658 | <h3 class="function"><a id="ippDelete">ippDelete</a></h3> | |
98d88c8d | 4659 | <p class="description">Delete an IPP message.</p> |
798d6e29 | 4660 | <p class="code"> |
98d88c8d | 4661 | void ippDelete(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 4662 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4663 | <table class="list"><tbody> |
4664 | <tr><th>ipp</th> | |
4665 | <td class="description">IPP message</td></tr> | |
4666 | </tbody></table> | |
4667 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippDeleteAttribute">ippDeleteAttribute</a></h3> | |
53af7f21 | 4668 | <p class="description">Delete a single attribute in an IPP message.</p> |
98d88c8d MS |
4669 | <p class="code"> |
4670 | void ippDeleteAttribute(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> | |
4671 | <h4 class="parameters">Parameters</h4> | |
4672 | <table class="list"><tbody> | |
4673 | <tr><th>ipp</th> | |
4674 | <td class="description">IPP message</td></tr> | |
4675 | <tr><th>attr</th> | |
4676 | <td class="description">Attribute to delete</td></tr> | |
4677 | </tbody></table> | |
798d6e29 MS |
4678 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippDeleteValues">ippDeleteValues</a></h3> |
4679 | <p class="description">Delete values in an attribute.</p> | |
4680 | <p class="code"> | |
98d88c8d MS |
4681 | int ippDeleteValues(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int count);</p> |
4682 | <h4 class="parameters">Parameters</h4> | |
4683 | <table class="list"><tbody> | |
4684 | <tr><th>ipp</th> | |
4685 | <td class="description">IPP message</td></tr> | |
4686 | <tr><th>attr</th> | |
4687 | <td class="description">Attribute</td></tr> | |
4688 | <tr><th>element</th> | |
4689 | <td class="description">Index of first value to delete (0-based)</td></tr> | |
4690 | <tr><th>count</th> | |
4691 | <td class="description">Number of values to delete</td></tr> | |
4692 | </tbody></table> | |
798d6e29 MS |
4693 | <h4 class="returnvalue">Return Value</h4> |
4694 | <p class="description">1 on success, 0 on failure</p> | |
4695 | <h4 class="discussion">Discussion</h4> | |
4696 | <p class="discussion">The <code>element</code> parameter specifies the first value to delete, starting at | |
4697 | 0. It must be less than the number of values returned by <a href="#ippGetCount"><code>ippGetCount</code></a>.<br> | |
4698 | <br> | |
4699 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
4700 | <br> | |
4701 | Deleting all values in an attribute deletes the attribute. | |
4702 | ||
4703 | </p> | |
4704 | <h3 class="function"><a id="ippEnumString">ippEnumString</a></h3> | |
4705 | <p class="description">Return a string corresponding to the enum value.</p> | |
4706 | <p class="code"> | |
98d88c8d | 4707 | const char *ippEnumString(const char *attrname, int enumvalue);</p> |
798d6e29 | 4708 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4709 | <table class="list"><tbody> |
4710 | <tr><th>attrname</th> | |
4711 | <td class="description">Attribute name</td></tr> | |
4712 | <tr><th>enumvalue</th> | |
4713 | <td class="description">Enum value</td></tr> | |
4714 | </tbody></table> | |
798d6e29 MS |
4715 | <h4 class="returnvalue">Return Value</h4> |
4716 | <p class="description">Enum string</p> | |
4717 | <h3 class="function"><a id="ippEnumValue">ippEnumValue</a></h3> | |
4718 | <p class="description">Return the value associated with a given enum string.</p> | |
4719 | <p class="code"> | |
98d88c8d | 4720 | int ippEnumValue(const char *attrname, const char *enumstring);</p> |
798d6e29 | 4721 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4722 | <table class="list"><tbody> |
4723 | <tr><th>attrname</th> | |
4724 | <td class="description">Attribute name</td></tr> | |
4725 | <tr><th>enumstring</th> | |
4726 | <td class="description">Enum string</td></tr> | |
4727 | </tbody></table> | |
798d6e29 MS |
4728 | <h4 class="returnvalue">Return Value</h4> |
4729 | <p class="description">Enum value or -1 if unknown</p> | |
4730 | <h3 class="function"><a id="ippErrorString">ippErrorString</a></h3> | |
4731 | <p class="description">Return a name for the given status code.</p> | |
4732 | <p class="code"> | |
98d88c8d | 4733 | const char *ippErrorString(ipp_status_t error);</p> |
798d6e29 | 4734 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4735 | <table class="list"><tbody> |
4736 | <tr><th>error</th> | |
4737 | <td class="description">Error status</td></tr> | |
4738 | </tbody></table> | |
798d6e29 MS |
4739 | <h4 class="returnvalue">Return Value</h4> |
4740 | <p class="description">Text string</p> | |
4741 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippErrorValue">ippErrorValue</a></h3> | |
4742 | <p class="description">Return a status code for the given name.</p> | |
4743 | <p class="code"> | |
98d88c8d | 4744 | ipp_status_t ippErrorValue(const char *name);</p> |
798d6e29 | 4745 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4746 | <table class="list"><tbody> |
4747 | <tr><th>name</th> | |
4748 | <td class="description">Name</td></tr> | |
4749 | </tbody></table> | |
798d6e29 MS |
4750 | <h4 class="returnvalue">Return Value</h4> |
4751 | <p class="description">IPP status code</p> | |
4752 | <h3 class="function"><a id="ippFindAttribute">ippFindAttribute</a></h3> | |
4753 | <p class="description">Find a named attribute in a request.</p> | |
4754 | <p class="code"> | |
98d88c8d MS |
4755 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindAttribute(<a href="#ipp_t">ipp_t</a> *ipp, const char *name, ipp_tag_t type);</p> |
4756 | <h4 class="parameters">Parameters</h4> | |
4757 | <table class="list"><tbody> | |
4758 | <tr><th>ipp</th> | |
4759 | <td class="description">IPP message</td></tr> | |
4760 | <tr><th>name</th> | |
4761 | <td class="description">Name of attribute</td></tr> | |
4762 | <tr><th>type</th> | |
4763 | <td class="description">Type of attribute</td></tr> | |
4764 | </tbody></table> | |
798d6e29 MS |
4765 | <h4 class="returnvalue">Return Value</h4> |
4766 | <p class="description">Matching attribute</p> | |
4767 | <h4 class="discussion">Discussion</h4> | |
4768 | <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list | |
4769 | of attribute and member names separated by slashes, for example | |
4770 | "media-col/media-size".</p> | |
4771 | <h3 class="function"><a id="ippFindNextAttribute">ippFindNextAttribute</a></h3> | |
4772 | <p class="description">Find the next named attribute in a request.</p> | |
4773 | <p class="code"> | |
98d88c8d MS |
4774 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindNextAttribute(<a href="#ipp_t">ipp_t</a> *ipp, const char *name, ipp_tag_t type);</p> |
4775 | <h4 class="parameters">Parameters</h4> | |
4776 | <table class="list"><tbody> | |
4777 | <tr><th>ipp</th> | |
4778 | <td class="description">IPP message</td></tr> | |
4779 | <tr><th>name</th> | |
4780 | <td class="description">Name of attribute</td></tr> | |
4781 | <tr><th>type</th> | |
4782 | <td class="description">Type of attribute</td></tr> | |
4783 | </tbody></table> | |
798d6e29 MS |
4784 | <h4 class="returnvalue">Return Value</h4> |
4785 | <p class="description">Matching attribute</p> | |
4786 | <h4 class="discussion">Discussion</h4> | |
4787 | <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list | |
4788 | of attribute and member names separated by slashes, for example | |
4789 | "media-col/media-size".</p> | |
4790 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippFirstAttribute">ippFirstAttribute</a></h3> | |
4791 | <p class="description">Return the first attribute in the message.</p> | |
4792 | <p class="code"> | |
98d88c8d | 4793 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFirstAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 4794 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4795 | <table class="list"><tbody> |
4796 | <tr><th>ipp</th> | |
4797 | <td class="description">IPP message</td></tr> | |
4798 | </tbody></table> | |
798d6e29 MS |
4799 | <h4 class="returnvalue">Return Value</h4> |
4800 | <p class="description">First attribute or <code>NULL</code> if none</p> | |
4801 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetBoolean">ippGetBoolean</a></h3> | |
4802 | <p class="description">Get a boolean value for an attribute.</p> | |
4803 | <p class="code"> | |
98d88c8d | 4804 | int ippGetBoolean(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p> |
798d6e29 | 4805 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4806 | <table class="list"><tbody> |
4807 | <tr><th>attr</th> | |
4808 | <td class="description">IPP attribute</td></tr> | |
4809 | <tr><th>element</th> | |
4810 | <td class="description">Value number (0-based)</td></tr> | |
4811 | </tbody></table> | |
798d6e29 MS |
4812 | <h4 class="returnvalue">Return Value</h4> |
4813 | <p class="description">Boolean value or 0 on error</p> | |
4814 | <h4 class="discussion">Discussion</h4> | |
4815 | <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to | |
65bebeac | 4816 | <code>ippGetCount(attr)</code> - 1. |
798d6e29 MS |
4817 | |
4818 | </p> | |
4819 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetCollection">ippGetCollection</a></h3> | |
4820 | <p class="description">Get a collection value for an attribute.</p> | |
4821 | <p class="code"> | |
98d88c8d | 4822 | <a href="#ipp_t">ipp_t</a> *ippGetCollection(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p> |
798d6e29 | 4823 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4824 | <table class="list"><tbody> |
4825 | <tr><th>attr</th> | |
4826 | <td class="description">IPP attribute</td></tr> | |
4827 | <tr><th>element</th> | |
4828 | <td class="description">Value number (0-based)</td></tr> | |
4829 | </tbody></table> | |
798d6e29 MS |
4830 | <h4 class="returnvalue">Return Value</h4> |
4831 | <p class="description">Collection value or <code>NULL</code> on error</p> | |
4832 | <h4 class="discussion">Discussion</h4> | |
4833 | <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to | |
65bebeac | 4834 | <code>ippGetCount(attr)</code> - 1. |
798d6e29 MS |
4835 | |
4836 | </p> | |
4837 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetCount">ippGetCount</a></h3> | |
4838 | <p class="description">Get the number of values in an attribute.</p> | |
4839 | <p class="code"> | |
98d88c8d | 4840 | int ippGetCount(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> |
798d6e29 | 4841 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4842 | <table class="list"><tbody> |
4843 | <tr><th>attr</th> | |
4844 | <td class="description">IPP attribute</td></tr> | |
4845 | </tbody></table> | |
798d6e29 MS |
4846 | <h4 class="returnvalue">Return Value</h4> |
4847 | <p class="description">Number of values or 0 on error</p> | |
4848 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetDate">ippGetDate</a></h3> | |
65bebeac | 4849 | <p class="description">Get a dateTime value for an attribute.</p> |
798d6e29 | 4850 | <p class="code"> |
98d88c8d | 4851 | const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippGetDate(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p> |
798d6e29 | 4852 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4853 | <table class="list"><tbody> |
4854 | <tr><th>attr</th> | |
4855 | <td class="description">IPP attribute</td></tr> | |
4856 | <tr><th>element</th> | |
4857 | <td class="description">Value number (0-based)</td></tr> | |
4858 | </tbody></table> | |
798d6e29 | 4859 | <h4 class="returnvalue">Return Value</h4> |
65bebeac | 4860 | <p class="description">dateTime value or <code>NULL</code></p> |
798d6e29 MS |
4861 | <h4 class="discussion">Discussion</h4> |
4862 | <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to | |
65bebeac | 4863 | <code>ippGetCount(attr)</code> - 1. |
798d6e29 MS |
4864 | |
4865 | </p> | |
4866 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetGroupTag">ippGetGroupTag</a></h3> | |
4867 | <p class="description">Get the group associated with an attribute.</p> | |
4868 | <p class="code"> | |
98d88c8d | 4869 | ipp_tag_t ippGetGroupTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> |
798d6e29 | 4870 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4871 | <table class="list"><tbody> |
4872 | <tr><th>attr</th> | |
4873 | <td class="description">IPP attribute</td></tr> | |
4874 | </tbody></table> | |
798d6e29 MS |
4875 | <h4 class="returnvalue">Return Value</h4> |
4876 | <p class="description">Group tag or <code>IPP_TAG_ZERO</code> on error</p> | |
4877 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetInteger">ippGetInteger</a></h3> | |
4878 | <p class="description">Get the integer/enum value for an attribute.</p> | |
4879 | <p class="code"> | |
98d88c8d | 4880 | int ippGetInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p> |
798d6e29 | 4881 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4882 | <table class="list"><tbody> |
4883 | <tr><th>attr</th> | |
4884 | <td class="description">IPP attribute</td></tr> | |
4885 | <tr><th>element</th> | |
4886 | <td class="description">Value number (0-based)</td></tr> | |
4887 | </tbody></table> | |
798d6e29 MS |
4888 | <h4 class="returnvalue">Return Value</h4> |
4889 | <p class="description">Value or 0 on error</p> | |
4890 | <h4 class="discussion">Discussion</h4> | |
4891 | <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to | |
65bebeac | 4892 | <code>ippGetCount(attr)</code> - 1. |
798d6e29 MS |
4893 | |
4894 | </p> | |
4895 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetName">ippGetName</a></h3> | |
4896 | <p class="description">Get the attribute name.</p> | |
4897 | <p class="code"> | |
98d88c8d | 4898 | const char *ippGetName(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> |
798d6e29 | 4899 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4900 | <table class="list"><tbody> |
4901 | <tr><th>attr</th> | |
4902 | <td class="description">IPP attribute</td></tr> | |
4903 | </tbody></table> | |
798d6e29 MS |
4904 | <h4 class="returnvalue">Return Value</h4> |
4905 | <p class="description">Attribute name or <code>NULL</code> for separators</p> | |
4906 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippGetOctetString">ippGetOctetString</a></h3> | |
4907 | <p class="description">Get an octetString value from an IPP attribute.</p> | |
4908 | <p class="code"> | |
98d88c8d MS |
4909 | void *ippGetOctetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *datalen);</p> |
4910 | <h4 class="parameters">Parameters</h4> | |
4911 | <table class="list"><tbody> | |
4912 | <tr><th>attr</th> | |
4913 | <td class="description">IPP attribute</td></tr> | |
4914 | <tr><th>element</th> | |
4915 | <td class="description">Value number (0-based)</td></tr> | |
4916 | <tr><th>datalen</th> | |
4917 | <td class="description">Length of octetString data</td></tr> | |
4918 | </tbody></table> | |
798d6e29 MS |
4919 | <h4 class="returnvalue">Return Value</h4> |
4920 | <p class="description">Pointer to octetString data</p> | |
4921 | <h4 class="discussion">Discussion</h4> | |
4922 | <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to | |
65bebeac | 4923 | <code>ippGetCount(attr)</code> - 1. |
798d6e29 MS |
4924 | |
4925 | </p> | |
4926 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetOperation">ippGetOperation</a></h3> | |
4927 | <p class="description">Get the operation ID in an IPP message.</p> | |
4928 | <p class="code"> | |
98d88c8d | 4929 | ipp_op_t ippGetOperation(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 4930 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4931 | <table class="list"><tbody> |
4932 | <tr><th>ipp</th> | |
4933 | <td class="description">IPP request message</td></tr> | |
4934 | </tbody></table> | |
798d6e29 MS |
4935 | <h4 class="returnvalue">Return Value</h4> |
4936 | <p class="description">Operation ID or 0 on error</p> | |
4937 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetRange">ippGetRange</a></h3> | |
4938 | <p class="description">Get a rangeOfInteger value from an attribute.</p> | |
4939 | <p class="code"> | |
98d88c8d MS |
4940 | int ippGetRange(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *uppervalue);</p> |
4941 | <h4 class="parameters">Parameters</h4> | |
4942 | <table class="list"><tbody> | |
4943 | <tr><th>attr</th> | |
4944 | <td class="description">IPP attribute</td></tr> | |
4945 | <tr><th>element</th> | |
4946 | <td class="description">Value number (0-based)</td></tr> | |
4947 | <tr><th>uppervalue</th> | |
4948 | <td class="description">Upper value of range</td></tr> | |
4949 | </tbody></table> | |
798d6e29 MS |
4950 | <h4 class="returnvalue">Return Value</h4> |
4951 | <p class="description">Lower value of range or 0</p> | |
4952 | <h4 class="discussion">Discussion</h4> | |
4953 | <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to | |
65bebeac | 4954 | <code>ippGetCount(attr)</code> - 1. |
798d6e29 MS |
4955 | |
4956 | </p> | |
4957 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetRequestId">ippGetRequestId</a></h3> | |
4958 | <p class="description">Get the request ID from an IPP message.</p> | |
4959 | <p class="code"> | |
98d88c8d | 4960 | int ippGetRequestId(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 4961 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4962 | <table class="list"><tbody> |
4963 | <tr><th>ipp</th> | |
4964 | <td class="description">IPP message</td></tr> | |
4965 | </tbody></table> | |
798d6e29 MS |
4966 | <h4 class="returnvalue">Return Value</h4> |
4967 | <p class="description">Request ID or 0 on error</p> | |
4968 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetResolution">ippGetResolution</a></h3> | |
4969 | <p class="description">Get a resolution value for an attribute.</p> | |
4970 | <p class="code"> | |
98d88c8d MS |
4971 | int ippGetResolution(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *yres, <a href="#ipp_res_t">ipp_res_t</a> *units);</p> |
4972 | <h4 class="parameters">Parameters</h4> | |
4973 | <table class="list"><tbody> | |
4974 | <tr><th>attr</th> | |
4975 | <td class="description">IPP attribute</td></tr> | |
4976 | <tr><th>element</th> | |
4977 | <td class="description">Value number (0-based)</td></tr> | |
4978 | <tr><th>yres</th> | |
4979 | <td class="description">Vertical/feed resolution</td></tr> | |
4980 | <tr><th>units</th> | |
4981 | <td class="description">Units for resolution</td></tr> | |
4982 | </tbody></table> | |
798d6e29 MS |
4983 | <h4 class="returnvalue">Return Value</h4> |
4984 | <p class="description">Horizontal/cross feed resolution or 0</p> | |
4985 | <h4 class="discussion">Discussion</h4> | |
4986 | <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to | |
65bebeac | 4987 | <code>ippGetCount(attr)</code> - 1. |
798d6e29 MS |
4988 | |
4989 | </p> | |
4990 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetState">ippGetState</a></h3> | |
4991 | <p class="description">Get the IPP message state.</p> | |
4992 | <p class="code"> | |
98d88c8d | 4993 | <a href="#ipp_state_t">ipp_state_t</a> ippGetState(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 4994 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4995 | <table class="list"><tbody> |
4996 | <tr><th>ipp</th> | |
4997 | <td class="description">IPP message</td></tr> | |
4998 | </tbody></table> | |
798d6e29 MS |
4999 | <h4 class="returnvalue">Return Value</h4> |
5000 | <p class="description">IPP message state value</p> | |
5001 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetStatusCode">ippGetStatusCode</a></h3> | |
5002 | <p class="description">Get the status code from an IPP response or event message.</p> | |
5003 | <p class="code"> | |
98d88c8d | 5004 | ipp_status_t ippGetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 5005 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5006 | <table class="list"><tbody> |
5007 | <tr><th>ipp</th> | |
5008 | <td class="description">IPP response or event message</td></tr> | |
5009 | </tbody></table> | |
798d6e29 MS |
5010 | <h4 class="returnvalue">Return Value</h4> |
5011 | <p class="description">Status code in IPP message</p> | |
5012 | <h3 class="function"><a id="ippGetString">ippGetString</a></h3> | |
98d88c8d MS |
5013 | <p class="description"></p> |
5014 | <p class="code"> | |
5015 | const char *ippGetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, const char **language);</p> | |
5016 | <h4 class="parameters">Parameters</h4> | |
5017 | <table class="list"><tbody> | |
5018 | <tr><th>attr</th> | |
5019 | <td class="description">IPP attribute</td></tr> | |
5020 | <tr><th>element</th> | |
5021 | <td class="description">Value number (0-based)</td></tr> | |
5022 | <tr><th>language</th> | |
5023 | <td class="description">Language code (<code>NULL</code> for don't care)</td></tr> | |
5024 | </tbody></table> | |
798d6e29 MS |
5025 | <h4 class="returnvalue">Return Value</h4> |
5026 | <p class="description">Get the string and optionally the language code for an attribute.</p> | |
5027 | <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to | |
65bebeac | 5028 | <code>ippGetCount(attr)</code> - 1. |
798d6e29 MS |
5029 | |
5030 | </p> | |
5031 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetValueTag">ippGetValueTag</a></h3> | |
5032 | <p class="description">Get the value tag for an attribute.</p> | |
5033 | <p class="code"> | |
98d88c8d | 5034 | ipp_tag_t ippGetValueTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> |
798d6e29 | 5035 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5036 | <table class="list"><tbody> |
5037 | <tr><th>attr</th> | |
5038 | <td class="description">IPP attribute</td></tr> | |
5039 | </tbody></table> | |
798d6e29 MS |
5040 | <h4 class="returnvalue">Return Value</h4> |
5041 | <p class="description">Value tag or <code>IPP_TAG_ZERO</code> on error</p> | |
5042 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetVersion">ippGetVersion</a></h3> | |
5043 | <p class="description">Get the major and minor version number from an IPP message.</p> | |
5044 | <p class="code"> | |
98d88c8d | 5045 | int ippGetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int *minor);</p> |
798d6e29 | 5046 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5047 | <table class="list"><tbody> |
5048 | <tr><th>ipp</th> | |
5049 | <td class="description">IPP message</td></tr> | |
5050 | <tr><th>minor</th> | |
65bebeac | 5051 | <td class="description">Minor version number or <code>NULL</code> for don't care</td></tr> |
98d88c8d | 5052 | </tbody></table> |
798d6e29 MS |
5053 | <h4 class="returnvalue">Return Value</h4> |
5054 | <p class="description">Major version number or 0 on error</p> | |
5055 | <h3 class="function"><a id="ippLength">ippLength</a></h3> | |
5056 | <p class="description">Compute the length of an IPP message.</p> | |
5057 | <p class="code"> | |
98d88c8d | 5058 | size_t ippLength(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 5059 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5060 | <table class="list"><tbody> |
5061 | <tr><th>ipp</th> | |
5062 | <td class="description">IPP message</td></tr> | |
5063 | </tbody></table> | |
798d6e29 MS |
5064 | <h4 class="returnvalue">Return Value</h4> |
5065 | <p class="description">Size of IPP message</p> | |
5066 | <h3 class="function"><a id="ippNew">ippNew</a></h3> | |
5067 | <p class="description">Allocate a new IPP message.</p> | |
5068 | <p class="code"> | |
98d88c8d | 5069 | <a href="#ipp_t">ipp_t</a> *ippNew(void);</p> |
798d6e29 MS |
5070 | <h4 class="returnvalue">Return Value</h4> |
5071 | <p class="description">New IPP message</p> | |
5072 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippNewRequest">ippNewRequest</a></h3> | |
5073 | <p class="description">Allocate a new IPP request message.</p> | |
5074 | <p class="code"> | |
98d88c8d | 5075 | <a href="#ipp_t">ipp_t</a> *ippNewRequest(ipp_op_t op);</p> |
798d6e29 | 5076 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5077 | <table class="list"><tbody> |
5078 | <tr><th>op</th> | |
5079 | <td class="description">Operation code</td></tr> | |
5080 | </tbody></table> | |
798d6e29 MS |
5081 | <h4 class="returnvalue">Return Value</h4> |
5082 | <p class="description">IPP request message</p> | |
5083 | <h4 class="discussion">Discussion</h4> | |
65bebeac MS |
5084 | <p class="discussion">The new request message is initialized with the "attributes-charset" and |
5085 | "attributes-natural-language" attributes added. The | |
5086 | "attributes-natural-language" value is derived from the current locale. | |
798d6e29 MS |
5087 | |
5088 | </p> | |
5089 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippNewResponse">ippNewResponse</a></h3> | |
5090 | <p class="description">Allocate a new IPP response message.</p> | |
5091 | <p class="code"> | |
98d88c8d | 5092 | <a href="#ipp_t">ipp_t</a> *ippNewResponse(<a href="#ipp_t">ipp_t</a> *request);</p> |
798d6e29 | 5093 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5094 | <table class="list"><tbody> |
5095 | <tr><th>request</th> | |
5096 | <td class="description">IPP request message</td></tr> | |
5097 | </tbody></table> | |
798d6e29 MS |
5098 | <h4 class="returnvalue">Return Value</h4> |
5099 | <p class="description">IPP response message</p> | |
5100 | <h4 class="discussion">Discussion</h4> | |
65bebeac MS |
5101 | <p class="discussion">The new response message is initialized with the same "version-number", |
5102 | "request-id", "attributes-charset", and "attributes-natural-language" as the | |
5103 | provided request message. If the "attributes-charset" or | |
5104 | "attributes-natural-language" attributes are missing from the request, | |
5105 | 'utf-8' and a value derived from the current locale are substituted, | |
798d6e29 MS |
5106 | respectively. |
5107 | ||
5108 | </p> | |
5109 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippNextAttribute">ippNextAttribute</a></h3> | |
5110 | <p class="description">Return the next attribute in the message.</p> | |
5111 | <p class="code"> | |
98d88c8d | 5112 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippNextAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 5113 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5114 | <table class="list"><tbody> |
5115 | <tr><th>ipp</th> | |
5116 | <td class="description">IPP message</td></tr> | |
5117 | </tbody></table> | |
798d6e29 MS |
5118 | <h4 class="returnvalue">Return Value</h4> |
5119 | <p class="description">Next attribute or <code>NULL</code> if none</p> | |
5120 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippOpString">ippOpString</a></h3> | |
5121 | <p class="description">Return a name for the given operation id.</p> | |
5122 | <p class="code"> | |
98d88c8d | 5123 | const char *ippOpString(ipp_op_t op);</p> |
798d6e29 | 5124 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5125 | <table class="list"><tbody> |
5126 | <tr><th>op</th> | |
5127 | <td class="description">Operation ID</td></tr> | |
5128 | </tbody></table> | |
798d6e29 MS |
5129 | <h4 class="returnvalue">Return Value</h4> |
5130 | <p class="description">Name</p> | |
5131 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippOpValue">ippOpValue</a></h3> | |
5132 | <p class="description">Return an operation id for the given name.</p> | |
5133 | <p class="code"> | |
98d88c8d | 5134 | ipp_op_t ippOpValue(const char *name);</p> |
798d6e29 | 5135 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5136 | <table class="list"><tbody> |
5137 | <tr><th>name</th> | |
5138 | <td class="description">Textual name</td></tr> | |
5139 | </tbody></table> | |
798d6e29 MS |
5140 | <h4 class="returnvalue">Return Value</h4> |
5141 | <p class="description">Operation ID</p> | |
5142 | <h3 class="function"><a id="ippPort">ippPort</a></h3> | |
5143 | <p class="description">Return the default IPP port number.</p> | |
5144 | <p class="code"> | |
98d88c8d | 5145 | int ippPort(void);</p> |
798d6e29 MS |
5146 | <h4 class="returnvalue">Return Value</h4> |
5147 | <p class="description">Port number</p> | |
5148 | <h3 class="function"><a id="ippRead">ippRead</a></h3> | |
5149 | <p class="description">Read data for an IPP message from a HTTP connection.</p> | |
5150 | <p class="code"> | |
98d88c8d | 5151 | <a href="#ipp_state_t">ipp_state_t</a> ippRead(<a href="#http_t">http_t</a> *http, <a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 5152 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5153 | <table class="list"><tbody> |
5154 | <tr><th>http</th> | |
5155 | <td class="description">HTTP connection</td></tr> | |
5156 | <tr><th>ipp</th> | |
5157 | <td class="description">IPP data</td></tr> | |
5158 | </tbody></table> | |
798d6e29 MS |
5159 | <h4 class="returnvalue">Return Value</h4> |
5160 | <p class="description">Current state</p> | |
5161 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippReadFile">ippReadFile</a></h3> | |
5162 | <p class="description">Read data for an IPP message from a file.</p> | |
5163 | <p class="code"> | |
98d88c8d | 5164 | <a href="#ipp_state_t">ipp_state_t</a> ippReadFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 5165 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5166 | <table class="list"><tbody> |
5167 | <tr><th>fd</th> | |
5168 | <td class="description">HTTP data</td></tr> | |
5169 | <tr><th>ipp</th> | |
5170 | <td class="description">IPP data</td></tr> | |
5171 | </tbody></table> | |
798d6e29 MS |
5172 | <h4 class="returnvalue">Return Value</h4> |
5173 | <p class="description">Current state</p> | |
5174 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippReadIO">ippReadIO</a></h3> | |
5175 | <p class="description">Read data for an IPP message.</p> | |
5176 | <p class="code"> | |
98d88c8d MS |
5177 | <a href="#ipp_state_t">ipp_state_t</a> ippReadIO(void *src, <a href="#ipp_iocb_t">ipp_iocb_t</a> cb, int blocking, <a href="#ipp_t">ipp_t</a> *parent, <a href="#ipp_t">ipp_t</a> *ipp);</p> |
5178 | <h4 class="parameters">Parameters</h4> | |
5179 | <table class="list"><tbody> | |
5180 | <tr><th>src</th> | |
5181 | <td class="description">Data source</td></tr> | |
5182 | <tr><th>cb</th> | |
5183 | <td class="description">Read callback function</td></tr> | |
5184 | <tr><th>blocking</th> | |
5185 | <td class="description">Use blocking IO?</td></tr> | |
5186 | <tr><th>parent</th> | |
5187 | <td class="description">Parent request, if any</td></tr> | |
5188 | <tr><th>ipp</th> | |
5189 | <td class="description">IPP data</td></tr> | |
5190 | </tbody></table> | |
798d6e29 MS |
5191 | <h4 class="returnvalue">Return Value</h4> |
5192 | <p class="description">Current state</p> | |
5193 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetBoolean">ippSetBoolean</a></h3> | |
5194 | <p class="description">Set a boolean value in an attribute.</p> | |
5195 | <p class="code"> | |
98d88c8d MS |
5196 | int ippSetBoolean(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int boolvalue);</p> |
5197 | <h4 class="parameters">Parameters</h4> | |
5198 | <table class="list"><tbody> | |
5199 | <tr><th>ipp</th> | |
5200 | <td class="description">IPP message</td></tr> | |
5201 | <tr><th>attr</th> | |
5202 | <td class="description">IPP attribute</td></tr> | |
5203 | <tr><th>element</th> | |
5204 | <td class="description">Value number (0-based)</td></tr> | |
5205 | <tr><th>boolvalue</th> | |
5206 | <td class="description">Boolean value</td></tr> | |
5207 | </tbody></table> | |
798d6e29 MS |
5208 | <h4 class="returnvalue">Return Value</h4> |
5209 | <p class="description">1 on success, 0 on failure</p> | |
5210 | <h4 class="discussion">Discussion</h4> | |
5211 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5212 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
5213 | <br> | |
5214 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5215 | <br> | |
5216 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5217 | <code>ippGetCount(attr)</code>. |
798d6e29 MS |
5218 | |
5219 | </p> | |
5220 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetCollection">ippSetCollection</a></h3> | |
5221 | <p class="description">Set a collection value in an attribute.</p> | |
5222 | <p class="code"> | |
98d88c8d MS |
5223 | int ippSetCollection(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, <a href="#ipp_t">ipp_t</a> *colvalue);</p> |
5224 | <h4 class="parameters">Parameters</h4> | |
5225 | <table class="list"><tbody> | |
5226 | <tr><th>ipp</th> | |
5227 | <td class="description">IPP message</td></tr> | |
5228 | <tr><th>attr</th> | |
5229 | <td class="description">IPP attribute</td></tr> | |
5230 | <tr><th>element</th> | |
5231 | <td class="description">Value number (0-based)</td></tr> | |
5232 | <tr><th>colvalue</th> | |
5233 | <td class="description">Collection value</td></tr> | |
5234 | </tbody></table> | |
798d6e29 MS |
5235 | <h4 class="returnvalue">Return Value</h4> |
5236 | <p class="description">1 on success, 0 on failure</p> | |
5237 | <h4 class="discussion">Discussion</h4> | |
5238 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5239 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
5240 | <br> | |
5241 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5242 | <br> | |
5243 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5244 | <code>ippGetCount(attr)</code>. |
798d6e29 MS |
5245 | |
5246 | </p> | |
5247 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetDate">ippSetDate</a></h3> | |
65bebeac | 5248 | <p class="description">Set a dateTime value in an attribute.</p> |
798d6e29 | 5249 | <p class="code"> |
98d88c8d MS |
5250 | int ippSetDate(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const <a href="#ipp_uchar_t">ipp_uchar_t</a> *datevalue);</p> |
5251 | <h4 class="parameters">Parameters</h4> | |
5252 | <table class="list"><tbody> | |
5253 | <tr><th>ipp</th> | |
5254 | <td class="description">IPP message</td></tr> | |
5255 | <tr><th>attr</th> | |
5256 | <td class="description">IPP attribute</td></tr> | |
5257 | <tr><th>element</th> | |
5258 | <td class="description">Value number (0-based)</td></tr> | |
5259 | <tr><th>datevalue</th> | |
65bebeac | 5260 | <td class="description">dateTime value</td></tr> |
98d88c8d | 5261 | </tbody></table> |
798d6e29 MS |
5262 | <h4 class="returnvalue">Return Value</h4> |
5263 | <p class="description">1 on success, 0 on failure</p> | |
5264 | <h4 class="discussion">Discussion</h4> | |
5265 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5266 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
5267 | <br> | |
5268 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5269 | <br> | |
5270 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5271 | <code>ippGetCount(attr)</code>. |
798d6e29 MS |
5272 | |
5273 | </p> | |
5274 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetGroupTag">ippSetGroupTag</a></h3> | |
5275 | <p class="description">Set the group tag of an attribute.</p> | |
5276 | <p class="code"> | |
98d88c8d MS |
5277 | int ippSetGroupTag(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, ipp_tag_t group_tag);</p> |
5278 | <h4 class="parameters">Parameters</h4> | |
5279 | <table class="list"><tbody> | |
5280 | <tr><th>ipp</th> | |
5281 | <td class="description">IPP message</td></tr> | |
5282 | <tr><th>attr</th> | |
5283 | <td class="description">Attribute</td></tr> | |
5284 | <tr><th>group_tag</th> | |
5285 | <td class="description">Group tag</td></tr> | |
5286 | </tbody></table> | |
798d6e29 MS |
5287 | <h4 class="returnvalue">Return Value</h4> |
5288 | <p class="description">1 on success, 0 on failure</p> | |
5289 | <h4 class="discussion">Discussion</h4> | |
5290 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5291 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
5292 | <br> | |
5293 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5294 | <br> | |
5295 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
5296 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
5297 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
5298 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
5299 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>). | |
5300 | ||
5301 | </p> | |
5302 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetInteger">ippSetInteger</a></h3> | |
5303 | <p class="description">Set an integer or enum value in an attribute.</p> | |
5304 | <p class="code"> | |
98d88c8d MS |
5305 | int ippSetInteger(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int intvalue);</p> |
5306 | <h4 class="parameters">Parameters</h4> | |
5307 | <table class="list"><tbody> | |
5308 | <tr><th>ipp</th> | |
5309 | <td class="description">IPP message</td></tr> | |
5310 | <tr><th>attr</th> | |
5311 | <td class="description">IPP attribute</td></tr> | |
5312 | <tr><th>element</th> | |
5313 | <td class="description">Value number (0-based)</td></tr> | |
5314 | <tr><th>intvalue</th> | |
5315 | <td class="description">Integer/enum value</td></tr> | |
5316 | </tbody></table> | |
798d6e29 MS |
5317 | <h4 class="returnvalue">Return Value</h4> |
5318 | <p class="description">1 on success, 0 on failure</p> | |
5319 | <h4 class="discussion">Discussion</h4> | |
5320 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5321 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
5322 | <br> | |
5323 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5324 | <br> | |
5325 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5326 | <code>ippGetCount(attr)</code>. |
798d6e29 MS |
5327 | |
5328 | </p> | |
5329 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetName">ippSetName</a></h3> | |
5330 | <p class="description">Set the name of an attribute.</p> | |
5331 | <p class="code"> | |
98d88c8d MS |
5332 | int ippSetName(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, const char *name);</p> |
5333 | <h4 class="parameters">Parameters</h4> | |
5334 | <table class="list"><tbody> | |
5335 | <tr><th>ipp</th> | |
5336 | <td class="description">IPP message</td></tr> | |
5337 | <tr><th>attr</th> | |
5338 | <td class="description">IPP attribute</td></tr> | |
5339 | <tr><th>name</th> | |
5340 | <td class="description">Attribute name</td></tr> | |
5341 | </tbody></table> | |
798d6e29 MS |
5342 | <h4 class="returnvalue">Return Value</h4> |
5343 | <p class="description">1 on success, 0 on failure</p> | |
5344 | <h4 class="discussion">Discussion</h4> | |
5345 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5346 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
5347 | <br> | |
5348 | The <code>attr</code> parameter may be modified as a result of setting the value. | |
5349 | ||
5350 | </p> | |
5351 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippSetOctetString">ippSetOctetString</a></h3> | |
5352 | <p class="description">Set an octetString value in an IPP attribute.</p> | |
5353 | <p class="code"> | |
98d88c8d MS |
5354 | int ippSetOctetString(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const void *data, int datalen);</p> |
5355 | <h4 class="parameters">Parameters</h4> | |
5356 | <table class="list"><tbody> | |
5357 | <tr><th>ipp</th> | |
5358 | <td class="description">IPP message</td></tr> | |
5359 | <tr><th>attr</th> | |
5360 | <td class="description">IPP attribute</td></tr> | |
5361 | <tr><th>element</th> | |
5362 | <td class="description">Value number (0-based)</td></tr> | |
5363 | <tr><th>data</th> | |
5364 | <td class="description">Pointer to octetString data</td></tr> | |
5365 | <tr><th>datalen</th> | |
5366 | <td class="description">Length of octetString data</td></tr> | |
5367 | </tbody></table> | |
798d6e29 MS |
5368 | <h4 class="returnvalue">Return Value</h4> |
5369 | <p class="description">1 on success, 0 on failure</p> | |
5370 | <h4 class="discussion">Discussion</h4> | |
5371 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5372 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
5373 | <br> | |
5374 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5375 | <br> | |
5376 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5377 | <code>ippGetCount(attr)</code>. |
798d6e29 MS |
5378 | |
5379 | </p> | |
5380 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetOperation">ippSetOperation</a></h3> | |
5381 | <p class="description">Set the operation ID in an IPP request message.</p> | |
5382 | <p class="code"> | |
98d88c8d | 5383 | int ippSetOperation(<a href="#ipp_t">ipp_t</a> *ipp, ipp_op_t op);</p> |
798d6e29 | 5384 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5385 | <table class="list"><tbody> |
5386 | <tr><th>ipp</th> | |
5387 | <td class="description">IPP request message</td></tr> | |
5388 | <tr><th>op</th> | |
5389 | <td class="description">Operation ID</td></tr> | |
5390 | </tbody></table> | |
798d6e29 MS |
5391 | <h4 class="returnvalue">Return Value</h4> |
5392 | <p class="description">1 on success, 0 on failure</p> | |
5393 | <h4 class="discussion">Discussion</h4> | |
5394 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5395 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions. | |
5396 | ||
5397 | </p> | |
5398 | <h3 class="function"><a id="ippSetPort">ippSetPort</a></h3> | |
98d88c8d | 5399 | <p class="description">Set the default port number.</p> |
798d6e29 | 5400 | <p class="code"> |
98d88c8d | 5401 | void ippSetPort(int p);</p> |
798d6e29 | 5402 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5403 | <table class="list"><tbody> |
5404 | <tr><th>p</th> | |
5405 | <td class="description">Port number to use</td></tr> | |
5406 | </tbody></table> | |
798d6e29 MS |
5407 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetRange">ippSetRange</a></h3> |
5408 | <p class="description">Set a rangeOfInteger value in an attribute.</p> | |
5409 | <p class="code"> | |
98d88c8d MS |
5410 | int ippSetRange(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int lowervalue, int uppervalue);</p> |
5411 | <h4 class="parameters">Parameters</h4> | |
5412 | <table class="list"><tbody> | |
5413 | <tr><th>ipp</th> | |
5414 | <td class="description">IPP message</td></tr> | |
5415 | <tr><th>attr</th> | |
5416 | <td class="description">IPP attribute</td></tr> | |
5417 | <tr><th>element</th> | |
5418 | <td class="description">Value number (0-based)</td></tr> | |
5419 | <tr><th>lowervalue</th> | |
5420 | <td class="description">Lower bound for range</td></tr> | |
5421 | <tr><th>uppervalue</th> | |
5422 | <td class="description">Upper bound for range</td></tr> | |
5423 | </tbody></table> | |
798d6e29 MS |
5424 | <h4 class="returnvalue">Return Value</h4> |
5425 | <p class="description">1 on success, 0 on failure</p> | |
5426 | <h4 class="discussion">Discussion</h4> | |
5427 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5428 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
5429 | <br> | |
5430 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5431 | <br> | |
5432 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5433 | <code>ippGetCount(attr)</code>. |
798d6e29 MS |
5434 | |
5435 | </p> | |
5436 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetRequestId">ippSetRequestId</a></h3> | |
5437 | <p class="description">Set the request ID in an IPP message.</p> | |
5438 | <p class="code"> | |
98d88c8d | 5439 | int ippSetRequestId(<a href="#ipp_t">ipp_t</a> *ipp, int request_id);</p> |
798d6e29 | 5440 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5441 | <table class="list"><tbody> |
5442 | <tr><th>ipp</th> | |
5443 | <td class="description">IPP message</td></tr> | |
5444 | <tr><th>request_id</th> | |
5445 | <td class="description">Request ID</td></tr> | |
5446 | </tbody></table> | |
798d6e29 MS |
5447 | <h4 class="returnvalue">Return Value</h4> |
5448 | <p class="description">1 on success, 0 on failure</p> | |
5449 | <h4 class="discussion">Discussion</h4> | |
5450 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5451 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
5452 | <br> | |
5453 | The <code>request_id</code> parameter must be greater than 0. | |
5454 | ||
5455 | </p> | |
5456 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetResolution">ippSetResolution</a></h3> | |
5457 | <p class="description">Set a resolution value in an attribute.</p> | |
5458 | <p class="code"> | |
98d88c8d MS |
5459 | int ippSetResolution(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, <a href="#ipp_res_t">ipp_res_t</a> unitsvalue, int xresvalue, int yresvalue);</p> |
5460 | <h4 class="parameters">Parameters</h4> | |
5461 | <table class="list"><tbody> | |
5462 | <tr><th>ipp</th> | |
5463 | <td class="description">IPP message</td></tr> | |
5464 | <tr><th>attr</th> | |
5465 | <td class="description">IPP attribute</td></tr> | |
5466 | <tr><th>element</th> | |
5467 | <td class="description">Value number (0-based)</td></tr> | |
5468 | <tr><th>unitsvalue</th> | |
5469 | <td class="description">Resolution units</td></tr> | |
5470 | <tr><th>xresvalue</th> | |
5471 | <td class="description">Horizontal/cross feed resolution</td></tr> | |
5472 | <tr><th>yresvalue</th> | |
5473 | <td class="description">Vertical/feed resolution</td></tr> | |
5474 | </tbody></table> | |
798d6e29 MS |
5475 | <h4 class="returnvalue">Return Value</h4> |
5476 | <p class="description">1 on success, 0 on failure</p> | |
5477 | <h4 class="discussion">Discussion</h4> | |
5478 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5479 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
5480 | <br> | |
5481 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5482 | <br> | |
5483 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5484 | <code>ippGetCount(attr)</code>. |
798d6e29 MS |
5485 | |
5486 | </p> | |
5487 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetState">ippSetState</a></h3> | |
5488 | <p class="description">Set the current state of the IPP message.</p> | |
5489 | <p class="code"> | |
98d88c8d | 5490 | int ippSetState(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_state_t">ipp_state_t</a> state);</p> |
798d6e29 | 5491 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5492 | <table class="list"><tbody> |
5493 | <tr><th>ipp</th> | |
5494 | <td class="description">IPP message</td></tr> | |
5495 | <tr><th>state</th> | |
5496 | <td class="description">IPP state value</td></tr> | |
5497 | </tbody></table> | |
798d6e29 MS |
5498 | <h4 class="returnvalue">Return Value</h4> |
5499 | <p class="description">1 on success, 0 on failure</p> | |
5500 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetStatusCode">ippSetStatusCode</a></h3> | |
5501 | <p class="description">Set the status code in an IPP response or event message.</p> | |
5502 | <p class="code"> | |
98d88c8d | 5503 | int ippSetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp, ipp_status_t status);</p> |
798d6e29 | 5504 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5505 | <table class="list"><tbody> |
5506 | <tr><th>ipp</th> | |
5507 | <td class="description">IPP response or event message</td></tr> | |
5508 | <tr><th>status</th> | |
5509 | <td class="description">Status code</td></tr> | |
5510 | </tbody></table> | |
798d6e29 MS |
5511 | <h4 class="returnvalue">Return Value</h4> |
5512 | <p class="description">1 on success, 0 on failure</p> | |
5513 | <h4 class="discussion">Discussion</h4> | |
5514 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5515 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions. | |
5516 | ||
5517 | </p> | |
5518 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetString">ippSetString</a></h3> | |
5519 | <p class="description">Set a string value in an attribute.</p> | |
5520 | <p class="code"> | |
98d88c8d MS |
5521 | int ippSetString(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const char *strvalue);</p> |
5522 | <h4 class="parameters">Parameters</h4> | |
5523 | <table class="list"><tbody> | |
5524 | <tr><th>ipp</th> | |
5525 | <td class="description">IPP message</td></tr> | |
5526 | <tr><th>attr</th> | |
5527 | <td class="description">IPP attribute</td></tr> | |
5528 | <tr><th>element</th> | |
5529 | <td class="description">Value number (0-based)</td></tr> | |
5530 | <tr><th>strvalue</th> | |
5531 | <td class="description">String value</td></tr> | |
5532 | </tbody></table> | |
798d6e29 MS |
5533 | <h4 class="returnvalue">Return Value</h4> |
5534 | <p class="description">1 on success, 0 on failure</p> | |
5535 | <h4 class="discussion">Discussion</h4> | |
5536 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5537 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
5538 | <br> | |
5539 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5540 | <br> | |
5541 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5542 | <code>ippGetCount(attr)</code>. |
798d6e29 MS |
5543 | |
5544 | </p> | |
5545 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippSetStringf">ippSetStringf</a></h3> | |
5546 | <p class="description">Set a formatted string value of an attribute.</p> | |
5547 | <p class="code"> | |
98d88c8d MS |
5548 | int ippSetStringf(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const char *format, ...);</p> |
5549 | <h4 class="parameters">Parameters</h4> | |
5550 | <table class="list"><tbody> | |
5551 | <tr><th>ipp</th> | |
5552 | <td class="description">IPP message</td></tr> | |
5553 | <tr><th>attr</th> | |
5554 | <td class="description">IPP attribute</td></tr> | |
5555 | <tr><th>element</th> | |
5556 | <td class="description">Value number (0-based)</td></tr> | |
5557 | <tr><th>format</th> | |
5558 | <td class="description">Printf-style format string</td></tr> | |
5559 | <tr><th>...</th> | |
5560 | <td class="description">Additional arguments as needed</td></tr> | |
5561 | </tbody></table> | |
798d6e29 MS |
5562 | <h4 class="returnvalue">Return Value</h4> |
5563 | <p class="description">1 on success, 0 on failure</p> | |
5564 | <h4 class="discussion">Discussion</h4> | |
5565 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5566 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
5567 | <br> | |
5568 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5569 | <br> | |
5570 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5571 | <code>ippGetCount(attr)</code>.<br> |
798d6e29 MS |
5572 | <br> |
5573 | The <code>format</code> parameter uses formatting characters compatible with the | |
5574 | printf family of standard functions. Additional arguments follow it as | |
5575 | needed. The formatted string is truncated as needed to the maximum length of | |
5576 | the corresponding value type. | |
5577 | ||
5578 | </p> | |
5579 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippSetStringfv">ippSetStringfv</a></h3> | |
5580 | <p class="description">Set a formatted string value of an attribute.</p> | |
5581 | <p class="code"> | |
98d88c8d MS |
5582 | int ippSetStringfv(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const char *format, va_list ap);</p> |
5583 | <h4 class="parameters">Parameters</h4> | |
5584 | <table class="list"><tbody> | |
5585 | <tr><th>ipp</th> | |
5586 | <td class="description">IPP message</td></tr> | |
5587 | <tr><th>attr</th> | |
5588 | <td class="description">IPP attribute</td></tr> | |
5589 | <tr><th>element</th> | |
5590 | <td class="description">Value number (0-based)</td></tr> | |
5591 | <tr><th>format</th> | |
5592 | <td class="description">Printf-style format string</td></tr> | |
5593 | <tr><th>ap</th> | |
5594 | <td class="description">Pointer to additional arguments</td></tr> | |
5595 | </tbody></table> | |
798d6e29 MS |
5596 | <h4 class="returnvalue">Return Value</h4> |
5597 | <p class="description">1 on success, 0 on failure</p> | |
5598 | <h4 class="discussion">Discussion</h4> | |
5599 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5600 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
5601 | <br> | |
5602 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5603 | <br> | |
5604 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5605 | <code>ippGetCount(attr)</code>.<br> |
798d6e29 MS |
5606 | <br> |
5607 | The <code>format</code> parameter uses formatting characters compatible with the | |
5608 | printf family of standard functions. Additional arguments follow it as | |
5609 | needed. The formatted string is truncated as needed to the maximum length of | |
5610 | the corresponding value type. | |
5611 | ||
5612 | </p> | |
5613 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetValueTag">ippSetValueTag</a></h3> | |
5614 | <p class="description">Set the value tag of an attribute.</p> | |
5615 | <p class="code"> | |
98d88c8d MS |
5616 | int ippSetValueTag(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, ipp_tag_t value_tag);</p> |
5617 | <h4 class="parameters">Parameters</h4> | |
5618 | <table class="list"><tbody> | |
5619 | <tr><th>ipp</th> | |
5620 | <td class="description">IPP message</td></tr> | |
5621 | <tr><th>attr</th> | |
5622 | <td class="description">IPP attribute</td></tr> | |
5623 | <tr><th>value_tag</th> | |
5624 | <td class="description">Value tag</td></tr> | |
5625 | </tbody></table> | |
798d6e29 MS |
5626 | <h4 class="returnvalue">Return Value</h4> |
5627 | <p class="description">1 on success, 0 on failure</p> | |
5628 | <h4 class="discussion">Discussion</h4> | |
5629 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5630 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
5631 | <br> | |
5632 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5633 | <br> | |
5634 | Integer (<code>IPP_TAG_INTEGER</code>) values can be promoted to rangeOfInteger | |
5635 | (<code>IPP_TAG_RANGE</code>) values, the various string tags can be promoted to name | |
5636 | (<code>IPP_TAG_NAME</code>) or nameWithLanguage (<code>IPP_TAG_NAMELANG</code>) values, text | |
5637 | (<code>IPP_TAG_TEXT</code>) values can be promoted to textWithLanguage | |
5638 | (<code>IPP_TAG_TEXTLANG</code>) values, and all values can be demoted to the various | |
5639 | out-of-band value tags such as no-value (<code>IPP_TAG_NOVALUE</code>). All other changes | |
5640 | will be rejected.<br> | |
5641 | <br> | |
5642 | Promoting a string attribute to nameWithLanguage or textWithLanguage adds the language | |
5643 | code in the "attributes-natural-language" attribute or, if not present, the language | |
5644 | code for the current locale. | |
5645 | ||
5646 | </p> | |
5647 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetVersion">ippSetVersion</a></h3> | |
5648 | <p class="description">Set the version number in an IPP message.</p> | |
5649 | <p class="code"> | |
98d88c8d MS |
5650 | int ippSetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int major, int minor);</p> |
5651 | <h4 class="parameters">Parameters</h4> | |
5652 | <table class="list"><tbody> | |
5653 | <tr><th>ipp</th> | |
5654 | <td class="description">IPP message</td></tr> | |
5655 | <tr><th>major</th> | |
5656 | <td class="description">Major version number (major.minor)</td></tr> | |
5657 | <tr><th>minor</th> | |
5658 | <td class="description">Minor version number (major.minor)</td></tr> | |
5659 | </tbody></table> | |
798d6e29 MS |
5660 | <h4 class="returnvalue">Return Value</h4> |
5661 | <p class="description">1 on success, 0 on failure</p> | |
5662 | <h4 class="discussion">Discussion</h4> | |
5663 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5664 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> | |
5665 | <br> | |
5666 | The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2. | |
5667 | ||
5668 | </p> | |
5669 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="ippStateString">ippStateString</a></h3> | |
5670 | <p class="description">Return the name corresponding to a state value.</p> | |
5671 | <p class="code"> | |
98d88c8d | 5672 | const char *ippStateString(<a href="#ipp_state_t">ipp_state_t</a> state);</p> |
798d6e29 | 5673 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5674 | <table class="list"><tbody> |
5675 | <tr><th>state</th> | |
5676 | <td class="description">State value</td></tr> | |
5677 | </tbody></table> | |
798d6e29 MS |
5678 | <h4 class="returnvalue">Return Value</h4> |
5679 | <p class="description">State name</p> | |
5680 | <h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="ippTagString">ippTagString</a></h3> | |
5681 | <p class="description">Return the tag name corresponding to a tag value.</p> | |
5682 | <p class="code"> | |
98d88c8d | 5683 | const char *ippTagString(ipp_tag_t tag);</p> |
798d6e29 | 5684 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5685 | <table class="list"><tbody> |
5686 | <tr><th>tag</th> | |
5687 | <td class="description">Tag value</td></tr> | |
5688 | </tbody></table> | |
798d6e29 MS |
5689 | <h4 class="returnvalue">Return Value</h4> |
5690 | <p class="description">Tag name</p> | |
5691 | <h4 class="discussion">Discussion</h4> | |
65bebeac | 5692 | <p class="discussion">The returned names are defined in RFC 8011 and the IANA IPP Registry. |
798d6e29 MS |
5693 | |
5694 | </p> | |
5695 | <h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="ippTagValue">ippTagValue</a></h3> | |
5696 | <p class="description">Return the tag value corresponding to a tag name.</p> | |
5697 | <p class="code"> | |
98d88c8d | 5698 | ipp_tag_t ippTagValue(const char *name);</p> |
798d6e29 | 5699 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5700 | <table class="list"><tbody> |
5701 | <tr><th>name</th> | |
5702 | <td class="description">Tag name</td></tr> | |
5703 | </tbody></table> | |
798d6e29 MS |
5704 | <h4 class="returnvalue">Return Value</h4> |
5705 | <p class="description">Tag value</p> | |
5706 | <h4 class="discussion">Discussion</h4> | |
65bebeac | 5707 | <p class="discussion">The tag names are defined in RFC 8011 and the IANA IPP Registry. |
798d6e29 MS |
5708 | |
5709 | </p> | |
5710 | <h3 class="function"><a id="ippTimeToDate">ippTimeToDate</a></h3> | |
65bebeac | 5711 | <p class="description">Convert from time in seconds to RFC 2579 format.</p> |
798d6e29 | 5712 | <p class="code"> |
98d88c8d | 5713 | const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippTimeToDate(time_t t);</p> |
798d6e29 | 5714 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5715 | <table class="list"><tbody> |
5716 | <tr><th>t</th> | |
65bebeac | 5717 | <td class="description">Time in seconds</td></tr> |
98d88c8d | 5718 | </tbody></table> |
798d6e29 | 5719 | <h4 class="returnvalue">Return Value</h4> |
65bebeac | 5720 | <p class="description">RFC-2579 date/time data</p> |
798d6e29 MS |
5721 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippValidateAttribute">ippValidateAttribute</a></h3> |
5722 | <p class="description">Validate the contents of an attribute.</p> | |
5723 | <p class="code"> | |
98d88c8d | 5724 | int ippValidateAttribute(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> |
798d6e29 | 5725 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5726 | <table class="list"><tbody> |
5727 | <tr><th>attr</th> | |
5728 | <td class="description">Attribute</td></tr> | |
5729 | </tbody></table> | |
798d6e29 MS |
5730 | <h4 class="returnvalue">Return Value</h4> |
5731 | <p class="description">1 if valid, 0 otherwise</p> | |
5732 | <h4 class="discussion">Discussion</h4> | |
5733 | <p class="discussion">This function validates the contents of an attribute based on the name and | |
5734 | value tag. 1 is returned if the attribute is valid, 0 otherwise. On | |
65bebeac | 5735 | failure, <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> is set to a human-readable message. |
798d6e29 MS |
5736 | |
5737 | </p> | |
5738 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippValidateAttributes">ippValidateAttributes</a></h3> | |
5739 | <p class="description">Validate all attributes in an IPP message.</p> | |
5740 | <p class="code"> | |
98d88c8d | 5741 | int ippValidateAttributes(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 5742 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5743 | <table class="list"><tbody> |
5744 | <tr><th>ipp</th> | |
5745 | <td class="description">IPP message</td></tr> | |
5746 | </tbody></table> | |
798d6e29 MS |
5747 | <h4 class="returnvalue">Return Value</h4> |
5748 | <p class="description">1 if valid, 0 otherwise</p> | |
5749 | <h4 class="discussion">Discussion</h4> | |
5750 | <p class="discussion">This function validates the contents of the IPP message, including each | |
65bebeac MS |
5751 | attribute. Like <a href="#ippValidateAttribute"><code>ippValidateAttribute</code></a>, <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> is |
5752 | set to a human-readable message on failure. | |
798d6e29 MS |
5753 | |
5754 | </p> | |
5755 | <h3 class="function"><a id="ippWrite">ippWrite</a></h3> | |
5756 | <p class="description">Write data for an IPP message to a HTTP connection.</p> | |
5757 | <p class="code"> | |
98d88c8d | 5758 | <a href="#ipp_state_t">ipp_state_t</a> ippWrite(<a href="#http_t">http_t</a> *http, <a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 5759 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5760 | <table class="list"><tbody> |
5761 | <tr><th>http</th> | |
5762 | <td class="description">HTTP connection</td></tr> | |
5763 | <tr><th>ipp</th> | |
5764 | <td class="description">IPP data</td></tr> | |
5765 | </tbody></table> | |
798d6e29 MS |
5766 | <h4 class="returnvalue">Return Value</h4> |
5767 | <p class="description">Current state</p> | |
5768 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippWriteFile">ippWriteFile</a></h3> | |
5769 | <p class="description">Write data for an IPP message to a file.</p> | |
5770 | <p class="code"> | |
98d88c8d | 5771 | <a href="#ipp_state_t">ipp_state_t</a> ippWriteFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 5772 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5773 | <table class="list"><tbody> |
5774 | <tr><th>fd</th> | |
5775 | <td class="description">HTTP data</td></tr> | |
5776 | <tr><th>ipp</th> | |
5777 | <td class="description">IPP data</td></tr> | |
5778 | </tbody></table> | |
798d6e29 MS |
5779 | <h4 class="returnvalue">Return Value</h4> |
5780 | <p class="description">Current state</p> | |
5781 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippWriteIO">ippWriteIO</a></h3> | |
5782 | <p class="description">Write data for an IPP message.</p> | |
5783 | <p class="code"> | |
98d88c8d MS |
5784 | <a href="#ipp_state_t">ipp_state_t</a> ippWriteIO(void *dst, <a href="#ipp_iocb_t">ipp_iocb_t</a> cb, int blocking, <a href="#ipp_t">ipp_t</a> *parent, <a href="#ipp_t">ipp_t</a> *ipp);</p> |
5785 | <h4 class="parameters">Parameters</h4> | |
5786 | <table class="list"><tbody> | |
5787 | <tr><th>dst</th> | |
5788 | <td class="description">Destination</td></tr> | |
5789 | <tr><th>cb</th> | |
5790 | <td class="description">Write callback function</td></tr> | |
5791 | <tr><th>blocking</th> | |
5792 | <td class="description">Use blocking IO?</td></tr> | |
5793 | <tr><th>parent</th> | |
5794 | <td class="description">Parent IPP message</td></tr> | |
5795 | <tr><th>ipp</th> | |
5796 | <td class="description">IPP data</td></tr> | |
5797 | </tbody></table> | |
798d6e29 MS |
5798 | <h4 class="returnvalue">Return Value</h4> |
5799 | <p class="description">Current state</p> | |
798d6e29 | 5800 | <h2 class="title"><a id="TYPES">Data Types</a></h2> |
798d6e29 MS |
5801 | <h3 class="typedef"><a id="cups_client_cert_cb_t"><span class="info"> CUPS 1.5/macOS 10.7 </span>cups_client_cert_cb_t</a></h3> |
5802 | <p class="description">Client credentials callback | |
5803 | </p> | |
5804 | <p class="code"> | |
53af7f21 | 5805 | typedef int(*)(http_t *http, void *tls, cups_array_t *distinguished_names, void *user_data)cups_client_cert_cb_t; |
798d6e29 MS |
5806 | </p> |
5807 | <h3 class="typedef"><a id="cups_dest_cb_t"><span class="info"> CUPS 1.6/macOS 10.8 </span>cups_dest_cb_t</a></h3> | |
5808 | <p class="description">Destination enumeration callback | |
5809 | </p> | |
5810 | <p class="code"> | |
5811 | typedef int(*)(void *user_data, unsigned flags, <a href="#cups_dest_t">cups_dest_t</a> *dest)cups_dest_cb_t; | |
5812 | </p> | |
5813 | <h3 class="typedef"><a id="cups_dest_t">cups_dest_t</a></h3> | |
5814 | <p class="description">Destination</p> | |
5815 | <p class="code"> | |
5816 | typedef struct <a href="#cups_dest_s">cups_dest_s</a> cups_dest_t; | |
5817 | </p> | |
5818 | <h3 class="typedef"><a id="cups_dinfo_t"><span class="info"> CUPS 1.6/macOS 10.8 </span>cups_dinfo_t</a></h3> | |
5819 | <p class="description">Destination capability and status | |
5820 | information </p> | |
5821 | <p class="code"> | |
5822 | typedef struct _cups_dinfo_s cups_dinfo_t; | |
798d6e29 MS |
5823 | </p> |
5824 | <h3 class="typedef"><a id="cups_job_t">cups_job_t</a></h3> | |
5825 | <p class="description">Job</p> | |
5826 | <p class="code"> | |
5827 | typedef struct <a href="#cups_job_s">cups_job_s</a> cups_job_t; | |
798d6e29 MS |
5828 | </p> |
5829 | <h3 class="typedef"><a id="cups_option_t">cups_option_t</a></h3> | |
5830 | <p class="description">Printer Options</p> | |
5831 | <p class="code"> | |
5832 | typedef struct <a href="#cups_option_s">cups_option_s</a> cups_option_t; | |
5833 | </p> | |
5834 | <h3 class="typedef"><a id="cups_password_cb2_t"><span class="info"> CUPS 1.4/macOS 10.6 </span>cups_password_cb2_t</a></h3> | |
5835 | <p class="description">New password callback | |
5836 | </p> | |
5837 | <p class="code"> | |
5838 | typedef const char *(*)(const char *prompt, <a href="#http_t">http_t</a> *http, const char *method, const char *resource, void *user_data)cups_password_cb2_t; | |
798d6e29 MS |
5839 | </p> |
5840 | <h3 class="typedef"><a id="cups_ptype_t">cups_ptype_t</a></h3> | |
5841 | <p class="description">Printer type/capability bits</p> | |
5842 | <p class="code"> | |
5843 | typedef unsigned cups_ptype_t; | |
5844 | </p> | |
5845 | <h3 class="typedef"><a id="cups_server_cert_cb_t"><span class="info"> CUPS 1.5/macOS 10.7 </span>cups_server_cert_cb_t</a></h3> | |
5846 | <p class="description">Server credentials callback | |
5847 | </p> | |
5848 | <p class="code"> | |
53af7f21 | 5849 | typedef int(*)(http_t *http, void *tls, cups_array_t *certs, void *user_data)cups_server_cert_cb_t; |
798d6e29 MS |
5850 | </p> |
5851 | <h3 class="typedef"><a id="cups_size_t"><span class="info"> CUPS 1.6/macOS 10.8 </span>cups_size_t</a></h3> | |
5852 | <p class="description">Media Size </p> | |
5853 | <p class="code"> | |
5854 | typedef struct <a href="#cups_size_s">cups_size_s</a> cups_size_t; | |
798d6e29 MS |
5855 | </p> |
5856 | <h3 class="typedef"><a id="http_addr_t"><span class="info"> CUPS 1.2/macOS 10.5 </span>http_addr_t</a></h3> | |
5857 | <p class="description">Socket address union, which | |
5858 | makes using IPv6 and other | |
5859 | address types easier and | |
5860 | more portable. </p> | |
5861 | <p class="code"> | |
5862 | typedef union _http_addr_u / http_addr_t; | |
798d6e29 MS |
5863 | </p> |
5864 | <h3 class="typedef"><a id="http_encoding_t">http_encoding_t</a></h3> | |
5865 | <p class="description">HTTP transfer encoding values</p> | |
5866 | <p class="code"> | |
5867 | typedef enum <a href="#http_encoding_e">http_encoding_e</a> http_encoding_t; | |
5868 | </p> | |
5869 | <h3 class="typedef"><a id="http_encryption_t">http_encryption_t</a></h3> | |
5870 | <p class="description">HTTP encryption values</p> | |
5871 | <p class="code"> | |
5872 | typedef enum <a href="#http_encryption_e">http_encryption_e</a> http_encryption_t; | |
5873 | </p> | |
5874 | <h3 class="typedef"><a id="http_field_t">http_field_t</a></h3> | |
5875 | <p class="description">HTTP field names</p> | |
5876 | <p class="code"> | |
5877 | typedef enum <a href="#http_field_e">http_field_e</a> http_field_t; | |
5878 | </p> | |
5879 | <h3 class="typedef"><a id="http_keepalive_t">http_keepalive_t</a></h3> | |
5880 | <p class="description">HTTP keep-alive values</p> | |
5881 | <p class="code"> | |
5882 | typedef enum <a href="#http_keepalive_e">http_keepalive_e</a> http_keepalive_t; | |
5883 | </p> | |
5884 | <h3 class="typedef"><a id="http_state_t">http_state_t</a></h3> | |
5885 | <p class="description">HTTP state values; states | |
5886 | are server-oriented...</p> | |
5887 | <p class="code"> | |
5888 | typedef enum <a href="#http_state_e">http_state_e</a> http_state_t; | |
5889 | </p> | |
5890 | <h3 class="typedef"><a id="http_t">http_t</a></h3> | |
5891 | <p class="description">HTTP connection type</p> | |
5892 | <p class="code"> | |
5893 | typedef struct _http_s http_t; | |
5894 | </p> | |
5895 | <h3 class="typedef"><a id="http_timeout_cb_t"><span class="info"> CUPS 1.5/macOS 10.7 </span>http_timeout_cb_t</a></h3> | |
5896 | <p class="description">HTTP timeout callback </p> | |
5897 | <p class="code"> | |
5898 | typedef int(*)(http_t *http, void *user_data)http_timeout_cb_t; | |
5899 | </p> | |
5900 | <h3 class="typedef"><a id="http_trust_t"><span class="info"> CUPS 2.0/OS 10.10 </span>http_trust_t</a></h3> | |
5901 | <p class="description">Level of trust for credentials </p> | |
5902 | <p class="code"> | |
5903 | typedef enum <a href="#http_trust_e">http_trust_e</a> http_trust_t; | |
5904 | </p> | |
5905 | <h3 class="typedef"><a id="http_uri_coding_t">http_uri_coding_t</a></h3> | |
5906 | <p class="description">URI en/decode flags</p> | |
5907 | <p class="code"> | |
5908 | typedef enum <a href="#http_uri_coding_e">http_uri_coding_e</a> http_uri_coding_t; | |
5909 | </p> | |
5910 | <h3 class="typedef"><a id="http_uri_status_t"><span class="info"> CUPS 1.2 </span>http_uri_status_t</a></h3> | |
5911 | <p class="description">URI separation status </p> | |
5912 | <p class="code"> | |
5913 | typedef enum <a href="#http_uri_status_e">http_uri_status_e</a> http_uri_status_t; | |
798d6e29 MS |
5914 | </p> |
5915 | <h3 class="typedef"><a id="ipp_attribute_t">ipp_attribute_t</a></h3> | |
5916 | <p class="description">IPP attribute</p> | |
5917 | <p class="code"> | |
5918 | typedef struct _ipp_attribute_s ipp_attribute_t; | |
5919 | </p> | |
65bebeac MS |
5920 | <h3 class="typedef"><a id="ipp_copycb_t"><span class="info"> CUPS 1.6/macOS 10.8 </span>ipp_copycb_t</a></h3> |
5921 | <p class="description">ippCopyAttributes callback function </p> | |
798d6e29 MS |
5922 | <p class="code"> |
5923 | typedef int(*)(void *context, <a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr)ipp_copycb_t; | |
798d6e29 MS |
5924 | </p> |
5925 | <h3 class="typedef"><a id="ipp_iocb_t"><span class="info"> CUPS 1.2/macOS 10.5 </span>ipp_iocb_t</a></h3> | |
65bebeac | 5926 | <p class="description">ippReadIO/ippWriteIO callback function </p> |
798d6e29 | 5927 | <p class="code"> |
98d88c8d | 5928 | typedef ssize_t(*)(void *context, ipp_uchar_t *buffer, size_t bytes) ipp_iocb_t; |
798d6e29 MS |
5929 | </p> |
5930 | <h3 class="typedef"><a id="ipp_orient_t">ipp_orient_t</a></h3> | |
5931 | <p class="description">Orientation values</p> | |
5932 | <p class="code"> | |
5933 | typedef enum <a href="#ipp_orient_e">ipp_orient_e</a> ipp_orient_t; | |
5934 | </p> | |
5935 | <h3 class="typedef"><a id="ipp_pstate_t">ipp_pstate_t</a></h3> | |
65bebeac | 5936 | <p class="description">Printer state values</p> |
798d6e29 MS |
5937 | <p class="code"> |
5938 | typedef enum <a href="#ipp_pstate_e">ipp_pstate_e</a> ipp_pstate_t; | |
5939 | </p> | |
5940 | <h3 class="typedef"><a id="ipp_quality_t">ipp_quality_t</a></h3> | |
65bebeac | 5941 | <p class="description">Print quality values</p> |
798d6e29 MS |
5942 | <p class="code"> |
5943 | typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t; | |
5944 | </p> | |
5945 | <h3 class="typedef"><a id="ipp_res_t">ipp_res_t</a></h3> | |
5946 | <p class="description">Resolution units</p> | |
5947 | <p class="code"> | |
5948 | typedef enum <a href="#ipp_res_e">ipp_res_e</a> ipp_res_t; | |
06a5a4d3 MS |
5949 | </p> |
5950 | <h3 class="typedef"><a id="ipp_rstate_t">ipp_rstate_t</a></h3> | |
5951 | <p class="description">resource-state values</p> | |
5952 | <p class="code"> | |
5953 | typedef enum <a href="#ipp_rstate_e">ipp_rstate_e</a> ipp_rstate_t; | |
5954 | </p> | |
5955 | <h3 class="typedef"><a id="ipp_sstate_t">ipp_sstate_t</a></h3> | |
5956 | <p class="description">system-state values</p> | |
5957 | <p class="code"> | |
5958 | typedef enum <a href="#ipp_sstate_e">ipp_sstate_e</a> ipp_sstate_t; | |
798d6e29 MS |
5959 | </p> |
5960 | <h3 class="typedef"><a id="ipp_state_t">ipp_state_t</a></h3> | |
65bebeac | 5961 | <p class="description">ipp_t state values</p> |
798d6e29 MS |
5962 | <p class="code"> |
5963 | typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t; | |
5964 | </p> | |
5965 | <h3 class="typedef"><a id="ipp_t">ipp_t</a></h3> | |
5966 | <p class="description">IPP request/response data</p> | |
5967 | <p class="code"> | |
5968 | typedef struct _ipp_s ipp_t; | |
798d6e29 MS |
5969 | </p> |
5970 | <h2 class="title"><a id="STRUCTURES">Structures</a></h2> | |
798d6e29 MS |
5971 | <h3 class="struct"><a id="cups_dest_s">cups_dest_s</a></h3> |
5972 | <p class="description">Destination</p> | |
5973 | <p class="code">struct cups_dest_s {<br> | |
5974 |     char *name, *instance;<br> | |
5975 |     int is_default;<br> | |
5976 |     int num_options;<br> | |
5977 |     <a href="#cups_option_t">cups_option_t</a> *options;<br> | |
5978 | };</p> | |
5979 | <h4 class="members">Members</h4> | |
98d88c8d MS |
5980 | <table class="list"><tbody> |
5981 | <tr><th>instance </th> | |
5982 | <td class="description">Local instance name or NULL</td></tr> | |
5983 | <tr><th>is_default </th> | |
5984 | <td class="description">Is this printer the default?</td></tr> | |
5985 | <tr><th>num_options </th> | |
5986 | <td class="description">Number of options</td></tr> | |
5987 | <tr><th>options </th> | |
5988 | <td class="description">Options</td></tr> | |
5989 | </tbody></table> | |
798d6e29 MS |
5990 | <h3 class="struct"><a id="cups_job_s">cups_job_s</a></h3> |
5991 | <p class="description">Job</p> | |
5992 | <p class="code">struct cups_job_s {<br> | |
5993 |     time_t completed_time;<br> | |
5994 |     time_t creation_time;<br> | |
5995 |     char *dest;<br> | |
5996 |     char *format;<br> | |
5997 |     int id;<br> | |
5998 |     int priority;<br> | |
5999 |     time_t processing_time;<br> | |
6000 |     int size;<br> | |
6001 |     ipp_jstate_t state;<br> | |
6002 |     char *title;<br> | |
6003 |     char *user;<br> | |
6004 | };</p> | |
6005 | <h4 class="members">Members</h4> | |
98d88c8d MS |
6006 | <table class="list"><tbody> |
6007 | <tr><th>completed_time </th> | |
6008 | <td class="description">Time the job was completed</td></tr> | |
6009 | <tr><th>creation_time </th> | |
6010 | <td class="description">Time the job was created</td></tr> | |
6011 | <tr><th>dest </th> | |
6012 | <td class="description">Printer or class name</td></tr> | |
6013 | <tr><th>format </th> | |
6014 | <td class="description">Document format</td></tr> | |
6015 | <tr><th>id </th> | |
6016 | <td class="description">The job ID</td></tr> | |
6017 | <tr><th>priority </th> | |
6018 | <td class="description">Priority (1-100)</td></tr> | |
6019 | <tr><th>processing_time </th> | |
6020 | <td class="description">Time the job was processed</td></tr> | |
6021 | <tr><th>size </th> | |
6022 | <td class="description">Size in kilobytes</td></tr> | |
6023 | <tr><th>state </th> | |
6024 | <td class="description">Job state</td></tr> | |
6025 | <tr><th>title </th> | |
6026 | <td class="description">Title/job name</td></tr> | |
6027 | <tr><th>user </th> | |
6028 | <td class="description">User that submitted the job</td></tr> | |
6029 | </tbody></table> | |
798d6e29 MS |
6030 | <h3 class="struct"><a id="cups_option_s">cups_option_s</a></h3> |
6031 | <p class="description">Printer Options</p> | |
6032 | <p class="code">struct cups_option_s {<br> | |
6033 |     char *name;<br> | |
6034 |     char *value;<br> | |
6035 | };</p> | |
6036 | <h4 class="members">Members</h4> | |
98d88c8d MS |
6037 | <table class="list"><tbody> |
6038 | <tr><th>name </th> | |
6039 | <td class="description">Name of option</td></tr> | |
6040 | <tr><th>value </th> | |
6041 | <td class="description">Value of option</td></tr> | |
6042 | </tbody></table> | |
798d6e29 MS |
6043 | <h3 class="struct"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cups_size_s">cups_size_s</a></h3> |
6044 | <p class="description">Media Size </p> | |
6045 | <p class="code">struct cups_size_s {<br> | |
6046 |     char media[128];<br> | |
6047 |     int width, length, bottom, left, right, top;<br> | |
6048 | };</p> | |
6049 | <h4 class="members">Members</h4> | |
98d88c8d MS |
6050 | <table class="list"><tbody> |
6051 | <tr><th>media[128] </th> | |
6052 | <td class="description">Media name to use</td></tr> | |
6053 | <tr><th>top </th> | |
6054 | <td class="description">Top margin in hundredths of | |
6055 | millimeters</td></tr> | |
6056 | </tbody></table> | |
798d6e29 | 6057 | <h2 class="title"><a id="ENUMERATIONS">Constants</a></h2> |
798d6e29 MS |
6058 | <h3 class="enumeration"><a id="cups_ptype_e">cups_ptype_e</a></h3> |
6059 | <p class="description">Printer type/capability bit | |
6060 | constants</p> | |
6061 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6062 | <table class="list"><tbody> |
6063 | <tr><th>CUPS_PRINTER_AUTHENTICATED <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Printer requires authentication | |
6064 | </td></tr> | |
6065 | <tr><th>CUPS_PRINTER_BIND </th> <td class="description">Can bind output</td></tr> | |
6066 | <tr><th>CUPS_PRINTER_BW </th> <td class="description">Can do B&W printing</td></tr> | |
6067 | <tr><th>CUPS_PRINTER_CLASS </th> <td class="description">Printer class</td></tr> | |
6068 | <tr><th>CUPS_PRINTER_COLLATE </th> <td class="description">Can quickly collate copies</td></tr> | |
6069 | <tr><th>CUPS_PRINTER_COLOR </th> <td class="description">Can do color printing</td></tr> | |
6070 | <tr><th>CUPS_PRINTER_COMMANDS <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Printer supports maintenance commands | |
6071 | </td></tr> | |
6072 | <tr><th>CUPS_PRINTER_COPIES </th> <td class="description">Can do copies in hardware</td></tr> | |
6073 | <tr><th>CUPS_PRINTER_COVER </th> <td class="description">Can cover output</td></tr> | |
6074 | <tr><th>CUPS_PRINTER_DEFAULT </th> <td class="description">Default printer on network</td></tr> | |
6075 | <tr><th>CUPS_PRINTER_DISCOVERED <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Printer was discovered </td></tr> | |
6076 | <tr><th>CUPS_PRINTER_DUPLEX </th> <td class="description">Can do two-sided printing</td></tr> | |
6077 | <tr><th>CUPS_PRINTER_FAX </th> <td class="description">Fax queue</td></tr> | |
6078 | <tr><th>CUPS_PRINTER_LARGE </th> <td class="description">Can print on D/E/A1/A0-size media</td></tr> | |
6079 | <tr><th>CUPS_PRINTER_LOCAL </th> <td class="description">Local printer or class</td></tr> | |
6080 | <tr><th>CUPS_PRINTER_MEDIUM </th> <td class="description">Can print on Tabloid/B/C/A3/A2-size media</td></tr> | |
6081 | <tr><th>CUPS_PRINTER_NOT_SHARED <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Printer is not shared | |
6082 | </td></tr> | |
6083 | <tr><th>CUPS_PRINTER_PUNCH </th> <td class="description">Can punch output</td></tr> | |
6084 | <tr><th>CUPS_PRINTER_REJECTING </th> <td class="description">Printer is rejecting jobs</td></tr> | |
6085 | <tr><th>CUPS_PRINTER_REMOTE </th> <td class="description">Remote printer or class</td></tr> | |
6086 | <tr><th>CUPS_PRINTER_SMALL </th> <td class="description">Can print on Letter/Legal/A4-size media</td></tr> | |
6087 | <tr><th>CUPS_PRINTER_SORT </th> <td class="description">Can sort output</td></tr> | |
6088 | <tr><th>CUPS_PRINTER_STAPLE </th> <td class="description">Can staple output</td></tr> | |
6089 | <tr><th>CUPS_PRINTER_VARIABLE </th> <td class="description">Can print on rolls and custom-size media</td></tr> | |
6090 | </tbody></table> | |
798d6e29 MS |
6091 | <h3 class="enumeration"><a id="http_encoding_e">http_encoding_e</a></h3> |
6092 | <p class="description">HTTP transfer encoding values</p> | |
6093 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6094 | <table class="list"><tbody> |
6095 | <tr><th>HTTP_ENCODING_CHUNKED </th> <td class="description">Data is chunked</td></tr> | |
6096 | <tr><th>HTTP_ENCODING_FIELDS </th> <td class="description">Sending HTTP fields</td></tr> | |
6097 | <tr><th>HTTP_ENCODING_LENGTH </th> <td class="description">Data is sent with Content-Length</td></tr> | |
6098 | </tbody></table> | |
798d6e29 MS |
6099 | <h3 class="enumeration"><a id="http_encryption_e">http_encryption_e</a></h3> |
6100 | <p class="description">HTTP encryption values</p> | |
6101 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6102 | <table class="list"><tbody> |
6103 | <tr><th>HTTP_ENCRYPTION_ALWAYS </th> <td class="description">Always encrypt (SSL)</td></tr> | |
6104 | <tr><th>HTTP_ENCRYPTION_IF_REQUESTED </th> <td class="description">Encrypt if requested (TLS upgrade)</td></tr> | |
6105 | <tr><th>HTTP_ENCRYPTION_NEVER </th> <td class="description">Never encrypt</td></tr> | |
6106 | <tr><th>HTTP_ENCRYPTION_REQUIRED </th> <td class="description">Encryption is required (TLS upgrade)</td></tr> | |
6107 | </tbody></table> | |
798d6e29 MS |
6108 | <h3 class="enumeration"><a id="http_field_e">http_field_e</a></h3> |
6109 | <p class="description">HTTP field names</p> | |
6110 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6111 | <table class="list"><tbody> |
6112 | <tr><th>HTTP_FIELD_ACCEPT_ENCODING <span class="info"> CUPS 1.7/macOS 10.9 </span></th> <td class="description">Accepting-Encoding field </td></tr> | |
6113 | <tr><th>HTTP_FIELD_ACCEPT_LANGUAGE </th> <td class="description">Accept-Language field</td></tr> | |
6114 | <tr><th>HTTP_FIELD_ACCEPT_RANGES </th> <td class="description">Accept-Ranges field</td></tr> | |
6115 | <tr><th>HTTP_FIELD_ALLOW <span class="info"> CUPS 1.7/macOS 10.9 </span></th> <td class="description">Allow field </td></tr> | |
73721e3e | 6116 | <tr><th>HTTP_FIELD_AUTHENTICATION_INFO <span class="info"> CUPS 2.2.9) </span></th> <td class="description">Authentication-Info field (</td></tr> |
98d88c8d MS |
6117 | <tr><th>HTTP_FIELD_AUTHORIZATION </th> <td class="description">Authorization field</td></tr> |
6118 | <tr><th>HTTP_FIELD_CONNECTION </th> <td class="description">Connection field</td></tr> | |
6119 | <tr><th>HTTP_FIELD_CONTENT_ENCODING </th> <td class="description">Content-Encoding field</td></tr> | |
6120 | <tr><th>HTTP_FIELD_CONTENT_LANGUAGE </th> <td class="description">Content-Language field</td></tr> | |
6121 | <tr><th>HTTP_FIELD_CONTENT_LENGTH </th> <td class="description">Content-Length field</td></tr> | |
6122 | <tr><th>HTTP_FIELD_CONTENT_LOCATION </th> <td class="description">Content-Location field</td></tr> | |
6123 | <tr><th>HTTP_FIELD_CONTENT_MD5 </th> <td class="description">Content-MD5 field</td></tr> | |
6124 | <tr><th>HTTP_FIELD_CONTENT_RANGE </th> <td class="description">Content-Range field</td></tr> | |
6125 | <tr><th>HTTP_FIELD_CONTENT_TYPE </th> <td class="description">Content-Type field</td></tr> | |
6126 | <tr><th>HTTP_FIELD_CONTENT_VERSION </th> <td class="description">Content-Version field</td></tr> | |
6127 | <tr><th>HTTP_FIELD_DATE </th> <td class="description">Date field</td></tr> | |
6128 | <tr><th>HTTP_FIELD_HOST </th> <td class="description">Host field</td></tr> | |
6129 | <tr><th>HTTP_FIELD_IF_MODIFIED_SINCE </th> <td class="description">If-Modified-Since field</td></tr> | |
6130 | <tr><th>HTTP_FIELD_IF_UNMODIFIED_SINCE </th> <td class="description">If-Unmodified-Since field</td></tr> | |
6131 | <tr><th>HTTP_FIELD_KEEP_ALIVE </th> <td class="description">Keep-Alive field</td></tr> | |
6132 | <tr><th>HTTP_FIELD_LAST_MODIFIED </th> <td class="description">Last-Modified field</td></tr> | |
6133 | <tr><th>HTTP_FIELD_LINK </th> <td class="description">Link field</td></tr> | |
6134 | <tr><th>HTTP_FIELD_LOCATION </th> <td class="description">Location field</td></tr> | |
6135 | <tr><th>HTTP_FIELD_MAX </th> <td class="description">Maximum field index</td></tr> | |
6136 | <tr><th>HTTP_FIELD_RANGE </th> <td class="description">Range field</td></tr> | |
6137 | <tr><th>HTTP_FIELD_REFERER </th> <td class="description">Referer field</td></tr> | |
6138 | <tr><th>HTTP_FIELD_RETRY_AFTER </th> <td class="description">Retry-After field</td></tr> | |
6139 | <tr><th>HTTP_FIELD_SERVER <span class="info"> CUPS 1.7/macOS 10.9 </span></th> <td class="description">Server field </td></tr> | |
6140 | <tr><th>HTTP_FIELD_TRANSFER_ENCODING </th> <td class="description">Transfer-Encoding field</td></tr> | |
6141 | <tr><th>HTTP_FIELD_UNKNOWN </th> <td class="description">Unknown field</td></tr> | |
6142 | <tr><th>HTTP_FIELD_UPGRADE </th> <td class="description">Upgrade field</td></tr> | |
6143 | <tr><th>HTTP_FIELD_USER_AGENT </th> <td class="description">User-Agent field</td></tr> | |
6144 | <tr><th>HTTP_FIELD_WWW_AUTHENTICATE </th> <td class="description">WWW-Authenticate field</td></tr> | |
6145 | </tbody></table> | |
798d6e29 MS |
6146 | <h3 class="enumeration"><a id="http_keepalive_e">http_keepalive_e</a></h3> |
6147 | <p class="description">HTTP keep-alive values</p> | |
6148 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6149 | <table class="list"><tbody> |
6150 | <tr><th>HTTP_KEEPALIVE_OFF </th> <td class="description">No keep alive support</td></tr> | |
6151 | <tr><th>HTTP_KEEPALIVE_ON </th> <td class="description">Use keep alive</td></tr> | |
6152 | </tbody></table> | |
798d6e29 MS |
6153 | <h3 class="enumeration"><a id="http_state_e">http_state_e</a></h3> |
6154 | <p class="description">HTTP state values; states | |
6155 | are server-oriented...</p> | |
6156 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6157 | <table class="list"><tbody> |
6158 | <tr><th>HTTP_STATE_CONNECT </th> <td class="description">CONNECT command, waiting for blank line</td></tr> | |
6159 | <tr><th>HTTP_STATE_DELETE </th> <td class="description">DELETE command, waiting for blank line</td></tr> | |
6160 | <tr><th>HTTP_STATE_ERROR </th> <td class="description">Error on socket</td></tr> | |
6161 | <tr><th>HTTP_STATE_GET </th> <td class="description">GET command, waiting for blank line</td></tr> | |
6162 | <tr><th>HTTP_STATE_GET_SEND </th> <td class="description">GET command, sending data</td></tr> | |
6163 | <tr><th>HTTP_STATE_HEAD </th> <td class="description">HEAD command, waiting for blank line</td></tr> | |
6164 | <tr><th>HTTP_STATE_OPTIONS </th> <td class="description">OPTIONS command, waiting for blank line</td></tr> | |
6165 | <tr><th>HTTP_STATE_POST </th> <td class="description">POST command, waiting for blank line</td></tr> | |
6166 | <tr><th>HTTP_STATE_POST_RECV </th> <td class="description">POST command, receiving data</td></tr> | |
6167 | <tr><th>HTTP_STATE_POST_SEND </th> <td class="description">POST command, sending data</td></tr> | |
6168 | <tr><th>HTTP_STATE_PUT </th> <td class="description">PUT command, waiting for blank line</td></tr> | |
6169 | <tr><th>HTTP_STATE_PUT_RECV </th> <td class="description">PUT command, receiving data</td></tr> | |
6170 | <tr><th>HTTP_STATE_STATUS </th> <td class="description">Command complete, sending status</td></tr> | |
6171 | <tr><th>HTTP_STATE_TRACE </th> <td class="description">TRACE command, waiting for blank line</td></tr> | |
6172 | <tr><th>HTTP_STATE_UNKNOWN_METHOD <span class="info"> CUPS 1.7/macOS 10.9 </span></th> <td class="description">Unknown request method, waiting for blank line </td></tr> | |
6173 | <tr><th>HTTP_STATE_UNKNOWN_VERSION <span class="info"> CUPS 1.7/macOS 10.9 </span></th> <td class="description">Unknown request method, waiting for blank line </td></tr> | |
6174 | <tr><th>HTTP_STATE_WAITING </th> <td class="description">Waiting for command</td></tr> | |
6175 | </tbody></table> | |
798d6e29 MS |
6176 | <h3 class="enumeration"><a id="http_status_e">http_status_e</a></h3> |
6177 | <p class="description">HTTP status codes</p> | |
6178 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6179 | <table class="list"><tbody> |
6180 | <tr><th>HTTP_STATUS_ACCEPTED </th> <td class="description">DELETE command was successful</td></tr> | |
6181 | <tr><th>HTTP_STATUS_BAD_GATEWAY </th> <td class="description">Bad gateway</td></tr> | |
6182 | <tr><th>HTTP_STATUS_BAD_REQUEST </th> <td class="description">Bad request</td></tr> | |
6183 | <tr><th>HTTP_STATUS_CONFLICT </th> <td class="description">Request is self-conflicting</td></tr> | |
6184 | <tr><th>HTTP_STATUS_CONTINUE </th> <td class="description">Everything OK, keep going...</td></tr> | |
6185 | <tr><th>HTTP_STATUS_CREATED </th> <td class="description">PUT command was successful</td></tr> | |
6186 | <tr><th>HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED <span class="info"> CUPS 1.4 </span></th> <td class="description">User canceled authorization </td></tr> | |
6187 | <tr><th>HTTP_STATUS_CUPS_PKI_ERROR <span class="info"> CUPS 1.5/macOS 10.7 </span></th> <td class="description">Error negotiating a secure connection </td></tr> | |
6188 | <tr><th>HTTP_STATUS_ERROR </th> <td class="description">An error response from httpXxxx()</td></tr> | |
6189 | <tr><th>HTTP_STATUS_EXPECTATION_FAILED </th> <td class="description">The expectation given in an Expect header field was not met</td></tr> | |
6190 | <tr><th>HTTP_STATUS_FORBIDDEN </th> <td class="description">Forbidden to access this URI</td></tr> | |
699fe020 | 6191 | <tr><th>HTTP_STATUS_FOUND </th> <td class="description">Document was found at a different URI</td></tr> |
98d88c8d MS |
6192 | <tr><th>HTTP_STATUS_GATEWAY_TIMEOUT </th> <td class="description">Gateway connection timed out</td></tr> |
6193 | <tr><th>HTTP_STATUS_GONE </th> <td class="description">Server has gone away</td></tr> | |
6194 | <tr><th>HTTP_STATUS_LENGTH_REQUIRED </th> <td class="description">A content length or encoding is required</td></tr> | |
6195 | <tr><th>HTTP_STATUS_METHOD_NOT_ALLOWED </th> <td class="description">Method is not allowed</td></tr> | |
6196 | <tr><th>HTTP_STATUS_MOVED_PERMANENTLY </th> <td class="description">Document has moved permanently</td></tr> | |
98d88c8d MS |
6197 | <tr><th>HTTP_STATUS_MULTIPLE_CHOICES </th> <td class="description">Multiple files match request</td></tr> |
6198 | <tr><th>HTTP_STATUS_NONE <span class="info"> CUPS 1.7/macOS 10.9 </span></th> <td class="description">No Expect value </td></tr> | |
6199 | <tr><th>HTTP_STATUS_NOT_ACCEPTABLE </th> <td class="description">Not Acceptable</td></tr> | |
6200 | <tr><th>HTTP_STATUS_NOT_AUTHORITATIVE </th> <td class="description">Information isn't authoritative</td></tr> | |
6201 | <tr><th>HTTP_STATUS_NOT_FOUND </th> <td class="description">URI was not found</td></tr> | |
6202 | <tr><th>HTTP_STATUS_NOT_IMPLEMENTED </th> <td class="description">Feature not implemented</td></tr> | |
6203 | <tr><th>HTTP_STATUS_NOT_MODIFIED </th> <td class="description">File not modified</td></tr> | |
6204 | <tr><th>HTTP_STATUS_NOT_SUPPORTED </th> <td class="description">HTTP version not supported</td></tr> | |
6205 | <tr><th>HTTP_STATUS_NO_CONTENT </th> <td class="description">Successful command, no new data</td></tr> | |
6206 | <tr><th>HTTP_STATUS_OK </th> <td class="description">OPTIONS/GET/HEAD/POST/TRACE command was successful</td></tr> | |
6207 | <tr><th>HTTP_STATUS_PARTIAL_CONTENT </th> <td class="description">Only a partial file was received/sent</td></tr> | |
6208 | <tr><th>HTTP_STATUS_PAYMENT_REQUIRED </th> <td class="description">Payment required</td></tr> | |
6209 | <tr><th>HTTP_STATUS_PRECONDITION </th> <td class="description">Precondition failed</td></tr> | |
6210 | <tr><th>HTTP_STATUS_PROXY_AUTHENTICATION </th> <td class="description">Proxy Authentication is Required</td></tr> | |
6211 | <tr><th>HTTP_STATUS_REQUESTED_RANGE </th> <td class="description">The requested range is not satisfiable</td></tr> | |
6212 | <tr><th>HTTP_STATUS_REQUEST_TIMEOUT </th> <td class="description">Request timed out</td></tr> | |
6213 | <tr><th>HTTP_STATUS_REQUEST_TOO_LARGE </th> <td class="description">Request entity too large</td></tr> | |
6214 | <tr><th>HTTP_STATUS_RESET_CONTENT </th> <td class="description">Content was reset/recreated</td></tr> | |
699fe020 | 6215 | <tr><th>HTTP_STATUS_SEE_OTHER </th> <td class="description">See this other link</td></tr> |
98d88c8d MS |
6216 | <tr><th>HTTP_STATUS_SERVER_ERROR </th> <td class="description">Internal server error</td></tr> |
6217 | <tr><th>HTTP_STATUS_SERVICE_UNAVAILABLE </th> <td class="description">Service is unavailable</td></tr> | |
6218 | <tr><th>HTTP_STATUS_SWITCHING_PROTOCOLS </th> <td class="description">HTTP upgrade to TLS/SSL</td></tr> | |
699fe020 | 6219 | <tr><th>HTTP_STATUS_TEMPORARY_REDIRECT </th> <td class="description">Temporary redirection</td></tr> |
98d88c8d MS |
6220 | <tr><th>HTTP_STATUS_UNAUTHORIZED </th> <td class="description">Unauthorized to access host</td></tr> |
6221 | <tr><th>HTTP_STATUS_UNSUPPORTED_MEDIATYPE </th> <td class="description">The requested media type is unsupported</td></tr> | |
6222 | <tr><th>HTTP_STATUS_UPGRADE_REQUIRED </th> <td class="description">Upgrade to SSL/TLS required</td></tr> | |
6223 | <tr><th>HTTP_STATUS_URI_TOO_LONG </th> <td class="description">URI too long</td></tr> | |
6224 | <tr><th>HTTP_STATUS_USE_PROXY </th> <td class="description">Must use a proxy to access this URI</td></tr> | |
6225 | </tbody></table> | |
798d6e29 MS |
6226 | <h3 class="enumeration"><a id="http_trust_e"><span class="info"> CUPS 2.0/OS 10.10 </span>http_trust_e</a></h3> |
6227 | <p class="description">Level of trust for credentials </p> | |
6228 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6229 | <table class="list"><tbody> |
6230 | <tr><th>HTTP_TRUST_CHANGED </th> <td class="description">Credentials have changed</td></tr> | |
6231 | <tr><th>HTTP_TRUST_EXPIRED </th> <td class="description">Credentials are expired</td></tr> | |
6232 | <tr><th>HTTP_TRUST_INVALID </th> <td class="description">Credentials are invalid</td></tr> | |
6233 | <tr><th>HTTP_TRUST_OK </th> <td class="description">Credentials are OK/trusted</td></tr> | |
6234 | <tr><th>HTTP_TRUST_RENEWED </th> <td class="description">Credentials have been renewed</td></tr> | |
6235 | <tr><th>HTTP_TRUST_UNKNOWN </th> <td class="description">Credentials are unknown/new</td></tr> | |
6236 | </tbody></table> | |
798d6e29 MS |
6237 | <h3 class="enumeration"><a id="http_uri_coding_e">http_uri_coding_e</a></h3> |
6238 | <p class="description">URI en/decode flags</p> | |
6239 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6240 | <table class="list"><tbody> |
6241 | <tr><th>HTTP_URI_CODING_ALL </th> <td class="description">En/decode everything</td></tr> | |
6242 | <tr><th>HTTP_URI_CODING_HOSTNAME </th> <td class="description">En/decode the hostname portion</td></tr> | |
6243 | <tr><th>HTTP_URI_CODING_MOST </th> <td class="description">En/decode all but the query</td></tr> | |
6244 | <tr><th>HTTP_URI_CODING_NONE </th> <td class="description">Don't en/decode anything</td></tr> | |
6245 | <tr><th>HTTP_URI_CODING_QUERY </th> <td class="description">En/decode the query portion</td></tr> | |
6246 | <tr><th>HTTP_URI_CODING_RESOURCE </th> <td class="description">En/decode the resource portion</td></tr> | |
6247 | <tr><th>HTTP_URI_CODING_RFC6874 </th> <td class="description">Use RFC 6874 address format</td></tr> | |
6248 | <tr><th>HTTP_URI_CODING_USERNAME </th> <td class="description">En/decode the username portion</td></tr> | |
6249 | </tbody></table> | |
798d6e29 MS |
6250 | <h3 class="enumeration"><a id="http_uri_status_e"><span class="info"> CUPS 1.2 </span>http_uri_status_e</a></h3> |
6251 | <p class="description">URI separation status </p> | |
6252 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6253 | <table class="list"><tbody> |
6254 | <tr><th>HTTP_URI_STATUS_BAD_ARGUMENTS </th> <td class="description">Bad arguments to function (error)</td></tr> | |
6255 | <tr><th>HTTP_URI_STATUS_BAD_HOSTNAME </th> <td class="description">Bad hostname in URI (error)</td></tr> | |
6256 | <tr><th>HTTP_URI_STATUS_BAD_PORT </th> <td class="description">Bad port number in URI (error)</td></tr> | |
6257 | <tr><th>HTTP_URI_STATUS_BAD_RESOURCE </th> <td class="description">Bad resource in URI (error)</td></tr> | |
6258 | <tr><th>HTTP_URI_STATUS_BAD_SCHEME </th> <td class="description">Bad scheme in URI (error)</td></tr> | |
6259 | <tr><th>HTTP_URI_STATUS_BAD_URI </th> <td class="description">Bad/empty URI (error)</td></tr> | |
6260 | <tr><th>HTTP_URI_STATUS_BAD_USERNAME </th> <td class="description">Bad username in URI (error)</td></tr> | |
6261 | <tr><th>HTTP_URI_STATUS_MISSING_RESOURCE </th> <td class="description">Missing resource in URI (warning)</td></tr> | |
6262 | <tr><th>HTTP_URI_STATUS_MISSING_SCHEME </th> <td class="description">Missing scheme in URI (warning)</td></tr> | |
6263 | <tr><th>HTTP_URI_STATUS_OK </th> <td class="description">URI decoded OK</td></tr> | |
6264 | <tr><th>HTTP_URI_STATUS_OVERFLOW </th> <td class="description">URI buffer for httpAssembleURI is too small</td></tr> | |
6265 | <tr><th>HTTP_URI_STATUS_UNKNOWN_SCHEME </th> <td class="description">Unknown scheme in URI (warning)</td></tr> | |
6266 | </tbody></table> | |
798d6e29 | 6267 | <h3 class="enumeration"><a id="ipp_finishings_e">ipp_finishings_e</a></h3> |
718ee2ff | 6268 | <p class="description">Finishings values</p> |
798d6e29 | 6269 | <h4 class="constants">Constants</h4> |
98d88c8d MS |
6270 | <table class="list"><tbody> |
6271 | <tr><th>IPP_FINISHINGS_BALE </th> <td class="description">Bale (any type)</td></tr> | |
6272 | <tr><th>IPP_FINISHINGS_BIND </th> <td class="description">Bind</td></tr> | |
6273 | <tr><th>IPP_FINISHINGS_BIND_BOTTOM </th> <td class="description">Bind on bottom</td></tr> | |
6274 | <tr><th>IPP_FINISHINGS_BIND_LEFT </th> <td class="description">Bind on left</td></tr> | |
6275 | <tr><th>IPP_FINISHINGS_BIND_RIGHT </th> <td class="description">Bind on right</td></tr> | |
6276 | <tr><th>IPP_FINISHINGS_BIND_TOP </th> <td class="description">Bind on top</td></tr> | |
6277 | <tr><th>IPP_FINISHINGS_BOOKLET_MAKER </th> <td class="description">Fold to make booklet</td></tr> | |
6278 | <tr><th>IPP_FINISHINGS_COAT </th> <td class="description">Apply protective liquid or powder coating</td></tr> | |
6279 | <tr><th>IPP_FINISHINGS_COVER </th> <td class="description">Add cover</td></tr> | |
6280 | <tr><th>IPP_FINISHINGS_EDGE_STITCH </th> <td class="description">Stitch along any side</td></tr> | |
6281 | <tr><th>IPP_FINISHINGS_EDGE_STITCH_BOTTOM </th> <td class="description">Stitch along bottom edge</td></tr> | |
6282 | <tr><th>IPP_FINISHINGS_EDGE_STITCH_LEFT </th> <td class="description">Stitch along left side</td></tr> | |
6283 | <tr><th>IPP_FINISHINGS_EDGE_STITCH_RIGHT </th> <td class="description">Stitch along right side</td></tr> | |
6284 | <tr><th>IPP_FINISHINGS_EDGE_STITCH_TOP </th> <td class="description">Stitch along top edge</td></tr> | |
6285 | <tr><th>IPP_FINISHINGS_FOLD </th> <td class="description">Fold (any type)</td></tr> | |
bea505c3 | 6286 | <tr><th>IPP_FINISHINGS_FOLD_ACCORDION </th> <td class="description">Accordion-fold the paper vertically into four sections</td></tr> |
98d88c8d MS |
6287 | <tr><th>IPP_FINISHINGS_FOLD_DOUBLE_GATE </th> <td class="description">Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically</td></tr> |
6288 | <tr><th>IPP_FINISHINGS_FOLD_ENGINEERING_Z </th> <td class="description">Fold the paper vertically into two small sections and one larger, forming an elongated Z</td></tr> | |
6289 | <tr><th>IPP_FINISHINGS_FOLD_GATE </th> <td class="description">Fold the top and bottom quarters of the paper towards the midline</td></tr> | |
6290 | <tr><th>IPP_FINISHINGS_FOLD_HALF </th> <td class="description">Fold the paper in half vertically</td></tr> | |
6291 | <tr><th>IPP_FINISHINGS_FOLD_HALF_Z </th> <td class="description">Fold the paper in half horizontally, then Z-fold the paper vertically</td></tr> | |
6292 | <tr><th>IPP_FINISHINGS_FOLD_LEFT_GATE </th> <td class="description">Fold the top quarter of the paper towards the midline</td></tr> | |
6293 | <tr><th>IPP_FINISHINGS_FOLD_LETTER </th> <td class="description">Fold the paper into three sections vertically; sometimes also known as a C fold</td></tr> | |
6294 | <tr><th>IPP_FINISHINGS_FOLD_PARALLEL </th> <td class="description">Fold the paper in half vertically two times, yielding four sections</td></tr> | |
6295 | <tr><th>IPP_FINISHINGS_FOLD_POSTER </th> <td class="description">Fold the paper in half horizontally and vertically; sometimes also called a cross fold</td></tr> | |
6296 | <tr><th>IPP_FINISHINGS_FOLD_RIGHT_GATE </th> <td class="description">Fold the bottom quarter of the paper towards the midline</td></tr> | |
6297 | <tr><th>IPP_FINISHINGS_FOLD_Z </th> <td class="description">Fold the paper vertically into three sections, forming a Z</td></tr> | |
6298 | <tr><th>IPP_FINISHINGS_JOG_OFFSET </th> <td class="description">Offset for binding (any type)</td></tr> | |
6299 | <tr><th>IPP_FINISHINGS_LAMINATE </th> <td class="description">Apply protective (solid) material</td></tr> | |
6300 | <tr><th>IPP_FINISHINGS_NONE </th> <td class="description">No finishing</td></tr> | |
6301 | <tr><th>IPP_FINISHINGS_PUNCH </th> <td class="description">Punch (any location/count)</td></tr> | |
6302 | <tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_LEFT </th> <td class="description">Punch 1 hole bottom left</td></tr> | |
6303 | <tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT </th> <td class="description">Punch 1 hole bottom right</td></tr> | |
6304 | <tr><th>IPP_FINISHINGS_PUNCH_DUAL_BOTTOM </th> <td class="description">Punch 2 holes bottom edge</td></tr> | |
6305 | <tr><th>IPP_FINISHINGS_PUNCH_DUAL_LEFT </th> <td class="description">Punch 2 holes left side</td></tr> | |
6306 | <tr><th>IPP_FINISHINGS_PUNCH_DUAL_RIGHT </th> <td class="description">Punch 2 holes right side</td></tr> | |
6307 | <tr><th>IPP_FINISHINGS_PUNCH_DUAL_TOP </th> <td class="description">Punch 2 holes top edge</td></tr> | |
bea505c3 MS |
6308 | <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM </th> <td class="description">Punch multiple holes bottom edge</td></tr> |
6309 | <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT </th> <td class="description">Punch multiple holes left side</td></tr> | |
6310 | <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT </th> <td class="description">Punch multiple holes right side</td></tr> | |
6311 | <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_TOP </th> <td class="description">Punch multiple holes top edge</td></tr> | |
98d88c8d MS |
6312 | <tr><th>IPP_FINISHINGS_PUNCH_QUAD_BOTTOM </th> <td class="description">Punch 4 holes bottom edge</td></tr> |
6313 | <tr><th>IPP_FINISHINGS_PUNCH_QUAD_LEFT </th> <td class="description">Punch 4 holes left side</td></tr> | |
6314 | <tr><th>IPP_FINISHINGS_PUNCH_QUAD_RIGHT </th> <td class="description">Punch 4 holes right side</td></tr> | |
6315 | <tr><th>IPP_FINISHINGS_PUNCH_QUAD_TOP </th> <td class="description">Punch 4 holes top edge</td></tr> | |
6316 | <tr><th>IPP_FINISHINGS_PUNCH_TOP_LEFT </th> <td class="description">Punch 1 hole top left</td></tr> | |
6317 | <tr><th>IPP_FINISHINGS_PUNCH_TOP_RIGHT </th> <td class="description">Punch 1 hole top right</td></tr> | |
6318 | <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM </th> <td class="description">Punch 3 holes bottom edge</td></tr> | |
6319 | <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_LEFT </th> <td class="description">Punch 3 holes left side</td></tr> | |
6320 | <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT </th> <td class="description">Punch 3 holes right side</td></tr> | |
6321 | <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_TOP </th> <td class="description">Punch 3 holes top edge</td></tr> | |
6322 | <tr><th>IPP_FINISHINGS_SADDLE_STITCH </th> <td class="description">Staple interior</td></tr> | |
6323 | <tr><th>IPP_FINISHINGS_STAPLE </th> <td class="description">Staple (any location/method)</td></tr> | |
6324 | <tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_LEFT </th> <td class="description">Staple bottom left corner</td></tr> | |
6325 | <tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT </th> <td class="description">Staple bottom right corner</td></tr> | |
6326 | <tr><th>IPP_FINISHINGS_STAPLE_DUAL_BOTTOM </th> <td class="description">Two staples on bottom</td></tr> | |
6327 | <tr><th>IPP_FINISHINGS_STAPLE_DUAL_LEFT </th> <td class="description">Two staples on left</td></tr> | |
6328 | <tr><th>IPP_FINISHINGS_STAPLE_DUAL_RIGHT </th> <td class="description">Two staples on right</td></tr> | |
6329 | <tr><th>IPP_FINISHINGS_STAPLE_DUAL_TOP </th> <td class="description">Two staples on top</td></tr> | |
6330 | <tr><th>IPP_FINISHINGS_STAPLE_TOP_LEFT </th> <td class="description">Staple top left corner</td></tr> | |
6331 | <tr><th>IPP_FINISHINGS_STAPLE_TOP_RIGHT </th> <td class="description">Staple top right corner</td></tr> | |
6332 | <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM </th> <td class="description">Three staples on bottom</td></tr> | |
6333 | <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_LEFT </th> <td class="description">Three staples on left</td></tr> | |
6334 | <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT </th> <td class="description">Three staples on right</td></tr> | |
6335 | <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_TOP </th> <td class="description">Three staples on top</td></tr> | |
6336 | <tr><th>IPP_FINISHINGS_TRIM </th> <td class="description">Trim (any type)</td></tr> | |
6337 | <tr><th>IPP_FINISHINGS_TRIM_AFTER_COPIES </th> <td class="description">Trim output after each copy</td></tr> | |
6338 | <tr><th>IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS </th> <td class="description">Trim output after each document</td></tr> | |
6339 | <tr><th>IPP_FINISHINGS_TRIM_AFTER_JOB </th> <td class="description">Trim output after job</td></tr> | |
6340 | <tr><th>IPP_FINISHINGS_TRIM_AFTER_PAGES </th> <td class="description">Trim output after each page</td></tr> | |
6341 | </tbody></table> | |
798d6e29 MS |
6342 | <h3 class="enumeration"><a id="ipp_jstate_e">ipp_jstate_e</a></h3> |
6343 | <p class="description">Job states</p> | |
6344 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6345 | <table class="list"><tbody> |
6346 | <tr><th>IPP_JSTATE_ABORTED </th> <td class="description">Job has aborted due to error</td></tr> | |
6347 | <tr><th>IPP_JSTATE_CANCELED </th> <td class="description">Job has been canceled</td></tr> | |
6348 | <tr><th>IPP_JSTATE_COMPLETED </th> <td class="description">Job has completed successfully</td></tr> | |
6349 | <tr><th>IPP_JSTATE_HELD </th> <td class="description">Job is held for printing</td></tr> | |
6350 | <tr><th>IPP_JSTATE_PENDING </th> <td class="description">Job is waiting to be printed</td></tr> | |
6351 | <tr><th>IPP_JSTATE_PROCESSING </th> <td class="description">Job is currently printing</td></tr> | |
6352 | <tr><th>IPP_JSTATE_STOPPED </th> <td class="description">Job has been stopped</td></tr> | |
6353 | </tbody></table> | |
798d6e29 MS |
6354 | <h3 class="enumeration"><a id="ipp_op_e">ipp_op_e</a></h3> |
6355 | <p class="description">IPP operations</p> | |
6356 | <h4 class="constants">Constants</h4> | |
98d88c8d | 6357 | <table class="list"><tbody> |
4f63d6cd | 6358 | <tr><th>IPP_OP_ALLOCATE_PRINTER_RESOURCES </th> <td class="description">Allocate-Printer-Resources: Use resources for a printer.</td></tr> |
98d88c8d MS |
6359 | <tr><th>IPP_OP_CANCEL_CURRENT_JOB </th> <td class="description">Cancel-Current-Job: Cancel the current job</td></tr> |
6360 | <tr><th>IPP_OP_CANCEL_JOB </th> <td class="description">Cancel-Job: Cancel a job</td></tr> | |
6361 | <tr><th>IPP_OP_CANCEL_JOBS </th> <td class="description">Cancel-Jobs: Cancel all jobs (administrative)</td></tr> | |
6362 | <tr><th>IPP_OP_CANCEL_MY_JOBS </th> <td class="description">Cancel-My-Jobs: Cancel a user's jobs</td></tr> | |
4f63d6cd | 6363 | <tr><th>IPP_OP_CANCEL_RESOURCE </th> <td class="description">Cancel-Resource: Uninstall a resource.</td></tr> |
98d88c8d MS |
6364 | <tr><th>IPP_OP_CANCEL_SUBSCRIPTION <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Cancel-Subscription: Cancel a subscription </td></tr> |
6365 | <tr><th>IPP_OP_CLOSE_JOB </th> <td class="description">Close-Job: Close a job and start printing</td></tr> | |
6366 | <tr><th>IPP_OP_CREATE_JOB </th> <td class="description">Create-Job: Create an empty print job</td></tr> | |
6367 | <tr><th>IPP_OP_CREATE_JOB_SUBSCRIPTIONS <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Create-Job-Subscriptions: Create one of more job subscriptions </td></tr> | |
4f63d6cd | 6368 | <tr><th>IPP_OP_CREATE_PRINTER </th> <td class="description">Create-Printer: Create a new service.</td></tr> |
98d88c8d | 6369 | <tr><th>IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Create-Printer-Subscriptions: Create one or more printer subscriptions </td></tr> |
4f63d6cd MS |
6370 | <tr><th>IPP_OP_CREATE_RESOURCE </th> <td class="description">Create-Resource: Create a new (empty) resource.</td></tr> |
6371 | <tr><th>IPP_OP_CREATE_RESOURCE_SUBSCRIPTIONS </th> <td class="description">Create-Resource-Subscriptions: Create event subscriptions for a resource.</td></tr> | |
6372 | <tr><th>IPP_OP_CREATE_SYSTEM_SUBSCRIPTIONS </th> <td class="description">Create-System-Subscriptions: Create event subscriptions for a system.</td></tr> | |
98d88c8d MS |
6373 | <tr><th>IPP_OP_CUPS_ADD_MODIFY_CLASS </th> <td class="description">CUPS-Add-Modify-Class: Add or modify a class</td></tr> |
6374 | <tr><th>IPP_OP_CUPS_ADD_MODIFY_PRINTER </th> <td class="description">CUPS-Add-Modify-Printer: Add or modify a printer</td></tr> | |
6375 | <tr><th>IPP_OP_CUPS_AUTHENTICATE_JOB <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">CUPS-Authenticate-Job: Authenticate a job </td></tr> | |
6376 | <tr><th>IPP_OP_CUPS_CREATE_LOCAL_PRINTER <span class="info"> CUPS 2.2 </span></th> <td class="description">CUPS-Create-Local-Printer: Create a local (temporary) printer </td></tr> | |
6377 | <tr><th>IPP_OP_CUPS_DELETE_CLASS </th> <td class="description">CUPS-Delete-Class: Delete a class</td></tr> | |
6378 | <tr><th>IPP_OP_CUPS_DELETE_PRINTER </th> <td class="description">CUPS-Delete-Printer: Delete a printer</td></tr> | |
6379 | <tr><th>IPP_OP_CUPS_GET_DEFAULT </th> <td class="description">CUPS-Get-Default: Get the default printer</td></tr> | |
6380 | <tr><th>IPP_OP_CUPS_GET_DEVICES <span class="info"> DEPRECATED </span></th> <td class="description">CUPS-Get-Devices: Get a list of supported devices </td></tr> | |
6381 | <tr><th>IPP_OP_CUPS_GET_DOCUMENT <span class="info"> CUPS 1.4/macOS 10.6 </span></th> <td class="description">CUPS-Get-Document: Get a document file </td></tr> | |
6382 | <tr><th>IPP_OP_CUPS_GET_PPD <span class="info"> DEPRECATED </span></th> <td class="description">CUPS-Get-PPD: Get a PPD file </td></tr> | |
6383 | <tr><th>IPP_OP_CUPS_GET_PPDS <span class="info"> DEPRECATED </span></th> <td class="description">CUPS-Get-PPDs: Get a list of supported drivers </td></tr> | |
6384 | <tr><th>IPP_OP_CUPS_GET_PRINTERS </th> <td class="description">CUPS-Get-Printers: Get a list of printers and/or classes</td></tr> | |
6385 | <tr><th>IPP_OP_CUPS_INVALID </th> <td class="description">Invalid operation name for <a href="#ippOpValue"><code>ippOpValue</code></a></td></tr> | |
6386 | <tr><th>IPP_OP_CUPS_MOVE_JOB </th> <td class="description">CUPS-Move-Job: Move a job to a different printer</td></tr> | |
6387 | <tr><th>IPP_OP_CUPS_SET_DEFAULT </th> <td class="description">CUPS-Set-Default: Set the default printer</td></tr> | |
4f63d6cd MS |
6388 | <tr><th>IPP_OP_DEALLOCATE_PRINTER_RESOURCES </th> <td class="description">Deallocate-Printer-Resources: Stop using resources for a printer.</td></tr> |
6389 | <tr><th>IPP_OP_DELETE_PRINTER </th> <td class="description">Delete-Printer: Delete an existing service.</td></tr> | |
6390 | <tr><th>IPP_OP_DISABLE_ALL_PRINTERS </th> <td class="description">Disable-All-Printers: Stop accepting new jobs on all services.</td></tr> | |
98d88c8d | 6391 | <tr><th>IPP_OP_DISABLE_PRINTER </th> <td class="description">Disable-Printer: Reject new jobs for a printer</td></tr> |
4f63d6cd | 6392 | <tr><th>IPP_OP_ENABLE_ALL_PRINTERS </th> <td class="description">Enable-All-Printers: Start accepting new jobs on all services.</td></tr> |
98d88c8d MS |
6393 | <tr><th>IPP_OP_ENABLE_PRINTER </th> <td class="description">Enable-Printer: Accept new jobs for a printer</td></tr> |
6394 | <tr><th>IPP_OP_GET_JOBS </th> <td class="description">Get-Jobs: Get a list of jobs</td></tr> | |
6395 | <tr><th>IPP_OP_GET_JOB_ATTRIBUTES </th> <td class="description">Get-Job-Attribute: Get information about a job</td></tr> | |
6396 | <tr><th>IPP_OP_GET_NOTIFICATIONS <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Get-Notifications: Get notification events </td></tr> | |
4f63d6cd | 6397 | <tr><th>IPP_OP_GET_PRINTERS </th> <td class="description">Get-Printers: Get a list of services.</td></tr> |
98d88c8d MS |
6398 | <tr><th>IPP_OP_GET_PRINTER_ATTRIBUTES </th> <td class="description">Get-Printer-Attributes: Get information about a printer</td></tr> |
6399 | <tr><th>IPP_OP_GET_PRINTER_SUPPORTED_VALUES </th> <td class="description">Get-Printer-Supported-Values: Get supported values</td></tr> | |
6400 | <tr><th>IPP_OP_GET_SUBSCRIPTIONS <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Get-Subscriptions: Get list of subscriptions </td></tr> | |
6401 | <tr><th>IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Get-Subscription-Attributes: Get subscription information </td></tr> | |
4f63d6cd MS |
6402 | <tr><th>IPP_OP_GET_SYSTEM_ATTRIBUTES </th> <td class="description">Get-System-Attributes: Get system object attributes.</td></tr> |
6403 | <tr><th>IPP_OP_GET_SYSTEM_SUPPORTED_VALUES </th> <td class="description">Get-System-Supported-Values: Get supported values for system object attributes.</td></tr> | |
98d88c8d MS |
6404 | <tr><th>IPP_OP_HOLD_JOB </th> <td class="description">Hold-Job: Hold a job for printing</td></tr> |
6405 | <tr><th>IPP_OP_HOLD_NEW_JOBS </th> <td class="description">Hold-New-Jobs: Hold new jobs</td></tr> | |
6406 | <tr><th>IPP_OP_IDENTIFY_PRINTER </th> <td class="description">Identify-Printer: Make the printer beep, flash, or display a message for identification</td></tr> | |
4f63d6cd MS |
6407 | <tr><th>IPP_OP_INSTALL_RESOURCE </th> <td class="description">Install-Resource: Install a resource.</td></tr> |
6408 | <tr><th>IPP_OP_PAUSE_ALL_PRINTERS </th> <td class="description">Pause-All-Printers: Stop all services immediately.</td></tr> | |
6409 | <tr><th>IPP_OP_PAUSE_ALL_PRINTERS_AFTER_CURRENT_JOB </th> <td class="description">Pause-All-Printers-After-Current-Job: Stop all services after processing the current jobs.</td></tr> | |
98d88c8d MS |
6410 | <tr><th>IPP_OP_PAUSE_PRINTER </th> <td class="description">Pause-Printer: Stop a printer</td></tr> |
6411 | <tr><th>IPP_OP_PAUSE_PRINTER_AFTER_CURRENT_JOB </th> <td class="description">Pause-Printer-After-Current-Job: Stop printer after the current job</td></tr> | |
6412 | <tr><th>IPP_OP_PRINT_JOB </th> <td class="description">Print-Job: Print a single file</td></tr> | |
6413 | <tr><th>IPP_OP_PROMOTE_JOB </th> <td class="description">Promote-Job: Promote a job to print sooner</td></tr> | |
4f63d6cd | 6414 | <tr><th>IPP_OP_REGISTER_OUTPUT_DEVICE </th> <td class="description">Register-Output-Device: Register a remote service.</td></tr> |
98d88c8d MS |
6415 | <tr><th>IPP_OP_RELEASE_HELD_NEW_JOBS </th> <td class="description">Release-Held-New-Jobs: Release new jobs that were previously held</td></tr> |
6416 | <tr><th>IPP_OP_RELEASE_JOB </th> <td class="description">Release-Job: Release a job for printing</td></tr> | |
6417 | <tr><th>IPP_OP_RENEW_SUBSCRIPTION <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Renew-Subscription: Renew a printer subscription </td></tr> | |
6418 | <tr><th>IPP_OP_RESTART_JOB <span class="info"> DEPRECATED </span></th> <td class="description">Restart-Job: Reprint a job </td></tr> | |
4f63d6cd MS |
6419 | <tr><th>IPP_OP_RESTART_SYSTEM </th> <td class="description">Restart-System: Restart all services.</td></tr> |
6420 | <tr><th>IPP_OP_RESUME_ALL_PRINTERS </th> <td class="description">Resume-All-Printers: Start job processing on all services.</td></tr> | |
98d88c8d MS |
6421 | <tr><th>IPP_OP_RESUME_JOB </th> <td class="description">Resume-Job: Resume the current job</td></tr> |
6422 | <tr><th>IPP_OP_RESUME_PRINTER </th> <td class="description">Resume-Printer: Start a printer</td></tr> | |
6423 | <tr><th>IPP_OP_SCHEDULE_JOB_AFTER </th> <td class="description">Schedule-Job-After: Schedule a job to print after another</td></tr> | |
6424 | <tr><th>IPP_OP_SEND_DOCUMENT </th> <td class="description">Send-Document: Add a file to a job</td></tr> | |
4f63d6cd | 6425 | <tr><th>IPP_OP_SEND_RESOURCE_DATA </th> <td class="description">Send-Resource-Data: Upload the data for a resource.</td></tr> |
98d88c8d MS |
6426 | <tr><th>IPP_OP_SET_JOB_ATTRIBUTES </th> <td class="description">Set-Job-Attributes: Set job values</td></tr> |
6427 | <tr><th>IPP_OP_SET_PRINTER_ATTRIBUTES </th> <td class="description">Set-Printer-Attributes: Set printer values</td></tr> | |
4f63d6cd MS |
6428 | <tr><th>IPP_OP_SET_RESOURCE_ATTRIBUTES </th> <td class="description">Set-Resource-Attributes: Set resource object attributes.</td></tr> |
6429 | <tr><th>IPP_OP_SET_SYSTEM_ATTRIBUTES </th> <td class="description">Set-System-Attributes: Set system object attributes.</td></tr> | |
6430 | <tr><th>IPP_OP_SHUTDOWN_ALL_PRINTERS </th> <td class="description">Shutdown-All-Printers: Shutdown all services.</td></tr> | |
6431 | <tr><th>IPP_OP_SHUTDOWN_ONE_PRINTER </th> <td class="description">Shutdown-One-Printer: Shutdown a service.</td></tr> | |
6432 | <tr><th>IPP_OP_STARTUP_ALL_PRINTERS </th> <td class="description">Startup-All-Printers: Startup all services.</td></tr> | |
6433 | <tr><th>IPP_OP_STARTUP_ONE_PRINTER </th> <td class="description">Startup-One-Printer: Start a service.</td></tr> | |
98d88c8d MS |
6434 | <tr><th>IPP_OP_SUSPEND_CURRENT_JOB </th> <td class="description">Suspend-Current-Job: Suspend the current job</td></tr> |
6435 | <tr><th>IPP_OP_VALIDATE_JOB </th> <td class="description">Validate-Job: Validate job values prior to submission</td></tr> | |
6436 | </tbody></table> | |
798d6e29 MS |
6437 | <h3 class="enumeration"><a id="ipp_orient_e">ipp_orient_e</a></h3> |
6438 | <p class="description">Orientation values</p> | |
6439 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6440 | <table class="list"><tbody> |
6441 | <tr><th>IPP_ORIENT_LANDSCAPE </th> <td class="description">90 degrees counter-clockwise</td></tr> | |
6442 | <tr><th>IPP_ORIENT_NONE </th> <td class="description">No rotation</td></tr> | |
6443 | <tr><th>IPP_ORIENT_PORTRAIT </th> <td class="description">No rotation</td></tr> | |
6444 | <tr><th>IPP_ORIENT_REVERSE_LANDSCAPE </th> <td class="description">90 degrees clockwise</td></tr> | |
6445 | <tr><th>IPP_ORIENT_REVERSE_PORTRAIT </th> <td class="description">180 degrees</td></tr> | |
6446 | </tbody></table> | |
798d6e29 | 6447 | <h3 class="enumeration"><a id="ipp_pstate_e">ipp_pstate_e</a></h3> |
65bebeac | 6448 | <p class="description">Printer state values</p> |
798d6e29 | 6449 | <h4 class="constants">Constants</h4> |
98d88c8d MS |
6450 | <table class="list"><tbody> |
6451 | <tr><th>IPP_PSTATE_IDLE </th> <td class="description">Printer is idle</td></tr> | |
6452 | <tr><th>IPP_PSTATE_PROCESSING </th> <td class="description">Printer is working</td></tr> | |
6453 | <tr><th>IPP_PSTATE_STOPPED </th> <td class="description">Printer is stopped</td></tr> | |
6454 | </tbody></table> | |
798d6e29 | 6455 | <h3 class="enumeration"><a id="ipp_quality_e">ipp_quality_e</a></h3> |
65bebeac | 6456 | <p class="description">Print quality values</p> |
798d6e29 | 6457 | <h4 class="constants">Constants</h4> |
98d88c8d MS |
6458 | <table class="list"><tbody> |
6459 | <tr><th>IPP_QUALITY_DRAFT </th> <td class="description">Draft quality</td></tr> | |
6460 | <tr><th>IPP_QUALITY_HIGH </th> <td class="description">High quality</td></tr> | |
6461 | <tr><th>IPP_QUALITY_NORMAL </th> <td class="description">Normal quality</td></tr> | |
6462 | </tbody></table> | |
798d6e29 MS |
6463 | <h3 class="enumeration"><a id="ipp_res_e">ipp_res_e</a></h3> |
6464 | <p class="description">Resolution units</p> | |
6465 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6466 | <table class="list"><tbody> |
6467 | <tr><th>IPP_RES_PER_CM </th> <td class="description">Pixels per centimeter</td></tr> | |
6468 | <tr><th>IPP_RES_PER_INCH </th> <td class="description">Pixels per inch</td></tr> | |
06a5a4d3 MS |
6469 | </tbody></table> |
6470 | <h3 class="enumeration"><a id="ipp_rstate_e">ipp_rstate_e</a></h3> | |
6471 | <p class="description">resource-state values</p> | |
6472 | <h4 class="constants">Constants</h4> | |
6473 | <table class="list"><tbody> | |
6474 | <tr><th>IPP_RSTATE_ABORTED </th> <td class="description">Resource has been aborted and is pending deletion.</td></tr> | |
6475 | <tr><th>IPP_RSTATE_AVAILABLE </th> <td class="description">Resource is available for installation.</td></tr> | |
6476 | <tr><th>IPP_RSTATE_CANCELED </th> <td class="description">Resource has been canceled and is pending deletion.</td></tr> | |
6477 | <tr><th>IPP_RSTATE_INSTALLED </th> <td class="description">Resource is installed.</td></tr> | |
6478 | <tr><th>IPP_RSTATE_PENDING </th> <td class="description">Resource is created but has no data yet.</td></tr> | |
6479 | </tbody></table> | |
6480 | <h3 class="enumeration"><a id="ipp_sstate_e">ipp_sstate_e</a></h3> | |
6481 | <p class="description">system-state values</p> | |
6482 | <h4 class="constants">Constants</h4> | |
6483 | <table class="list"><tbody> | |
6484 | <tr><th>IPP_SSTATE_IDLE </th> <td class="description">At least one printer is idle and none are processing a job.</td></tr> | |
6485 | <tr><th>IPP_SSTATE_PROCESSING </th> <td class="description">At least one printer is processing a job.</td></tr> | |
6486 | <tr><th>IPP_SSTATE_STOPPED </th> <td class="description">All printers are stopped.</td></tr> | |
98d88c8d | 6487 | </tbody></table> |
798d6e29 | 6488 | <h3 class="enumeration"><a id="ipp_state_e">ipp_state_e</a></h3> |
65bebeac | 6489 | <p class="description">ipp_t state values</p> |
798d6e29 | 6490 | <h4 class="constants">Constants</h4> |
98d88c8d MS |
6491 | <table class="list"><tbody> |
6492 | <tr><th>IPP_STATE_ATTRIBUTE </th> <td class="description">One or more attributes need to be sent/received</td></tr> | |
6493 | <tr><th>IPP_STATE_DATA </th> <td class="description">IPP request data needs to be sent/received</td></tr> | |
6494 | <tr><th>IPP_STATE_ERROR </th> <td class="description">An error occurred</td></tr> | |
6495 | <tr><th>IPP_STATE_HEADER </th> <td class="description">The request header needs to be sent/received</td></tr> | |
6496 | <tr><th>IPP_STATE_IDLE </th> <td class="description">Nothing is happening/request completed</td></tr> | |
6497 | </tbody></table> | |
798d6e29 | 6498 | <h3 class="enumeration"><a id="ipp_status_e">ipp_status_e</a></h3> |
65bebeac | 6499 | <p class="description">IPP status code values</p> |
798d6e29 | 6500 | <h4 class="constants">Constants</h4> |
98d88c8d MS |
6501 | <table class="list"><tbody> |
6502 | <tr><th>IPP_STATUS_CUPS_INVALID </th> <td class="description">Invalid status name for <a href="#ippErrorValue"><code>ippErrorValue</code></a></td></tr> | |
6503 | <tr><th>IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED </th> <td class="description">client-error-account-authorization-failed</td></tr> | |
6504 | <tr><th>IPP_STATUS_ERROR_ACCOUNT_CLOSED </th> <td class="description">client-error-account-closed</td></tr> | |
6505 | <tr><th>IPP_STATUS_ERROR_ACCOUNT_INFO_NEEDED </th> <td class="description">client-error-account-info-needed</td></tr> | |
6506 | <tr><th>IPP_STATUS_ERROR_ACCOUNT_LIMIT_REACHED </th> <td class="description">client-error-account-limit-reached</td></tr> | |
6507 | <tr><th>IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE </th> <td class="description">client-error-attributes-not-settable</td></tr> | |
6508 | <tr><th>IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES </th> <td class="description">client-error-attributes-or-values-not-supported</td></tr> | |
6509 | <tr><th>IPP_STATUS_ERROR_BAD_REQUEST </th> <td class="description">client-error-bad-request</td></tr> | |
6510 | <tr><th>IPP_STATUS_ERROR_BUSY </th> <td class="description">server-error-busy</td></tr> | |
6511 | <tr><th>IPP_STATUS_ERROR_CHARSET </th> <td class="description">client-error-charset-not-supported</td></tr> | |
6512 | <tr><th>IPP_STATUS_ERROR_COMPRESSION_ERROR </th> <td class="description">client-error-compression-error</td></tr> | |
6513 | <tr><th>IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED </th> <td class="description">client-error-compression-not-supported</td></tr> | |
6514 | <tr><th>IPP_STATUS_ERROR_CONFLICTING </th> <td class="description">client-error-conflicting-attributes</td></tr> | |
6515 | <tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED <span class="info"> DEPRECATED </span></th> <td class="description">cups-error-account-authorization-failed </td></tr> | |
6516 | <tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED </th> <td class="description">cups-error-account-closed @deprecate@</td></tr> | |
6517 | <tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED <span class="info"> DEPRECATED </span></th> <td class="description">cups-error-account-info-needed </td></tr> | |
6518 | <tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED <span class="info"> DEPRECATED </span></th> <td class="description">cups-error-account-limit-reached </td></tr> | |
6519 | <tr><th>IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED <span class="info"> CUPS 1.5/macOS 10.7 </span></th> <td class="description">cups-authentication-canceled - Authentication canceled by user </td></tr> | |
6520 | <tr><th>IPP_STATUS_ERROR_CUPS_PKI <span class="info"> CUPS 1.5/macOS 10.7 </span></th> <td class="description">cups-pki-error - Error negotiating a secure connection </td></tr> | |
6521 | <tr><th>IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED <span class="info"> CUPS 1.5/macOS 10.7 </span></th> <td class="description">cups-upgrade-required - TLS upgrade required </td></tr> | |
6522 | <tr><th>IPP_STATUS_ERROR_DEVICE </th> <td class="description">server-error-device-error</td></tr> | |
6523 | <tr><th>IPP_STATUS_ERROR_DOCUMENT_ACCESS </th> <td class="description">client-error-document-access-error</td></tr> | |
6524 | <tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR </th> <td class="description">client-error-document-format-error</td></tr> | |
6525 | <tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED </th> <td class="description">client-error-document-format-not-supported</td></tr> | |
6526 | <tr><th>IPP_STATUS_ERROR_DOCUMENT_PASSWORD </th> <td class="description">client-error-document-password-error</td></tr> | |
6527 | <tr><th>IPP_STATUS_ERROR_DOCUMENT_PERMISSION </th> <td class="description">client-error-document-permission-error</td></tr> | |
6528 | <tr><th>IPP_STATUS_ERROR_DOCUMENT_SECURITY </th> <td class="description">client-error-document-security-error</td></tr> | |
6529 | <tr><th>IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE </th> <td class="description">client-error-document-unprintable-error</td></tr> | |
6530 | <tr><th>IPP_STATUS_ERROR_FORBIDDEN </th> <td class="description">client-error-forbidden</td></tr> | |
6531 | <tr><th>IPP_STATUS_ERROR_GONE </th> <td class="description">client-error-gone</td></tr> | |
6532 | <tr><th>IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS </th> <td class="description">client-error-ignored-all-subscriptions</td></tr> | |
6533 | <tr><th>IPP_STATUS_ERROR_INTERNAL </th> <td class="description">server-error-internal-error</td></tr> | |
6534 | <tr><th>IPP_STATUS_ERROR_JOB_CANCELED </th> <td class="description">server-error-job-canceled</td></tr> | |
6535 | <tr><th>IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED </th> <td class="description">server-error-multiple-document-jobs-not-supported</td></tr> | |
6536 | <tr><th>IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS </th> <td class="description">server-error-not-accepting-jobs</td></tr> | |
6537 | <tr><th>IPP_STATUS_ERROR_NOT_AUTHENTICATED </th> <td class="description">client-error-not-authenticated</td></tr> | |
6538 | <tr><th>IPP_STATUS_ERROR_NOT_AUTHORIZED </th> <td class="description">client-error-not-authorized</td></tr> | |
6539 | <tr><th>IPP_STATUS_ERROR_NOT_FETCHABLE </th> <td class="description">client-error-not-fetchable</td></tr> | |
6540 | <tr><th>IPP_STATUS_ERROR_NOT_FOUND </th> <td class="description">client-error-not-found</td></tr> | |
6541 | <tr><th>IPP_STATUS_ERROR_NOT_POSSIBLE </th> <td class="description">client-error-not-possible</td></tr> | |
6542 | <tr><th>IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED </th> <td class="description">server-error-operation-not-supported</td></tr> | |
6543 | <tr><th>IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED </th> <td class="description">server-error-printer-is-deactivated</td></tr> | |
6544 | <tr><th>IPP_STATUS_ERROR_REQUEST_ENTITY </th> <td class="description">client-error-request-entity-too-large</td></tr> | |
6545 | <tr><th>IPP_STATUS_ERROR_REQUEST_VALUE </th> <td class="description">client-error-request-value-too-long</td></tr> | |
6546 | <tr><th>IPP_STATUS_ERROR_SERVICE_UNAVAILABLE </th> <td class="description">server-error-service-unavailable</td></tr> | |
6547 | <tr><th>IPP_STATUS_ERROR_TEMPORARY </th> <td class="description">server-error-temporary-error</td></tr> | |
6548 | <tr><th>IPP_STATUS_ERROR_TIMEOUT </th> <td class="description">client-error-timeout</td></tr> | |
6549 | <tr><th>IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS </th> <td class="description">server-error-too-many-documents</td></tr> | |
6550 | <tr><th>IPP_STATUS_ERROR_TOO_MANY_JOBS </th> <td class="description">server-error-too-many-jobs</td></tr> | |
6551 | <tr><th>IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS </th> <td class="description">client-error-too-many-subscriptions</td></tr> | |
6552 | <tr><th>IPP_STATUS_ERROR_URI_SCHEME </th> <td class="description">client-error-uri-scheme-not-supported</td></tr> | |
6553 | <tr><th>IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED </th> <td class="description">server-error-version-not-supported</td></tr> | |
6554 | <tr><th>IPP_STATUS_OK </th> <td class="description">successful-ok</td></tr> | |
6555 | <tr><th>IPP_STATUS_OK_CONFLICTING </th> <td class="description">successful-ok-conflicting-attributes</td></tr> | |
6556 | <tr><th>IPP_STATUS_OK_EVENTS_COMPLETE </th> <td class="description">successful-ok-events-complete</td></tr> | |
6557 | <tr><th>IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED </th> <td class="description">successful-ok-ignored-or-substituted-attributes</td></tr> | |
6558 | <tr><th>IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS </th> <td class="description">successful-ok-ignored-subscriptions</td></tr> | |
6559 | <tr><th>IPP_STATUS_OK_TOO_MANY_EVENTS </th> <td class="description">successful-ok-too-many-events</td></tr> | |
6560 | </tbody></table> | |
798d6e29 | 6561 | <h3 class="enumeration"><a id="ipp_tag_e">ipp_tag_e</a></h3> |
65bebeac | 6562 | <p class="description">Value and group tag values for attributes</p> |
798d6e29 | 6563 | <h4 class="constants">Constants</h4> |
98d88c8d MS |
6564 | <table class="list"><tbody> |
6565 | <tr><th>IPP_TAG_ADMINDEFINE </th> <td class="description">Admin-defined value</td></tr> | |
6566 | <tr><th>IPP_TAG_BOOLEAN </th> <td class="description">Boolean value</td></tr> | |
6567 | <tr><th>IPP_TAG_CHARSET </th> <td class="description">Character set value</td></tr> | |
6568 | <tr><th>IPP_TAG_CUPS_INVALID </th> <td class="description">Invalid tag name for <a href="#ippTagValue"><code>ippTagValue</code></a></td></tr> | |
6569 | <tr><th>IPP_TAG_DATE </th> <td class="description">Date/time value</td></tr> | |
6570 | <tr><th>IPP_TAG_DEFAULT </th> <td class="description">Default value</td></tr> | |
6571 | <tr><th>IPP_TAG_DELETEATTR </th> <td class="description">Delete-attribute value</td></tr> | |
4f63d6cd | 6572 | <tr><th>IPP_TAG_DOCUMENT </th> <td class="description">Document group</td></tr> |
98d88c8d MS |
6573 | <tr><th>IPP_TAG_END </th> <td class="description">End-of-attributes</td></tr> |
6574 | <tr><th>IPP_TAG_ENUM </th> <td class="description">Enumeration value</td></tr> | |
6575 | <tr><th>IPP_TAG_EVENT_NOTIFICATION </th> <td class="description">Event group</td></tr> | |
6576 | <tr><th>IPP_TAG_INTEGER </th> <td class="description">Integer value</td></tr> | |
6577 | <tr><th>IPP_TAG_JOB </th> <td class="description">Job group</td></tr> | |
6578 | <tr><th>IPP_TAG_KEYWORD </th> <td class="description">Keyword value</td></tr> | |
6579 | <tr><th>IPP_TAG_LANGUAGE </th> <td class="description">Language value</td></tr> | |
6580 | <tr><th>IPP_TAG_MIMETYPE </th> <td class="description">MIME media type value</td></tr> | |
6581 | <tr><th>IPP_TAG_NAME </th> <td class="description">Name value</td></tr> | |
6582 | <tr><th>IPP_TAG_NAMELANG </th> <td class="description">Name-with-language value</td></tr> | |
6583 | <tr><th>IPP_TAG_NOTSETTABLE </th> <td class="description">Not-settable value</td></tr> | |
6584 | <tr><th>IPP_TAG_NOVALUE </th> <td class="description">No-value value</td></tr> | |
6585 | <tr><th>IPP_TAG_OPERATION </th> <td class="description">Operation group</td></tr> | |
6586 | <tr><th>IPP_TAG_PRINTER </th> <td class="description">Printer group</td></tr> | |
6587 | <tr><th>IPP_TAG_RANGE </th> <td class="description">Range value</td></tr> | |
6588 | <tr><th>IPP_TAG_RESOLUTION </th> <td class="description">Resolution value</td></tr> | |
4f63d6cd | 6589 | <tr><th>IPP_TAG_RESOURCE </th> <td class="description">Resource group</td></tr> |
98d88c8d MS |
6590 | <tr><th>IPP_TAG_STRING </th> <td class="description">Octet string value</td></tr> |
6591 | <tr><th>IPP_TAG_SUBSCRIPTION </th> <td class="description">Subscription group</td></tr> | |
4f63d6cd | 6592 | <tr><th>IPP_TAG_SYSTEM </th> <td class="description">System group</td></tr> |
98d88c8d MS |
6593 | <tr><th>IPP_TAG_TEXT </th> <td class="description">Text value</td></tr> |
6594 | <tr><th>IPP_TAG_TEXTLANG </th> <td class="description">Text-with-language value</td></tr> | |
6595 | <tr><th>IPP_TAG_UNKNOWN </th> <td class="description">Unknown value</td></tr> | |
6596 | <tr><th>IPP_TAG_UNSUPPORTED_GROUP </th> <td class="description">Unsupported attributes group</td></tr> | |
6597 | <tr><th>IPP_TAG_UNSUPPORTED_VALUE </th> <td class="description">Unsupported value</td></tr> | |
6598 | <tr><th>IPP_TAG_URI </th> <td class="description">URI value</td></tr> | |
6599 | <tr><th>IPP_TAG_URISCHEME </th> <td class="description">URI scheme value</td></tr> | |
6600 | <tr><th>IPP_TAG_ZERO </th> <td class="description">Zero tag - used for separators</td></tr> | |
6601 | </tbody></table> | |
798d6e29 MS |
6602 | </div> |
6603 | </body> | |
6604 | </html> |