]>
Commit | Line | Data |
---|---|---|
798d6e29 MS |
1 | <!doctype html> |
2 | <html> | |
3 | <!-- SECTION: Programming --> | |
4 | <head> | |
5 | <title>CUPS Programming Manual</title> | |
6 | <meta name="keywords" content="Programming"> | |
7 | <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
8 | <meta name="creator" content="Mini-XML v2.11"> | |
9 | <meta name="author" content="Michael R Sweet"> | |
9c44e2cb | 10 | <meta name="copyright" content="Copyright © 2007-2017 by Apple Inc. All Rights Reserved."> |
f1175a5a | 11 | <meta name="version" content="2.2.5"> |
798d6e29 MS |
12 | <style type="text/css"><!-- |
13 | body, p, h1, h2, h3, h4 { | |
14 | font-family: sans-serif; | |
15 | } | |
16 | div.body h1 { | |
17 | font-size: 250%; | |
18 | font-weight: bold; | |
19 | margin: 0; | |
20 | } | |
21 | div.body h2 { | |
22 | font-size: 250%; | |
23 | margin-top: 1.5em; | |
24 | } | |
25 | div.body h3 { | |
26 | font-size: 150%; | |
27 | margin-bottom: 0.5em; | |
28 | margin-top: 1.5em; | |
29 | } | |
30 | div.body h4 { | |
31 | font-size: 110%; | |
32 | margin-bottom: 0.5em; | |
33 | margin-top: 1.5em; | |
34 | } | |
35 | div.body h5 { | |
36 | font-size: 100%; | |
37 | margin-bottom: 0.5em; | |
38 | margin-top: 1.5em; | |
39 | } | |
40 | div.contents { | |
41 | background: #e8e8e8; | |
42 | border: solid thin black; | |
43 | padding: 10px; | |
44 | } | |
45 | div.contents h1 { | |
46 | font-size: 110%; | |
47 | } | |
48 | div.contents h2 { | |
49 | font-size: 100%; | |
50 | } | |
51 | div.contents ul.contents { | |
52 | font-size: 80%; | |
53 | } | |
54 | .class { | |
55 | border-bottom: solid 2px gray; | |
56 | } | |
57 | .constants { | |
58 | } | |
59 | .description { | |
60 | margin-top: 0.5em; | |
61 | } | |
62 | .discussion { | |
63 | } | |
64 | .enumeration { | |
65 | border-bottom: solid 2px gray; | |
66 | } | |
67 | .function { | |
68 | border-bottom: solid 2px gray; | |
69 | margin-bottom: 0; | |
70 | } | |
71 | .members { | |
72 | } | |
73 | .method { | |
74 | } | |
75 | .parameters { | |
76 | } | |
77 | .returnvalue { | |
78 | } | |
79 | .struct { | |
80 | border-bottom: solid 2px gray; | |
81 | } | |
82 | .typedef { | |
83 | border-bottom: solid 2px gray; | |
84 | } | |
85 | .union { | |
86 | border-bottom: solid 2px gray; | |
87 | } | |
88 | .variable { | |
89 | } | |
9c44e2cb MS |
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 { | |
100 | background: rgba(127,127,127,0.1); | |
101 | border: thin dotted gray; | |
102 | font-family: monospace; | |
103 | font-size: 90%; | |
104 | hyphens: manual; | |
105 | -webkit-hyphens: manual; | |
106 | page-break-inside: avoid; | |
107 | } | |
108 | p.code, pre, ul.code li { | |
109 | padding: 10px; | |
110 | } | |
111 | p code, li code { | |
112 | padding: 2px 5px; | |
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 | } | |
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 | } |
98d88c8d MS |
150 | table.list tr:nth-child(even) { |
151 | background: rgba(127,127,127,0.1);]n} | |
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 MS |
163 | } |
164 | h1.title { | |
165 | } | |
166 | h2.title { | |
167 | border-bottom: solid 2px black; | |
168 | } | |
169 | h3.title { | |
170 | border-bottom: solid 2px black; | |
171 | } | |
172 | --></style> | |
173 | </head> | |
174 | <body> | |
175 | <h1 class="title">CUPS Programming Manual</h1> | |
176 | <p>Michael R Sweet</p> | |
9c44e2cb | 177 | <p>Copyright © 2007-2017 by Apple Inc. All Rights Reserved.</p> |
798d6e29 MS |
178 | <div class="contents"> |
179 | <h2 class="title">Contents</h2> | |
180 | <ul class="contents"> | |
53af7f21 MS |
181 | <li><a href="#introduction">Introduction</a><ul class="subcontents"> |
182 | <li><a href="#guidelines">Guidelines</a></li> | |
183 | <li><a href="#terms-used-in-this-document">Terms Used in This Document</a></li> | |
184 | <li><a href="#compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></li> | |
798d6e29 | 185 | </ul></li> |
53af7f21 MS |
186 | <li><a href="#working-with-destinations">Working with Destinations</a><ul class="subcontents"> |
187 | <li><a href="#finding-available-destinations">Finding Available Destinations</a></li> | |
188 | <li><a href="#basic-destination-information">Basic Destination Information</a></li> | |
189 | <li><a href="#detailed-destination-information">Detailed Destination Information</a></li> | |
190 | <li><a href="#submitting-a-print-job">Submitting a Print Job</a></li> | |
798d6e29 | 191 | </ul></li> |
b0fb2d75 MS |
192 | <li><a href="#sending-ipp-requests">Sending IPP Requests</a><ul class="subcontents"> |
193 | <li><a href="#connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</a></li> | |
194 | <li><a href="#creating-an-ipp-request">Creating an IPP Request</a></li> | |
195 | <li><a href="#sending-the-ipp-request">Sending the IPP Request</a></li> | |
196 | <li><a href="#processing-the-ipp-response">Processing the IPP Response</a></li> | |
197 | <li><a href="#authentication">Authentication</a></li> | |
198 | </ul></li> | |
798d6e29 MS |
199 | <li><a href="#FUNCTIONS">Functions</a><ul class="subcontents"> |
200 | <li><a href="#cupsAddDest">cupsAddDest</a></li> | |
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 MS |
212 | <li><a href="#cupsDoAuthentication">cupsDoAuthentication</a></li> |
213 | <li><a href="#cupsEncodeOptions">cupsEncodeOptions</a></li> | |
214 | <li><a href="#cupsEncodeOptions2">cupsEncodeOptions2</a></li> | |
215 | <li><a href="#cupsEncryption">cupsEncryption</a></li> | |
216 | <li><a href="#cupsEnumDests">cupsEnumDests</a></li> | |
798d6e29 MS |
217 | <li><a href="#cupsFindDestDefault">cupsFindDestDefault</a></li> |
218 | <li><a href="#cupsFindDestReady">cupsFindDestReady</a></li> | |
219 | <li><a href="#cupsFindDestSupported">cupsFindDestSupported</a></li> | |
220 | <li><a href="#cupsFinishDestDocument">cupsFinishDestDocument</a></li> | |
798d6e29 MS |
221 | <li><a href="#cupsFreeDestInfo">cupsFreeDestInfo</a></li> |
222 | <li><a href="#cupsFreeDests">cupsFreeDests</a></li> | |
223 | <li><a href="#cupsFreeJobs">cupsFreeJobs</a></li> | |
224 | <li><a href="#cupsFreeOptions">cupsFreeOptions</a></li> | |
798d6e29 MS |
225 | <li><a href="#cupsGetDest">cupsGetDest</a></li> |
226 | <li><a href="#cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></li> | |
227 | <li><a href="#cupsGetDestMediaByName">cupsGetDestMediaByName</a></li> | |
228 | <li><a href="#cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></li> | |
229 | <li><a href="#cupsGetDestMediaCount">cupsGetDestMediaCount</a></li> | |
230 | <li><a href="#cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></li> | |
231 | <li><a href="#cupsGetDestWithURI">cupsGetDestWithURI</a></li> | |
98d88c8d | 232 | <li><a href="#cupsGetDests2">cupsGetDests2</a></li> |
53af7f21 | 233 | <li><a href="#cupsGetIntegerOption">cupsGetIntegerOption</a></li> |
798d6e29 MS |
234 | <li><a href="#cupsGetJobs2">cupsGetJobs2</a></li> |
235 | <li><a href="#cupsGetNamedDest">cupsGetNamedDest</a></li> | |
236 | <li><a href="#cupsGetOption">cupsGetOption</a></li> | |
798d6e29 | 237 | <li><a href="#cupsGetPassword2">cupsGetPassword2</a></li> |
798d6e29 MS |
238 | <li><a href="#cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></li> |
239 | <li><a href="#cupsLocalizeDestOption">cupsLocalizeDestOption</a></li> | |
240 | <li><a href="#cupsLocalizeDestValue">cupsLocalizeDestValue</a></li> | |
241 | <li><a href="#cupsMakeServerCredentials">cupsMakeServerCredentials</a></li> | |
798d6e29 | 242 | <li><a href="#cupsParseOptions">cupsParseOptions</a></li> |
798d6e29 MS |
243 | <li><a href="#cupsRemoveDest">cupsRemoveDest</a></li> |
244 | <li><a href="#cupsRemoveOption">cupsRemoveOption</a></li> | |
245 | <li><a href="#cupsServer">cupsServer</a></li> | |
246 | <li><a href="#cupsSetClientCertCB">cupsSetClientCertCB</a></li> | |
247 | <li><a href="#cupsSetCredentials">cupsSetCredentials</a></li> | |
248 | <li><a href="#cupsSetDefaultDest">cupsSetDefaultDest</a></li> | |
798d6e29 MS |
249 | <li><a href="#cupsSetDests2">cupsSetDests2</a></li> |
250 | <li><a href="#cupsSetEncryption">cupsSetEncryption</a></li> | |
798d6e29 MS |
251 | <li><a href="#cupsSetPasswordCB2">cupsSetPasswordCB2</a></li> |
252 | <li><a href="#cupsSetServer">cupsSetServer</a></li> | |
253 | <li><a href="#cupsSetServerCertCB">cupsSetServerCertCB</a></li> | |
254 | <li><a href="#cupsSetServerCredentials">cupsSetServerCredentials</a></li> | |
255 | <li><a href="#cupsSetUser">cupsSetUser</a></li> | |
256 | <li><a href="#cupsSetUserAgent">cupsSetUserAgent</a></li> | |
257 | <li><a href="#cupsStartDestDocument">cupsStartDestDocument</a></li> | |
798d6e29 MS |
258 | <li><a href="#cupsUser">cupsUser</a></li> |
259 | <li><a href="#cupsUserAgent">cupsUserAgent</a></li> | |
260 | <li><a href="#httpAcceptConnection">httpAcceptConnection</a></li> | |
261 | <li><a href="#httpAddCredential">httpAddCredential</a></li> | |
262 | <li><a href="#httpAddrAny">httpAddrAny</a></li> | |
263 | <li><a href="#httpAddrClose">httpAddrClose</a></li> | |
798d6e29 MS |
264 | <li><a href="#httpAddrConnect2">httpAddrConnect2</a></li> |
265 | <li><a href="#httpAddrCopyList">httpAddrCopyList</a></li> | |
266 | <li><a href="#httpAddrEqual">httpAddrEqual</a></li> | |
267 | <li><a href="#httpAddrFamily">httpAddrFamily</a></li> | |
268 | <li><a href="#httpAddrFreeList">httpAddrFreeList</a></li> | |
269 | <li><a href="#httpAddrGetList">httpAddrGetList</a></li> | |
270 | <li><a href="#httpAddrLength">httpAddrLength</a></li> | |
271 | <li><a href="#httpAddrListen">httpAddrListen</a></li> | |
272 | <li><a href="#httpAddrLocalhost">httpAddrLocalhost</a></li> | |
273 | <li><a href="#httpAddrLookup">httpAddrLookup</a></li> | |
274 | <li><a href="#httpAddrPort">httpAddrPort</a></li> | |
275 | <li><a href="#httpAddrString">httpAddrString</a></li> | |
276 | <li><a href="#httpAssembleURI">httpAssembleURI</a></li> | |
277 | <li><a href="#httpAssembleURIf">httpAssembleURIf</a></li> | |
278 | <li><a href="#httpAssembleUUID">httpAssembleUUID</a></li> | |
279 | <li><a href="#httpBlocking">httpBlocking</a></li> | |
280 | <li><a href="#httpCheck">httpCheck</a></li> | |
281 | <li><a href="#httpClearCookie">httpClearCookie</a></li> | |
282 | <li><a href="#httpClearFields">httpClearFields</a></li> | |
283 | <li><a href="#httpClose">httpClose</a></li> | |
284 | <li><a href="#httpCompareCredentials">httpCompareCredentials</a></li> | |
798d6e29 | 285 | <li><a href="#httpConnect2">httpConnect2</a></li> |
798d6e29 MS |
286 | <li><a href="#httpCopyCredentials">httpCopyCredentials</a></li> |
287 | <li><a href="#httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></li> | |
288 | <li><a href="#httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></li> | |
289 | <li><a href="#httpCredentialsGetTrust">httpCredentialsGetTrust</a></li> | |
290 | <li><a href="#httpCredentialsString">httpCredentialsString</a></li> | |
798d6e29 MS |
291 | <li><a href="#httpDecode64_2">httpDecode64_2</a></li> |
292 | <li><a href="#httpDelete">httpDelete</a></li> | |
798d6e29 MS |
293 | <li><a href="#httpEncode64_2">httpEncode64_2</a></li> |
294 | <li><a href="#httpEncryption">httpEncryption</a></li> | |
295 | <li><a href="#httpError">httpError</a></li> | |
296 | <li><a href="#httpFieldValue">httpFieldValue</a></li> | |
297 | <li><a href="#httpFlush">httpFlush</a></li> | |
298 | <li><a href="#httpFlushWrite">httpFlushWrite</a></li> | |
299 | <li><a href="#httpFreeCredentials">httpFreeCredentials</a></li> | |
300 | <li><a href="#httpGet">httpGet</a></li> | |
301 | <li><a href="#httpGetActivity">httpGetActivity</a></li> | |
302 | <li><a href="#httpGetAddress">httpGetAddress</a></li> | |
303 | <li><a href="#httpGetAuthString">httpGetAuthString</a></li> | |
304 | <li><a href="#httpGetBlocking">httpGetBlocking</a></li> | |
305 | <li><a href="#httpGetContentEncoding">httpGetContentEncoding</a></li> | |
306 | <li><a href="#httpGetCookie">httpGetCookie</a></li> | |
798d6e29 MS |
307 | <li><a href="#httpGetDateString2">httpGetDateString2</a></li> |
308 | <li><a href="#httpGetDateTime">httpGetDateTime</a></li> | |
309 | <li><a href="#httpGetEncryption">httpGetEncryption</a></li> | |
310 | <li><a href="#httpGetExpect">httpGetExpect</a></li> | |
311 | <li><a href="#httpGetFd">httpGetFd</a></li> | |
312 | <li><a href="#httpGetField">httpGetField</a></li> | |
798d6e29 MS |
313 | <li><a href="#httpGetHostname">httpGetHostname</a></li> |
314 | <li><a href="#httpGetKeepAlive">httpGetKeepAlive</a></li> | |
798d6e29 MS |
315 | <li><a href="#httpGetLength2">httpGetLength2</a></li> |
316 | <li><a href="#httpGetPending">httpGetPending</a></li> | |
317 | <li><a href="#httpGetReady">httpGetReady</a></li> | |
318 | <li><a href="#httpGetRemaining">httpGetRemaining</a></li> | |
319 | <li><a href="#httpGetState">httpGetState</a></li> | |
320 | <li><a href="#httpGetStatus">httpGetStatus</a></li> | |
798d6e29 MS |
321 | <li><a href="#httpGetSubField2">httpGetSubField2</a></li> |
322 | <li><a href="#httpGetVersion">httpGetVersion</a></li> | |
323 | <li><a href="#httpGets">httpGets</a></li> | |
324 | <li><a href="#httpHead">httpHead</a></li> | |
325 | <li><a href="#httpInitialize">httpInitialize</a></li> | |
326 | <li><a href="#httpIsChunked">httpIsChunked</a></li> | |
327 | <li><a href="#httpIsEncrypted">httpIsEncrypted</a></li> | |
328 | <li><a href="#httpLoadCredentials">httpLoadCredentials</a></li> | |
329 | <li><a href="#httpOptions">httpOptions</a></li> | |
330 | <li><a href="#httpPeek">httpPeek</a></li> | |
331 | <li><a href="#httpPost">httpPost</a></li> | |
332 | <li><a href="#httpPut">httpPut</a></li> | |
798d6e29 MS |
333 | <li><a href="#httpRead2">httpRead2</a></li> |
334 | <li><a href="#httpReadRequest">httpReadRequest</a></li> | |
798d6e29 MS |
335 | <li><a href="#httpReconnect2">httpReconnect2</a></li> |
336 | <li><a href="#httpResolveHostname">httpResolveHostname</a></li> | |
337 | <li><a href="#httpSaveCredentials">httpSaveCredentials</a></li> | |
798d6e29 MS |
338 | <li><a href="#httpSeparateURI">httpSeparateURI</a></li> |
339 | <li><a href="#httpSetAuthString">httpSetAuthString</a></li> | |
340 | <li><a href="#httpSetCookie">httpSetCookie</a></li> | |
341 | <li><a href="#httpSetCredentials">httpSetCredentials</a></li> | |
342 | <li><a href="#httpSetDefaultField">httpSetDefaultField</a></li> | |
343 | <li><a href="#httpSetExpect">httpSetExpect</a></li> | |
344 | <li><a href="#httpSetField">httpSetField</a></li> | |
345 | <li><a href="#httpSetKeepAlive">httpSetKeepAlive</a></li> | |
346 | <li><a href="#httpSetLength">httpSetLength</a></li> | |
347 | <li><a href="#httpSetTimeout">httpSetTimeout</a></li> | |
348 | <li><a href="#httpShutdown">httpShutdown</a></li> | |
349 | <li><a href="#httpStateString">httpStateString</a></li> | |
350 | <li><a href="#httpStatus">httpStatus</a></li> | |
798d6e29 MS |
351 | <li><a href="#httpURIStatusString">httpURIStatusString</a></li> |
352 | <li><a href="#httpUpdate">httpUpdate</a></li> | |
353 | <li><a href="#httpWait">httpWait</a></li> | |
798d6e29 MS |
354 | <li><a href="#httpWrite2">httpWrite2</a></li> |
355 | <li><a href="#httpWriteResponse">httpWriteResponse</a></li> | |
356 | <li><a href="#ippAddBoolean">ippAddBoolean</a></li> | |
357 | <li><a href="#ippAddBooleans">ippAddBooleans</a></li> | |
358 | <li><a href="#ippAddCollection">ippAddCollection</a></li> | |
359 | <li><a href="#ippAddCollections">ippAddCollections</a></li> | |
360 | <li><a href="#ippAddDate">ippAddDate</a></li> | |
361 | <li><a href="#ippAddInteger">ippAddInteger</a></li> | |
362 | <li><a href="#ippAddIntegers">ippAddIntegers</a></li> | |
363 | <li><a href="#ippAddOctetString">ippAddOctetString</a></li> | |
364 | <li><a href="#ippAddOutOfBand">ippAddOutOfBand</a></li> | |
365 | <li><a href="#ippAddRange">ippAddRange</a></li> | |
366 | <li><a href="#ippAddRanges">ippAddRanges</a></li> | |
367 | <li><a href="#ippAddResolution">ippAddResolution</a></li> | |
368 | <li><a href="#ippAddResolutions">ippAddResolutions</a></li> | |
369 | <li><a href="#ippAddSeparator">ippAddSeparator</a></li> | |
370 | <li><a href="#ippAddString">ippAddString</a></li> | |
371 | <li><a href="#ippAddStringf">ippAddStringf</a></li> | |
372 | <li><a href="#ippAddStringfv">ippAddStringfv</a></li> | |
373 | <li><a href="#ippAddStrings">ippAddStrings</a></li> | |
374 | <li><a href="#ippAttributeString">ippAttributeString</a></li> | |
375 | <li><a href="#ippContainsInteger">ippContainsInteger</a></li> | |
376 | <li><a href="#ippContainsString">ippContainsString</a></li> | |
377 | <li><a href="#ippCopyAttribute">ippCopyAttribute</a></li> | |
378 | <li><a href="#ippCopyAttributes">ippCopyAttributes</a></li> | |
379 | <li><a href="#ippCreateRequestedArray">ippCreateRequestedArray</a></li> | |
380 | <li><a href="#ippDateToTime">ippDateToTime</a></li> | |
381 | <li><a href="#ippDelete">ippDelete</a></li> | |
382 | <li><a href="#ippDeleteAttribute">ippDeleteAttribute</a></li> | |
383 | <li><a href="#ippDeleteValues">ippDeleteValues</a></li> | |
384 | <li><a href="#ippEnumString">ippEnumString</a></li> | |
385 | <li><a href="#ippEnumValue">ippEnumValue</a></li> | |
386 | <li><a href="#ippErrorString">ippErrorString</a></li> | |
387 | <li><a href="#ippErrorValue">ippErrorValue</a></li> | |
388 | <li><a href="#ippFindAttribute">ippFindAttribute</a></li> | |
389 | <li><a href="#ippFindNextAttribute">ippFindNextAttribute</a></li> | |
390 | <li><a href="#ippFirstAttribute">ippFirstAttribute</a></li> | |
391 | <li><a href="#ippGetBoolean">ippGetBoolean</a></li> | |
392 | <li><a href="#ippGetCollection">ippGetCollection</a></li> | |
393 | <li><a href="#ippGetCount">ippGetCount</a></li> | |
394 | <li><a href="#ippGetDate">ippGetDate</a></li> | |
395 | <li><a href="#ippGetGroupTag">ippGetGroupTag</a></li> | |
396 | <li><a href="#ippGetInteger">ippGetInteger</a></li> | |
397 | <li><a href="#ippGetName">ippGetName</a></li> | |
398 | <li><a href="#ippGetOctetString">ippGetOctetString</a></li> | |
399 | <li><a href="#ippGetOperation">ippGetOperation</a></li> | |
400 | <li><a href="#ippGetRange">ippGetRange</a></li> | |
401 | <li><a href="#ippGetRequestId">ippGetRequestId</a></li> | |
402 | <li><a href="#ippGetResolution">ippGetResolution</a></li> | |
403 | <li><a href="#ippGetState">ippGetState</a></li> | |
404 | <li><a href="#ippGetStatusCode">ippGetStatusCode</a></li> | |
405 | <li><a href="#ippGetString">ippGetString</a></li> | |
406 | <li><a href="#ippGetValueTag">ippGetValueTag</a></li> | |
407 | <li><a href="#ippGetVersion">ippGetVersion</a></li> | |
408 | <li><a href="#ippLength">ippLength</a></li> | |
409 | <li><a href="#ippNew">ippNew</a></li> | |
410 | <li><a href="#ippNewRequest">ippNewRequest</a></li> | |
411 | <li><a href="#ippNewResponse">ippNewResponse</a></li> | |
412 | <li><a href="#ippNextAttribute">ippNextAttribute</a></li> | |
413 | <li><a href="#ippOpString">ippOpString</a></li> | |
414 | <li><a href="#ippOpValue">ippOpValue</a></li> | |
415 | <li><a href="#ippPort">ippPort</a></li> | |
416 | <li><a href="#ippRead">ippRead</a></li> | |
417 | <li><a href="#ippReadFile">ippReadFile</a></li> | |
418 | <li><a href="#ippReadIO">ippReadIO</a></li> | |
419 | <li><a href="#ippSetBoolean">ippSetBoolean</a></li> | |
420 | <li><a href="#ippSetCollection">ippSetCollection</a></li> | |
421 | <li><a href="#ippSetDate">ippSetDate</a></li> | |
422 | <li><a href="#ippSetGroupTag">ippSetGroupTag</a></li> | |
423 | <li><a href="#ippSetInteger">ippSetInteger</a></li> | |
424 | <li><a href="#ippSetName">ippSetName</a></li> | |
425 | <li><a href="#ippSetOctetString">ippSetOctetString</a></li> | |
426 | <li><a href="#ippSetOperation">ippSetOperation</a></li> | |
427 | <li><a href="#ippSetPort">ippSetPort</a></li> | |
428 | <li><a href="#ippSetRange">ippSetRange</a></li> | |
429 | <li><a href="#ippSetRequestId">ippSetRequestId</a></li> | |
430 | <li><a href="#ippSetResolution">ippSetResolution</a></li> | |
431 | <li><a href="#ippSetState">ippSetState</a></li> | |
432 | <li><a href="#ippSetStatusCode">ippSetStatusCode</a></li> | |
433 | <li><a href="#ippSetString">ippSetString</a></li> | |
434 | <li><a href="#ippSetStringf">ippSetStringf</a></li> | |
435 | <li><a href="#ippSetStringfv">ippSetStringfv</a></li> | |
436 | <li><a href="#ippSetValueTag">ippSetValueTag</a></li> | |
437 | <li><a href="#ippSetVersion">ippSetVersion</a></li> | |
438 | <li><a href="#ippStateString">ippStateString</a></li> | |
439 | <li><a href="#ippTagString">ippTagString</a></li> | |
440 | <li><a href="#ippTagValue">ippTagValue</a></li> | |
441 | <li><a href="#ippTimeToDate">ippTimeToDate</a></li> | |
442 | <li><a href="#ippValidateAttribute">ippValidateAttribute</a></li> | |
443 | <li><a href="#ippValidateAttributes">ippValidateAttributes</a></li> | |
444 | <li><a href="#ippWrite">ippWrite</a></li> | |
445 | <li><a href="#ippWriteFile">ippWriteFile</a></li> | |
446 | <li><a href="#ippWriteIO">ippWriteIO</a></li> | |
798d6e29 MS |
447 | </ul></li> |
448 | <li><a href="#TYPES">Data Types</a><ul class="subcontents"> | |
798d6e29 | 449 | <li><a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a></li> |
798d6e29 MS |
450 | <li><a href="#cups_dest_cb_t">cups_dest_cb_t</a></li> |
451 | <li><a href="#cups_dest_t">cups_dest_t</a></li> | |
452 | <li><a href="#cups_dinfo_t">cups_dinfo_t</a></li> | |
798d6e29 | 453 | <li><a href="#cups_job_t">cups_job_t</a></li> |
798d6e29 MS |
454 | <li><a href="#cups_option_t">cups_option_t</a></li> |
455 | <li><a href="#cups_password_cb2_t">cups_password_cb2_t</a></li> | |
798d6e29 MS |
456 | <li><a href="#cups_ptype_t">cups_ptype_t</a></li> |
457 | <li><a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a></li> | |
458 | <li><a href="#cups_size_t">cups_size_t</a></li> | |
798d6e29 | 459 | <li><a href="#http_addr_t">http_addr_t</a></li> |
798d6e29 MS |
460 | <li><a href="#http_encoding_t">http_encoding_t</a></li> |
461 | <li><a href="#http_encryption_t">http_encryption_t</a></li> | |
462 | <li><a href="#http_field_t">http_field_t</a></li> | |
463 | <li><a href="#http_keepalive_t">http_keepalive_t</a></li> | |
464 | <li><a href="#http_state_t">http_state_t</a></li> | |
465 | <li><a href="#http_t">http_t</a></li> | |
466 | <li><a href="#http_timeout_cb_t">http_timeout_cb_t</a></li> | |
467 | <li><a href="#http_trust_t">http_trust_t</a></li> | |
468 | <li><a href="#http_uri_coding_t">http_uri_coding_t</a></li> | |
469 | <li><a href="#http_uri_status_t">http_uri_status_t</a></li> | |
798d6e29 MS |
470 | <li><a href="#ipp_attribute_t">ipp_attribute_t</a></li> |
471 | <li><a href="#ipp_copycb_t">ipp_copycb_t</a></li> | |
798d6e29 | 472 | <li><a href="#ipp_iocb_t">ipp_iocb_t</a></li> |
798d6e29 MS |
473 | <li><a href="#ipp_orient_t">ipp_orient_t</a></li> |
474 | <li><a href="#ipp_pstate_t">ipp_pstate_t</a></li> | |
475 | <li><a href="#ipp_quality_t">ipp_quality_t</a></li> | |
476 | <li><a href="#ipp_res_t">ipp_res_t</a></li> | |
477 | <li><a href="#ipp_state_t">ipp_state_t</a></li> | |
478 | <li><a href="#ipp_t">ipp_t</a></li> | |
798d6e29 MS |
479 | </ul></li> |
480 | <li><a href="#STRUCTURES">Structures</a><ul class="subcontents"> | |
798d6e29 MS |
481 | <li><a href="#cups_dest_s">cups_dest_s</a></li> |
482 | <li><a href="#cups_job_s">cups_job_s</a></li> | |
798d6e29 MS |
483 | <li><a href="#cups_option_s">cups_option_s</a></li> |
484 | <li><a href="#cups_size_s">cups_size_s</a></li> | |
798d6e29 | 485 | </ul></li> |
798d6e29 | 486 | <li><a href="#ENUMERATIONS">Enumerations</a><ul class="subcontents"> |
798d6e29 | 487 | <li><a href="#cups_ptype_e">cups_ptype_e</a></li> |
798d6e29 MS |
488 | <li><a href="#http_encoding_e">http_encoding_e</a></li> |
489 | <li><a href="#http_encryption_e">http_encryption_e</a></li> | |
490 | <li><a href="#http_field_e">http_field_e</a></li> | |
491 | <li><a href="#http_keepalive_e">http_keepalive_e</a></li> | |
492 | <li><a href="#http_state_e">http_state_e</a></li> | |
493 | <li><a href="#http_status_e">http_status_e</a></li> | |
494 | <li><a href="#http_trust_e">http_trust_e</a></li> | |
495 | <li><a href="#http_uri_coding_e">http_uri_coding_e</a></li> | |
496 | <li><a href="#http_uri_status_e">http_uri_status_e</a></li> | |
798d6e29 | 497 | <li><a href="#ipp_finishings_e">ipp_finishings_e</a></li> |
798d6e29 MS |
498 | <li><a href="#ipp_jstate_e">ipp_jstate_e</a></li> |
499 | <li><a href="#ipp_op_e">ipp_op_e</a></li> | |
500 | <li><a href="#ipp_orient_e">ipp_orient_e</a></li> | |
501 | <li><a href="#ipp_pstate_e">ipp_pstate_e</a></li> | |
502 | <li><a href="#ipp_quality_e">ipp_quality_e</a></li> | |
503 | <li><a href="#ipp_res_e">ipp_res_e</a></li> | |
504 | <li><a href="#ipp_state_e">ipp_state_e</a></li> | |
505 | <li><a href="#ipp_status_e">ipp_status_e</a></li> | |
506 | <li><a href="#ipp_tag_e">ipp_tag_e</a></li> | |
507 | </ul></li> | |
508 | </ul> | |
509 | </div> | |
510 | <div class="body"> | |
511 | <blockquote> | |
1da024d1 | 512 | <p>Please <a href="https://github.com/apple/cups/issues">file issues on Github</a> to provide feedback on this document.</p> |
798d6e29 | 513 | </blockquote> |
53af7f21 | 514 | <h2><a id="introduction">Introduction</a></h2> |
798d6e29 MS |
515 | <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> |
516 | <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> | |
53af7f21 | 517 | <h3><a id="guidelines">Guidelines</a></h3> |
798d6e29 MS |
518 | <p>When writing software that uses the "cups" library:</p> |
519 | <ul> | |
520 | <li>Do not use undocumented or deprecated APIs,</li> | |
521 | <li>Do not rely on pre-configured printers,</li> | |
522 | <li>Do not assume that printers support specific features or formats, and</li> | |
523 | <li>Do not rely on implementation details (PPDs, etc.)</li> | |
524 | </ul> | |
525 | <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> | |
526 | <p>Similarly, printer and job management applications can use standard query operations to obtain the status information in a common, generic form and use standard management operations to control the state of those printers and jobs.</p> | |
53af7f21 | 527 | <h3><a id="terms-used-in-this-document">Terms Used in This Document</a></h3> |
9c44e2cb | 528 | <p>A <em>Destination</em> is a printer or print queue that accepts print jobs. A <em>Print</em> <em>Job</em> is one or more documents that are processed by a destination using options supplied when creating the job. A <em>Document</em> is a file (JPEG image, PDF file, etc.) suitable for printing. An <em>Option</em> controls some aspect of printing, such as the media used. <em>Media</em> is the sheets or roll that is printed on. An <em>Attribute</em> is an option encoded for an Internet Printing Protocol (IPP) request.</p> |
53af7f21 | 529 | <h3><a id="compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></h3> |
798d6e29 MS |
530 | <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> |
531 | <p>The following simple program lists the available destinations:</p> | |
532 | <pre><code>#include <stdio.h> | |
533 | #include <cups/cups.h> | |
534 | ||
535 | int print_dest(void *user_data, unsigned flags, cups_dest_t *dest) | |
536 | { | |
537 | if (dest->instance) | |
538 | printf("%s/%s\n", dest->name, dest->instance); | |
539 | else | |
540 | puts(dest->name); | |
541 | ||
542 | return (1); | |
543 | } | |
544 | ||
545 | int main(void) | |
546 | { | |
547 | cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, 0, 0, print_dest, NULL); | |
548 | ||
549 | return (0); | |
550 | } | |
551 | </code></pre> | |
53af7f21 | 552 | <h4><a id="compiling-with-xcode">Compiling with Xcode</a></h4> |
9c44e2cb MS |
553 | <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> |
554 | <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 | 555 | <p>Finally, click on the <code>main.c</code> file in the sidebar and copy the example program to the file. Build and run (CMD+R) to see the list of destinations.</p> |
53af7f21 | 556 | <h4><a id="compiling-with-gcc">Compiling with GCC</a></h4> |
798d6e29 MS |
557 | <p>From the command-line, create a file called <code>sample.c</code> using your favorite editor, copy the example to this file, and save. Then run the following command to compile it with GCC and run it:</p> |
558 | <pre><code>gcc -o simple `cups-config --cflags` simple.c `cups-config --libs` | |
559 | ./simple | |
560 | </code></pre> | |
9c44e2cb | 561 | <p>The <code>cups-config</code> command provides the compiler flags (<code>cups-config --cflags</code>) and libraries (<code>cups-config --libs</code>) needed for the local system.</p> |
53af7f21 | 562 | <h2><a id="working-with-destinations">Working with Destinations</a></h2> |
9c44e2cb | 563 | <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 | 564 | <p>Historically destinations have been manually maintained by the administrator of a system or network, but CUPS also supports dynamic discovery of destinations on the current network.</p> |
53af7f21 | 565 | <h3><a id="finding-available-destinations">Finding Available Destinations</a></h3> |
798d6e29 MS |
566 | <p>The <code>cupsEnumDests</code> function finds all of the available destinations:</p> |
567 | <pre><code> int | |
568 | cupsEnumDests(unsigned flags, int msec, int *cancel, | |
569 | cups_ptype_t type, cups_ptype_t mask, | |
570 | cups_dest_cb_t cb, void *user_data) | |
571 | </code></pre> | |
572 | <p>The <code>flags</code> argument specifies enumeration options, which at present must be <code>CUPS_DEST_FLAGS_NONE</code>.</p> | |
573 | <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> | |
574 | <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 | 575 | <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 MS |
576 | <ul> |
577 | <li><code>CUPS_PRINTER_CLASS</code>: A collection of destinations.</li> | |
578 | <li><code>CUPS_PRINTER_FAX</code>: A facsimile device.</li> | |
53af7f21 MS |
579 | <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> |
580 | <li><code>CUPS_PRINTER_REMOTE</code>: A remote (shared) printer or class.</li> | |
581 | <li><code>CUPS_PRINTER_DISCOVERED</code>: An available network printer or class.</li> | |
798d6e29 MS |
582 | <li><code>CUPS_PRINTER_BW</code>: Can do B&W printing.</li> |
583 | <li><code>CUPS_PRINTER_COLOR</code>: Can do color printing.</li> | |
584 | <li><code>CUPS_PRINTER_DUPLEX</code>: Can do two-sided printing.</li> | |
585 | <li><code>CUPS_PRINTER_STAPLE</code>: Can staple output.</li> | |
586 | <li><code>CUPS_PRINTER_COLLATE</code>: Can quickly collate copies.</li> | |
587 | <li><code>CUPS_PRINTER_PUNCH</code>: Can punch output.</li> | |
588 | <li><code>CUPS_PRINTER_COVER</code>: Can cover output.</li> | |
589 | <li><code>CUPS_PRINTER_BIND</code>: Can bind output.</li> | |
590 | <li><code>CUPS_PRINTER_SORT</code>: Can sort output (mailboxes, etc.)</li> | |
591 | <li><code>CUPS_PRINTER_SMALL</code>: Can print on Letter/Legal/A4-size media.</li> | |
592 | <li><code>CUPS_PRINTER_MEDIUM</code>: Can print on Tabloid/B/C/A3/A2-size media.</li> | |
593 | <li><code>CUPS_PRINTER_LARGE</code>: Can print on D/E/A1/A0-size media.</li> | |
594 | <li><code>CUPS_PRINTER_VARIABLE</code>: Can print on rolls and custom-size media.</li> | |
595 | </ul> | |
596 | <p>The <code>cb</code> argument specifies a function to call for every destination that is found:</p> | |
597 | <pre><code>typedef int (*cups_dest_cb_t)(void *user_data, | |
598 | unsigned flags, | |
599 | cups_dest_t *dest); | |
600 | </code></pre> | |
9c44e2cb | 601 | <p>The callback function receives a copy of the <code>user_data</code> argument along with a bitfield (<code>flags</code>) and the destination that was found. The <code>flags</code> argument can have any of the following constant (bit) values set:</p> |
798d6e29 MS |
602 | <ul> |
603 | <li><code>CUPS_DEST_FLAGS_MORE</code>: There are more destinations coming.</li> | |
604 | <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> | |
605 | <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> | |
606 | </ul> | |
607 | <p>The callback function returns 0 to stop enumeration or 1 to continue.</p> | |
718ee2ff MS |
608 | <blockquote> |
609 | <p>Note that the callback function will likely be called multiple times for the same destination, so it is up to the caller to suppress any duplicate destinations.</p> | |
610 | </blockquote> | |
798d6e29 MS |
611 | <p>The following example shows how to use <code>cupsEnumDests</code> to get a filtered array of destinations:</p> |
612 | <pre><code>typedef struct | |
613 | { | |
614 | int num_dests; | |
615 | cups_dest_t *dests; | |
616 | } my_user_data_t; | |
617 | ||
618 | int | |
619 | my_dest_cb(my_user_data_t *user_data, unsigned flags, | |
620 | cups_dest_t *dest) | |
621 | { | |
622 | if (flags & CUPS_DEST_FLAGS_REMOVED) | |
623 | { | |
624 | /* | |
625 | * Remove destination from array... | |
626 | */ | |
627 | ||
628 | user_data->num_dests = | |
629 | cupsRemoveDest(dest->name, dest->instance, | |
630 | user_data->num_dests, | |
631 | &(user_data->dests)); | |
632 | } | |
633 | else | |
634 | { | |
635 | /* | |
636 | * Add destination to array... | |
637 | */ | |
638 | ||
639 | user_data->num_dests = | |
640 | cupsCopyDest(dest, user_data->num_dests, | |
641 | &(user_data->dests)); | |
642 | } | |
643 | ||
644 | return (1); | |
645 | } | |
646 | ||
647 | int | |
648 | my_get_dests(cups_ptype_t type, cups_ptype_t mask, | |
649 | cups_dest_t **dests) | |
650 | { | |
651 | my_user_data_t user_data = { 0, NULL }; | |
652 | ||
653 | if (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, type, | |
654 | mask, (cups_dest_cb_t)my_dest_cb, | |
655 | &user_data)) | |
656 | { | |
657 | /* | |
658 | * An error occurred, free all of the destinations and | |
659 | * return... | |
660 | */ | |
661 | ||
662 | cupsFreeDests(user_data.num_dests, user_dasta.dests); | |
663 | ||
664 | *dests = NULL; | |
665 | ||
666 | return (0); | |
667 | } | |
668 | ||
669 | /* | |
670 | * Return the destination array... | |
671 | */ | |
672 | ||
673 | *dests = user_data.dests; | |
674 | ||
675 | return (user_data.num_dests); | |
676 | } | |
677 | </code></pre> | |
53af7f21 | 678 | <h3><a id="basic-destination-information">Basic Destination Information</a></h3> |
798d6e29 MS |
679 | <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> |
680 | <ul> | |
681 | <li>"auth-info-required": The type of authentication required for printing to this destination: "none", "username,password", "domain,username,password", or "negotiate" (Kerberos).</li> | |
682 | <li>"printer-info": The human-readable description of the destination such as "My Laser Printer".</li> | |
683 | <li>"printer-is-accepting-jobs": "true" if the destination is accepting new jobs, "false" otherwise.</li> | |
684 | <li>"printer-is-shared": "true" if the destination is being shared with other computers, "false" otherwise.</li> | |
685 | <li>"printer-location": The human-readable location of the destination such as "Lab 4".</li> | |
686 | <li>"printer-make-and-model": The human-readable make and model of the destination such as "ExampleCorp LaserPrinter 4000 Series".</li> | |
687 | <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> | |
688 | <li>"printer-state-change-time": The UNIX time when the destination entered the current state.</li> | |
689 | <li>"printer-state-reasons": Additional comma-delimited state keywords for the destination such as "media-tray-empty-error" and "toner-low-warning".</li> | |
690 | <li>"printer-type": The <code>cups_ptype_t</code> value associated with the destination.</li> | |
53af7f21 | 691 | <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 |
692 | </ul> |
693 | <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> | |
694 | <pre><code>const char *model = cupsGetOption("printer-make-and-model", | |
695 | dest->num_options, | |
696 | dest->options); | |
697 | </code></pre> | |
53af7f21 | 698 | <h3><a id="detailed-destination-information">Detailed Destination Information</a></h3> |
798d6e29 MS |
699 | <p>Once a destination has been chosen, the <code>cupsCopyDestInfo</code> function can be used to gather detailed information about the destination:</p> |
700 | <pre><code>cups_dinfo_t * | |
701 | cupsCopyDestInfo(http_t *http, cups_dest_t *dest); | |
702 | </code></pre> | |
703 | <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> | |
704 | <p>The <code>cups_dinfo_t</code> structure that is returned contains a snapshot of the supported options and their supported, ready, and default values. It also can report constraints between different options and values, and recommend changes to resolve those constraints.</p> | |
53af7f21 | 705 | <h4><a id="getting-supported-options-and-values">Getting Supported Options and Values</a></h4> |
798d6e29 MS |
706 | <p>The <code>cupsCheckDestSupported</code> function can be used to test whether a particular option or option and value is supported:</p> |
707 | <pre><code>int | |
708 | cupsCheckDestSupported(http_t *http, cups_dest_t *dest, | |
709 | cups_dinfo_t *info, | |
710 | const char *option, | |
711 | const char *value); | |
712 | </code></pre> | |
713 | <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> | |
714 | <ul> | |
715 | <li><code>CUPS_COPIES</code>: Controls the number of copies that are produced.</li> | |
716 | <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> | |
717 | <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> | |
718 | <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> | |
719 | <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> | |
720 | <li><code>CUPS_NUMBER_UP</code>: Controls the number of document pages that are placed on each media side.</li> | |
721 | <li><code>CUPS_ORIENTATION</code>: Controls the orientation of document pages placed on the media: <code>CUPS_ORIENTATION_PORTRAIT</code> or <code>CUPS_ORIENTATION_LANDSCAPE</code>.</li> | |
9c44e2cb | 722 | <li><code>CUPS_PRINT_COLOR_MODE</code>: Controls whether the output is in color (<code>CUPS_PRINT_COLOR_MODE_COLOR</code>), grayscale (<code>CUPS_PRINT_COLOR_MODE_MONOCHROME</code>), or either (<code>CUPS_PRINT_COLOR_MODE_AUTO</code>).</li> |
798d6e29 MS |
723 | <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> |
724 | <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> | |
725 | </ul> | |
726 | <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> | |
727 | <p>The <code>cupsFindDestSupported</code> function returns the IPP attribute containing the supported values for a given option:</p> | |
728 | <pre><code> ipp_attribute_t * | |
729 | cupsFindDestSupported(http_t *http, cups_dest_t *dest, | |
730 | cups_dinfo_t *dinfo, | |
731 | const char *option); | |
732 | </code></pre> | |
733 | <p>For example, the following code prints the supported finishing processes for a destination, if any, to the standard output:</p> | |
734 | <pre><code>cups_dinfo_t *info = cupsCopyDestInfo(CUPS_HTTP_DEFAULT, | |
735 | dest); | |
736 | ||
737 | if (cupsCheckDestSupported(CUPS_HTTP_DEFAULT, dest, info, | |
738 | CUPS_FINISHINGS, NULL)) | |
739 | { | |
740 | ipp_attribute_t *finishings = | |
741 | cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info, | |
742 | CUPS_FINISHINGS); | |
743 | int i, count = ippGetCount(finishings); | |
744 | ||
745 | puts("finishings supported:"); | |
746 | for (i = 0; i < count; i ++) | |
747 | printf(" %d\n", ippGetInteger(finishings, i)); | |
748 | } | |
749 | else | |
750 | puts("finishings not supported."); | |
751 | </code></pre> | |
752 | <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> | |
753 | <pre><code>ipp_attribute_t *attrs = | |
754 | cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info, | |
755 | "job-creation-attributes"); | |
756 | int i, count = ippGetCount(attrs); | |
757 | ||
758 | for (i = 0; i < count; i ++) | |
759 | puts(ippGetString(attrs, i, NULL)); | |
760 | </code></pre> | |
53af7f21 | 761 | <h4><a id="getting-default-values">Getting Default Values</a></h4> |
798d6e29 MS |
762 | <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> |
763 | <pre><code>ipp_attribute_t * | |
764 | cupsFindDestDefault(http_t *http, cups_dest_t *dest, | |
765 | cups_dinfo_t *dinfo, | |
766 | const char *option); | |
767 | </code></pre> | |
768 | <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> | |
769 | <pre><code>const char *def_value = | |
770 | cupsGetOption(CUPS_FINISHINGS, dest->num_options, | |
771 | dest->options); | |
772 | ipp_attribute_t *def_attr = | |
773 | cupsFindDestDefault(CUPS_HTTP_DEFAULT, dest, info, | |
774 | CUPS_FINISHINGS); | |
775 | ||
776 | if (def_value != NULL) | |
777 | { | |
778 | printf("Default finishings: %s\n", def_value); | |
779 | } | |
780 | else | |
781 | { | |
782 | int i, count = ippGetCount(def_attr); | |
783 | ||
784 | printf("Default finishings: %d", | |
785 | ippGetInteger(def_attr, 0)); | |
786 | for (i = 1; i < count; i ++) | |
787 | printf(",%d", ippGetInteger(def_attr, i)); | |
788 | putchar('\n'); | |
789 | } | |
790 | </code></pre> | |
53af7f21 | 791 | <h4><a id="getting-ready-loaded-values">Getting Ready (Loaded) Values</a></h4> |
798d6e29 MS |
792 | <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> |
793 | <p>The <code>cupsFindDestReady</code> function finds the IPP attribute containing the ready values for a given option:</p> | |
794 | <pre><code>ipp_attribute_t * | |
795 | cupsFindDestReady(http_t *http, cups_dest_t *dest, | |
796 | cups_dinfo_t *dinfo, const char *option); | |
797 | </code></pre> | |
798 | <p>For example, the following code lists the ready finishing processes:</p> | |
799 | <pre><code>ipp_attribute_t *ready_finishings = | |
800 | cupsFindDestReady(CUPS_HTTP_DEFAULT, dest, info, | |
801 | CUPS_FINISHINGS); | |
802 | ||
803 | if (ready_finishings != NULL) | |
804 | { | |
805 | int i, count = ippGetCount(ready_finishings); | |
806 | ||
807 | puts("finishings ready:"); | |
808 | for (i = 0; i < count; i ++) | |
809 | printf(" %d\n", ippGetInteger(ready_finishings, i)); | |
810 | } | |
811 | else | |
812 | puts("no finishings are ready."); | |
813 | </code></pre> | |
53af7f21 | 814 | <h4><a id="media-size-options">Media Size Options</a></h4> |
798d6e29 MS |
815 | <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> |
816 | <pre><code>typedef struct cups_size_s | |
817 | { | |
818 | char media[128]; | |
819 | int width, length; | |
820 | int bottom, left, right, top; | |
821 | } cups_size_t; | |
822 | </code></pre> | |
823 | <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> | |
824 | <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> | |
825 | <pre><code>int | |
826 | cupsGetDestMediaByName(http_t *http, cups_dest_t *dest, | |
827 | cups_dinfo_t *dinfo, | |
828 | const char *media, | |
829 | unsigned flags, cups_size_t *size); | |
830 | ||
831 | int | |
832 | cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest, | |
833 | cups_dinfo_t *dinfo, | |
834 | int width, int length, | |
835 | unsigned flags, cups_size_t *size); | |
836 | </code></pre> | |
837 | <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> | |
838 | <ul> | |
839 | <li><code>CUPS_MEDIA_FLAGS_DEFAULT</code>: Find the closest size supported by the printer.</li> | |
840 | <li><code>CUPS_MEDIA_FLAGS_BORDERLESS</code>: Find a borderless size.</li> | |
841 | <li><code>CUPS_MEDIA_FLAGS_DUPLEX</code>: Find a size compatible with two-sided printing.</li> | |
842 | <li><code>CUPS_MEDIA_FLAGS_EXACT</code>: Find an exact match for the size.</li> | |
843 | <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> | |
844 | </ul> | |
845 | <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> | |
846 | <p>For example, the following code prints the margins for two-sided printing on US Letter media:</p> | |
847 | <pre><code>cups_size_t size; | |
848 | ||
849 | if (cupsGetDestMediaByName(CUPS_HTTP_DEFAULT, dest, info, | |
850 | CUPS_MEDIA_LETTER, | |
851 | CUPS_MEDIA_FLAGS_DUPLEX, &size)) | |
852 | { | |
853 | puts("Margins for duplex US Letter:"); | |
854 | printf(" Bottom: %.2fin\n", size.bottom / 2540.0); | |
855 | printf(" Left: %.2fin\n", size.left / 2540.0); | |
856 | printf(" Right: %.2fin\n", size.right / 2540.0); | |
857 | printf(" Top: %.2fin\n", size.top / 2540.0); | |
858 | } | |
859 | else | |
860 | puts("Margins for duplex US Letter are not available."); | |
861 | </code></pre> | |
862 | <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> | |
863 | <pre><code>int | |
864 | cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest, | |
865 | cups_dinfo_t *dinfo, int n, | |
866 | unsigned flags, cups_size_t *size); | |
867 | ||
868 | int | |
869 | cupsGetDestMediaCount(http_t *http, cups_dest_t *dest, | |
870 | cups_dinfo_t *dinfo, unsigned flags); | |
871 | </code></pre> | |
872 | <p>For example, the following code prints the list of ready media and corresponding margins:</p> | |
873 | <pre><code>cups_size_t size; | |
874 | int i; | |
875 | int count = cupsGetDestMediaCount(CUPS_HTTP_DEFAULT, | |
876 | dest, info, | |
877 | CUPS_MEDIA_FLAGS_READY); | |
878 | ||
879 | for (i = 0; i < count; i ++) | |
880 | { | |
881 | if (cupsGetDestMediaByIndex(CUPS_HTTP_DEFAULT, dest, info, | |
882 | i, CUPS_MEDIA_FLAGS_READY, | |
883 | &size)) | |
884 | { | |
885 | printf("%s:\n", size.name); | |
886 | printf(" Width: %.2fin\n", size.width / 2540.0); | |
887 | printf(" Length: %.2fin\n", size.length / 2540.0); | |
888 | printf(" Bottom: %.2fin\n", size.bottom / 2540.0); | |
889 | printf(" Left: %.2fin\n", size.left / 2540.0); | |
890 | printf(" Right: %.2fin\n", size.right / 2540.0); | |
891 | printf(" Top: %.2fin\n", size.top / 2540.0); | |
892 | } | |
893 | } | |
894 | </code></pre> | |
895 | <p>Finally, the <code>cupsGetDestMediaDefault</code> function returns the default media size:</p> | |
896 | <pre><code>int | |
897 | cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest, | |
898 | cups_dinfo_t *dinfo, unsigned flags, | |
899 | cups_size_t *size); | |
900 | </code></pre> | |
53af7f21 | 901 | <h4><a id="localizing-options-and-values">Localizing Options and Values</a></h4> |
6ad44eeb | 902 | <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 |
903 | <pre><code>const char * |
904 | cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest, | |
905 | cups_dinfo_t *info, unsigned flags, | |
906 | cups_size_t *size); | |
907 | ||
908 | const char * | |
909 | cupsLocalizeDestOption(http_t *http, cups_dest_t *dest, | |
910 | cups_dinfo_t *info, | |
911 | const char *option); | |
912 | ||
913 | const char * | |
914 | cupsLocalizeDestValue(http_t *http, cups_dest_t *dest, | |
915 | cups_dinfo_t *info, | |
916 | const char *option, const char *value); | |
917 | </code></pre> | |
53af7f21 | 918 | <h3><a id="submitting-a-print-job">Submitting a Print Job</a></h3> |
798d6e29 MS |
919 | <p>Once you are ready to submit a print job, you create a job using the <code>cupsCreateDestJob</code> function:</p> |
920 | <pre><code>ipp_status_t | |
921 | cupsCreateDestJob(http_t *http, cups_dest_t *dest, | |
922 | cups_dinfo_t *info, int *job_id, | |
923 | const char *title, int num_options, | |
924 | cups_option_t *options); | |
925 | </code></pre> | |
926 | <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> | |
927 | <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> | |
928 | <p>For example, the following code creates a new job that will print 42 copies of a two-sided US Letter document:</p> | |
929 | <pre><code>int job_id = 0; | |
930 | int num_options = 0; | |
931 | cups_option_t *options = NULL; | |
932 | ||
933 | num_options = cupsAddOption(CUPS_COPIES, "42", | |
934 | num_options, &options); | |
935 | num_options = cupsAddOption(CUPS_MEDIA, CUPS_MEDIA_LETTER, | |
936 | num_options, &options); | |
937 | num_options = cupsAddOption(CUPS_SIDES, | |
938 | CUPS_SIDES_TWO_SIDED_PORTRAIT, | |
939 | num_options, &options); | |
940 | ||
941 | if (cupsCreateDestJob(CUPS_HTTP_DEFAULT, dest, info, | |
942 | &job_id, "My Document", num_options, | |
943 | options) == IPP_STATUS_OK) | |
944 | printf("Created job: %d\n", job_id); | |
945 | else | |
946 | printf("Unable to create job: %s\n", | |
947 | cupsLastErrorString()); | |
948 | </code></pre> | |
949 | <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> | |
950 | <pre><code>http_status_t | |
951 | cupsStartDestDocument(http_t *http, cups_dest_t *dest, | |
952 | cups_dinfo_t *info, int job_id, | |
953 | const char *docname, | |
954 | const char *format, | |
955 | int num_options, | |
956 | cups_option_t *options, | |
957 | int last_document); | |
958 | ||
959 | http_status_t | |
960 | cupsWriteRequestData(http_t *http, const char *buffer, | |
961 | size_t length); | |
962 | ||
963 | ipp_status_t | |
964 | cupsFinishDestDocument(http_t *http, cups_dest_t *dest, | |
965 | cups_dinfo_t *info); | |
966 | </code></pre> | |
967 | <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> | |
968 | <ul> | |
969 | <li><code>CUPS_FORMAT_JPEG</code>: "image/jpeg"</li> | |
970 | <li><code>CUPS_FORMAT_PDF</code>: "application/pdf"</li> | |
971 | <li><code>CUPS_FORMAT_POSTSCRIPT</code>: "application/postscript"</li> | |
972 | <li><code>CUPS_FORMAT_TEXT</code>: "text/plain"</li> | |
973 | </ul> | |
974 | <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> | |
975 | <p>For example, the following code submits a PDF file to the job that was just created:</p> | |
976 | <pre><code>FILE *fp = fopen("filename.pdf", "rb"); | |
977 | size_t bytes; | |
978 | char buffer[65536]; | |
979 | ||
980 | if (cupsStartDestDocument(CUPS_HTTP_DEFAULT, dest, info, | |
981 | job_id, "filename.pdf", 0, NULL, | |
982 | 1) == HTTP_STATUS_CONTINUE) | |
983 | { | |
984 | while ((bytes = fread(buffer, 1, sizeof(buffer), fp)) > 0) | |
985 | if (cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer, | |
986 | bytes) != HTTP_STATUS_CONTINUE) | |
987 | break; | |
988 | ||
989 | if (cupsFinishDestDocument(CUPS_HTTP_DEFAULT, dest, | |
990 | info) == IPP_STATUS_OK) | |
991 | puts("Document send succeeded."); | |
992 | else | |
993 | printf("Document send failed: %s\n", | |
994 | cupsLastErrorString()); | |
995 | } | |
996 | ||
997 | fclose(fp); | |
998 | </code></pre> | |
b0fb2d75 MS |
999 | <h2><a id="sending-ipp-requests">Sending IPP Requests</a></h2> |
1000 | <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> | |
1001 | <h3><a id="connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</a></h3> | |
1002 | <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> | |
1003 | <pre><code>http_t * | |
1004 | cupsConnectDest(cups_dest_t *dest, unsigned flags, int msec, | |
1005 | int *cancel, char *resource, | |
1006 | size_t resourcesize, cups_dest_cb_t cb, | |
1007 | void *user_data); | |
1008 | </code></pre> | |
1009 | <p>The <code>dest</code> argument specifies the destination to connect to.</p> | |
1010 | <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> | |
1011 | <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> | |
1012 | <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> | |
1013 | <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> | |
1014 | <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> | |
1015 | <p>On success, a HTTP connection is returned that can be used to send IPP requests and get IPP responses.</p> | |
1016 | <p>For example, the following code connects to the printer associated with a destination with a 30 second timeout:</p> | |
1017 | <pre><code>char resource[256]; | |
1018 | http_t *http = cupsConnectDest(dest, CUPS_DEST_FLAGS_DEVICE, | |
1019 | 30000, NULL, resource, | |
1020 | sizeof(resource), NULL, NULL); | |
1021 | </code></pre> | |
1022 | <h3><a id="creating-an-ipp-request">Creating an IPP Request</a></h3> | |
1023 | <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> | |
1024 | <p>The <code>ippNewRequest</code> function creates a new IPP request:</p> | |
1025 | <pre><code>ipp_t * | |
1026 | ippNewRequest(ipp_op_t op); | |
1027 | </code></pre> | |
1028 | <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> | |
1029 | <pre><code>ipp_t *request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES); | |
1030 | </code></pre> | |
1031 | <p>The request identifier is automatically set to a unique value for the current process.</p> | |
1032 | <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> | |
1033 | <pre><code>const char *printer_uri = cupsGetOption("device-uri", | |
1034 | dest->num_options, | |
1035 | dest->options); | |
1036 | ||
1037 | ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, | |
1038 | "printer-uri", NULL, printer_uri); | |
1039 | </code></pre> | |
1040 | <blockquote> | |
1041 | <p>Note: 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> | |
1042 | </blockquote> | |
1043 | <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> | |
1044 | <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> | |
1045 | <pre><code>static const char * const requested_attributes[] = | |
1046 | { | |
1047 | "printer-state", | |
1048 | "printer-state-message", | |
1049 | "printer-state-reasons" | |
1050 | }; | |
1051 | ||
1052 | ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, | |
1053 | "requested-attributes", 3, NULL, | |
1054 | requested_attributes); | |
1055 | </code></pre> | |
1056 | <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> | |
1057 | <p>CUPS provides many functions to adding attributes of different types:</p> | |
1058 | <ul> | |
1059 | <li><code>ippAddBoolean</code> adds a boolean (<code>IPP_TAG_BOOLEAN</code>) attribute with one value.</li> | |
1060 | <li><code>ippAddInteger</code> adds an enum (<code>IPP_TAG_ENUM</code>) or integer (<code>IPP_TAG_INTEGER</code>) attribute with one value.</li> | |
1061 | <li><code>ippAddIntegers</code> adds an enum or integer attribute with one or more values.</li> | |
1062 | <li><code>ippAddOctetString</code> adds an octetString attribute with one value.</li> | |
1063 | <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> | |
1064 | <li><code>ippAddRange</code> adds a rangeOfInteger attribute with one range.</li> | |
1065 | <li><code>ippAddRanges</code> adds a rangeOfInteger attribute with one or more ranges.</li> | |
1066 | <li><code>ippAddResolution</code> adds a resolution attribute with one resolution.</li> | |
1067 | <li><code>ippAddResolutions</code> adds a resolution attribute with one or more resolutions.</li> | |
1068 | <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> | |
1069 | <li><code>ippAddStrings</code> adds a charset, keyword, mimeMediaType, name, naturalLanguage, text, uri, or uriScheme attribute with one or more values.</li> | |
1070 | </ul> | |
1071 | <h3><a id="sending-the-ipp-request">Sending the IPP Request</a></h3> | |
1072 | <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> | |
1073 | <pre><code>ipp_t *response = cupsDoRequest(http, request, resource); | |
1074 | </code></pre> | |
1075 | <p>For requests like Send-Document that include a file, the <code>cupsDoFileRequest</code> function should be used:</p> | |
1076 | <pre><code>ipp_t *response = cupsDoFileRequest(http, request, resource, | |
1077 | filename); | |
1078 | </code></pre> | |
1079 | <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> | |
1080 | <p>The status from the most recent request can be queried using the <code>cupsLastError</code> function, for example:</p> | |
1081 | <pre><code>if (cupsLastError() >= IPP_STATUS_ERROR_BAD_REQUEST) | |
1082 | { | |
1083 | /* request failed */ | |
1084 | } | |
1085 | </code></pre> | |
1086 | <p>A human-readable error message is also available using the <code>cupsLastErrorString</code> function:</p> | |
1087 | <pre><code>if (cupsLastError() >= IPP_STATUS_ERROR_BAD_REQUEST) | |
1088 | { | |
1089 | /* request failed */ | |
1090 | printf("Request failed: %s\n", cupsLastErrorString()); | |
1091 | } | |
1092 | </code></pre> | |
1093 | <h3><a id="processing-the-ipp-response">Processing the IPP Response</a></h3> | |
1094 | <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> | |
1095 | <p>For example, the following code finds the printer state attributes and prints their values:</p> | |
1096 | <pre><code>ipp_attribute_t *attr; | |
1097 | ||
1098 | if ((attr = ippFindAttribute(response, "printer-state", | |
1099 | IPP_TAG_ENUM)) != NULL) | |
1100 | { | |
1101 | printf("printer-state=%s\n", | |
db5424ea | 1102 | ippEnumString("printer-state", ippGetInteger(attr, 0))); |
b0fb2d75 MS |
1103 | } |
1104 | else | |
1105 | puts("printer-state=unknown"); | |
1106 | ||
1107 | if ((attr = ippFindAttribute(response, "printer-state-message", | |
1108 | IPP_TAG_TEXT)) != NULL) | |
1109 | { | |
1110 | printf("printer-state-message=\"%s\"\n", | |
1111 | ippGetString(attr, 0, NULL))); | |
1112 | } | |
1113 | ||
1114 | if ((attr = ippFindAttribute(response, "printer-state-reasons", | |
1115 | IPP_TAG_KEYWORD)) != NULL) | |
1116 | { | |
1117 | int i, count = ippGetCount(attr); | |
1118 | ||
1119 | puts("printer-state-reasons="); | |
1120 | for (i = 0; i < count; i ++) | |
1121 | printf(" %s\n", ippGetString(attr, i, NULL))); | |
1122 | } | |
1123 | </code></pre> | |
1124 | <p>The <code>ippGetCount</code> function returns the number of values in an attribute.</p> | |
1125 | <p>The <code>ippGetInteger</code> and <code>ippGetString</code> functions return a single integer or string value from an attribute.</p> | |
db5424ea | 1126 | <p>The <code>ippEnumString</code> function converts a enum value to its keyword (string) equivalent.</p> |
b0fb2d75 MS |
1127 | <p>Once you are done using the IPP response message, free it using the <code>ippDelete</code> function:</p> |
1128 | <pre><code>ippDelete(response); | |
1129 | </code></pre> | |
1130 | <h3><a id="authentication">Authentication</a></h3> | |
1131 | <p>CUPS normally handles authentication through the console. GUI applications should set a password callback using the <code>cupsSetPasswordCB2</code> function:</p> | |
1132 | <pre><code>void | |
1133 | cupsSetPasswordCB2(cups_password_cb2_t cb, void *user_data); | |
1134 | </code></pre> | |
1135 | <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> | |
1136 | <pre><code>const char * | |
1137 | cups_password_cb2(const char *prompt, http_t *http, | |
1138 | const char *method, const char *resource, | |
1139 | void *user_data); | |
1140 | </code></pre> | |
1141 | <p>The <code>prompt</code> argument is a string from CUPS that should be displayed to the user.</p> | |
1142 | <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> | |
1143 | <p>The <code>method</code> argument specifies the HTTP method used for the request and is typically "POST".</p> | |
1144 | <p>The <code>resource</code> argument specifies the path used for the request.</p> | |
1145 | <p>The <code>user_data</code> argument provides the user data pointer from the <code>cupsSetPasswordCB2</code> call.</p> | |
798d6e29 MS |
1146 | <h2 class="title"><a id="FUNCTIONS">Functions</a></h2> |
1147 | <h3 class="function"><a id="cupsAddDest">cupsAddDest</a></h3> | |
1148 | <p class="description">Add a destination to the list of destinations.</p> | |
1149 | <p class="code"> | |
98d88c8d MS |
1150 | int cupsAddDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p> |
1151 | <h4 class="parameters">Parameters</h4> | |
1152 | <table class="list"><tbody> | |
1153 | <tr><th>name</th> | |
1154 | <td class="description">Destination name</td></tr> | |
1155 | <tr><th>instance</th> | |
1156 | <td class="description">Instance name or <code>NULL</code> for none/primary</td></tr> | |
1157 | <tr><th>num_dests</th> | |
1158 | <td class="description">Number of destinations</td></tr> | |
1159 | <tr><th>dests</th> | |
1160 | <td class="description">Destinations</td></tr> | |
1161 | </tbody></table> | |
798d6e29 MS |
1162 | <h4 class="returnvalue">Return Value</h4> |
1163 | <p class="description">New number of destinations</p> | |
1164 | <h4 class="discussion">Discussion</h4> | |
1165 | <p class="discussion">This function cannot be used to add a new class or printer queue, | |
1166 | it only adds a new container of saved options for the named | |
1167 | destination or instance.<br> | |
1168 | <br> | |
1169 | If the named destination already exists, the destination list is | |
1170 | returned unchanged. Adding a new instance of a destination creates | |
1171 | a copy of that destination's options.<br> | |
1172 | <br> | |
1173 | Use the <a href="#cupsSaveDests"><code>cupsSaveDests</code></a> function to save the updated list of | |
1174 | destinations to the user's lpoptions file.</p> | |
63b75fbe MS |
1175 | <h3 class="function"><span class="info"> CUPS 2.3 </span><a id="cupsAddDestMediaOptions">cupsAddDestMediaOptions</a></h3> |
1176 | <p class="description">Add the option corresponding to the specified media size.</p> | |
1177 | <p class="code"> | |
1178 | 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> | |
1179 | <h4 class="parameters">Parameters</h4> | |
1180 | <table class="list"><tbody> | |
1181 | <tr><th>http</th> | |
1182 | <td class="description">Connection to destination</td></tr> | |
1183 | <tr><th>dest</th> | |
1184 | <td class="description">Destination</td></tr> | |
1185 | <tr><th>dinfo</th> | |
1186 | <td class="description">Destination information</td></tr> | |
1187 | <tr><th>flags</th> | |
1188 | <td class="description">Media matching flags</td></tr> | |
1189 | <tr><th>size</th> | |
1190 | <td class="description">Media size</td></tr> | |
1191 | <tr><th>num_options</th> | |
1192 | <td class="description">Current number of options</td></tr> | |
1193 | <tr><th>options</th> | |
1194 | <td class="description">Options</td></tr> | |
1195 | </tbody></table> | |
1196 | <h4 class="returnvalue">Return Value</h4> | |
1197 | <p class="description">New number of options</p> | |
98d88c8d | 1198 | <h3 class="function"><span class="info"> CUPS 2.2.4/macOS 10.13 </span><a id="cupsAddIntegerOption">cupsAddIntegerOption</a></h3> |
53af7f21 | 1199 | <p class="description">Add an integer option to an option array.</p> |
798d6e29 | 1200 | <p class="code"> |
98d88c8d MS |
1201 | int cupsAddIntegerOption(const char *name, int value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p> |
1202 | <h4 class="parameters">Parameters</h4> | |
1203 | <table class="list"><tbody> | |
1204 | <tr><th>name</th> | |
1205 | <td class="description">Name of option</td></tr> | |
1206 | <tr><th>value</th> | |
1207 | <td class="description">Value of option</td></tr> | |
1208 | <tr><th>num_options</th> | |
1209 | <td class="description">Number of options</td></tr> | |
1210 | <tr><th>options</th> | |
1211 | <td class="description">Pointer to options</td></tr> | |
1212 | </tbody></table> | |
798d6e29 MS |
1213 | <h4 class="returnvalue">Return Value</h4> |
1214 | <p class="description">Number of options</p> | |
1215 | <h4 class="discussion">Discussion</h4> | |
1216 | <p class="discussion">New option arrays can be initialized simply by passing 0 for the | |
53af7f21 | 1217 | "num_options" parameter. |
798d6e29 MS |
1218 | |
1219 | </p> | |
53af7f21 MS |
1220 | <h3 class="function"><a id="cupsAddOption">cupsAddOption</a></h3> |
1221 | <p class="description">Add an option to an option array.</p> | |
798d6e29 | 1222 | <p class="code"> |
98d88c8d MS |
1223 | int cupsAddOption(const char *name, const char *value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p> |
1224 | <h4 class="parameters">Parameters</h4> | |
1225 | <table class="list"><tbody> | |
1226 | <tr><th>name</th> | |
1227 | <td class="description">Name of option</td></tr> | |
1228 | <tr><th>value</th> | |
1229 | <td class="description">Value of option</td></tr> | |
1230 | <tr><th>num_options</th> | |
1231 | <td class="description">Number of options</td></tr> | |
1232 | <tr><th>options</th> | |
1233 | <td class="description">Pointer to options</td></tr> | |
1234 | </tbody></table> | |
798d6e29 | 1235 | <h4 class="returnvalue">Return Value</h4> |
53af7f21 | 1236 | <p class="description">Number of options</p> |
798d6e29 | 1237 | <h4 class="discussion">Discussion</h4> |
53af7f21 MS |
1238 | <p class="discussion">New option arrays can be initialized simply by passing 0 for the |
1239 | "num_options" parameter.</p> | |
98d88c8d | 1240 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCancelDestJob">cupsCancelDestJob</a></h3> |
798d6e29 | 1241 | <p class="description">Cancel a job on a destination.</p> |
98d88c8d MS |
1242 | <p class="code"> |
1243 | 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> | |
1244 | <h4 class="parameters">Parameters</h4> | |
1245 | <table class="list"><tbody> | |
1246 | <tr><th>http</th> | |
1247 | <td class="description">Connection to destination</td></tr> | |
1248 | <tr><th>dest</th> | |
1249 | <td class="description">Destination</td></tr> | |
1250 | <tr><th>job_id</th> | |
1251 | <td class="description">Job ID</td></tr> | |
1252 | </tbody></table> | |
1253 | <h4 class="returnvalue">Return Value</h4> | |
1254 | <p class="description">Status of cancel operation</p> | |
1255 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
1256 | <p class="discussion">The "job_id" is the number returned by cupsCreateDestJob.<br> |
1257 | <br> | |
1258 | Returns <code>IPP_STATUS_OK</code> on success and | |
98d88c8d | 1259 | <code>IPP_STATUS_ERROR_NOT_AUTHORIZED</code> or |
798d6e29 MS |
1260 | <code>IPP_STATUS_ERROR_FORBIDDEN</code> on failure. |
1261 | ||
798d6e29 MS |
1262 | </p> |
1263 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCheckDestSupported">cupsCheckDestSupported</a></h3> | |
1264 | <p class="description">Check that the option and value are supported | |
1265 | by the destination.</p> | |
1266 | <p class="code"> | |
98d88c8d MS |
1267 | 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> |
1268 | <h4 class="parameters">Parameters</h4> | |
1269 | <table class="list"><tbody> | |
1270 | <tr><th>http</th> | |
1271 | <td class="description">Connection to destination</td></tr> | |
1272 | <tr><th>dest</th> | |
1273 | <td class="description">Destination</td></tr> | |
1274 | <tr><th>dinfo</th> | |
1275 | <td class="description">Destination information</td></tr> | |
1276 | <tr><th>option</th> | |
1277 | <td class="description">Option</td></tr> | |
1278 | <tr><th>value</th> | |
b0fb2d75 | 1279 | <td class="description">Value or <code>NULL</code></td></tr> |
98d88c8d | 1280 | </tbody></table> |
798d6e29 MS |
1281 | <h4 class="returnvalue">Return Value</h4> |
1282 | <p class="description">1 if supported, 0 otherwise</p> | |
1283 | <h4 class="discussion">Discussion</h4> | |
1284 | <p class="discussion">Returns 1 if supported, 0 otherwise. | |
1285 | ||
1286 | </p> | |
1287 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCloseDestJob">cupsCloseDestJob</a></h3> | |
1288 | <p class="description">Close a job and start printing.</p> | |
1289 | <p class="code"> | |
98d88c8d MS |
1290 | 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> |
1291 | <h4 class="parameters">Parameters</h4> | |
1292 | <table class="list"><tbody> | |
1293 | <tr><th>http</th> | |
1294 | <td class="description">Connection to destination</td></tr> | |
1295 | <tr><th>dest</th> | |
1296 | <td class="description">Destination</td></tr> | |
1297 | <tr><th>info</th> | |
1298 | <td class="description">Destination information</td></tr> | |
1299 | <tr><th>job_id</th> | |
1300 | <td class="description">Job ID</td></tr> | |
1301 | </tbody></table> | |
798d6e29 MS |
1302 | <h4 class="returnvalue">Return Value</h4> |
1303 | <p class="description">IPP status code</p> | |
1304 | <h4 class="discussion">Discussion</h4> | |
1305 | <p class="discussion">Use when the last call to cupsStartDocument passed 0 for "last_document". | |
1306 | "job_id" is the job ID returned by cupsCreateDestJob. Returns <code>IPP_STATUS_OK</code> | |
1307 | on success. | |
1308 | ||
1309 | </p> | |
1310 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsConnectDest">cupsConnectDest</a></h3> | |
98d88c8d MS |
1311 | <p class="description">Open a conection to the destination.</p> |
1312 | <p class="code"> | |
1313 | <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> | |
1314 | <h4 class="parameters">Parameters</h4> | |
1315 | <table class="list"><tbody> | |
1316 | <tr><th>dest</th> | |
1317 | <td class="description">Destination</td></tr> | |
1318 | <tr><th>flags</th> | |
1319 | <td class="description">Connection flags</td></tr> | |
1320 | <tr><th>msec</th> | |
1321 | <td class="description">Timeout in milliseconds</td></tr> | |
1322 | <tr><th>cancel</th> | |
1323 | <td class="description">Pointer to "cancel" variable</td></tr> | |
1324 | <tr><th>resource</th> | |
1325 | <td class="description">Resource buffer</td></tr> | |
1326 | <tr><th>resourcesize</th> | |
1327 | <td class="description">Size of resource buffer</td></tr> | |
1328 | <tr><th>cb</th> | |
1329 | <td class="description">Callback function</td></tr> | |
1330 | <tr><th>user_data</th> | |
1331 | <td class="description">User data pointer</td></tr> | |
1332 | </tbody></table> | |
1333 | <h4 class="returnvalue">Return Value</h4> | |
1334 | <p class="description">Connection to destination or <code>NULL</code></p> | |
1335 | <h4 class="discussion">Discussion</h4> | |
1336 | <p class="discussion">Connect to the destination, returning a new <code>http_t</code> connection object | |
1337 | and optionally the resource path to use for the destination. These calls | |
1338 | will block until a connection is made, the timeout expires, the integer | |
1339 | pointed to by "cancel" is non-zero, or the callback function (or block) | |
1340 | returns 0. The caller is responsible for calling <a href="#httpClose"><code>httpClose</code></a> on the | |
b0fb2d75 MS |
1341 | returned connection.<br> |
1342 | <br> | |
1343 | Starting with CUPS 2.2.4, the caller can pass <code>CUPS_DEST_FLAGS_DEVICE</code> | |
1344 | for the "flags" argument to connect directly to the device associated with | |
1345 | the destination. Otherwise, the connection is made to the CUPS scheduler | |
1346 | associated with the destination. | |
798d6e29 MS |
1347 | |
1348 | </p> | |
53af7f21 MS |
1349 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCopyDest">cupsCopyDest</a></h3> |
1350 | <p class="description">Copy a destination.</p> | |
798d6e29 | 1351 | <p class="code"> |
98d88c8d MS |
1352 | 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> |
1353 | <h4 class="parameters">Parameters</h4> | |
1354 | <table class="list"><tbody> | |
1355 | <tr><th>dest</th> | |
1356 | <td class="description">Destination to copy</td></tr> | |
1357 | <tr><th>num_dests</th> | |
1358 | <td class="description">Number of destinations</td></tr> | |
1359 | <tr><th>dests</th> | |
1360 | <td class="description">Destination array</td></tr> | |
1361 | </tbody></table> | |
798d6e29 MS |
1362 | <h4 class="returnvalue">Return Value</h4> |
1363 | <p class="description">New number of destinations</p> | |
1364 | <h4 class="discussion">Discussion</h4> | |
1365 | <p class="discussion">Make a copy of the destination to an array of destinations (or just a single | |
1366 | copy) - for use with the cupsEnumDests* functions. The caller is responsible | |
1367 | for calling cupsFreeDests() on the returned object(s). | |
1368 | ||
1369 | </p> | |
1370 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCopyDestConflicts">cupsCopyDestConflicts</a></h3> | |
1371 | <p class="description">Get conflicts and resolutions for a new | |
1372 | option/value pair.</p> | |
1373 | <p class="code"> | |
98d88c8d MS |
1374 | 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> |
1375 | <h4 class="parameters">Parameters</h4> | |
1376 | <table class="list"><tbody> | |
1377 | <tr><th>http</th> | |
1378 | <td class="description">Connection to destination</td></tr> | |
1379 | <tr><th>dest</th> | |
1380 | <td class="description">Destination</td></tr> | |
1381 | <tr><th>dinfo</th> | |
1382 | <td class="description">Destination information</td></tr> | |
1383 | <tr><th>num_options</th> | |
1384 | <td class="description">Number of current options</td></tr> | |
1385 | <tr><th>options</th> | |
1386 | <td class="description">Current options</td></tr> | |
1387 | <tr><th>new_option</th> | |
1388 | <td class="description">New option</td></tr> | |
1389 | <tr><th>new_value</th> | |
1390 | <td class="description">New value</td></tr> | |
1391 | <tr><th>num_conflicts</th> | |
1392 | <td class="description">Number of conflicting options</td></tr> | |
1393 | <tr><th>conflicts</th> | |
1394 | <td class="description">Conflicting options</td></tr> | |
1395 | <tr><th>num_resolved</th> | |
1396 | <td class="description">Number of options to resolve</td></tr> | |
1397 | <tr><th>resolved</th> | |
1398 | <td class="description">Resolved options</td></tr> | |
1399 | </tbody></table> | |
798d6e29 MS |
1400 | <h4 class="returnvalue">Return Value</h4> |
1401 | <p class="description">1 if there is a conflict, 0 if none, -1 on error</p> | |
1402 | <h4 class="discussion">Discussion</h4> | |
1403 | <p class="discussion">"num_options" and "options" represent the currently selected options by the | |
1404 | user. "new_option" and "new_value" are the setting the user has just | |
1405 | changed.<br> | |
1406 | <br> | |
1407 | Returns 1 if there is a conflict, 0 if there are no conflicts, and -1 if | |
1408 | there was an unrecoverable error such as a resolver loop.<br> | |
1409 | <br> | |
1410 | If "num_conflicts" and "conflicts" are not <code>NULL</code>, they are set to | |
1411 | contain the list of conflicting option/value pairs. Similarly, if | |
1412 | "num_resolved" and "resolved" are not <code>NULL</code> they will be set to the | |
1413 | list of changes needed to resolve the conflict.<br> | |
1414 | <br> | |
1415 | If cupsCopyDestConflicts returns 1 but "num_resolved" and "resolved" are set | |
1416 | to 0 and <code>NULL</code>, respectively, then the conflict cannot be resolved. | |
1417 | ||
1418 | </p> | |
1419 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCopyDestInfo">cupsCopyDestInfo</a></h3> | |
1420 | <p class="description">Get the supported values/capabilities for the | |
1421 | destination.</p> | |
1422 | <p class="code"> | |
98d88c8d | 1423 | <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 | 1424 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
1425 | <table class="list"><tbody> |
1426 | <tr><th>http</th> | |
1427 | <td class="description">Connection to destination</td></tr> | |
1428 | <tr><th>dest</th> | |
1429 | <td class="description">Destination</td></tr> | |
1430 | </tbody></table> | |
798d6e29 MS |
1431 | <h4 class="returnvalue">Return Value</h4> |
1432 | <p class="description">Destination information</p> | |
1433 | <h4 class="discussion">Discussion</h4> | |
1434 | <p class="discussion">The caller is responsible for calling <a href="#cupsFreeDestInfo"><code>cupsFreeDestInfo</code></a> on the return | |
1435 | value. <code>NULL</code> is returned on error. | |
1436 | ||
1437 | </p> | |
1438 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCreateDestJob">cupsCreateDestJob</a></h3> | |
1439 | <p class="description">Create a job on a destination.</p> | |
1440 | <p class="code"> | |
98d88c8d MS |
1441 | 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> |
1442 | <h4 class="parameters">Parameters</h4> | |
1443 | <table class="list"><tbody> | |
1444 | <tr><th>http</th> | |
1445 | <td class="description">Connection to destination</td></tr> | |
1446 | <tr><th>dest</th> | |
1447 | <td class="description">Destination</td></tr> | |
1448 | <tr><th>info</th> | |
1449 | <td class="description">Destination information</td></tr> | |
1450 | <tr><th>job_id</th> | |
1451 | <td class="description">Job ID or 0 on error</td></tr> | |
1452 | <tr><th>title</th> | |
1453 | <td class="description">Job name</td></tr> | |
1454 | <tr><th>num_options</th> | |
1455 | <td class="description">Number of job options</td></tr> | |
1456 | <tr><th>options</th> | |
1457 | <td class="description">Job options</td></tr> | |
1458 | </tbody></table> | |
798d6e29 MS |
1459 | <h4 class="returnvalue">Return Value</h4> |
1460 | <p class="description">IPP status code</p> | |
1461 | <h4 class="discussion">Discussion</h4> | |
1462 | <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success, saving the job ID | |
1463 | in the variable pointed to by "job_id". | |
1464 | ||
1465 | </p> | |
798d6e29 MS |
1466 | <h3 class="function"><span class="info"> CUPS 1.1.20/macOS 10.4 </span><a id="cupsDoAuthentication">cupsDoAuthentication</a></h3> |
1467 | <p class="description">Authenticate a request.</p> | |
1468 | <p class="code"> | |
98d88c8d MS |
1469 | int cupsDoAuthentication(<a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p> |
1470 | <h4 class="parameters">Parameters</h4> | |
1471 | <table class="list"><tbody> | |
1472 | <tr><th>http</th> | |
1473 | <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> | |
1474 | <tr><th>method</th> | |
1475 | <td class="description">Request method ("GET", "POST", "PUT")</td></tr> | |
1476 | <tr><th>resource</th> | |
1477 | <td class="description">Resource path</td></tr> | |
1478 | </tbody></table> | |
798d6e29 MS |
1479 | <h4 class="returnvalue">Return Value</h4> |
1480 | <p class="description">0 on success, -1 on error</p> | |
1481 | <h4 class="discussion">Discussion</h4> | |
1482 | <p class="discussion">This function should be called in response to a <code>HTTP_STATUS_UNAUTHORIZED</code> | |
1483 | status, prior to resubmitting your request. | |
1484 | ||
1485 | </p> | |
1486 | <h3 class="function"><a id="cupsEncodeOptions">cupsEncodeOptions</a></h3> | |
53af7f21 | 1487 | <p class="description">Encode printer options into IPP attributes.</p> |
98d88c8d MS |
1488 | <p class="code"> |
1489 | void cupsEncodeOptions(<a href="#ipp_t">ipp_t</a> *ipp, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p> | |
1490 | <h4 class="parameters">Parameters</h4> | |
1491 | <table class="list"><tbody> | |
1492 | <tr><th>ipp</th> | |
1493 | <td class="description">Request to add to</td></tr> | |
1494 | <tr><th>num_options</th> | |
1495 | <td class="description">Number of options</td></tr> | |
1496 | <tr><th>options</th> | |
1497 | <td class="description">Options</td></tr> | |
1498 | </tbody></table> | |
1499 | <h4 class="discussion">Discussion</h4> | |
798d6e29 | 1500 | <p class="discussion">This function adds operation, job, and then subscription attributes, |
98d88c8d MS |
1501 | in that order. Use the <a href="#cupsEncodeOptions2"><code>cupsEncodeOptions2</code></a> function to add attributes |
1502 | for a single group.</p> | |
1503 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsEncodeOptions2">cupsEncodeOptions2</a></h3> | |
53af7f21 | 1504 | <p class="description">Encode printer options into IPP attributes for a group.</p> |
98d88c8d MS |
1505 | <p class="code"> |
1506 | 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> | |
1507 | <h4 class="parameters">Parameters</h4> | |
1508 | <table class="list"><tbody> | |
1509 | <tr><th>ipp</th> | |
1510 | <td class="description">Request to add to</td></tr> | |
1511 | <tr><th>num_options</th> | |
1512 | <td class="description">Number of options</td></tr> | |
1513 | <tr><th>options</th> | |
1514 | <td class="description">Options</td></tr> | |
1515 | <tr><th>group_tag</th> | |
1516 | <td class="description">Group to encode</td></tr> | |
1517 | </tbody></table> | |
1518 | <h4 class="discussion">Discussion</h4> | |
798d6e29 | 1519 | <p class="discussion">This function only adds attributes for a single group. Call this |
98d88c8d | 1520 | function multiple times for each group, or use <a href="#cupsEncodeOptions"><code>cupsEncodeOptions</code></a> |
798d6e29 MS |
1521 | to add the standard groups. |
1522 | ||
1523 | </p> | |
1524 | <h3 class="function"><a id="cupsEncryption">cupsEncryption</a></h3> | |
1525 | <p class="description">Get the current encryption settings.</p> | |
1526 | <p class="code"> | |
98d88c8d | 1527 | <a href="#http_encryption_t">http_encryption_t</a> cupsEncryption(void);</p> |
798d6e29 MS |
1528 | <h4 class="returnvalue">Return Value</h4> |
1529 | <p class="description">Encryption settings</p> | |
1530 | <h4 class="discussion">Discussion</h4> | |
1531 | <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION | |
1532 | environment variable, then the ~/.cups/client.conf file, and finally the | |
1533 | /etc/cups/client.conf file. If not set, the default is | |
1534 | <code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br> | |
1535 | <br> | |
1536 | Note: The current encryption setting is tracked separately for each thread | |
1537 | in a program. Multi-threaded programs that override the setting via the | |
1538 | <a href="#cupsSetEncryption"><code>cupsSetEncryption</code></a> function need to do so in each thread for the same | |
1539 | setting to be used.</p> | |
1540 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsEnumDests">cupsEnumDests</a></h3> | |
1541 | <p class="description">Enumerate available destinations with a callback function.</p> | |
1542 | <p class="code"> | |
98d88c8d MS |
1543 | 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> |
1544 | <h4 class="parameters">Parameters</h4> | |
1545 | <table class="list"><tbody> | |
1546 | <tr><th>flags</th> | |
1547 | <td class="description">Enumeration flags</td></tr> | |
1548 | <tr><th>msec</th> | |
1549 | <td class="description">Timeout in milliseconds, -1 for indefinite</td></tr> | |
1550 | <tr><th>cancel</th> | |
1551 | <td class="description">Pointer to "cancel" variable</td></tr> | |
1552 | <tr><th>type</th> | |
1553 | <td class="description">Printer type bits</td></tr> | |
1554 | <tr><th>mask</th> | |
1555 | <td class="description">Mask for printer type bits</td></tr> | |
1556 | <tr><th>cb</th> | |
1557 | <td class="description">Callback function</td></tr> | |
1558 | <tr><th>user_data</th> | |
1559 | <td class="description">User data</td></tr> | |
1560 | </tbody></table> | |
798d6e29 MS |
1561 | <h4 class="returnvalue">Return Value</h4> |
1562 | <p class="description">1 on success, 0 on failure</p> | |
1563 | <h4 class="discussion">Discussion</h4> | |
53af7f21 MS |
1564 | <p class="discussion">Destinations are enumerated from one or more sources. The callback function |
1565 | receives the <code>user_data</code> pointer and the destination pointer which can | |
1566 | be used as input to the <a href="#cupsCopyDest"><code>cupsCopyDest</code></a> function. The function must | |
1567 | return 1 to continue enumeration or 0 to stop.<br> | |
798d6e29 | 1568 | <br> |
53af7f21 MS |
1569 | The <code>type</code> and <code>mask</code> arguments allow the caller to filter the |
1570 | destinations that are enumerated. Passing 0 for both will enumerate all | |
1571 | printers. The constant <code>CUPS_PRINTER_DISCOVERED</code> is used to filter on | |
1572 | destinations that are available but have not yet been added locally.<br> | |
798d6e29 MS |
1573 | <br> |
1574 | Enumeration happens on the current thread and does not return until all | |
718ee2ff MS |
1575 | destinations have been enumerated or the callback function returns 0.<br> |
1576 | <br> | |
1577 | Note: The callback function will likely receive multiple updates for the same | |
1578 | destinations - it is up to the caller to suppress any duplicate destinations. | |
798d6e29 MS |
1579 | |
1580 | </p> | |
798d6e29 MS |
1581 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsFindDestDefault">cupsFindDestDefault</a></h3> |
1582 | <p class="description">Find the default value(s) for the given option.</p> | |
1583 | <p class="code"> | |
98d88c8d MS |
1584 | <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> |
1585 | <h4 class="parameters">Parameters</h4> | |
1586 | <table class="list"><tbody> | |
1587 | <tr><th>http</th> | |
1588 | <td class="description">Connection to destination</td></tr> | |
1589 | <tr><th>dest</th> | |
1590 | <td class="description">Destination</td></tr> | |
1591 | <tr><th>dinfo</th> | |
1592 | <td class="description">Destination information</td></tr> | |
1593 | <tr><th>option</th> | |
1594 | <td class="description">Option/attribute name</td></tr> | |
1595 | </tbody></table> | |
798d6e29 MS |
1596 | <h4 class="returnvalue">Return Value</h4> |
1597 | <p class="description">Default attribute or <code>NULL</code> for none</p> | |
1598 | <h4 class="discussion">Discussion</h4> | |
1599 | <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>, | |
1600 | <code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>, | |
1601 | <code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>, | |
1602 | <code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code> | |
1603 | functions to inspect the default value(s) as needed. | |
1604 | ||
1605 | </p> | |
1606 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsFindDestReady">cupsFindDestReady</a></h3> | |
1607 | <p class="description">Find the default value(s) for the given option.</p> | |
1608 | <p class="code"> | |
98d88c8d MS |
1609 | <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> |
1610 | <h4 class="parameters">Parameters</h4> | |
1611 | <table class="list"><tbody> | |
1612 | <tr><th>http</th> | |
1613 | <td class="description">Connection to destination</td></tr> | |
1614 | <tr><th>dest</th> | |
1615 | <td class="description">Destination</td></tr> | |
1616 | <tr><th>dinfo</th> | |
1617 | <td class="description">Destination information</td></tr> | |
1618 | <tr><th>option</th> | |
1619 | <td class="description">Option/attribute name</td></tr> | |
1620 | </tbody></table> | |
798d6e29 MS |
1621 | <h4 class="returnvalue">Return Value</h4> |
1622 | <p class="description">Default attribute or <code>NULL</code> for none</p> | |
1623 | <h4 class="discussion">Discussion</h4> | |
1624 | <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>, | |
1625 | <code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>, | |
1626 | <code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>, | |
1627 | <code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code> | |
1628 | functions to inspect the default value(s) as needed. | |
1629 | ||
1630 | </p> | |
1631 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsFindDestSupported">cupsFindDestSupported</a></h3> | |
1632 | <p class="description">Find the default value(s) for the given option.</p> | |
1633 | <p class="code"> | |
98d88c8d MS |
1634 | <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> |
1635 | <h4 class="parameters">Parameters</h4> | |
1636 | <table class="list"><tbody> | |
1637 | <tr><th>http</th> | |
1638 | <td class="description">Connection to destination</td></tr> | |
1639 | <tr><th>dest</th> | |
1640 | <td class="description">Destination</td></tr> | |
1641 | <tr><th>dinfo</th> | |
1642 | <td class="description">Destination information</td></tr> | |
1643 | <tr><th>option</th> | |
1644 | <td class="description">Option/attribute name</td></tr> | |
1645 | </tbody></table> | |
798d6e29 MS |
1646 | <h4 class="returnvalue">Return Value</h4> |
1647 | <p class="description">Default attribute or <code>NULL</code> for none</p> | |
1648 | <h4 class="discussion">Discussion</h4> | |
1649 | <p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>, | |
1650 | <code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>, | |
1651 | <code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>, | |
1652 | <code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code> | |
1653 | functions to inspect the default value(s) as needed. | |
1654 | ||
1655 | </p> | |
1656 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsFinishDestDocument">cupsFinishDestDocument</a></h3> | |
1657 | <p class="description">Finish the current document.</p> | |
1658 | <p class="code"> | |
98d88c8d MS |
1659 | 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> |
1660 | <h4 class="parameters">Parameters</h4> | |
1661 | <table class="list"><tbody> | |
1662 | <tr><th>http</th> | |
1663 | <td class="description">Connection to destination</td></tr> | |
1664 | <tr><th>dest</th> | |
1665 | <td class="description">Destination</td></tr> | |
1666 | <tr><th>info</th> | |
1667 | <td class="description">Destination information</td></tr> | |
1668 | </tbody></table> | |
798d6e29 MS |
1669 | <h4 class="returnvalue">Return Value</h4> |
1670 | <p class="description">Status of document submission</p> | |
1671 | <h4 class="discussion">Discussion</h4> | |
1672 | <p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success. | |
1673 | ||
798d6e29 | 1674 | </p> |
98d88c8d | 1675 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsFreeDestInfo">cupsFreeDestInfo</a></h3> |
53af7f21 MS |
1676 | <p class="description">Free destination information obtained using |
1677 | <a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a>.</p> | |
798d6e29 | 1678 | <p class="code"> |
98d88c8d | 1679 | void cupsFreeDestInfo(<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo);</p> |
798d6e29 | 1680 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
1681 | <table class="list"><tbody> |
1682 | <tr><th>dinfo</th> | |
1683 | <td class="description">Destination information</td></tr> | |
1684 | </tbody></table> | |
1685 | <h3 class="function"><a id="cupsFreeDests">cupsFreeDests</a></h3> | |
53af7f21 | 1686 | <p class="description">Free the memory used by the list of destinations.</p> |
798d6e29 | 1687 | <p class="code"> |
98d88c8d | 1688 | void cupsFreeDests(int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p> |
798d6e29 | 1689 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
1690 | <table class="list"><tbody> |
1691 | <tr><th>num_dests</th> | |
1692 | <td class="description">Number of destinations</td></tr> | |
1693 | <tr><th>dests</th> | |
1694 | <td class="description">Destinations</td></tr> | |
1695 | </tbody></table> | |
1696 | <h3 class="function"><a id="cupsFreeJobs">cupsFreeJobs</a></h3> | |
53af7f21 | 1697 | <p class="description">Free memory used by job data.</p> |
798d6e29 | 1698 | <p class="code"> |
98d88c8d | 1699 | void cupsFreeJobs(int num_jobs, <a href="#cups_job_t">cups_job_t</a> *jobs);</p> |
798d6e29 | 1700 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
1701 | <table class="list"><tbody> |
1702 | <tr><th>num_jobs</th> | |
1703 | <td class="description">Number of jobs</td></tr> | |
1704 | <tr><th>jobs</th> | |
1705 | <td class="description">Jobs</td></tr> | |
1706 | </tbody></table> | |
1707 | <h3 class="function"><a id="cupsFreeOptions">cupsFreeOptions</a></h3> | |
53af7f21 | 1708 | <p class="description">Free all memory used by options.</p> |
98d88c8d MS |
1709 | <p class="code"> |
1710 | void cupsFreeOptions(int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p> | |
1711 | <h4 class="parameters">Parameters</h4> | |
1712 | <table class="list"><tbody> | |
1713 | <tr><th>num_options</th> | |
1714 | <td class="description">Number of options</td></tr> | |
1715 | <tr><th>options</th> | |
1716 | <td class="description">Pointer to options</td></tr> | |
1717 | </tbody></table> | |
798d6e29 MS |
1718 | <h3 class="function"><a id="cupsGetDest">cupsGetDest</a></h3> |
1719 | <p class="description">Get the named destination from the list.</p> | |
1720 | <p class="code"> | |
98d88c8d MS |
1721 | <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> |
1722 | <h4 class="parameters">Parameters</h4> | |
1723 | <table class="list"><tbody> | |
1724 | <tr><th>name</th> | |
1725 | <td class="description">Destination name or <code>NULL</code> for the default destination</td></tr> | |
1726 | <tr><th>instance</th> | |
1727 | <td class="description">Instance name or <code>NULL</code></td></tr> | |
1728 | <tr><th>num_dests</th> | |
1729 | <td class="description">Number of destinations</td></tr> | |
1730 | <tr><th>dests</th> | |
1731 | <td class="description">Destinations</td></tr> | |
1732 | </tbody></table> | |
798d6e29 MS |
1733 | <h4 class="returnvalue">Return Value</h4> |
1734 | <p class="description">Destination pointer or <code>NULL</code></p> | |
1735 | <h4 class="discussion">Discussion</h4> | |
98d88c8d | 1736 | <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 |
1737 | list of supported destinations for the current user.</p> |
1738 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></h3> | |
1739 | <p class="description">Get a media name, dimension, and margins for a | |
1740 | specific size.</p> | |
1741 | <p class="code"> | |
98d88c8d MS |
1742 | 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> |
1743 | <h4 class="parameters">Parameters</h4> | |
1744 | <table class="list"><tbody> | |
1745 | <tr><th>http</th> | |
1746 | <td class="description">Connection to destination</td></tr> | |
1747 | <tr><th>dest</th> | |
1748 | <td class="description">Destination</td></tr> | |
1749 | <tr><th>dinfo</th> | |
1750 | <td class="description">Destination information</td></tr> | |
1751 | <tr><th>n</th> | |
1752 | <td class="description">Media size number (0-based)</td></tr> | |
1753 | <tr><th>flags</th> | |
1754 | <td class="description">Media flags</td></tr> | |
1755 | <tr><th>size</th> | |
1756 | <td class="description">Media size information</td></tr> | |
1757 | </tbody></table> | |
798d6e29 MS |
1758 | <h4 class="returnvalue">Return Value</h4> |
1759 | <p class="description">1 on success, 0 on failure</p> | |
1760 | <h4 class="discussion">Discussion</h4> | |
1761 | <p class="discussion">The <code>flags</code> parameter determines which set of media are indexed. For | |
1762 | example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will get the Nth | |
1763 | borderless size supported by the printer. | |
1764 | ||
1765 | </p> | |
1766 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsGetDestMediaByName">cupsGetDestMediaByName</a></h3> | |
1767 | <p class="description">Get media names, dimensions, and margins.</p> | |
1768 | <p class="code"> | |
98d88c8d MS |
1769 | 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> |
1770 | <h4 class="parameters">Parameters</h4> | |
1771 | <table class="list"><tbody> | |
1772 | <tr><th>http</th> | |
1773 | <td class="description">Connection to destination</td></tr> | |
1774 | <tr><th>dest</th> | |
1775 | <td class="description">Destination</td></tr> | |
1776 | <tr><th>dinfo</th> | |
1777 | <td class="description">Destination information</td></tr> | |
1778 | <tr><th>media</th> | |
1779 | <td class="description">Media name</td></tr> | |
1780 | <tr><th>flags</th> | |
1781 | <td class="description">Media matching flags</td></tr> | |
1782 | <tr><th>size</th> | |
1783 | <td class="description">Media size information</td></tr> | |
1784 | </tbody></table> | |
798d6e29 MS |
1785 | <h4 class="returnvalue">Return Value</h4> |
1786 | <p class="description">1 on match, 0 on failure</p> | |
1787 | <h4 class="discussion">Discussion</h4> | |
1788 | <p class="discussion">The "media" string is a PWG media name. "Flags" provides some matching | |
1789 | guidance (multiple flags can be combined):<br> | |
1790 | <br> | |
1791 | CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer, | |
1792 | CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size, | |
1793 | CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing, | |
1794 | CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and | |
1795 | CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the | |
1796 | size amongst the "ready" media.<br> | |
1797 | <br> | |
1798 | The matching result (if any) is returned in the "cups_size_t" structure.<br> | |
1799 | <br> | |
1800 | Returns 1 when there is a match and 0 if there is not a match. | |
1801 | ||
1802 | </p> | |
1803 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></h3> | |
1804 | <p class="description">Get media names, dimensions, and margins.</p> | |
1805 | <p class="code"> | |
98d88c8d MS |
1806 | 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> |
1807 | <h4 class="parameters">Parameters</h4> | |
1808 | <table class="list"><tbody> | |
1809 | <tr><th>http</th> | |
1810 | <td class="description">Connection to destination</td></tr> | |
1811 | <tr><th>dest</th> | |
1812 | <td class="description">Destination</td></tr> | |
1813 | <tr><th>dinfo</th> | |
1814 | <td class="description">Destination information</td></tr> | |
1815 | <tr><th>width</th> | |
1816 | <td class="description">Media width in hundredths of | |
1817 | of millimeters</td></tr> | |
1818 | <tr><th>length</th> | |
1819 | <td class="description">Media length in hundredths of | |
1820 | of millimeters</td></tr> | |
1821 | <tr><th>flags</th> | |
1822 | <td class="description">Media matching flags</td></tr> | |
1823 | <tr><th>size</th> | |
1824 | <td class="description">Media size information</td></tr> | |
1825 | </tbody></table> | |
798d6e29 MS |
1826 | <h4 class="returnvalue">Return Value</h4> |
1827 | <p class="description">1 on match, 0 on failure</p> | |
1828 | <h4 class="discussion">Discussion</h4> | |
1829 | <p class="discussion">"Width" and "length" are the dimensions in hundredths of millimeters. | |
1830 | "Flags" provides some matching guidance (multiple flags can be combined):<br> | |
1831 | <br> | |
1832 | CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer, | |
1833 | CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size, | |
1834 | CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing, | |
1835 | CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and | |
1836 | CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the | |
1837 | size amongst the "ready" media.<br> | |
1838 | <br> | |
1839 | The matching result (if any) is returned in the "cups_size_t" structure.<br> | |
1840 | <br> | |
1841 | Returns 1 when there is a match and 0 if there is not a match. | |
1842 | ||
1843 | </p> | |
1844 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsGetDestMediaCount">cupsGetDestMediaCount</a></h3> | |
1845 | <p class="description">Get the number of sizes supported by a | |
1846 | destination.</p> | |
1847 | <p class="code"> | |
98d88c8d MS |
1848 | 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> |
1849 | <h4 class="parameters">Parameters</h4> | |
1850 | <table class="list"><tbody> | |
1851 | <tr><th>http</th> | |
1852 | <td class="description">Connection to destination</td></tr> | |
1853 | <tr><th>dest</th> | |
1854 | <td class="description">Destination</td></tr> | |
1855 | <tr><th>dinfo</th> | |
1856 | <td class="description">Destination information</td></tr> | |
1857 | <tr><th>flags</th> | |
1858 | <td class="description">Media flags</td></tr> | |
1859 | </tbody></table> | |
798d6e29 MS |
1860 | <h4 class="returnvalue">Return Value</h4> |
1861 | <p class="description">Number of sizes</p> | |
1862 | <h4 class="discussion">Discussion</h4> | |
1863 | <p class="discussion">The <code>flags</code> parameter determines the set of media sizes that are | |
1864 | counted. For example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return | |
1865 | the number of borderless sizes. | |
1866 | ||
1867 | </p> | |
1868 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></h3> | |
1869 | <p class="description">Get the default size for a destination.</p> | |
1870 | <p class="code"> | |
98d88c8d MS |
1871 | 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> |
1872 | <h4 class="parameters">Parameters</h4> | |
1873 | <table class="list"><tbody> | |
1874 | <tr><th>http</th> | |
1875 | <td class="description">Connection to destination</td></tr> | |
1876 | <tr><th>dest</th> | |
1877 | <td class="description">Destination</td></tr> | |
1878 | <tr><th>dinfo</th> | |
1879 | <td class="description">Destination information</td></tr> | |
1880 | <tr><th>flags</th> | |
1881 | <td class="description">Media flags</td></tr> | |
1882 | <tr><th>size</th> | |
1883 | <td class="description">Media size information</td></tr> | |
1884 | </tbody></table> | |
798d6e29 MS |
1885 | <h4 class="returnvalue">Return Value</h4> |
1886 | <p class="description">1 on success, 0 on failure</p> | |
1887 | <h4 class="discussion">Discussion</h4> | |
1888 | <p class="discussion">The <code>flags</code> parameter determines which default size is returned. For | |
1889 | example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the default | |
1890 | borderless size, typically US Letter or A4, but sometimes 4x6 photo media. | |
1891 | ||
1892 | </p> | |
1893 | <h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="cupsGetDestWithURI">cupsGetDestWithURI</a></h3> | |
1894 | <p class="description">Get a destination associated with a URI.</p> | |
1895 | <p class="code"> | |
98d88c8d | 1896 | <a href="#cups_dest_t">cups_dest_t</a> *cupsGetDestWithURI(const char *name, const char *uri);</p> |
798d6e29 | 1897 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
1898 | <table class="list"><tbody> |
1899 | <tr><th>name</th> | |
1900 | <td class="description">Desired printer name or <code>NULL</code></td></tr> | |
1901 | <tr><th>uri</th> | |
1902 | <td class="description">URI for the printer</td></tr> | |
1903 | </tbody></table> | |
798d6e29 MS |
1904 | <h4 class="returnvalue">Return Value</h4> |
1905 | <p class="description">Destination or <code>NULL</code></p> | |
1906 | <h4 class="discussion">Discussion</h4> | |
1907 | <p class="discussion">"name" is the desired name for the printer. If <code>NULL</code>, a name will be | |
1908 | created using the URI.<br> | |
1909 | <br> | |
1910 | "uri" is the "ipp" or "ipps" URI for the printer. | |
1911 | ||
1912 | </p> | |
98d88c8d MS |
1913 | <h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsGetDests2">cupsGetDests2</a></h3> |
1914 | <p class="description">Get the list of destinations from the specified server.</p> | |
1915 | <p class="code"> | |
1916 | int cupsGetDests2(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p> | |
1917 | <h4 class="parameters">Parameters</h4> | |
1918 | <table class="list"><tbody> | |
1919 | <tr><th>http</th> | |
1920 | <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> | |
1921 | <tr><th>dests</th> | |
1922 | <td class="description">Destinations</td></tr> | |
1923 | </tbody></table> | |
1924 | <h4 class="returnvalue">Return Value</h4> | |
1925 | <p class="description">Number of destinations</p> | |
1926 | <h4 class="discussion">Discussion</h4> | |
1927 | <p class="discussion">Starting with CUPS 1.2, the returned list of destinations include the | |
1928 | "printer-info", "printer-is-accepting-jobs", "printer-is-shared", | |
1929 | "printer-make-and-model", "printer-state", "printer-state-change-time", | |
1930 | "printer-state-reasons", "printer-type", and "printer-uri-supported" | |
1931 | attributes as options.<br> | |
1932 | <br> | |
1933 | CUPS 1.4 adds the "marker-change-time", "marker-colors", | |
1934 | "marker-high-levels", "marker-levels", "marker-low-levels", "marker-message", | |
1935 | "marker-names", "marker-types", and "printer-commands" attributes as options.<br> | |
1936 | <br> | |
1937 | CUPS 2.2 adds accessible IPP printers to the list of destinations that can | |
1938 | be used. The "printer-uri-supported" option will be present for those IPP | |
1939 | printers that have been recently used.<br> | |
1940 | <br> | |
1941 | Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and | |
1942 | the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination. | |
1943 | ||
1944 | </p> | |
1945 | <h3 class="function"><span class="info"> CUPS 2.2.4/macOS 10.13 </span><a id="cupsGetIntegerOption">cupsGetIntegerOption</a></h3> | |
53af7f21 | 1946 | <p class="description">Get an integer option value.</p> |
798d6e29 | 1947 | <p class="code"> |
98d88c8d MS |
1948 | int cupsGetIntegerOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p> |
1949 | <h4 class="parameters">Parameters</h4> | |
1950 | <table class="list"><tbody> | |
1951 | <tr><th>name</th> | |
1952 | <td class="description">Name of option</td></tr> | |
1953 | <tr><th>num_options</th> | |
1954 | <td class="description">Number of options</td></tr> | |
1955 | <tr><th>options</th> | |
1956 | <td class="description">Options</td></tr> | |
1957 | </tbody></table> | |
798d6e29 | 1958 | <h4 class="returnvalue">Return Value</h4> |
53af7f21 | 1959 | <p class="description">Option value or <code>INT_MIN</code></p> |
798d6e29 | 1960 | <h4 class="discussion">Discussion</h4> |
53af7f21 MS |
1961 | <p class="discussion">INT_MIN is returned when the option does not exist, is not an integer, or |
1962 | exceeds the range of values for the "int" type. | |
1963 | ||
1964 | </p> | |
798d6e29 MS |
1965 | <h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsGetJobs2">cupsGetJobs2</a></h3> |
1966 | <p class="description">Get the jobs from the specified server.</p> | |
1967 | <p class="code"> | |
98d88c8d MS |
1968 | 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> |
1969 | <h4 class="parameters">Parameters</h4> | |
1970 | <table class="list"><tbody> | |
1971 | <tr><th>http</th> | |
1972 | <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> | |
1973 | <tr><th>jobs</th> | |
1974 | <td class="description">Job data</td></tr> | |
1975 | <tr><th>name</th> | |
1976 | <td class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</td></tr> | |
1977 | <tr><th>myjobs</th> | |
1978 | <td class="description">0 = all users, 1 = mine</td></tr> | |
1979 | <tr><th>whichjobs</th> | |
1980 | <td class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></td></tr> | |
1981 | </tbody></table> | |
798d6e29 MS |
1982 | <h4 class="returnvalue">Return Value</h4> |
1983 | <p class="description">Number of jobs</p> | |
1984 | <h4 class="discussion">Discussion</h4> | |
1985 | <p class="discussion">A "whichjobs" value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless | |
1986 | of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are | |
1987 | pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns | |
1988 | jobs that are stopped, canceled, aborted, or completed. | |
1989 | ||
1990 | </p> | |
1991 | <h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsGetNamedDest">cupsGetNamedDest</a></h3> | |
1992 | <p class="description">Get options for the named destination.</p> | |
1993 | <p class="code"> | |
98d88c8d MS |
1994 | <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> |
1995 | <h4 class="parameters">Parameters</h4> | |
1996 | <table class="list"><tbody> | |
1997 | <tr><th>http</th> | |
1998 | <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> | |
1999 | <tr><th>name</th> | |
2000 | <td class="description">Destination name or <code>NULL</code> for the default destination</td></tr> | |
2001 | <tr><th>instance</th> | |
2002 | <td class="description">Instance name or <code>NULL</code></td></tr> | |
2003 | </tbody></table> | |
798d6e29 MS |
2004 | <h4 class="returnvalue">Return Value</h4> |
2005 | <p class="description">Destination or <code>NULL</code></p> | |
2006 | <h4 class="discussion">Discussion</h4> | |
2007 | <p class="discussion">This function is optimized for retrieving a single destination and should | |
98d88c8d MS |
2008 | be used instead of <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> when you |
2009 | either know the name of the destination or want to print to the default | |
2010 | destination. If <code>NULL</code> is returned, the destination does not exist or | |
2011 | there is no default destination.<br> | |
798d6e29 MS |
2012 | <br> |
2013 | If "http" is <code>CUPS_HTTP_DEFAULT</code>, the connection to the default print | |
2014 | server will be used.<br> | |
2015 | <br> | |
2016 | If "name" is <code>NULL</code>, the default printer for the current user will be | |
2017 | returned.<br> | |
2018 | <br> | |
2019 | The returned destination must be freed using <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> with a | |
2020 | "num_dests" value of 1. | |
2021 | ||
2022 | </p> | |
2023 | <h3 class="function"><a id="cupsGetOption">cupsGetOption</a></h3> | |
2024 | <p class="description">Get an option value.</p> | |
2025 | <p class="code"> | |
98d88c8d MS |
2026 | const char *cupsGetOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p> |
2027 | <h4 class="parameters">Parameters</h4> | |
2028 | <table class="list"><tbody> | |
2029 | <tr><th>name</th> | |
2030 | <td class="description">Name of option</td></tr> | |
2031 | <tr><th>num_options</th> | |
2032 | <td class="description">Number of options</td></tr> | |
2033 | <tr><th>options</th> | |
2034 | <td class="description">Options</td></tr> | |
2035 | </tbody></table> | |
798d6e29 MS |
2036 | <h4 class="returnvalue">Return Value</h4> |
2037 | <p class="description">Option value or <code>NULL</code></p> | |
798d6e29 | 2038 | <h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsGetPassword2">cupsGetPassword2</a></h3> |
98d88c8d | 2039 | <p class="description">Get a password from the user using the current |
798d6e29 MS |
2040 | password callback.</p> |
2041 | <p class="code"> | |
98d88c8d MS |
2042 | const char *cupsGetPassword2(const char *prompt, <a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p> |
2043 | <h4 class="parameters">Parameters</h4> | |
2044 | <table class="list"><tbody> | |
2045 | <tr><th>prompt</th> | |
2046 | <td class="description">Prompt string</td></tr> | |
2047 | <tr><th>http</th> | |
2048 | <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> | |
2049 | <tr><th>method</th> | |
2050 | <td class="description">Request method ("GET", "POST", "PUT")</td></tr> | |
2051 | <tr><th>resource</th> | |
2052 | <td class="description">Resource path</td></tr> | |
2053 | </tbody></table> | |
798d6e29 MS |
2054 | <h4 class="returnvalue">Return Value</h4> |
2055 | <p class="description">Password</p> | |
2056 | <h4 class="discussion">Discussion</h4> | |
2057 | <p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the | |
2058 | user does not provide a password.<br> | |
2059 | <br> | |
2060 | Note: The current password callback function is tracked separately for each | |
2061 | thread in a program. Multi-threaded programs that override the setting via | |
98d88c8d MS |
2062 | the <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> function need to do so in each thread for the |
2063 | same function to be used. | |
798d6e29 | 2064 | |
798d6e29 | 2065 | </p> |
798d6e29 MS |
2066 | <h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></h3> |
2067 | <p class="description">Get the localized string for a destination media | |
2068 | size.</p> | |
2069 | <p class="code"> | |
98d88c8d MS |
2070 | 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> |
2071 | <h4 class="parameters">Parameters</h4> | |
2072 | <table class="list"><tbody> | |
2073 | <tr><th>http</th> | |
2074 | <td class="description">Connection to destination</td></tr> | |
2075 | <tr><th>dest</th> | |
2076 | <td class="description">Destination</td></tr> | |
2077 | <tr><th>dinfo</th> | |
2078 | <td class="description">Destination information</td></tr> | |
2079 | <tr><th>flags</th> | |
2080 | <td class="description">Media flags</td></tr> | |
2081 | <tr><th>size</th> | |
2082 | <td class="description">Media size</td></tr> | |
2083 | </tbody></table> | |
798d6e29 MS |
2084 | <h4 class="returnvalue">Return Value</h4> |
2085 | <p class="description">Localized string</p> | |
2086 | <h4 class="discussion">Discussion</h4> | |
2087 | <p class="discussion">The returned string is stored in the destination information and will become | |
2088 | invalid if the destination information is deleted. | |
2089 | ||
2090 | </p> | |
2091 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsLocalizeDestOption">cupsLocalizeDestOption</a></h3> | |
2092 | <p class="description">Get the localized string for a destination | |
2093 | option.</p> | |
2094 | <p class="code"> | |
98d88c8d MS |
2095 | 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> |
2096 | <h4 class="parameters">Parameters</h4> | |
2097 | <table class="list"><tbody> | |
2098 | <tr><th>http</th> | |
2099 | <td class="description">Connection to destination</td></tr> | |
2100 | <tr><th>dest</th> | |
2101 | <td class="description">Destination</td></tr> | |
2102 | <tr><th>dinfo</th> | |
2103 | <td class="description">Destination information</td></tr> | |
2104 | <tr><th>option</th> | |
2105 | <td class="description">Option to localize</td></tr> | |
2106 | </tbody></table> | |
798d6e29 MS |
2107 | <h4 class="returnvalue">Return Value</h4> |
2108 | <p class="description">Localized string</p> | |
2109 | <h4 class="discussion">Discussion</h4> | |
2110 | <p class="discussion">The returned string is stored in the destination information and will become | |
2111 | invalid if the destination information is deleted. | |
2112 | ||
2113 | </p> | |
2114 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsLocalizeDestValue">cupsLocalizeDestValue</a></h3> | |
2115 | <p class="description">Get the localized string for a destination | |
2116 | option+value pair.</p> | |
2117 | <p class="code"> | |
98d88c8d MS |
2118 | 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> |
2119 | <h4 class="parameters">Parameters</h4> | |
2120 | <table class="list"><tbody> | |
2121 | <tr><th>http</th> | |
2122 | <td class="description">Connection to destination</td></tr> | |
2123 | <tr><th>dest</th> | |
2124 | <td class="description">Destination</td></tr> | |
2125 | <tr><th>dinfo</th> | |
2126 | <td class="description">Destination information</td></tr> | |
2127 | <tr><th>option</th> | |
2128 | <td class="description">Option to localize</td></tr> | |
2129 | <tr><th>value</th> | |
2130 | <td class="description">Value to localize</td></tr> | |
2131 | </tbody></table> | |
798d6e29 MS |
2132 | <h4 class="returnvalue">Return Value</h4> |
2133 | <p class="description">Localized string</p> | |
2134 | <h4 class="discussion">Discussion</h4> | |
2135 | <p class="discussion">The returned string is stored in the destination information and will become | |
2136 | invalid if the destination information is deleted. | |
2137 | ||
2138 | </p> | |
2139 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="cupsMakeServerCredentials">cupsMakeServerCredentials</a></h3> | |
2140 | <p class="description">Make a self-signed certificate and private key pair.</p> | |
2141 | <p class="code"> | |
98d88c8d MS |
2142 | int cupsMakeServerCredentials(const char *path, const char *common_name, int num_alt_names, const char **alt_names, time_t expiration_date);</p> |
2143 | <h4 class="parameters">Parameters</h4> | |
2144 | <table class="list"><tbody> | |
2145 | <tr><th>path</th> | |
2146 | <td class="description">Keychain path or <code>NULL</code> for default</td></tr> | |
2147 | <tr><th>common_name</th> | |
2148 | <td class="description">Common name</td></tr> | |
2149 | <tr><th>num_alt_names</th> | |
2150 | <td class="description">Number of subject alternate names</td></tr> | |
2151 | <tr><th>alt_names</th> | |
2152 | <td class="description">Subject Alternate Names</td></tr> | |
2153 | <tr><th>expiration_date</th> | |
2154 | <td class="description">Expiration date</td></tr> | |
2155 | </tbody></table> | |
798d6e29 MS |
2156 | <h4 class="returnvalue">Return Value</h4> |
2157 | <p class="description">1 on success, 0 on failure</p> | |
798d6e29 MS |
2158 | <h3 class="function"><a id="cupsParseOptions">cupsParseOptions</a></h3> |
2159 | <p class="description">Parse options from a command-line argument.</p> | |
2160 | <p class="code"> | |
98d88c8d MS |
2161 | int cupsParseOptions(const char *arg, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p> |
2162 | <h4 class="parameters">Parameters</h4> | |
2163 | <table class="list"><tbody> | |
2164 | <tr><th>arg</th> | |
2165 | <td class="description">Argument to parse</td></tr> | |
2166 | <tr><th>num_options</th> | |
2167 | <td class="description">Number of options</td></tr> | |
2168 | <tr><th>options</th> | |
2169 | <td class="description">Options found</td></tr> | |
2170 | </tbody></table> | |
798d6e29 MS |
2171 | <h4 class="returnvalue">Return Value</h4> |
2172 | <p class="description">Number of options found</p> | |
2173 | <h4 class="discussion">Discussion</h4> | |
2174 | <p class="discussion">This function converts space-delimited name/value pairs according | |
2175 | to the PAPI text option ABNF specification. Collection values | |
2176 | ("name={a=... b=... c=...}") are stored with the curley brackets | |
2177 | intact - use <code>cupsParseOptions</code> on the value to extract the | |
2178 | collection attributes.</p> | |
798d6e29 MS |
2179 | <h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="cupsRemoveDest">cupsRemoveDest</a></h3> |
2180 | <p class="description">Remove a destination from the destination list.</p> | |
2181 | <p class="code"> | |
98d88c8d MS |
2182 | int cupsRemoveDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p> |
2183 | <h4 class="parameters">Parameters</h4> | |
2184 | <table class="list"><tbody> | |
2185 | <tr><th>name</th> | |
2186 | <td class="description">Destination name</td></tr> | |
2187 | <tr><th>instance</th> | |
2188 | <td class="description">Instance name or <code>NULL</code></td></tr> | |
2189 | <tr><th>num_dests</th> | |
2190 | <td class="description">Number of destinations</td></tr> | |
2191 | <tr><th>dests</th> | |
2192 | <td class="description">Destinations</td></tr> | |
2193 | </tbody></table> | |
798d6e29 MS |
2194 | <h4 class="returnvalue">Return Value</h4> |
2195 | <p class="description">New number of destinations</p> | |
2196 | <h4 class="discussion">Discussion</h4> | |
2197 | <p class="discussion">Removing a destination/instance does not delete the class or printer | |
2198 | queue, merely the lpoptions for that destination/instance. Use the | |
2199 | <a href="#cupsSetDests"><code>cupsSetDests</code></a> or <a href="#cupsSetDests2"><code>cupsSetDests2</code></a> functions to save the new | |
2200 | options for the user. | |
2201 | ||
2202 | </p> | |
2203 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsRemoveOption">cupsRemoveOption</a></h3> | |
2204 | <p class="description">Remove an option from an option array.</p> | |
2205 | <p class="code"> | |
98d88c8d MS |
2206 | int cupsRemoveOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p> |
2207 | <h4 class="parameters">Parameters</h4> | |
2208 | <table class="list"><tbody> | |
2209 | <tr><th>name</th> | |
2210 | <td class="description">Option name</td></tr> | |
2211 | <tr><th>num_options</th> | |
2212 | <td class="description">Current number of options</td></tr> | |
2213 | <tr><th>options</th> | |
2214 | <td class="description">Options</td></tr> | |
2215 | </tbody></table> | |
798d6e29 MS |
2216 | <h4 class="returnvalue">Return Value</h4> |
2217 | <p class="description">New number of options</p> | |
2218 | <h3 class="function"><a id="cupsServer">cupsServer</a></h3> | |
2219 | <p class="description">Return the hostname/address of the current server.</p> | |
2220 | <p class="code"> | |
98d88c8d | 2221 | const char *cupsServer(void);</p> |
798d6e29 MS |
2222 | <h4 class="returnvalue">Return Value</h4> |
2223 | <p class="description">Server name</p> | |
2224 | <h4 class="discussion">Discussion</h4> | |
2225 | <p class="discussion">The default server comes from the CUPS_SERVER environment variable, then the | |
2226 | ~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not | |
2227 | set, the default is the local system - either "localhost" or a domain socket | |
2228 | path.<br> | |
2229 | <br> | |
2230 | The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6 | |
2231 | address, or a domain socket pathname.<br> | |
2232 | <br> | |
2233 | Note: The current server is tracked separately for each thread in a program. | |
2234 | Multi-threaded programs that override the server via the | |
2235 | <a href="#cupsSetServer"><code>cupsSetServer</code></a> function need to do so in each thread for the same | |
2236 | server to be used.</p> | |
98d88c8d MS |
2237 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="cupsSetClientCertCB">cupsSetClientCertCB</a></h3> |
2238 | <p class="description">Set the client certificate callback.</p> | |
798d6e29 | 2239 | <p class="code"> |
98d88c8d | 2240 | void cupsSetClientCertCB(<a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a> cb, void *user_data);</p> |
798d6e29 | 2241 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2242 | <table class="list"><tbody> |
2243 | <tr><th>cb</th> | |
2244 | <td class="description">Callback function</td></tr> | |
2245 | <tr><th>user_data</th> | |
2246 | <td class="description">User data pointer</td></tr> | |
2247 | </tbody></table> | |
2248 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
2249 | <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br> |
2250 | <br> | |
2251 | Note: The current certificate callback is tracked separately for each thread | |
2252 | in a program. Multi-threaded programs that override the callback need to do | |
2253 | so in each thread for the same callback to be used. | |
2254 | ||
2255 | </p> | |
2256 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="cupsSetCredentials">cupsSetCredentials</a></h3> | |
2257 | <p class="description">Set the default credentials to be used for SSL/TLS | |
2258 | connections.</p> | |
2259 | <p class="code"> | |
98d88c8d | 2260 | int cupsSetCredentials(cups_array_t *credentials);</p> |
798d6e29 | 2261 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2262 | <table class="list"><tbody> |
2263 | <tr><th>credentials</th> | |
2264 | <td class="description">Array of credentials</td></tr> | |
2265 | </tbody></table> | |
798d6e29 MS |
2266 | <h4 class="returnvalue">Return Value</h4> |
2267 | <p class="description">Status of call (0 = success)</p> | |
2268 | <h4 class="discussion">Discussion</h4> | |
2269 | <p class="discussion">Note: The default credentials are tracked separately for each thread in a | |
2270 | program. Multi-threaded programs that override the setting need to do so in | |
2271 | each thread for the same setting to be used. | |
2272 | ||
2273 | </p> | |
98d88c8d | 2274 | <h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="cupsSetDefaultDest">cupsSetDefaultDest</a></h3> |
53af7f21 | 2275 | <p class="description">Set the default destination.</p> |
98d88c8d MS |
2276 | <p class="code"> |
2277 | void cupsSetDefaultDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p> | |
2278 | <h4 class="parameters">Parameters</h4> | |
2279 | <table class="list"><tbody> | |
2280 | <tr><th>name</th> | |
2281 | <td class="description">Destination name</td></tr> | |
2282 | <tr><th>instance</th> | |
2283 | <td class="description">Instance name or <code>NULL</code></td></tr> | |
2284 | <tr><th>num_dests</th> | |
2285 | <td class="description">Number of destinations</td></tr> | |
2286 | <tr><th>dests</th> | |
2287 | <td class="description">Destinations</td></tr> | |
2288 | </tbody></table> | |
798d6e29 MS |
2289 | <h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsSetDests2">cupsSetDests2</a></h3> |
2290 | <p class="description">Save the list of destinations for the specified server.</p> | |
2291 | <p class="code"> | |
98d88c8d MS |
2292 | int cupsSetDests2(<a href="#http_t">http_t</a> *http, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p> |
2293 | <h4 class="parameters">Parameters</h4> | |
2294 | <table class="list"><tbody> | |
2295 | <tr><th>http</th> | |
2296 | <td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> | |
2297 | <tr><th>num_dests</th> | |
2298 | <td class="description">Number of destinations</td></tr> | |
2299 | <tr><th>dests</th> | |
2300 | <td class="description">Destinations</td></tr> | |
2301 | </tbody></table> | |
798d6e29 MS |
2302 | <h4 class="returnvalue">Return Value</h4> |
2303 | <p class="description">0 on success, -1 on error</p> | |
2304 | <h4 class="discussion">Discussion</h4> | |
2305 | <p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run | |
2306 | as root and ~/.cups/lpoptions when run as a normal user. | |
2307 | ||
2308 | </p> | |
2309 | <h3 class="function"><a id="cupsSetEncryption">cupsSetEncryption</a></h3> | |
98d88c8d | 2310 | <p class="description">Set the encryption preference.</p> |
798d6e29 | 2311 | <p class="code"> |
98d88c8d | 2312 | void cupsSetEncryption(<a href="#http_encryption_t">http_encryption_t</a> e);</p> |
798d6e29 | 2313 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2314 | <table class="list"><tbody> |
2315 | <tr><th>e</th> | |
2316 | <td class="description">New encryption preference</td></tr> | |
2317 | </tbody></table> | |
2318 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
2319 | <p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION |
2320 | environment variable, then the ~/.cups/client.conf file, and finally the | |
2321 | /etc/cups/client.conf file. If not set, the default is | |
2322 | <code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br> | |
2323 | <br> | |
2324 | Note: The current encryption setting is tracked separately for each thread | |
2325 | in a program. Multi-threaded programs that override the setting need to do | |
2326 | so in each thread for the same setting to be used.</p> | |
98d88c8d MS |
2327 | <h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsSetPasswordCB2">cupsSetPasswordCB2</a></h3> |
2328 | <p class="description">Set the advanced password callback for CUPS.</p> | |
798d6e29 | 2329 | <p class="code"> |
98d88c8d | 2330 | void cupsSetPasswordCB2(<a href="#cups_password_cb2_t">cups_password_cb2_t</a> cb, void *user_data);</p> |
798d6e29 | 2331 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2332 | <table class="list"><tbody> |
2333 | <tr><th>cb</th> | |
2334 | <td class="description">Callback function</td></tr> | |
2335 | <tr><th>user_data</th> | |
2336 | <td class="description">User data pointer</td></tr> | |
2337 | </tbody></table> | |
2338 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
2339 | <p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which |
2340 | reads the password from the console. Programs should call either this | |
2341 | function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered | |
2342 | by a program per thread.<br> | |
2343 | <br> | |
2344 | Note: The current password callback is tracked separately for each thread | |
2345 | in a program. Multi-threaded programs that override the callback need to do | |
2346 | so in each thread for the same callback to be used. | |
2347 | ||
2348 | </p> | |
2349 | <h3 class="function"><a id="cupsSetServer">cupsSetServer</a></h3> | |
98d88c8d | 2350 | <p class="description">Set the default server name and port.</p> |
798d6e29 | 2351 | <p class="code"> |
98d88c8d | 2352 | void cupsSetServer(const char *server);</p> |
798d6e29 | 2353 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2354 | <table class="list"><tbody> |
2355 | <tr><th>server</th> | |
2356 | <td class="description">Server name</td></tr> | |
2357 | </tbody></table> | |
2358 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
2359 | <p class="discussion">The "server" string can be a fully-qualified hostname, a numeric |
2360 | IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP | |
2361 | addresses can be optionally followed by a colon and port number to override | |
2362 | the default port 631, e.g. "hostname:8631". Pass <code>NULL</code> to restore the | |
2363 | default server name and port.<br> | |
2364 | <br> | |
2365 | Note: The current server is tracked separately for each thread in a program. | |
2366 | Multi-threaded programs that override the server need to do so in each | |
2367 | thread for the same server to be used.</p> | |
98d88c8d MS |
2368 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="cupsSetServerCertCB">cupsSetServerCertCB</a></h3> |
2369 | <p class="description">Set the server certificate callback.</p> | |
798d6e29 | 2370 | <p class="code"> |
98d88c8d | 2371 | void cupsSetServerCertCB(<a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a> cb, void *user_data);</p> |
798d6e29 | 2372 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2373 | <table class="list"><tbody> |
2374 | <tr><th>cb</th> | |
2375 | <td class="description">Callback function</td></tr> | |
2376 | <tr><th>user_data</th> | |
2377 | <td class="description">User data pointer</td></tr> | |
2378 | </tbody></table> | |
2379 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
2380 | <p class="discussion">Pass <code>NULL</code> to restore the default callback.<br> |
2381 | <br> | |
2382 | Note: The current credentials callback is tracked separately for each thread | |
2383 | in a program. Multi-threaded programs that override the callback need to do | |
2384 | so in each thread for the same callback to be used. | |
2385 | ||
2386 | </p> | |
2387 | <h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="cupsSetServerCredentials">cupsSetServerCredentials</a></h3> | |
2388 | <p class="description">Set the default server credentials.</p> | |
2389 | <p class="code"> | |
98d88c8d MS |
2390 | int cupsSetServerCredentials(const char *path, const char *common_name, int auto_create);</p> |
2391 | <h4 class="parameters">Parameters</h4> | |
2392 | <table class="list"><tbody> | |
2393 | <tr><th>path</th> | |
2394 | <td class="description">Keychain path or <code>NULL</code> for default</td></tr> | |
2395 | <tr><th>common_name</th> | |
2396 | <td class="description">Default common name for server</td></tr> | |
2397 | <tr><th>auto_create</th> | |
2398 | <td class="description">1 = automatically create self-signed certificates</td></tr> | |
2399 | </tbody></table> | |
798d6e29 MS |
2400 | <h4 class="returnvalue">Return Value</h4> |
2401 | <p class="description">1 on success, 0 on failure</p> | |
2402 | <h4 class="discussion">Discussion</h4> | |
2403 | <p class="discussion">Note: The server credentials are used by all threads in the running process. | |
2404 | This function is threadsafe. | |
2405 | ||
2406 | </p> | |
2407 | <h3 class="function"><a id="cupsSetUser">cupsSetUser</a></h3> | |
98d88c8d | 2408 | <p class="description">Set the default user name.</p> |
798d6e29 | 2409 | <p class="code"> |
98d88c8d | 2410 | void cupsSetUser(const char *user);</p> |
798d6e29 | 2411 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2412 | <table class="list"><tbody> |
2413 | <tr><th>user</th> | |
2414 | <td class="description">User name</td></tr> | |
2415 | </tbody></table> | |
2416 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
2417 | <p class="discussion">Pass <code>NULL</code> to restore the default user name.<br> |
2418 | <br> | |
2419 | Note: The current user name is tracked separately for each thread in a | |
2420 | program. Multi-threaded programs that override the user name need to do so | |
2421 | in each thread for the same user name to be used.</p> | |
98d88c8d MS |
2422 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsSetUserAgent">cupsSetUserAgent</a></h3> |
2423 | <p class="description">Set the default HTTP User-Agent string.</p> | |
798d6e29 | 2424 | <p class="code"> |
98d88c8d | 2425 | void cupsSetUserAgent(const char *user_agent);</p> |
798d6e29 | 2426 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2427 | <table class="list"><tbody> |
2428 | <tr><th>user_agent</th> | |
2429 | <td class="description">User-Agent string or <code>NULL</code></td></tr> | |
2430 | </tbody></table> | |
2431 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
2432 | <p class="discussion">Setting the string to NULL forces the default value containing the CUPS |
2433 | version, IPP version, and operating system version and architecture. | |
2434 | ||
2435 | </p> | |
2436 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsStartDestDocument">cupsStartDestDocument</a></h3> | |
2437 | <p class="description">Start a new document.</p> | |
2438 | <p class="code"> | |
98d88c8d MS |
2439 | 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> |
2440 | <h4 class="parameters">Parameters</h4> | |
2441 | <table class="list"><tbody> | |
2442 | <tr><th>http</th> | |
2443 | <td class="description">Connection to destination</td></tr> | |
2444 | <tr><th>dest</th> | |
2445 | <td class="description">Destination</td></tr> | |
2446 | <tr><th>info</th> | |
2447 | <td class="description">Destination information</td></tr> | |
2448 | <tr><th>job_id</th> | |
2449 | <td class="description">Job ID</td></tr> | |
2450 | <tr><th>docname</th> | |
2451 | <td class="description">Document name</td></tr> | |
2452 | <tr><th>format</th> | |
2453 | <td class="description">Document format</td></tr> | |
2454 | <tr><th>num_options</th> | |
2455 | <td class="description">Number of document options</td></tr> | |
2456 | <tr><th>options</th> | |
2457 | <td class="description">Document options</td></tr> | |
2458 | <tr><th>last_document</th> | |
2459 | <td class="description">1 if this is the last document</td></tr> | |
2460 | </tbody></table> | |
798d6e29 MS |
2461 | <h4 class="returnvalue">Return Value</h4> |
2462 | <p class="description">Status of document creation</p> | |
2463 | <h4 class="discussion">Discussion</h4> | |
2464 | <p class="discussion">"job_id" is the job ID returned by cupsCreateDestJob. "docname" is the name | |
2465 | of the document/file being printed, "format" is the MIME media type for the | |
2466 | document (see CUPS_FORMAT_xxx constants), and "num_options" and "options" | |
2467 | are the options do be applied to the document. "last_document" should be 1 | |
2468 | if this is the last document to be submitted in the job. Returns | |
2469 | <code>HTTP_CONTINUE</code> on success. | |
2470 | ||
798d6e29 MS |
2471 | </p> |
2472 | <h3 class="function"><a id="cupsUser">cupsUser</a></h3> | |
2473 | <p class="description">Return the current user's name.</p> | |
2474 | <p class="code"> | |
98d88c8d | 2475 | const char *cupsUser(void);</p> |
798d6e29 MS |
2476 | <h4 class="returnvalue">Return Value</h4> |
2477 | <p class="description">User name</p> | |
2478 | <h4 class="discussion">Discussion</h4> | |
2479 | <p class="discussion">Note: The current user name is tracked separately for each thread in a | |
2480 | program. Multi-threaded programs that override the user name with the | |
2481 | <a href="#cupsSetUser"><code>cupsSetUser</code></a> function need to do so in each thread for the same user | |
2482 | name to be used.</p> | |
2483 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsUserAgent">cupsUserAgent</a></h3> | |
2484 | <p class="description">Return the default HTTP User-Agent string.</p> | |
2485 | <p class="code"> | |
98d88c8d | 2486 | const char *cupsUserAgent(void);</p> |
798d6e29 MS |
2487 | <h4 class="returnvalue">Return Value</h4> |
2488 | <p class="description">User-Agent string</p> | |
2489 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAcceptConnection">httpAcceptConnection</a></h3> | |
2490 | <p class="description">Accept a new HTTP client connection from the | |
2491 | specified listening socket.</p> | |
2492 | <p class="code"> | |
98d88c8d | 2493 | <a href="#http_t">http_t</a> *httpAcceptConnection(int fd, int blocking);</p> |
798d6e29 | 2494 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2495 | <table class="list"><tbody> |
2496 | <tr><th>fd</th> | |
2497 | <td class="description">Listen socket file descriptor</td></tr> | |
2498 | <tr><th>blocking</th> | |
2499 | <td class="description">1 if the connection should be | |
2500 | blocking, 0 otherwise</td></tr> | |
2501 | </tbody></table> | |
798d6e29 MS |
2502 | <h4 class="returnvalue">Return Value</h4> |
2503 | <p class="description">HTTP connection or <code>NULL</code></p> | |
2504 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="httpAddCredential">httpAddCredential</a></h3> | |
2505 | <p class="description">Allocates and adds a single credential to an array.</p> | |
2506 | <p class="code"> | |
98d88c8d MS |
2507 | int httpAddCredential(cups_array_t *credentials, const void *data, size_t datalen);</p> |
2508 | <h4 class="parameters">Parameters</h4> | |
2509 | <table class="list"><tbody> | |
2510 | <tr><th>credentials</th> | |
2511 | <td class="description">Credentials array</td></tr> | |
2512 | <tr><th>data</th> | |
2513 | <td class="description">PEM-encoded X.509 data</td></tr> | |
2514 | <tr><th>datalen</th> | |
2515 | <td class="description">Length of data</td></tr> | |
2516 | </tbody></table> | |
798d6e29 MS |
2517 | <h4 class="returnvalue">Return Value</h4> |
2518 | <p class="description">0 on success, -1 on error</p> | |
2519 | <h4 class="discussion">Discussion</h4> | |
2520 | <p class="discussion">Use <code>cupsArrayNew(NULL, NULL)</code> to create a credentials array. | |
2521 | ||
2522 | </p> | |
2523 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrAny">httpAddrAny</a></h3> | |
2524 | <p class="description">Check for the "any" address.</p> | |
2525 | <p class="code"> | |
98d88c8d | 2526 | int httpAddrAny(const <a href="#http_addr_t">http_addr_t</a> *addr);</p> |
798d6e29 | 2527 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2528 | <table class="list"><tbody> |
2529 | <tr><th>addr</th> | |
2530 | <td class="description">Address to check</td></tr> | |
2531 | </tbody></table> | |
798d6e29 MS |
2532 | <h4 class="returnvalue">Return Value</h4> |
2533 | <p class="description">1 if "any", 0 otherwise</p> | |
2534 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpAddrClose">httpAddrClose</a></h3> | |
2535 | <p class="description">Close a socket created by <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> or | |
2536 | <a href="#httpAddrListen"><code>httpAddrListen</code></a>.</p> | |
2537 | <p class="code"> | |
98d88c8d | 2538 | int httpAddrClose(<a href="#http_addr_t">http_addr_t</a> *addr, int fd);</p> |
798d6e29 | 2539 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2540 | <table class="list"><tbody> |
2541 | <tr><th>addr</th> | |
2542 | <td class="description">Listen address or <code>NULL</code></td></tr> | |
2543 | <tr><th>fd</th> | |
2544 | <td class="description">Socket file descriptor</td></tr> | |
2545 | </tbody></table> | |
798d6e29 MS |
2546 | <h4 class="returnvalue">Return Value</h4> |
2547 | <p class="description">0 on success, -1 on failure</p> | |
2548 | <h4 class="discussion">Discussion</h4> | |
98d88c8d MS |
2549 | <p class="discussion">Pass <code>NULL</code> for sockets created with <a href="#httpAddrConnect2"><code>httpAddrConnect2</code></a> and the |
2550 | listen address for sockets created with <a href="#httpAddrListen"><code>httpAddrListen</code></a>. This function | |
2551 | ensures that domain sockets are removed when closed. | |
798d6e29 MS |
2552 | |
2553 | </p> | |
798d6e29 MS |
2554 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAddrConnect2">httpAddrConnect2</a></h3> |
2555 | <p class="description">Connect to any of the addresses in the list with a | |
2556 | timeout and optional cancel.</p> | |
2557 | <p class="code"> | |
98d88c8d MS |
2558 | <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> |
2559 | <h4 class="parameters">Parameters</h4> | |
2560 | <table class="list"><tbody> | |
2561 | <tr><th>addrlist</th> | |
2562 | <td class="description">List of potential addresses</td></tr> | |
2563 | <tr><th>sock</th> | |
2564 | <td class="description">Socket</td></tr> | |
2565 | <tr><th>msec</th> | |
2566 | <td class="description">Timeout in milliseconds</td></tr> | |
2567 | <tr><th>cancel</th> | |
2568 | <td class="description">Pointer to "cancel" variable</td></tr> | |
2569 | </tbody></table> | |
798d6e29 MS |
2570 | <h4 class="returnvalue">Return Value</h4> |
2571 | <p class="description">Connected address or NULL on failure</p> | |
2572 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAddrCopyList">httpAddrCopyList</a></h3> | |
2573 | <p class="description">Copy an address list.</p> | |
2574 | <p class="code"> | |
98d88c8d | 2575 | <a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrCopyList(<a href="#http_addrlist_t">http_addrlist_t</a> *src);</p> |
798d6e29 | 2576 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2577 | <table class="list"><tbody> |
2578 | <tr><th>src</th> | |
2579 | <td class="description">Source address list</td></tr> | |
2580 | </tbody></table> | |
798d6e29 MS |
2581 | <h4 class="returnvalue">Return Value</h4> |
2582 | <p class="description">New address list or <code>NULL</code> on error</p> | |
2583 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrEqual">httpAddrEqual</a></h3> | |
2584 | <p class="description">Compare two addresses.</p> | |
2585 | <p class="code"> | |
98d88c8d | 2586 | 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 | 2587 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2588 | <table class="list"><tbody> |
2589 | <tr><th>addr1</th> | |
2590 | <td class="description">First address</td></tr> | |
2591 | <tr><th>addr2</th> | |
2592 | <td class="description">Second address</td></tr> | |
2593 | </tbody></table> | |
798d6e29 MS |
2594 | <h4 class="returnvalue">Return Value</h4> |
2595 | <p class="description">1 if equal, 0 if not</p> | |
2596 | <h3 class="function"><a id="httpAddrFamily">httpAddrFamily</a></h3> | |
2597 | <p class="description">Get the address family of an address.</p> | |
2598 | <p class="code"> | |
98d88c8d | 2599 | int httpAddrFamily(<a href="#http_addr_t">http_addr_t</a> *addr);</p> |
798d6e29 | 2600 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2601 | <table class="list"><tbody> |
2602 | <tr><th>addr</th> | |
2603 | <td class="description">Address</td></tr> | |
2604 | </tbody></table> | |
798d6e29 MS |
2605 | <h4 class="returnvalue">Return Value</h4> |
2606 | <p class="description">Address family</p> | |
98d88c8d MS |
2607 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrFreeList">httpAddrFreeList</a></h3> |
2608 | <p class="description">Free an address list.</p> | |
798d6e29 | 2609 | <p class="code"> |
98d88c8d | 2610 | void httpAddrFreeList(<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist);</p> |
798d6e29 | 2611 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2612 | <table class="list"><tbody> |
2613 | <tr><th>addrlist</th> | |
2614 | <td class="description">Address list to free</td></tr> | |
2615 | </tbody></table> | |
798d6e29 MS |
2616 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrGetList">httpAddrGetList</a></h3> |
2617 | <p class="description">Get a list of addresses for a hostname.</p> | |
2618 | <p class="code"> | |
98d88c8d MS |
2619 | <a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrGetList(const char *hostname, int family, const char *service);</p> |
2620 | <h4 class="parameters">Parameters</h4> | |
2621 | <table class="list"><tbody> | |
2622 | <tr><th>hostname</th> | |
2623 | <td class="description">Hostname, IP address, or NULL for passive listen address</td></tr> | |
2624 | <tr><th>family</th> | |
2625 | <td class="description">Address family or AF_UNSPEC</td></tr> | |
2626 | <tr><th>service</th> | |
2627 | <td class="description">Service name or port number</td></tr> | |
2628 | </tbody></table> | |
798d6e29 MS |
2629 | <h4 class="returnvalue">Return Value</h4> |
2630 | <p class="description">List of addresses or NULL</p> | |
2631 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrLength">httpAddrLength</a></h3> | |
2632 | <p class="description">Return the length of the address in bytes.</p> | |
2633 | <p class="code"> | |
98d88c8d | 2634 | int httpAddrLength(const <a href="#http_addr_t">http_addr_t</a> *addr);</p> |
798d6e29 | 2635 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2636 | <table class="list"><tbody> |
2637 | <tr><th>addr</th> | |
2638 | <td class="description">Address</td></tr> | |
2639 | </tbody></table> | |
798d6e29 MS |
2640 | <h4 class="returnvalue">Return Value</h4> |
2641 | <p class="description">Length in bytes</p> | |
2642 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAddrListen">httpAddrListen</a></h3> | |
2643 | <p class="description">Create a listening socket bound to the specified | |
2644 | address and port.</p> | |
2645 | <p class="code"> | |
98d88c8d | 2646 | int httpAddrListen(<a href="#http_addr_t">http_addr_t</a> *addr, int port);</p> |
798d6e29 | 2647 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2648 | <table class="list"><tbody> |
2649 | <tr><th>addr</th> | |
2650 | <td class="description">Address to bind to</td></tr> | |
2651 | <tr><th>port</th> | |
2652 | <td class="description">Port number to bind to</td></tr> | |
2653 | </tbody></table> | |
798d6e29 MS |
2654 | <h4 class="returnvalue">Return Value</h4> |
2655 | <p class="description">Socket or -1 on error</p> | |
2656 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrLocalhost">httpAddrLocalhost</a></h3> | |
2657 | <p class="description">Check for the local loopback address.</p> | |
2658 | <p class="code"> | |
98d88c8d | 2659 | int httpAddrLocalhost(const <a href="#http_addr_t">http_addr_t</a> *addr);</p> |
798d6e29 | 2660 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2661 | <table class="list"><tbody> |
2662 | <tr><th>addr</th> | |
2663 | <td class="description">Address to check</td></tr> | |
2664 | </tbody></table> | |
798d6e29 MS |
2665 | <h4 class="returnvalue">Return Value</h4> |
2666 | <p class="description">1 if local host, 0 otherwise</p> | |
2667 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrLookup">httpAddrLookup</a></h3> | |
2668 | <p class="description">Lookup the hostname associated with the address.</p> | |
2669 | <p class="code"> | |
98d88c8d MS |
2670 | char *httpAddrLookup(const <a href="#http_addr_t">http_addr_t</a> *addr, char *name, int namelen);</p> |
2671 | <h4 class="parameters">Parameters</h4> | |
2672 | <table class="list"><tbody> | |
2673 | <tr><th>addr</th> | |
2674 | <td class="description">Address to lookup</td></tr> | |
2675 | <tr><th>name</th> | |
2676 | <td class="description">Host name buffer</td></tr> | |
2677 | <tr><th>namelen</th> | |
2678 | <td class="description">Size of name buffer</td></tr> | |
2679 | </tbody></table> | |
798d6e29 MS |
2680 | <h4 class="returnvalue">Return Value</h4> |
2681 | <p class="description">Host name</p> | |
2682 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAddrPort">httpAddrPort</a></h3> | |
2683 | <p class="description">Get the port number associated with an address.</p> | |
2684 | <p class="code"> | |
98d88c8d | 2685 | int httpAddrPort(<a href="#http_addr_t">http_addr_t</a> *addr);</p> |
798d6e29 | 2686 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2687 | <table class="list"><tbody> |
2688 | <tr><th>addr</th> | |
2689 | <td class="description">Address</td></tr> | |
2690 | </tbody></table> | |
798d6e29 MS |
2691 | <h4 class="returnvalue">Return Value</h4> |
2692 | <p class="description">Port number</p> | |
2693 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrString">httpAddrString</a></h3> | |
2694 | <p class="description">Convert an address to a numeric string.</p> | |
2695 | <p class="code"> | |
98d88c8d MS |
2696 | char *httpAddrString(const <a href="#http_addr_t">http_addr_t</a> *addr, char *s, int slen);</p> |
2697 | <h4 class="parameters">Parameters</h4> | |
2698 | <table class="list"><tbody> | |
2699 | <tr><th>addr</th> | |
2700 | <td class="description">Address to convert</td></tr> | |
2701 | <tr><th>s</th> | |
2702 | <td class="description">String buffer</td></tr> | |
2703 | <tr><th>slen</th> | |
2704 | <td class="description">Length of string</td></tr> | |
2705 | </tbody></table> | |
798d6e29 MS |
2706 | <h4 class="returnvalue">Return Value</h4> |
2707 | <p class="description">Numeric address string</p> | |
2708 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAssembleURI">httpAssembleURI</a></h3> | |
2709 | <p class="description">Assemble a uniform resource identifier from its | |
2710 | components.</p> | |
2711 | <p class="code"> | |
98d88c8d MS |
2712 | <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> |
2713 | <h4 class="parameters">Parameters</h4> | |
2714 | <table class="list"><tbody> | |
2715 | <tr><th>encoding</th> | |
2716 | <td class="description">Encoding flags</td></tr> | |
2717 | <tr><th>uri</th> | |
2718 | <td class="description">URI buffer</td></tr> | |
2719 | <tr><th>urilen</th> | |
2720 | <td class="description">Size of URI buffer</td></tr> | |
2721 | <tr><th>scheme</th> | |
2722 | <td class="description">Scheme name</td></tr> | |
2723 | <tr><th>username</th> | |
2724 | <td class="description">Username</td></tr> | |
2725 | <tr><th>host</th> | |
2726 | <td class="description">Hostname or address</td></tr> | |
2727 | <tr><th>port</th> | |
2728 | <td class="description">Port number</td></tr> | |
2729 | <tr><th>resource</th> | |
2730 | <td class="description">Resource</td></tr> | |
2731 | </tbody></table> | |
798d6e29 MS |
2732 | <h4 class="returnvalue">Return Value</h4> |
2733 | <p class="description">URI status</p> | |
2734 | <h4 class="discussion">Discussion</h4> | |
2735 | <p class="discussion">This function escapes reserved characters in the URI depending on the | |
2736 | value of the "encoding" argument. You should use this function in | |
2737 | place of traditional string functions whenever you need to create a | |
2738 | URI string. | |
2739 | ||
2740 | </p> | |
2741 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAssembleURIf">httpAssembleURIf</a></h3> | |
2742 | <p class="description">Assemble a uniform resource identifier from its | |
2743 | components with a formatted resource.</p> | |
2744 | <p class="code"> | |
98d88c8d MS |
2745 | <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> |
2746 | <h4 class="parameters">Parameters</h4> | |
2747 | <table class="list"><tbody> | |
2748 | <tr><th>encoding</th> | |
2749 | <td class="description">Encoding flags</td></tr> | |
2750 | <tr><th>uri</th> | |
2751 | <td class="description">URI buffer</td></tr> | |
2752 | <tr><th>urilen</th> | |
2753 | <td class="description">Size of URI buffer</td></tr> | |
2754 | <tr><th>scheme</th> | |
2755 | <td class="description">Scheme name</td></tr> | |
2756 | <tr><th>username</th> | |
2757 | <td class="description">Username</td></tr> | |
2758 | <tr><th>host</th> | |
2759 | <td class="description">Hostname or address</td></tr> | |
2760 | <tr><th>port</th> | |
2761 | <td class="description">Port number</td></tr> | |
2762 | <tr><th>resourcef</th> | |
2763 | <td class="description">Printf-style resource</td></tr> | |
2764 | <tr><th>...</th> | |
2765 | <td class="description">Additional arguments as needed</td></tr> | |
2766 | </tbody></table> | |
798d6e29 MS |
2767 | <h4 class="returnvalue">Return Value</h4> |
2768 | <p class="description">URI status</p> | |
2769 | <h4 class="discussion">Discussion</h4> | |
2770 | <p class="discussion">This function creates a formatted version of the resource string | |
2771 | argument "resourcef" and escapes reserved characters in the URI | |
2772 | depending on the value of the "encoding" argument. You should use | |
2773 | this function in place of traditional string functions whenever | |
2774 | you need to create a URI string. | |
2775 | ||
2776 | </p> | |
2777 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAssembleUUID">httpAssembleUUID</a></h3> | |
2778 | <p class="description">Assemble a name-based UUID URN conforming to RFC 4122.</p> | |
2779 | <p class="code"> | |
98d88c8d MS |
2780 | char *httpAssembleUUID(const char *server, int port, const char *name, int number, char *buffer, size_t bufsize);</p> |
2781 | <h4 class="parameters">Parameters</h4> | |
2782 | <table class="list"><tbody> | |
2783 | <tr><th>server</th> | |
2784 | <td class="description">Server name</td></tr> | |
2785 | <tr><th>port</th> | |
2786 | <td class="description">Port number</td></tr> | |
2787 | <tr><th>name</th> | |
2788 | <td class="description">Object name or NULL</td></tr> | |
2789 | <tr><th>number</th> | |
2790 | <td class="description">Object number or 0</td></tr> | |
2791 | <tr><th>buffer</th> | |
2792 | <td class="description">String buffer</td></tr> | |
2793 | <tr><th>bufsize</th> | |
2794 | <td class="description">Size of buffer</td></tr> | |
2795 | </tbody></table> | |
798d6e29 MS |
2796 | <h4 class="returnvalue">Return Value</h4> |
2797 | <p class="description">UUID string</p> | |
2798 | <h4 class="discussion">Discussion</h4> | |
2799 | <p class="discussion">This function creates a unique 128-bit identifying number using the server | |
2800 | name, port number, random data, and optionally an object name and/or object | |
2801 | number. The result is formatted as a UUID URN as defined in RFC 4122.<br> | |
2802 | <br> | |
2803 | The buffer needs to be at least 46 bytes in size. | |
2804 | ||
2805 | </p> | |
2806 | <h3 class="function"><a id="httpBlocking">httpBlocking</a></h3> | |
98d88c8d | 2807 | <p class="description">Set blocking/non-blocking behavior on a connection.</p> |
798d6e29 | 2808 | <p class="code"> |
98d88c8d | 2809 | void httpBlocking(<a href="#http_t">http_t</a> *http, int b);</p> |
798d6e29 | 2810 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2811 | <table class="list"><tbody> |
2812 | <tr><th>http</th> | |
2813 | <td class="description">HTTP connection</td></tr> | |
2814 | <tr><th>b</th> | |
2815 | <td class="description">1 = blocking, 0 = non-blocking</td></tr> | |
2816 | </tbody></table> | |
798d6e29 MS |
2817 | <h3 class="function"><a id="httpCheck">httpCheck</a></h3> |
2818 | <p class="description">Check to see if there is a pending response from the server.</p> | |
2819 | <p class="code"> | |
98d88c8d | 2820 | int httpCheck(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 2821 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2822 | <table class="list"><tbody> |
2823 | <tr><th>http</th> | |
2824 | <td class="description">HTTP connection</td></tr> | |
2825 | </tbody></table> | |
798d6e29 MS |
2826 | <h4 class="returnvalue">Return Value</h4> |
2827 | <p class="description">0 = no data, 1 = data available</p> | |
98d88c8d MS |
2828 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="httpClearCookie">httpClearCookie</a></h3> |
2829 | <p class="description">Clear the cookie value(s).</p> | |
798d6e29 | 2830 | <p class="code"> |
98d88c8d | 2831 | void httpClearCookie(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 2832 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2833 | <table class="list"><tbody> |
2834 | <tr><th>http</th> | |
2835 | <td class="description">HTTP connection</td></tr> | |
2836 | </tbody></table> | |
798d6e29 | 2837 | <h3 class="function"><a id="httpClearFields">httpClearFields</a></h3> |
98d88c8d | 2838 | <p class="description">Clear HTTP request fields.</p> |
798d6e29 | 2839 | <p class="code"> |
98d88c8d | 2840 | void httpClearFields(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 2841 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2842 | <table class="list"><tbody> |
2843 | <tr><th>http</th> | |
2844 | <td class="description">HTTP connection</td></tr> | |
2845 | </tbody></table> | |
798d6e29 | 2846 | <h3 class="function"><a id="httpClose">httpClose</a></h3> |
98d88c8d | 2847 | <p class="description">Close an HTTP connection.</p> |
798d6e29 | 2848 | <p class="code"> |
98d88c8d | 2849 | void httpClose(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 2850 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2851 | <table class="list"><tbody> |
2852 | <tr><th>http</th> | |
2853 | <td class="description">HTTP connection</td></tr> | |
2854 | </tbody></table> | |
798d6e29 MS |
2855 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpCompareCredentials">httpCompareCredentials</a></h3> |
2856 | <p class="description">Compare two sets of X.509 credentials.</p> | |
2857 | <p class="code"> | |
98d88c8d | 2858 | int httpCompareCredentials(cups_array_t *cred1, cups_array_t *cred2);</p> |
798d6e29 | 2859 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2860 | <table class="list"><tbody> |
2861 | <tr><th>cred1</th> | |
2862 | <td class="description">First set of X.509 credentials</td></tr> | |
2863 | <tr><th>cred2</th> | |
2864 | <td class="description">Second set of X.509 credentials</td></tr> | |
2865 | </tbody></table> | |
53af7f21 MS |
2866 | <h4 class="returnvalue">Return Value</h4> |
2867 | <p class="description">1 if they match, 0 if they do not</p> | |
798d6e29 MS |
2868 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpConnect2">httpConnect2</a></h3> |
2869 | <p class="description">Connect to a HTTP server.</p> | |
2870 | <p class="code"> | |
98d88c8d MS |
2871 | <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> |
2872 | <h4 class="parameters">Parameters</h4> | |
2873 | <table class="list"><tbody> | |
2874 | <tr><th>host</th> | |
2875 | <td class="description">Host to connect to</td></tr> | |
2876 | <tr><th>port</th> | |
2877 | <td class="description">Port number</td></tr> | |
2878 | <tr><th>addrlist</th> | |
65bebeac | 2879 | <td class="description">List of addresses or <code>NULL</code> to lookup</td></tr> |
98d88c8d MS |
2880 | <tr><th>family</th> |
2881 | <td class="description">Address family to use or <code>AF_UNSPEC</code> for any</td></tr> | |
2882 | <tr><th>encryption</th> | |
2883 | <td class="description">Type of encryption to use</td></tr> | |
2884 | <tr><th>blocking</th> | |
2885 | <td class="description">1 for blocking connection, 0 for non-blocking</td></tr> | |
2886 | <tr><th>msec</th> | |
2887 | <td class="description">Connection timeout in milliseconds, 0 means don't connect</td></tr> | |
2888 | <tr><th>cancel</th> | |
2889 | <td class="description">Pointer to "cancel" variable</td></tr> | |
2890 | </tbody></table> | |
798d6e29 MS |
2891 | <h4 class="returnvalue">Return Value</h4> |
2892 | <p class="description">New HTTP connection</p> | |
798d6e29 MS |
2893 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="httpCopyCredentials">httpCopyCredentials</a></h3> |
2894 | <p class="description">Copy the credentials associated with the peer in | |
2895 | an encrypted connection.</p> | |
2896 | <p class="code"> | |
98d88c8d | 2897 | int httpCopyCredentials(<a href="#http_t">http_t</a> *http, cups_array_t **credentials);</p> |
798d6e29 | 2898 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2899 | <table class="list"><tbody> |
2900 | <tr><th>http</th> | |
2901 | <td class="description">Connection to server</td></tr> | |
2902 | <tr><th>credentials</th> | |
2903 | <td class="description">Array of credentials</td></tr> | |
2904 | </tbody></table> | |
798d6e29 MS |
2905 | <h4 class="returnvalue">Return Value</h4> |
2906 | <p class="description">Status of call (0 = success)</p> | |
2907 | <h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></h3> | |
2908 | <p class="description">Return whether the credentials are valid for the given name.</p> | |
2909 | <p class="code"> | |
98d88c8d | 2910 | int httpCredentialsAreValidForName(cups_array_t *credentials, const char *common_name);</p> |
798d6e29 | 2911 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2912 | <table class="list"><tbody> |
2913 | <tr><th>credentials</th> | |
2914 | <td class="description">Credentials</td></tr> | |
2915 | <tr><th>common_name</th> | |
2916 | <td class="description">Name to check</td></tr> | |
2917 | </tbody></table> | |
798d6e29 MS |
2918 | <h4 class="returnvalue">Return Value</h4> |
2919 | <p class="description">1 if valid, 0 otherwise</p> | |
2920 | <h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></h3> | |
2921 | <p class="description">Return the expiration date of the credentials.</p> | |
2922 | <p class="code"> | |
98d88c8d | 2923 | time_t httpCredentialsGetExpiration(cups_array_t *credentials);</p> |
798d6e29 | 2924 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2925 | <table class="list"><tbody> |
2926 | <tr><th>credentials</th> | |
2927 | <td class="description">Credentials</td></tr> | |
2928 | </tbody></table> | |
798d6e29 MS |
2929 | <h4 class="returnvalue">Return Value</h4> |
2930 | <p class="description">Expiration date of credentials</p> | |
2931 | <h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="httpCredentialsGetTrust">httpCredentialsGetTrust</a></h3> | |
2932 | <p class="description">Return the trust of credentials.</p> | |
2933 | <p class="code"> | |
98d88c8d | 2934 | <a href="#http_trust_t">http_trust_t</a> httpCredentialsGetTrust(cups_array_t *credentials, const char *common_name);</p> |
798d6e29 | 2935 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2936 | <table class="list"><tbody> |
2937 | <tr><th>credentials</th> | |
2938 | <td class="description">Credentials</td></tr> | |
2939 | <tr><th>common_name</th> | |
2940 | <td class="description">Common name for trust lookup</td></tr> | |
2941 | </tbody></table> | |
798d6e29 MS |
2942 | <h4 class="returnvalue">Return Value</h4> |
2943 | <p class="description">Level of trust</p> | |
2944 | <h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="httpCredentialsString">httpCredentialsString</a></h3> | |
2945 | <p class="description">Return a string representing the credentials.</p> | |
2946 | <p class="code"> | |
98d88c8d MS |
2947 | size_t httpCredentialsString(cups_array_t *credentials, char *buffer, size_t bufsize);</p> |
2948 | <h4 class="parameters">Parameters</h4> | |
2949 | <table class="list"><tbody> | |
2950 | <tr><th>credentials</th> | |
2951 | <td class="description">Credentials</td></tr> | |
2952 | <tr><th>buffer</th> | |
2953 | <td class="description">Buffer or <code>NULL</code></td></tr> | |
2954 | <tr><th>bufsize</th> | |
2955 | <td class="description">Size of buffer</td></tr> | |
2956 | </tbody></table> | |
798d6e29 MS |
2957 | <h4 class="returnvalue">Return Value</h4> |
2958 | <p class="description">Total size of credentials string</p> | |
798d6e29 MS |
2959 | <h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="httpDecode64_2">httpDecode64_2</a></h3> |
2960 | <p class="description">Base64-decode a string.</p> | |
2961 | <p class="code"> | |
98d88c8d MS |
2962 | char *httpDecode64_2(char *out, int *outlen, const char *in);</p> |
2963 | <h4 class="parameters">Parameters</h4> | |
2964 | <table class="list"><tbody> | |
2965 | <tr><th>out</th> | |
2966 | <td class="description">String to write to</td></tr> | |
2967 | <tr><th>outlen</th> | |
2968 | <td class="description">Size of output string</td></tr> | |
2969 | <tr><th>in</th> | |
2970 | <td class="description">String to read from</td></tr> | |
2971 | </tbody></table> | |
798d6e29 MS |
2972 | <h4 class="returnvalue">Return Value</h4> |
2973 | <p class="description">Decoded string</p> | |
98d88c8d MS |
2974 | <h4 class="discussion">Discussion</h4> |
2975 | <p class="discussion">The caller must initialize "outlen" to the maximum size of the decoded | |
65bebeac | 2976 | string before calling <code>httpDecode64_2</code>. On return "outlen" contains the |
98d88c8d MS |
2977 | decoded length of the string. |
2978 | ||
2979 | </p> | |
798d6e29 MS |
2980 | <h3 class="function"><a id="httpDelete">httpDelete</a></h3> |
2981 | <p class="description">Send a DELETE request to the server.</p> | |
2982 | <p class="code"> | |
98d88c8d | 2983 | int httpDelete(<a href="#http_t">http_t</a> *http, const char *uri);</p> |
798d6e29 | 2984 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
2985 | <table class="list"><tbody> |
2986 | <tr><th>http</th> | |
2987 | <td class="description">HTTP connection</td></tr> | |
2988 | <tr><th>uri</th> | |
2989 | <td class="description">URI to delete</td></tr> | |
2990 | </tbody></table> | |
798d6e29 MS |
2991 | <h4 class="returnvalue">Return Value</h4> |
2992 | <p class="description">Status of call (0 = success)</p> | |
798d6e29 MS |
2993 | <h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="httpEncode64_2">httpEncode64_2</a></h3> |
2994 | <p class="description">Base64-encode a string.</p> | |
2995 | <p class="code"> | |
98d88c8d MS |
2996 | char *httpEncode64_2(char *out, int outlen, const char *in, int inlen);</p> |
2997 | <h4 class="parameters">Parameters</h4> | |
2998 | <table class="list"><tbody> | |
2999 | <tr><th>out</th> | |
3000 | <td class="description">String to write to</td></tr> | |
3001 | <tr><th>outlen</th> | |
3002 | <td class="description">Maximum size of output string</td></tr> | |
3003 | <tr><th>in</th> | |
3004 | <td class="description">String to read from</td></tr> | |
3005 | <tr><th>inlen</th> | |
3006 | <td class="description">Size of input string</td></tr> | |
3007 | </tbody></table> | |
798d6e29 MS |
3008 | <h4 class="returnvalue">Return Value</h4> |
3009 | <p class="description">Encoded string</p> | |
3010 | <h3 class="function"><a id="httpEncryption">httpEncryption</a></h3> | |
3011 | <p class="description">Set the required encryption on the link.</p> | |
3012 | <p class="code"> | |
98d88c8d | 3013 | int httpEncryption(<a href="#http_t">http_t</a> *http, <a href="#http_encryption_t">http_encryption_t</a> e);</p> |
798d6e29 | 3014 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3015 | <table class="list"><tbody> |
3016 | <tr><th>http</th> | |
3017 | <td class="description">HTTP connection</td></tr> | |
3018 | <tr><th>e</th> | |
3019 | <td class="description">New encryption preference</td></tr> | |
3020 | </tbody></table> | |
798d6e29 MS |
3021 | <h4 class="returnvalue">Return Value</h4> |
3022 | <p class="description">-1 on error, 0 on success</p> | |
3023 | <h3 class="function"><a id="httpError">httpError</a></h3> | |
3024 | <p class="description">Get the last error on a connection.</p> | |
3025 | <p class="code"> | |
98d88c8d | 3026 | int httpError(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3027 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3028 | <table class="list"><tbody> |
3029 | <tr><th>http</th> | |
3030 | <td class="description">HTTP connection</td></tr> | |
3031 | </tbody></table> | |
798d6e29 MS |
3032 | <h4 class="returnvalue">Return Value</h4> |
3033 | <p class="description">Error code (errno) value</p> | |
3034 | <h3 class="function"><a id="httpFieldValue">httpFieldValue</a></h3> | |
3035 | <p class="description">Return the HTTP field enumeration value for a field | |
3036 | name.</p> | |
3037 | <p class="code"> | |
98d88c8d | 3038 | <a href="#http_field_t">http_field_t</a> httpFieldValue(const char *name);</p> |
798d6e29 | 3039 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3040 | <table class="list"><tbody> |
3041 | <tr><th>name</th> | |
3042 | <td class="description">String name</td></tr> | |
3043 | </tbody></table> | |
798d6e29 MS |
3044 | <h4 class="returnvalue">Return Value</h4> |
3045 | <p class="description">Field index</p> | |
3046 | <h3 class="function"><a id="httpFlush">httpFlush</a></h3> | |
65bebeac | 3047 | <p class="description">Flush data read from a HTTP connection.</p> |
798d6e29 | 3048 | <p class="code"> |
98d88c8d | 3049 | void httpFlush(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3050 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3051 | <table class="list"><tbody> |
3052 | <tr><th>http</th> | |
3053 | <td class="description">HTTP connection</td></tr> | |
3054 | </tbody></table> | |
798d6e29 | 3055 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpFlushWrite">httpFlushWrite</a></h3> |
65bebeac | 3056 | <p class="description">Flush data written to a HTTP connection.</p> |
798d6e29 | 3057 | <p class="code"> |
98d88c8d | 3058 | int httpFlushWrite(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3059 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3060 | <table class="list"><tbody> |
3061 | <tr><th>http</th> | |
3062 | <td class="description">HTTP connection</td></tr> | |
3063 | </tbody></table> | |
798d6e29 MS |
3064 | <h4 class="returnvalue">Return Value</h4> |
3065 | <p class="description">Bytes written or -1 on error</p> | |
3066 | <h3 class="function"><a id="httpFreeCredentials">httpFreeCredentials</a></h3> | |
98d88c8d | 3067 | <p class="description">Free an array of credentials.</p> |
798d6e29 | 3068 | <p class="code"> |
98d88c8d | 3069 | void httpFreeCredentials(cups_array_t *credentials);</p> |
798d6e29 | 3070 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3071 | <table class="list"><tbody> |
3072 | <tr><th>credentials</th> | |
3073 | <td class="description">Array of credentials</td></tr> | |
3074 | </tbody></table> | |
798d6e29 MS |
3075 | <h3 class="function"><a id="httpGet">httpGet</a></h3> |
3076 | <p class="description">Send a GET request to the server.</p> | |
3077 | <p class="code"> | |
98d88c8d | 3078 | int httpGet(<a href="#http_t">http_t</a> *http, const char *uri);</p> |
798d6e29 | 3079 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3080 | <table class="list"><tbody> |
3081 | <tr><th>http</th> | |
3082 | <td class="description">HTTP connection</td></tr> | |
3083 | <tr><th>uri</th> | |
3084 | <td class="description">URI to get</td></tr> | |
3085 | </tbody></table> | |
798d6e29 MS |
3086 | <h4 class="returnvalue">Return Value</h4> |
3087 | <p class="description">Status of call (0 = success)</p> | |
3088 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetActivity">httpGetActivity</a></h3> | |
3089 | <p class="description">Get the most recent activity for a connection.</p> | |
3090 | <p class="code"> | |
98d88c8d | 3091 | time_t httpGetActivity(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3092 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3093 | <table class="list"><tbody> |
3094 | <tr><th>http</th> | |
3095 | <td class="description">HTTP connection</td></tr> | |
3096 | </tbody></table> | |
798d6e29 MS |
3097 | <h4 class="returnvalue">Return Value</h4> |
3098 | <p class="description">Time of last read or write</p> | |
3099 | <h4 class="discussion">Discussion</h4> | |
65bebeac | 3100 | <p class="discussion">The return value is the time in seconds of the last read or write. |
798d6e29 MS |
3101 | |
3102 | </p> | |
3103 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetAddress">httpGetAddress</a></h3> | |
3104 | <p class="description">Get the address of the connected peer of a connection.</p> | |
3105 | <p class="code"> | |
98d88c8d | 3106 | <a href="#http_addr_t">http_addr_t</a> *httpGetAddress(<a href="#http_t">http_t</a> *http);</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 | </tbody></table> | |
798d6e29 MS |
3112 | <h4 class="returnvalue">Return Value</h4> |
3113 | <p class="description">Connected address or <code>NULL</code></p> | |
3114 | <h4 class="discussion">Discussion</h4> | |
65bebeac MS |
3115 | <p class="discussion">For connections created with <a href="#httpConnect2"><code>httpConnect2</code></a>, the address is for the |
3116 | server. For connections created with <a href="#httpAccept"><code>httpAccept</code></a>, the address is for | |
3117 | the client.<br> | |
3118 | <br> | |
3119 | Returns <code>NULL</code> if the socket is currently unconnected. | |
798d6e29 MS |
3120 | |
3121 | </p> | |
3122 | <h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="httpGetAuthString">httpGetAuthString</a></h3> | |
3123 | <p class="description">Get the current authorization string.</p> | |
3124 | <p class="code"> | |
98d88c8d | 3125 | char *httpGetAuthString(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3126 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3127 | <table class="list"><tbody> |
3128 | <tr><th>http</th> | |
3129 | <td class="description">HTTP connection</td></tr> | |
3130 | </tbody></table> | |
798d6e29 MS |
3131 | <h4 class="returnvalue">Return Value</h4> |
3132 | <p class="description">Authorization string</p> | |
3133 | <h4 class="discussion">Discussion</h4> | |
65bebeac MS |
3134 | <p class="discussion">The authorization string is set by <a href="#cupsDoAuthentication"><code>cupsDoAuthentication</code></a> and |
3135 | <a href="#httpSetAuthString"><code>httpSetAuthString</code></a>. Use <a href="#httpGetAuthString"><code>httpGetAuthString</code></a> to retrieve the | |
3136 | string to use with <a href="#httpSetField"><code>httpSetField</code></a> for the | |
3137 | <code>HTTP_FIELD_AUTHORIZATION</code> value. | |
798d6e29 MS |
3138 | |
3139 | </p> | |
3140 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetBlocking">httpGetBlocking</a></h3> | |
3141 | <p class="description">Get the blocking/non-block state of a connection.</p> | |
3142 | <p class="code"> | |
98d88c8d | 3143 | int httpGetBlocking(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3144 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3145 | <table class="list"><tbody> |
3146 | <tr><th>http</th> | |
3147 | <td class="description">HTTP connection</td></tr> | |
3148 | </tbody></table> | |
798d6e29 MS |
3149 | <h4 class="returnvalue">Return Value</h4> |
3150 | <p class="description">1 if blocking, 0 if non-blocking</p> | |
3151 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpGetContentEncoding">httpGetContentEncoding</a></h3> | |
3152 | <p class="description">Get a common content encoding, if any, between | |
3153 | the client and server.</p> | |
3154 | <p class="code"> | |
98d88c8d | 3155 | const char *httpGetContentEncoding(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3156 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3157 | <table class="list"><tbody> |
3158 | <tr><th>http</th> | |
3159 | <td class="description">HTTP connection</td></tr> | |
3160 | </tbody></table> | |
798d6e29 MS |
3161 | <h4 class="returnvalue">Return Value</h4> |
3162 | <p class="description">Content-Coding value or | |
3163 | <code>NULL</code> for the identity | |
3164 | coding.</p> | |
3165 | <h4 class="discussion">Discussion</h4> | |
3166 | <p class="discussion">This function uses the value of the Accepts-Encoding HTTP header and must be | |
3167 | called after receiving a response from the server or a request from the | |
3168 | client. The value returned can be use in subsequent requests (for clients) | |
3169 | or in the response (for servers) in order to compress the content stream. | |
3170 | ||
3171 | </p> | |
3172 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="httpGetCookie">httpGetCookie</a></h3> | |
3173 | <p class="description">Get any cookie data from the response.</p> | |
3174 | <p class="code"> | |
98d88c8d | 3175 | const char *httpGetCookie(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3176 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3177 | <table class="list"><tbody> |
3178 | <tr><th>http</th> | |
3179 | <td class="description">HTTP connection</td></tr> | |
3180 | </tbody></table> | |
798d6e29 | 3181 | <h4 class="returnvalue">Return Value</h4> |
65bebeac | 3182 | <p class="description">Cookie data or <code>NULL</code></p> |
798d6e29 MS |
3183 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetDateString2">httpGetDateString2</a></h3> |
3184 | <p class="description">Get a formatted date/time string from a time value.</p> | |
3185 | <p class="code"> | |
98d88c8d MS |
3186 | const char *httpGetDateString2(time_t t, char *s, int slen);</p> |
3187 | <h4 class="parameters">Parameters</h4> | |
3188 | <table class="list"><tbody> | |
3189 | <tr><th>t</th> | |
65bebeac | 3190 | <td class="description">Time in seconds</td></tr> |
98d88c8d MS |
3191 | <tr><th>s</th> |
3192 | <td class="description">String buffer</td></tr> | |
3193 | <tr><th>slen</th> | |
3194 | <td class="description">Size of string buffer</td></tr> | |
3195 | </tbody></table> | |
798d6e29 MS |
3196 | <h4 class="returnvalue">Return Value</h4> |
3197 | <p class="description">Date/time string</p> | |
3198 | <h3 class="function"><a id="httpGetDateTime">httpGetDateTime</a></h3> | |
3199 | <p class="description">Get a time value from a formatted date/time string.</p> | |
3200 | <p class="code"> | |
98d88c8d | 3201 | time_t httpGetDateTime(const char *s);</p> |
798d6e29 | 3202 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3203 | <table class="list"><tbody> |
3204 | <tr><th>s</th> | |
3205 | <td class="description">Date/time string</td></tr> | |
3206 | </tbody></table> | |
798d6e29 | 3207 | <h4 class="returnvalue">Return Value</h4> |
65bebeac | 3208 | <p class="description">Time in seconds</p> |
798d6e29 MS |
3209 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetEncryption">httpGetEncryption</a></h3> |
3210 | <p class="description">Get the current encryption mode of a connection.</p> | |
3211 | <p class="code"> | |
98d88c8d | 3212 | <a href="#http_encryption_t">http_encryption_t</a> httpGetEncryption(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3213 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3214 | <table class="list"><tbody> |
3215 | <tr><th>http</th> | |
3216 | <td class="description">HTTP connection</td></tr> | |
3217 | </tbody></table> | |
798d6e29 MS |
3218 | <h4 class="returnvalue">Return Value</h4> |
3219 | <p class="description">Current encryption mode</p> | |
3220 | <h4 class="discussion">Discussion</h4> | |
3221 | <p class="discussion">This function returns the encryption mode for the connection. Use the | |
3222 | <a href="#httpIsEncrypted"><code>httpIsEncrypted</code></a> function to determine whether a TLS session has | |
3223 | been established. | |
3224 | ||
3225 | </p> | |
3226 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpGetExpect">httpGetExpect</a></h3> | |
3227 | <p class="description">Get the value of the Expect header, if any.</p> | |
3228 | <p class="code"> | |
98d88c8d | 3229 | http_status_t httpGetExpect(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3230 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3231 | <table class="list"><tbody> |
3232 | <tr><th>http</th> | |
3233 | <td class="description">HTTP connection</td></tr> | |
3234 | </tbody></table> | |
798d6e29 MS |
3235 | <h4 class="returnvalue">Return Value</h4> |
3236 | <p class="description">Expect: status, if any</p> | |
3237 | <h4 class="discussion">Discussion</h4> | |
3238 | <p class="discussion">Returns <code>HTTP_STATUS_NONE</code> if there is no Expect header, otherwise | |
3239 | returns the expected HTTP status code, typically <code>HTTP_STATUS_CONTINUE</code>. | |
3240 | ||
3241 | </p> | |
3242 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetFd">httpGetFd</a></h3> | |
3243 | <p class="description">Get the file descriptor associated with a connection.</p> | |
3244 | <p class="code"> | |
98d88c8d | 3245 | int httpGetFd(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3246 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3247 | <table class="list"><tbody> |
3248 | <tr><th>http</th> | |
3249 | <td class="description">HTTP connection</td></tr> | |
3250 | </tbody></table> | |
798d6e29 MS |
3251 | <h4 class="returnvalue">Return Value</h4> |
3252 | <p class="description">File descriptor or -1 if none</p> | |
3253 | <h3 class="function"><a id="httpGetField">httpGetField</a></h3> | |
3254 | <p class="description">Get a field value from a request/response.</p> | |
3255 | <p class="code"> | |
98d88c8d | 3256 | const char *httpGetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field);</p> |
798d6e29 | 3257 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3258 | <table class="list"><tbody> |
3259 | <tr><th>http</th> | |
3260 | <td class="description">HTTP connection</td></tr> | |
3261 | <tr><th>field</th> | |
3262 | <td class="description">Field to get</td></tr> | |
3263 | </tbody></table> | |
798d6e29 MS |
3264 | <h4 class="returnvalue">Return Value</h4> |
3265 | <p class="description">Field value</p> | |
798d6e29 MS |
3266 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetHostname">httpGetHostname</a></h3> |
3267 | <p class="description">Get the FQDN for the connection or local system.</p> | |
3268 | <p class="code"> | |
98d88c8d MS |
3269 | const char *httpGetHostname(<a href="#http_t">http_t</a> *http, char *s, int slen);</p> |
3270 | <h4 class="parameters">Parameters</h4> | |
3271 | <table class="list"><tbody> | |
3272 | <tr><th>http</th> | |
3273 | <td class="description">HTTP connection or NULL</td></tr> | |
3274 | <tr><th>s</th> | |
3275 | <td class="description">String buffer for name</td></tr> | |
3276 | <tr><th>slen</th> | |
3277 | <td class="description">Size of buffer</td></tr> | |
3278 | </tbody></table> | |
798d6e29 MS |
3279 | <h4 class="returnvalue">Return Value</h4> |
3280 | <p class="description">FQDN for connection or system</p> | |
3281 | <h4 class="discussion">Discussion</h4> | |
3282 | <p class="discussion">When "http" points to a connected socket, return the hostname or | |
3283 | address that was used in the call to httpConnect() or httpConnectEncrypt(), | |
3284 | or the address of the client for the connection from httpAcceptConnection(). | |
3285 | Otherwise, return the FQDN for the local system using both gethostname() | |
3286 | and gethostbyname() to get the local hostname with domain. | |
3287 | ||
3288 | </p> | |
3289 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetKeepAlive">httpGetKeepAlive</a></h3> | |
3290 | <p class="description">Get the current Keep-Alive state of the connection.</p> | |
3291 | <p class="code"> | |
98d88c8d | 3292 | <a href="#http_keepalive_t">http_keepalive_t</a> httpGetKeepAlive(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3293 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3294 | <table class="list"><tbody> |
3295 | <tr><th>http</th> | |
3296 | <td class="description">HTTP connection</td></tr> | |
3297 | </tbody></table> | |
798d6e29 MS |
3298 | <h4 class="returnvalue">Return Value</h4> |
3299 | <p class="description">Keep-Alive state</p> | |
798d6e29 MS |
3300 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetLength2">httpGetLength2</a></h3> |
3301 | <p class="description">Get the amount of data remaining from the | |
3302 | content-length or transfer-encoding fields.</p> | |
3303 | <p class="code"> | |
98d88c8d | 3304 | off_t httpGetLength2(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3305 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3306 | <table class="list"><tbody> |
3307 | <tr><th>http</th> | |
3308 | <td class="description">HTTP connection</td></tr> | |
3309 | </tbody></table> | |
798d6e29 MS |
3310 | <h4 class="returnvalue">Return Value</h4> |
3311 | <p class="description">Content length</p> | |
3312 | <h4 class="discussion">Discussion</h4> | |
3313 | <p class="discussion">This function returns the complete content length, even for | |
3314 | content larger than 2^31 - 1. | |
3315 | ||
3316 | </p> | |
3317 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetPending">httpGetPending</a></h3> | |
3318 | <p class="description">Get the number of bytes that are buffered for writing.</p> | |
3319 | <p class="code"> | |
98d88c8d | 3320 | size_t httpGetPending(<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">Number of bytes buffered</p> | |
3328 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetReady">httpGetReady</a></h3> | |
3329 | <p class="description">Get the number of bytes that can be read without blocking.</p> | |
3330 | <p class="code"> | |
98d88c8d | 3331 | size_t httpGetReady(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3332 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3333 | <table class="list"><tbody> |
3334 | <tr><th>http</th> | |
3335 | <td class="description">HTTP connection</td></tr> | |
3336 | </tbody></table> | |
798d6e29 MS |
3337 | <h4 class="returnvalue">Return Value</h4> |
3338 | <p class="description">Number of bytes available</p> | |
3339 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetRemaining">httpGetRemaining</a></h3> | |
3340 | <p class="description">Get the number of remaining bytes in the message | |
3341 | body or current chunk.</p> | |
3342 | <p class="code"> | |
98d88c8d | 3343 | size_t httpGetRemaining(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3344 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3345 | <table class="list"><tbody> |
3346 | <tr><th>http</th> | |
3347 | <td class="description">HTTP connection</td></tr> | |
3348 | </tbody></table> | |
798d6e29 MS |
3349 | <h4 class="returnvalue">Return Value</h4> |
3350 | <p class="description">Remaining bytes</p> | |
3351 | <h4 class="discussion">Discussion</h4> | |
3352 | <p class="discussion">The <a href="#httpIsChunked"><code>httpIsChunked</code></a> function can be used to determine whether the | |
3353 | message body is chunked or fixed-length. | |
3354 | ||
3355 | </p> | |
3356 | <h3 class="function"><a id="httpGetState">httpGetState</a></h3> | |
3357 | <p class="description">Get the current state of the HTTP request.</p> | |
3358 | <p class="code"> | |
98d88c8d | 3359 | <a href="#http_state_t">http_state_t</a> httpGetState(<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">HTTP state</p> | |
3367 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetStatus">httpGetStatus</a></h3> | |
3368 | <p class="description">Get the status of the last HTTP request.</p> | |
3369 | <p class="code"> | |
98d88c8d | 3370 | http_status_t httpGetStatus(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3371 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3372 | <table class="list"><tbody> |
3373 | <tr><th>http</th> | |
3374 | <td class="description">HTTP connection</td></tr> | |
3375 | </tbody></table> | |
798d6e29 MS |
3376 | <h4 class="returnvalue">Return Value</h4> |
3377 | <p class="description">HTTP status</p> | |
798d6e29 MS |
3378 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetSubField2">httpGetSubField2</a></h3> |
3379 | <p class="description">Get a sub-field value.</p> | |
3380 | <p class="code"> | |
98d88c8d MS |
3381 | 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> |
3382 | <h4 class="parameters">Parameters</h4> | |
3383 | <table class="list"><tbody> | |
3384 | <tr><th>http</th> | |
3385 | <td class="description">HTTP connection</td></tr> | |
3386 | <tr><th>field</th> | |
3387 | <td class="description">Field index</td></tr> | |
3388 | <tr><th>name</th> | |
3389 | <td class="description">Name of sub-field</td></tr> | |
3390 | <tr><th>value</th> | |
3391 | <td class="description">Value string</td></tr> | |
3392 | <tr><th>valuelen</th> | |
3393 | <td class="description">Size of value buffer</td></tr> | |
3394 | </tbody></table> | |
798d6e29 | 3395 | <h4 class="returnvalue">Return Value</h4> |
65bebeac | 3396 | <p class="description">Value or <code>NULL</code></p> |
798d6e29 MS |
3397 | <h3 class="function"><a id="httpGetVersion">httpGetVersion</a></h3> |
3398 | <p class="description">Get the HTTP version at the other end.</p> | |
3399 | <p class="code"> | |
98d88c8d | 3400 | <a href="#http_version_t">http_version_t</a> httpGetVersion(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3401 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3402 | <table class="list"><tbody> |
3403 | <tr><th>http</th> | |
3404 | <td class="description">HTTP connection</td></tr> | |
3405 | </tbody></table> | |
798d6e29 MS |
3406 | <h4 class="returnvalue">Return Value</h4> |
3407 | <p class="description">Version number</p> | |
3408 | <h3 class="function"><a id="httpGets">httpGets</a></h3> | |
3409 | <p class="description">Get a line of text from a HTTP connection.</p> | |
3410 | <p class="code"> | |
98d88c8d MS |
3411 | char *httpGets(char *line, int length, <a href="#http_t">http_t</a> *http);</p> |
3412 | <h4 class="parameters">Parameters</h4> | |
3413 | <table class="list"><tbody> | |
3414 | <tr><th>line</th> | |
3415 | <td class="description">Line to read into</td></tr> | |
3416 | <tr><th>length</th> | |
3417 | <td class="description">Max length of buffer</td></tr> | |
3418 | <tr><th>http</th> | |
3419 | <td class="description">HTTP connection</td></tr> | |
3420 | </tbody></table> | |
798d6e29 | 3421 | <h4 class="returnvalue">Return Value</h4> |
65bebeac | 3422 | <p class="description">Line or <code>NULL</code></p> |
798d6e29 MS |
3423 | <h3 class="function"><a id="httpHead">httpHead</a></h3> |
3424 | <p class="description">Send a HEAD request to the server.</p> | |
3425 | <p class="code"> | |
98d88c8d | 3426 | int httpHead(<a href="#http_t">http_t</a> *http, const char *uri);</p> |
798d6e29 | 3427 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3428 | <table class="list"><tbody> |
3429 | <tr><th>http</th> | |
3430 | <td class="description">HTTP connection</td></tr> | |
3431 | <tr><th>uri</th> | |
3432 | <td class="description">URI for head</td></tr> | |
3433 | </tbody></table> | |
798d6e29 MS |
3434 | <h4 class="returnvalue">Return Value</h4> |
3435 | <p class="description">Status of call (0 = success)</p> | |
3436 | <h3 class="function"><a id="httpInitialize">httpInitialize</a></h3> | |
53af7f21 MS |
3437 | <p class="description">Initialize the HTTP interface library and set the |
3438 | default HTTP proxy (if any).</p> | |
98d88c8d MS |
3439 | <p class="code"> |
3440 | void httpInitialize(void);</p> | |
798d6e29 MS |
3441 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpIsChunked">httpIsChunked</a></h3> |
3442 | <p class="description">Report whether a message body is chunked.</p> | |
3443 | <p class="code"> | |
98d88c8d | 3444 | int httpIsChunked(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3445 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3446 | <table class="list"><tbody> |
3447 | <tr><th>http</th> | |
3448 | <td class="description">HTTP connection</td></tr> | |
3449 | </tbody></table> | |
798d6e29 MS |
3450 | <h4 class="returnvalue">Return Value</h4> |
3451 | <p class="description">1 if chunked, 0 if not</p> | |
3452 | <h4 class="discussion">Discussion</h4> | |
3453 | <p class="discussion">This function returns non-zero if the message body is composed of | |
3454 | variable-length chunks. | |
3455 | ||
3456 | </p> | |
3457 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpIsEncrypted">httpIsEncrypted</a></h3> | |
3458 | <p class="description">Report whether a connection is encrypted.</p> | |
3459 | <p class="code"> | |
98d88c8d | 3460 | int httpIsEncrypted(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3461 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3462 | <table class="list"><tbody> |
3463 | <tr><th>http</th> | |
3464 | <td class="description">HTTP connection</td></tr> | |
3465 | </tbody></table> | |
798d6e29 MS |
3466 | <h4 class="returnvalue">Return Value</h4> |
3467 | <p class="description">1 if encrypted, 0 if not</p> | |
3468 | <h4 class="discussion">Discussion</h4> | |
3469 | <p class="discussion">This function returns non-zero if the connection is currently encrypted. | |
3470 | ||
3471 | </p> | |
3472 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpLoadCredentials">httpLoadCredentials</a></h3> | |
3473 | <p class="description">Load X.509 credentials from a keychain file.</p> | |
3474 | <p class="code"> | |
98d88c8d MS |
3475 | int httpLoadCredentials(const char *path, cups_array_t **credentials, const char *common_name);</p> |
3476 | <h4 class="parameters">Parameters</h4> | |
3477 | <table class="list"><tbody> | |
3478 | <tr><th>path</th> | |
3479 | <td class="description">Keychain path or <code>NULL</code> for default</td></tr> | |
3480 | <tr><th>credentials</th> | |
3481 | <td class="description">Credentials</td></tr> | |
3482 | <tr><th>common_name</th> | |
3483 | <td class="description">Common name for credentials</td></tr> | |
3484 | </tbody></table> | |
798d6e29 MS |
3485 | <h4 class="returnvalue">Return Value</h4> |
3486 | <p class="description">0 on success, -1 on error</p> | |
3487 | <h3 class="function"><a id="httpOptions">httpOptions</a></h3> | |
3488 | <p class="description">Send an OPTIONS request to the server.</p> | |
3489 | <p class="code"> | |
98d88c8d | 3490 | int httpOptions(<a href="#http_t">http_t</a> *http, const char *uri);</p> |
798d6e29 | 3491 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3492 | <table class="list"><tbody> |
3493 | <tr><th>http</th> | |
3494 | <td class="description">HTTP connection</td></tr> | |
3495 | <tr><th>uri</th> | |
3496 | <td class="description">URI for options</td></tr> | |
3497 | </tbody></table> | |
798d6e29 MS |
3498 | <h4 class="returnvalue">Return Value</h4> |
3499 | <p class="description">Status of call (0 = success)</p> | |
3500 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpPeek">httpPeek</a></h3> | |
3501 | <p class="description">Peek at data from a HTTP connection.</p> | |
3502 | <p class="code"> | |
98d88c8d MS |
3503 | ssize_t httpPeek(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p> |
3504 | <h4 class="parameters">Parameters</h4> | |
3505 | <table class="list"><tbody> | |
3506 | <tr><th>http</th> | |
3507 | <td class="description">HTTP connection</td></tr> | |
3508 | <tr><th>buffer</th> | |
3509 | <td class="description">Buffer for data</td></tr> | |
3510 | <tr><th>length</th> | |
3511 | <td class="description">Maximum number of bytes</td></tr> | |
3512 | </tbody></table> | |
798d6e29 MS |
3513 | <h4 class="returnvalue">Return Value</h4> |
3514 | <p class="description">Number of bytes copied</p> | |
3515 | <h4 class="discussion">Discussion</h4> | |
3516 | <p class="discussion">This function copies available data from the given HTTP connection, reading | |
3517 | a buffer as needed. The data is still available for reading using | |
65bebeac | 3518 | <a href="#httpRead2"><code>httpRead2</code></a>.<br> |
798d6e29 MS |
3519 | <br> |
3520 | For non-blocking connections the usual timeouts apply. | |
3521 | ||
3522 | </p> | |
3523 | <h3 class="function"><a id="httpPost">httpPost</a></h3> | |
3524 | <p class="description">Send a POST request to the server.</p> | |
3525 | <p class="code"> | |
98d88c8d | 3526 | int httpPost(<a href="#http_t">http_t</a> *http, const char *uri);</p> |
798d6e29 | 3527 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3528 | <table class="list"><tbody> |
3529 | <tr><th>http</th> | |
3530 | <td class="description">HTTP connection</td></tr> | |
3531 | <tr><th>uri</th> | |
3532 | <td class="description">URI for post</td></tr> | |
3533 | </tbody></table> | |
798d6e29 MS |
3534 | <h4 class="returnvalue">Return Value</h4> |
3535 | <p class="description">Status of call (0 = success)</p> | |
3536 | <h3 class="function"><a id="httpPut">httpPut</a></h3> | |
3537 | <p class="description">Send a PUT request to the server.</p> | |
3538 | <p class="code"> | |
98d88c8d | 3539 | int httpPut(<a href="#http_t">http_t</a> *http, const char *uri);</p> |
798d6e29 | 3540 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3541 | <table class="list"><tbody> |
3542 | <tr><th>http</th> | |
3543 | <td class="description">HTTP connection</td></tr> | |
3544 | <tr><th>uri</th> | |
3545 | <td class="description">URI to put</td></tr> | |
3546 | </tbody></table> | |
798d6e29 MS |
3547 | <h4 class="returnvalue">Return Value</h4> |
3548 | <p class="description">Status of call (0 = success)</p> | |
798d6e29 MS |
3549 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpRead2">httpRead2</a></h3> |
3550 | <p class="description">Read data from a HTTP connection.</p> | |
3551 | <p class="code"> | |
98d88c8d MS |
3552 | ssize_t httpRead2(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p> |
3553 | <h4 class="parameters">Parameters</h4> | |
3554 | <table class="list"><tbody> | |
3555 | <tr><th>http</th> | |
3556 | <td class="description">HTTP connection</td></tr> | |
3557 | <tr><th>buffer</th> | |
3558 | <td class="description">Buffer for data</td></tr> | |
3559 | <tr><th>length</th> | |
3560 | <td class="description">Maximum number of bytes</td></tr> | |
3561 | </tbody></table> | |
798d6e29 MS |
3562 | <h4 class="returnvalue">Return Value</h4> |
3563 | <p class="description">Number of bytes read</p> | |
3564 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpReadRequest">httpReadRequest</a></h3> | |
3565 | <p class="description">Read a HTTP request from a connection.</p> | |
3566 | <p class="code"> | |
98d88c8d MS |
3567 | <a href="#http_state_t">http_state_t</a> httpReadRequest(<a href="#http_t">http_t</a> *http, char *uri, size_t urilen);</p> |
3568 | <h4 class="parameters">Parameters</h4> | |
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 buffer</td></tr> | |
3574 | <tr><th>urilen</th> | |
3575 | <td class="description">Size of URI buffer</td></tr> | |
3576 | </tbody></table> | |
798d6e29 MS |
3577 | <h4 class="returnvalue">Return Value</h4> |
3578 | <p class="description">New state of connection</p> | |
798d6e29 MS |
3579 | <h3 class="function"><a id="httpReconnect2">httpReconnect2</a></h3> |
3580 | <p class="description">Reconnect to a HTTP server with timeout and optional | |
3581 | cancel.</p> | |
3582 | <p class="code"> | |
98d88c8d MS |
3583 | int httpReconnect2(<a href="#http_t">http_t</a> *http, int msec, int *cancel);</p> |
3584 | <h4 class="parameters">Parameters</h4> | |
3585 | <table class="list"><tbody> | |
3586 | <tr><th>http</th> | |
3587 | <td class="description">HTTP connection</td></tr> | |
3588 | <tr><th>msec</th> | |
3589 | <td class="description">Timeout in milliseconds</td></tr> | |
3590 | <tr><th>cancel</th> | |
3591 | <td class="description">Pointer to "cancel" variable</td></tr> | |
3592 | </tbody></table> | |
798d6e29 MS |
3593 | <h4 class="returnvalue">Return Value</h4> |
3594 | <p class="description">0 on success, non-zero on failure</p> | |
3595 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpResolveHostname">httpResolveHostname</a></h3> | |
3596 | <p class="description">Resolve the hostname of the HTTP connection | |
3597 | address.</p> | |
3598 | <p class="code"> | |
98d88c8d MS |
3599 | const char *httpResolveHostname(<a href="#http_t">http_t</a> *http, char *buffer, size_t bufsize);</p> |
3600 | <h4 class="parameters">Parameters</h4> | |
3601 | <table class="list"><tbody> | |
3602 | <tr><th>http</th> | |
3603 | <td class="description">HTTP connection</td></tr> | |
3604 | <tr><th>buffer</th> | |
3605 | <td class="description">Hostname buffer</td></tr> | |
3606 | <tr><th>bufsize</th> | |
3607 | <td class="description">Size of buffer</td></tr> | |
3608 | </tbody></table> | |
798d6e29 MS |
3609 | <h4 class="returnvalue">Return Value</h4> |
3610 | <p class="description">Resolved hostname or <code>NULL</code></p> | |
3611 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpSaveCredentials">httpSaveCredentials</a></h3> | |
3612 | <p class="description">Save X.509 credentials to a keychain file.</p> | |
3613 | <p class="code"> | |
98d88c8d MS |
3614 | int httpSaveCredentials(const char *path, cups_array_t *credentials, const char *common_name);</p> |
3615 | <h4 class="parameters">Parameters</h4> | |
3616 | <table class="list"><tbody> | |
3617 | <tr><th>path</th> | |
3618 | <td class="description">Keychain path or <code>NULL</code> for default</td></tr> | |
3619 | <tr><th>credentials</th> | |
3620 | <td class="description">Credentials</td></tr> | |
3621 | <tr><th>common_name</th> | |
3622 | <td class="description">Common name for credentials</td></tr> | |
3623 | </tbody></table> | |
798d6e29 MS |
3624 | <h4 class="returnvalue">Return Value</h4> |
3625 | <p class="description">-1 on error, 0 on success</p> | |
798d6e29 MS |
3626 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpSeparateURI">httpSeparateURI</a></h3> |
3627 | <p class="description">Separate a Universal Resource Identifier into its | |
3628 | components.</p> | |
3629 | <p class="code"> | |
98d88c8d MS |
3630 | <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> |
3631 | <h4 class="parameters">Parameters</h4> | |
3632 | <table class="list"><tbody> | |
3633 | <tr><th>decoding</th> | |
3634 | <td class="description">Decoding flags</td></tr> | |
3635 | <tr><th>uri</th> | |
3636 | <td class="description">Universal Resource Identifier</td></tr> | |
3637 | <tr><th>scheme</th> | |
3638 | <td class="description">Scheme (http, https, etc.)</td></tr> | |
3639 | <tr><th>schemelen</th> | |
3640 | <td class="description">Size of scheme buffer</td></tr> | |
3641 | <tr><th>username</th> | |
3642 | <td class="description">Username</td></tr> | |
3643 | <tr><th>usernamelen</th> | |
3644 | <td class="description">Size of username buffer</td></tr> | |
3645 | <tr><th>host</th> | |
3646 | <td class="description">Hostname</td></tr> | |
3647 | <tr><th>hostlen</th> | |
3648 | <td class="description">Size of hostname buffer</td></tr> | |
3649 | <tr><th>port</th> | |
3650 | <td class="description">Port number to use</td></tr> | |
3651 | <tr><th>resource</th> | |
3652 | <td class="description">Resource/filename</td></tr> | |
3653 | <tr><th>resourcelen</th> | |
3654 | <td class="description">Size of resource buffer</td></tr> | |
3655 | </tbody></table> | |
798d6e29 MS |
3656 | <h4 class="returnvalue">Return Value</h4> |
3657 | <p class="description">Result of separation</p> | |
98d88c8d | 3658 | <h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="httpSetAuthString">httpSetAuthString</a></h3> |
53af7f21 | 3659 | <p class="description">Set the current authorization string.</p> |
98d88c8d MS |
3660 | <p class="code"> |
3661 | void httpSetAuthString(<a href="#http_t">http_t</a> *http, const char *scheme, const char *data);</p> | |
3662 | <h4 class="parameters">Parameters</h4> | |
3663 | <table class="list"><tbody> | |
3664 | <tr><th>http</th> | |
3665 | <td class="description">HTTP connection</td></tr> | |
3666 | <tr><th>scheme</th> | |
3667 | <td class="description">Auth scheme (NULL to clear it)</td></tr> | |
3668 | <tr><th>data</th> | |
3669 | <td class="description">Auth data (NULL for none)</td></tr> | |
3670 | </tbody></table> | |
3671 | <h4 class="discussion">Discussion</h4> | |
798d6e29 | 3672 | <p class="discussion">This function just stores a copy of the current authorization string in |
65bebeac MS |
3673 | the HTTP connection object. You must still call <a href="#httpSetField"><code>httpSetField</code></a> to set |
3674 | <code>HTTP_FIELD_AUTHORIZATION</code> prior to issuing a HTTP request using | |
3675 | <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 | |
3676 | <a href="#httpPut"><code>httpPut</code></a>. | |
798d6e29 MS |
3677 | |
3678 | </p> | |
98d88c8d MS |
3679 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="httpSetCookie">httpSetCookie</a></h3> |
3680 | <p class="description">Set the cookie value(s).</p> | |
798d6e29 | 3681 | <p class="code"> |
98d88c8d | 3682 | void httpSetCookie(<a href="#http_t">http_t</a> *http, const char *cookie);</p> |
798d6e29 | 3683 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3684 | <table class="list"><tbody> |
3685 | <tr><th>http</th> | |
3686 | <td class="description">Connection</td></tr> | |
3687 | <tr><th>cookie</th> | |
3688 | <td class="description">Cookie string</td></tr> | |
3689 | </tbody></table> | |
798d6e29 MS |
3690 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="httpSetCredentials">httpSetCredentials</a></h3> |
3691 | <p class="description">Set the credentials associated with an encrypted | |
3692 | connection.</p> | |
3693 | <p class="code"> | |
98d88c8d | 3694 | int httpSetCredentials(<a href="#http_t">http_t</a> *http, cups_array_t *credentials);</p> |
798d6e29 | 3695 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3696 | <table class="list"><tbody> |
3697 | <tr><th>http</th> | |
3698 | <td class="description">HTTP connection</td></tr> | |
3699 | <tr><th>credentials</th> | |
3700 | <td class="description">Array of credentials</td></tr> | |
3701 | </tbody></table> | |
798d6e29 MS |
3702 | <h4 class="returnvalue">Return Value</h4> |
3703 | <p class="description">Status of call (0 = success)</p> | |
98d88c8d | 3704 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpSetDefaultField">httpSetDefaultField</a></h3> |
53af7f21 | 3705 | <p class="description">Set the default value of an HTTP header.</p> |
98d88c8d MS |
3706 | <p class="code"> |
3707 | void httpSetDefaultField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p> | |
3708 | <h4 class="parameters">Parameters</h4> | |
3709 | <table class="list"><tbody> | |
3710 | <tr><th>http</th> | |
3711 | <td class="description">HTTP connection</td></tr> | |
3712 | <tr><th>field</th> | |
3713 | <td class="description">Field index</td></tr> | |
3714 | <tr><th>value</th> | |
3715 | <td class="description">Value</td></tr> | |
3716 | </tbody></table> | |
3717 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
3718 | <p class="discussion">Currently only <code>HTTP_FIELD_ACCEPT_ENCODING</code>, <code>HTTP_FIELD_SERVER</code>, |
3719 | and <code>HTTP_FIELD_USER_AGENT</code> can be set. | |
3720 | ||
3721 | </p> | |
98d88c8d MS |
3722 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpSetExpect">httpSetExpect</a></h3> |
3723 | <p class="description">Set the Expect: header in a request.</p> | |
798d6e29 | 3724 | <p class="code"> |
98d88c8d | 3725 | void httpSetExpect(<a href="#http_t">http_t</a> *http, http_status_t expect);</p> |
798d6e29 | 3726 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3727 | <table class="list"><tbody> |
3728 | <tr><th>http</th> | |
3729 | <td class="description">HTTP connection</td></tr> | |
3730 | <tr><th>expect</th> | |
3731 | <td class="description">HTTP status to expect | |
3732 | (<code>HTTP_STATUS_CONTINUE</code>)</td></tr> | |
3733 | </tbody></table> | |
3734 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
3735 | <p class="discussion">Currently only <code>HTTP_STATUS_CONTINUE</code> is supported for the "expect" |
3736 | argument. | |
3737 | ||
3738 | </p> | |
3739 | <h3 class="function"><a id="httpSetField">httpSetField</a></h3> | |
53af7f21 | 3740 | <p class="description">Set the value of an HTTP header.</p> |
798d6e29 | 3741 | <p class="code"> |
98d88c8d MS |
3742 | void httpSetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p> |
3743 | <h4 class="parameters">Parameters</h4> | |
3744 | <table class="list"><tbody> | |
3745 | <tr><th>http</th> | |
3746 | <td class="description">HTTP connection</td></tr> | |
3747 | <tr><th>field</th> | |
3748 | <td class="description">Field index</td></tr> | |
3749 | <tr><th>value</th> | |
3750 | <td class="description">Value</td></tr> | |
3751 | </tbody></table> | |
3752 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpSetKeepAlive">httpSetKeepAlive</a></h3> | |
53af7f21 | 3753 | <p class="description">Set the current Keep-Alive state of a connection.</p> |
98d88c8d MS |
3754 | <p class="code"> |
3755 | void httpSetKeepAlive(<a href="#http_t">http_t</a> *http, <a href="#http_keepalive_t">http_keepalive_t</a> keep_alive);</p> | |
3756 | <h4 class="parameters">Parameters</h4> | |
3757 | <table class="list"><tbody> | |
3758 | <tr><th>http</th> | |
3759 | <td class="description">HTTP connection</td></tr> | |
3760 | <tr><th>keep_alive</th> | |
3761 | <td class="description">New Keep-Alive value</td></tr> | |
3762 | </tbody></table> | |
3763 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpSetLength">httpSetLength</a></h3> | |
53af7f21 | 3764 | <p class="description">Set the content-length and content-encoding.</p> |
98d88c8d MS |
3765 | <p class="code"> |
3766 | void httpSetLength(<a href="#http_t">http_t</a> *http, size_t length);</p> | |
3767 | <h4 class="parameters">Parameters</h4> | |
3768 | <table class="list"><tbody> | |
3769 | <tr><th>http</th> | |
3770 | <td class="description">HTTP connection</td></tr> | |
3771 | <tr><th>length</th> | |
3772 | <td class="description">Length (0 for chunked)</td></tr> | |
3773 | </tbody></table> | |
3774 | <h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="httpSetTimeout">httpSetTimeout</a></h3> | |
53af7f21 | 3775 | <p class="description">Set read/write timeouts and an optional callback.</p> |
98d88c8d MS |
3776 | <p class="code"> |
3777 | 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> | |
3778 | <h4 class="parameters">Parameters</h4> | |
3779 | <table class="list"><tbody> | |
3780 | <tr><th>http</th> | |
3781 | <td class="description">HTTP connection</td></tr> | |
3782 | <tr><th>timeout</th> | |
3783 | <td class="description">Number of seconds for timeout, | |
3784 | must be greater than 0</td></tr> | |
3785 | <tr><th>cb</th> | |
65bebeac | 3786 | <td class="description">Callback function or <code>NULL</code></td></tr> |
98d88c8d MS |
3787 | <tr><th>user_data</th> |
3788 | <td class="description">User data pointer</td></tr> | |
3789 | </tbody></table> | |
3790 | <h4 class="discussion">Discussion</h4> | |
798d6e29 MS |
3791 | <p class="discussion">The optional timeout callback receives both the HTTP connection and a user |
3792 | data pointer and must return 1 to continue or 0 to error (time) out. | |
3793 | ||
3794 | </p> | |
98d88c8d MS |
3795 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpShutdown">httpShutdown</a></h3> |
3796 | <p class="description">Shutdown one side of an HTTP connection.</p> | |
798d6e29 | 3797 | <p class="code"> |
98d88c8d | 3798 | void httpShutdown(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3799 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3800 | <table class="list"><tbody> |
3801 | <tr><th>http</th> | |
3802 | <td class="description">HTTP connection</td></tr> | |
3803 | </tbody></table> | |
798d6e29 MS |
3804 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpStateString">httpStateString</a></h3> |
3805 | <p class="description">Return the string describing a HTTP state value.</p> | |
3806 | <p class="code"> | |
98d88c8d | 3807 | const char *httpStateString(<a href="#http_state_t">http_state_t</a> state);</p> |
798d6e29 | 3808 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3809 | <table class="list"><tbody> |
3810 | <tr><th>state</th> | |
3811 | <td class="description">HTTP state value</td></tr> | |
3812 | </tbody></table> | |
798d6e29 MS |
3813 | <h4 class="returnvalue">Return Value</h4> |
3814 | <p class="description">State string</p> | |
3815 | <h3 class="function"><a id="httpStatus">httpStatus</a></h3> | |
3816 | <p class="description">Return a short string describing a HTTP status code.</p> | |
3817 | <p class="code"> | |
98d88c8d | 3818 | const char *httpStatus(http_status_t status);</p> |
798d6e29 | 3819 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3820 | <table class="list"><tbody> |
3821 | <tr><th>status</th> | |
3822 | <td class="description">HTTP status code</td></tr> | |
3823 | </tbody></table> | |
798d6e29 MS |
3824 | <h4 class="returnvalue">Return Value</h4> |
3825 | <p class="description">Localized status string</p> | |
3826 | <h4 class="discussion">Discussion</h4> | |
3827 | <p class="discussion">The returned string is localized to the current POSIX locale and is based | |
65bebeac | 3828 | on the status strings defined in RFC 7231.</p> |
798d6e29 MS |
3829 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpURIStatusString">httpURIStatusString</a></h3> |
3830 | <p class="description">Return a string describing a URI status code.</p> | |
3831 | <p class="code"> | |
98d88c8d | 3832 | const char *httpURIStatusString(<a href="#http_uri_status_t">http_uri_status_t</a> status);</p> |
798d6e29 | 3833 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3834 | <table class="list"><tbody> |
3835 | <tr><th>status</th> | |
3836 | <td class="description">URI status code</td></tr> | |
3837 | </tbody></table> | |
798d6e29 MS |
3838 | <h4 class="returnvalue">Return Value</h4> |
3839 | <p class="description">Localized status string</p> | |
3840 | <h3 class="function"><a id="httpUpdate">httpUpdate</a></h3> | |
3841 | <p class="description">Update the current HTTP state for incoming data.</p> | |
3842 | <p class="code"> | |
98d88c8d | 3843 | http_status_t httpUpdate(<a href="#http_t">http_t</a> *http);</p> |
798d6e29 | 3844 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3845 | <table class="list"><tbody> |
3846 | <tr><th>http</th> | |
3847 | <td class="description">HTTP connection</td></tr> | |
3848 | </tbody></table> | |
798d6e29 MS |
3849 | <h4 class="returnvalue">Return Value</h4> |
3850 | <p class="description">HTTP status</p> | |
3851 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="httpWait">httpWait</a></h3> | |
3852 | <p class="description">Wait for data available on a connection.</p> | |
3853 | <p class="code"> | |
98d88c8d | 3854 | int httpWait(<a href="#http_t">http_t</a> *http, int msec);</p> |
798d6e29 | 3855 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
3856 | <table class="list"><tbody> |
3857 | <tr><th>http</th> | |
3858 | <td class="description">HTTP connection</td></tr> | |
3859 | <tr><th>msec</th> | |
3860 | <td class="description">Milliseconds to wait</td></tr> | |
3861 | </tbody></table> | |
798d6e29 MS |
3862 | <h4 class="returnvalue">Return Value</h4> |
3863 | <p class="description">1 if data is available, 0 otherwise</p> | |
798d6e29 MS |
3864 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpWrite2">httpWrite2</a></h3> |
3865 | <p class="description">Write data to a HTTP connection.</p> | |
3866 | <p class="code"> | |
98d88c8d MS |
3867 | ssize_t httpWrite2(<a href="#http_t">http_t</a> *http, const char *buffer, size_t length);</p> |
3868 | <h4 class="parameters">Parameters</h4> | |
3869 | <table class="list"><tbody> | |
3870 | <tr><th>http</th> | |
3871 | <td class="description">HTTP connection</td></tr> | |
3872 | <tr><th>buffer</th> | |
3873 | <td class="description">Buffer for data</td></tr> | |
3874 | <tr><th>length</th> | |
3875 | <td class="description">Number of bytes to write</td></tr> | |
3876 | </tbody></table> | |
798d6e29 MS |
3877 | <h4 class="returnvalue">Return Value</h4> |
3878 | <p class="description">Number of bytes written</p> | |
3879 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpWriteResponse">httpWriteResponse</a></h3> | |
3880 | <p class="description">Write a HTTP response to a client connection.</p> | |
3881 | <p class="code"> | |
98d88c8d | 3882 | int httpWriteResponse(<a href="#http_t">http_t</a> *http, http_status_t status);</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>status</th> | |
3888 | <td class="description">Status code</td></tr> | |
3889 | </tbody></table> | |
798d6e29 MS |
3890 | <h4 class="returnvalue">Return Value</h4> |
3891 | <p class="description">0 on success, -1 on error</p> | |
3892 | <h3 class="function"><a id="ippAddBoolean">ippAddBoolean</a></h3> | |
3893 | <p class="description">Add a boolean attribute to an IPP message.</p> | |
3894 | <p class="code"> | |
98d88c8d MS |
3895 | <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> |
3896 | <h4 class="parameters">Parameters</h4> | |
3897 | <table class="list"><tbody> | |
3898 | <tr><th>ipp</th> | |
3899 | <td class="description">IPP message</td></tr> | |
3900 | <tr><th>group</th> | |
3901 | <td class="description">IPP group</td></tr> | |
3902 | <tr><th>name</th> | |
3903 | <td class="description">Name of attribute</td></tr> | |
3904 | <tr><th>value</th> | |
3905 | <td class="description">Value of attribute</td></tr> | |
3906 | </tbody></table> | |
798d6e29 MS |
3907 | <h4 class="returnvalue">Return Value</h4> |
3908 | <p class="description">New attribute</p> | |
3909 | <h4 class="discussion">Discussion</h4> | |
3910 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
3911 | 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> | |
3912 | <br> | |
3913 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
3914 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
3915 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
3916 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
3917 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p> | |
3918 | <h3 class="function"><a id="ippAddBooleans">ippAddBooleans</a></h3> | |
3919 | <p class="description">Add an array of boolean values.</p> | |
3920 | <p class="code"> | |
98d88c8d MS |
3921 | <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> |
3922 | <h4 class="parameters">Parameters</h4> | |
3923 | <table class="list"><tbody> | |
3924 | <tr><th>ipp</th> | |
3925 | <td class="description">IPP message</td></tr> | |
3926 | <tr><th>group</th> | |
3927 | <td class="description">IPP group</td></tr> | |
3928 | <tr><th>name</th> | |
3929 | <td class="description">Name of attribute</td></tr> | |
3930 | <tr><th>num_values</th> | |
3931 | <td class="description">Number of values</td></tr> | |
3932 | <tr><th>values</th> | |
3933 | <td class="description">Values</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"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippAddCollection">ippAddCollection</a></h3> | |
3947 | <p class="description">Add a collection value.</p> | |
3948 | <p class="code"> | |
98d88c8d MS |
3949 | <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> |
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>value</th> | |
3959 | <td class="description">Value</td></tr> | |
3960 | </tbody></table> | |
798d6e29 MS |
3961 | <h4 class="returnvalue">Return Value</h4> |
3962 | <p class="description">New attribute</p> | |
3963 | <h4 class="discussion">Discussion</h4> | |
3964 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
3965 | 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> | |
3966 | <br> | |
3967 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
3968 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
3969 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
3970 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
3971 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>). | |
3972 | ||
3973 | </p> | |
3974 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippAddCollections">ippAddCollections</a></h3> | |
3975 | <p class="description">Add an array of collection values.</p> | |
3976 | <p class="code"> | |
98d88c8d MS |
3977 | <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> |
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>num_values</th> | |
3987 | <td class="description">Number of values</td></tr> | |
3988 | <tr><th>values</th> | |
3989 | <td class="description">Values</td></tr> | |
3990 | </tbody></table> | |
798d6e29 MS |
3991 | <h4 class="returnvalue">Return Value</h4> |
3992 | <p class="description">New attribute</p> | |
3993 | <h4 class="discussion">Discussion</h4> | |
3994 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
3995 | 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> | |
3996 | <br> | |
3997 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
3998 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
3999 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4000 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4001 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>). | |
4002 | ||
4003 | </p> | |
4004 | <h3 class="function"><a id="ippAddDate">ippAddDate</a></h3> | |
65bebeac | 4005 | <p class="description">Add a dateTime attribute to an IPP message.</p> |
798d6e29 | 4006 | <p class="code"> |
98d88c8d MS |
4007 | <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> |
4008 | <h4 class="parameters">Parameters</h4> | |
4009 | <table class="list"><tbody> | |
4010 | <tr><th>ipp</th> | |
4011 | <td class="description">IPP message</td></tr> | |
4012 | <tr><th>group</th> | |
4013 | <td class="description">IPP group</td></tr> | |
4014 | <tr><th>name</th> | |
4015 | <td class="description">Name of attribute</td></tr> | |
4016 | <tr><th>value</th> | |
4017 | <td class="description">Value</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>).</p> | |
4030 | <h3 class="function"><a id="ippAddInteger">ippAddInteger</a></h3> | |
4031 | <p class="description">Add a integer attribute to an IPP message.</p> | |
4032 | <p class="code"> | |
98d88c8d MS |
4033 | <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> |
4034 | <h4 class="parameters">Parameters</h4> | |
4035 | <table class="list"><tbody> | |
4036 | <tr><th>ipp</th> | |
4037 | <td class="description">IPP message</td></tr> | |
4038 | <tr><th>group</th> | |
4039 | <td class="description">IPP group</td></tr> | |
4040 | <tr><th>value_tag</th> | |
4041 | <td class="description">Type of attribute</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 of attribute</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>).<br> | |
4058 | <br> | |
4059 | Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer | |
4060 | (<code>IPP_TAG_INTEGER</code>).</p> | |
4061 | <h3 class="function"><a id="ippAddIntegers">ippAddIntegers</a></h3> | |
4062 | <p class="description">Add an array of integer values.</p> | |
4063 | <p class="code"> | |
98d88c8d MS |
4064 | <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> |
4065 | <h4 class="parameters">Parameters</h4> | |
4066 | <table class="list"><tbody> | |
4067 | <tr><th>ipp</th> | |
4068 | <td class="description">IPP message</td></tr> | |
4069 | <tr><th>group</th> | |
4070 | <td class="description">IPP group</td></tr> | |
4071 | <tr><th>value_tag</th> | |
4072 | <td class="description">Type of attribute</td></tr> | |
4073 | <tr><th>name</th> | |
4074 | <td class="description">Name of attribute</td></tr> | |
4075 | <tr><th>num_values</th> | |
4076 | <td class="description">Number of values</td></tr> | |
4077 | <tr><th>values</th> | |
4078 | <td class="description">Values</td></tr> | |
4079 | </tbody></table> | |
798d6e29 MS |
4080 | <h4 class="returnvalue">Return Value</h4> |
4081 | <p class="description">New attribute</p> | |
4082 | <h4 class="discussion">Discussion</h4> | |
4083 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4084 | 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> | |
4085 | <br> | |
4086 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4087 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4088 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4089 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4090 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> | |
4091 | <br> | |
4092 | Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer | |
4093 | (<code>IPP_TAG_INTEGER</code>).</p> | |
4094 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippAddOctetString">ippAddOctetString</a></h3> | |
4095 | <p class="description">Add an octetString value to an IPP message.</p> | |
4096 | <p class="code"> | |
98d88c8d MS |
4097 | <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> |
4098 | <h4 class="parameters">Parameters</h4> | |
4099 | <table class="list"><tbody> | |
4100 | <tr><th>ipp</th> | |
4101 | <td class="description">IPP message</td></tr> | |
4102 | <tr><th>group</th> | |
4103 | <td class="description">IPP group</td></tr> | |
4104 | <tr><th>name</th> | |
4105 | <td class="description">Name of attribute</td></tr> | |
4106 | <tr><th>data</th> | |
4107 | <td class="description">octetString data</td></tr> | |
4108 | <tr><th>datalen</th> | |
4109 | <td class="description">Length of data in bytes</td></tr> | |
4110 | </tbody></table> | |
798d6e29 MS |
4111 | <h4 class="returnvalue">Return Value</h4> |
4112 | <p class="description">New attribute</p> | |
4113 | <h4 class="discussion">Discussion</h4> | |
4114 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4115 | 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> | |
4116 | <br> | |
4117 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4118 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4119 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4120 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4121 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>). | |
4122 | ||
4123 | </p> | |
4124 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippAddOutOfBand">ippAddOutOfBand</a></h3> | |
4125 | <p class="description">Add an out-of-band value to an IPP message.</p> | |
4126 | <p class="code"> | |
98d88c8d MS |
4127 | <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> |
4128 | <h4 class="parameters">Parameters</h4> | |
4129 | <table class="list"><tbody> | |
4130 | <tr><th>ipp</th> | |
4131 | <td class="description">IPP message</td></tr> | |
4132 | <tr><th>group</th> | |
4133 | <td class="description">IPP group</td></tr> | |
4134 | <tr><th>value_tag</th> | |
4135 | <td class="description">Type of attribute</td></tr> | |
4136 | <tr><th>name</th> | |
4137 | <td class="description">Name of attribute</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>).<br> | |
4150 | <br> | |
4151 | Supported out-of-band values include unsupported-value | |
4152 | (<code>IPP_TAG_UNSUPPORTED_VALUE</code>), default (<code>IPP_TAG_DEFAULT</code>), unknown | |
4153 | (<code>IPP_TAG_UNKNOWN</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable | |
4154 | (<code>IPP_TAG_NOTSETTABLE</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), and | |
4155 | admin-define (<code>IPP_TAG_ADMINDEFINE</code>). | |
4156 | ||
4157 | </p> | |
4158 | <h3 class="function"><a id="ippAddRange">ippAddRange</a></h3> | |
4159 | <p class="description">Add a range of values to an IPP message.</p> | |
4160 | <p class="code"> | |
98d88c8d MS |
4161 | <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> |
4162 | <h4 class="parameters">Parameters</h4> | |
4163 | <table class="list"><tbody> | |
4164 | <tr><th>ipp</th> | |
4165 | <td class="description">IPP message</td></tr> | |
4166 | <tr><th>group</th> | |
4167 | <td class="description">IPP group</td></tr> | |
4168 | <tr><th>name</th> | |
4169 | <td class="description">Name of attribute</td></tr> | |
4170 | <tr><th>lower</th> | |
4171 | <td class="description">Lower value</td></tr> | |
4172 | <tr><th>upper</th> | |
4173 | <td class="description">Upper value</td></tr> | |
4174 | </tbody></table> | |
798d6e29 MS |
4175 | <h4 class="returnvalue">Return Value</h4> |
4176 | <p class="description">New attribute</p> | |
4177 | <h4 class="discussion">Discussion</h4> | |
4178 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4179 | 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> | |
4180 | <br> | |
4181 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4182 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4183 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4184 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4185 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> | |
4186 | <br> | |
4187 | The <code>lower</code> parameter must be less than or equal to the <code>upper</code> parameter.</p> | |
4188 | <h3 class="function"><a id="ippAddRanges">ippAddRanges</a></h3> | |
4189 | <p class="description">Add ranges of values to an IPP message.</p> | |
4190 | <p class="code"> | |
98d88c8d MS |
4191 | <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> |
4192 | <h4 class="parameters">Parameters</h4> | |
4193 | <table class="list"><tbody> | |
4194 | <tr><th>ipp</th> | |
4195 | <td class="description">IPP message</td></tr> | |
4196 | <tr><th>group</th> | |
4197 | <td class="description">IPP group</td></tr> | |
4198 | <tr><th>name</th> | |
4199 | <td class="description">Name of attribute</td></tr> | |
4200 | <tr><th>num_values</th> | |
4201 | <td class="description">Number of values</td></tr> | |
4202 | <tr><th>lower</th> | |
4203 | <td class="description">Lower values</td></tr> | |
4204 | <tr><th>upper</th> | |
4205 | <td class="description">Upper values</td></tr> | |
4206 | </tbody></table> | |
798d6e29 MS |
4207 | <h4 class="returnvalue">Return Value</h4> |
4208 | <p class="description">New attribute</p> | |
4209 | <h4 class="discussion">Discussion</h4> | |
4210 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4211 | 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> | |
4212 | <br> | |
4213 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4214 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4215 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4216 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4217 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p> | |
4218 | <h3 class="function"><a id="ippAddResolution">ippAddResolution</a></h3> | |
4219 | <p class="description">Add a resolution value to an IPP message.</p> | |
4220 | <p class="code"> | |
98d88c8d MS |
4221 | <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> |
4222 | <h4 class="parameters">Parameters</h4> | |
4223 | <table class="list"><tbody> | |
4224 | <tr><th>ipp</th> | |
4225 | <td class="description">IPP message</td></tr> | |
4226 | <tr><th>group</th> | |
4227 | <td class="description">IPP group</td></tr> | |
4228 | <tr><th>name</th> | |
4229 | <td class="description">Name of attribute</td></tr> | |
4230 | <tr><th>units</th> | |
4231 | <td class="description">Units for resolution</td></tr> | |
4232 | <tr><th>xres</th> | |
4233 | <td class="description">X resolution</td></tr> | |
4234 | <tr><th>yres</th> | |
4235 | <td class="description">Y resolution</td></tr> | |
4236 | </tbody></table> | |
798d6e29 MS |
4237 | <h4 class="returnvalue">Return Value</h4> |
4238 | <p class="description">New attribute</p> | |
4239 | <h4 class="discussion">Discussion</h4> | |
4240 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4241 | 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> | |
4242 | <br> | |
4243 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4244 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4245 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4246 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4247 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p> | |
4248 | <h3 class="function"><a id="ippAddResolutions">ippAddResolutions</a></h3> | |
4249 | <p class="description">Add resolution values to an IPP message.</p> | |
4250 | <p class="code"> | |
98d88c8d MS |
4251 | <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> |
4252 | <h4 class="parameters">Parameters</h4> | |
4253 | <table class="list"><tbody> | |
4254 | <tr><th>ipp</th> | |
4255 | <td class="description">IPP message</td></tr> | |
4256 | <tr><th>group</th> | |
4257 | <td class="description">IPP group</td></tr> | |
4258 | <tr><th>name</th> | |
4259 | <td class="description">Name of attribute</td></tr> | |
4260 | <tr><th>num_values</th> | |
4261 | <td class="description">Number of values</td></tr> | |
4262 | <tr><th>units</th> | |
4263 | <td class="description">Units for resolution</td></tr> | |
4264 | <tr><th>xres</th> | |
4265 | <td class="description">X resolutions</td></tr> | |
4266 | <tr><th>yres</th> | |
4267 | <td class="description">Y resolutions</td></tr> | |
4268 | </tbody></table> | |
798d6e29 MS |
4269 | <h4 class="returnvalue">Return Value</h4> |
4270 | <p class="description">New attribute</p> | |
4271 | <h4 class="discussion">Discussion</h4> | |
4272 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4273 | 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> | |
4274 | <br> | |
4275 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4276 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4277 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4278 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4279 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p> | |
4280 | <h3 class="function"><a id="ippAddSeparator">ippAddSeparator</a></h3> | |
4281 | <p class="description">Add a group separator to an IPP message.</p> | |
4282 | <p class="code"> | |
98d88c8d | 4283 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddSeparator(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 4284 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4285 | <table class="list"><tbody> |
4286 | <tr><th>ipp</th> | |
4287 | <td class="description">IPP message</td></tr> | |
4288 | </tbody></table> | |
798d6e29 MS |
4289 | <h4 class="returnvalue">Return Value</h4> |
4290 | <p class="description">New attribute</p> | |
4291 | <h4 class="discussion">Discussion</h4> | |
4292 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4293 | 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> | |
4294 | <h3 class="function"><a id="ippAddString">ippAddString</a></h3> | |
4295 | <p class="description">Add a language-encoded string to an IPP message.</p> | |
4296 | <p class="code"> | |
98d88c8d MS |
4297 | <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> |
4298 | <h4 class="parameters">Parameters</h4> | |
4299 | <table class="list"><tbody> | |
4300 | <tr><th>ipp</th> | |
4301 | <td class="description">IPP message</td></tr> | |
4302 | <tr><th>group</th> | |
4303 | <td class="description">IPP group</td></tr> | |
4304 | <tr><th>value_tag</th> | |
4305 | <td class="description">Type of attribute</td></tr> | |
4306 | <tr><th>name</th> | |
4307 | <td class="description">Name of attribute</td></tr> | |
4308 | <tr><th>language</th> | |
4309 | <td class="description">Language code</td></tr> | |
4310 | <tr><th>value</th> | |
4311 | <td class="description">Value</td></tr> | |
4312 | </tbody></table> | |
798d6e29 MS |
4313 | <h4 class="returnvalue">Return Value</h4> |
4314 | <p class="description">New attribute</p> | |
4315 | <h4 class="discussion">Discussion</h4> | |
4316 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4317 | 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> | |
4318 | <br> | |
4319 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4320 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4321 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4322 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4323 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> | |
4324 | <br> | |
4325 | Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword | |
4326 | (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType | |
4327 | (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage | |
4328 | (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage | |
4329 | (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme | |
4330 | (<code>IPP_TAG_URISCHEME</code>).<br> | |
4331 | <br> | |
4332 | The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and | |
4333 | textWithLanguage string values and must be <code>NULL</code> for all other string values.</p> | |
4334 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippAddStringf">ippAddStringf</a></h3> | |
4335 | <p class="description">Add a formatted string to an IPP message.</p> | |
4336 | <p class="code"> | |
98d88c8d MS |
4337 | <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> |
4338 | <h4 class="parameters">Parameters</h4> | |
4339 | <table class="list"><tbody> | |
4340 | <tr><th>ipp</th> | |
4341 | <td class="description">IPP message</td></tr> | |
4342 | <tr><th>group</th> | |
4343 | <td class="description">IPP group</td></tr> | |
4344 | <tr><th>value_tag</th> | |
4345 | <td class="description">Type of attribute</td></tr> | |
4346 | <tr><th>name</th> | |
4347 | <td class="description">Name of attribute</td></tr> | |
4348 | <tr><th>language</th> | |
4349 | <td class="description">Language code (<code>NULL</code> for default)</td></tr> | |
4350 | <tr><th>format</th> | |
4351 | <td class="description">Printf-style format string</td></tr> | |
4352 | <tr><th>...</th> | |
4353 | <td class="description">Additional arguments as needed</td></tr> | |
4354 | </tbody></table> | |
798d6e29 MS |
4355 | <h4 class="returnvalue">Return Value</h4> |
4356 | <p class="description">New attribute</p> | |
4357 | <h4 class="discussion">Discussion</h4> | |
4358 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4359 | 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> | |
4360 | <br> | |
4361 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4362 | (<code>IPP_TAG_ZERO</code>, for member attributes), document | |
4363 | (<code>IPP_TAG_DOCUMENT</code>), event notification | |
4364 | (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>), | |
4365 | printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>), | |
4366 | or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> | |
4367 | <br> | |
4368 | Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword | |
4369 | (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType | |
4370 | (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage | |
4371 | (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage | |
4372 | (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme | |
4373 | (<code>IPP_TAG_URISCHEME</code>).<br> | |
4374 | <br> | |
4375 | The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage | |
4376 | and textWithLanguage string values and must be <code>NULL</code> for all other | |
4377 | string values.<br> | |
4378 | <br> | |
4379 | The <code>format</code> parameter uses formatting characters compatible with the | |
4380 | printf family of standard functions. Additional arguments follow it as | |
4381 | needed. The formatted string is truncated as needed to the maximum length of | |
4382 | the corresponding value type. | |
4383 | ||
4384 | </p> | |
4385 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippAddStringfv">ippAddStringfv</a></h3> | |
4386 | <p class="description">Add a formatted string to an IPP message.</p> | |
4387 | <p class="code"> | |
98d88c8d MS |
4388 | <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> |
4389 | <h4 class="parameters">Parameters</h4> | |
4390 | <table class="list"><tbody> | |
4391 | <tr><th>ipp</th> | |
4392 | <td class="description">IPP message</td></tr> | |
4393 | <tr><th>group</th> | |
4394 | <td class="description">IPP group</td></tr> | |
4395 | <tr><th>value_tag</th> | |
4396 | <td class="description">Type of attribute</td></tr> | |
4397 | <tr><th>name</th> | |
4398 | <td class="description">Name of attribute</td></tr> | |
4399 | <tr><th>language</th> | |
4400 | <td class="description">Language code (<code>NULL</code> for default)</td></tr> | |
4401 | <tr><th>format</th> | |
4402 | <td class="description">Printf-style format string</td></tr> | |
4403 | <tr><th>ap</th> | |
4404 | <td class="description">Additional arguments</td></tr> | |
4405 | </tbody></table> | |
798d6e29 MS |
4406 | <h4 class="returnvalue">Return Value</h4> |
4407 | <p class="description">New attribute</p> | |
4408 | <h4 class="discussion">Discussion</h4> | |
4409 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4410 | 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> | |
4411 | <br> | |
4412 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4413 | (<code>IPP_TAG_ZERO</code>, for member attributes), document | |
4414 | (<code>IPP_TAG_DOCUMENT</code>), event notification | |
4415 | (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>), | |
4416 | printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>), | |
4417 | or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> | |
4418 | <br> | |
4419 | Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword | |
4420 | (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType | |
4421 | (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage | |
4422 | (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage | |
4423 | (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme | |
4424 | (<code>IPP_TAG_URISCHEME</code>).<br> | |
4425 | <br> | |
4426 | The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage | |
4427 | and textWithLanguage string values and must be <code>NULL</code> for all other | |
4428 | string values.<br> | |
4429 | <br> | |
4430 | The <code>format</code> parameter uses formatting characters compatible with the | |
4431 | printf family of standard functions. Additional arguments are passed in the | |
4432 | stdarg pointer <code>ap</code>. The formatted string is truncated as needed to the | |
4433 | maximum length of the corresponding value type. | |
4434 | ||
4435 | </p> | |
4436 | <h3 class="function"><a id="ippAddStrings">ippAddStrings</a></h3> | |
4437 | <p class="description">Add language-encoded strings to an IPP message.</p> | |
4438 | <p class="code"> | |
98d88c8d MS |
4439 | <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> |
4440 | <h4 class="parameters">Parameters</h4> | |
4441 | <table class="list"><tbody> | |
4442 | <tr><th>ipp</th> | |
4443 | <td class="description">IPP message</td></tr> | |
4444 | <tr><th>group</th> | |
4445 | <td class="description">IPP group</td></tr> | |
4446 | <tr><th>value_tag</th> | |
4447 | <td class="description">Type of attribute</td></tr> | |
4448 | <tr><th>name</th> | |
4449 | <td class="description">Name of attribute</td></tr> | |
4450 | <tr><th>num_values</th> | |
4451 | <td class="description">Number of values</td></tr> | |
4452 | <tr><th>language</th> | |
4453 | <td class="description">Language code (<code>NULL</code> for default)</td></tr> | |
4454 | <tr><th>values</th> | |
4455 | <td class="description">Values</td></tr> | |
4456 | </tbody></table> | |
798d6e29 MS |
4457 | <h4 class="returnvalue">Return Value</h4> |
4458 | <p class="description">New attribute</p> | |
4459 | <h4 class="discussion">Discussion</h4> | |
4460 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
4461 | 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> | |
4462 | <br> | |
4463 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
4464 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
4465 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
4466 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
4467 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> | |
4468 | <br> | |
4469 | Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword | |
4470 | (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType | |
4471 | (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage | |
4472 | (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage | |
4473 | (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme | |
4474 | (<code>IPP_TAG_URISCHEME</code>).<br> | |
4475 | <br> | |
4476 | The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and | |
4477 | textWithLanguage string values and must be <code>NULL</code> for all other string values.</p> | |
4478 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippAttributeString">ippAttributeString</a></h3> | |
4479 | <p class="description">Convert the attribute's value to a string.</p> | |
4480 | <p class="code"> | |
98d88c8d MS |
4481 | size_t ippAttributeString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, char *buffer, size_t bufsize);</p> |
4482 | <h4 class="parameters">Parameters</h4> | |
4483 | <table class="list"><tbody> | |
4484 | <tr><th>attr</th> | |
4485 | <td class="description">Attribute</td></tr> | |
4486 | <tr><th>buffer</th> | |
4487 | <td class="description">String buffer or NULL</td></tr> | |
4488 | <tr><th>bufsize</th> | |
4489 | <td class="description">Size of string buffer</td></tr> | |
4490 | </tbody></table> | |
798d6e29 MS |
4491 | <h4 class="returnvalue">Return Value</h4> |
4492 | <p class="description">Number of bytes less nul</p> | |
4493 | <h4 class="discussion">Discussion</h4> | |
4494 | <p class="discussion">Returns the number of bytes that would be written, not including the | |
4495 | trailing nul. The buffer pointer can be NULL to get the required length, | |
4496 | just like (v)snprintf. | |
4497 | ||
4498 | </p> | |
4499 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippContainsInteger">ippContainsInteger</a></h3> | |
4500 | <p class="description">Determine whether an attribute contains the | |
4501 | specified value or is within the list of ranges.</p> | |
4502 | <p class="code"> | |
98d88c8d | 4503 | int ippContainsInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int value);</p> |
798d6e29 | 4504 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4505 | <table class="list"><tbody> |
4506 | <tr><th>attr</th> | |
4507 | <td class="description">Attribute</td></tr> | |
4508 | <tr><th>value</th> | |
4509 | <td class="description">Integer/enum value</td></tr> | |
4510 | </tbody></table> | |
798d6e29 MS |
4511 | <h4 class="returnvalue">Return Value</h4> |
4512 | <p class="description">1 on a match, 0 on no match</p> | |
4513 | <h4 class="discussion">Discussion</h4> | |
4514 | <p class="discussion">Returns non-zero when the attribute contains either a matching integer or | |
4515 | enum value, or the value falls within one of the rangeOfInteger values for | |
4516 | the attribute. | |
4517 | ||
4518 | </p> | |
4519 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippContainsString">ippContainsString</a></h3> | |
4520 | <p class="description">Determine whether an attribute contains the | |
4521 | specified string value.</p> | |
4522 | <p class="code"> | |
98d88c8d | 4523 | int ippContainsString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, const char *value);</p> |
798d6e29 | 4524 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4525 | <table class="list"><tbody> |
4526 | <tr><th>attr</th> | |
4527 | <td class="description">Attribute</td></tr> | |
4528 | <tr><th>value</th> | |
4529 | <td class="description">String value</td></tr> | |
4530 | </tbody></table> | |
798d6e29 MS |
4531 | <h4 class="returnvalue">Return Value</h4> |
4532 | <p class="description">1 on a match, 0 on no match</p> | |
4533 | <h4 class="discussion">Discussion</h4> | |
4534 | <p class="discussion">Returns non-zero when the attribute contains a matching charset, keyword, | |
65bebeac | 4535 | naturalLanguage, mimeMediaType, name, text, uri, or uriScheme value. |
798d6e29 MS |
4536 | |
4537 | </p> | |
4538 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippCopyAttribute">ippCopyAttribute</a></h3> | |
4539 | <p class="description">Copy an attribute.</p> | |
4540 | <p class="code"> | |
98d88c8d MS |
4541 | <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> |
4542 | <h4 class="parameters">Parameters</h4> | |
4543 | <table class="list"><tbody> | |
4544 | <tr><th>dst</th> | |
4545 | <td class="description">Destination IPP message</td></tr> | |
4546 | <tr><th>srcattr</th> | |
4547 | <td class="description">Attribute to copy</td></tr> | |
4548 | <tr><th>quickcopy</th> | |
4549 | <td class="description">1 for a referenced copy, 0 for normal</td></tr> | |
4550 | </tbody></table> | |
798d6e29 MS |
4551 | <h4 class="returnvalue">Return Value</h4> |
4552 | <p class="description">New attribute</p> | |
4553 | <h4 class="discussion">Discussion</h4> | |
4554 | <p class="discussion">The specified attribute, <code>attr</code>, is copied to the destination IPP message. | |
4555 | When <code>quickcopy</code> is non-zero, a "shallow" reference copy of the attribute is | |
4556 | created - this should only be done as long as the original source IPP message will | |
4557 | not be freed for the life of the destination. | |
4558 | ||
4559 | </p> | |
4560 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippCopyAttributes">ippCopyAttributes</a></h3> | |
4561 | <p class="description">Copy attributes from one IPP message to another.</p> | |
4562 | <p class="code"> | |
98d88c8d MS |
4563 | 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> |
4564 | <h4 class="parameters">Parameters</h4> | |
4565 | <table class="list"><tbody> | |
4566 | <tr><th>dst</th> | |
4567 | <td class="description">Destination IPP message</td></tr> | |
4568 | <tr><th>src</th> | |
4569 | <td class="description">Source IPP message</td></tr> | |
4570 | <tr><th>quickcopy</th> | |
4571 | <td class="description">1 for a referenced copy, 0 for normal</td></tr> | |
4572 | <tr><th>cb</th> | |
4573 | <td class="description">Copy callback or <code>NULL</code> for none</td></tr> | |
4574 | <tr><th>context</th> | |
4575 | <td class="description">Context pointer</td></tr> | |
4576 | </tbody></table> | |
798d6e29 MS |
4577 | <h4 class="returnvalue">Return Value</h4> |
4578 | <p class="description">1 on success, 0 on error</p> | |
4579 | <h4 class="discussion">Discussion</h4> | |
4580 | <p class="discussion">Zero or more attributes are copied from the source IPP message, <code>src</code>, to the | |
4581 | destination IPP message, <code>dst</code>. When <code>quickcopy</code> is non-zero, a "shallow" | |
4582 | reference copy of the attribute is created - this should only be done as long as the | |
4583 | original source IPP message will not be freed for the life of the destination.<br> | |
4584 | <br> | |
4585 | The <code>cb</code> and <code>context</code> parameters provide a generic way to "filter" the | |
4586 | attributes that are copied - the function must return 1 to copy the attribute or | |
4587 | 0 to skip it. The function may also choose to do a partial copy of the source attribute | |
4588 | itself. | |
4589 | ||
4590 | </p> | |
4591 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippCreateRequestedArray">ippCreateRequestedArray</a></h3> | |
4592 | <p class="description">Create a CUPS array of attribute names from the | |
4593 | given requested-attributes attribute.</p> | |
4594 | <p class="code"> | |
98d88c8d | 4595 | cups_array_t *ippCreateRequestedArray(<a href="#ipp_t">ipp_t</a> *request);</p> |
798d6e29 | 4596 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4597 | <table class="list"><tbody> |
4598 | <tr><th>request</th> | |
4599 | <td class="description">IPP request</td></tr> | |
4600 | </tbody></table> | |
798d6e29 MS |
4601 | <h4 class="returnvalue">Return Value</h4> |
4602 | <p class="description">CUPS array or <code>NULL</code> if all</p> | |
4603 | <h4 class="discussion">Discussion</h4> | |
4604 | <p class="discussion">This function creates a (sorted) CUPS array of attribute names matching the | |
4605 | list of "requested-attribute" values supplied in an IPP request. All IANA- | |
4606 | registered values are supported in addition to the CUPS IPP extension | |
4607 | attributes.<br> | |
4608 | <br> | |
4609 | The <code>request</code> parameter specifies the request message that was read from | |
4610 | the client. | |
4611 | ||
4612 | <code>NULL</code> is returned if all attributes should be returned. Otherwise, the | |
4613 | result is a sorted array of attribute names, where <code>cupsArrayFind(array, | |
4614 | "attribute-name")</code> will return a non-NULL pointer. The array must be freed | |
4615 | using the <code>cupsArrayDelete</code> function. | |
4616 | ||
4617 | </p> | |
4618 | <h3 class="function"><a id="ippDateToTime">ippDateToTime</a></h3> | |
65bebeac MS |
4619 | <p class="description">Convert from RFC 2579 Date/Time format to time in |
4620 | seconds.</p> | |
798d6e29 | 4621 | <p class="code"> |
98d88c8d | 4622 | time_t ippDateToTime(const <a href="#ipp_uchar_t">ipp_uchar_t</a> *date);</p> |
798d6e29 | 4623 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4624 | <table class="list"><tbody> |
4625 | <tr><th>date</th> | |
65bebeac | 4626 | <td class="description">RFC 2579 date info</td></tr> |
98d88c8d | 4627 | </tbody></table> |
798d6e29 MS |
4628 | <h4 class="returnvalue">Return Value</h4> |
4629 | <p class="description">UNIX time value</p> | |
4630 | <h3 class="function"><a id="ippDelete">ippDelete</a></h3> | |
98d88c8d | 4631 | <p class="description">Delete an IPP message.</p> |
798d6e29 | 4632 | <p class="code"> |
98d88c8d | 4633 | void ippDelete(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 4634 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4635 | <table class="list"><tbody> |
4636 | <tr><th>ipp</th> | |
4637 | <td class="description">IPP message</td></tr> | |
4638 | </tbody></table> | |
4639 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippDeleteAttribute">ippDeleteAttribute</a></h3> | |
53af7f21 | 4640 | <p class="description">Delete a single attribute in an IPP message.</p> |
98d88c8d MS |
4641 | <p class="code"> |
4642 | void ippDeleteAttribute(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> | |
4643 | <h4 class="parameters">Parameters</h4> | |
4644 | <table class="list"><tbody> | |
4645 | <tr><th>ipp</th> | |
4646 | <td class="description">IPP message</td></tr> | |
4647 | <tr><th>attr</th> | |
4648 | <td class="description">Attribute to delete</td></tr> | |
4649 | </tbody></table> | |
798d6e29 MS |
4650 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippDeleteValues">ippDeleteValues</a></h3> |
4651 | <p class="description">Delete values in an attribute.</p> | |
4652 | <p class="code"> | |
98d88c8d MS |
4653 | 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> |
4654 | <h4 class="parameters">Parameters</h4> | |
4655 | <table class="list"><tbody> | |
4656 | <tr><th>ipp</th> | |
4657 | <td class="description">IPP message</td></tr> | |
4658 | <tr><th>attr</th> | |
4659 | <td class="description">Attribute</td></tr> | |
4660 | <tr><th>element</th> | |
4661 | <td class="description">Index of first value to delete (0-based)</td></tr> | |
4662 | <tr><th>count</th> | |
4663 | <td class="description">Number of values to delete</td></tr> | |
4664 | </tbody></table> | |
798d6e29 MS |
4665 | <h4 class="returnvalue">Return Value</h4> |
4666 | <p class="description">1 on success, 0 on failure</p> | |
4667 | <h4 class="discussion">Discussion</h4> | |
4668 | <p class="discussion">The <code>element</code> parameter specifies the first value to delete, starting at | |
4669 | 0. It must be less than the number of values returned by <a href="#ippGetCount"><code>ippGetCount</code></a>.<br> | |
4670 | <br> | |
4671 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
4672 | <br> | |
4673 | Deleting all values in an attribute deletes the attribute. | |
4674 | ||
4675 | </p> | |
4676 | <h3 class="function"><a id="ippEnumString">ippEnumString</a></h3> | |
4677 | <p class="description">Return a string corresponding to the enum value.</p> | |
4678 | <p class="code"> | |
98d88c8d | 4679 | const char *ippEnumString(const char *attrname, int enumvalue);</p> |
798d6e29 | 4680 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4681 | <table class="list"><tbody> |
4682 | <tr><th>attrname</th> | |
4683 | <td class="description">Attribute name</td></tr> | |
4684 | <tr><th>enumvalue</th> | |
4685 | <td class="description">Enum value</td></tr> | |
4686 | </tbody></table> | |
798d6e29 MS |
4687 | <h4 class="returnvalue">Return Value</h4> |
4688 | <p class="description">Enum string</p> | |
4689 | <h3 class="function"><a id="ippEnumValue">ippEnumValue</a></h3> | |
4690 | <p class="description">Return the value associated with a given enum string.</p> | |
4691 | <p class="code"> | |
98d88c8d | 4692 | int ippEnumValue(const char *attrname, const char *enumstring);</p> |
798d6e29 | 4693 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4694 | <table class="list"><tbody> |
4695 | <tr><th>attrname</th> | |
4696 | <td class="description">Attribute name</td></tr> | |
4697 | <tr><th>enumstring</th> | |
4698 | <td class="description">Enum string</td></tr> | |
4699 | </tbody></table> | |
798d6e29 MS |
4700 | <h4 class="returnvalue">Return Value</h4> |
4701 | <p class="description">Enum value or -1 if unknown</p> | |
4702 | <h3 class="function"><a id="ippErrorString">ippErrorString</a></h3> | |
4703 | <p class="description">Return a name for the given status code.</p> | |
4704 | <p class="code"> | |
98d88c8d | 4705 | const char *ippErrorString(ipp_status_t error);</p> |
798d6e29 | 4706 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4707 | <table class="list"><tbody> |
4708 | <tr><th>error</th> | |
4709 | <td class="description">Error status</td></tr> | |
4710 | </tbody></table> | |
798d6e29 MS |
4711 | <h4 class="returnvalue">Return Value</h4> |
4712 | <p class="description">Text string</p> | |
4713 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippErrorValue">ippErrorValue</a></h3> | |
4714 | <p class="description">Return a status code for the given name.</p> | |
4715 | <p class="code"> | |
98d88c8d | 4716 | ipp_status_t ippErrorValue(const char *name);</p> |
798d6e29 | 4717 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4718 | <table class="list"><tbody> |
4719 | <tr><th>name</th> | |
4720 | <td class="description">Name</td></tr> | |
4721 | </tbody></table> | |
798d6e29 MS |
4722 | <h4 class="returnvalue">Return Value</h4> |
4723 | <p class="description">IPP status code</p> | |
4724 | <h3 class="function"><a id="ippFindAttribute">ippFindAttribute</a></h3> | |
4725 | <p class="description">Find a named attribute in a request.</p> | |
4726 | <p class="code"> | |
98d88c8d MS |
4727 | <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> |
4728 | <h4 class="parameters">Parameters</h4> | |
4729 | <table class="list"><tbody> | |
4730 | <tr><th>ipp</th> | |
4731 | <td class="description">IPP message</td></tr> | |
4732 | <tr><th>name</th> | |
4733 | <td class="description">Name of attribute</td></tr> | |
4734 | <tr><th>type</th> | |
4735 | <td class="description">Type of attribute</td></tr> | |
4736 | </tbody></table> | |
798d6e29 MS |
4737 | <h4 class="returnvalue">Return Value</h4> |
4738 | <p class="description">Matching attribute</p> | |
4739 | <h4 class="discussion">Discussion</h4> | |
4740 | <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list | |
4741 | of attribute and member names separated by slashes, for example | |
4742 | "media-col/media-size".</p> | |
4743 | <h3 class="function"><a id="ippFindNextAttribute">ippFindNextAttribute</a></h3> | |
4744 | <p class="description">Find the next named attribute in a request.</p> | |
4745 | <p class="code"> | |
98d88c8d MS |
4746 | <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> |
4747 | <h4 class="parameters">Parameters</h4> | |
4748 | <table class="list"><tbody> | |
4749 | <tr><th>ipp</th> | |
4750 | <td class="description">IPP message</td></tr> | |
4751 | <tr><th>name</th> | |
4752 | <td class="description">Name of attribute</td></tr> | |
4753 | <tr><th>type</th> | |
4754 | <td class="description">Type of attribute</td></tr> | |
4755 | </tbody></table> | |
798d6e29 MS |
4756 | <h4 class="returnvalue">Return Value</h4> |
4757 | <p class="description">Matching attribute</p> | |
4758 | <h4 class="discussion">Discussion</h4> | |
4759 | <p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list | |
4760 | of attribute and member names separated by slashes, for example | |
4761 | "media-col/media-size".</p> | |
4762 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippFirstAttribute">ippFirstAttribute</a></h3> | |
4763 | <p class="description">Return the first attribute in the message.</p> | |
4764 | <p class="code"> | |
98d88c8d | 4765 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFirstAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 4766 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4767 | <table class="list"><tbody> |
4768 | <tr><th>ipp</th> | |
4769 | <td class="description">IPP message</td></tr> | |
4770 | </tbody></table> | |
798d6e29 MS |
4771 | <h4 class="returnvalue">Return Value</h4> |
4772 | <p class="description">First attribute or <code>NULL</code> if none</p> | |
4773 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetBoolean">ippGetBoolean</a></h3> | |
4774 | <p class="description">Get a boolean value for an attribute.</p> | |
4775 | <p class="code"> | |
98d88c8d | 4776 | int ippGetBoolean(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p> |
798d6e29 | 4777 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4778 | <table class="list"><tbody> |
4779 | <tr><th>attr</th> | |
4780 | <td class="description">IPP attribute</td></tr> | |
4781 | <tr><th>element</th> | |
4782 | <td class="description">Value number (0-based)</td></tr> | |
4783 | </tbody></table> | |
798d6e29 MS |
4784 | <h4 class="returnvalue">Return Value</h4> |
4785 | <p class="description">Boolean value or 0 on error</p> | |
4786 | <h4 class="discussion">Discussion</h4> | |
4787 | <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to | |
65bebeac | 4788 | <code>ippGetCount(attr)</code> - 1. |
798d6e29 MS |
4789 | |
4790 | </p> | |
4791 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetCollection">ippGetCollection</a></h3> | |
4792 | <p class="description">Get a collection value for an attribute.</p> | |
4793 | <p class="code"> | |
98d88c8d | 4794 | <a href="#ipp_t">ipp_t</a> *ippGetCollection(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p> |
798d6e29 | 4795 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4796 | <table class="list"><tbody> |
4797 | <tr><th>attr</th> | |
4798 | <td class="description">IPP attribute</td></tr> | |
4799 | <tr><th>element</th> | |
4800 | <td class="description">Value number (0-based)</td></tr> | |
4801 | </tbody></table> | |
798d6e29 MS |
4802 | <h4 class="returnvalue">Return Value</h4> |
4803 | <p class="description">Collection value or <code>NULL</code> on error</p> | |
4804 | <h4 class="discussion">Discussion</h4> | |
4805 | <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to | |
65bebeac | 4806 | <code>ippGetCount(attr)</code> - 1. |
798d6e29 MS |
4807 | |
4808 | </p> | |
4809 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetCount">ippGetCount</a></h3> | |
4810 | <p class="description">Get the number of values in an attribute.</p> | |
4811 | <p class="code"> | |
98d88c8d | 4812 | int ippGetCount(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> |
798d6e29 | 4813 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4814 | <table class="list"><tbody> |
4815 | <tr><th>attr</th> | |
4816 | <td class="description">IPP attribute</td></tr> | |
4817 | </tbody></table> | |
798d6e29 MS |
4818 | <h4 class="returnvalue">Return Value</h4> |
4819 | <p class="description">Number of values or 0 on error</p> | |
4820 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetDate">ippGetDate</a></h3> | |
65bebeac | 4821 | <p class="description">Get a dateTime value for an attribute.</p> |
798d6e29 | 4822 | <p class="code"> |
98d88c8d | 4823 | 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 | 4824 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4825 | <table class="list"><tbody> |
4826 | <tr><th>attr</th> | |
4827 | <td class="description">IPP attribute</td></tr> | |
4828 | <tr><th>element</th> | |
4829 | <td class="description">Value number (0-based)</td></tr> | |
4830 | </tbody></table> | |
798d6e29 | 4831 | <h4 class="returnvalue">Return Value</h4> |
65bebeac | 4832 | <p class="description">dateTime value or <code>NULL</code></p> |
798d6e29 MS |
4833 | <h4 class="discussion">Discussion</h4> |
4834 | <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to | |
65bebeac | 4835 | <code>ippGetCount(attr)</code> - 1. |
798d6e29 MS |
4836 | |
4837 | </p> | |
4838 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetGroupTag">ippGetGroupTag</a></h3> | |
4839 | <p class="description">Get the group associated with an attribute.</p> | |
4840 | <p class="code"> | |
98d88c8d | 4841 | ipp_tag_t ippGetGroupTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> |
798d6e29 | 4842 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4843 | <table class="list"><tbody> |
4844 | <tr><th>attr</th> | |
4845 | <td class="description">IPP attribute</td></tr> | |
4846 | </tbody></table> | |
798d6e29 MS |
4847 | <h4 class="returnvalue">Return Value</h4> |
4848 | <p class="description">Group tag or <code>IPP_TAG_ZERO</code> on error</p> | |
4849 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetInteger">ippGetInteger</a></h3> | |
4850 | <p class="description">Get the integer/enum value for an attribute.</p> | |
4851 | <p class="code"> | |
98d88c8d | 4852 | int ippGetInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p> |
798d6e29 | 4853 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4854 | <table class="list"><tbody> |
4855 | <tr><th>attr</th> | |
4856 | <td class="description">IPP attribute</td></tr> | |
4857 | <tr><th>element</th> | |
4858 | <td class="description">Value number (0-based)</td></tr> | |
4859 | </tbody></table> | |
798d6e29 MS |
4860 | <h4 class="returnvalue">Return Value</h4> |
4861 | <p class="description">Value or 0 on error</p> | |
4862 | <h4 class="discussion">Discussion</h4> | |
4863 | <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to | |
65bebeac | 4864 | <code>ippGetCount(attr)</code> - 1. |
798d6e29 MS |
4865 | |
4866 | </p> | |
4867 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetName">ippGetName</a></h3> | |
4868 | <p class="description">Get the attribute name.</p> | |
4869 | <p class="code"> | |
98d88c8d | 4870 | const char *ippGetName(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> |
798d6e29 | 4871 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4872 | <table class="list"><tbody> |
4873 | <tr><th>attr</th> | |
4874 | <td class="description">IPP attribute</td></tr> | |
4875 | </tbody></table> | |
798d6e29 MS |
4876 | <h4 class="returnvalue">Return Value</h4> |
4877 | <p class="description">Attribute name or <code>NULL</code> for separators</p> | |
4878 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippGetOctetString">ippGetOctetString</a></h3> | |
4879 | <p class="description">Get an octetString value from an IPP attribute.</p> | |
4880 | <p class="code"> | |
98d88c8d MS |
4881 | void *ippGetOctetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *datalen);</p> |
4882 | <h4 class="parameters">Parameters</h4> | |
4883 | <table class="list"><tbody> | |
4884 | <tr><th>attr</th> | |
4885 | <td class="description">IPP attribute</td></tr> | |
4886 | <tr><th>element</th> | |
4887 | <td class="description">Value number (0-based)</td></tr> | |
4888 | <tr><th>datalen</th> | |
4889 | <td class="description">Length of octetString data</td></tr> | |
4890 | </tbody></table> | |
798d6e29 MS |
4891 | <h4 class="returnvalue">Return Value</h4> |
4892 | <p class="description">Pointer to octetString data</p> | |
4893 | <h4 class="discussion">Discussion</h4> | |
4894 | <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to | |
65bebeac | 4895 | <code>ippGetCount(attr)</code> - 1. |
798d6e29 MS |
4896 | |
4897 | </p> | |
4898 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetOperation">ippGetOperation</a></h3> | |
4899 | <p class="description">Get the operation ID in an IPP message.</p> | |
4900 | <p class="code"> | |
98d88c8d | 4901 | ipp_op_t ippGetOperation(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 4902 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4903 | <table class="list"><tbody> |
4904 | <tr><th>ipp</th> | |
4905 | <td class="description">IPP request message</td></tr> | |
4906 | </tbody></table> | |
798d6e29 MS |
4907 | <h4 class="returnvalue">Return Value</h4> |
4908 | <p class="description">Operation ID or 0 on error</p> | |
4909 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetRange">ippGetRange</a></h3> | |
4910 | <p class="description">Get a rangeOfInteger value from an attribute.</p> | |
4911 | <p class="code"> | |
98d88c8d MS |
4912 | int ippGetRange(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *uppervalue);</p> |
4913 | <h4 class="parameters">Parameters</h4> | |
4914 | <table class="list"><tbody> | |
4915 | <tr><th>attr</th> | |
4916 | <td class="description">IPP attribute</td></tr> | |
4917 | <tr><th>element</th> | |
4918 | <td class="description">Value number (0-based)</td></tr> | |
4919 | <tr><th>uppervalue</th> | |
4920 | <td class="description">Upper value of range</td></tr> | |
4921 | </tbody></table> | |
798d6e29 MS |
4922 | <h4 class="returnvalue">Return Value</h4> |
4923 | <p class="description">Lower value of range or 0</p> | |
4924 | <h4 class="discussion">Discussion</h4> | |
4925 | <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to | |
65bebeac | 4926 | <code>ippGetCount(attr)</code> - 1. |
798d6e29 MS |
4927 | |
4928 | </p> | |
4929 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetRequestId">ippGetRequestId</a></h3> | |
4930 | <p class="description">Get the request ID from an IPP message.</p> | |
4931 | <p class="code"> | |
98d88c8d | 4932 | int ippGetRequestId(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 4933 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4934 | <table class="list"><tbody> |
4935 | <tr><th>ipp</th> | |
4936 | <td class="description">IPP message</td></tr> | |
4937 | </tbody></table> | |
798d6e29 MS |
4938 | <h4 class="returnvalue">Return Value</h4> |
4939 | <p class="description">Request ID or 0 on error</p> | |
4940 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetResolution">ippGetResolution</a></h3> | |
4941 | <p class="description">Get a resolution value for an attribute.</p> | |
4942 | <p class="code"> | |
98d88c8d MS |
4943 | 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> |
4944 | <h4 class="parameters">Parameters</h4> | |
4945 | <table class="list"><tbody> | |
4946 | <tr><th>attr</th> | |
4947 | <td class="description">IPP attribute</td></tr> | |
4948 | <tr><th>element</th> | |
4949 | <td class="description">Value number (0-based)</td></tr> | |
4950 | <tr><th>yres</th> | |
4951 | <td class="description">Vertical/feed resolution</td></tr> | |
4952 | <tr><th>units</th> | |
4953 | <td class="description">Units for resolution</td></tr> | |
4954 | </tbody></table> | |
798d6e29 MS |
4955 | <h4 class="returnvalue">Return Value</h4> |
4956 | <p class="description">Horizontal/cross feed resolution or 0</p> | |
4957 | <h4 class="discussion">Discussion</h4> | |
4958 | <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to | |
65bebeac | 4959 | <code>ippGetCount(attr)</code> - 1. |
798d6e29 MS |
4960 | |
4961 | </p> | |
4962 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetState">ippGetState</a></h3> | |
4963 | <p class="description">Get the IPP message state.</p> | |
4964 | <p class="code"> | |
98d88c8d | 4965 | <a href="#ipp_state_t">ipp_state_t</a> ippGetState(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 4966 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4967 | <table class="list"><tbody> |
4968 | <tr><th>ipp</th> | |
4969 | <td class="description">IPP message</td></tr> | |
4970 | </tbody></table> | |
798d6e29 MS |
4971 | <h4 class="returnvalue">Return Value</h4> |
4972 | <p class="description">IPP message state value</p> | |
4973 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetStatusCode">ippGetStatusCode</a></h3> | |
4974 | <p class="description">Get the status code from an IPP response or event message.</p> | |
4975 | <p class="code"> | |
98d88c8d | 4976 | ipp_status_t ippGetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 4977 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
4978 | <table class="list"><tbody> |
4979 | <tr><th>ipp</th> | |
4980 | <td class="description">IPP response or event message</td></tr> | |
4981 | </tbody></table> | |
798d6e29 MS |
4982 | <h4 class="returnvalue">Return Value</h4> |
4983 | <p class="description">Status code in IPP message</p> | |
4984 | <h3 class="function"><a id="ippGetString">ippGetString</a></h3> | |
98d88c8d MS |
4985 | <p class="description"></p> |
4986 | <p class="code"> | |
4987 | const char *ippGetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, const char **language);</p> | |
4988 | <h4 class="parameters">Parameters</h4> | |
4989 | <table class="list"><tbody> | |
4990 | <tr><th>attr</th> | |
4991 | <td class="description">IPP attribute</td></tr> | |
4992 | <tr><th>element</th> | |
4993 | <td class="description">Value number (0-based)</td></tr> | |
4994 | <tr><th>language</th> | |
4995 | <td class="description">Language code (<code>NULL</code> for don't care)</td></tr> | |
4996 | </tbody></table> | |
798d6e29 MS |
4997 | <h4 class="returnvalue">Return Value</h4> |
4998 | <p class="description">Get the string and optionally the language code for an attribute.</p> | |
4999 | <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to | |
65bebeac | 5000 | <code>ippGetCount(attr)</code> - 1. |
798d6e29 MS |
5001 | |
5002 | </p> | |
5003 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetValueTag">ippGetValueTag</a></h3> | |
5004 | <p class="description">Get the value tag for an attribute.</p> | |
5005 | <p class="code"> | |
98d88c8d | 5006 | ipp_tag_t ippGetValueTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> |
798d6e29 | 5007 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5008 | <table class="list"><tbody> |
5009 | <tr><th>attr</th> | |
5010 | <td class="description">IPP attribute</td></tr> | |
5011 | </tbody></table> | |
798d6e29 MS |
5012 | <h4 class="returnvalue">Return Value</h4> |
5013 | <p class="description">Value tag or <code>IPP_TAG_ZERO</code> on error</p> | |
5014 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetVersion">ippGetVersion</a></h3> | |
5015 | <p class="description">Get the major and minor version number from an IPP message.</p> | |
5016 | <p class="code"> | |
98d88c8d | 5017 | int ippGetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int *minor);</p> |
798d6e29 | 5018 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5019 | <table class="list"><tbody> |
5020 | <tr><th>ipp</th> | |
5021 | <td class="description">IPP message</td></tr> | |
5022 | <tr><th>minor</th> | |
65bebeac | 5023 | <td class="description">Minor version number or <code>NULL</code> for don't care</td></tr> |
98d88c8d | 5024 | </tbody></table> |
798d6e29 MS |
5025 | <h4 class="returnvalue">Return Value</h4> |
5026 | <p class="description">Major version number or 0 on error</p> | |
5027 | <h3 class="function"><a id="ippLength">ippLength</a></h3> | |
5028 | <p class="description">Compute the length of an IPP message.</p> | |
5029 | <p class="code"> | |
98d88c8d | 5030 | size_t ippLength(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 5031 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5032 | <table class="list"><tbody> |
5033 | <tr><th>ipp</th> | |
5034 | <td class="description">IPP message</td></tr> | |
5035 | </tbody></table> | |
798d6e29 MS |
5036 | <h4 class="returnvalue">Return Value</h4> |
5037 | <p class="description">Size of IPP message</p> | |
5038 | <h3 class="function"><a id="ippNew">ippNew</a></h3> | |
5039 | <p class="description">Allocate a new IPP message.</p> | |
5040 | <p class="code"> | |
98d88c8d | 5041 | <a href="#ipp_t">ipp_t</a> *ippNew(void);</p> |
798d6e29 MS |
5042 | <h4 class="returnvalue">Return Value</h4> |
5043 | <p class="description">New IPP message</p> | |
5044 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippNewRequest">ippNewRequest</a></h3> | |
5045 | <p class="description">Allocate a new IPP request message.</p> | |
5046 | <p class="code"> | |
98d88c8d | 5047 | <a href="#ipp_t">ipp_t</a> *ippNewRequest(ipp_op_t op);</p> |
798d6e29 | 5048 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5049 | <table class="list"><tbody> |
5050 | <tr><th>op</th> | |
5051 | <td class="description">Operation code</td></tr> | |
5052 | </tbody></table> | |
798d6e29 MS |
5053 | <h4 class="returnvalue">Return Value</h4> |
5054 | <p class="description">IPP request message</p> | |
5055 | <h4 class="discussion">Discussion</h4> | |
65bebeac MS |
5056 | <p class="discussion">The new request message is initialized with the "attributes-charset" and |
5057 | "attributes-natural-language" attributes added. The | |
5058 | "attributes-natural-language" value is derived from the current locale. | |
798d6e29 MS |
5059 | |
5060 | </p> | |
5061 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippNewResponse">ippNewResponse</a></h3> | |
5062 | <p class="description">Allocate a new IPP response message.</p> | |
5063 | <p class="code"> | |
98d88c8d | 5064 | <a href="#ipp_t">ipp_t</a> *ippNewResponse(<a href="#ipp_t">ipp_t</a> *request);</p> |
798d6e29 | 5065 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5066 | <table class="list"><tbody> |
5067 | <tr><th>request</th> | |
5068 | <td class="description">IPP request message</td></tr> | |
5069 | </tbody></table> | |
798d6e29 MS |
5070 | <h4 class="returnvalue">Return Value</h4> |
5071 | <p class="description">IPP response message</p> | |
5072 | <h4 class="discussion">Discussion</h4> | |
65bebeac MS |
5073 | <p class="discussion">The new response message is initialized with the same "version-number", |
5074 | "request-id", "attributes-charset", and "attributes-natural-language" as the | |
5075 | provided request message. If the "attributes-charset" or | |
5076 | "attributes-natural-language" attributes are missing from the request, | |
5077 | 'utf-8' and a value derived from the current locale are substituted, | |
798d6e29 MS |
5078 | respectively. |
5079 | ||
5080 | </p> | |
5081 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippNextAttribute">ippNextAttribute</a></h3> | |
5082 | <p class="description">Return the next attribute in the message.</p> | |
5083 | <p class="code"> | |
98d88c8d | 5084 | <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippNextAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 5085 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5086 | <table class="list"><tbody> |
5087 | <tr><th>ipp</th> | |
5088 | <td class="description">IPP message</td></tr> | |
5089 | </tbody></table> | |
798d6e29 MS |
5090 | <h4 class="returnvalue">Return Value</h4> |
5091 | <p class="description">Next attribute or <code>NULL</code> if none</p> | |
5092 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippOpString">ippOpString</a></h3> | |
5093 | <p class="description">Return a name for the given operation id.</p> | |
5094 | <p class="code"> | |
98d88c8d | 5095 | const char *ippOpString(ipp_op_t op);</p> |
798d6e29 | 5096 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5097 | <table class="list"><tbody> |
5098 | <tr><th>op</th> | |
5099 | <td class="description">Operation ID</td></tr> | |
5100 | </tbody></table> | |
798d6e29 MS |
5101 | <h4 class="returnvalue">Return Value</h4> |
5102 | <p class="description">Name</p> | |
5103 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippOpValue">ippOpValue</a></h3> | |
5104 | <p class="description">Return an operation id for the given name.</p> | |
5105 | <p class="code"> | |
98d88c8d | 5106 | ipp_op_t ippOpValue(const char *name);</p> |
798d6e29 | 5107 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5108 | <table class="list"><tbody> |
5109 | <tr><th>name</th> | |
5110 | <td class="description">Textual name</td></tr> | |
5111 | </tbody></table> | |
798d6e29 MS |
5112 | <h4 class="returnvalue">Return Value</h4> |
5113 | <p class="description">Operation ID</p> | |
5114 | <h3 class="function"><a id="ippPort">ippPort</a></h3> | |
5115 | <p class="description">Return the default IPP port number.</p> | |
5116 | <p class="code"> | |
98d88c8d | 5117 | int ippPort(void);</p> |
798d6e29 MS |
5118 | <h4 class="returnvalue">Return Value</h4> |
5119 | <p class="description">Port number</p> | |
5120 | <h3 class="function"><a id="ippRead">ippRead</a></h3> | |
5121 | <p class="description">Read data for an IPP message from a HTTP connection.</p> | |
5122 | <p class="code"> | |
98d88c8d | 5123 | <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 | 5124 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5125 | <table class="list"><tbody> |
5126 | <tr><th>http</th> | |
5127 | <td class="description">HTTP connection</td></tr> | |
5128 | <tr><th>ipp</th> | |
5129 | <td class="description">IPP data</td></tr> | |
5130 | </tbody></table> | |
798d6e29 MS |
5131 | <h4 class="returnvalue">Return Value</h4> |
5132 | <p class="description">Current state</p> | |
5133 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippReadFile">ippReadFile</a></h3> | |
5134 | <p class="description">Read data for an IPP message from a file.</p> | |
5135 | <p class="code"> | |
98d88c8d | 5136 | <a href="#ipp_state_t">ipp_state_t</a> ippReadFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 5137 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5138 | <table class="list"><tbody> |
5139 | <tr><th>fd</th> | |
5140 | <td class="description">HTTP data</td></tr> | |
5141 | <tr><th>ipp</th> | |
5142 | <td class="description">IPP data</td></tr> | |
5143 | </tbody></table> | |
798d6e29 MS |
5144 | <h4 class="returnvalue">Return Value</h4> |
5145 | <p class="description">Current state</p> | |
5146 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippReadIO">ippReadIO</a></h3> | |
5147 | <p class="description">Read data for an IPP message.</p> | |
5148 | <p class="code"> | |
98d88c8d MS |
5149 | <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> |
5150 | <h4 class="parameters">Parameters</h4> | |
5151 | <table class="list"><tbody> | |
5152 | <tr><th>src</th> | |
5153 | <td class="description">Data source</td></tr> | |
5154 | <tr><th>cb</th> | |
5155 | <td class="description">Read callback function</td></tr> | |
5156 | <tr><th>blocking</th> | |
5157 | <td class="description">Use blocking IO?</td></tr> | |
5158 | <tr><th>parent</th> | |
5159 | <td class="description">Parent request, if any</td></tr> | |
5160 | <tr><th>ipp</th> | |
5161 | <td class="description">IPP data</td></tr> | |
5162 | </tbody></table> | |
798d6e29 MS |
5163 | <h4 class="returnvalue">Return Value</h4> |
5164 | <p class="description">Current state</p> | |
5165 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetBoolean">ippSetBoolean</a></h3> | |
5166 | <p class="description">Set a boolean value in an attribute.</p> | |
5167 | <p class="code"> | |
98d88c8d MS |
5168 | 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> |
5169 | <h4 class="parameters">Parameters</h4> | |
5170 | <table class="list"><tbody> | |
5171 | <tr><th>ipp</th> | |
5172 | <td class="description">IPP message</td></tr> | |
5173 | <tr><th>attr</th> | |
5174 | <td class="description">IPP attribute</td></tr> | |
5175 | <tr><th>element</th> | |
5176 | <td class="description">Value number (0-based)</td></tr> | |
5177 | <tr><th>boolvalue</th> | |
5178 | <td class="description">Boolean value</td></tr> | |
5179 | </tbody></table> | |
798d6e29 MS |
5180 | <h4 class="returnvalue">Return Value</h4> |
5181 | <p class="description">1 on success, 0 on failure</p> | |
5182 | <h4 class="discussion">Discussion</h4> | |
5183 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5184 | 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> | |
5185 | <br> | |
5186 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5187 | <br> | |
5188 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5189 | <code>ippGetCount(attr)</code>. |
798d6e29 MS |
5190 | |
5191 | </p> | |
5192 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetCollection">ippSetCollection</a></h3> | |
5193 | <p class="description">Set a collection value in an attribute.</p> | |
5194 | <p class="code"> | |
98d88c8d MS |
5195 | 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> |
5196 | <h4 class="parameters">Parameters</h4> | |
5197 | <table class="list"><tbody> | |
5198 | <tr><th>ipp</th> | |
5199 | <td class="description">IPP message</td></tr> | |
5200 | <tr><th>attr</th> | |
5201 | <td class="description">IPP attribute</td></tr> | |
5202 | <tr><th>element</th> | |
5203 | <td class="description">Value number (0-based)</td></tr> | |
5204 | <tr><th>colvalue</th> | |
5205 | <td class="description">Collection value</td></tr> | |
5206 | </tbody></table> | |
798d6e29 MS |
5207 | <h4 class="returnvalue">Return Value</h4> |
5208 | <p class="description">1 on success, 0 on failure</p> | |
5209 | <h4 class="discussion">Discussion</h4> | |
5210 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5211 | 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> | |
5212 | <br> | |
5213 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5214 | <br> | |
5215 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5216 | <code>ippGetCount(attr)</code>. |
798d6e29 MS |
5217 | |
5218 | </p> | |
5219 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetDate">ippSetDate</a></h3> | |
65bebeac | 5220 | <p class="description">Set a dateTime value in an attribute.</p> |
798d6e29 | 5221 | <p class="code"> |
98d88c8d MS |
5222 | 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> |
5223 | <h4 class="parameters">Parameters</h4> | |
5224 | <table class="list"><tbody> | |
5225 | <tr><th>ipp</th> | |
5226 | <td class="description">IPP message</td></tr> | |
5227 | <tr><th>attr</th> | |
5228 | <td class="description">IPP attribute</td></tr> | |
5229 | <tr><th>element</th> | |
5230 | <td class="description">Value number (0-based)</td></tr> | |
5231 | <tr><th>datevalue</th> | |
65bebeac | 5232 | <td class="description">dateTime value</td></tr> |
98d88c8d | 5233 | </tbody></table> |
798d6e29 MS |
5234 | <h4 class="returnvalue">Return Value</h4> |
5235 | <p class="description">1 on success, 0 on failure</p> | |
5236 | <h4 class="discussion">Discussion</h4> | |
5237 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5238 | 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> | |
5239 | <br> | |
5240 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5241 | <br> | |
5242 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5243 | <code>ippGetCount(attr)</code>. |
798d6e29 MS |
5244 | |
5245 | </p> | |
5246 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetGroupTag">ippSetGroupTag</a></h3> | |
5247 | <p class="description">Set the group tag of an attribute.</p> | |
5248 | <p class="code"> | |
98d88c8d MS |
5249 | 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> |
5250 | <h4 class="parameters">Parameters</h4> | |
5251 | <table class="list"><tbody> | |
5252 | <tr><th>ipp</th> | |
5253 | <td class="description">IPP message</td></tr> | |
5254 | <tr><th>attr</th> | |
5255 | <td class="description">Attribute</td></tr> | |
5256 | <tr><th>group_tag</th> | |
5257 | <td class="description">Group tag</td></tr> | |
5258 | </tbody></table> | |
798d6e29 MS |
5259 | <h4 class="returnvalue">Return Value</h4> |
5260 | <p class="description">1 on success, 0 on failure</p> | |
5261 | <h4 class="discussion">Discussion</h4> | |
5262 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5263 | 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> | |
5264 | <br> | |
5265 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5266 | <br> | |
5267 | The <code>group</code> parameter specifies the IPP attribute group tag: none | |
5268 | (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), | |
5269 | event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation | |
5270 | (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription | |
5271 | (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>). | |
5272 | ||
5273 | </p> | |
5274 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetInteger">ippSetInteger</a></h3> | |
5275 | <p class="description">Set an integer or enum value in an attribute.</p> | |
5276 | <p class="code"> | |
98d88c8d MS |
5277 | 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> |
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">IPP attribute</td></tr> | |
5284 | <tr><th>element</th> | |
5285 | <td class="description">Value number (0-based)</td></tr> | |
5286 | <tr><th>intvalue</th> | |
5287 | <td class="description">Integer/enum value</td></tr> | |
5288 | </tbody></table> | |
798d6e29 MS |
5289 | <h4 class="returnvalue">Return Value</h4> |
5290 | <p class="description">1 on success, 0 on failure</p> | |
5291 | <h4 class="discussion">Discussion</h4> | |
5292 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5293 | 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> | |
5294 | <br> | |
5295 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5296 | <br> | |
5297 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5298 | <code>ippGetCount(attr)</code>. |
798d6e29 MS |
5299 | |
5300 | </p> | |
5301 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetName">ippSetName</a></h3> | |
5302 | <p class="description">Set the name of an attribute.</p> | |
5303 | <p class="code"> | |
98d88c8d MS |
5304 | int ippSetName(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, const char *name);</p> |
5305 | <h4 class="parameters">Parameters</h4> | |
5306 | <table class="list"><tbody> | |
5307 | <tr><th>ipp</th> | |
5308 | <td class="description">IPP message</td></tr> | |
5309 | <tr><th>attr</th> | |
5310 | <td class="description">IPP attribute</td></tr> | |
5311 | <tr><th>name</th> | |
5312 | <td class="description">Attribute name</td></tr> | |
5313 | </tbody></table> | |
798d6e29 MS |
5314 | <h4 class="returnvalue">Return Value</h4> |
5315 | <p class="description">1 on success, 0 on failure</p> | |
5316 | <h4 class="discussion">Discussion</h4> | |
5317 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5318 | 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> | |
5319 | <br> | |
5320 | The <code>attr</code> parameter may be modified as a result of setting the value. | |
5321 | ||
5322 | </p> | |
5323 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippSetOctetString">ippSetOctetString</a></h3> | |
5324 | <p class="description">Set an octetString value in an IPP attribute.</p> | |
5325 | <p class="code"> | |
98d88c8d MS |
5326 | 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> |
5327 | <h4 class="parameters">Parameters</h4> | |
5328 | <table class="list"><tbody> | |
5329 | <tr><th>ipp</th> | |
5330 | <td class="description">IPP message</td></tr> | |
5331 | <tr><th>attr</th> | |
5332 | <td class="description">IPP attribute</td></tr> | |
5333 | <tr><th>element</th> | |
5334 | <td class="description">Value number (0-based)</td></tr> | |
5335 | <tr><th>data</th> | |
5336 | <td class="description">Pointer to octetString data</td></tr> | |
5337 | <tr><th>datalen</th> | |
5338 | <td class="description">Length of octetString data</td></tr> | |
5339 | </tbody></table> | |
798d6e29 MS |
5340 | <h4 class="returnvalue">Return Value</h4> |
5341 | <p class="description">1 on success, 0 on failure</p> | |
5342 | <h4 class="discussion">Discussion</h4> | |
5343 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5344 | 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> | |
5345 | <br> | |
5346 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5347 | <br> | |
5348 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5349 | <code>ippGetCount(attr)</code>. |
798d6e29 MS |
5350 | |
5351 | </p> | |
5352 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetOperation">ippSetOperation</a></h3> | |
5353 | <p class="description">Set the operation ID in an IPP request message.</p> | |
5354 | <p class="code"> | |
98d88c8d | 5355 | int ippSetOperation(<a href="#ipp_t">ipp_t</a> *ipp, ipp_op_t op);</p> |
798d6e29 | 5356 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5357 | <table class="list"><tbody> |
5358 | <tr><th>ipp</th> | |
5359 | <td class="description">IPP request message</td></tr> | |
5360 | <tr><th>op</th> | |
5361 | <td class="description">Operation ID</td></tr> | |
5362 | </tbody></table> | |
798d6e29 MS |
5363 | <h4 class="returnvalue">Return Value</h4> |
5364 | <p class="description">1 on success, 0 on failure</p> | |
5365 | <h4 class="discussion">Discussion</h4> | |
5366 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5367 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions. | |
5368 | ||
5369 | </p> | |
5370 | <h3 class="function"><a id="ippSetPort">ippSetPort</a></h3> | |
98d88c8d | 5371 | <p class="description">Set the default port number.</p> |
798d6e29 | 5372 | <p class="code"> |
98d88c8d | 5373 | void ippSetPort(int p);</p> |
798d6e29 | 5374 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5375 | <table class="list"><tbody> |
5376 | <tr><th>p</th> | |
5377 | <td class="description">Port number to use</td></tr> | |
5378 | </tbody></table> | |
798d6e29 MS |
5379 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetRange">ippSetRange</a></h3> |
5380 | <p class="description">Set a rangeOfInteger value in an attribute.</p> | |
5381 | <p class="code"> | |
98d88c8d MS |
5382 | 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> |
5383 | <h4 class="parameters">Parameters</h4> | |
5384 | <table class="list"><tbody> | |
5385 | <tr><th>ipp</th> | |
5386 | <td class="description">IPP message</td></tr> | |
5387 | <tr><th>attr</th> | |
5388 | <td class="description">IPP attribute</td></tr> | |
5389 | <tr><th>element</th> | |
5390 | <td class="description">Value number (0-based)</td></tr> | |
5391 | <tr><th>lowervalue</th> | |
5392 | <td class="description">Lower bound for range</td></tr> | |
5393 | <tr><th>uppervalue</th> | |
5394 | <td class="description">Upper bound for range</td></tr> | |
5395 | </tbody></table> | |
798d6e29 MS |
5396 | <h4 class="returnvalue">Return Value</h4> |
5397 | <p class="description">1 on success, 0 on failure</p> | |
5398 | <h4 class="discussion">Discussion</h4> | |
5399 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5400 | 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> | |
5401 | <br> | |
5402 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5403 | <br> | |
5404 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5405 | <code>ippGetCount(attr)</code>. |
798d6e29 MS |
5406 | |
5407 | </p> | |
5408 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetRequestId">ippSetRequestId</a></h3> | |
5409 | <p class="description">Set the request ID in an IPP message.</p> | |
5410 | <p class="code"> | |
98d88c8d | 5411 | int ippSetRequestId(<a href="#ipp_t">ipp_t</a> *ipp, int request_id);</p> |
798d6e29 | 5412 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5413 | <table class="list"><tbody> |
5414 | <tr><th>ipp</th> | |
5415 | <td class="description">IPP message</td></tr> | |
5416 | <tr><th>request_id</th> | |
5417 | <td class="description">Request ID</td></tr> | |
5418 | </tbody></table> | |
798d6e29 MS |
5419 | <h4 class="returnvalue">Return Value</h4> |
5420 | <p class="description">1 on success, 0 on failure</p> | |
5421 | <h4 class="discussion">Discussion</h4> | |
5422 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5423 | 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> | |
5424 | <br> | |
5425 | The <code>request_id</code> parameter must be greater than 0. | |
5426 | ||
5427 | </p> | |
5428 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetResolution">ippSetResolution</a></h3> | |
5429 | <p class="description">Set a resolution value in an attribute.</p> | |
5430 | <p class="code"> | |
98d88c8d MS |
5431 | 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> |
5432 | <h4 class="parameters">Parameters</h4> | |
5433 | <table class="list"><tbody> | |
5434 | <tr><th>ipp</th> | |
5435 | <td class="description">IPP message</td></tr> | |
5436 | <tr><th>attr</th> | |
5437 | <td class="description">IPP attribute</td></tr> | |
5438 | <tr><th>element</th> | |
5439 | <td class="description">Value number (0-based)</td></tr> | |
5440 | <tr><th>unitsvalue</th> | |
5441 | <td class="description">Resolution units</td></tr> | |
5442 | <tr><th>xresvalue</th> | |
5443 | <td class="description">Horizontal/cross feed resolution</td></tr> | |
5444 | <tr><th>yresvalue</th> | |
5445 | <td class="description">Vertical/feed resolution</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>attr</code> parameter may be modified as a result of setting the value.<br> | |
5454 | <br> | |
5455 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5456 | <code>ippGetCount(attr)</code>. |
798d6e29 MS |
5457 | |
5458 | </p> | |
5459 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetState">ippSetState</a></h3> | |
5460 | <p class="description">Set the current state of the IPP message.</p> | |
5461 | <p class="code"> | |
98d88c8d | 5462 | int ippSetState(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_state_t">ipp_state_t</a> state);</p> |
798d6e29 | 5463 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5464 | <table class="list"><tbody> |
5465 | <tr><th>ipp</th> | |
5466 | <td class="description">IPP message</td></tr> | |
5467 | <tr><th>state</th> | |
5468 | <td class="description">IPP state value</td></tr> | |
5469 | </tbody></table> | |
798d6e29 MS |
5470 | <h4 class="returnvalue">Return Value</h4> |
5471 | <p class="description">1 on success, 0 on failure</p> | |
5472 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetStatusCode">ippSetStatusCode</a></h3> | |
5473 | <p class="description">Set the status code in an IPP response or event message.</p> | |
5474 | <p class="code"> | |
98d88c8d | 5475 | int ippSetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp, ipp_status_t status);</p> |
798d6e29 | 5476 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5477 | <table class="list"><tbody> |
5478 | <tr><th>ipp</th> | |
5479 | <td class="description">IPP response or event message</td></tr> | |
5480 | <tr><th>status</th> | |
5481 | <td class="description">Status code</td></tr> | |
5482 | </tbody></table> | |
798d6e29 MS |
5483 | <h4 class="returnvalue">Return Value</h4> |
5484 | <p class="description">1 on success, 0 on failure</p> | |
5485 | <h4 class="discussion">Discussion</h4> | |
5486 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5487 | the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions. | |
5488 | ||
5489 | </p> | |
5490 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetString">ippSetString</a></h3> | |
5491 | <p class="description">Set a string value in an attribute.</p> | |
5492 | <p class="code"> | |
98d88c8d MS |
5493 | 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> |
5494 | <h4 class="parameters">Parameters</h4> | |
5495 | <table class="list"><tbody> | |
5496 | <tr><th>ipp</th> | |
5497 | <td class="description">IPP message</td></tr> | |
5498 | <tr><th>attr</th> | |
5499 | <td class="description">IPP attribute</td></tr> | |
5500 | <tr><th>element</th> | |
5501 | <td class="description">Value number (0-based)</td></tr> | |
5502 | <tr><th>strvalue</th> | |
5503 | <td class="description">String value</td></tr> | |
5504 | </tbody></table> | |
798d6e29 MS |
5505 | <h4 class="returnvalue">Return Value</h4> |
5506 | <p class="description">1 on success, 0 on failure</p> | |
5507 | <h4 class="discussion">Discussion</h4> | |
5508 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5509 | 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> | |
5510 | <br> | |
5511 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5512 | <br> | |
5513 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5514 | <code>ippGetCount(attr)</code>. |
798d6e29 MS |
5515 | |
5516 | </p> | |
5517 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippSetStringf">ippSetStringf</a></h3> | |
5518 | <p class="description">Set a formatted string value of an attribute.</p> | |
5519 | <p class="code"> | |
98d88c8d MS |
5520 | 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> |
5521 | <h4 class="parameters">Parameters</h4> | |
5522 | <table class="list"><tbody> | |
5523 | <tr><th>ipp</th> | |
5524 | <td class="description">IPP message</td></tr> | |
5525 | <tr><th>attr</th> | |
5526 | <td class="description">IPP attribute</td></tr> | |
5527 | <tr><th>element</th> | |
5528 | <td class="description">Value number (0-based)</td></tr> | |
5529 | <tr><th>format</th> | |
5530 | <td class="description">Printf-style format string</td></tr> | |
5531 | <tr><th>...</th> | |
5532 | <td class="description">Additional arguments as needed</td></tr> | |
5533 | </tbody></table> | |
798d6e29 MS |
5534 | <h4 class="returnvalue">Return Value</h4> |
5535 | <p class="description">1 on success, 0 on failure</p> | |
5536 | <h4 class="discussion">Discussion</h4> | |
5537 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5538 | 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> | |
5539 | <br> | |
5540 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5541 | <br> | |
5542 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5543 | <code>ippGetCount(attr)</code>.<br> |
798d6e29 MS |
5544 | <br> |
5545 | The <code>format</code> parameter uses formatting characters compatible with the | |
5546 | printf family of standard functions. Additional arguments follow it as | |
5547 | needed. The formatted string is truncated as needed to the maximum length of | |
5548 | the corresponding value type. | |
5549 | ||
5550 | </p> | |
5551 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippSetStringfv">ippSetStringfv</a></h3> | |
5552 | <p class="description">Set a formatted string value of an attribute.</p> | |
5553 | <p class="code"> | |
98d88c8d MS |
5554 | 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> |
5555 | <h4 class="parameters">Parameters</h4> | |
5556 | <table class="list"><tbody> | |
5557 | <tr><th>ipp</th> | |
5558 | <td class="description">IPP message</td></tr> | |
5559 | <tr><th>attr</th> | |
5560 | <td class="description">IPP attribute</td></tr> | |
5561 | <tr><th>element</th> | |
5562 | <td class="description">Value number (0-based)</td></tr> | |
5563 | <tr><th>format</th> | |
5564 | <td class="description">Printf-style format string</td></tr> | |
5565 | <tr><th>ap</th> | |
5566 | <td class="description">Pointer to additional arguments</td></tr> | |
5567 | </tbody></table> | |
798d6e29 MS |
5568 | <h4 class="returnvalue">Return Value</h4> |
5569 | <p class="description">1 on success, 0 on failure</p> | |
5570 | <h4 class="discussion">Discussion</h4> | |
5571 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5572 | 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> | |
5573 | <br> | |
5574 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5575 | <br> | |
5576 | The <code>element</code> parameter specifies which value to set from 0 to | |
65bebeac | 5577 | <code>ippGetCount(attr)</code>.<br> |
798d6e29 MS |
5578 | <br> |
5579 | The <code>format</code> parameter uses formatting characters compatible with the | |
5580 | printf family of standard functions. Additional arguments follow it as | |
5581 | needed. The formatted string is truncated as needed to the maximum length of | |
5582 | the corresponding value type. | |
5583 | ||
5584 | </p> | |
5585 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetValueTag">ippSetValueTag</a></h3> | |
5586 | <p class="description">Set the value tag of an attribute.</p> | |
5587 | <p class="code"> | |
98d88c8d MS |
5588 | 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> |
5589 | <h4 class="parameters">Parameters</h4> | |
5590 | <table class="list"><tbody> | |
5591 | <tr><th>ipp</th> | |
5592 | <td class="description">IPP message</td></tr> | |
5593 | <tr><th>attr</th> | |
5594 | <td class="description">IPP attribute</td></tr> | |
5595 | <tr><th>value_tag</th> | |
5596 | <td class="description">Value tag</td></tr> | |
5597 | </tbody></table> | |
798d6e29 MS |
5598 | <h4 class="returnvalue">Return Value</h4> |
5599 | <p class="description">1 on success, 0 on failure</p> | |
5600 | <h4 class="discussion">Discussion</h4> | |
5601 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5602 | 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> | |
5603 | <br> | |
5604 | The <code>attr</code> parameter may be modified as a result of setting the value.<br> | |
5605 | <br> | |
5606 | Integer (<code>IPP_TAG_INTEGER</code>) values can be promoted to rangeOfInteger | |
5607 | (<code>IPP_TAG_RANGE</code>) values, the various string tags can be promoted to name | |
5608 | (<code>IPP_TAG_NAME</code>) or nameWithLanguage (<code>IPP_TAG_NAMELANG</code>) values, text | |
5609 | (<code>IPP_TAG_TEXT</code>) values can be promoted to textWithLanguage | |
5610 | (<code>IPP_TAG_TEXTLANG</code>) values, and all values can be demoted to the various | |
5611 | out-of-band value tags such as no-value (<code>IPP_TAG_NOVALUE</code>). All other changes | |
5612 | will be rejected.<br> | |
5613 | <br> | |
5614 | Promoting a string attribute to nameWithLanguage or textWithLanguage adds the language | |
5615 | code in the "attributes-natural-language" attribute or, if not present, the language | |
5616 | code for the current locale. | |
5617 | ||
5618 | </p> | |
5619 | <h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetVersion">ippSetVersion</a></h3> | |
5620 | <p class="description">Set the version number in an IPP message.</p> | |
5621 | <p class="code"> | |
98d88c8d MS |
5622 | int ippSetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int major, int minor);</p> |
5623 | <h4 class="parameters">Parameters</h4> | |
5624 | <table class="list"><tbody> | |
5625 | <tr><th>ipp</th> | |
5626 | <td class="description">IPP message</td></tr> | |
5627 | <tr><th>major</th> | |
5628 | <td class="description">Major version number (major.minor)</td></tr> | |
5629 | <tr><th>minor</th> | |
5630 | <td class="description">Minor version number (major.minor)</td></tr> | |
5631 | </tbody></table> | |
798d6e29 MS |
5632 | <h4 class="returnvalue">Return Value</h4> |
5633 | <p class="description">1 on success, 0 on failure</p> | |
5634 | <h4 class="discussion">Discussion</h4> | |
5635 | <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using | |
5636 | 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> | |
5637 | <br> | |
5638 | The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2. | |
5639 | ||
5640 | </p> | |
5641 | <h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="ippStateString">ippStateString</a></h3> | |
5642 | <p class="description">Return the name corresponding to a state value.</p> | |
5643 | <p class="code"> | |
98d88c8d | 5644 | const char *ippStateString(<a href="#ipp_state_t">ipp_state_t</a> state);</p> |
798d6e29 | 5645 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5646 | <table class="list"><tbody> |
5647 | <tr><th>state</th> | |
5648 | <td class="description">State value</td></tr> | |
5649 | </tbody></table> | |
798d6e29 MS |
5650 | <h4 class="returnvalue">Return Value</h4> |
5651 | <p class="description">State name</p> | |
5652 | <h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="ippTagString">ippTagString</a></h3> | |
5653 | <p class="description">Return the tag name corresponding to a tag value.</p> | |
5654 | <p class="code"> | |
98d88c8d | 5655 | const char *ippTagString(ipp_tag_t tag);</p> |
798d6e29 | 5656 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5657 | <table class="list"><tbody> |
5658 | <tr><th>tag</th> | |
5659 | <td class="description">Tag value</td></tr> | |
5660 | </tbody></table> | |
798d6e29 MS |
5661 | <h4 class="returnvalue">Return Value</h4> |
5662 | <p class="description">Tag name</p> | |
5663 | <h4 class="discussion">Discussion</h4> | |
65bebeac | 5664 | <p class="discussion">The returned names are defined in RFC 8011 and the IANA IPP Registry. |
798d6e29 MS |
5665 | |
5666 | </p> | |
5667 | <h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="ippTagValue">ippTagValue</a></h3> | |
5668 | <p class="description">Return the tag value corresponding to a tag name.</p> | |
5669 | <p class="code"> | |
98d88c8d | 5670 | ipp_tag_t ippTagValue(const char *name);</p> |
798d6e29 | 5671 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5672 | <table class="list"><tbody> |
5673 | <tr><th>name</th> | |
5674 | <td class="description">Tag name</td></tr> | |
5675 | </tbody></table> | |
798d6e29 MS |
5676 | <h4 class="returnvalue">Return Value</h4> |
5677 | <p class="description">Tag value</p> | |
5678 | <h4 class="discussion">Discussion</h4> | |
65bebeac | 5679 | <p class="discussion">The tag names are defined in RFC 8011 and the IANA IPP Registry. |
798d6e29 MS |
5680 | |
5681 | </p> | |
5682 | <h3 class="function"><a id="ippTimeToDate">ippTimeToDate</a></h3> | |
65bebeac | 5683 | <p class="description">Convert from time in seconds to RFC 2579 format.</p> |
798d6e29 | 5684 | <p class="code"> |
98d88c8d | 5685 | const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippTimeToDate(time_t t);</p> |
798d6e29 | 5686 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5687 | <table class="list"><tbody> |
5688 | <tr><th>t</th> | |
65bebeac | 5689 | <td class="description">Time in seconds</td></tr> |
98d88c8d | 5690 | </tbody></table> |
798d6e29 | 5691 | <h4 class="returnvalue">Return Value</h4> |
65bebeac | 5692 | <p class="description">RFC-2579 date/time data</p> |
798d6e29 MS |
5693 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippValidateAttribute">ippValidateAttribute</a></h3> |
5694 | <p class="description">Validate the contents of an attribute.</p> | |
5695 | <p class="code"> | |
98d88c8d | 5696 | int ippValidateAttribute(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> |
798d6e29 | 5697 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5698 | <table class="list"><tbody> |
5699 | <tr><th>attr</th> | |
5700 | <td class="description">Attribute</td></tr> | |
5701 | </tbody></table> | |
798d6e29 MS |
5702 | <h4 class="returnvalue">Return Value</h4> |
5703 | <p class="description">1 if valid, 0 otherwise</p> | |
5704 | <h4 class="discussion">Discussion</h4> | |
5705 | <p class="discussion">This function validates the contents of an attribute based on the name and | |
5706 | value tag. 1 is returned if the attribute is valid, 0 otherwise. On | |
65bebeac | 5707 | failure, <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> is set to a human-readable message. |
798d6e29 MS |
5708 | |
5709 | </p> | |
5710 | <h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippValidateAttributes">ippValidateAttributes</a></h3> | |
5711 | <p class="description">Validate all attributes in an IPP message.</p> | |
5712 | <p class="code"> | |
98d88c8d | 5713 | int ippValidateAttributes(<a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 5714 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5715 | <table class="list"><tbody> |
5716 | <tr><th>ipp</th> | |
5717 | <td class="description">IPP message</td></tr> | |
5718 | </tbody></table> | |
798d6e29 MS |
5719 | <h4 class="returnvalue">Return Value</h4> |
5720 | <p class="description">1 if valid, 0 otherwise</p> | |
5721 | <h4 class="discussion">Discussion</h4> | |
5722 | <p class="discussion">This function validates the contents of the IPP message, including each | |
65bebeac MS |
5723 | attribute. Like <a href="#ippValidateAttribute"><code>ippValidateAttribute</code></a>, <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> is |
5724 | set to a human-readable message on failure. | |
798d6e29 MS |
5725 | |
5726 | </p> | |
5727 | <h3 class="function"><a id="ippWrite">ippWrite</a></h3> | |
5728 | <p class="description">Write data for an IPP message to a HTTP connection.</p> | |
5729 | <p class="code"> | |
98d88c8d | 5730 | <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 | 5731 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5732 | <table class="list"><tbody> |
5733 | <tr><th>http</th> | |
5734 | <td class="description">HTTP connection</td></tr> | |
5735 | <tr><th>ipp</th> | |
5736 | <td class="description">IPP data</td></tr> | |
5737 | </tbody></table> | |
798d6e29 MS |
5738 | <h4 class="returnvalue">Return Value</h4> |
5739 | <p class="description">Current state</p> | |
5740 | <h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippWriteFile">ippWriteFile</a></h3> | |
5741 | <p class="description">Write data for an IPP message to a file.</p> | |
5742 | <p class="code"> | |
98d88c8d | 5743 | <a href="#ipp_state_t">ipp_state_t</a> ippWriteFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p> |
798d6e29 | 5744 | <h4 class="parameters">Parameters</h4> |
98d88c8d MS |
5745 | <table class="list"><tbody> |
5746 | <tr><th>fd</th> | |
5747 | <td class="description">HTTP data</td></tr> | |
5748 | <tr><th>ipp</th> | |
5749 | <td class="description">IPP data</td></tr> | |
5750 | </tbody></table> | |
798d6e29 MS |
5751 | <h4 class="returnvalue">Return Value</h4> |
5752 | <p class="description">Current state</p> | |
5753 | <h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippWriteIO">ippWriteIO</a></h3> | |
5754 | <p class="description">Write data for an IPP message.</p> | |
5755 | <p class="code"> | |
98d88c8d MS |
5756 | <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> |
5757 | <h4 class="parameters">Parameters</h4> | |
5758 | <table class="list"><tbody> | |
5759 | <tr><th>dst</th> | |
5760 | <td class="description">Destination</td></tr> | |
5761 | <tr><th>cb</th> | |
5762 | <td class="description">Write callback function</td></tr> | |
5763 | <tr><th>blocking</th> | |
5764 | <td class="description">Use blocking IO?</td></tr> | |
5765 | <tr><th>parent</th> | |
5766 | <td class="description">Parent IPP message</td></tr> | |
5767 | <tr><th>ipp</th> | |
5768 | <td class="description">IPP data</td></tr> | |
5769 | </tbody></table> | |
798d6e29 MS |
5770 | <h4 class="returnvalue">Return Value</h4> |
5771 | <p class="description">Current state</p> | |
798d6e29 | 5772 | <h2 class="title"><a id="TYPES">Data Types</a></h2> |
798d6e29 MS |
5773 | <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> |
5774 | <p class="description">Client credentials callback | |
5775 | </p> | |
5776 | <p class="code"> | |
53af7f21 | 5777 | typedef int(*)(http_t *http, void *tls, cups_array_t *distinguished_names, void *user_data)cups_client_cert_cb_t; |
798d6e29 MS |
5778 | </p> |
5779 | <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> | |
5780 | <p class="description">Destination enumeration callback | |
5781 | </p> | |
5782 | <p class="code"> | |
5783 | typedef int(*)(void *user_data, unsigned flags, <a href="#cups_dest_t">cups_dest_t</a> *dest)cups_dest_cb_t; | |
5784 | </p> | |
5785 | <h3 class="typedef"><a id="cups_dest_t">cups_dest_t</a></h3> | |
5786 | <p class="description">Destination</p> | |
5787 | <p class="code"> | |
5788 | typedef struct <a href="#cups_dest_s">cups_dest_s</a> cups_dest_t; | |
5789 | </p> | |
5790 | <h3 class="typedef"><a id="cups_dinfo_t"><span class="info"> CUPS 1.6/macOS 10.8 </span>cups_dinfo_t</a></h3> | |
5791 | <p class="description">Destination capability and status | |
5792 | information </p> | |
5793 | <p class="code"> | |
5794 | typedef struct _cups_dinfo_s cups_dinfo_t; | |
798d6e29 MS |
5795 | </p> |
5796 | <h3 class="typedef"><a id="cups_job_t">cups_job_t</a></h3> | |
5797 | <p class="description">Job</p> | |
5798 | <p class="code"> | |
5799 | typedef struct <a href="#cups_job_s">cups_job_s</a> cups_job_t; | |
798d6e29 MS |
5800 | </p> |
5801 | <h3 class="typedef"><a id="cups_option_t">cups_option_t</a></h3> | |
5802 | <p class="description">Printer Options</p> | |
5803 | <p class="code"> | |
5804 | typedef struct <a href="#cups_option_s">cups_option_s</a> cups_option_t; | |
5805 | </p> | |
5806 | <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> | |
5807 | <p class="description">New password callback | |
5808 | </p> | |
5809 | <p class="code"> | |
5810 | 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 |
5811 | </p> |
5812 | <h3 class="typedef"><a id="cups_ptype_t">cups_ptype_t</a></h3> | |
5813 | <p class="description">Printer type/capability bits</p> | |
5814 | <p class="code"> | |
5815 | typedef unsigned cups_ptype_t; | |
5816 | </p> | |
5817 | <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> | |
5818 | <p class="description">Server credentials callback | |
5819 | </p> | |
5820 | <p class="code"> | |
53af7f21 | 5821 | typedef int(*)(http_t *http, void *tls, cups_array_t *certs, void *user_data)cups_server_cert_cb_t; |
798d6e29 MS |
5822 | </p> |
5823 | <h3 class="typedef"><a id="cups_size_t"><span class="info"> CUPS 1.6/macOS 10.8 </span>cups_size_t</a></h3> | |
5824 | <p class="description">Media Size </p> | |
5825 | <p class="code"> | |
5826 | typedef struct <a href="#cups_size_s">cups_size_s</a> cups_size_t; | |
798d6e29 MS |
5827 | </p> |
5828 | <h3 class="typedef"><a id="http_addr_t"><span class="info"> CUPS 1.2/macOS 10.5 </span>http_addr_t</a></h3> | |
5829 | <p class="description">Socket address union, which | |
5830 | makes using IPv6 and other | |
5831 | address types easier and | |
5832 | more portable. </p> | |
5833 | <p class="code"> | |
5834 | typedef union _http_addr_u / http_addr_t; | |
798d6e29 MS |
5835 | </p> |
5836 | <h3 class="typedef"><a id="http_encoding_t">http_encoding_t</a></h3> | |
5837 | <p class="description">HTTP transfer encoding values</p> | |
5838 | <p class="code"> | |
5839 | typedef enum <a href="#http_encoding_e">http_encoding_e</a> http_encoding_t; | |
5840 | </p> | |
5841 | <h3 class="typedef"><a id="http_encryption_t">http_encryption_t</a></h3> | |
5842 | <p class="description">HTTP encryption values</p> | |
5843 | <p class="code"> | |
5844 | typedef enum <a href="#http_encryption_e">http_encryption_e</a> http_encryption_t; | |
5845 | </p> | |
5846 | <h3 class="typedef"><a id="http_field_t">http_field_t</a></h3> | |
5847 | <p class="description">HTTP field names</p> | |
5848 | <p class="code"> | |
5849 | typedef enum <a href="#http_field_e">http_field_e</a> http_field_t; | |
5850 | </p> | |
5851 | <h3 class="typedef"><a id="http_keepalive_t">http_keepalive_t</a></h3> | |
5852 | <p class="description">HTTP keep-alive values</p> | |
5853 | <p class="code"> | |
5854 | typedef enum <a href="#http_keepalive_e">http_keepalive_e</a> http_keepalive_t; | |
5855 | </p> | |
5856 | <h3 class="typedef"><a id="http_state_t">http_state_t</a></h3> | |
5857 | <p class="description">HTTP state values; states | |
5858 | are server-oriented...</p> | |
5859 | <p class="code"> | |
5860 | typedef enum <a href="#http_state_e">http_state_e</a> http_state_t; | |
5861 | </p> | |
5862 | <h3 class="typedef"><a id="http_t">http_t</a></h3> | |
5863 | <p class="description">HTTP connection type</p> | |
5864 | <p class="code"> | |
5865 | typedef struct _http_s http_t; | |
5866 | </p> | |
5867 | <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> | |
5868 | <p class="description">HTTP timeout callback </p> | |
5869 | <p class="code"> | |
5870 | typedef int(*)(http_t *http, void *user_data)http_timeout_cb_t; | |
5871 | </p> | |
5872 | <h3 class="typedef"><a id="http_trust_t"><span class="info"> CUPS 2.0/OS 10.10 </span>http_trust_t</a></h3> | |
5873 | <p class="description">Level of trust for credentials </p> | |
5874 | <p class="code"> | |
5875 | typedef enum <a href="#http_trust_e">http_trust_e</a> http_trust_t; | |
5876 | </p> | |
5877 | <h3 class="typedef"><a id="http_uri_coding_t">http_uri_coding_t</a></h3> | |
5878 | <p class="description">URI en/decode flags</p> | |
5879 | <p class="code"> | |
5880 | typedef enum <a href="#http_uri_coding_e">http_uri_coding_e</a> http_uri_coding_t; | |
5881 | </p> | |
5882 | <h3 class="typedef"><a id="http_uri_status_t"><span class="info"> CUPS 1.2 </span>http_uri_status_t</a></h3> | |
5883 | <p class="description">URI separation status </p> | |
5884 | <p class="code"> | |
5885 | typedef enum <a href="#http_uri_status_e">http_uri_status_e</a> http_uri_status_t; | |
798d6e29 MS |
5886 | </p> |
5887 | <h3 class="typedef"><a id="ipp_attribute_t">ipp_attribute_t</a></h3> | |
5888 | <p class="description">IPP attribute</p> | |
5889 | <p class="code"> | |
5890 | typedef struct _ipp_attribute_s ipp_attribute_t; | |
5891 | </p> | |
65bebeac MS |
5892 | <h3 class="typedef"><a id="ipp_copycb_t"><span class="info"> CUPS 1.6/macOS 10.8 </span>ipp_copycb_t</a></h3> |
5893 | <p class="description">ippCopyAttributes callback function </p> | |
798d6e29 MS |
5894 | <p class="code"> |
5895 | 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 |
5896 | </p> |
5897 | <h3 class="typedef"><a id="ipp_iocb_t"><span class="info"> CUPS 1.2/macOS 10.5 </span>ipp_iocb_t</a></h3> | |
65bebeac | 5898 | <p class="description">ippReadIO/ippWriteIO callback function </p> |
798d6e29 | 5899 | <p class="code"> |
98d88c8d | 5900 | typedef ssize_t(*)(void *context, ipp_uchar_t *buffer, size_t bytes) ipp_iocb_t; |
798d6e29 MS |
5901 | </p> |
5902 | <h3 class="typedef"><a id="ipp_orient_t">ipp_orient_t</a></h3> | |
5903 | <p class="description">Orientation values</p> | |
5904 | <p class="code"> | |
5905 | typedef enum <a href="#ipp_orient_e">ipp_orient_e</a> ipp_orient_t; | |
5906 | </p> | |
5907 | <h3 class="typedef"><a id="ipp_pstate_t">ipp_pstate_t</a></h3> | |
65bebeac | 5908 | <p class="description">Printer state values</p> |
798d6e29 MS |
5909 | <p class="code"> |
5910 | typedef enum <a href="#ipp_pstate_e">ipp_pstate_e</a> ipp_pstate_t; | |
5911 | </p> | |
5912 | <h3 class="typedef"><a id="ipp_quality_t">ipp_quality_t</a></h3> | |
65bebeac | 5913 | <p class="description">Print quality values</p> |
798d6e29 MS |
5914 | <p class="code"> |
5915 | typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t; | |
5916 | </p> | |
5917 | <h3 class="typedef"><a id="ipp_res_t">ipp_res_t</a></h3> | |
5918 | <p class="description">Resolution units</p> | |
5919 | <p class="code"> | |
5920 | typedef enum <a href="#ipp_res_e">ipp_res_e</a> ipp_res_t; | |
5921 | </p> | |
5922 | <h3 class="typedef"><a id="ipp_state_t">ipp_state_t</a></h3> | |
65bebeac | 5923 | <p class="description">ipp_t state values</p> |
798d6e29 MS |
5924 | <p class="code"> |
5925 | typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t; | |
5926 | </p> | |
5927 | <h3 class="typedef"><a id="ipp_t">ipp_t</a></h3> | |
5928 | <p class="description">IPP request/response data</p> | |
5929 | <p class="code"> | |
5930 | typedef struct _ipp_s ipp_t; | |
798d6e29 MS |
5931 | </p> |
5932 | <h2 class="title"><a id="STRUCTURES">Structures</a></h2> | |
798d6e29 MS |
5933 | <h3 class="struct"><a id="cups_dest_s">cups_dest_s</a></h3> |
5934 | <p class="description">Destination</p> | |
5935 | <p class="code">struct cups_dest_s {<br> | |
5936 |     char *name, *instance;<br> | |
5937 |     int is_default;<br> | |
5938 |     int num_options;<br> | |
5939 |     <a href="#cups_option_t">cups_option_t</a> *options;<br> | |
5940 | };</p> | |
5941 | <h4 class="members">Members</h4> | |
98d88c8d MS |
5942 | <table class="list"><tbody> |
5943 | <tr><th>instance </th> | |
5944 | <td class="description">Local instance name or NULL</td></tr> | |
5945 | <tr><th>is_default </th> | |
5946 | <td class="description">Is this printer the default?</td></tr> | |
5947 | <tr><th>num_options </th> | |
5948 | <td class="description">Number of options</td></tr> | |
5949 | <tr><th>options </th> | |
5950 | <td class="description">Options</td></tr> | |
5951 | </tbody></table> | |
798d6e29 MS |
5952 | <h3 class="struct"><a id="cups_job_s">cups_job_s</a></h3> |
5953 | <p class="description">Job</p> | |
5954 | <p class="code">struct cups_job_s {<br> | |
5955 |     time_t completed_time;<br> | |
5956 |     time_t creation_time;<br> | |
5957 |     char *dest;<br> | |
5958 |     char *format;<br> | |
5959 |     int id;<br> | |
5960 |     int priority;<br> | |
5961 |     time_t processing_time;<br> | |
5962 |     int size;<br> | |
5963 |     ipp_jstate_t state;<br> | |
5964 |     char *title;<br> | |
5965 |     char *user;<br> | |
5966 | };</p> | |
5967 | <h4 class="members">Members</h4> | |
98d88c8d MS |
5968 | <table class="list"><tbody> |
5969 | <tr><th>completed_time </th> | |
5970 | <td class="description">Time the job was completed</td></tr> | |
5971 | <tr><th>creation_time </th> | |
5972 | <td class="description">Time the job was created</td></tr> | |
5973 | <tr><th>dest </th> | |
5974 | <td class="description">Printer or class name</td></tr> | |
5975 | <tr><th>format </th> | |
5976 | <td class="description">Document format</td></tr> | |
5977 | <tr><th>id </th> | |
5978 | <td class="description">The job ID</td></tr> | |
5979 | <tr><th>priority </th> | |
5980 | <td class="description">Priority (1-100)</td></tr> | |
5981 | <tr><th>processing_time </th> | |
5982 | <td class="description">Time the job was processed</td></tr> | |
5983 | <tr><th>size </th> | |
5984 | <td class="description">Size in kilobytes</td></tr> | |
5985 | <tr><th>state </th> | |
5986 | <td class="description">Job state</td></tr> | |
5987 | <tr><th>title </th> | |
5988 | <td class="description">Title/job name</td></tr> | |
5989 | <tr><th>user </th> | |
5990 | <td class="description">User that submitted the job</td></tr> | |
5991 | </tbody></table> | |
798d6e29 MS |
5992 | <h3 class="struct"><a id="cups_option_s">cups_option_s</a></h3> |
5993 | <p class="description">Printer Options</p> | |
5994 | <p class="code">struct cups_option_s {<br> | |
5995 |     char *name;<br> | |
5996 |     char *value;<br> | |
5997 | };</p> | |
5998 | <h4 class="members">Members</h4> | |
98d88c8d MS |
5999 | <table class="list"><tbody> |
6000 | <tr><th>name </th> | |
6001 | <td class="description">Name of option</td></tr> | |
6002 | <tr><th>value </th> | |
6003 | <td class="description">Value of option</td></tr> | |
6004 | </tbody></table> | |
798d6e29 MS |
6005 | <h3 class="struct"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cups_size_s">cups_size_s</a></h3> |
6006 | <p class="description">Media Size </p> | |
6007 | <p class="code">struct cups_size_s {<br> | |
6008 |     char media[128];<br> | |
6009 |     int width, length, bottom, left, right, top;<br> | |
6010 | };</p> | |
6011 | <h4 class="members">Members</h4> | |
98d88c8d MS |
6012 | <table class="list"><tbody> |
6013 | <tr><th>media[128] </th> | |
6014 | <td class="description">Media name to use</td></tr> | |
6015 | <tr><th>top </th> | |
6016 | <td class="description">Top margin in hundredths of | |
6017 | millimeters</td></tr> | |
6018 | </tbody></table> | |
798d6e29 | 6019 | <h2 class="title"><a id="ENUMERATIONS">Constants</a></h2> |
798d6e29 MS |
6020 | <h3 class="enumeration"><a id="cups_ptype_e">cups_ptype_e</a></h3> |
6021 | <p class="description">Printer type/capability bit | |
6022 | constants</p> | |
6023 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6024 | <table class="list"><tbody> |
6025 | <tr><th>CUPS_PRINTER_AUTHENTICATED <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Printer requires authentication | |
6026 | </td></tr> | |
6027 | <tr><th>CUPS_PRINTER_BIND </th> <td class="description">Can bind output</td></tr> | |
6028 | <tr><th>CUPS_PRINTER_BW </th> <td class="description">Can do B&W printing</td></tr> | |
6029 | <tr><th>CUPS_PRINTER_CLASS </th> <td class="description">Printer class</td></tr> | |
6030 | <tr><th>CUPS_PRINTER_COLLATE </th> <td class="description">Can quickly collate copies</td></tr> | |
6031 | <tr><th>CUPS_PRINTER_COLOR </th> <td class="description">Can do color printing</td></tr> | |
6032 | <tr><th>CUPS_PRINTER_COMMANDS <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Printer supports maintenance commands | |
6033 | </td></tr> | |
6034 | <tr><th>CUPS_PRINTER_COPIES </th> <td class="description">Can do copies in hardware</td></tr> | |
6035 | <tr><th>CUPS_PRINTER_COVER </th> <td class="description">Can cover output</td></tr> | |
6036 | <tr><th>CUPS_PRINTER_DEFAULT </th> <td class="description">Default printer on network</td></tr> | |
6037 | <tr><th>CUPS_PRINTER_DISCOVERED <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Printer was discovered </td></tr> | |
6038 | <tr><th>CUPS_PRINTER_DUPLEX </th> <td class="description">Can do two-sided printing</td></tr> | |
6039 | <tr><th>CUPS_PRINTER_FAX </th> <td class="description">Fax queue</td></tr> | |
6040 | <tr><th>CUPS_PRINTER_LARGE </th> <td class="description">Can print on D/E/A1/A0-size media</td></tr> | |
6041 | <tr><th>CUPS_PRINTER_LOCAL </th> <td class="description">Local printer or class</td></tr> | |
6042 | <tr><th>CUPS_PRINTER_MEDIUM </th> <td class="description">Can print on Tabloid/B/C/A3/A2-size media</td></tr> | |
6043 | <tr><th>CUPS_PRINTER_NOT_SHARED <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Printer is not shared | |
6044 | </td></tr> | |
6045 | <tr><th>CUPS_PRINTER_PUNCH </th> <td class="description">Can punch output</td></tr> | |
6046 | <tr><th>CUPS_PRINTER_REJECTING </th> <td class="description">Printer is rejecting jobs</td></tr> | |
6047 | <tr><th>CUPS_PRINTER_REMOTE </th> <td class="description">Remote printer or class</td></tr> | |
6048 | <tr><th>CUPS_PRINTER_SMALL </th> <td class="description">Can print on Letter/Legal/A4-size media</td></tr> | |
6049 | <tr><th>CUPS_PRINTER_SORT </th> <td class="description">Can sort output</td></tr> | |
6050 | <tr><th>CUPS_PRINTER_STAPLE </th> <td class="description">Can staple output</td></tr> | |
6051 | <tr><th>CUPS_PRINTER_VARIABLE </th> <td class="description">Can print on rolls and custom-size media</td></tr> | |
6052 | </tbody></table> | |
798d6e29 MS |
6053 | <h3 class="enumeration"><a id="http_encoding_e">http_encoding_e</a></h3> |
6054 | <p class="description">HTTP transfer encoding values</p> | |
6055 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6056 | <table class="list"><tbody> |
6057 | <tr><th>HTTP_ENCODING_CHUNKED </th> <td class="description">Data is chunked</td></tr> | |
6058 | <tr><th>HTTP_ENCODING_FIELDS </th> <td class="description">Sending HTTP fields</td></tr> | |
6059 | <tr><th>HTTP_ENCODING_LENGTH </th> <td class="description">Data is sent with Content-Length</td></tr> | |
6060 | </tbody></table> | |
798d6e29 MS |
6061 | <h3 class="enumeration"><a id="http_encryption_e">http_encryption_e</a></h3> |
6062 | <p class="description">HTTP encryption values</p> | |
6063 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6064 | <table class="list"><tbody> |
6065 | <tr><th>HTTP_ENCRYPTION_ALWAYS </th> <td class="description">Always encrypt (SSL)</td></tr> | |
6066 | <tr><th>HTTP_ENCRYPTION_IF_REQUESTED </th> <td class="description">Encrypt if requested (TLS upgrade)</td></tr> | |
6067 | <tr><th>HTTP_ENCRYPTION_NEVER </th> <td class="description">Never encrypt</td></tr> | |
6068 | <tr><th>HTTP_ENCRYPTION_REQUIRED </th> <td class="description">Encryption is required (TLS upgrade)</td></tr> | |
6069 | </tbody></table> | |
798d6e29 MS |
6070 | <h3 class="enumeration"><a id="http_field_e">http_field_e</a></h3> |
6071 | <p class="description">HTTP field names</p> | |
6072 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6073 | <table class="list"><tbody> |
6074 | <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> | |
6075 | <tr><th>HTTP_FIELD_ACCEPT_LANGUAGE </th> <td class="description">Accept-Language field</td></tr> | |
6076 | <tr><th>HTTP_FIELD_ACCEPT_RANGES </th> <td class="description">Accept-Ranges field</td></tr> | |
6077 | <tr><th>HTTP_FIELD_ALLOW <span class="info"> CUPS 1.7/macOS 10.9 </span></th> <td class="description">Allow field </td></tr> | |
6078 | <tr><th>HTTP_FIELD_AUTHORIZATION </th> <td class="description">Authorization field</td></tr> | |
6079 | <tr><th>HTTP_FIELD_CONNECTION </th> <td class="description">Connection field</td></tr> | |
6080 | <tr><th>HTTP_FIELD_CONTENT_ENCODING </th> <td class="description">Content-Encoding field</td></tr> | |
6081 | <tr><th>HTTP_FIELD_CONTENT_LANGUAGE </th> <td class="description">Content-Language field</td></tr> | |
6082 | <tr><th>HTTP_FIELD_CONTENT_LENGTH </th> <td class="description">Content-Length field</td></tr> | |
6083 | <tr><th>HTTP_FIELD_CONTENT_LOCATION </th> <td class="description">Content-Location field</td></tr> | |
6084 | <tr><th>HTTP_FIELD_CONTENT_MD5 </th> <td class="description">Content-MD5 field</td></tr> | |
6085 | <tr><th>HTTP_FIELD_CONTENT_RANGE </th> <td class="description">Content-Range field</td></tr> | |
6086 | <tr><th>HTTP_FIELD_CONTENT_TYPE </th> <td class="description">Content-Type field</td></tr> | |
6087 | <tr><th>HTTP_FIELD_CONTENT_VERSION </th> <td class="description">Content-Version field</td></tr> | |
6088 | <tr><th>HTTP_FIELD_DATE </th> <td class="description">Date field</td></tr> | |
6089 | <tr><th>HTTP_FIELD_HOST </th> <td class="description">Host field</td></tr> | |
6090 | <tr><th>HTTP_FIELD_IF_MODIFIED_SINCE </th> <td class="description">If-Modified-Since field</td></tr> | |
6091 | <tr><th>HTTP_FIELD_IF_UNMODIFIED_SINCE </th> <td class="description">If-Unmodified-Since field</td></tr> | |
6092 | <tr><th>HTTP_FIELD_KEEP_ALIVE </th> <td class="description">Keep-Alive field</td></tr> | |
6093 | <tr><th>HTTP_FIELD_LAST_MODIFIED </th> <td class="description">Last-Modified field</td></tr> | |
6094 | <tr><th>HTTP_FIELD_LINK </th> <td class="description">Link field</td></tr> | |
6095 | <tr><th>HTTP_FIELD_LOCATION </th> <td class="description">Location field</td></tr> | |
6096 | <tr><th>HTTP_FIELD_MAX </th> <td class="description">Maximum field index</td></tr> | |
6097 | <tr><th>HTTP_FIELD_RANGE </th> <td class="description">Range field</td></tr> | |
6098 | <tr><th>HTTP_FIELD_REFERER </th> <td class="description">Referer field</td></tr> | |
6099 | <tr><th>HTTP_FIELD_RETRY_AFTER </th> <td class="description">Retry-After field</td></tr> | |
6100 | <tr><th>HTTP_FIELD_SERVER <span class="info"> CUPS 1.7/macOS 10.9 </span></th> <td class="description">Server field </td></tr> | |
6101 | <tr><th>HTTP_FIELD_TRANSFER_ENCODING </th> <td class="description">Transfer-Encoding field</td></tr> | |
6102 | <tr><th>HTTP_FIELD_UNKNOWN </th> <td class="description">Unknown field</td></tr> | |
6103 | <tr><th>HTTP_FIELD_UPGRADE </th> <td class="description">Upgrade field</td></tr> | |
6104 | <tr><th>HTTP_FIELD_USER_AGENT </th> <td class="description">User-Agent field</td></tr> | |
6105 | <tr><th>HTTP_FIELD_WWW_AUTHENTICATE </th> <td class="description">WWW-Authenticate field</td></tr> | |
6106 | </tbody></table> | |
798d6e29 MS |
6107 | <h3 class="enumeration"><a id="http_keepalive_e">http_keepalive_e</a></h3> |
6108 | <p class="description">HTTP keep-alive values</p> | |
6109 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6110 | <table class="list"><tbody> |
6111 | <tr><th>HTTP_KEEPALIVE_OFF </th> <td class="description">No keep alive support</td></tr> | |
6112 | <tr><th>HTTP_KEEPALIVE_ON </th> <td class="description">Use keep alive</td></tr> | |
6113 | </tbody></table> | |
798d6e29 MS |
6114 | <h3 class="enumeration"><a id="http_state_e">http_state_e</a></h3> |
6115 | <p class="description">HTTP state values; states | |
6116 | are server-oriented...</p> | |
6117 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6118 | <table class="list"><tbody> |
6119 | <tr><th>HTTP_STATE_CONNECT </th> <td class="description">CONNECT command, waiting for blank line</td></tr> | |
6120 | <tr><th>HTTP_STATE_DELETE </th> <td class="description">DELETE command, waiting for blank line</td></tr> | |
6121 | <tr><th>HTTP_STATE_ERROR </th> <td class="description">Error on socket</td></tr> | |
6122 | <tr><th>HTTP_STATE_GET </th> <td class="description">GET command, waiting for blank line</td></tr> | |
6123 | <tr><th>HTTP_STATE_GET_SEND </th> <td class="description">GET command, sending data</td></tr> | |
6124 | <tr><th>HTTP_STATE_HEAD </th> <td class="description">HEAD command, waiting for blank line</td></tr> | |
6125 | <tr><th>HTTP_STATE_OPTIONS </th> <td class="description">OPTIONS command, waiting for blank line</td></tr> | |
6126 | <tr><th>HTTP_STATE_POST </th> <td class="description">POST command, waiting for blank line</td></tr> | |
6127 | <tr><th>HTTP_STATE_POST_RECV </th> <td class="description">POST command, receiving data</td></tr> | |
6128 | <tr><th>HTTP_STATE_POST_SEND </th> <td class="description">POST command, sending data</td></tr> | |
6129 | <tr><th>HTTP_STATE_PUT </th> <td class="description">PUT command, waiting for blank line</td></tr> | |
6130 | <tr><th>HTTP_STATE_PUT_RECV </th> <td class="description">PUT command, receiving data</td></tr> | |
6131 | <tr><th>HTTP_STATE_STATUS </th> <td class="description">Command complete, sending status</td></tr> | |
6132 | <tr><th>HTTP_STATE_TRACE </th> <td class="description">TRACE command, waiting for blank line</td></tr> | |
6133 | <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> | |
6134 | <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> | |
6135 | <tr><th>HTTP_STATE_WAITING </th> <td class="description">Waiting for command</td></tr> | |
6136 | </tbody></table> | |
798d6e29 MS |
6137 | <h3 class="enumeration"><a id="http_status_e">http_status_e</a></h3> |
6138 | <p class="description">HTTP status codes</p> | |
6139 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6140 | <table class="list"><tbody> |
6141 | <tr><th>HTTP_STATUS_ACCEPTED </th> <td class="description">DELETE command was successful</td></tr> | |
6142 | <tr><th>HTTP_STATUS_BAD_GATEWAY </th> <td class="description">Bad gateway</td></tr> | |
6143 | <tr><th>HTTP_STATUS_BAD_REQUEST </th> <td class="description">Bad request</td></tr> | |
6144 | <tr><th>HTTP_STATUS_CONFLICT </th> <td class="description">Request is self-conflicting</td></tr> | |
6145 | <tr><th>HTTP_STATUS_CONTINUE </th> <td class="description">Everything OK, keep going...</td></tr> | |
6146 | <tr><th>HTTP_STATUS_CREATED </th> <td class="description">PUT command was successful</td></tr> | |
6147 | <tr><th>HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED <span class="info"> CUPS 1.4 </span></th> <td class="description">User canceled authorization </td></tr> | |
6148 | <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> | |
6149 | <tr><th>HTTP_STATUS_ERROR </th> <td class="description">An error response from httpXxxx()</td></tr> | |
6150 | <tr><th>HTTP_STATUS_EXPECTATION_FAILED </th> <td class="description">The expectation given in an Expect header field was not met</td></tr> | |
6151 | <tr><th>HTTP_STATUS_FORBIDDEN </th> <td class="description">Forbidden to access this URI</td></tr> | |
6152 | <tr><th>HTTP_STATUS_GATEWAY_TIMEOUT </th> <td class="description">Gateway connection timed out</td></tr> | |
6153 | <tr><th>HTTP_STATUS_GONE </th> <td class="description">Server has gone away</td></tr> | |
6154 | <tr><th>HTTP_STATUS_LENGTH_REQUIRED </th> <td class="description">A content length or encoding is required</td></tr> | |
6155 | <tr><th>HTTP_STATUS_METHOD_NOT_ALLOWED </th> <td class="description">Method is not allowed</td></tr> | |
6156 | <tr><th>HTTP_STATUS_MOVED_PERMANENTLY </th> <td class="description">Document has moved permanently</td></tr> | |
6157 | <tr><th>HTTP_STATUS_MOVED_TEMPORARILY </th> <td class="description">Document has moved temporarily</td></tr> | |
6158 | <tr><th>HTTP_STATUS_MULTIPLE_CHOICES </th> <td class="description">Multiple files match request</td></tr> | |
6159 | <tr><th>HTTP_STATUS_NONE <span class="info"> CUPS 1.7/macOS 10.9 </span></th> <td class="description">No Expect value </td></tr> | |
6160 | <tr><th>HTTP_STATUS_NOT_ACCEPTABLE </th> <td class="description">Not Acceptable</td></tr> | |
6161 | <tr><th>HTTP_STATUS_NOT_AUTHORITATIVE </th> <td class="description">Information isn't authoritative</td></tr> | |
6162 | <tr><th>HTTP_STATUS_NOT_FOUND </th> <td class="description">URI was not found</td></tr> | |
6163 | <tr><th>HTTP_STATUS_NOT_IMPLEMENTED </th> <td class="description">Feature not implemented</td></tr> | |
6164 | <tr><th>HTTP_STATUS_NOT_MODIFIED </th> <td class="description">File not modified</td></tr> | |
6165 | <tr><th>HTTP_STATUS_NOT_SUPPORTED </th> <td class="description">HTTP version not supported</td></tr> | |
6166 | <tr><th>HTTP_STATUS_NO_CONTENT </th> <td class="description">Successful command, no new data</td></tr> | |
6167 | <tr><th>HTTP_STATUS_OK </th> <td class="description">OPTIONS/GET/HEAD/POST/TRACE command was successful</td></tr> | |
6168 | <tr><th>HTTP_STATUS_PARTIAL_CONTENT </th> <td class="description">Only a partial file was received/sent</td></tr> | |
6169 | <tr><th>HTTP_STATUS_PAYMENT_REQUIRED </th> <td class="description">Payment required</td></tr> | |
6170 | <tr><th>HTTP_STATUS_PRECONDITION </th> <td class="description">Precondition failed</td></tr> | |
6171 | <tr><th>HTTP_STATUS_PROXY_AUTHENTICATION </th> <td class="description">Proxy Authentication is Required</td></tr> | |
6172 | <tr><th>HTTP_STATUS_REQUESTED_RANGE </th> <td class="description">The requested range is not satisfiable</td></tr> | |
6173 | <tr><th>HTTP_STATUS_REQUEST_TIMEOUT </th> <td class="description">Request timed out</td></tr> | |
6174 | <tr><th>HTTP_STATUS_REQUEST_TOO_LARGE </th> <td class="description">Request entity too large</td></tr> | |
6175 | <tr><th>HTTP_STATUS_RESET_CONTENT </th> <td class="description">Content was reset/recreated</td></tr> | |
6176 | <tr><th>HTTP_STATUS_SEE_OTHER </th> <td class="description">See this other link...</td></tr> | |
6177 | <tr><th>HTTP_STATUS_SERVER_ERROR </th> <td class="description">Internal server error</td></tr> | |
6178 | <tr><th>HTTP_STATUS_SERVICE_UNAVAILABLE </th> <td class="description">Service is unavailable</td></tr> | |
6179 | <tr><th>HTTP_STATUS_SWITCHING_PROTOCOLS </th> <td class="description">HTTP upgrade to TLS/SSL</td></tr> | |
6180 | <tr><th>HTTP_STATUS_UNAUTHORIZED </th> <td class="description">Unauthorized to access host</td></tr> | |
6181 | <tr><th>HTTP_STATUS_UNSUPPORTED_MEDIATYPE </th> <td class="description">The requested media type is unsupported</td></tr> | |
6182 | <tr><th>HTTP_STATUS_UPGRADE_REQUIRED </th> <td class="description">Upgrade to SSL/TLS required</td></tr> | |
6183 | <tr><th>HTTP_STATUS_URI_TOO_LONG </th> <td class="description">URI too long</td></tr> | |
6184 | <tr><th>HTTP_STATUS_USE_PROXY </th> <td class="description">Must use a proxy to access this URI</td></tr> | |
6185 | </tbody></table> | |
798d6e29 MS |
6186 | <h3 class="enumeration"><a id="http_trust_e"><span class="info"> CUPS 2.0/OS 10.10 </span>http_trust_e</a></h3> |
6187 | <p class="description">Level of trust for credentials </p> | |
6188 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6189 | <table class="list"><tbody> |
6190 | <tr><th>HTTP_TRUST_CHANGED </th> <td class="description">Credentials have changed</td></tr> | |
6191 | <tr><th>HTTP_TRUST_EXPIRED </th> <td class="description">Credentials are expired</td></tr> | |
6192 | <tr><th>HTTP_TRUST_INVALID </th> <td class="description">Credentials are invalid</td></tr> | |
6193 | <tr><th>HTTP_TRUST_OK </th> <td class="description">Credentials are OK/trusted</td></tr> | |
6194 | <tr><th>HTTP_TRUST_RENEWED </th> <td class="description">Credentials have been renewed</td></tr> | |
6195 | <tr><th>HTTP_TRUST_UNKNOWN </th> <td class="description">Credentials are unknown/new</td></tr> | |
6196 | </tbody></table> | |
798d6e29 MS |
6197 | <h3 class="enumeration"><a id="http_uri_coding_e">http_uri_coding_e</a></h3> |
6198 | <p class="description">URI en/decode flags</p> | |
6199 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6200 | <table class="list"><tbody> |
6201 | <tr><th>HTTP_URI_CODING_ALL </th> <td class="description">En/decode everything</td></tr> | |
6202 | <tr><th>HTTP_URI_CODING_HOSTNAME </th> <td class="description">En/decode the hostname portion</td></tr> | |
6203 | <tr><th>HTTP_URI_CODING_MOST </th> <td class="description">En/decode all but the query</td></tr> | |
6204 | <tr><th>HTTP_URI_CODING_NONE </th> <td class="description">Don't en/decode anything</td></tr> | |
6205 | <tr><th>HTTP_URI_CODING_QUERY </th> <td class="description">En/decode the query portion</td></tr> | |
6206 | <tr><th>HTTP_URI_CODING_RESOURCE </th> <td class="description">En/decode the resource portion</td></tr> | |
6207 | <tr><th>HTTP_URI_CODING_RFC6874 </th> <td class="description">Use RFC 6874 address format</td></tr> | |
6208 | <tr><th>HTTP_URI_CODING_USERNAME </th> <td class="description">En/decode the username portion</td></tr> | |
6209 | </tbody></table> | |
798d6e29 MS |
6210 | <h3 class="enumeration"><a id="http_uri_status_e"><span class="info"> CUPS 1.2 </span>http_uri_status_e</a></h3> |
6211 | <p class="description">URI separation status </p> | |
6212 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6213 | <table class="list"><tbody> |
6214 | <tr><th>HTTP_URI_STATUS_BAD_ARGUMENTS </th> <td class="description">Bad arguments to function (error)</td></tr> | |
6215 | <tr><th>HTTP_URI_STATUS_BAD_HOSTNAME </th> <td class="description">Bad hostname in URI (error)</td></tr> | |
6216 | <tr><th>HTTP_URI_STATUS_BAD_PORT </th> <td class="description">Bad port number in URI (error)</td></tr> | |
6217 | <tr><th>HTTP_URI_STATUS_BAD_RESOURCE </th> <td class="description">Bad resource in URI (error)</td></tr> | |
6218 | <tr><th>HTTP_URI_STATUS_BAD_SCHEME </th> <td class="description">Bad scheme in URI (error)</td></tr> | |
6219 | <tr><th>HTTP_URI_STATUS_BAD_URI </th> <td class="description">Bad/empty URI (error)</td></tr> | |
6220 | <tr><th>HTTP_URI_STATUS_BAD_USERNAME </th> <td class="description">Bad username in URI (error)</td></tr> | |
6221 | <tr><th>HTTP_URI_STATUS_MISSING_RESOURCE </th> <td class="description">Missing resource in URI (warning)</td></tr> | |
6222 | <tr><th>HTTP_URI_STATUS_MISSING_SCHEME </th> <td class="description">Missing scheme in URI (warning)</td></tr> | |
6223 | <tr><th>HTTP_URI_STATUS_OK </th> <td class="description">URI decoded OK</td></tr> | |
6224 | <tr><th>HTTP_URI_STATUS_OVERFLOW </th> <td class="description">URI buffer for httpAssembleURI is too small</td></tr> | |
6225 | <tr><th>HTTP_URI_STATUS_UNKNOWN_SCHEME </th> <td class="description">Unknown scheme in URI (warning)</td></tr> | |
6226 | </tbody></table> | |
798d6e29 | 6227 | <h3 class="enumeration"><a id="ipp_finishings_e">ipp_finishings_e</a></h3> |
718ee2ff | 6228 | <p class="description">Finishings values</p> |
798d6e29 | 6229 | <h4 class="constants">Constants</h4> |
98d88c8d MS |
6230 | <table class="list"><tbody> |
6231 | <tr><th>IPP_FINISHINGS_BALE </th> <td class="description">Bale (any type)</td></tr> | |
6232 | <tr><th>IPP_FINISHINGS_BIND </th> <td class="description">Bind</td></tr> | |
6233 | <tr><th>IPP_FINISHINGS_BIND_BOTTOM </th> <td class="description">Bind on bottom</td></tr> | |
6234 | <tr><th>IPP_FINISHINGS_BIND_LEFT </th> <td class="description">Bind on left</td></tr> | |
6235 | <tr><th>IPP_FINISHINGS_BIND_RIGHT </th> <td class="description">Bind on right</td></tr> | |
6236 | <tr><th>IPP_FINISHINGS_BIND_TOP </th> <td class="description">Bind on top</td></tr> | |
6237 | <tr><th>IPP_FINISHINGS_BOOKLET_MAKER </th> <td class="description">Fold to make booklet</td></tr> | |
6238 | <tr><th>IPP_FINISHINGS_COAT </th> <td class="description">Apply protective liquid or powder coating</td></tr> | |
6239 | <tr><th>IPP_FINISHINGS_COVER </th> <td class="description">Add cover</td></tr> | |
6240 | <tr><th>IPP_FINISHINGS_EDGE_STITCH </th> <td class="description">Stitch along any side</td></tr> | |
6241 | <tr><th>IPP_FINISHINGS_EDGE_STITCH_BOTTOM </th> <td class="description">Stitch along bottom edge</td></tr> | |
6242 | <tr><th>IPP_FINISHINGS_EDGE_STITCH_LEFT </th> <td class="description">Stitch along left side</td></tr> | |
6243 | <tr><th>IPP_FINISHINGS_EDGE_STITCH_RIGHT </th> <td class="description">Stitch along right side</td></tr> | |
6244 | <tr><th>IPP_FINISHINGS_EDGE_STITCH_TOP </th> <td class="description">Stitch along top edge</td></tr> | |
6245 | <tr><th>IPP_FINISHINGS_FOLD </th> <td class="description">Fold (any type)</td></tr> | |
6246 | <tr><th>IPP_FINISHINGS_FOLD_ACCORDIAN </th> <td class="description">Accordian-fold the paper vertically into four sections</td></tr> | |
6247 | <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> | |
6248 | <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> | |
6249 | <tr><th>IPP_FINISHINGS_FOLD_GATE </th> <td class="description">Fold the top and bottom quarters of the paper towards the midline</td></tr> | |
6250 | <tr><th>IPP_FINISHINGS_FOLD_HALF </th> <td class="description">Fold the paper in half vertically</td></tr> | |
6251 | <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> | |
6252 | <tr><th>IPP_FINISHINGS_FOLD_LEFT_GATE </th> <td class="description">Fold the top quarter of the paper towards the midline</td></tr> | |
6253 | <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> | |
6254 | <tr><th>IPP_FINISHINGS_FOLD_PARALLEL </th> <td class="description">Fold the paper in half vertically two times, yielding four sections</td></tr> | |
6255 | <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> | |
6256 | <tr><th>IPP_FINISHINGS_FOLD_RIGHT_GATE </th> <td class="description">Fold the bottom quarter of the paper towards the midline</td></tr> | |
6257 | <tr><th>IPP_FINISHINGS_FOLD_Z </th> <td class="description">Fold the paper vertically into three sections, forming a Z</td></tr> | |
6258 | <tr><th>IPP_FINISHINGS_JOG_OFFSET </th> <td class="description">Offset for binding (any type)</td></tr> | |
6259 | <tr><th>IPP_FINISHINGS_LAMINATE </th> <td class="description">Apply protective (solid) material</td></tr> | |
6260 | <tr><th>IPP_FINISHINGS_NONE </th> <td class="description">No finishing</td></tr> | |
6261 | <tr><th>IPP_FINISHINGS_PUNCH </th> <td class="description">Punch (any location/count)</td></tr> | |
6262 | <tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_LEFT </th> <td class="description">Punch 1 hole bottom left</td></tr> | |
6263 | <tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT </th> <td class="description">Punch 1 hole bottom right</td></tr> | |
6264 | <tr><th>IPP_FINISHINGS_PUNCH_DUAL_BOTTOM </th> <td class="description">Punch 2 holes bottom edge</td></tr> | |
6265 | <tr><th>IPP_FINISHINGS_PUNCH_DUAL_LEFT </th> <td class="description">Punch 2 holes left side</td></tr> | |
6266 | <tr><th>IPP_FINISHINGS_PUNCH_DUAL_RIGHT </th> <td class="description">Punch 2 holes right side</td></tr> | |
6267 | <tr><th>IPP_FINISHINGS_PUNCH_DUAL_TOP </th> <td class="description">Punch 2 holes top edge</td></tr> | |
6268 | <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM </th> <td class="description">Pucnh multiple holes bottom edge</td></tr> | |
6269 | <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT </th> <td class="description">Pucnh multiple holes left side</td></tr> | |
6270 | <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT </th> <td class="description">Pucnh multiple holes right side</td></tr> | |
6271 | <tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_TOP </th> <td class="description">Pucnh multiple holes top edge</td></tr> | |
6272 | <tr><th>IPP_FINISHINGS_PUNCH_QUAD_BOTTOM </th> <td class="description">Punch 4 holes bottom edge</td></tr> | |
6273 | <tr><th>IPP_FINISHINGS_PUNCH_QUAD_LEFT </th> <td class="description">Punch 4 holes left side</td></tr> | |
6274 | <tr><th>IPP_FINISHINGS_PUNCH_QUAD_RIGHT </th> <td class="description">Punch 4 holes right side</td></tr> | |
6275 | <tr><th>IPP_FINISHINGS_PUNCH_QUAD_TOP </th> <td class="description">Punch 4 holes top edge</td></tr> | |
6276 | <tr><th>IPP_FINISHINGS_PUNCH_TOP_LEFT </th> <td class="description">Punch 1 hole top left</td></tr> | |
6277 | <tr><th>IPP_FINISHINGS_PUNCH_TOP_RIGHT </th> <td class="description">Punch 1 hole top right</td></tr> | |
6278 | <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM </th> <td class="description">Punch 3 holes bottom edge</td></tr> | |
6279 | <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_LEFT </th> <td class="description">Punch 3 holes left side</td></tr> | |
6280 | <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT </th> <td class="description">Punch 3 holes right side</td></tr> | |
6281 | <tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_TOP </th> <td class="description">Punch 3 holes top edge</td></tr> | |
6282 | <tr><th>IPP_FINISHINGS_SADDLE_STITCH </th> <td class="description">Staple interior</td></tr> | |
6283 | <tr><th>IPP_FINISHINGS_STAPLE </th> <td class="description">Staple (any location/method)</td></tr> | |
6284 | <tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_LEFT </th> <td class="description">Staple bottom left corner</td></tr> | |
6285 | <tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT </th> <td class="description">Staple bottom right corner</td></tr> | |
6286 | <tr><th>IPP_FINISHINGS_STAPLE_DUAL_BOTTOM </th> <td class="description">Two staples on bottom</td></tr> | |
6287 | <tr><th>IPP_FINISHINGS_STAPLE_DUAL_LEFT </th> <td class="description">Two staples on left</td></tr> | |
6288 | <tr><th>IPP_FINISHINGS_STAPLE_DUAL_RIGHT </th> <td class="description">Two staples on right</td></tr> | |
6289 | <tr><th>IPP_FINISHINGS_STAPLE_DUAL_TOP </th> <td class="description">Two staples on top</td></tr> | |
6290 | <tr><th>IPP_FINISHINGS_STAPLE_TOP_LEFT </th> <td class="description">Staple top left corner</td></tr> | |
6291 | <tr><th>IPP_FINISHINGS_STAPLE_TOP_RIGHT </th> <td class="description">Staple top right corner</td></tr> | |
6292 | <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM </th> <td class="description">Three staples on bottom</td></tr> | |
6293 | <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_LEFT </th> <td class="description">Three staples on left</td></tr> | |
6294 | <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT </th> <td class="description">Three staples on right</td></tr> | |
6295 | <tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_TOP </th> <td class="description">Three staples on top</td></tr> | |
6296 | <tr><th>IPP_FINISHINGS_TRIM </th> <td class="description">Trim (any type)</td></tr> | |
6297 | <tr><th>IPP_FINISHINGS_TRIM_AFTER_COPIES </th> <td class="description">Trim output after each copy</td></tr> | |
6298 | <tr><th>IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS </th> <td class="description">Trim output after each document</td></tr> | |
6299 | <tr><th>IPP_FINISHINGS_TRIM_AFTER_JOB </th> <td class="description">Trim output after job</td></tr> | |
6300 | <tr><th>IPP_FINISHINGS_TRIM_AFTER_PAGES </th> <td class="description">Trim output after each page</td></tr> | |
6301 | </tbody></table> | |
798d6e29 MS |
6302 | <h3 class="enumeration"><a id="ipp_jstate_e">ipp_jstate_e</a></h3> |
6303 | <p class="description">Job states</p> | |
6304 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6305 | <table class="list"><tbody> |
6306 | <tr><th>IPP_JSTATE_ABORTED </th> <td class="description">Job has aborted due to error</td></tr> | |
6307 | <tr><th>IPP_JSTATE_CANCELED </th> <td class="description">Job has been canceled</td></tr> | |
6308 | <tr><th>IPP_JSTATE_COMPLETED </th> <td class="description">Job has completed successfully</td></tr> | |
6309 | <tr><th>IPP_JSTATE_HELD </th> <td class="description">Job is held for printing</td></tr> | |
6310 | <tr><th>IPP_JSTATE_PENDING </th> <td class="description">Job is waiting to be printed</td></tr> | |
6311 | <tr><th>IPP_JSTATE_PROCESSING </th> <td class="description">Job is currently printing</td></tr> | |
6312 | <tr><th>IPP_JSTATE_STOPPED </th> <td class="description">Job has been stopped</td></tr> | |
6313 | </tbody></table> | |
798d6e29 MS |
6314 | <h3 class="enumeration"><a id="ipp_op_e">ipp_op_e</a></h3> |
6315 | <p class="description">IPP operations</p> | |
6316 | <h4 class="constants">Constants</h4> | |
98d88c8d | 6317 | <table class="list"><tbody> |
4f63d6cd | 6318 | <tr><th>IPP_OP_ALLOCATE_PRINTER_RESOURCES </th> <td class="description">Allocate-Printer-Resources: Use resources for a printer.</td></tr> |
98d88c8d MS |
6319 | <tr><th>IPP_OP_CANCEL_CURRENT_JOB </th> <td class="description">Cancel-Current-Job: Cancel the current job</td></tr> |
6320 | <tr><th>IPP_OP_CANCEL_JOB </th> <td class="description">Cancel-Job: Cancel a job</td></tr> | |
6321 | <tr><th>IPP_OP_CANCEL_JOBS </th> <td class="description">Cancel-Jobs: Cancel all jobs (administrative)</td></tr> | |
6322 | <tr><th>IPP_OP_CANCEL_MY_JOBS </th> <td class="description">Cancel-My-Jobs: Cancel a user's jobs</td></tr> | |
4f63d6cd | 6323 | <tr><th>IPP_OP_CANCEL_RESOURCE </th> <td class="description">Cancel-Resource: Uninstall a resource.</td></tr> |
98d88c8d MS |
6324 | <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> |
6325 | <tr><th>IPP_OP_CLOSE_JOB </th> <td class="description">Close-Job: Close a job and start printing</td></tr> | |
6326 | <tr><th>IPP_OP_CREATE_JOB </th> <td class="description">Create-Job: Create an empty print job</td></tr> | |
6327 | <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 | 6328 | <tr><th>IPP_OP_CREATE_PRINTER </th> <td class="description">Create-Printer: Create a new service.</td></tr> |
98d88c8d | 6329 | <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 |
6330 | <tr><th>IPP_OP_CREATE_RESOURCE </th> <td class="description">Create-Resource: Create a new (empty) resource.</td></tr> |
6331 | <tr><th>IPP_OP_CREATE_RESOURCE_SUBSCRIPTIONS </th> <td class="description">Create-Resource-Subscriptions: Create event subscriptions for a resource.</td></tr> | |
6332 | <tr><th>IPP_OP_CREATE_SYSTEM_SUBSCRIPTIONS </th> <td class="description">Create-System-Subscriptions: Create event subscriptions for a system.</td></tr> | |
98d88c8d MS |
6333 | <tr><th>IPP_OP_CUPS_ADD_MODIFY_CLASS </th> <td class="description">CUPS-Add-Modify-Class: Add or modify a class</td></tr> |
6334 | <tr><th>IPP_OP_CUPS_ADD_MODIFY_PRINTER </th> <td class="description">CUPS-Add-Modify-Printer: Add or modify a printer</td></tr> | |
6335 | <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> | |
6336 | <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> | |
6337 | <tr><th>IPP_OP_CUPS_DELETE_CLASS </th> <td class="description">CUPS-Delete-Class: Delete a class</td></tr> | |
6338 | <tr><th>IPP_OP_CUPS_DELETE_PRINTER </th> <td class="description">CUPS-Delete-Printer: Delete a printer</td></tr> | |
6339 | <tr><th>IPP_OP_CUPS_GET_DEFAULT </th> <td class="description">CUPS-Get-Default: Get the default printer</td></tr> | |
6340 | <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> | |
6341 | <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> | |
6342 | <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> | |
6343 | <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> | |
6344 | <tr><th>IPP_OP_CUPS_GET_PRINTERS </th> <td class="description">CUPS-Get-Printers: Get a list of printers and/or classes</td></tr> | |
6345 | <tr><th>IPP_OP_CUPS_INVALID </th> <td class="description">Invalid operation name for <a href="#ippOpValue"><code>ippOpValue</code></a></td></tr> | |
6346 | <tr><th>IPP_OP_CUPS_MOVE_JOB </th> <td class="description">CUPS-Move-Job: Move a job to a different printer</td></tr> | |
6347 | <tr><th>IPP_OP_CUPS_SET_DEFAULT </th> <td class="description">CUPS-Set-Default: Set the default printer</td></tr> | |
4f63d6cd MS |
6348 | <tr><th>IPP_OP_DEALLOCATE_PRINTER_RESOURCES </th> <td class="description">Deallocate-Printer-Resources: Stop using resources for a printer.</td></tr> |
6349 | <tr><th>IPP_OP_DELETE_PRINTER </th> <td class="description">Delete-Printer: Delete an existing service.</td></tr> | |
6350 | <tr><th>IPP_OP_DISABLE_ALL_PRINTERS </th> <td class="description">Disable-All-Printers: Stop accepting new jobs on all services.</td></tr> | |
98d88c8d | 6351 | <tr><th>IPP_OP_DISABLE_PRINTER </th> <td class="description">Disable-Printer: Reject new jobs for a printer</td></tr> |
4f63d6cd | 6352 | <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 |
6353 | <tr><th>IPP_OP_ENABLE_PRINTER </th> <td class="description">Enable-Printer: Accept new jobs for a printer</td></tr> |
6354 | <tr><th>IPP_OP_GET_JOBS </th> <td class="description">Get-Jobs: Get a list of jobs</td></tr> | |
6355 | <tr><th>IPP_OP_GET_JOB_ATTRIBUTES </th> <td class="description">Get-Job-Attribute: Get information about a job</td></tr> | |
6356 | <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 | 6357 | <tr><th>IPP_OP_GET_PRINTERS </th> <td class="description">Get-Printers: Get a list of services.</td></tr> |
98d88c8d MS |
6358 | <tr><th>IPP_OP_GET_PRINTER_ATTRIBUTES </th> <td class="description">Get-Printer-Attributes: Get information about a printer</td></tr> |
6359 | <tr><th>IPP_OP_GET_PRINTER_SUPPORTED_VALUES </th> <td class="description">Get-Printer-Supported-Values: Get supported values</td></tr> | |
6360 | <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> | |
6361 | <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 |
6362 | <tr><th>IPP_OP_GET_SYSTEM_ATTRIBUTES </th> <td class="description">Get-System-Attributes: Get system object attributes.</td></tr> |
6363 | <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 |
6364 | <tr><th>IPP_OP_HOLD_JOB </th> <td class="description">Hold-Job: Hold a job for printing</td></tr> |
6365 | <tr><th>IPP_OP_HOLD_NEW_JOBS </th> <td class="description">Hold-New-Jobs: Hold new jobs</td></tr> | |
6366 | <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 |
6367 | <tr><th>IPP_OP_INSTALL_RESOURCE </th> <td class="description">Install-Resource: Install a resource.</td></tr> |
6368 | <tr><th>IPP_OP_PAUSE_ALL_PRINTERS </th> <td class="description">Pause-All-Printers: Stop all services immediately.</td></tr> | |
6369 | <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 |
6370 | <tr><th>IPP_OP_PAUSE_PRINTER </th> <td class="description">Pause-Printer: Stop a printer</td></tr> |
6371 | <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> | |
6372 | <tr><th>IPP_OP_PRINT_JOB </th> <td class="description">Print-Job: Print a single file</td></tr> | |
6373 | <tr><th>IPP_OP_PROMOTE_JOB </th> <td class="description">Promote-Job: Promote a job to print sooner</td></tr> | |
4f63d6cd | 6374 | <tr><th>IPP_OP_REGISTER_OUTPUT_DEVICE </th> <td class="description">Register-Output-Device: Register a remote service.</td></tr> |
98d88c8d MS |
6375 | <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> |
6376 | <tr><th>IPP_OP_RELEASE_JOB </th> <td class="description">Release-Job: Release a job for printing</td></tr> | |
6377 | <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> | |
6378 | <tr><th>IPP_OP_RESTART_JOB <span class="info"> DEPRECATED </span></th> <td class="description">Restart-Job: Reprint a job </td></tr> | |
4f63d6cd MS |
6379 | <tr><th>IPP_OP_RESTART_SYSTEM </th> <td class="description">Restart-System: Restart all services.</td></tr> |
6380 | <tr><th>IPP_OP_RESUME_ALL_PRINTERS </th> <td class="description">Resume-All-Printers: Start job processing on all services.</td></tr> | |
98d88c8d MS |
6381 | <tr><th>IPP_OP_RESUME_JOB </th> <td class="description">Resume-Job: Resume the current job</td></tr> |
6382 | <tr><th>IPP_OP_RESUME_PRINTER </th> <td class="description">Resume-Printer: Start a printer</td></tr> | |
6383 | <tr><th>IPP_OP_SCHEDULE_JOB_AFTER </th> <td class="description">Schedule-Job-After: Schedule a job to print after another</td></tr> | |
6384 | <tr><th>IPP_OP_SEND_DOCUMENT </th> <td class="description">Send-Document: Add a file to a job</td></tr> | |
4f63d6cd | 6385 | <tr><th>IPP_OP_SEND_RESOURCE_DATA </th> <td class="description">Send-Resource-Data: Upload the data for a resource.</td></tr> |
98d88c8d MS |
6386 | <tr><th>IPP_OP_SET_JOB_ATTRIBUTES </th> <td class="description">Set-Job-Attributes: Set job values</td></tr> |
6387 | <tr><th>IPP_OP_SET_PRINTER_ATTRIBUTES </th> <td class="description">Set-Printer-Attributes: Set printer values</td></tr> | |
4f63d6cd MS |
6388 | <tr><th>IPP_OP_SET_RESOURCE_ATTRIBUTES </th> <td class="description">Set-Resource-Attributes: Set resource object attributes.</td></tr> |
6389 | <tr><th>IPP_OP_SET_SYSTEM_ATTRIBUTES </th> <td class="description">Set-System-Attributes: Set system object attributes.</td></tr> | |
6390 | <tr><th>IPP_OP_SHUTDOWN_ALL_PRINTERS </th> <td class="description">Shutdown-All-Printers: Shutdown all services.</td></tr> | |
6391 | <tr><th>IPP_OP_SHUTDOWN_ONE_PRINTER </th> <td class="description">Shutdown-One-Printer: Shutdown a service.</td></tr> | |
6392 | <tr><th>IPP_OP_STARTUP_ALL_PRINTERS </th> <td class="description">Startup-All-Printers: Startup all services.</td></tr> | |
6393 | <tr><th>IPP_OP_STARTUP_ONE_PRINTER </th> <td class="description">Startup-One-Printer: Start a service.</td></tr> | |
98d88c8d MS |
6394 | <tr><th>IPP_OP_SUSPEND_CURRENT_JOB </th> <td class="description">Suspend-Current-Job: Suspend the current job</td></tr> |
6395 | <tr><th>IPP_OP_VALIDATE_JOB </th> <td class="description">Validate-Job: Validate job values prior to submission</td></tr> | |
6396 | </tbody></table> | |
798d6e29 MS |
6397 | <h3 class="enumeration"><a id="ipp_orient_e">ipp_orient_e</a></h3> |
6398 | <p class="description">Orientation values</p> | |
6399 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6400 | <table class="list"><tbody> |
6401 | <tr><th>IPP_ORIENT_LANDSCAPE </th> <td class="description">90 degrees counter-clockwise</td></tr> | |
6402 | <tr><th>IPP_ORIENT_NONE </th> <td class="description">No rotation</td></tr> | |
6403 | <tr><th>IPP_ORIENT_PORTRAIT </th> <td class="description">No rotation</td></tr> | |
6404 | <tr><th>IPP_ORIENT_REVERSE_LANDSCAPE </th> <td class="description">90 degrees clockwise</td></tr> | |
6405 | <tr><th>IPP_ORIENT_REVERSE_PORTRAIT </th> <td class="description">180 degrees</td></tr> | |
6406 | </tbody></table> | |
798d6e29 | 6407 | <h3 class="enumeration"><a id="ipp_pstate_e">ipp_pstate_e</a></h3> |
65bebeac | 6408 | <p class="description">Printer state values</p> |
798d6e29 | 6409 | <h4 class="constants">Constants</h4> |
98d88c8d MS |
6410 | <table class="list"><tbody> |
6411 | <tr><th>IPP_PSTATE_IDLE </th> <td class="description">Printer is idle</td></tr> | |
6412 | <tr><th>IPP_PSTATE_PROCESSING </th> <td class="description">Printer is working</td></tr> | |
6413 | <tr><th>IPP_PSTATE_STOPPED </th> <td class="description">Printer is stopped</td></tr> | |
6414 | </tbody></table> | |
798d6e29 | 6415 | <h3 class="enumeration"><a id="ipp_quality_e">ipp_quality_e</a></h3> |
65bebeac | 6416 | <p class="description">Print quality values</p> |
798d6e29 | 6417 | <h4 class="constants">Constants</h4> |
98d88c8d MS |
6418 | <table class="list"><tbody> |
6419 | <tr><th>IPP_QUALITY_DRAFT </th> <td class="description">Draft quality</td></tr> | |
6420 | <tr><th>IPP_QUALITY_HIGH </th> <td class="description">High quality</td></tr> | |
6421 | <tr><th>IPP_QUALITY_NORMAL </th> <td class="description">Normal quality</td></tr> | |
6422 | </tbody></table> | |
798d6e29 MS |
6423 | <h3 class="enumeration"><a id="ipp_res_e">ipp_res_e</a></h3> |
6424 | <p class="description">Resolution units</p> | |
6425 | <h4 class="constants">Constants</h4> | |
98d88c8d MS |
6426 | <table class="list"><tbody> |
6427 | <tr><th>IPP_RES_PER_CM </th> <td class="description">Pixels per centimeter</td></tr> | |
6428 | <tr><th>IPP_RES_PER_INCH </th> <td class="description">Pixels per inch</td></tr> | |
6429 | </tbody></table> | |
798d6e29 | 6430 | <h3 class="enumeration"><a id="ipp_state_e">ipp_state_e</a></h3> |
65bebeac | 6431 | <p class="description">ipp_t state values</p> |
798d6e29 | 6432 | <h4 class="constants">Constants</h4> |
98d88c8d MS |
6433 | <table class="list"><tbody> |
6434 | <tr><th>IPP_STATE_ATTRIBUTE </th> <td class="description">One or more attributes need to be sent/received</td></tr> | |
6435 | <tr><th>IPP_STATE_DATA </th> <td class="description">IPP request data needs to be sent/received</td></tr> | |
6436 | <tr><th>IPP_STATE_ERROR </th> <td class="description">An error occurred</td></tr> | |
6437 | <tr><th>IPP_STATE_HEADER </th> <td class="description">The request header needs to be sent/received</td></tr> | |
6438 | <tr><th>IPP_STATE_IDLE </th> <td class="description">Nothing is happening/request completed</td></tr> | |
6439 | </tbody></table> | |
798d6e29 | 6440 | <h3 class="enumeration"><a id="ipp_status_e">ipp_status_e</a></h3> |
65bebeac | 6441 | <p class="description">IPP status code values</p> |
798d6e29 | 6442 | <h4 class="constants">Constants</h4> |
98d88c8d MS |
6443 | <table class="list"><tbody> |
6444 | <tr><th>IPP_STATUS_CUPS_INVALID </th> <td class="description">Invalid status name for <a href="#ippErrorValue"><code>ippErrorValue</code></a></td></tr> | |
6445 | <tr><th>IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED </th> <td class="description">client-error-account-authorization-failed</td></tr> | |
6446 | <tr><th>IPP_STATUS_ERROR_ACCOUNT_CLOSED </th> <td class="description">client-error-account-closed</td></tr> | |
6447 | <tr><th>IPP_STATUS_ERROR_ACCOUNT_INFO_NEEDED </th> <td class="description">client-error-account-info-needed</td></tr> | |
6448 | <tr><th>IPP_STATUS_ERROR_ACCOUNT_LIMIT_REACHED </th> <td class="description">client-error-account-limit-reached</td></tr> | |
6449 | <tr><th>IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE </th> <td class="description">client-error-attributes-not-settable</td></tr> | |
6450 | <tr><th>IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES </th> <td class="description">client-error-attributes-or-values-not-supported</td></tr> | |
6451 | <tr><th>IPP_STATUS_ERROR_BAD_REQUEST </th> <td class="description">client-error-bad-request</td></tr> | |
6452 | <tr><th>IPP_STATUS_ERROR_BUSY </th> <td class="description">server-error-busy</td></tr> | |
6453 | <tr><th>IPP_STATUS_ERROR_CHARSET </th> <td class="description">client-error-charset-not-supported</td></tr> | |
6454 | <tr><th>IPP_STATUS_ERROR_COMPRESSION_ERROR </th> <td class="description">client-error-compression-error</td></tr> | |
6455 | <tr><th>IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED </th> <td class="description">client-error-compression-not-supported</td></tr> | |
6456 | <tr><th>IPP_STATUS_ERROR_CONFLICTING </th> <td class="description">client-error-conflicting-attributes</td></tr> | |
6457 | <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> | |
6458 | <tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED </th> <td class="description">cups-error-account-closed @deprecate@</td></tr> | |
6459 | <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> | |
6460 | <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> | |
6461 | <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> | |
6462 | <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> | |
6463 | <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> | |
6464 | <tr><th>IPP_STATUS_ERROR_DEVICE </th> <td class="description">server-error-device-error</td></tr> | |
6465 | <tr><th>IPP_STATUS_ERROR_DOCUMENT_ACCESS </th> <td class="description">client-error-document-access-error</td></tr> | |
6466 | <tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR </th> <td class="description">client-error-document-format-error</td></tr> | |
6467 | <tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED </th> <td class="description">client-error-document-format-not-supported</td></tr> | |
6468 | <tr><th>IPP_STATUS_ERROR_DOCUMENT_PASSWORD </th> <td class="description">client-error-document-password-error</td></tr> | |
6469 | <tr><th>IPP_STATUS_ERROR_DOCUMENT_PERMISSION </th> <td class="description">client-error-document-permission-error</td></tr> | |
6470 | <tr><th>IPP_STATUS_ERROR_DOCUMENT_SECURITY </th> <td class="description">client-error-document-security-error</td></tr> | |
6471 | <tr><th>IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE </th> <td class="description">client-error-document-unprintable-error</td></tr> | |
6472 | <tr><th>IPP_STATUS_ERROR_FORBIDDEN </th> <td class="description">client-error-forbidden</td></tr> | |
6473 | <tr><th>IPP_STATUS_ERROR_GONE </th> <td class="description">client-error-gone</td></tr> | |
6474 | <tr><th>IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS </th> <td class="description">client-error-ignored-all-subscriptions</td></tr> | |
6475 | <tr><th>IPP_STATUS_ERROR_INTERNAL </th> <td class="description">server-error-internal-error</td></tr> | |
6476 | <tr><th>IPP_STATUS_ERROR_JOB_CANCELED </th> <td class="description">server-error-job-canceled</td></tr> | |
6477 | <tr><th>IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED </th> <td class="description">server-error-multiple-document-jobs-not-supported</td></tr> | |
6478 | <tr><th>IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS </th> <td class="description">server-error-not-accepting-jobs</td></tr> | |
6479 | <tr><th>IPP_STATUS_ERROR_NOT_AUTHENTICATED </th> <td class="description">client-error-not-authenticated</td></tr> | |
6480 | <tr><th>IPP_STATUS_ERROR_NOT_AUTHORIZED </th> <td class="description">client-error-not-authorized</td></tr> | |
6481 | <tr><th>IPP_STATUS_ERROR_NOT_FETCHABLE </th> <td class="description">client-error-not-fetchable</td></tr> | |
6482 | <tr><th>IPP_STATUS_ERROR_NOT_FOUND </th> <td class="description">client-error-not-found</td></tr> | |
6483 | <tr><th>IPP_STATUS_ERROR_NOT_POSSIBLE </th> <td class="description">client-error-not-possible</td></tr> | |
6484 | <tr><th>IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED </th> <td class="description">server-error-operation-not-supported</td></tr> | |
6485 | <tr><th>IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED </th> <td class="description">server-error-printer-is-deactivated</td></tr> | |
6486 | <tr><th>IPP_STATUS_ERROR_REQUEST_ENTITY </th> <td class="description">client-error-request-entity-too-large</td></tr> | |
6487 | <tr><th>IPP_STATUS_ERROR_REQUEST_VALUE </th> <td class="description">client-error-request-value-too-long</td></tr> | |
6488 | <tr><th>IPP_STATUS_ERROR_SERVICE_UNAVAILABLE </th> <td class="description">server-error-service-unavailable</td></tr> | |
6489 | <tr><th>IPP_STATUS_ERROR_TEMPORARY </th> <td class="description">server-error-temporary-error</td></tr> | |
6490 | <tr><th>IPP_STATUS_ERROR_TIMEOUT </th> <td class="description">client-error-timeout</td></tr> | |
6491 | <tr><th>IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS </th> <td class="description">server-error-too-many-documents</td></tr> | |
6492 | <tr><th>IPP_STATUS_ERROR_TOO_MANY_JOBS </th> <td class="description">server-error-too-many-jobs</td></tr> | |
6493 | <tr><th>IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS </th> <td class="description">client-error-too-many-subscriptions</td></tr> | |
6494 | <tr><th>IPP_STATUS_ERROR_URI_SCHEME </th> <td class="description">client-error-uri-scheme-not-supported</td></tr> | |
6495 | <tr><th>IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED </th> <td class="description">server-error-version-not-supported</td></tr> | |
6496 | <tr><th>IPP_STATUS_OK </th> <td class="description">successful-ok</td></tr> | |
6497 | <tr><th>IPP_STATUS_OK_CONFLICTING </th> <td class="description">successful-ok-conflicting-attributes</td></tr> | |
6498 | <tr><th>IPP_STATUS_OK_EVENTS_COMPLETE </th> <td class="description">successful-ok-events-complete</td></tr> | |
6499 | <tr><th>IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED </th> <td class="description">successful-ok-ignored-or-substituted-attributes</td></tr> | |
6500 | <tr><th>IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS </th> <td class="description">successful-ok-ignored-subscriptions</td></tr> | |
6501 | <tr><th>IPP_STATUS_OK_TOO_MANY_EVENTS </th> <td class="description">successful-ok-too-many-events</td></tr> | |
6502 | </tbody></table> | |
798d6e29 | 6503 | <h3 class="enumeration"><a id="ipp_tag_e">ipp_tag_e</a></h3> |
65bebeac | 6504 | <p class="description">Value and group tag values for attributes</p> |
798d6e29 | 6505 | <h4 class="constants">Constants</h4> |
98d88c8d MS |
6506 | <table class="list"><tbody> |
6507 | <tr><th>IPP_TAG_ADMINDEFINE </th> <td class="description">Admin-defined value</td></tr> | |
6508 | <tr><th>IPP_TAG_BOOLEAN </th> <td class="description">Boolean value</td></tr> | |
6509 | <tr><th>IPP_TAG_CHARSET </th> <td class="description">Character set value</td></tr> | |
6510 | <tr><th>IPP_TAG_CUPS_INVALID </th> <td class="description">Invalid tag name for <a href="#ippTagValue"><code>ippTagValue</code></a></td></tr> | |
6511 | <tr><th>IPP_TAG_DATE </th> <td class="description">Date/time value</td></tr> | |
6512 | <tr><th>IPP_TAG_DEFAULT </th> <td class="description">Default value</td></tr> | |
6513 | <tr><th>IPP_TAG_DELETEATTR </th> <td class="description">Delete-attribute value</td></tr> | |
4f63d6cd | 6514 | <tr><th>IPP_TAG_DOCUMENT </th> <td class="description">Document group</td></tr> |
98d88c8d MS |
6515 | <tr><th>IPP_TAG_END </th> <td class="description">End-of-attributes</td></tr> |
6516 | <tr><th>IPP_TAG_ENUM </th> <td class="description">Enumeration value</td></tr> | |
6517 | <tr><th>IPP_TAG_EVENT_NOTIFICATION </th> <td class="description">Event group</td></tr> | |
6518 | <tr><th>IPP_TAG_INTEGER </th> <td class="description">Integer value</td></tr> | |
6519 | <tr><th>IPP_TAG_JOB </th> <td class="description">Job group</td></tr> | |
6520 | <tr><th>IPP_TAG_KEYWORD </th> <td class="description">Keyword value</td></tr> | |
6521 | <tr><th>IPP_TAG_LANGUAGE </th> <td class="description">Language value</td></tr> | |
6522 | <tr><th>IPP_TAG_MIMETYPE </th> <td class="description">MIME media type value</td></tr> | |
6523 | <tr><th>IPP_TAG_NAME </th> <td class="description">Name value</td></tr> | |
6524 | <tr><th>IPP_TAG_NAMELANG </th> <td class="description">Name-with-language value</td></tr> | |
6525 | <tr><th>IPP_TAG_NOTSETTABLE </th> <td class="description">Not-settable value</td></tr> | |
6526 | <tr><th>IPP_TAG_NOVALUE </th> <td class="description">No-value value</td></tr> | |
6527 | <tr><th>IPP_TAG_OPERATION </th> <td class="description">Operation group</td></tr> | |
6528 | <tr><th>IPP_TAG_PRINTER </th> <td class="description">Printer group</td></tr> | |
6529 | <tr><th>IPP_TAG_RANGE </th> <td class="description">Range value</td></tr> | |
6530 | <tr><th>IPP_TAG_RESOLUTION </th> <td class="description">Resolution value</td></tr> | |
4f63d6cd | 6531 | <tr><th>IPP_TAG_RESOURCE </th> <td class="description">Resource group</td></tr> |
98d88c8d MS |
6532 | <tr><th>IPP_TAG_STRING </th> <td class="description">Octet string value</td></tr> |
6533 | <tr><th>IPP_TAG_SUBSCRIPTION </th> <td class="description">Subscription group</td></tr> | |
4f63d6cd | 6534 | <tr><th>IPP_TAG_SYSTEM </th> <td class="description">System group</td></tr> |
98d88c8d MS |
6535 | <tr><th>IPP_TAG_TEXT </th> <td class="description">Text value</td></tr> |
6536 | <tr><th>IPP_TAG_TEXTLANG </th> <td class="description">Text-with-language value</td></tr> | |
6537 | <tr><th>IPP_TAG_UNKNOWN </th> <td class="description">Unknown value</td></tr> | |
6538 | <tr><th>IPP_TAG_UNSUPPORTED_GROUP </th> <td class="description">Unsupported attributes group</td></tr> | |
6539 | <tr><th>IPP_TAG_UNSUPPORTED_VALUE </th> <td class="description">Unsupported value</td></tr> | |
6540 | <tr><th>IPP_TAG_URI </th> <td class="description">URI value</td></tr> | |
6541 | <tr><th>IPP_TAG_URISCHEME </th> <td class="description">URI scheme value</td></tr> | |
6542 | <tr><th>IPP_TAG_ZERO </th> <td class="description">Zero tag - used for separators</td></tr> | |
6543 | </tbody></table> | |
798d6e29 MS |
6544 | </div> |
6545 | </body> | |
6546 | </html> |