]> git.ipfire.org Git - thirdparty/cups.git/blob - doc/help/api-httpipp.html
Merge changes from CUPS 1.6svn-r10390.
[thirdparty/cups.git] / doc / help / api-httpipp.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- SECTION: Programming -->
4 <head>
5 <title>HTTP and IPP APIs </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.7">
9 <style type="text/css"><!--
10 BODY {
11 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
12 }
13
14 H1, H2, H3, H4, H5, H6, P, TD, TH {
15 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
16 }
17
18 KBD {
19 font-family: monaco, courier, monospace;
20 font-weight: bold;
21 }
22
23 PRE {
24 font-family: monaco, courier, monospace;
25 }
26
27 PRE.command {
28 border: dotted thin #7f7f7f;
29 margin-left: 36pt;
30 padding: 10px;
31 }
32
33 P.compact {
34 margin: 0;
35 }
36
37 P.example {
38 font-style: italic;
39 margin-left: 36pt;
40 }
41
42 PRE.example {
43 background: #eeeeee;
44 border: dotted thin #999999;
45 margin-left: 36pt;
46 padding: 10pt;
47 }
48
49 PRE.command EM, PRE.example EM {
50 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
51 }
52
53 P.command {
54 font-family: monaco, courier, monospace;
55 margin-left: 36pt;
56 }
57
58 P.formula {
59 font-style: italic;
60 margin-left: 36pt;
61 }
62
63 BLOCKQUOTE {
64 background: #eeeeee;
65 border: solid thin #999999;
66 padding: 10pt;
67 }
68
69 A IMG {
70 border: none;
71 }
72
73 A:link:hover IMG {
74 background: #f0f0f0;
75 border-radius: 10px;
76 -moz-border-radius: 10px;
77 }
78
79 A:link, A:visited {
80 font-weight: normal;
81 text-decoration: none;
82 }
83
84 A:link:hover, A:visited:hover, A:active {
85 text-decoration: underline;
86 }
87
88 SUB, SUP {
89 font-size: 50%;
90 }
91
92 TR.data, TD.data, TR.data TD {
93 margin-top: 10pt;
94 padding: 5pt;
95 border-bottom: solid 1pt #999999;
96 }
97
98 TR.data TH {
99 border-bottom: solid 1pt #999999;
100 padding-top: 10pt;
101 padding-left: 5pt;
102 text-align: left;
103 }
104
105 DIV.table TABLE {
106 border: solid thin #999999;
107 border-collapse: collapse;
108 border-spacing: 0;
109 margin-left: auto;
110 margin-right: auto;
111 }
112
113 DIV.table CAPTION {
114 caption-side: top;
115 font-size: 120%;
116 font-style: italic;
117 font-weight: bold;
118 margin-left: auto;
119 margin-right: auto;
120 }
121
122 DIV.table TABLE TD {
123 border: solid thin #cccccc;
124 padding-top: 5pt;
125 }
126
127 DIV.table TABLE TH {
128 background: #cccccc;
129 border: none;
130 border-bottom: solid thin #999999;
131 }
132
133 DIV.figure TABLE {
134 margin-left: auto;
135 margin-right: auto;
136 }
137
138 DIV.figure CAPTION {
139 caption-side: bottom;
140 font-size: 120%;
141 font-style: italic;
142 font-weight: bold;
143 margin-left: auto;
144 margin-right: auto;
145 }
146
147 TH.label {
148 text-align: right;
149 vertical-align: top;
150 }
151
152 TH.sublabel {
153 text-align: right;
154 font-weight: normal;
155 }
156
157 HR {
158 border: solid thin;
159 }
160
161 SPAN.info {
162 background: black;
163 border: thin solid black;
164 color: white;
165 font-size: 80%;
166 font-style: italic;
167 font-weight: bold;
168 white-space: nowrap;
169 }
170
171 H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
172 float: right;
173 font-size: 100%;
174 }
175
176 H1.title {
177 }
178
179 H2.title, H3.title {
180 border-bottom: solid 2pt #000000;
181 }
182
183 DIV.indent, TABLE.indent {
184 margin-top: 2em;
185 margin-left: auto;
186 margin-right: auto;
187 width: 90%;
188 }
189
190 TABLE.indent {
191 border-collapse: collapse;
192 }
193
194 TABLE.indent TD, TABLE.indent TH {
195 padding: 0;
196 }
197
198 TABLE.list {
199 border-collapse: collapse;
200 margin-left: auto;
201 margin-right: auto;
202 width: 90%;
203 }
204
205 TABLE.list TH {
206 background: white;
207 border-bottom: solid thin #cccccc;
208 color: #444444;
209 padding-top: 10pt;
210 padding-left: 5pt;
211 text-align: left;
212 vertical-align: bottom;
213 white-space: nowrap;
214 }
215
216 TABLE.list TH A {
217 color: #4444cc;
218 }
219
220 TABLE.list TD {
221 border-bottom: solid thin #eeeeee;
222 padding-top: 5pt;
223 padding-left: 5pt;
224 }
225
226 TABLE.list TR:nth-child(even) {
227 background: #f8f8f8;
228 }
229
230 TABLE.list TR:nth-child(odd) {
231 background: #f4f4f4;
232 }
233
234 DT {
235 margin-left: 36pt;
236 margin-top: 12pt;
237 }
238
239 DD {
240 margin-left: 54pt;
241 }
242
243 DL.category DT {
244 font-weight: bold;
245 }
246
247 P.summary {
248 margin-left: 36pt;
249 font-family: monaco, courier, monospace;
250 }
251
252 DIV.summary TABLE {
253 border: solid thin #999999;
254 border-collapse: collapse;
255 border-spacing: 0;
256 margin: 10px;
257 }
258
259 DIV.summary TABLE TD, DIV.summary TABLE TH {
260 border: solid thin #999999;
261 padding: 5px;
262 text-align: left;
263 vertical-align: top;
264 }
265
266 DIV.summary TABLE THEAD TH {
267 background: #eeeeee;
268 }
269
270 /* API documentation styles... */
271 div.body h1 {
272 margin: 0;
273 }
274 div.body h2 {
275 margin-top: 1.5em;
276 }
277 div.body h3, div.body h4, div.body h5 {
278 margin-bottom: 0.5em;
279 margin-top: 1.5em;
280 }
281 .class, .enumeration, .function, .struct, .typedef, .union {
282 border-bottom: solid thin #999999;
283 margin-bottom: 0;
284 margin-top: 2em;
285 }
286 .description {
287 margin-top: 0.5em;
288 }
289 code, p.code, pre, ul.code li {
290 font-family: monaco, courier, monospace;
291 font-size: 90%;
292 }
293 ul.code, ul.contents, ul.subcontents {
294 list-style-type: none;
295 margin: 0;
296 padding-left: 0;
297 }
298 ul.code li {
299 margin: 0;
300 }
301 ul.contents > li {
302 margin-top: 1em;
303 }
304 ul.contents li ul.code, ul.contents li ul.subcontents {
305 padding-left: 2em;
306 }
307 div.body dl {
308 margin-left: 0;
309 margin-top: 0;
310 }
311 div.body dt {
312 font-style: italic;
313 margin-left: 0;
314 margin-top: 0;
315 }
316 div.body dd {
317 margin-bottom: 0.5em;
318 }
319
320 /* This is just for the HTML files generated with the framedhelp target */
321 div.contents {
322 background: #e8e8e8;
323 border: solid thin black;
324 padding: 10px;
325 }
326 div.contents h1 {
327 font-size: 110%;
328 }
329 div.contents h2 {
330 font-size: 100%;
331 }
332 div.contents ul.contents {
333 font-size: 80%;
334 }
335 div.contents ul.subcontents li {
336 margin-left: 1em;
337 text-indent: -1em;
338 }
339 --></style>
340 </head>
341 <body>
342 <div class='body'>
343 <!--
344 "$Id$"
345
346 HTTP and IPP API header for CUPS.
347
348 Copyright 2007-2011 by Apple Inc.
349 Copyright 1997-2006 by Easy Software Products, all rights reserved.
350
351 These coded instructions, statements, and computer programs are the
352 property of Apple Inc. and are protected by Federal copyright
353 law. Distribution and use rights are outlined in the file "LICENSE.txt"
354 which should have been included with this file. If this file is
355 file is missing or damaged, see the license at "http://www.cups.org/".
356 -->
357
358 <h1 class='title'>HTTP and IPP APIs</h1>
359
360 <div class='summary'><table summary='General Information'>
361 <thead>
362 <tr>
363 <th>Header</th>
364 <th>cups/cups.h</th>
365 </tr>
366 </thead>
367 <tbody>
368 <tr>
369 <th>Library</th>
370 <td>-lcups</td>
371 </tr>
372 <tr>
373 <th>See Also</th>
374 <td>Programming: <a href='api-overview.html'>Introduction to CUPS Programming</a><br>
375 Programming: <a href='api-cups.html'>CUPS API</a><br>
376 References: <a href='spec-ipp.html'>CUPS Implementation of IPP</a></td>
377 </tr>
378 </tbody>
379 </table></div>
380 <h2 class="title">Contents</h2>
381 <ul class="contents">
382 <li><a href="#OVERVIEW">Overview</a><ul class="subcontents">
383 <li><a href="#CREATING_URI_STRINGS">Creating URI Strings</a></li>
384 <li><a href="#SENDING_REQUESTS_WITH_FILES">Sending Requests with Files</a></li>
385 <li><a href="#ASYNCHRONOUS_REQUEST_PROCESSING">Asynchronous Request Processing</a></li>
386 </ul></li>
387 <li><a href="#FUNCTIONS">Functions</a><ul class="code">
388 <li><a href="#cupsDoAuthentication" title="Authenticate a request.">cupsDoAuthentication</a></li>
389 <li><a href="#cupsDoFileRequest" title="Do an IPP request with a file.">cupsDoFileRequest</a></li>
390 <li><a href="#cupsDoIORequest" title="Do an IPP request with file descriptors.">cupsDoIORequest</a></li>
391 <li><a href="#cupsDoRequest" title="Do an IPP request.">cupsDoRequest</a></li>
392 <li><a href="#cupsEncodeOptions" title="Encode printer options into IPP attributes.">cupsEncodeOptions</a></li>
393 <li><a href="#cupsEncodeOptions2" title="Encode printer options into IPP attributes for a group.">cupsEncodeOptions2</a></li>
394 <li><a href="#cupsGetDevices" title="Get available printer devices.">cupsGetDevices</a></li>
395 <li><a href="#cupsGetFd" title="Get a file from the server.">cupsGetFd</a></li>
396 <li><a href="#cupsGetFile" title="Get a file from the server.">cupsGetFile</a></li>
397 <li><a href="#cupsGetResponse" title="Get a response to an IPP request.">cupsGetResponse</a></li>
398 <li><a href="#cupsLastError" title="Return the last IPP status code.">cupsLastError</a></li>
399 <li><a href="#cupsLastErrorString" title="Return the last IPP status-message.">cupsLastErrorString</a></li>
400 <li><a href="#cupsPutFd" title="Put a file on the server.">cupsPutFd</a></li>
401 <li><a href="#cupsPutFile" title="Put a file on the server.">cupsPutFile</a></li>
402 <li><a href="#cupsReadResponseData" title="Read additional data after the IPP response.">cupsReadResponseData</a></li>
403 <li><a href="#cupsSendRequest" title="Send an IPP request.">cupsSendRequest</a></li>
404 <li><a href="#cupsWriteRequestData" title="Write additional data after an IPP request.">cupsWriteRequestData</a></li>
405 <li><a href="#httpAddCredential" title="Allocates and adds a single credential to an array.">httpAddCredential</a></li>
406 <li><a href="#httpAddrAny" title="Check for the &quot;any&quot; address.">httpAddrAny</a></li>
407 <li><a href="#httpAddrEqual" title="Compare two addresses.">httpAddrEqual</a></li>
408 <li><a href="#httpAddrLength" title="Return the length of the address in bytes.">httpAddrLength</a></li>
409 <li><a href="#httpAddrLocalhost" title="Check for the local loopback address.">httpAddrLocalhost</a></li>
410 <li><a href="#httpAddrLookup" title="Lookup the hostname associated with the address.">httpAddrLookup</a></li>
411 <li><a href="#httpAddrString" title="Convert an address to a numeric string.">httpAddrString</a></li>
412 <li><a href="#httpAssembleURI" title="Assemble a uniform resource identifier from its
413 components.">httpAssembleURI</a></li>
414 <li><a href="#httpAssembleURIf" title="Assemble a uniform resource identifier from its
415 components with a formatted resource.">httpAssembleURIf</a></li>
416 <li><a href="#httpBlocking" title="Set blocking/non-blocking behavior on a connection.">httpBlocking</a></li>
417 <li><a href="#httpCheck" title="Check to see if there is a pending response from the server.">httpCheck</a></li>
418 <li><a href="#httpClearCookie" title="Clear the cookie value(s).">httpClearCookie</a></li>
419 <li><a href="#httpClearFields" title="Clear HTTP request fields.">httpClearFields</a></li>
420 <li><a href="#httpClose" title="Close an HTTP connection.">httpClose</a></li>
421 <li><a href="#httpConnect" title="Connect to a HTTP server.">httpConnect</a></li>
422 <li><a href="#httpConnectEncrypt" title="Connect to a HTTP server using encryption.">httpConnectEncrypt</a></li>
423 <li><a href="#httpCopyCredentials" title="Copy the credentials associated with an encrypted
424 connection.">httpCopyCredentials</a></li>
425 <li><a href="#httpDecode64" title="Base64-decode a string.">httpDecode64</a></li>
426 <li><a href="#httpDecode64_2" title="Base64-decode a string.">httpDecode64_2</a></li>
427 <li><a href="#httpDelete" title="Send a DELETE request to the server.">httpDelete</a></li>
428 <li><a href="#httpEncode64" title="Base64-encode a string.">httpEncode64</a></li>
429 <li><a href="#httpEncode64_2" title="Base64-encode a string.">httpEncode64_2</a></li>
430 <li><a href="#httpEncryption" title="Set the required encryption on the link.">httpEncryption</a></li>
431 <li><a href="#httpError" title="Get the last error on a connection.">httpError</a></li>
432 <li><a href="#httpFlush" title="Flush data from a HTTP connection.">httpFlush</a></li>
433 <li><a href="#httpFlushWrite" title="Flush data in write buffer.">httpFlushWrite</a></li>
434 <li><a href="#httpFreeCredentials" title="Free an array of credentials.">httpFreeCredentials</a></li>
435 <li><a href="#httpGet" title="Send a GET request to the server.">httpGet</a></li>
436 <li><a href="#httpGetAuthString" title="Get the current authorization string.">httpGetAuthString</a></li>
437 <li><a href="#httpGetBlocking" title="Get the blocking/non-block state of a connection.">httpGetBlocking</a></li>
438 <li><a href="#httpGetCookie" title="Get any cookie data from the response.">httpGetCookie</a></li>
439 <li><a href="#httpGetDateString" title="Get a formatted date/time string from a time value.">httpGetDateString</a></li>
440 <li><a href="#httpGetDateString2" title="Get a formatted date/time string from a time value.">httpGetDateString2</a></li>
441 <li><a href="#httpGetDateTime" title="Get a time value from a formatted date/time string.">httpGetDateTime</a></li>
442 <li><a href="#httpGetFd" title="Get the file descriptor associated with a connection.">httpGetFd</a></li>
443 <li><a href="#httpGetField" title="Get a field value from a request/response.">httpGetField</a></li>
444 <li><a href="#httpGetHostByName" title="Lookup a hostname or IPv4 address, and return
445 address records for the specified name.">httpGetHostByName</a></li>
446 <li><a href="#httpGetHostname" title="Get the FQDN for the connection or local system.">httpGetHostname</a></li>
447 <li><a href="#httpGetLength" title="Get the amount of data remaining from the
448 content-length or transfer-encoding fields.">httpGetLength</a></li>
449 <li><a href="#httpGetLength2" title="Get the amount of data remaining from the
450 content-length or transfer-encoding fields.">httpGetLength2</a></li>
451 <li><a href="#httpGetState" title="Get the current state of the HTTP request.">httpGetState</a></li>
452 <li><a href="#httpGetStatus" title="Get the status of the last HTTP request.">httpGetStatus</a></li>
453 <li><a href="#httpGetSubField" title="Get a sub-field value.">httpGetSubField</a></li>
454 <li><a href="#httpGetSubField2" title="Get a sub-field value.">httpGetSubField2</a></li>
455 <li><a href="#httpGetVersion" title="Get the HTTP version at the other end.">httpGetVersion</a></li>
456 <li><a href="#httpGets" title="Get a line of text from a HTTP connection.">httpGets</a></li>
457 <li><a href="#httpHead" title="Send a HEAD request to the server.">httpHead</a></li>
458 <li><a href="#httpInitialize" title="Initialize the HTTP interface library and set the
459 default HTTP proxy (if any).">httpInitialize</a></li>
460 <li><a href="#httpMD5" title="Compute the MD5 sum of the username:group:password.">httpMD5</a></li>
461 <li><a href="#httpMD5Final" title="Combine the MD5 sum of the username, group, and password
462 with the server-supplied nonce value, method, and
463 request-uri.">httpMD5Final</a></li>
464 <li><a href="#httpMD5String" title="Convert an MD5 sum to a character string.">httpMD5String</a></li>
465 <li><a href="#httpOptions" title="Send an OPTIONS request to the server.">httpOptions</a></li>
466 <li><a href="#httpPost" title="Send a POST request to the server.">httpPost</a></li>
467 <li><a href="#httpPut" title="Send a PUT request to the server.">httpPut</a></li>
468 <li><a href="#httpRead" title="Read data from a HTTP connection.">httpRead</a></li>
469 <li><a href="#httpRead2" title="Read data from a HTTP connection.">httpRead2</a></li>
470 <li><a href="#httpReconnect" title="Reconnect to a HTTP server.">httpReconnect</a></li>
471 <li><a href="#httpReconnect2" title="Reconnect to a HTTP server with timeout and optional
472 cancel.">httpReconnect2</a></li>
473 <li><a href="#httpSeparate" title="Separate a Universal Resource Identifier into its
474 components.">httpSeparate</a></li>
475 <li><a href="#httpSeparate2" title="Separate a Universal Resource Identifier into its
476 components.">httpSeparate2</a></li>
477 <li><a href="#httpSeparateURI" title="Separate a Universal Resource Identifier into its
478 components.">httpSeparateURI</a></li>
479 <li><a href="#httpSetAuthString" title="Set the current authorization string.">httpSetAuthString</a></li>
480 <li><a href="#httpSetCookie" title="Set the cookie value(s).">httpSetCookie</a></li>
481 <li><a href="#httpSetCredentials" title="Set the credentials associated with an encrypted
482 connection.">httpSetCredentials</a></li>
483 <li><a href="#httpSetExpect" title="Set the Expect: header in a request.">httpSetExpect</a></li>
484 <li><a href="#httpSetField" title="Set the value of an HTTP header.">httpSetField</a></li>
485 <li><a href="#httpSetLength" title="Set the content-length and content-encoding.">httpSetLength</a></li>
486 <li><a href="#httpSetTimeout" title="Set read/write timeouts and an optional callback.">httpSetTimeout</a></li>
487 <li><a href="#httpStatus" title="Return a short string describing a HTTP status code.">httpStatus</a></li>
488 <li><a href="#httpTrace" title="Send an TRACE request to the server.">httpTrace</a></li>
489 <li><a href="#httpUpdate" title="Update the current HTTP state for incoming data.">httpUpdate</a></li>
490 <li><a href="#httpWait" title="Wait for data available on a connection.">httpWait</a></li>
491 <li><a href="#httpWrite" title="Write data to a HTTP connection.">httpWrite</a></li>
492 <li><a href="#httpWrite2" title="Write data to a HTTP connection.">httpWrite2</a></li>
493 <li><a href="#ippAddBoolean" title="Add a boolean attribute to an IPP message.">ippAddBoolean</a></li>
494 <li><a href="#ippAddBooleans" title="Add an array of boolean values.">ippAddBooleans</a></li>
495 <li><a href="#ippAddCollection" title="Add a collection value.">ippAddCollection</a></li>
496 <li><a href="#ippAddCollections" title="Add an array of collection values.">ippAddCollections</a></li>
497 <li><a href="#ippAddDate" title="Add a date attribute to an IPP message.">ippAddDate</a></li>
498 <li><a href="#ippAddInteger" title="Add a integer attribute to an IPP message.">ippAddInteger</a></li>
499 <li><a href="#ippAddIntegers" title="Add an array of integer values.">ippAddIntegers</a></li>
500 <li><a href="#ippAddOctetString" title="Add an octetString value to an IPP message.">ippAddOctetString</a></li>
501 <li><a href="#ippAddOutOfBand" title="Add an out-of-band value to an IPP message.">ippAddOutOfBand</a></li>
502 <li><a href="#ippAddRange" title="Add a range of values to an IPP message.">ippAddRange</a></li>
503 <li><a href="#ippAddRanges" title="Add ranges of values to an IPP message.">ippAddRanges</a></li>
504 <li><a href="#ippAddResolution" title="Add a resolution value to an IPP message.">ippAddResolution</a></li>
505 <li><a href="#ippAddResolutions" title="Add resolution values to an IPP message.">ippAddResolutions</a></li>
506 <li><a href="#ippAddSeparator" title="Add a group separator to an IPP message.">ippAddSeparator</a></li>
507 <li><a href="#ippAddString" title="Add a language-encoded string to an IPP message.">ippAddString</a></li>
508 <li><a href="#ippAddStrings" title="Add language-encoded strings to an IPP message.">ippAddStrings</a></li>
509 <li><a href="#ippAttributeString" title="Convert the attribute's value to a string.">ippAttributeString</a></li>
510 <li><a href="#ippCopyAttribute" title="Copy an attribute.">ippCopyAttribute</a></li>
511 <li><a href="#ippCopyAttributes" title="Copy attributes from one IPP message to another.">ippCopyAttributes</a></li>
512 <li><a href="#ippDateToTime" title="Convert from RFC 1903 Date/Time format to UNIX time
513 in seconds.">ippDateToTime</a></li>
514 <li><a href="#ippDelete" title="Delete an IPP message.">ippDelete</a></li>
515 <li><a href="#ippDeleteAttribute" title="Delete a single attribute in an IPP message.">ippDeleteAttribute</a></li>
516 <li><a href="#ippDeleteValues" title="Delete values in an attribute.">ippDeleteValues</a></li>
517 <li><a href="#ippEnumString" title="Return a string corresponding to the enum value.">ippEnumString</a></li>
518 <li><a href="#ippEnumValue" title="Return the value associated with a given enum string.">ippEnumValue</a></li>
519 <li><a href="#ippErrorString" title="Return a name for the given status code.">ippErrorString</a></li>
520 <li><a href="#ippErrorValue" title="Return a status code for the given name.">ippErrorValue</a></li>
521 <li><a href="#ippFindAttribute" title="Find a named attribute in a request.">ippFindAttribute</a></li>
522 <li><a href="#ippFindNextAttribute" title="Find the next named attribute in a request.">ippFindNextAttribute</a></li>
523 <li><a href="#ippFirstAttribute" title="Return the first attribute in the message.">ippFirstAttribute</a></li>
524 <li><a href="#ippGetBoolean" title="Get a boolean value for an attribute.">ippGetBoolean</a></li>
525 <li><a href="#ippGetCollection" title="Get a collection value for an attribute.">ippGetCollection</a></li>
526 <li><a href="#ippGetCount" title="Get the number of values in an attribute.">ippGetCount</a></li>
527 <li><a href="#ippGetDate" title="Get a date value for an attribute.">ippGetDate</a></li>
528 <li><a href="#ippGetGroupTag" title="Get the group associated with an attribute.">ippGetGroupTag</a></li>
529 <li><a href="#ippGetInteger" title="Get the integer/enum value for an attribute.">ippGetInteger</a></li>
530 <li><a href="#ippGetName" title="Get the attribute name.">ippGetName</a></li>
531 <li><a href="#ippGetOperation" title="Get the operation ID in an IPP message.">ippGetOperation</a></li>
532 <li><a href="#ippGetRange" title="Get a rangeOfInteger value from an attribute.">ippGetRange</a></li>
533 <li><a href="#ippGetRequestId" title="Get the request ID from an IPP message.">ippGetRequestId</a></li>
534 <li><a href="#ippGetResolution" title="Get a resolution value for an attribute.">ippGetResolution</a></li>
535 <li><a href="#ippGetState" title="Get the IPP message state.">ippGetState</a></li>
536 <li><a href="#ippGetStatusCode" title="Get the status code from an IPP response or event message.">ippGetStatusCode</a></li>
537 <li><a href="#ippGetString" title="Return the value...">ippGetString</a></li>
538 <li><a href="#ippGetValueTag" title="Get the value tag for an attribute.">ippGetValueTag</a></li>
539 <li><a href="#ippGetVersion" title="Get the major and minor version number from an IPP message.">ippGetVersion</a></li>
540 <li><a href="#ippLength" title="Compute the length of an IPP message.">ippLength</a></li>
541 <li><a href="#ippNew" title="Allocate a new IPP message.">ippNew</a></li>
542 <li><a href="#ippNewRequest" title="Allocate a new IPP request message.">ippNewRequest</a></li>
543 <li><a href="#ippNextAttribute" title="Return the next attribute in the message.">ippNextAttribute</a></li>
544 <li><a href="#ippOpString" title="Return a name for the given operation id.">ippOpString</a></li>
545 <li><a href="#ippOpValue" title="Return an operation id for the given name.">ippOpValue</a></li>
546 <li><a href="#ippPort" title="Return the default IPP port number.">ippPort</a></li>
547 <li><a href="#ippRead" title="Read data for an IPP message from a HTTP connection.">ippRead</a></li>
548 <li><a href="#ippReadFile" title="Read data for an IPP message from a file.">ippReadFile</a></li>
549 <li><a href="#ippReadIO" title="Read data for an IPP message.">ippReadIO</a></li>
550 <li><a href="#ippSetBoolean" title="Set a boolean value in an attribute.">ippSetBoolean</a></li>
551 <li><a href="#ippSetCollection" title="Set a collection value in an attribute.">ippSetCollection</a></li>
552 <li><a href="#ippSetDate" title="Set a date value in an attribute.">ippSetDate</a></li>
553 <li><a href="#ippSetGroupTag" title="Set the group tag of an attribute.">ippSetGroupTag</a></li>
554 <li><a href="#ippSetInteger" title="Set an integer or enum value in an attribute.">ippSetInteger</a></li>
555 <li><a href="#ippSetName" title="Set the name of an attribute.">ippSetName</a></li>
556 <li><a href="#ippSetOperation" title="Set the operation ID in an IPP request message.">ippSetOperation</a></li>
557 <li><a href="#ippSetPort" title="Set the default port number.">ippSetPort</a></li>
558 <li><a href="#ippSetRange" title="Set a rangeOfInteger value in an attribute.">ippSetRange</a></li>
559 <li><a href="#ippSetRequestId" title="Set the request ID in an IPP message.">ippSetRequestId</a></li>
560 <li><a href="#ippSetResolution" title="Set a resolution value in an attribute.">ippSetResolution</a></li>
561 <li><a href="#ippSetState" title="Set the current state of the IPP message.">ippSetState</a></li>
562 <li><a href="#ippSetStatusCode" title="Set the status code in an IPP response or event message.">ippSetStatusCode</a></li>
563 <li><a href="#ippSetString" title="Set a string value in an attribute.">ippSetString</a></li>
564 <li><a href="#ippSetValueTag" title="Set the value tag of an attribute.">ippSetValueTag</a></li>
565 <li><a href="#ippSetVersion" title="Set the version number in an IPP message.">ippSetVersion</a></li>
566 <li><a href="#ippTagString" title="Return the tag name corresponding to a tag value.">ippTagString</a></li>
567 <li><a href="#ippTagValue" title="Return the tag value corresponding to a tag name.">ippTagValue</a></li>
568 <li><a href="#ippTimeToDate" title="Convert from UNIX time to RFC 1903 format.">ippTimeToDate</a></li>
569 <li><a href="#ippWrite" title="Write data for an IPP message to a HTTP connection.">ippWrite</a></li>
570 <li><a href="#ippWriteFile" title="Write data for an IPP message to a file.">ippWriteFile</a></li>
571 <li><a href="#ippWriteIO" title="Write data for an IPP message.">ippWriteIO</a></li>
572 </ul></li>
573 <li><a href="#TYPES">Data Types</a><ul class="code">
574 <li><a href="#gss_auth_identity_desc" title="Local functions...">gss_auth_identity_desc</a></li>
575 <li><a href="#http_addr_t" title="Socket address union, which
576 makes using IPv6 and other
577 address types easier and
578 more portable. ">http_addr_t</a></li>
579 <li><a href="#http_addrlist_t" title="Socket address list, which is
580 used to enumerate all of the
581 addresses that are associated
582 with a hostname. ">http_addrlist_t</a></li>
583 <li><a href="#http_auth_t" title="HTTP authentication types">http_auth_t</a></li>
584 <li><a href="#http_credential_t" title="HTTP credential data ">http_credential_t</a></li>
585 <li><a href="#http_encoding_t" title="HTTP transfer encoding values">http_encoding_t</a></li>
586 <li><a href="#http_encryption_t" title="HTTP encryption values">http_encryption_t</a></li>
587 <li><a href="#http_field_t" title="HTTP field names">http_field_t</a></li>
588 <li><a href="#http_keepalive_t" title="HTTP keep-alive values">http_keepalive_t</a></li>
589 <li><a href="#http_state_t" title="HTTP state values; states
590 are server-oriented...">http_state_t</a></li>
591 <li><a href="#http_status_t" title="HTTP status codes">http_status_t</a></li>
592 <li><a href="#http_t" title="HTTP connection type">http_t</a></li>
593 <li><a href="#http_timeout_cb_t" title="HTTP timeout callback ">http_timeout_cb_t</a></li>
594 <li><a href="#http_uri_coding_t" title="URI en/decode flags">http_uri_coding_t</a></li>
595 <li><a href="#http_uri_status_t" title="URI separation status ">http_uri_status_t</a></li>
596 <li><a href="#http_version_t" title="HTTP version numbers">http_version_t</a></li>
597 <li><a href="#ipp_attribute_t" title="IPP attribute">ipp_attribute_t</a></li>
598 <li><a href="#ipp_copycb_t" title="The following structures are PRIVATE starting with CUPS 1.6. Please use the
599 new accessor functions available in CUPS 1.6 and later, as these definitions
600 will be moved to a private header file in a future release.">ipp_copycb_t</a></li>
601 <li><a href="#ipp_dstate_t" title="Document states">ipp_dstate_t</a></li>
602 <li><a href="#ipp_finish_t" title="Finishings">ipp_finish_t</a></li>
603 <li><a href="#ipp_iocb_t" title="IPP IO Callback Function ">ipp_iocb_t</a></li>
604 <li><a href="#ipp_jcollate_t" title="Job collation types">ipp_jcollate_t</a></li>
605 <li><a href="#ipp_orient_t" title="Orientation values">ipp_orient_t</a></li>
606 <li><a href="#ipp_pstate_t" title="Printer states">ipp_pstate_t</a></li>
607 <li><a href="#ipp_quality_t" title="Qualities">ipp_quality_t</a></li>
608 <li><a href="#ipp_res_t" title="Resolution units">ipp_res_t</a></li>
609 <li><a href="#ipp_state_t" title="IPP states">ipp_state_t</a></li>
610 <li><a href="#ipp_t" title="IPP request/response data">ipp_t</a></li>
611 <li><a href="#ipp_uchar_t" title="Unsigned 8-bit integer/character">ipp_uchar_t</a></li>
612 </ul></li>
613 <li><a href="#STRUCTURES">Structures</a><ul class="code">
614 <li><a href="#gss_auth_identity" title="Local functions...">gss_auth_identity</a></li>
615 <li><a href="#http_addrlist_s" title="Socket address list, which is
616 used to enumerate all of the
617 addresses that are associated
618 with a hostname. ">http_addrlist_s</a></li>
619 <li><a href="#http_credential_s" title="HTTP credential data ">http_credential_s</a></li>
620 </ul></li>
621 <li><a href="#ENUMERATIONS">Constants</a><ul class="code">
622 <li><a href="#http_auth_e" title="HTTP authentication types">http_auth_e</a></li>
623 <li><a href="#http_encoding_e" title="HTTP transfer encoding values">http_encoding_e</a></li>
624 <li><a href="#http_encryption_e" title="HTTP encryption values">http_encryption_e</a></li>
625 <li><a href="#http_field_e" title="HTTP field names">http_field_e</a></li>
626 <li><a href="#http_keepalive_e" title="HTTP keep-alive values">http_keepalive_e</a></li>
627 <li><a href="#http_state_e" title="HTTP state values; states
628 are server-oriented...">http_state_e</a></li>
629 <li><a href="#http_status_e" title="HTTP status codes">http_status_e</a></li>
630 <li><a href="#http_uri_coding_e" title="URI en/decode flags">http_uri_coding_e</a></li>
631 <li><a href="#http_uri_status_e" title="URI separation status ">http_uri_status_e</a></li>
632 <li><a href="#http_version_e" title="HTTP version numbers">http_version_e</a></li>
633 <li><a href="#ipp_dstate_e" title="Document states">ipp_dstate_e</a></li>
634 <li><a href="#ipp_finish_e" title="Finishings">ipp_finish_e</a></li>
635 <li><a href="#ipp_jcollate_e" title="Job collation types">ipp_jcollate_e</a></li>
636 <li><a href="#ipp_jstate_e" title="Job states">ipp_jstate_e</a></li>
637 <li><a href="#ipp_op_e" title="IPP operations">ipp_op_e</a></li>
638 <li><a href="#ipp_orient_e" title="Orientation values">ipp_orient_e</a></li>
639 <li><a href="#ipp_pstate_e" title="Printer states">ipp_pstate_e</a></li>
640 <li><a href="#ipp_quality_e" title="Qualities">ipp_quality_e</a></li>
641 <li><a href="#ipp_res_e" title="Resolution units">ipp_res_e</a></li>
642 <li><a href="#ipp_state_e" title="IPP states">ipp_state_e</a></li>
643 <li><a href="#ipp_status_e" title="IPP status codes">ipp_status_e</a></li>
644 <li><a href="#ipp_tag_e" title="Format tags for attributes">ipp_tag_e</a></li>
645 </ul></li>
646 </ul>
647 <!--
648 "$Id$"
649
650 HTTP and IPP API introduction for CUPS.
651
652 Copyright 2007-2012 by Apple Inc.
653 Copyright 1997-2006 by Easy Software Products, all rights reserved.
654
655 These coded instructions, statements, and computer programs are the
656 property of Apple Inc. and are protected by Federal copyright
657 law. Distribution and use rights are outlined in the file "LICENSE.txt"
658 which should have been included with this file. If this file is
659 file is missing or damaged, see the license at "http://www.cups.org/".
660 -->
661
662 <h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
663
664 <p>The CUPS HTTP and IPP APIs provide low-level access to the HTTP and IPP
665 protocols and CUPS scheduler. They are typically used by monitoring and
666 administration programs to perform specific functions not supported by the
667 high-level CUPS API functions.</p>
668
669 <p>The HTTP APIs use an opaque structure called
670 <a href='#http_t'><code>http_t</code></a> to manage connections to
671 a particular HTTP or IPP server. The
672 <a href='#httpConnectEncrypt'><code>httpConnectEncrypt</code></a> function is
673 used to create an instance of this structure for a particular server.
674 The constant <code>CUPS_HTTP_DEFAULT</code> can be used with all of the
675 <code>cups</code> functions to refer to the default CUPS server - the functions
676 create a per-thread <a href='#http_t'><code>http_t</code></a> as needed.</p>
677
678 <p>The IPP APIs use two opaque structures for requests (messages sent to the CUPS scheduler) and responses (messages sent back to your application from the scheduler). The <a href='#ipp_t'><code>ipp_t</code></a> type holds a complete request or response and is allocated using the <a href='#ippNew'><code>ippNew</code></a> or <a href='#ippNewRequest'><code>ippNewRequest</code></a> functions and freed using the <a href='#ippDelete'><code>ippDelete</code></a> function.</p>
679
680 <p>The second opaque structure is called <a href='#ipp_attribute_t'><code>ipp_attribute_t</code></a> and holds a single IPP attribute which consists of a group tag (<a href='#ippGetGroupTag'><code>ippGetGroupTag</code></a>), a value type tag (<a href='#ippGetValueTag'><code>ippGetValueTag</code></a>), the attribute name (<a href='#ippGetName'><code>ippGetName</code></a>), and 1 or more values (<a href='#ippGetCount'><code>ippGetCount</code></a>, <a href='#ippGetBoolean'><code>ippGetBoolean</code></a>, <a href='#ippGetCollection'><code>ippGetCollection</code></a>, <a href='#ippGetDate'><code>ippGetDate</code></a>, <a href='#ippGetInteger'><code>ippGetInteger</code></a>, <a href='#ippGetRange'><code>ippGetRange</code></a>, <a href='#ippGetResolution'><code>ippGetResolution</code></a>, and <a href='#ippGetString'><code>ippGetString</code></a>). Attributes are added to an <a href='#ipp_t'><code>ipp_t</code></a> pointer using one of the <code>ippAdd</code> functions. For example, use <a href='#ippAddString'><code>ippAddString</code></a> to add the "printer-uri" and "requesting-user-name" string attributes to a request:</p>
681
682 <pre class='example'>
683 <a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(IPP_GET_JOBS);
684
685 <a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
686 NULL, "ipp://localhost/printers/");
687 <a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
688 NULL, cupsUser());
689 </pre>
690
691 <p>Once you have created an IPP request, use the <code>cups</code> functions to send the request to and read the response from the server. For example, the <a href='#cupsDoRequest'><code>cupsDoRequest</code></a> function can be used for simple query operations that do not involve files:</p>
692
693 <pre class='example'>
694 #include &lt;cups/cups.h&gt;
695
696
697 <a href='#ipp_t'>ipp_t</a> *<a name='get_jobs'>get_jobs</a>(void)
698 {
699 <a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(IPP_GET_JOBS);
700
701 <a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
702 NULL, "ipp://localhost/printers/");
703 <a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
704 NULL, cupsUser());
705
706 return (<a href='#cupsDoRequest'>cupsDoRequest</a>(CUPS_HTTP_DEFAULT, request, "/"));
707 }
708 </pre>
709
710 <p>The <a href='#cupsDoRequest'><code>cupsDoRequest</code></a> function frees the request and returns an IPP response or <code>NULL</code> pointer if the request could not be sent to the server. Once you have a response from the server, you can either use the <a href='#ippFindAttribute'><code>ippFindAttribute</code></a> and <a href='#ippFindNextAttribute'><code>ippFindNextAttribute</code></a> functions to find specific attributes, for example:</p>
711
712 <pre class='example'>
713 <a href='#ipp_t'>ipp_t</a> *response;
714 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *attr;
715
716 attr = <a href='#ippFindAttribute'>ippFindAttribute</a>(response, "printer-state", IPP_TAG_ENUM);
717 </pre>
718
719 <p>You can also walk the list of attributes with a simple <code>for</code> loop like this:</p>
720
721 <pre class='example'>
722 <a href='#ipp_t'>ipp_t</a> *response;
723 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *attr;
724
725 for (attr = <a href='#ippFirstAttribute'>ippFirstAttribute</a>(response); attr != NULL; attr = <a href='#ippNextAttribute'>ippNextAttribute</a>(response))
726 if (ippGetName(attr) == NULL)
727 puts("--SEPARATOR--");
728 else
729 puts(ippGetName(attr));
730 </pre>
731
732 <p>The <code>for</code> loop approach is normally used when collecting attributes for multiple objects (jobs, printers, etc.) in a response. Attributes with <code>NULL</code> names indicate a separator between the attributes of each object. For example, the following code will list the jobs returned from our previous <a href='#get_jobs'><code>get_jobs</code></a> example code:</p>
733
734 <pre class='example'>
735 <a href='#ipp_t'>ipp_t</a> *response = <a href='#get_jobs'>get_jobs</a>();
736
737 if (response != NULL)
738 {
739 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *attr;
740 const char *attrname;
741 int job_id = 0;
742 const char *job_name = NULL;
743 const char *job_originating_user_name = NULL;
744
745 puts("Job ID Owner Title");
746 puts("------ ---------------- ---------------------------------");
747
748 for (attr = <a href='#ippFirstAttribute'>ippFirstAttribute</a>(response); attr != NULL; attr = <a href='#ippNextAttribute'>ippNextAttribute</a>(response))
749 {
750 /* Attributes without names are separators between jobs */
751 attrname = ippGetName(attr);
752 if (attrname == NULL)
753 {
754 if (job_id > 0)
755 {
756 if (job_name == NULL)
757 job_name = "(withheld)";
758
759 if (job_originating_user_name == NULL)
760 job_originating_user_name = "(withheld)";
761
762 printf("%5d %-16s %s\n", job_id, job_originating_user_name, job_name);
763 }
764
765 job_id = 0;
766 job_name = NULL;
767 job_originating_user_name = NULL;
768 continue;
769 }
770 else if (!strcmp(attrname, "job-id") &amp;&amp; ippGetValueTag(attr) == IPP_TAG_INTEGER)
771 job_id = ippGetInteger(attr, 0);
772 else if (!strcmp(attrname, "job-name") &amp;&amp; ippGetValueTag(attr) == IPP_TAG_NAME)
773 job_name = ippGetString(attr, 0, NULL);
774 else if (!strcmp(attrname, "job-originating-user-name") &amp;&amp;
775 ippGetValueTag(attr) == IPP_TAG_NAME)
776 job_originating_user_name = ippGetString(attr, 0, NULL);
777 }
778
779 if (job_id > 0)
780 {
781 if (job_name == NULL)
782 job_name = "(withheld)";
783
784 if (job_originating_user_name == NULL)
785 job_originating_user_name = "(withheld)";
786
787 printf("%5d %-16s %s\n", job_id, job_originating_user_name, job_name);
788 }
789 }
790 </pre>
791
792 <h3><a name='CREATING_URI_STRINGS'>Creating URI Strings</a></h3>
793
794 <p>To ensure proper encoding, the
795 <a href='#httpAssembleURIf'><code>httpAssembleURIf</code></a> function must be
796 used to format a "printer-uri" string for all printer-based requests:</p>
797
798 <pre class='example'>
799 const char *name = "Foo";
800 char uri[1024];
801 <a href='#ipp_t'>ipp_t</a> *request;
802
803 <a href='#httpAssembleURIf'>httpAssembleURIf</a>(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, cupsServer(),
804 ippPort(), "/printers/%s", name);
805 <a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
806 </pre>
807
808 <h3><a name='SENDING_REQUESTS_WITH_FILES'>Sending Requests with Files</a></h3>
809
810 <p>The <a href='#cupsDoFileRequest'><code>cupsDoFileRequest</code></a> and
811 <a href='#cupsDoIORequest'><code>cupsDoIORequest</code></a> functions are
812 used for requests involving files. The
813 <a href='#cupsDoFileRequest'><code>cupsDoFileRequest</code></a> function
814 attaches the named file to a request and is typically used when sending a print
815 file or changing a printer's PPD file:</p>
816
817 <pre class='example'>
818 const char *filename = "/usr/share/cups/data/testprint.ps";
819 const char *name = "Foo";
820 char uri[1024];
821 char resource[1024];
822 <a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(IPP_PRINT_JOB);
823 <a href='#ipp_t'>ipp_t</a> *response;
824
825 /* Use httpAssembleURIf for the printer-uri string */
826 <a href='#httpAssembleURIf'>httpAssembleURIf</a>(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, cupsServer(),
827 ippPort(), "/printers/%s", name);
828 <a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
829 <a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
830 NULL, cupsUser());
831 <a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name",
832 NULL, "testprint.ps");
833
834 /* Use snprintf for the resource path */
835 snprintf(resource, sizeof(resource), "/printers/%s", name);
836
837 response = <a href='#cupsDoFileRequest'>cupsDoFileRequest</a>(CUPS_HTTP_DEFAULT, request, resource, filename);
838 </pre>
839
840 <p>The <a href='#cupsDoIORequest'><code>cupsDoIORequest</code></a> function
841 optionally attaches a file to the request and optionally saves a file in the
842 response from the server. It is used when using a pipe for the request
843 attachment or when using a request that returns a file, currently only
844 <code>CUPS_GET_DOCUMENT</code> and <code>CUPS_GET_PPD</code>. For example,
845 the following code will download the PPD file for the sample HP LaserJet
846 printer driver:</p>
847
848 <pre class='example'>
849 char tempfile[1024];
850 int tempfd;
851 <a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(CUPS_GET_PPD);
852 <a href='#ipp_t'>ipp_t</a> *response;
853
854 <a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
855 NULL, "laserjet.ppd");
856
857 tempfd = cupsTempFd(tempfile, sizeof(tempfile));
858
859 response = <a href='#cupsDoIORequest'>cupsDoIORequest</a>(CUPS_HTTP_DEFAULT, request, "/", -1, tempfd);
860 </pre>
861
862 <p>The example passes <code>-1</code> for the input file descriptor to specify
863 that no file is to be attached to the request. The PPD file attached to the
864 response is written to the temporary file descriptor we created using the
865 <code>cupsTempFd</code> function.</p>
866
867 <h3><a name='ASYNCHRONOUS_REQUEST_PROCESSING'>Asynchronous Request Processing</a></h3>
868
869 <p>The <a href='#cupsSendRequest'><code>cupsSendRequest</code></a> and
870 <a href='#cupsGetResponse'><code>cupsGetResponse</code></a> support
871 asynchronous communications with the server. Unlike the other request
872 functions, the IPP request is not automatically freed, so remember to
873 free your request with the <a href='#ippDelete'><code>ippDelete</code></a>
874 function.</p>
875
876 <p>File data is attached to the request using the
877 <a href='#cupsWriteRequestData'><code>cupsWriteRequestData</code></a>
878 function, while file data returned from the server is read using the
879 <a href='#cupsReadResponseData'><code>cupsReadResponseData</code></a>
880 function. We can rewrite the previous <code>CUPS_GET_PPD</code> example
881 to use the asynchronous functions quite easily:</p>
882
883 <pre class='example'>
884 char tempfile[1024];
885 int tempfd;
886 <a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(CUPS_GET_PPD);
887 <a href='#ipp_t'>ipp_t</a> *response;
888
889 <a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
890 NULL, "laserjet.ppd");
891
892 tempfd = cupsTempFd(tempfile, sizeof(tempfile));
893
894 if (<a href='#cupsSendRequest'>cupsSendRequest</a>(CUPS_HTTP_DEFAULT, request, "/") == HTTP_CONTINUE)
895 {
896 response = <a href='#cupsGetResponse'>cupsGetResponse</a>(CUPS_HTTP_DEFAULT, "/");
897
898 if (response != NULL)
899 {
900 ssize_t bytes;
901 char buffer[8192];
902
903 while ((bytes = <a href='#cupsReadResponseData'>cupsReadResponseData</a>(CUPS_HTTP_DEFAULT, buffer, sizeof(buffer))) > 0)
904 write(tempfd, buffer, bytes);
905 }
906 }
907
908 /* Free the request! */
909 <a href='#ippDelete'>ippDelete</a>(request);
910 </pre>
911
912 <p>The <a href='#cupsSendRequest'><code>cupsSendRequest</code></a> function
913 returns the initial HTTP request status, typically either
914 <code>HTTP_CONTINUE</code> or <code>HTTP_UNAUTHORIZED</code>. The latter status
915 is returned when the request requires authentication of some sort. The
916 <a href='#cupsDoAuthentication'><code>cupsDoAuthentication</code></a> function
917 must be called when your see <code>HTTP_UNAUTHORIZED</code> and the request
918 re-sent. We can add authentication support to our example code by using a
919 <code>do ... while</code> loop:</p>
920
921 <pre class='example'>
922 char tempfile[1024];
923 int tempfd;
924 <a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(CUPS_GET_PPD);
925 <a href='#ipp_t'>ipp_t</a> *response;
926 http_status_t status;
927
928 <a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
929 NULL, "laserjet.ppd");
930
931 tempfd = cupsTempFd(tempfile, sizeof(tempfile));
932
933 /* Loop for authentication */
934 do
935 {
936 status = <a href='#cupsSendRequest'>cupsSendRequest</a>(CUPS_HTTP_DEFAULT, request, "/");
937
938 if (status == HTTP_UNAUTHORIZED)
939 {
940 /* Try to authenticate, break out of the loop if that fails */
941 if (<a href='#cupsDoAuthentication'>cupsDoAuthentication</a>(CUPS_HTTP_DEFAULT, "POST", "/"))
942 break;
943 }
944 }
945 while (status != HTTP_CONTINUE &amp;&amp; status != HTTP_UNAUTHORIZED);
946
947 if (status == HTTP_CONTINUE)
948 {
949 response = <a href='#cupsGetResponse'>cupsGetResponse</a>(CUPS_HTTP_DEFAULT, "/");
950
951 if (response != NULL)
952 {
953 ssize_t bytes;
954 char buffer[8192];
955
956 while ((bytes = <a href='#cupsReadResponseData'>cupsReadResponseData</a>(CUPS_HTTP_DEFAULT, buffer, sizeof(buffer))) > 0)
957 write(tempfd, buffer, bytes);
958 }
959 }
960
961 /* Free the request! */
962 <a href='#ippDelete'>ippDelete</a>(request);
963 </pre>
964 <h2 class="title"><a name="FUNCTIONS">Functions</a></h2>
965 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.20/Mac OS X 10.4&nbsp;</span><a name="cupsDoAuthentication">cupsDoAuthentication</a></h3>
966 <p class="description">Authenticate a request.</p>
967 <p class="code">
968 int cupsDoAuthentication (<br>
969 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
970 &nbsp;&nbsp;&nbsp;&nbsp;const char *method,<br>
971 &nbsp;&nbsp;&nbsp;&nbsp;const char *resource<br>
972 );</p>
973 <h4 class="parameters">Parameters</h4>
974 <dl>
975 <dt>http</dt>
976 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
977 <dt>method</dt>
978 <dd class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</dd>
979 <dt>resource</dt>
980 <dd class="description">Resource path</dd>
981 </dl>
982 <h4 class="returnvalue">Return Value</h4>
983 <p class="description">0 on success, -1 on error</p>
984 <h4 class="discussion">Discussion</h4>
985 <p class="discussion">This function should be called in response to a <code>HTTP_UNAUTHORIZED</code>
986 status, prior to resubmitting your request.
987
988 </p>
989 <h3 class="function"><a name="cupsDoFileRequest">cupsDoFileRequest</a></h3>
990 <p class="description">Do an IPP request with a file.</p>
991 <p class="code">
992 <a href="#ipp_t">ipp_t</a> *cupsDoFileRequest (<br>
993 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
994 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *request,<br>
995 &nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
996 &nbsp;&nbsp;&nbsp;&nbsp;const char *filename<br>
997 );</p>
998 <h4 class="parameters">Parameters</h4>
999 <dl>
1000 <dt>http</dt>
1001 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1002 <dt>request</dt>
1003 <dd class="description">IPP request</dd>
1004 <dt>resource</dt>
1005 <dd class="description">HTTP resource for POST</dd>
1006 <dt>filename</dt>
1007 <dd class="description">File to send or <code>NULL</code> for none</dd>
1008 </dl>
1009 <h4 class="returnvalue">Return Value</h4>
1010 <p class="description">Response data</p>
1011 <h4 class="discussion">Discussion</h4>
1012 <p class="discussion">This function sends the IPP request to the specified server, retrying
1013 and authenticating as necessary. The request is freed with <a href="#ippDelete"><code>ippDelete</code></a>
1014 after receiving a valid IPP response.</p>
1015 <h3 class="function"><span class="info">&nbsp;CUPS 1.3/Mac OS X 10.5&nbsp;</span><a name="cupsDoIORequest">cupsDoIORequest</a></h3>
1016 <p class="description">Do an IPP request with file descriptors.</p>
1017 <p class="code">
1018 <a href="#ipp_t">ipp_t</a> *cupsDoIORequest (<br>
1019 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1020 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *request,<br>
1021 &nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1022 &nbsp;&nbsp;&nbsp;&nbsp;int infile,<br>
1023 &nbsp;&nbsp;&nbsp;&nbsp;int outfile<br>
1024 );</p>
1025 <h4 class="parameters">Parameters</h4>
1026 <dl>
1027 <dt>http</dt>
1028 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1029 <dt>request</dt>
1030 <dd class="description">IPP request</dd>
1031 <dt>resource</dt>
1032 <dd class="description">HTTP resource for POST</dd>
1033 <dt>infile</dt>
1034 <dd class="description">File to read from or -1 for none</dd>
1035 <dt>outfile</dt>
1036 <dd class="description">File to write to or -1 for none</dd>
1037 </dl>
1038 <h4 class="returnvalue">Return Value</h4>
1039 <p class="description">Response data</p>
1040 <h4 class="discussion">Discussion</h4>
1041 <p class="discussion">This function sends the IPP request to the specified server, retrying
1042 and authenticating as necessary. The request is freed with ippDelete()
1043 after receiving a valid IPP response.<br>
1044 <br>
1045 If &quot;infile&quot; is a valid file descriptor, cupsDoIORequest() copies
1046 all of the data from the file after the IPP request message.<br>
1047 <br>
1048 If &quot;outfile&quot; is a valid file descriptor, cupsDoIORequest() copies
1049 all of the data after the IPP response message to the file.
1050
1051 </p>
1052 <h3 class="function"><a name="cupsDoRequest">cupsDoRequest</a></h3>
1053 <p class="description">Do an IPP request.</p>
1054 <p class="code">
1055 <a href="#ipp_t">ipp_t</a> *cupsDoRequest (<br>
1056 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1057 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *request,<br>
1058 &nbsp;&nbsp;&nbsp;&nbsp;const char *resource<br>
1059 );</p>
1060 <h4 class="parameters">Parameters</h4>
1061 <dl>
1062 <dt>http</dt>
1063 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1064 <dt>request</dt>
1065 <dd class="description">IPP request</dd>
1066 <dt>resource</dt>
1067 <dd class="description">HTTP resource for POST</dd>
1068 </dl>
1069 <h4 class="returnvalue">Return Value</h4>
1070 <p class="description">Response data</p>
1071 <h4 class="discussion">Discussion</h4>
1072 <p class="discussion">This function sends the IPP request to the specified server, retrying
1073 and authenticating as necessary. The request is freed with ippDelete()
1074 after receiving a valid IPP response.</p>
1075 <h3 class="function"><a name="cupsEncodeOptions">cupsEncodeOptions</a></h3>
1076 <p class="description">Encode printer options into IPP attributes.</p>
1077 <p class="code">
1078 void cupsEncodeOptions (<br>
1079 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
1080 &nbsp;&nbsp;&nbsp;&nbsp;int num_options,<br>
1081 &nbsp;&nbsp;&nbsp;&nbsp;cups_option_t *options<br>
1082 );</p>
1083 <h4 class="parameters">Parameters</h4>
1084 <dl>
1085 <dt>ipp</dt>
1086 <dd class="description">Request to add to</dd>
1087 <dt>num_options</dt>
1088 <dd class="description">Number of options</dd>
1089 <dt>options</dt>
1090 <dd class="description">Options</dd>
1091 </dl>
1092 <h4 class="discussion">Discussion</h4>
1093 <p class="discussion">This function adds operation, job, and then subscription attributes,
1094 in that order. Use the cupsEncodeOptions2() function to add attributes
1095 for a single group.</p>
1096 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="cupsEncodeOptions2">cupsEncodeOptions2</a></h3>
1097 <p class="description">Encode printer options into IPP attributes for a group.</p>
1098 <p class="code">
1099 void cupsEncodeOptions2 (<br>
1100 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
1101 &nbsp;&nbsp;&nbsp;&nbsp;int num_options,<br>
1102 &nbsp;&nbsp;&nbsp;&nbsp;cups_option_t *options,<br>
1103 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group_tag<br>
1104 );</p>
1105 <h4 class="parameters">Parameters</h4>
1106 <dl>
1107 <dt>ipp</dt>
1108 <dd class="description">Request to add to</dd>
1109 <dt>num_options</dt>
1110 <dd class="description">Number of options</dd>
1111 <dt>options</dt>
1112 <dd class="description">Options</dd>
1113 <dt>group_tag</dt>
1114 <dd class="description">Group to encode</dd>
1115 </dl>
1116 <h4 class="discussion">Discussion</h4>
1117 <p class="discussion">This function only adds attributes for a single group. Call this
1118 function multiple times for each group, or use cupsEncodeOptions()
1119 to add the standard groups.
1120
1121 </p>
1122 <h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="cupsGetDevices">cupsGetDevices</a></h3>
1123 <p class="description">Get available printer devices.</p>
1124 <p class="code">
1125 ipp_status_t cupsGetDevices (<br>
1126 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1127 &nbsp;&nbsp;&nbsp;&nbsp;int timeout,<br>
1128 &nbsp;&nbsp;&nbsp;&nbsp;const char *include_schemes,<br>
1129 &nbsp;&nbsp;&nbsp;&nbsp;const char *exclude_schemes,<br>
1130 &nbsp;&nbsp;&nbsp;&nbsp;cups_device_cb_t callback,<br>
1131 &nbsp;&nbsp;&nbsp;&nbsp;void *user_data<br>
1132 );</p>
1133 <h4 class="parameters">Parameters</h4>
1134 <dl>
1135 <dt>http</dt>
1136 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1137 <dt>timeout</dt>
1138 <dd class="description">Timeout in seconds or <code>CUPS_TIMEOUT_DEFAULT</code></dd>
1139 <dt>include_schemes</dt>
1140 <dd class="description">Comma-separated URI schemes to include or <code>CUPS_INCLUDE_ALL</code></dd>
1141 <dt>exclude_schemes</dt>
1142 <dd class="description">Comma-separated URI schemes to exclude or <code>CUPS_EXCLUDE_NONE</code></dd>
1143 <dt>callback</dt>
1144 <dd class="description">Callback function</dd>
1145 <dt>user_data</dt>
1146 <dd class="description">User data pointer</dd>
1147 </dl>
1148 <h4 class="returnvalue">Return Value</h4>
1149 <p class="description">Request status - <code>IPP_OK</code> on success.</p>
1150 <h4 class="discussion">Discussion</h4>
1151 <p class="discussion">This function sends a CUPS-Get-Devices request and streams the discovered
1152 devices to the specified callback function. The &quot;timeout&quot; parameter controls
1153 how long the request lasts, while the &quot;include_schemes&quot; and &quot;exclude_schemes&quot;
1154 parameters provide comma-delimited lists of backends to include or omit from
1155 the request respectively.
1156
1157 </p>
1158 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.20/Mac OS X 10.4&nbsp;</span><a name="cupsGetFd">cupsGetFd</a></h3>
1159 <p class="description">Get a file from the server.</p>
1160 <p class="code">
1161 <a href="#http_status_t">http_status_t</a> cupsGetFd (<br>
1162 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1163 &nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1164 &nbsp;&nbsp;&nbsp;&nbsp;int fd<br>
1165 );</p>
1166 <h4 class="parameters">Parameters</h4>
1167 <dl>
1168 <dt>http</dt>
1169 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1170 <dt>resource</dt>
1171 <dd class="description">Resource name</dd>
1172 <dt>fd</dt>
1173 <dd class="description">File descriptor</dd>
1174 </dl>
1175 <h4 class="returnvalue">Return Value</h4>
1176 <p class="description">HTTP status</p>
1177 <h4 class="discussion">Discussion</h4>
1178 <p class="discussion">This function returns <code>HTTP_OK</code> when the file is successfully retrieved.
1179
1180 </p>
1181 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.20/Mac OS X 10.4&nbsp;</span><a name="cupsGetFile">cupsGetFile</a></h3>
1182 <p class="description">Get a file from the server.</p>
1183 <p class="code">
1184 <a href="#http_status_t">http_status_t</a> cupsGetFile (<br>
1185 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1186 &nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1187 &nbsp;&nbsp;&nbsp;&nbsp;const char *filename<br>
1188 );</p>
1189 <h4 class="parameters">Parameters</h4>
1190 <dl>
1191 <dt>http</dt>
1192 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1193 <dt>resource</dt>
1194 <dd class="description">Resource name</dd>
1195 <dt>filename</dt>
1196 <dd class="description">Filename</dd>
1197 </dl>
1198 <h4 class="returnvalue">Return Value</h4>
1199 <p class="description">HTTP status</p>
1200 <h4 class="discussion">Discussion</h4>
1201 <p class="discussion">This function returns <code>HTTP_OK</code> when the file is successfully retrieved.
1202
1203 </p>
1204 <h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="cupsGetResponse">cupsGetResponse</a></h3>
1205 <p class="description">Get a response to an IPP request.</p>
1206 <p class="code">
1207 <a href="#ipp_t">ipp_t</a> *cupsGetResponse (<br>
1208 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1209 &nbsp;&nbsp;&nbsp;&nbsp;const char *resource<br>
1210 );</p>
1211 <h4 class="parameters">Parameters</h4>
1212 <dl>
1213 <dt>http</dt>
1214 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1215 <dt>resource</dt>
1216 <dd class="description">HTTP resource for POST</dd>
1217 </dl>
1218 <h4 class="returnvalue">Return Value</h4>
1219 <p class="description">Response or <code>NULL</code> on HTTP error</p>
1220 <h4 class="discussion">Discussion</h4>
1221 <p class="discussion">Use this function to get the response for an IPP request sent using
1222 cupsSendDocument() or cupsSendRequest(). For requests that return
1223 additional data, use httpRead() after getting a successful response,
1224 otherwise call httpFlush() to complete the response processing.
1225
1226 </p>
1227 <h3 class="function"><a name="cupsLastError">cupsLastError</a></h3>
1228 <p class="description">Return the last IPP status code.</p>
1229 <p class="code">
1230 ipp_status_t cupsLastError (void);</p>
1231 <h4 class="returnvalue">Return Value</h4>
1232 <p class="description">IPP status code from last request</p>
1233 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="cupsLastErrorString">cupsLastErrorString</a></h3>
1234 <p class="description">Return the last IPP status-message.</p>
1235 <p class="code">
1236 const char *cupsLastErrorString (void);</p>
1237 <h4 class="returnvalue">Return Value</h4>
1238 <p class="description">status-message text from last request</p>
1239 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.20/Mac OS X 10.4&nbsp;</span><a name="cupsPutFd">cupsPutFd</a></h3>
1240 <p class="description">Put a file on the server.</p>
1241 <p class="code">
1242 <a href="#http_status_t">http_status_t</a> cupsPutFd (<br>
1243 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1244 &nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1245 &nbsp;&nbsp;&nbsp;&nbsp;int fd<br>
1246 );</p>
1247 <h4 class="parameters">Parameters</h4>
1248 <dl>
1249 <dt>http</dt>
1250 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1251 <dt>resource</dt>
1252 <dd class="description">Resource name</dd>
1253 <dt>fd</dt>
1254 <dd class="description">File descriptor</dd>
1255 </dl>
1256 <h4 class="returnvalue">Return Value</h4>
1257 <p class="description">HTTP status</p>
1258 <h4 class="discussion">Discussion</h4>
1259 <p class="discussion">This function returns <code>HTTP_CREATED</code> when the file is stored
1260 successfully.
1261
1262 </p>
1263 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.20/Mac OS X 10.4&nbsp;</span><a name="cupsPutFile">cupsPutFile</a></h3>
1264 <p class="description">Put a file on the server.</p>
1265 <p class="code">
1266 <a href="#http_status_t">http_status_t</a> cupsPutFile (<br>
1267 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1268 &nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1269 &nbsp;&nbsp;&nbsp;&nbsp;const char *filename<br>
1270 );</p>
1271 <h4 class="parameters">Parameters</h4>
1272 <dl>
1273 <dt>http</dt>
1274 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1275 <dt>resource</dt>
1276 <dd class="description">Resource name</dd>
1277 <dt>filename</dt>
1278 <dd class="description">Filename</dd>
1279 </dl>
1280 <h4 class="returnvalue">Return Value</h4>
1281 <p class="description">HTTP status</p>
1282 <h4 class="discussion">Discussion</h4>
1283 <p class="discussion">This function returns <code>HTTP_CREATED</code> when the file is stored
1284 successfully.
1285
1286 </p>
1287 <h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="cupsReadResponseData">cupsReadResponseData</a></h3>
1288 <p class="description">Read additional data after the IPP response.</p>
1289 <p class="code">
1290 ssize_t cupsReadResponseData (<br>
1291 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1292 &nbsp;&nbsp;&nbsp;&nbsp;char *buffer,<br>
1293 &nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
1294 );</p>
1295 <h4 class="parameters">Parameters</h4>
1296 <dl>
1297 <dt>http</dt>
1298 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1299 <dt>buffer</dt>
1300 <dd class="description">Buffer to use</dd>
1301 <dt>length</dt>
1302 <dd class="description">Number of bytes to read</dd>
1303 </dl>
1304 <h4 class="returnvalue">Return Value</h4>
1305 <p class="description">Bytes read, 0 on EOF, -1 on error</p>
1306 <h4 class="discussion">Discussion</h4>
1307 <p class="discussion">This function is used after cupsGetResponse() to read the PPD or document
1308 files for CUPS_GET_PPD and CUPS_GET_DOCUMENT requests, respectively.
1309
1310 </p>
1311 <h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="cupsSendRequest">cupsSendRequest</a></h3>
1312 <p class="description">Send an IPP request.</p>
1313 <p class="code">
1314 <a href="#http_status_t">http_status_t</a> cupsSendRequest (<br>
1315 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1316 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *request,<br>
1317 &nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1318 &nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
1319 );</p>
1320 <h4 class="parameters">Parameters</h4>
1321 <dl>
1322 <dt>http</dt>
1323 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1324 <dt>request</dt>
1325 <dd class="description">IPP request</dd>
1326 <dt>resource</dt>
1327 <dd class="description">Resource path</dd>
1328 <dt>length</dt>
1329 <dd class="description">Length of data to follow or <code>CUPS_LENGTH_VARIABLE</code></dd>
1330 </dl>
1331 <h4 class="returnvalue">Return Value</h4>
1332 <p class="description">Initial HTTP status</p>
1333 <h4 class="discussion">Discussion</h4>
1334 <p class="discussion">Use httpWrite() to write any additional data (document, PPD file, etc.)
1335 for the request, cupsGetResponse() to get the IPP response, and httpRead()
1336 to read any additional data following the response. Only one request can be
1337 sent/queued at a time.<br>
1338 <br>
1339 Unlike cupsDoFileRequest(), cupsDoIORequest(), and cupsDoRequest(), the
1340 request is not freed.
1341
1342 </p>
1343 <h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="cupsWriteRequestData">cupsWriteRequestData</a></h3>
1344 <p class="description">Write additional data after an IPP request.</p>
1345 <p class="code">
1346 <a href="#http_status_t">http_status_t</a> cupsWriteRequestData (<br>
1347 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1348 &nbsp;&nbsp;&nbsp;&nbsp;const char *buffer,<br>
1349 &nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
1350 );</p>
1351 <h4 class="parameters">Parameters</h4>
1352 <dl>
1353 <dt>http</dt>
1354 <dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1355 <dt>buffer</dt>
1356 <dd class="description">Bytes to write</dd>
1357 <dt>length</dt>
1358 <dd class="description">Number of bytes to write</dd>
1359 </dl>
1360 <h4 class="returnvalue">Return Value</h4>
1361 <p class="description"><code>HTTP_CONTINUE</code> if OK or HTTP status on error</p>
1362 <h4 class="discussion">Discussion</h4>
1363 <p class="discussion">This function is used after <a href="#cupsSendRequest"><code>cupsSendRequest</code></a> to provide a PPD and
1364 after <a href="#cupsStartDocument"><code>cupsStartDocument</code></a> to provide a document file.
1365
1366 </p>
1367 <h3 class="function"><span class="info">&nbsp;CUPS 1.5/Mac OS X 10.7&nbsp;</span><a name="httpAddCredential">httpAddCredential</a></h3>
1368 <p class="description">Allocates and adds a single credential to an array.</p>
1369 <p class="code">
1370 int httpAddCredential (<br>
1371 &nbsp;&nbsp;&nbsp;&nbsp;cups_array_t *credentials,<br>
1372 &nbsp;&nbsp;&nbsp;&nbsp;const void *data,<br>
1373 &nbsp;&nbsp;&nbsp;&nbsp;size_t datalen<br>
1374 );</p>
1375 <h4 class="parameters">Parameters</h4>
1376 <dl>
1377 <dt>credentials</dt>
1378 <dd class="description">Credentials array</dd>
1379 <dt>data</dt>
1380 <dd class="description">PEM-encoded X.509 data</dd>
1381 <dt>datalen</dt>
1382 <dd class="description">Length of data</dd>
1383 </dl>
1384 <h4 class="returnvalue">Return Value</h4>
1385 <p class="description">0 on success, -1 on error</p>
1386 <h4 class="discussion">Discussion</h4>
1387 <p class="discussion">Use <code>cupsArrayNew(NULL, NULL)</code> to create a credentials array.
1388
1389 </p>
1390 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpAddrAny">httpAddrAny</a></h3>
1391 <p class="description">Check for the &quot;any&quot; address.</p>
1392 <p class="code">
1393 int httpAddrAny (<br>
1394 &nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr<br>
1395 );</p>
1396 <h4 class="parameters">Parameters</h4>
1397 <dl>
1398 <dt>addr</dt>
1399 <dd class="description">Address to check</dd>
1400 </dl>
1401 <h4 class="returnvalue">Return Value</h4>
1402 <p class="description">1 if &quot;any&quot;, 0 otherwise</p>
1403 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpAddrEqual">httpAddrEqual</a></h3>
1404 <p class="description">Compare two addresses.</p>
1405 <p class="code">
1406 int httpAddrEqual (<br>
1407 &nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr1,<br>
1408 &nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr2<br>
1409 );</p>
1410 <h4 class="parameters">Parameters</h4>
1411 <dl>
1412 <dt>addr1</dt>
1413 <dd class="description">First address</dd>
1414 <dt>addr2</dt>
1415 <dd class="description">Second address</dd>
1416 </dl>
1417 <h4 class="returnvalue">Return Value</h4>
1418 <p class="description">1 if equal, 0 if not</p>
1419 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpAddrLength">httpAddrLength</a></h3>
1420 <p class="description">Return the length of the address in bytes.</p>
1421 <p class="code">
1422 int httpAddrLength (<br>
1423 &nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr<br>
1424 );</p>
1425 <h4 class="parameters">Parameters</h4>
1426 <dl>
1427 <dt>addr</dt>
1428 <dd class="description">Address</dd>
1429 </dl>
1430 <h4 class="returnvalue">Return Value</h4>
1431 <p class="description">Length in bytes</p>
1432 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpAddrLocalhost">httpAddrLocalhost</a></h3>
1433 <p class="description">Check for the local loopback address.</p>
1434 <p class="code">
1435 int httpAddrLocalhost (<br>
1436 &nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr<br>
1437 );</p>
1438 <h4 class="parameters">Parameters</h4>
1439 <dl>
1440 <dt>addr</dt>
1441 <dd class="description">Address to check</dd>
1442 </dl>
1443 <h4 class="returnvalue">Return Value</h4>
1444 <p class="description">1 if local host, 0 otherwise</p>
1445 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpAddrLookup">httpAddrLookup</a></h3>
1446 <p class="description">Lookup the hostname associated with the address.</p>
1447 <p class="code">
1448 char *httpAddrLookup (<br>
1449 &nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr,<br>
1450 &nbsp;&nbsp;&nbsp;&nbsp;char *name,<br>
1451 &nbsp;&nbsp;&nbsp;&nbsp;int namelen<br>
1452 );</p>
1453 <h4 class="parameters">Parameters</h4>
1454 <dl>
1455 <dt>addr</dt>
1456 <dd class="description">Address to lookup</dd>
1457 <dt>name</dt>
1458 <dd class="description">Host name buffer</dd>
1459 <dt>namelen</dt>
1460 <dd class="description">Size of name buffer</dd>
1461 </dl>
1462 <h4 class="returnvalue">Return Value</h4>
1463 <p class="description">Host name</p>
1464 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpAddrString">httpAddrString</a></h3>
1465 <p class="description">Convert an address to a numeric string.</p>
1466 <p class="code">
1467 char *httpAddrString (<br>
1468 &nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr,<br>
1469 &nbsp;&nbsp;&nbsp;&nbsp;char *s,<br>
1470 &nbsp;&nbsp;&nbsp;&nbsp;int slen<br>
1471 );</p>
1472 <h4 class="parameters">Parameters</h4>
1473 <dl>
1474 <dt>addr</dt>
1475 <dd class="description">Address to convert</dd>
1476 <dt>s</dt>
1477 <dd class="description">String buffer</dd>
1478 <dt>slen</dt>
1479 <dd class="description">Length of string</dd>
1480 </dl>
1481 <h4 class="returnvalue">Return Value</h4>
1482 <p class="description">Numeric address string</p>
1483 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpAssembleURI">httpAssembleURI</a></h3>
1484 <p class="description">Assemble a uniform resource identifier from its
1485 components.</p>
1486 <p class="code">
1487 <a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURI (<br>
1488 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding,<br>
1489 &nbsp;&nbsp;&nbsp;&nbsp;char *uri,<br>
1490 &nbsp;&nbsp;&nbsp;&nbsp;int urilen,<br>
1491 &nbsp;&nbsp;&nbsp;&nbsp;const char *scheme,<br>
1492 &nbsp;&nbsp;&nbsp;&nbsp;const char *username,<br>
1493 &nbsp;&nbsp;&nbsp;&nbsp;const char *host,<br>
1494 &nbsp;&nbsp;&nbsp;&nbsp;int port,<br>
1495 &nbsp;&nbsp;&nbsp;&nbsp;const char *resource<br>
1496 );</p>
1497 <h4 class="parameters">Parameters</h4>
1498 <dl>
1499 <dt>encoding</dt>
1500 <dd class="description">Encoding flags</dd>
1501 <dt>uri</dt>
1502 <dd class="description">URI buffer</dd>
1503 <dt>urilen</dt>
1504 <dd class="description">Size of URI buffer</dd>
1505 <dt>scheme</dt>
1506 <dd class="description">Scheme name</dd>
1507 <dt>username</dt>
1508 <dd class="description">Username</dd>
1509 <dt>host</dt>
1510 <dd class="description">Hostname or address</dd>
1511 <dt>port</dt>
1512 <dd class="description">Port number</dd>
1513 <dt>resource</dt>
1514 <dd class="description">Resource</dd>
1515 </dl>
1516 <h4 class="returnvalue">Return Value</h4>
1517 <p class="description">URI status</p>
1518 <h4 class="discussion">Discussion</h4>
1519 <p class="discussion">This function escapes reserved characters in the URI depending on the
1520 value of the &quot;encoding&quot; argument. You should use this function in
1521 place of traditional string functions whenever you need to create a
1522 URI string.
1523
1524 </p>
1525 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpAssembleURIf">httpAssembleURIf</a></h3>
1526 <p class="description">Assemble a uniform resource identifier from its
1527 components with a formatted resource.</p>
1528 <p class="code">
1529 <a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURIf (<br>
1530 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding,<br>
1531 &nbsp;&nbsp;&nbsp;&nbsp;char *uri,<br>
1532 &nbsp;&nbsp;&nbsp;&nbsp;int urilen,<br>
1533 &nbsp;&nbsp;&nbsp;&nbsp;const char *scheme,<br>
1534 &nbsp;&nbsp;&nbsp;&nbsp;const char *username,<br>
1535 &nbsp;&nbsp;&nbsp;&nbsp;const char *host,<br>
1536 &nbsp;&nbsp;&nbsp;&nbsp;int port,<br>
1537 &nbsp;&nbsp;&nbsp;&nbsp;const char *resourcef,<br>
1538 &nbsp;&nbsp;&nbsp;&nbsp;...<br>
1539 );</p>
1540 <h4 class="parameters">Parameters</h4>
1541 <dl>
1542 <dt>encoding</dt>
1543 <dd class="description">Encoding flags</dd>
1544 <dt>uri</dt>
1545 <dd class="description">URI buffer</dd>
1546 <dt>urilen</dt>
1547 <dd class="description">Size of URI buffer</dd>
1548 <dt>scheme</dt>
1549 <dd class="description">Scheme name</dd>
1550 <dt>username</dt>
1551 <dd class="description">Username</dd>
1552 <dt>host</dt>
1553 <dd class="description">Hostname or address</dd>
1554 <dt>port</dt>
1555 <dd class="description">Port number</dd>
1556 <dt>resourcef</dt>
1557 <dd class="description">Printf-style resource</dd>
1558 <dt>...</dt>
1559 <dd class="description">Additional arguments as needed</dd>
1560 </dl>
1561 <h4 class="returnvalue">Return Value</h4>
1562 <p class="description">URI status</p>
1563 <h4 class="discussion">Discussion</h4>
1564 <p class="discussion">This function creates a formatted version of the resource string
1565 argument &quot;resourcef&quot; and escapes reserved characters in the URI
1566 depending on the value of the &quot;encoding&quot; argument. You should use
1567 this function in place of traditional string functions whenever
1568 you need to create a URI string.
1569
1570 </p>
1571 <h3 class="function"><a name="httpBlocking">httpBlocking</a></h3>
1572 <p class="description">Set blocking/non-blocking behavior on a connection.</p>
1573 <p class="code">
1574 void httpBlocking (<br>
1575 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1576 &nbsp;&nbsp;&nbsp;&nbsp;int b<br>
1577 );</p>
1578 <h4 class="parameters">Parameters</h4>
1579 <dl>
1580 <dt>http</dt>
1581 <dd class="description">Connection to server</dd>
1582 <dt>b</dt>
1583 <dd class="description">1 = blocking, 0 = non-blocking</dd>
1584 </dl>
1585 <h3 class="function"><a name="httpCheck">httpCheck</a></h3>
1586 <p class="description">Check to see if there is a pending response from the server.</p>
1587 <p class="code">
1588 int httpCheck (<br>
1589 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1590 );</p>
1591 <h4 class="parameters">Parameters</h4>
1592 <dl>
1593 <dt>http</dt>
1594 <dd class="description">Connection to server</dd>
1595 </dl>
1596 <h4 class="returnvalue">Return Value</h4>
1597 <p class="description">0 = no data, 1 = data available</p>
1598 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="httpClearCookie">httpClearCookie</a></h3>
1599 <p class="description">Clear the cookie value(s).</p>
1600 <p class="code">
1601 void httpClearCookie (<br>
1602 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1603 );</p>
1604 <h4 class="parameters">Parameters</h4>
1605 <dl>
1606 <dt>http</dt>
1607 <dd class="description">Connection to server</dd>
1608 </dl>
1609 <h3 class="function"><a name="httpClearFields">httpClearFields</a></h3>
1610 <p class="description">Clear HTTP request fields.</p>
1611 <p class="code">
1612 void httpClearFields (<br>
1613 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1614 );</p>
1615 <h4 class="parameters">Parameters</h4>
1616 <dl>
1617 <dt>http</dt>
1618 <dd class="description">Connection to server</dd>
1619 </dl>
1620 <h3 class="function"><a name="httpClose">httpClose</a></h3>
1621 <p class="description">Close an HTTP connection.</p>
1622 <p class="code">
1623 void httpClose (<br>
1624 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1625 );</p>
1626 <h4 class="parameters">Parameters</h4>
1627 <dl>
1628 <dt>http</dt>
1629 <dd class="description">Connection to server</dd>
1630 </dl>
1631 <h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpConnect">httpConnect</a></h3>
1632 <p class="description">Connect to a HTTP server.</p>
1633 <p class="code">
1634 <a href="#http_t">http_t</a> *httpConnect (<br>
1635 &nbsp;&nbsp;&nbsp;&nbsp;const char *host,<br>
1636 &nbsp;&nbsp;&nbsp;&nbsp;int port<br>
1637 );</p>
1638 <h4 class="parameters">Parameters</h4>
1639 <dl>
1640 <dt>host</dt>
1641 <dd class="description">Host to connect to</dd>
1642 <dt>port</dt>
1643 <dd class="description">Port number</dd>
1644 </dl>
1645 <h4 class="returnvalue">Return Value</h4>
1646 <p class="description">New HTTP connection</p>
1647 <h4 class="discussion">Discussion</h4>
1648 <p class="discussion">This function is deprecated - use <a href="#httpConnectEncrypt"><code>httpConnectEncrypt</code></a> instead.
1649
1650 </p>
1651 <h3 class="function"><a name="httpConnectEncrypt">httpConnectEncrypt</a></h3>
1652 <p class="description">Connect to a HTTP server using encryption.</p>
1653 <p class="code">
1654 <a href="#http_t">http_t</a> *httpConnectEncrypt (<br>
1655 &nbsp;&nbsp;&nbsp;&nbsp;const char *host,<br>
1656 &nbsp;&nbsp;&nbsp;&nbsp;int port,<br>
1657 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_encryption_t">http_encryption_t</a> encryption<br>
1658 );</p>
1659 <h4 class="parameters">Parameters</h4>
1660 <dl>
1661 <dt>host</dt>
1662 <dd class="description">Host to connect to</dd>
1663 <dt>port</dt>
1664 <dd class="description">Port number</dd>
1665 <dt>encryption</dt>
1666 <dd class="description">Type of encryption to use</dd>
1667 </dl>
1668 <h4 class="returnvalue">Return Value</h4>
1669 <p class="description">New HTTP connection</p>
1670 <h3 class="function"><span class="info">&nbsp;CUPS 1.5/Mac OS X 10.7&nbsp;</span><a name="httpCopyCredentials">httpCopyCredentials</a></h3>
1671 <p class="description">Copy the credentials associated with an encrypted
1672 connection.</p>
1673 <p class="code">
1674 int httpCopyCredentials (<br>
1675 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1676 &nbsp;&nbsp;&nbsp;&nbsp;cups_array_t **credentials<br>
1677 );</p>
1678 <h4 class="parameters">Parameters</h4>
1679 <dl>
1680 <dt>http</dt>
1681 <dd class="description">Connection to server</dd>
1682 <dt>credentials</dt>
1683 <dd class="description">Array of credentials</dd>
1684 </dl>
1685 <h4 class="returnvalue">Return Value</h4>
1686 <p class="description">Status of call (0 = success)</p>
1687 <h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpDecode64">httpDecode64</a></h3>
1688 <p class="description">Base64-decode a string.</p>
1689 <p class="code">
1690 char *httpDecode64 (<br>
1691 &nbsp;&nbsp;&nbsp;&nbsp;char *out,<br>
1692 &nbsp;&nbsp;&nbsp;&nbsp;const char *in<br>
1693 );</p>
1694 <h4 class="parameters">Parameters</h4>
1695 <dl>
1696 <dt>out</dt>
1697 <dd class="description">String to write to</dd>
1698 <dt>in</dt>
1699 <dd class="description">String to read from</dd>
1700 </dl>
1701 <h4 class="returnvalue">Return Value</h4>
1702 <p class="description">Decoded string</p>
1703 <h4 class="discussion">Discussion</h4>
1704 <p class="discussion">This function is deprecated. Use the httpDecode64_2() function instead
1705 which provides buffer length arguments.
1706
1707 </p>
1708 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.21/Mac OS X 10.4&nbsp;</span><a name="httpDecode64_2">httpDecode64_2</a></h3>
1709 <p class="description">Base64-decode a string.</p>
1710 <p class="code">
1711 char *httpDecode64_2 (<br>
1712 &nbsp;&nbsp;&nbsp;&nbsp;char *out,<br>
1713 &nbsp;&nbsp;&nbsp;&nbsp;int *outlen,<br>
1714 &nbsp;&nbsp;&nbsp;&nbsp;const char *in<br>
1715 );</p>
1716 <h4 class="parameters">Parameters</h4>
1717 <dl>
1718 <dt>out</dt>
1719 <dd class="description">String to write to</dd>
1720 <dt>outlen</dt>
1721 <dd class="description">Size of output string</dd>
1722 <dt>in</dt>
1723 <dd class="description">String to read from</dd>
1724 </dl>
1725 <h4 class="returnvalue">Return Value</h4>
1726 <p class="description">Decoded string</p>
1727 <h3 class="function"><a name="httpDelete">httpDelete</a></h3>
1728 <p class="description">Send a DELETE request to the server.</p>
1729 <p class="code">
1730 int httpDelete (<br>
1731 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1732 &nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
1733 );</p>
1734 <h4 class="parameters">Parameters</h4>
1735 <dl>
1736 <dt>http</dt>
1737 <dd class="description">Connection to server</dd>
1738 <dt>uri</dt>
1739 <dd class="description">URI to delete</dd>
1740 </dl>
1741 <h4 class="returnvalue">Return Value</h4>
1742 <p class="description">Status of call (0 = success)</p>
1743 <h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpEncode64">httpEncode64</a></h3>
1744 <p class="description">Base64-encode a string.</p>
1745 <p class="code">
1746 char *httpEncode64 (<br>
1747 &nbsp;&nbsp;&nbsp;&nbsp;char *out,<br>
1748 &nbsp;&nbsp;&nbsp;&nbsp;const char *in<br>
1749 );</p>
1750 <h4 class="parameters">Parameters</h4>
1751 <dl>
1752 <dt>out</dt>
1753 <dd class="description">String to write to</dd>
1754 <dt>in</dt>
1755 <dd class="description">String to read from</dd>
1756 </dl>
1757 <h4 class="returnvalue">Return Value</h4>
1758 <p class="description">Encoded string</p>
1759 <h4 class="discussion">Discussion</h4>
1760 <p class="discussion">This function is deprecated. Use the httpEncode64_2() function instead
1761 which provides buffer length arguments.
1762
1763 </p>
1764 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.21/Mac OS X 10.4&nbsp;</span><a name="httpEncode64_2">httpEncode64_2</a></h3>
1765 <p class="description">Base64-encode a string.</p>
1766 <p class="code">
1767 char *httpEncode64_2 (<br>
1768 &nbsp;&nbsp;&nbsp;&nbsp;char *out,<br>
1769 &nbsp;&nbsp;&nbsp;&nbsp;int outlen,<br>
1770 &nbsp;&nbsp;&nbsp;&nbsp;const char *in,<br>
1771 &nbsp;&nbsp;&nbsp;&nbsp;int inlen<br>
1772 );</p>
1773 <h4 class="parameters">Parameters</h4>
1774 <dl>
1775 <dt>out</dt>
1776 <dd class="description">String to write to</dd>
1777 <dt>outlen</dt>
1778 <dd class="description">Size of output string</dd>
1779 <dt>in</dt>
1780 <dd class="description">String to read from</dd>
1781 <dt>inlen</dt>
1782 <dd class="description">Size of input string</dd>
1783 </dl>
1784 <h4 class="returnvalue">Return Value</h4>
1785 <p class="description">Encoded string</p>
1786 <h3 class="function"><a name="httpEncryption">httpEncryption</a></h3>
1787 <p class="description">Set the required encryption on the link.</p>
1788 <p class="code">
1789 int httpEncryption (<br>
1790 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1791 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_encryption_t">http_encryption_t</a> e<br>
1792 );</p>
1793 <h4 class="parameters">Parameters</h4>
1794 <dl>
1795 <dt>http</dt>
1796 <dd class="description">Connection to server</dd>
1797 <dt>e</dt>
1798 <dd class="description">New encryption preference</dd>
1799 </dl>
1800 <h4 class="returnvalue">Return Value</h4>
1801 <p class="description">-1 on error, 0 on success</p>
1802 <h3 class="function"><a name="httpError">httpError</a></h3>
1803 <p class="description">Get the last error on a connection.</p>
1804 <p class="code">
1805 int httpError (<br>
1806 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1807 );</p>
1808 <h4 class="parameters">Parameters</h4>
1809 <dl>
1810 <dt>http</dt>
1811 <dd class="description">Connection to server</dd>
1812 </dl>
1813 <h4 class="returnvalue">Return Value</h4>
1814 <p class="description">Error code (errno) value</p>
1815 <h3 class="function"><a name="httpFlush">httpFlush</a></h3>
1816 <p class="description">Flush data from a HTTP connection.</p>
1817 <p class="code">
1818 void httpFlush (<br>
1819 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1820 );</p>
1821 <h4 class="parameters">Parameters</h4>
1822 <dl>
1823 <dt>http</dt>
1824 <dd class="description">Connection to server</dd>
1825 </dl>
1826 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpFlushWrite">httpFlushWrite</a></h3>
1827 <p class="description">Flush data in write buffer.</p>
1828 <p class="code">
1829 int httpFlushWrite (<br>
1830 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1831 );</p>
1832 <h4 class="parameters">Parameters</h4>
1833 <dl>
1834 <dt>http</dt>
1835 <dd class="description">Connection to server</dd>
1836 </dl>
1837 <h4 class="returnvalue">Return Value</h4>
1838 <p class="description">Bytes written or -1 on error</p>
1839 <h3 class="function"><a name="httpFreeCredentials">httpFreeCredentials</a></h3>
1840 <p class="description">Free an array of credentials.</p>
1841 <p class="code">
1842 void httpFreeCredentials (<br>
1843 &nbsp;&nbsp;&nbsp;&nbsp;cups_array_t *credentials<br>
1844 );</p>
1845 <h4 class="parameters">Parameters</h4>
1846 <dl>
1847 <dt>credentials</dt>
1848 <dd class="description">Array of credentials</dd>
1849 </dl>
1850 <h3 class="function"><a name="httpGet">httpGet</a></h3>
1851 <p class="description">Send a GET request to the server.</p>
1852 <p class="code">
1853 int httpGet (<br>
1854 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1855 &nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
1856 );</p>
1857 <h4 class="parameters">Parameters</h4>
1858 <dl>
1859 <dt>http</dt>
1860 <dd class="description">Connection to server</dd>
1861 <dt>uri</dt>
1862 <dd class="description">URI to get</dd>
1863 </dl>
1864 <h4 class="returnvalue">Return Value</h4>
1865 <p class="description">Status of call (0 = success)</p>
1866 <h3 class="function"><span class="info">&nbsp;CUPS 1.3/Mac OS X 10.5&nbsp;</span><a name="httpGetAuthString">httpGetAuthString</a></h3>
1867 <p class="description">Get the current authorization string.</p>
1868 <p class="code">
1869 char *httpGetAuthString (<br>
1870 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1871 );</p>
1872 <h4 class="parameters">Parameters</h4>
1873 <dl>
1874 <dt>http</dt>
1875 <dd class="description">Connection to server</dd>
1876 </dl>
1877 <h4 class="returnvalue">Return Value</h4>
1878 <p class="description">Authorization string</p>
1879 <h4 class="discussion">Discussion</h4>
1880 <p class="discussion">The authorization string is set by cupsDoAuthentication() and
1881 httpSetAuthString(). Use httpGetAuthString() to retrieve the
1882 string to use with httpSetField() for the HTTP_FIELD_AUTHORIZATION
1883 value.
1884
1885 </p>
1886 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpGetBlocking">httpGetBlocking</a></h3>
1887 <p class="description">Get the blocking/non-block state of a connection.</p>
1888 <p class="code">
1889 int httpGetBlocking (<br>
1890 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1891 );</p>
1892 <h4 class="parameters">Parameters</h4>
1893 <dl>
1894 <dt>http</dt>
1895 <dd class="description">Connection to server</dd>
1896 </dl>
1897 <h4 class="returnvalue">Return Value</h4>
1898 <p class="description">1 if blocking, 0 if non-blocking</p>
1899 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="httpGetCookie">httpGetCookie</a></h3>
1900 <p class="description">Get any cookie data from the response.</p>
1901 <p class="code">
1902 const char *httpGetCookie (<br>
1903 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1904 );</p>
1905 <h4 class="parameters">Parameters</h4>
1906 <dl>
1907 <dt>http</dt>
1908 <dd class="description">HTTP connecion</dd>
1909 </dl>
1910 <h4 class="returnvalue">Return Value</h4>
1911 <p class="description">Cookie data or NULL</p>
1912 <h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpGetDateString">httpGetDateString</a></h3>
1913 <p class="description">Get a formatted date/time string from a time value.</p>
1914 <p class="code">
1915 const char *httpGetDateString (<br>
1916 &nbsp;&nbsp;&nbsp;&nbsp;time_t t<br>
1917 );</p>
1918 <h4 class="parameters">Parameters</h4>
1919 <dl>
1920 <dt>t</dt>
1921 <dd class="description">UNIX time</dd>
1922 </dl>
1923 <h4 class="returnvalue">Return Value</h4>
1924 <p class="description">Date/time string</p>
1925 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpGetDateString2">httpGetDateString2</a></h3>
1926 <p class="description">Get a formatted date/time string from a time value.</p>
1927 <p class="code">
1928 const char *httpGetDateString2 (<br>
1929 &nbsp;&nbsp;&nbsp;&nbsp;time_t t,<br>
1930 &nbsp;&nbsp;&nbsp;&nbsp;char *s,<br>
1931 &nbsp;&nbsp;&nbsp;&nbsp;int slen<br>
1932 );</p>
1933 <h4 class="parameters">Parameters</h4>
1934 <dl>
1935 <dt>t</dt>
1936 <dd class="description">UNIX time</dd>
1937 <dt>s</dt>
1938 <dd class="description">String buffer</dd>
1939 <dt>slen</dt>
1940 <dd class="description">Size of string buffer</dd>
1941 </dl>
1942 <h4 class="returnvalue">Return Value</h4>
1943 <p class="description">Date/time string</p>
1944 <h3 class="function"><a name="httpGetDateTime">httpGetDateTime</a></h3>
1945 <p class="description">Get a time value from a formatted date/time string.</p>
1946 <p class="code">
1947 time_t httpGetDateTime (<br>
1948 &nbsp;&nbsp;&nbsp;&nbsp;const char *s<br>
1949 );</p>
1950 <h4 class="parameters">Parameters</h4>
1951 <dl>
1952 <dt>s</dt>
1953 <dd class="description">Date/time string</dd>
1954 </dl>
1955 <h4 class="returnvalue">Return Value</h4>
1956 <p class="description">UNIX time</p>
1957 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpGetFd">httpGetFd</a></h3>
1958 <p class="description">Get the file descriptor associated with a connection.</p>
1959 <p class="code">
1960 int httpGetFd (<br>
1961 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1962 );</p>
1963 <h4 class="parameters">Parameters</h4>
1964 <dl>
1965 <dt>http</dt>
1966 <dd class="description">Connection to server</dd>
1967 </dl>
1968 <h4 class="returnvalue">Return Value</h4>
1969 <p class="description">File descriptor or -1 if none</p>
1970 <h3 class="function"><a name="httpGetField">httpGetField</a></h3>
1971 <p class="description">Get a field value from a request/response.</p>
1972 <p class="code">
1973 const char *httpGetField (<br>
1974 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1975 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_field_t">http_field_t</a> field<br>
1976 );</p>
1977 <h4 class="parameters">Parameters</h4>
1978 <dl>
1979 <dt>http</dt>
1980 <dd class="description">Connection to server</dd>
1981 <dt>field</dt>
1982 <dd class="description">Field to get</dd>
1983 </dl>
1984 <h4 class="returnvalue">Return Value</h4>
1985 <p class="description">Field value</p>
1986 <h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpGetHostByName">httpGetHostByName</a></h3>
1987 <p class="description">Lookup a hostname or IPv4 address, and return
1988 address records for the specified name.</p>
1989 <p class="code">
1990 struct hostent *httpGetHostByName (<br>
1991 &nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
1992 );</p>
1993 <h4 class="parameters">Parameters</h4>
1994 <dl>
1995 <dt>name</dt>
1996 <dd class="description">Hostname or IP address</dd>
1997 </dl>
1998 <h4 class="returnvalue">Return Value</h4>
1999 <p class="description">Host entry</p>
2000 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpGetHostname">httpGetHostname</a></h3>
2001 <p class="description">Get the FQDN for the connection or local system.</p>
2002 <p class="code">
2003 const char *httpGetHostname (<br>
2004 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2005 &nbsp;&nbsp;&nbsp;&nbsp;char *s,<br>
2006 &nbsp;&nbsp;&nbsp;&nbsp;int slen<br>
2007 );</p>
2008 <h4 class="parameters">Parameters</h4>
2009 <dl>
2010 <dt>http</dt>
2011 <dd class="description">HTTP connection or NULL</dd>
2012 <dt>s</dt>
2013 <dd class="description">String buffer for name</dd>
2014 <dt>slen</dt>
2015 <dd class="description">Size of buffer</dd>
2016 </dl>
2017 <h4 class="returnvalue">Return Value</h4>
2018 <p class="description">FQDN for connection or system</p>
2019 <h4 class="discussion">Discussion</h4>
2020 <p class="discussion">When &quot;http&quot; points to a connected socket, return the hostname or
2021 address that was used in the call to httpConnect() or httpConnectEncrypt().
2022 Otherwise, return the FQDN for the local system using both gethostname()
2023 and gethostbyname() to get the local hostname with domain.
2024
2025 </p>
2026 <h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpGetLength">httpGetLength</a></h3>
2027 <p class="description">Get the amount of data remaining from the
2028 content-length or transfer-encoding fields.</p>
2029 <p class="code">
2030 int httpGetLength (<br>
2031 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2032 );</p>
2033 <h4 class="parameters">Parameters</h4>
2034 <dl>
2035 <dt>http</dt>
2036 <dd class="description">Connection to server</dd>
2037 </dl>
2038 <h4 class="returnvalue">Return Value</h4>
2039 <p class="description">Content length</p>
2040 <h4 class="discussion">Discussion</h4>
2041 <p class="discussion">This function is deprecated and will not return lengths larger than
2042 2^31 - 1; use httpGetLength2() instead.
2043
2044 </p>
2045 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpGetLength2">httpGetLength2</a></h3>
2046 <p class="description">Get the amount of data remaining from the
2047 content-length or transfer-encoding fields.</p>
2048 <p class="code">
2049 off_t httpGetLength2 (<br>
2050 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2051 );</p>
2052 <h4 class="parameters">Parameters</h4>
2053 <dl>
2054 <dt>http</dt>
2055 <dd class="description">Connection to server</dd>
2056 </dl>
2057 <h4 class="returnvalue">Return Value</h4>
2058 <p class="description">Content length</p>
2059 <h4 class="discussion">Discussion</h4>
2060 <p class="discussion">This function returns the complete content length, even for
2061 content larger than 2^31 - 1.
2062
2063 </p>
2064 <h3 class="function"><a name="httpGetState">httpGetState</a></h3>
2065 <p class="description">Get the current state of the HTTP request.</p>
2066 <p class="code">
2067 <a href="#http_state_t">http_state_t</a> httpGetState (<br>
2068 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2069 );</p>
2070 <h4 class="parameters">Parameters</h4>
2071 <dl>
2072 <dt>http</dt>
2073 <dd class="description">Connection to server</dd>
2074 </dl>
2075 <h4 class="returnvalue">Return Value</h4>
2076 <p class="description">HTTP state</p>
2077 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpGetStatus">httpGetStatus</a></h3>
2078 <p class="description">Get the status of the last HTTP request.</p>
2079 <p class="code">
2080 <a href="#http_status_t">http_status_t</a> httpGetStatus (<br>
2081 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2082 );</p>
2083 <h4 class="parameters">Parameters</h4>
2084 <dl>
2085 <dt>http</dt>
2086 <dd class="description">Connection to server</dd>
2087 </dl>
2088 <h4 class="returnvalue">Return Value</h4>
2089 <p class="description">HTTP status</p>
2090 <h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpGetSubField">httpGetSubField</a></h3>
2091 <p class="description">Get a sub-field value.</p>
2092 <p class="code">
2093 char *httpGetSubField (<br>
2094 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2095 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_field_t">http_field_t</a> field,<br>
2096 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2097 &nbsp;&nbsp;&nbsp;&nbsp;char *value<br>
2098 );</p>
2099 <h4 class="parameters">Parameters</h4>
2100 <dl>
2101 <dt>http</dt>
2102 <dd class="description">Connection to server</dd>
2103 <dt>field</dt>
2104 <dd class="description">Field index</dd>
2105 <dt>name</dt>
2106 <dd class="description">Name of sub-field</dd>
2107 <dt>value</dt>
2108 <dd class="description">Value string</dd>
2109 </dl>
2110 <h4 class="returnvalue">Return Value</h4>
2111 <p class="description">Value or NULL</p>
2112 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpGetSubField2">httpGetSubField2</a></h3>
2113 <p class="description">Get a sub-field value.</p>
2114 <p class="code">
2115 char *httpGetSubField2 (<br>
2116 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2117 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_field_t">http_field_t</a> field,<br>
2118 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2119 &nbsp;&nbsp;&nbsp;&nbsp;char *value,<br>
2120 &nbsp;&nbsp;&nbsp;&nbsp;int valuelen<br>
2121 );</p>
2122 <h4 class="parameters">Parameters</h4>
2123 <dl>
2124 <dt>http</dt>
2125 <dd class="description">Connection to server</dd>
2126 <dt>field</dt>
2127 <dd class="description">Field index</dd>
2128 <dt>name</dt>
2129 <dd class="description">Name of sub-field</dd>
2130 <dt>value</dt>
2131 <dd class="description">Value string</dd>
2132 <dt>valuelen</dt>
2133 <dd class="description">Size of value buffer</dd>
2134 </dl>
2135 <h4 class="returnvalue">Return Value</h4>
2136 <p class="description">Value or NULL</p>
2137 <h3 class="function"><a name="httpGetVersion">httpGetVersion</a></h3>
2138 <p class="description">Get the HTTP version at the other end.</p>
2139 <p class="code">
2140 <a href="#http_version_t">http_version_t</a> httpGetVersion (<br>
2141 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2142 );</p>
2143 <h4 class="parameters">Parameters</h4>
2144 <dl>
2145 <dt>http</dt>
2146 <dd class="description">Connection to server</dd>
2147 </dl>
2148 <h4 class="returnvalue">Return Value</h4>
2149 <p class="description">Version number</p>
2150 <h3 class="function"><a name="httpGets">httpGets</a></h3>
2151 <p class="description">Get a line of text from a HTTP connection.</p>
2152 <p class="code">
2153 char *httpGets (<br>
2154 &nbsp;&nbsp;&nbsp;&nbsp;char *line,<br>
2155 &nbsp;&nbsp;&nbsp;&nbsp;int length,<br>
2156 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2157 );</p>
2158 <h4 class="parameters">Parameters</h4>
2159 <dl>
2160 <dt>line</dt>
2161 <dd class="description">Line to read into</dd>
2162 <dt>length</dt>
2163 <dd class="description">Max length of buffer</dd>
2164 <dt>http</dt>
2165 <dd class="description">Connection to server</dd>
2166 </dl>
2167 <h4 class="returnvalue">Return Value</h4>
2168 <p class="description">Line or NULL</p>
2169 <h3 class="function"><a name="httpHead">httpHead</a></h3>
2170 <p class="description">Send a HEAD request to the server.</p>
2171 <p class="code">
2172 int httpHead (<br>
2173 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2174 &nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
2175 );</p>
2176 <h4 class="parameters">Parameters</h4>
2177 <dl>
2178 <dt>http</dt>
2179 <dd class="description">Connection to server</dd>
2180 <dt>uri</dt>
2181 <dd class="description">URI for head</dd>
2182 </dl>
2183 <h4 class="returnvalue">Return Value</h4>
2184 <p class="description">Status of call (0 = success)</p>
2185 <h3 class="function"><a name="httpInitialize">httpInitialize</a></h3>
2186 <p class="description">Initialize the HTTP interface library and set the
2187 default HTTP proxy (if any).</p>
2188 <p class="code">
2189 void httpInitialize (void);</p>
2190 <h3 class="function"><a name="httpMD5">httpMD5</a></h3>
2191 <p class="description">Compute the MD5 sum of the username:group:password.</p>
2192 <p class="code">
2193 char *httpMD5 (<br>
2194 &nbsp;&nbsp;&nbsp;&nbsp;const char *username,<br>
2195 &nbsp;&nbsp;&nbsp;&nbsp;const char *realm,<br>
2196 &nbsp;&nbsp;&nbsp;&nbsp;const char *passwd,<br>
2197 &nbsp;&nbsp;&nbsp;&nbsp;char md5[33]<br>
2198 );</p>
2199 <h4 class="parameters">Parameters</h4>
2200 <dl>
2201 <dt>username</dt>
2202 <dd class="description">User name</dd>
2203 <dt>realm</dt>
2204 <dd class="description">Realm name</dd>
2205 <dt>passwd</dt>
2206 <dd class="description">Password string</dd>
2207 <dt>md5[33]</dt>
2208 <dd class="description">MD5 string</dd>
2209 </dl>
2210 <h4 class="returnvalue">Return Value</h4>
2211 <p class="description">MD5 sum</p>
2212 <h3 class="function"><a name="httpMD5Final">httpMD5Final</a></h3>
2213 <p class="description">Combine the MD5 sum of the username, group, and password
2214 with the server-supplied nonce value, method, and
2215 request-uri.</p>
2216 <p class="code">
2217 char *httpMD5Final (<br>
2218 &nbsp;&nbsp;&nbsp;&nbsp;const char *nonce,<br>
2219 &nbsp;&nbsp;&nbsp;&nbsp;const char *method,<br>
2220 &nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
2221 &nbsp;&nbsp;&nbsp;&nbsp;char md5[33]<br>
2222 );</p>
2223 <h4 class="parameters">Parameters</h4>
2224 <dl>
2225 <dt>nonce</dt>
2226 <dd class="description">Server nonce value</dd>
2227 <dt>method</dt>
2228 <dd class="description">METHOD (GET, POST, etc.)</dd>
2229 <dt>resource</dt>
2230 <dd class="description">Resource path</dd>
2231 <dt>md5[33]</dt>
2232 <dd class="description">MD5 sum</dd>
2233 </dl>
2234 <h4 class="returnvalue">Return Value</h4>
2235 <p class="description">New sum</p>
2236 <h3 class="function"><a name="httpMD5String">httpMD5String</a></h3>
2237 <p class="description">Convert an MD5 sum to a character string.</p>
2238 <p class="code">
2239 char *httpMD5String (<br>
2240 &nbsp;&nbsp;&nbsp;&nbsp;const unsigned char *sum,<br>
2241 &nbsp;&nbsp;&nbsp;&nbsp;char md5[33]<br>
2242 );</p>
2243 <h4 class="parameters">Parameters</h4>
2244 <dl>
2245 <dt>sum</dt>
2246 <dd class="description">MD5 sum data</dd>
2247 <dt>md5[33]</dt>
2248 <dd class="description">MD5 sum in hex</dd>
2249 </dl>
2250 <h4 class="returnvalue">Return Value</h4>
2251 <p class="description">MD5 sum in hex</p>
2252 <h3 class="function"><a name="httpOptions">httpOptions</a></h3>
2253 <p class="description">Send an OPTIONS request to the server.</p>
2254 <p class="code">
2255 int httpOptions (<br>
2256 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2257 &nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
2258 );</p>
2259 <h4 class="parameters">Parameters</h4>
2260 <dl>
2261 <dt>http</dt>
2262 <dd class="description">Connection to server</dd>
2263 <dt>uri</dt>
2264 <dd class="description">URI for options</dd>
2265 </dl>
2266 <h4 class="returnvalue">Return Value</h4>
2267 <p class="description">Status of call (0 = success)</p>
2268 <h3 class="function"><a name="httpPost">httpPost</a></h3>
2269 <p class="description">Send a POST request to the server.</p>
2270 <p class="code">
2271 int httpPost (<br>
2272 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2273 &nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
2274 );</p>
2275 <h4 class="parameters">Parameters</h4>
2276 <dl>
2277 <dt>http</dt>
2278 <dd class="description">Connection to server</dd>
2279 <dt>uri</dt>
2280 <dd class="description">URI for post</dd>
2281 </dl>
2282 <h4 class="returnvalue">Return Value</h4>
2283 <p class="description">Status of call (0 = success)</p>
2284 <h3 class="function"><a name="httpPut">httpPut</a></h3>
2285 <p class="description">Send a PUT request to the server.</p>
2286 <p class="code">
2287 int httpPut (<br>
2288 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2289 &nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
2290 );</p>
2291 <h4 class="parameters">Parameters</h4>
2292 <dl>
2293 <dt>http</dt>
2294 <dd class="description">Connection to server</dd>
2295 <dt>uri</dt>
2296 <dd class="description">URI to put</dd>
2297 </dl>
2298 <h4 class="returnvalue">Return Value</h4>
2299 <p class="description">Status of call (0 = success)</p>
2300 <h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpRead">httpRead</a></h3>
2301 <p class="description">Read data from a HTTP connection.</p>
2302 <p class="code">
2303 int httpRead (<br>
2304 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2305 &nbsp;&nbsp;&nbsp;&nbsp;char *buffer,<br>
2306 &nbsp;&nbsp;&nbsp;&nbsp;int length<br>
2307 );</p>
2308 <h4 class="parameters">Parameters</h4>
2309 <dl>
2310 <dt>http</dt>
2311 <dd class="description">Connection to server</dd>
2312 <dt>buffer</dt>
2313 <dd class="description">Buffer for data</dd>
2314 <dt>length</dt>
2315 <dd class="description">Maximum number of bytes</dd>
2316 </dl>
2317 <h4 class="returnvalue">Return Value</h4>
2318 <p class="description">Number of bytes read</p>
2319 <h4 class="discussion">Discussion</h4>
2320 <p class="discussion">This function is deprecated. Use the httpRead2() function which can
2321 read more than 2GB of data.
2322
2323 </p>
2324 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpRead2">httpRead2</a></h3>
2325 <p class="description">Read data from a HTTP connection.</p>
2326 <p class="code">
2327 ssize_t httpRead2 (<br>
2328 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2329 &nbsp;&nbsp;&nbsp;&nbsp;char *buffer,<br>
2330 &nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
2331 );</p>
2332 <h4 class="parameters">Parameters</h4>
2333 <dl>
2334 <dt>http</dt>
2335 <dd class="description">Connection to server</dd>
2336 <dt>buffer</dt>
2337 <dd class="description">Buffer for data</dd>
2338 <dt>length</dt>
2339 <dd class="description">Maximum number of bytes</dd>
2340 </dl>
2341 <h4 class="returnvalue">Return Value</h4>
2342 <p class="description">Number of bytes read</p>
2343 <h3 class="function"><a name="httpReconnect">httpReconnect</a></h3>
2344 <p class="description">Reconnect to a HTTP server.</p>
2345 <p class="code">
2346 int httpReconnect (<br>
2347 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2348 );</p>
2349 <h4 class="parameters">Parameters</h4>
2350 <dl>
2351 <dt>http</dt>
2352 <dd class="description">Connection to server</dd>
2353 </dl>
2354 <h4 class="returnvalue">Return Value</h4>
2355 <p class="description">0 on success, non-zero on failure</p>
2356 <h3 class="function"><a name="httpReconnect2">httpReconnect2</a></h3>
2357 <p class="description">Reconnect to a HTTP server with timeout and optional
2358 cancel.</p>
2359 <p class="code">
2360 int httpReconnect2 (<br>
2361 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2362 &nbsp;&nbsp;&nbsp;&nbsp;int msec,<br>
2363 &nbsp;&nbsp;&nbsp;&nbsp;int *cancel<br>
2364 );</p>
2365 <h4 class="parameters">Parameters</h4>
2366 <dl>
2367 <dt>http</dt>
2368 <dd class="description">Connection to server</dd>
2369 <dt>msec</dt>
2370 <dd class="description">Timeout in milliseconds</dd>
2371 <dt>cancel</dt>
2372 <dd class="description">Pointer to &quot;cancel&quot; variable</dd>
2373 </dl>
2374 <h4 class="returnvalue">Return Value</h4>
2375 <p class="description">0 on success, non-zero on failure</p>
2376 <h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpSeparate">httpSeparate</a></h3>
2377 <p class="description">Separate a Universal Resource Identifier into its
2378 components.</p>
2379 <p class="code">
2380 void httpSeparate (<br>
2381 &nbsp;&nbsp;&nbsp;&nbsp;const char *uri,<br>
2382 &nbsp;&nbsp;&nbsp;&nbsp;char *scheme,<br>
2383 &nbsp;&nbsp;&nbsp;&nbsp;char *username,<br>
2384 &nbsp;&nbsp;&nbsp;&nbsp;char *host,<br>
2385 &nbsp;&nbsp;&nbsp;&nbsp;int *port,<br>
2386 &nbsp;&nbsp;&nbsp;&nbsp;char *resource<br>
2387 );</p>
2388 <h4 class="parameters">Parameters</h4>
2389 <dl>
2390 <dt>uri</dt>
2391 <dd class="description">Universal Resource Identifier</dd>
2392 <dt>scheme</dt>
2393 <dd class="description">Scheme [32] (http, https, etc.)</dd>
2394 <dt>username</dt>
2395 <dd class="description">Username [1024]</dd>
2396 <dt>host</dt>
2397 <dd class="description">Hostname [1024]</dd>
2398 <dt>port</dt>
2399 <dd class="description">Port number to use</dd>
2400 <dt>resource</dt>
2401 <dd class="description">Resource/filename [1024]</dd>
2402 </dl>
2403 <h4 class="discussion">Discussion</h4>
2404 <p class="discussion">This function is deprecated; use the httpSeparateURI() function instead.
2405
2406 </p>
2407 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.21/Mac OS X 10.4&nbsp;</span><a name="httpSeparate2">httpSeparate2</a></h3>
2408 <p class="description">Separate a Universal Resource Identifier into its
2409 components.</p>
2410 <p class="code">
2411 void httpSeparate2 (<br>
2412 &nbsp;&nbsp;&nbsp;&nbsp;const char *uri,<br>
2413 &nbsp;&nbsp;&nbsp;&nbsp;char *scheme,<br>
2414 &nbsp;&nbsp;&nbsp;&nbsp;int schemelen,<br>
2415 &nbsp;&nbsp;&nbsp;&nbsp;char *username,<br>
2416 &nbsp;&nbsp;&nbsp;&nbsp;int usernamelen,<br>
2417 &nbsp;&nbsp;&nbsp;&nbsp;char *host,<br>
2418 &nbsp;&nbsp;&nbsp;&nbsp;int hostlen,<br>
2419 &nbsp;&nbsp;&nbsp;&nbsp;int *port,<br>
2420 &nbsp;&nbsp;&nbsp;&nbsp;char *resource,<br>
2421 &nbsp;&nbsp;&nbsp;&nbsp;int resourcelen<br>
2422 );</p>
2423 <h4 class="parameters">Parameters</h4>
2424 <dl>
2425 <dt>uri</dt>
2426 <dd class="description">Universal Resource Identifier</dd>
2427 <dt>scheme</dt>
2428 <dd class="description">Scheme (http, https, etc.)</dd>
2429 <dt>schemelen</dt>
2430 <dd class="description">Size of scheme buffer</dd>
2431 <dt>username</dt>
2432 <dd class="description">Username</dd>
2433 <dt>usernamelen</dt>
2434 <dd class="description">Size of username buffer</dd>
2435 <dt>host</dt>
2436 <dd class="description">Hostname</dd>
2437 <dt>hostlen</dt>
2438 <dd class="description">Size of hostname buffer</dd>
2439 <dt>port</dt>
2440 <dd class="description">Port number to use</dd>
2441 <dt>resource</dt>
2442 <dd class="description">Resource/filename</dd>
2443 <dt>resourcelen</dt>
2444 <dd class="description">Size of resource buffer</dd>
2445 </dl>
2446 <h4 class="discussion">Discussion</h4>
2447 <p class="discussion">This function is deprecated; use the httpSeparateURI() function instead.
2448
2449
2450 </p>
2451 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpSeparateURI">httpSeparateURI</a></h3>
2452 <p class="description">Separate a Universal Resource Identifier into its
2453 components.</p>
2454 <p class="code">
2455 <a href="#http_uri_status_t">http_uri_status_t</a> httpSeparateURI (<br>
2456 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_uri_coding_t">http_uri_coding_t</a> decoding,<br>
2457 &nbsp;&nbsp;&nbsp;&nbsp;const char *uri,<br>
2458 &nbsp;&nbsp;&nbsp;&nbsp;char *scheme,<br>
2459 &nbsp;&nbsp;&nbsp;&nbsp;int schemelen,<br>
2460 &nbsp;&nbsp;&nbsp;&nbsp;char *username,<br>
2461 &nbsp;&nbsp;&nbsp;&nbsp;int usernamelen,<br>
2462 &nbsp;&nbsp;&nbsp;&nbsp;char *host,<br>
2463 &nbsp;&nbsp;&nbsp;&nbsp;int hostlen,<br>
2464 &nbsp;&nbsp;&nbsp;&nbsp;int *port,<br>
2465 &nbsp;&nbsp;&nbsp;&nbsp;char *resource,<br>
2466 &nbsp;&nbsp;&nbsp;&nbsp;int resourcelen<br>
2467 );</p>
2468 <h4 class="parameters">Parameters</h4>
2469 <dl>
2470 <dt>decoding</dt>
2471 <dd class="description">Decoding flags</dd>
2472 <dt>uri</dt>
2473 <dd class="description">Universal Resource Identifier</dd>
2474 <dt>scheme</dt>
2475 <dd class="description">Scheme (http, https, etc.)</dd>
2476 <dt>schemelen</dt>
2477 <dd class="description">Size of scheme buffer</dd>
2478 <dt>username</dt>
2479 <dd class="description">Username</dd>
2480 <dt>usernamelen</dt>
2481 <dd class="description">Size of username buffer</dd>
2482 <dt>host</dt>
2483 <dd class="description">Hostname</dd>
2484 <dt>hostlen</dt>
2485 <dd class="description">Size of hostname buffer</dd>
2486 <dt>port</dt>
2487 <dd class="description">Port number to use</dd>
2488 <dt>resource</dt>
2489 <dd class="description">Resource/filename</dd>
2490 <dt>resourcelen</dt>
2491 <dd class="description">Size of resource buffer</dd>
2492 </dl>
2493 <h4 class="returnvalue">Return Value</h4>
2494 <p class="description">Result of separation</p>
2495 <h3 class="function"><span class="info">&nbsp;CUPS 1.3/Mac OS X 10.5&nbsp;</span><a name="httpSetAuthString">httpSetAuthString</a></h3>
2496 <p class="description">Set the current authorization string.</p>
2497 <p class="code">
2498 void httpSetAuthString (<br>
2499 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2500 &nbsp;&nbsp;&nbsp;&nbsp;const char *scheme,<br>
2501 &nbsp;&nbsp;&nbsp;&nbsp;const char *data<br>
2502 );</p>
2503 <h4 class="parameters">Parameters</h4>
2504 <dl>
2505 <dt>http</dt>
2506 <dd class="description">Connection to server</dd>
2507 <dt>scheme</dt>
2508 <dd class="description">Auth scheme (NULL to clear it)</dd>
2509 <dt>data</dt>
2510 <dd class="description">Auth data (NULL for none)</dd>
2511 </dl>
2512 <h4 class="discussion">Discussion</h4>
2513 <p class="discussion">This function just stores a copy of the current authorization string in
2514 the HTTP connection object. You must still call httpSetField() to set
2515 HTTP_FIELD_AUTHORIZATION prior to issuing a HTTP request using httpGet(),
2516 httpHead(), httpOptions(), httpPost, or httpPut().
2517
2518 </p>
2519 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="httpSetCookie">httpSetCookie</a></h3>
2520 <p class="description">Set the cookie value(s).</p>
2521 <p class="code">
2522 void httpSetCookie (<br>
2523 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2524 &nbsp;&nbsp;&nbsp;&nbsp;const char *cookie<br>
2525 );</p>
2526 <h4 class="parameters">Parameters</h4>
2527 <dl>
2528 <dt>http</dt>
2529 <dd class="description">Connection</dd>
2530 <dt>cookie</dt>
2531 <dd class="description">Cookie string</dd>
2532 </dl>
2533 <h3 class="function"><span class="info">&nbsp;CUPS 1.5/Mac OS X 10.7&nbsp;</span><a name="httpSetCredentials">httpSetCredentials</a></h3>
2534 <p class="description">Set the credentials associated with an encrypted
2535 connection.</p>
2536 <p class="code">
2537 int httpSetCredentials (<br>
2538 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2539 &nbsp;&nbsp;&nbsp;&nbsp;cups_array_t *credentials<br>
2540 );</p>
2541 <h4 class="parameters">Parameters</h4>
2542 <dl>
2543 <dt>http</dt>
2544 <dd class="description">Connection to server</dd>
2545 <dt>credentials</dt>
2546 <dd class="description">Array of credentials</dd>
2547 </dl>
2548 <h4 class="returnvalue">Return Value</h4>
2549 <p class="description">Status of call (0 = success)</p>
2550 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpSetExpect">httpSetExpect</a></h3>
2551 <p class="description">Set the Expect: header in a request.</p>
2552 <p class="code">
2553 void httpSetExpect (<br>
2554 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2555 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_status_t">http_status_t</a> expect<br>
2556 );</p>
2557 <h4 class="parameters">Parameters</h4>
2558 <dl>
2559 <dt>http</dt>
2560 <dd class="description">Connection to server</dd>
2561 <dt>expect</dt>
2562 <dd class="description">HTTP status to expect (HTTP_CONTINUE)</dd>
2563 </dl>
2564 <h4 class="discussion">Discussion</h4>
2565 <p class="discussion">Currently only HTTP_CONTINUE is supported for the &quot;expect&quot; argument.
2566
2567 </p>
2568 <h3 class="function"><a name="httpSetField">httpSetField</a></h3>
2569 <p class="description">Set the value of an HTTP header.</p>
2570 <p class="code">
2571 void httpSetField (<br>
2572 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2573 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_field_t">http_field_t</a> field,<br>
2574 &nbsp;&nbsp;&nbsp;&nbsp;const char *value<br>
2575 );</p>
2576 <h4 class="parameters">Parameters</h4>
2577 <dl>
2578 <dt>http</dt>
2579 <dd class="description">Connection to server</dd>
2580 <dt>field</dt>
2581 <dd class="description">Field index</dd>
2582 <dt>value</dt>
2583 <dd class="description">Value</dd>
2584 </dl>
2585 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpSetLength">httpSetLength</a></h3>
2586 <p class="description">Set the content-length and content-encoding.</p>
2587 <p class="code">
2588 void httpSetLength (<br>
2589 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2590 &nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
2591 );</p>
2592 <h4 class="parameters">Parameters</h4>
2593 <dl>
2594 <dt>http</dt>
2595 <dd class="description">Connection to server</dd>
2596 <dt>length</dt>
2597 <dd class="description">Length (0 for chunked)</dd>
2598 </dl>
2599 <h3 class="function"><span class="info">&nbsp;CUPS 1.5/Mac OS X 10.7&nbsp;</span><a name="httpSetTimeout">httpSetTimeout</a></h3>
2600 <p class="description">Set read/write timeouts and an optional callback.</p>
2601 <p class="code">
2602 void httpSetTimeout (<br>
2603 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2604 &nbsp;&nbsp;&nbsp;&nbsp;double timeout,<br>
2605 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_timeout_cb_t">http_timeout_cb_t</a> cb,<br>
2606 &nbsp;&nbsp;&nbsp;&nbsp;void *user_data<br>
2607 );</p>
2608 <h4 class="parameters">Parameters</h4>
2609 <dl>
2610 <dt>http</dt>
2611 <dd class="description">Connection to server</dd>
2612 <dt>timeout</dt>
2613 <dd class="description">Number of seconds for timeout,
2614 must be greater than 0</dd>
2615 <dt>cb</dt>
2616 <dd class="description">Callback function or NULL</dd>
2617 <dt>user_data</dt>
2618 <dd class="description">User data pointer</dd>
2619 </dl>
2620 <h4 class="discussion">Discussion</h4>
2621 <p class="discussion">The optional timeout callback receives both the HTTP connection and a user
2622 data pointer and must return 1 to continue or 0 to error (time) out.
2623
2624 </p>
2625 <h3 class="function"><a name="httpStatus">httpStatus</a></h3>
2626 <p class="description">Return a short string describing a HTTP status code.</p>
2627 <p class="code">
2628 const char *httpStatus (<br>
2629 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_status_t">http_status_t</a> status<br>
2630 );</p>
2631 <h4 class="parameters">Parameters</h4>
2632 <dl>
2633 <dt>status</dt>
2634 <dd class="description">HTTP status code</dd>
2635 </dl>
2636 <h4 class="returnvalue">Return Value</h4>
2637 <p class="description">Localized status string</p>
2638 <h4 class="discussion">Discussion</h4>
2639 <p class="discussion">The returned string is localized to the current POSIX locale and is based
2640 on the status strings defined in RFC 2616.</p>
2641 <h3 class="function"><a name="httpTrace">httpTrace</a></h3>
2642 <p class="description">Send an TRACE request to the server.</p>
2643 <p class="code">
2644 int httpTrace (<br>
2645 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2646 &nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
2647 );</p>
2648 <h4 class="parameters">Parameters</h4>
2649 <dl>
2650 <dt>http</dt>
2651 <dd class="description">Connection to server</dd>
2652 <dt>uri</dt>
2653 <dd class="description">URI for trace</dd>
2654 </dl>
2655 <h4 class="returnvalue">Return Value</h4>
2656 <p class="description">Status of call (0 = success)</p>
2657 <h3 class="function"><a name="httpUpdate">httpUpdate</a></h3>
2658 <p class="description">Update the current HTTP state for incoming data.</p>
2659 <p class="code">
2660 <a href="#http_status_t">http_status_t</a> httpUpdate (<br>
2661 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2662 );</p>
2663 <h4 class="parameters">Parameters</h4>
2664 <dl>
2665 <dt>http</dt>
2666 <dd class="description">Connection to server</dd>
2667 </dl>
2668 <h4 class="returnvalue">Return Value</h4>
2669 <p class="description">HTTP status</p>
2670 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="httpWait">httpWait</a></h3>
2671 <p class="description">Wait for data available on a connection.</p>
2672 <p class="code">
2673 int httpWait (<br>
2674 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2675 &nbsp;&nbsp;&nbsp;&nbsp;int msec<br>
2676 );</p>
2677 <h4 class="parameters">Parameters</h4>
2678 <dl>
2679 <dt>http</dt>
2680 <dd class="description">Connection to server</dd>
2681 <dt>msec</dt>
2682 <dd class="description">Milliseconds to wait</dd>
2683 </dl>
2684 <h4 class="returnvalue">Return Value</h4>
2685 <p class="description">1 if data is available, 0 otherwise</p>
2686 <h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpWrite">httpWrite</a></h3>
2687 <p class="description">Write data to a HTTP connection.</p>
2688 <p class="code">
2689 int httpWrite (<br>
2690 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2691 &nbsp;&nbsp;&nbsp;&nbsp;const char *buffer,<br>
2692 &nbsp;&nbsp;&nbsp;&nbsp;int length<br>
2693 );</p>
2694 <h4 class="parameters">Parameters</h4>
2695 <dl>
2696 <dt>http</dt>
2697 <dd class="description">Connection to server</dd>
2698 <dt>buffer</dt>
2699 <dd class="description">Buffer for data</dd>
2700 <dt>length</dt>
2701 <dd class="description">Number of bytes to write</dd>
2702 </dl>
2703 <h4 class="returnvalue">Return Value</h4>
2704 <p class="description">Number of bytes written</p>
2705 <h4 class="discussion">Discussion</h4>
2706 <p class="discussion">This function is deprecated. Use the httpWrite2() function which can
2707 write more than 2GB of data.
2708
2709 </p>
2710 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="httpWrite2">httpWrite2</a></h3>
2711 <p class="description">Write data to a HTTP connection.</p>
2712 <p class="code">
2713 ssize_t httpWrite2 (<br>
2714 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2715 &nbsp;&nbsp;&nbsp;&nbsp;const char *buffer,<br>
2716 &nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
2717 );</p>
2718 <h4 class="parameters">Parameters</h4>
2719 <dl>
2720 <dt>http</dt>
2721 <dd class="description">Connection to server</dd>
2722 <dt>buffer</dt>
2723 <dd class="description">Buffer for data</dd>
2724 <dt>length</dt>
2725 <dd class="description">Number of bytes to write</dd>
2726 </dl>
2727 <h4 class="returnvalue">Return Value</h4>
2728 <p class="description">Number of bytes written</p>
2729 <h3 class="function"><a name="ippAddBoolean">ippAddBoolean</a></h3>
2730 <p class="description">Add a boolean attribute to an IPP message.</p>
2731 <p class="code">
2732 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBoolean (<br>
2733 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
2734 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
2735 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2736 &nbsp;&nbsp;&nbsp;&nbsp;char value<br>
2737 );</p>
2738 <h4 class="parameters">Parameters</h4>
2739 <dl>
2740 <dt>ipp</dt>
2741 <dd class="description">IPP message</dd>
2742 <dt>group</dt>
2743 <dd class="description">IPP group</dd>
2744 <dt>name</dt>
2745 <dd class="description">Name of attribute</dd>
2746 <dt>value</dt>
2747 <dd class="description">Value of attribute</dd>
2748 </dl>
2749 <h4 class="returnvalue">Return Value</h4>
2750 <p class="description">New attribute</p>
2751 <h4 class="discussion">Discussion</h4>
2752 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
2753 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
2754 <br>
2755 The <code>group</code> parameter specifies the IPP attribute group tag: none
2756 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
2757 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
2758 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
2759 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
2760 <h3 class="function"><a name="ippAddBooleans">ippAddBooleans</a></h3>
2761 <p class="description">Add an array of boolean values.</p>
2762 <p class="code">
2763 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBooleans (<br>
2764 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
2765 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
2766 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2767 &nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
2768 &nbsp;&nbsp;&nbsp;&nbsp;const char *values<br>
2769 );</p>
2770 <h4 class="parameters">Parameters</h4>
2771 <dl>
2772 <dt>ipp</dt>
2773 <dd class="description">IPP message</dd>
2774 <dt>group</dt>
2775 <dd class="description">IPP group</dd>
2776 <dt>name</dt>
2777 <dd class="description">Name of attribute</dd>
2778 <dt>num_values</dt>
2779 <dd class="description">Number of values</dd>
2780 <dt>values</dt>
2781 <dd class="description">Values</dd>
2782 </dl>
2783 <h4 class="returnvalue">Return Value</h4>
2784 <p class="description">New attribute</p>
2785 <h4 class="discussion">Discussion</h4>
2786 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
2787 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
2788 <br>
2789 The <code>group</code> parameter specifies the IPP attribute group tag: none
2790 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
2791 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
2792 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
2793 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
2794 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="ippAddCollection">ippAddCollection</a></h3>
2795 <p class="description">Add a collection value.</p>
2796 <p class="code">
2797 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollection (<br>
2798 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
2799 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
2800 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2801 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *value<br>
2802 );</p>
2803 <h4 class="parameters">Parameters</h4>
2804 <dl>
2805 <dt>ipp</dt>
2806 <dd class="description">IPP message</dd>
2807 <dt>group</dt>
2808 <dd class="description">IPP group</dd>
2809 <dt>name</dt>
2810 <dd class="description">Name of attribute</dd>
2811 <dt>value</dt>
2812 <dd class="description">Value</dd>
2813 </dl>
2814 <h4 class="returnvalue">Return Value</h4>
2815 <p class="description">New attribute</p>
2816 <h4 class="discussion">Discussion</h4>
2817 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
2818 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
2819 <br>
2820 The <code>group</code> parameter specifies the IPP attribute group tag: none
2821 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
2822 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
2823 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
2824 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
2825
2826 </p>
2827 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="ippAddCollections">ippAddCollections</a></h3>
2828 <p class="description">Add an array of collection values.</p>
2829 <p class="code">
2830 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollections (<br>
2831 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
2832 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
2833 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2834 &nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
2835 &nbsp;&nbsp;&nbsp;&nbsp;const <a href="#ipp_t">ipp_t</a> **values<br>
2836 );</p>
2837 <h4 class="parameters">Parameters</h4>
2838 <dl>
2839 <dt>ipp</dt>
2840 <dd class="description">IPP message</dd>
2841 <dt>group</dt>
2842 <dd class="description">IPP group</dd>
2843 <dt>name</dt>
2844 <dd class="description">Name of attribute</dd>
2845 <dt>num_values</dt>
2846 <dd class="description">Number of values</dd>
2847 <dt>values</dt>
2848 <dd class="description">Values</dd>
2849 </dl>
2850 <h4 class="returnvalue">Return Value</h4>
2851 <p class="description">New attribute</p>
2852 <h4 class="discussion">Discussion</h4>
2853 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
2854 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
2855 <br>
2856 The <code>group</code> parameter specifies the IPP attribute group tag: none
2857 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
2858 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
2859 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
2860 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
2861
2862 </p>
2863 <h3 class="function"><a name="ippAddDate">ippAddDate</a></h3>
2864 <p class="description">Add a date attribute to an IPP message.</p>
2865 <p class="code">
2866 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddDate (<br>
2867 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
2868 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
2869 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2870 &nbsp;&nbsp;&nbsp;&nbsp;const <a href="#ipp_uchar_t">ipp_uchar_t</a> *value<br>
2871 );</p>
2872 <h4 class="parameters">Parameters</h4>
2873 <dl>
2874 <dt>ipp</dt>
2875 <dd class="description">IPP message</dd>
2876 <dt>group</dt>
2877 <dd class="description">IPP group</dd>
2878 <dt>name</dt>
2879 <dd class="description">Name of attribute</dd>
2880 <dt>value</dt>
2881 <dd class="description">Value</dd>
2882 </dl>
2883 <h4 class="returnvalue">Return Value</h4>
2884 <p class="description">New attribute</p>
2885 <h4 class="discussion">Discussion</h4>
2886 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
2887 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
2888 <br>
2889 The <code>group</code> parameter specifies the IPP attribute group tag: none
2890 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
2891 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
2892 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
2893 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
2894 <h3 class="function"><a name="ippAddInteger">ippAddInteger</a></h3>
2895 <p class="description">Add a integer attribute to an IPP message.</p>
2896 <p class="code">
2897 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddInteger (<br>
2898 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
2899 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
2900 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t value_tag,<br>
2901 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2902 &nbsp;&nbsp;&nbsp;&nbsp;int value<br>
2903 );</p>
2904 <h4 class="parameters">Parameters</h4>
2905 <dl>
2906 <dt>ipp</dt>
2907 <dd class="description">IPP message</dd>
2908 <dt>group</dt>
2909 <dd class="description">IPP group</dd>
2910 <dt>value_tag</dt>
2911 <dd class="description">Type of attribute</dd>
2912 <dt>name</dt>
2913 <dd class="description">Name of attribute</dd>
2914 <dt>value</dt>
2915 <dd class="description">Value of attribute</dd>
2916 </dl>
2917 <h4 class="returnvalue">Return Value</h4>
2918 <p class="description">New attribute</p>
2919 <h4 class="discussion">Discussion</h4>
2920 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
2921 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
2922 <br>
2923 The <code>group</code> parameter specifies the IPP attribute group tag: none
2924 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
2925 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
2926 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
2927 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
2928 <br>
2929 Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
2930 (<code>IPP_TAG_INTEGER</code>).</p>
2931 <h3 class="function"><a name="ippAddIntegers">ippAddIntegers</a></h3>
2932 <p class="description">Add an array of integer values.</p>
2933 <p class="code">
2934 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddIntegers (<br>
2935 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
2936 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
2937 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t value_tag,<br>
2938 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2939 &nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
2940 &nbsp;&nbsp;&nbsp;&nbsp;const int *values<br>
2941 );</p>
2942 <h4 class="parameters">Parameters</h4>
2943 <dl>
2944 <dt>ipp</dt>
2945 <dd class="description">IPP message</dd>
2946 <dt>group</dt>
2947 <dd class="description">IPP group</dd>
2948 <dt>value_tag</dt>
2949 <dd class="description">Type of attribute</dd>
2950 <dt>name</dt>
2951 <dd class="description">Name of attribute</dd>
2952 <dt>num_values</dt>
2953 <dd class="description">Number of values</dd>
2954 <dt>values</dt>
2955 <dd class="description">Values</dd>
2956 </dl>
2957 <h4 class="returnvalue">Return Value</h4>
2958 <p class="description">New attribute</p>
2959 <h4 class="discussion">Discussion</h4>
2960 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
2961 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
2962 <br>
2963 The <code>group</code> parameter specifies the IPP attribute group tag: none
2964 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
2965 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
2966 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
2967 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
2968 <br>
2969 Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
2970 (<code>IPP_TAG_INTEGER</code>).</p>
2971 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ippAddOctetString">ippAddOctetString</a></h3>
2972 <p class="description">Add an octetString value to an IPP message.</p>
2973 <p class="code">
2974 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOctetString (<br>
2975 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
2976 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
2977 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2978 &nbsp;&nbsp;&nbsp;&nbsp;const void *data,<br>
2979 &nbsp;&nbsp;&nbsp;&nbsp;int datalen<br>
2980 );</p>
2981 <h4 class="parameters">Parameters</h4>
2982 <dl>
2983 <dt>ipp</dt>
2984 <dd class="description">IPP message</dd>
2985 <dt>group</dt>
2986 <dd class="description">IPP group</dd>
2987 <dt>name</dt>
2988 <dd class="description">Name of attribute</dd>
2989 <dt>data</dt>
2990 <dd class="description">octetString data</dd>
2991 <dt>datalen</dt>
2992 <dd class="description">Length of data in bytes</dd>
2993 </dl>
2994 <h4 class="returnvalue">Return Value</h4>
2995 <p class="description">New attribute</p>
2996 <h4 class="discussion">Discussion</h4>
2997 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
2998 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
2999 <br>
3000 The <code>group</code> parameter specifies the IPP attribute group tag: none
3001 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3002 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3003 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3004 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
3005
3006 </p>
3007 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippAddOutOfBand">ippAddOutOfBand</a></h3>
3008 <p class="description">Add an out-of-band value to an IPP message.</p>
3009 <p class="code">
3010 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOutOfBand (<br>
3011 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3012 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
3013 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t value_tag,<br>
3014 &nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
3015 );</p>
3016 <h4 class="parameters">Parameters</h4>
3017 <dl>
3018 <dt>ipp</dt>
3019 <dd class="description">IPP message</dd>
3020 <dt>group</dt>
3021 <dd class="description">IPP group</dd>
3022 <dt>value_tag</dt>
3023 <dd class="description">Type of attribute</dd>
3024 <dt>name</dt>
3025 <dd class="description">Name of attribute</dd>
3026 </dl>
3027 <h4 class="returnvalue">Return Value</h4>
3028 <p class="description">New attribute</p>
3029 <h4 class="discussion">Discussion</h4>
3030 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
3031 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
3032 <br>
3033 The <code>group</code> parameter specifies the IPP attribute group tag: none
3034 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3035 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3036 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3037 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
3038 <br>
3039 Supported out-of-band values include unsupported-value
3040 (<code>IPP_TAG_UNSUPPORTED_VALUE</code>), default (<code>IPP_TAG_DEFAULT</code>), unknown
3041 (<code>IPP_TAG_UNKNOWN</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable
3042 (<code>IPP_TAG_NOTSETTABLE</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), and
3043 admin-define (<code>IPP_TAG_ADMINDEFINE</code>).
3044
3045 </p>
3046 <h3 class="function"><a name="ippAddRange">ippAddRange</a></h3>
3047 <p class="description">Add a range of values to an IPP message.</p>
3048 <p class="code">
3049 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRange (<br>
3050 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3051 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
3052 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3053 &nbsp;&nbsp;&nbsp;&nbsp;int lower,<br>
3054 &nbsp;&nbsp;&nbsp;&nbsp;int upper<br>
3055 );</p>
3056 <h4 class="parameters">Parameters</h4>
3057 <dl>
3058 <dt>ipp</dt>
3059 <dd class="description">IPP message</dd>
3060 <dt>group</dt>
3061 <dd class="description">IPP group</dd>
3062 <dt>name</dt>
3063 <dd class="description">Name of attribute</dd>
3064 <dt>lower</dt>
3065 <dd class="description">Lower value</dd>
3066 <dt>upper</dt>
3067 <dd class="description">Upper value</dd>
3068 </dl>
3069 <h4 class="returnvalue">Return Value</h4>
3070 <p class="description">New attribute</p>
3071 <h4 class="discussion">Discussion</h4>
3072 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
3073 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
3074 <br>
3075 The <code>group</code> parameter specifies the IPP attribute group tag: none
3076 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3077 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3078 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3079 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
3080 <br>
3081 The <code>lower</code> parameter must be less than or equal to the <code>upper</code> parameter.</p>
3082 <h3 class="function"><a name="ippAddRanges">ippAddRanges</a></h3>
3083 <p class="description">Add ranges of values to an IPP message.</p>
3084 <p class="code">
3085 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRanges (<br>
3086 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3087 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
3088 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3089 &nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
3090 &nbsp;&nbsp;&nbsp;&nbsp;const int *lower,<br>
3091 &nbsp;&nbsp;&nbsp;&nbsp;const int *upper<br>
3092 );</p>
3093 <h4 class="parameters">Parameters</h4>
3094 <dl>
3095 <dt>ipp</dt>
3096 <dd class="description">IPP message</dd>
3097 <dt>group</dt>
3098 <dd class="description">IPP group</dd>
3099 <dt>name</dt>
3100 <dd class="description">Name of attribute</dd>
3101 <dt>num_values</dt>
3102 <dd class="description">Number of values</dd>
3103 <dt>lower</dt>
3104 <dd class="description">Lower values</dd>
3105 <dt>upper</dt>
3106 <dd class="description">Upper values</dd>
3107 </dl>
3108 <h4 class="returnvalue">Return Value</h4>
3109 <p class="description">New attribute</p>
3110 <h4 class="discussion">Discussion</h4>
3111 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
3112 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
3113 <br>
3114 The <code>group</code> parameter specifies the IPP attribute group tag: none
3115 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3116 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3117 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3118 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
3119 <h3 class="function"><a name="ippAddResolution">ippAddResolution</a></h3>
3120 <p class="description">Add a resolution value to an IPP message.</p>
3121 <p class="code">
3122 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolution (<br>
3123 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3124 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
3125 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3126 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_res_t">ipp_res_t</a> units,<br>
3127 &nbsp;&nbsp;&nbsp;&nbsp;int xres,<br>
3128 &nbsp;&nbsp;&nbsp;&nbsp;int yres<br>
3129 );</p>
3130 <h4 class="parameters">Parameters</h4>
3131 <dl>
3132 <dt>ipp</dt>
3133 <dd class="description">IPP message</dd>
3134 <dt>group</dt>
3135 <dd class="description">IPP group</dd>
3136 <dt>name</dt>
3137 <dd class="description">Name of attribute</dd>
3138 <dt>units</dt>
3139 <dd class="description">Units for resolution</dd>
3140 <dt>xres</dt>
3141 <dd class="description">X resolution</dd>
3142 <dt>yres</dt>
3143 <dd class="description">Y resolution</dd>
3144 </dl>
3145 <h4 class="returnvalue">Return Value</h4>
3146 <p class="description">New attribute</p>
3147 <h4 class="discussion">Discussion</h4>
3148 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
3149 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
3150 <br>
3151 The <code>group</code> parameter specifies the IPP attribute group tag: none
3152 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3153 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3154 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3155 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
3156 <h3 class="function"><a name="ippAddResolutions">ippAddResolutions</a></h3>
3157 <p class="description">Add resolution values to an IPP message.</p>
3158 <p class="code">
3159 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolutions (<br>
3160 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3161 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
3162 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3163 &nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
3164 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_res_t">ipp_res_t</a> units,<br>
3165 &nbsp;&nbsp;&nbsp;&nbsp;const int *xres,<br>
3166 &nbsp;&nbsp;&nbsp;&nbsp;const int *yres<br>
3167 );</p>
3168 <h4 class="parameters">Parameters</h4>
3169 <dl>
3170 <dt>ipp</dt>
3171 <dd class="description">IPP message</dd>
3172 <dt>group</dt>
3173 <dd class="description">IPP group</dd>
3174 <dt>name</dt>
3175 <dd class="description">Name of attribute</dd>
3176 <dt>num_values</dt>
3177 <dd class="description">Number of values</dd>
3178 <dt>units</dt>
3179 <dd class="description">Units for resolution</dd>
3180 <dt>xres</dt>
3181 <dd class="description">X resolutions</dd>
3182 <dt>yres</dt>
3183 <dd class="description">Y resolutions</dd>
3184 </dl>
3185 <h4 class="returnvalue">Return Value</h4>
3186 <p class="description">New attribute</p>
3187 <h4 class="discussion">Discussion</h4>
3188 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
3189 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
3190 <br>
3191 The <code>group</code> parameter specifies the IPP attribute group tag: none
3192 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3193 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3194 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3195 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
3196 <h3 class="function"><a name="ippAddSeparator">ippAddSeparator</a></h3>
3197 <p class="description">Add a group separator to an IPP message.</p>
3198 <p class="code">
3199 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddSeparator (<br>
3200 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3201 );</p>
3202 <h4 class="parameters">Parameters</h4>
3203 <dl>
3204 <dt>ipp</dt>
3205 <dd class="description">IPP message</dd>
3206 </dl>
3207 <h4 class="returnvalue">Return Value</h4>
3208 <p class="description">New attribute</p>
3209 <h4 class="discussion">Discussion</h4>
3210 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
3211 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.</p>
3212 <h3 class="function"><a name="ippAddString">ippAddString</a></h3>
3213 <p class="description">Add a language-encoded string to an IPP message.</p>
3214 <p class="code">
3215 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddString (<br>
3216 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3217 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
3218 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t value_tag,<br>
3219 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3220 &nbsp;&nbsp;&nbsp;&nbsp;const char *language,<br>
3221 &nbsp;&nbsp;&nbsp;&nbsp;const char *value<br>
3222 );</p>
3223 <h4 class="parameters">Parameters</h4>
3224 <dl>
3225 <dt>ipp</dt>
3226 <dd class="description">IPP message</dd>
3227 <dt>group</dt>
3228 <dd class="description">IPP group</dd>
3229 <dt>value_tag</dt>
3230 <dd class="description">Type of attribute</dd>
3231 <dt>name</dt>
3232 <dd class="description">Name of attribute</dd>
3233 <dt>language</dt>
3234 <dd class="description">Language code</dd>
3235 <dt>value</dt>
3236 <dd class="description">Value</dd>
3237 </dl>
3238 <h4 class="returnvalue">Return Value</h4>
3239 <p class="description">New attribute</p>
3240 <h4 class="discussion">Discussion</h4>
3241 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
3242 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
3243 <br>
3244 The <code>group</code> parameter specifies the IPP attribute group tag: none
3245 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3246 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3247 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3248 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
3249 <br>
3250 Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
3251 (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
3252 (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
3253 (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
3254 (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
3255 (<code>IPP_TAG_URISCHEME</code>).<br>
3256 <br>
3257 The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
3258 textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
3259 <h3 class="function"><a name="ippAddStrings">ippAddStrings</a></h3>
3260 <p class="description">Add language-encoded strings to an IPP message.</p>
3261 <p class="code">
3262 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStrings (<br>
3263 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3264 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
3265 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t value_tag,<br>
3266 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3267 &nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
3268 &nbsp;&nbsp;&nbsp;&nbsp;const char *language,<br>
3269 &nbsp;&nbsp;&nbsp;&nbsp;const char *const *values<br>
3270 );</p>
3271 <h4 class="parameters">Parameters</h4>
3272 <dl>
3273 <dt>ipp</dt>
3274 <dd class="description">IPP message</dd>
3275 <dt>group</dt>
3276 <dd class="description">IPP group</dd>
3277 <dt>value_tag</dt>
3278 <dd class="description">Type of attribute</dd>
3279 <dt>name</dt>
3280 <dd class="description">Name of attribute</dd>
3281 <dt>num_values</dt>
3282 <dd class="description">Number of values</dd>
3283 <dt>language</dt>
3284 <dd class="description">Language code (<code>NULL</code> for default)</dd>
3285 <dt>values</dt>
3286 <dd class="description">Values</dd>
3287 </dl>
3288 <h4 class="returnvalue">Return Value</h4>
3289 <p class="description">New attribute</p>
3290 <h4 class="discussion">Discussion</h4>
3291 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
3292 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
3293 <br>
3294 The <code>group</code> parameter specifies the IPP attribute group tag: none
3295 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3296 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3297 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3298 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
3299 <br>
3300 Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
3301 (<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
3302 (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
3303 (<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
3304 (<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
3305 (<code>IPP_TAG_URISCHEME</code>).<br>
3306 <br>
3307 The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
3308 textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
3309 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippAttributeString">ippAttributeString</a></h3>
3310 <p class="description">Convert the attribute's value to a string.</p>
3311 <p class="code">
3312 size_t ippAttributeString (<br>
3313 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
3314 &nbsp;&nbsp;&nbsp;&nbsp;char *buffer,<br>
3315 &nbsp;&nbsp;&nbsp;&nbsp;size_t bufsize<br>
3316 );</p>
3317 <h4 class="parameters">Parameters</h4>
3318 <dl>
3319 <dt>attr</dt>
3320 <dd class="description">Attribute</dd>
3321 <dt>buffer</dt>
3322 <dd class="description">String buffer or NULL</dd>
3323 <dt>bufsize</dt>
3324 <dd class="description">Size of string buffer</dd>
3325 </dl>
3326 <h4 class="returnvalue">Return Value</h4>
3327 <p class="description">Number of bytes less nul</p>
3328 <h4 class="discussion">Discussion</h4>
3329 <p class="discussion">Returns the number of bytes that would be written, not including the
3330 trailing nul. The buffer pointer can be NULL to get the required length,
3331 just like (v)snprintf.
3332
3333 </p>
3334 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippCopyAttribute">ippCopyAttribute</a></h3>
3335 <p class="description">Copy an attribute.</p>
3336 <p class="code">
3337 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippCopyAttribute (<br>
3338 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *dst,<br>
3339 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *srcattr,<br>
3340 &nbsp;&nbsp;&nbsp;&nbsp;int quickcopy<br>
3341 );</p>
3342 <h4 class="parameters">Parameters</h4>
3343 <dl>
3344 <dt>dst</dt>
3345 <dd class="description">Destination IPP message</dd>
3346 <dt>srcattr</dt>
3347 <dd class="description">Attribute to copy</dd>
3348 <dt>quickcopy</dt>
3349 <dd class="description">1 for a referenced copy, 0 for normal</dd>
3350 </dl>
3351 <h4 class="returnvalue">Return Value</h4>
3352 <p class="description">New attribute</p>
3353 <h4 class="discussion">Discussion</h4>
3354 <p class="discussion">The specified attribute, <code>attr</code>, is copied to the destination IPP message.
3355 When <code>quickcopy</code> is non-zero, a &quot;shallow&quot; reference copy of the attribute is
3356 created - this should only be done as long as the original source IPP message will
3357 not be freed for the life of the destination.
3358
3359 </p>
3360 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippCopyAttributes">ippCopyAttributes</a></h3>
3361 <p class="description">Copy attributes from one IPP message to another.</p>
3362 <p class="code">
3363 int ippCopyAttributes (<br>
3364 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *dst,<br>
3365 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *src,<br>
3366 &nbsp;&nbsp;&nbsp;&nbsp;int quickcopy,<br>
3367 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_copycb_t">ipp_copycb_t</a> cb,<br>
3368 &nbsp;&nbsp;&nbsp;&nbsp;void *context<br>
3369 );</p>
3370 <h4 class="parameters">Parameters</h4>
3371 <dl>
3372 <dt>dst</dt>
3373 <dd class="description">Destination IPP message</dd>
3374 <dt>src</dt>
3375 <dd class="description">Source IPP message</dd>
3376 <dt>quickcopy</dt>
3377 <dd class="description">1 for a referenced copy, 0 for normal</dd>
3378 <dt>cb</dt>
3379 <dd class="description">Copy callback or <code>NULL</code> for none</dd>
3380 <dt>context</dt>
3381 <dd class="description">Context pointer</dd>
3382 </dl>
3383 <h4 class="returnvalue">Return Value</h4>
3384 <p class="description">1 on success, 0 on error</p>
3385 <h4 class="discussion">Discussion</h4>
3386 <p class="discussion">Zero or more attributes are copied from the source IPP message, @code@ src, to the
3387 destination IPP message, <code>dst</code>. When <code>quickcopy</code> is non-zero, a &quot;shallow&quot;
3388 reference copy of the attribute is created - this should only be done as long as the
3389 original source IPP message will not be freed for the life of the destination.<br>
3390 <br>
3391 The <code>cb</code> and <code>context</code> parameters provide a generic way to &quot;filter&quot; the
3392 attributes that are copied - the function must return 1 to copy the attribute or
3393 0 to skip it. The function may also choose to do a partial copy of the source attribute
3394 itself.
3395
3396 </p>
3397 <h3 class="function"><a name="ippDateToTime">ippDateToTime</a></h3>
3398 <p class="description">Convert from RFC 1903 Date/Time format to UNIX time
3399 in seconds.</p>
3400 <p class="code">
3401 time_t ippDateToTime (<br>
3402 &nbsp;&nbsp;&nbsp;&nbsp;const <a href="#ipp_uchar_t">ipp_uchar_t</a> *date<br>
3403 );</p>
3404 <h4 class="parameters">Parameters</h4>
3405 <dl>
3406 <dt>date</dt>
3407 <dd class="description">RFC 1903 date info</dd>
3408 </dl>
3409 <h4 class="returnvalue">Return Value</h4>
3410 <p class="description">UNIX time value</p>
3411 <h3 class="function"><a name="ippDelete">ippDelete</a></h3>
3412 <p class="description">Delete an IPP message.</p>
3413 <p class="code">
3414 void ippDelete (<br>
3415 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3416 );</p>
3417 <h4 class="parameters">Parameters</h4>
3418 <dl>
3419 <dt>ipp</dt>
3420 <dd class="description">IPP message</dd>
3421 </dl>
3422 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="ippDeleteAttribute">ippDeleteAttribute</a></h3>
3423 <p class="description">Delete a single attribute in an IPP message.</p>
3424 <p class="code">
3425 void ippDeleteAttribute (<br>
3426 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3427 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
3428 );</p>
3429 <h4 class="parameters">Parameters</h4>
3430 <dl>
3431 <dt>ipp</dt>
3432 <dd class="description">IPP message</dd>
3433 <dt>attr</dt>
3434 <dd class="description">Attribute to delete</dd>
3435 </dl>
3436 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippDeleteValues">ippDeleteValues</a></h3>
3437 <p class="description">Delete values in an attribute.</p>
3438 <p class="code">
3439 int ippDeleteValues (<br>
3440 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3441 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
3442 &nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
3443 &nbsp;&nbsp;&nbsp;&nbsp;int count<br>
3444 );</p>
3445 <h4 class="parameters">Parameters</h4>
3446 <dl>
3447 <dt>ipp</dt>
3448 <dd class="description">IPP message</dd>
3449 <dt>attr</dt>
3450 <dd class="description">Attribute</dd>
3451 <dt>element</dt>
3452 <dd class="description">Index of first value to delete (0-based)</dd>
3453 <dt>count</dt>
3454 <dd class="description">Number of values to delete</dd>
3455 </dl>
3456 <h4 class="returnvalue">Return Value</h4>
3457 <p class="description">1 on success, 0 on failure</p>
3458 <h4 class="discussion">Discussion</h4>
3459 <p class="discussion">The <code>element</code> parameter specifies the first value to delete, starting at
3460 0. It must be less than the number of values returned by <a href="#ippGetCount"><code>ippGetCount</code></a>.<br>
3461 <br>
3462 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
3463 <br>
3464 Deleting all values in an attribute deletes the attribute.
3465
3466 </p>
3467 <h3 class="function"><a name="ippEnumString">ippEnumString</a></h3>
3468 <p class="description">Return a string corresponding to the enum value.</p>
3469 <p class="code">
3470 const char *ippEnumString (<br>
3471 &nbsp;&nbsp;&nbsp;&nbsp;const char *attrname,<br>
3472 &nbsp;&nbsp;&nbsp;&nbsp;int enumvalue<br>
3473 );</p>
3474 <h4 class="parameters">Parameters</h4>
3475 <dl>
3476 <dt>attrname</dt>
3477 <dd class="description">Attribute name</dd>
3478 <dt>enumvalue</dt>
3479 <dd class="description">Enum value</dd>
3480 </dl>
3481 <h4 class="returnvalue">Return Value</h4>
3482 <p class="description">Enum string</p>
3483 <h3 class="function"><a name="ippEnumValue">ippEnumValue</a></h3>
3484 <p class="description">Return the value associated with a given enum string.</p>
3485 <p class="code">
3486 int ippEnumValue (<br>
3487 &nbsp;&nbsp;&nbsp;&nbsp;const char *attrname,<br>
3488 &nbsp;&nbsp;&nbsp;&nbsp;const char *enumstring<br>
3489 );</p>
3490 <h4 class="parameters">Parameters</h4>
3491 <dl>
3492 <dt>attrname</dt>
3493 <dd class="description">Attribute name</dd>
3494 <dt>enumstring</dt>
3495 <dd class="description">Enum string</dd>
3496 </dl>
3497 <h4 class="returnvalue">Return Value</h4>
3498 <p class="description">Enum value or -1 if unknown</p>
3499 <h3 class="function"><a name="ippErrorString">ippErrorString</a></h3>
3500 <p class="description">Return a name for the given status code.</p>
3501 <p class="code">
3502 const char *ippErrorString (<br>
3503 &nbsp;&nbsp;&nbsp;&nbsp;ipp_status_t error<br>
3504 );</p>
3505 <h4 class="parameters">Parameters</h4>
3506 <dl>
3507 <dt>error</dt>
3508 <dd class="description">Error status</dd>
3509 </dl>
3510 <h4 class="returnvalue">Return Value</h4>
3511 <p class="description">Text string</p>
3512 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ippErrorValue">ippErrorValue</a></h3>
3513 <p class="description">Return a status code for the given name.</p>
3514 <p class="code">
3515 ipp_status_t ippErrorValue (<br>
3516 &nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
3517 );</p>
3518 <h4 class="parameters">Parameters</h4>
3519 <dl>
3520 <dt>name</dt>
3521 <dd class="description">Name</dd>
3522 </dl>
3523 <h4 class="returnvalue">Return Value</h4>
3524 <p class="description">IPP status code</p>
3525 <h3 class="function"><a name="ippFindAttribute">ippFindAttribute</a></h3>
3526 <p class="description">Find a named attribute in a request.</p>
3527 <p class="code">
3528 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindAttribute (<br>
3529 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3530 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3531 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t type<br>
3532 );</p>
3533 <h4 class="parameters">Parameters</h4>
3534 <dl>
3535 <dt>ipp</dt>
3536 <dd class="description">IPP message</dd>
3537 <dt>name</dt>
3538 <dd class="description">Name of attribute</dd>
3539 <dt>type</dt>
3540 <dd class="description">Type of attribute</dd>
3541 </dl>
3542 <h4 class="returnvalue">Return Value</h4>
3543 <p class="description">Matching attribute</p>
3544 <h3 class="function"><a name="ippFindNextAttribute">ippFindNextAttribute</a></h3>
3545 <p class="description">Find the next named attribute in a request.</p>
3546 <p class="code">
3547 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindNextAttribute (<br>
3548 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3549 &nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3550 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t type<br>
3551 );</p>
3552 <h4 class="parameters">Parameters</h4>
3553 <dl>
3554 <dt>ipp</dt>
3555 <dd class="description">IPP message</dd>
3556 <dt>name</dt>
3557 <dd class="description">Name of attribute</dd>
3558 <dt>type</dt>
3559 <dd class="description">Type of attribute</dd>
3560 </dl>
3561 <h4 class="returnvalue">Return Value</h4>
3562 <p class="description">Matching attribute</p>
3563 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippFirstAttribute">ippFirstAttribute</a></h3>
3564 <p class="description">Return the first attribute in the message.</p>
3565 <p class="code">
3566 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFirstAttribute (<br>
3567 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3568 );</p>
3569 <h4 class="parameters">Parameters</h4>
3570 <dl>
3571 <dt>ipp</dt>
3572 <dd class="description">IPP message</dd>
3573 </dl>
3574 <h4 class="returnvalue">Return Value</h4>
3575 <p class="description">First attribute or <code>NULL</code> if none</p>
3576 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippGetBoolean">ippGetBoolean</a></h3>
3577 <p class="description">Get a boolean value for an attribute.</p>
3578 <p class="code">
3579 int ippGetBoolean (<br>
3580 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
3581 &nbsp;&nbsp;&nbsp;&nbsp;int element<br>
3582 );</p>
3583 <h4 class="parameters">Parameters</h4>
3584 <dl>
3585 <dt>attr</dt>
3586 <dd class="description">IPP attribute</dd>
3587 <dt>element</dt>
3588 <dd class="description">Value number (0-based)</dd>
3589 </dl>
3590 <h4 class="returnvalue">Return Value</h4>
3591 <p class="description">Boolean value or -1 on error</p>
3592 <h4 class="discussion">Discussion</h4>
3593 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
3594 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
3595
3596 </p>
3597 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippGetCollection">ippGetCollection</a></h3>
3598 <p class="description">Get a collection value for an attribute.</p>
3599 <p class="code">
3600 <a href="#ipp_t">ipp_t</a> *ippGetCollection (<br>
3601 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
3602 &nbsp;&nbsp;&nbsp;&nbsp;int element<br>
3603 );</p>
3604 <h4 class="parameters">Parameters</h4>
3605 <dl>
3606 <dt>attr</dt>
3607 <dd class="description">IPP attribute</dd>
3608 <dt>element</dt>
3609 <dd class="description">Value number (0-based)</dd>
3610 </dl>
3611 <h4 class="returnvalue">Return Value</h4>
3612 <p class="description">Collection value or <code>NULL</code> on error</p>
3613 <h4 class="discussion">Discussion</h4>
3614 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
3615 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
3616
3617 </p>
3618 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippGetCount">ippGetCount</a></h3>
3619 <p class="description">Get the number of values in an attribute.</p>
3620 <p class="code">
3621 int ippGetCount (<br>
3622 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
3623 );</p>
3624 <h4 class="parameters">Parameters</h4>
3625 <dl>
3626 <dt>attr</dt>
3627 <dd class="description">IPP attribute</dd>
3628 </dl>
3629 <h4 class="returnvalue">Return Value</h4>
3630 <p class="description">Number of values or -1 on error</p>
3631 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippGetDate">ippGetDate</a></h3>
3632 <p class="description">Get a date value for an attribute.</p>
3633 <p class="code">
3634 const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippGetDate (<br>
3635 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
3636 &nbsp;&nbsp;&nbsp;&nbsp;int element<br>
3637 );</p>
3638 <h4 class="parameters">Parameters</h4>
3639 <dl>
3640 <dt>attr</dt>
3641 <dd class="description">IPP attribute</dd>
3642 <dt>element</dt>
3643 <dd class="description">Value number (0-based)</dd>
3644 </dl>
3645 <h4 class="returnvalue">Return Value</h4>
3646 <p class="description">Date value or <code>NULL</code></p>
3647 <h4 class="discussion">Discussion</h4>
3648 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
3649 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
3650
3651 </p>
3652 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippGetGroupTag">ippGetGroupTag</a></h3>
3653 <p class="description">Get the group associated with an attribute.</p>
3654 <p class="code">
3655 ipp_tag_t ippGetGroupTag (<br>
3656 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
3657 );</p>
3658 <h4 class="parameters">Parameters</h4>
3659 <dl>
3660 <dt>attr</dt>
3661 <dd class="description">IPP attribute</dd>
3662 </dl>
3663 <h4 class="returnvalue">Return Value</h4>
3664 <p class="description">Group tag or <code>IPP_TAG_ZERO</code> on error</p>
3665 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippGetInteger">ippGetInteger</a></h3>
3666 <p class="description">Get the integer/enum value for an attribute.</p>
3667 <p class="code">
3668 int ippGetInteger (<br>
3669 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
3670 &nbsp;&nbsp;&nbsp;&nbsp;int element<br>
3671 );</p>
3672 <h4 class="parameters">Parameters</h4>
3673 <dl>
3674 <dt>attr</dt>
3675 <dd class="description">IPP attribute</dd>
3676 <dt>element</dt>
3677 <dd class="description">Value number (0-based)</dd>
3678 </dl>
3679 <h4 class="returnvalue">Return Value</h4>
3680 <p class="description">Value or -1 on error</p>
3681 <h4 class="discussion">Discussion</h4>
3682 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
3683 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
3684
3685 </p>
3686 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippGetName">ippGetName</a></h3>
3687 <p class="description">Get the attribute name.</p>
3688 <p class="code">
3689 const char *ippGetName (<br>
3690 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
3691 );</p>
3692 <h4 class="parameters">Parameters</h4>
3693 <dl>
3694 <dt>attr</dt>
3695 <dd class="description">IPP attribute</dd>
3696 </dl>
3697 <h4 class="returnvalue">Return Value</h4>
3698 <p class="description">Attribute name or <code>NULL</code> for separators</p>
3699 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippGetOperation">ippGetOperation</a></h3>
3700 <p class="description">Get the operation ID in an IPP message.</p>
3701 <p class="code">
3702 ipp_op_t ippGetOperation (<br>
3703 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3704 );</p>
3705 <h4 class="parameters">Parameters</h4>
3706 <dl>
3707 <dt>ipp</dt>
3708 <dd class="description">IPP request message</dd>
3709 </dl>
3710 <h4 class="returnvalue">Return Value</h4>
3711 <p class="description">Operation ID or -1 on error</p>
3712 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippGetRange">ippGetRange</a></h3>
3713 <p class="description">Get a rangeOfInteger value from an attribute.</p>
3714 <p class="code">
3715 int ippGetRange (<br>
3716 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
3717 &nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
3718 &nbsp;&nbsp;&nbsp;&nbsp;int *uppervalue<br>
3719 );</p>
3720 <h4 class="parameters">Parameters</h4>
3721 <dl>
3722 <dt>attr</dt>
3723 <dd class="description">IPP attribute</dd>
3724 <dt>element</dt>
3725 <dd class="description">Value number (0-based)</dd>
3726 <dt>uppervalue</dt>
3727 <dd class="description">Upper value of range</dd>
3728 </dl>
3729 <h4 class="returnvalue">Return Value</h4>
3730 <p class="description">Lower value of range or -1</p>
3731 <h4 class="discussion">Discussion</h4>
3732 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
3733 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
3734
3735 </p>
3736 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippGetRequestId">ippGetRequestId</a></h3>
3737 <p class="description">Get the request ID from an IPP message.</p>
3738 <p class="code">
3739 int ippGetRequestId (<br>
3740 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3741 );</p>
3742 <h4 class="parameters">Parameters</h4>
3743 <dl>
3744 <dt>ipp</dt>
3745 <dd class="description">IPP message</dd>
3746 </dl>
3747 <h4 class="returnvalue">Return Value</h4>
3748 <p class="description">Request ID or -1 on error</p>
3749 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippGetResolution">ippGetResolution</a></h3>
3750 <p class="description">Get a resolution value for an attribute.</p>
3751 <p class="code">
3752 int ippGetResolution (<br>
3753 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
3754 &nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
3755 &nbsp;&nbsp;&nbsp;&nbsp;int *yres,<br>
3756 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_res_t">ipp_res_t</a> *units<br>
3757 );</p>
3758 <h4 class="parameters">Parameters</h4>
3759 <dl>
3760 <dt>attr</dt>
3761 <dd class="description">IPP attribute</dd>
3762 <dt>element</dt>
3763 <dd class="description">Value number (0-based)</dd>
3764 <dt>yres</dt>
3765 <dd class="description">Vertical/feed resolution</dd>
3766 <dt>units</dt>
3767 <dd class="description">Units for resolution</dd>
3768 </dl>
3769 <h4 class="returnvalue">Return Value</h4>
3770 <p class="description">Horizontal/cross feed resolution or -1</p>
3771 <h4 class="discussion">Discussion</h4>
3772 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
3773 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
3774
3775 </p>
3776 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippGetState">ippGetState</a></h3>
3777 <p class="description">Get the IPP message state.</p>
3778 <p class="code">
3779 <a href="#ipp_state_t">ipp_state_t</a> ippGetState (<br>
3780 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3781 );</p>
3782 <h4 class="parameters">Parameters</h4>
3783 <dl>
3784 <dt>ipp</dt>
3785 <dd class="description">IPP message</dd>
3786 </dl>
3787 <h4 class="returnvalue">Return Value</h4>
3788 <p class="description">IPP message state value</p>
3789 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippGetStatusCode">ippGetStatusCode</a></h3>
3790 <p class="description">Get the status code from an IPP response or event message.</p>
3791 <p class="code">
3792 ipp_status_t ippGetStatusCode (<br>
3793 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3794 );</p>
3795 <h4 class="parameters">Parameters</h4>
3796 <dl>
3797 <dt>ipp</dt>
3798 <dd class="description">IPP response or event message</dd>
3799 </dl>
3800 <h4 class="returnvalue">Return Value</h4>
3801 <p class="description">Status code in IPP message</p>
3802 <h3 class="function"><a name="ippGetString">ippGetString</a></h3>
3803 <p class="description">Return the value...</p>
3804 <p class="code">
3805 const char *ippGetString (<br>
3806 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
3807 &nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
3808 &nbsp;&nbsp;&nbsp;&nbsp;const char **language<br>
3809 );</p>
3810 <h4 class="parameters">Parameters</h4>
3811 <dl>
3812 <dt>attr</dt>
3813 <dd class="description">IPP attribute</dd>
3814 <dt>element</dt>
3815 <dd class="description">Value number (0-based)</dd>
3816 <dt>language</dt>
3817 <dd class="description">Language code (<code>NULL</code> for don't care)</dd>
3818 </dl>
3819 <h4 class="returnvalue">Return Value</h4>
3820 <p class="description">Get the string and optionally the language code for an attribute.</p>
3821 <p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
3822 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
3823
3824 </p>
3825 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippGetValueTag">ippGetValueTag</a></h3>
3826 <p class="description">Get the value tag for an attribute.</p>
3827 <p class="code">
3828 ipp_tag_t ippGetValueTag (<br>
3829 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
3830 );</p>
3831 <h4 class="parameters">Parameters</h4>
3832 <dl>
3833 <dt>attr</dt>
3834 <dd class="description">IPP attribute</dd>
3835 </dl>
3836 <h4 class="returnvalue">Return Value</h4>
3837 <p class="description">Value tag or <code>IPP_TAG_ZERO</code> on error</p>
3838 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippGetVersion">ippGetVersion</a></h3>
3839 <p class="description">Get the major and minor version number from an IPP message.</p>
3840 <p class="code">
3841 int ippGetVersion (<br>
3842 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3843 &nbsp;&nbsp;&nbsp;&nbsp;int *minor<br>
3844 );</p>
3845 <h4 class="parameters">Parameters</h4>
3846 <dl>
3847 <dt>ipp</dt>
3848 <dd class="description">IPP message</dd>
3849 <dt>minor</dt>
3850 <dd class="description">Minor version number or <code>NULL</code></dd>
3851 </dl>
3852 <h4 class="returnvalue">Return Value</h4>
3853 <p class="description">Major version number or -1 on error</p>
3854 <h3 class="function"><a name="ippLength">ippLength</a></h3>
3855 <p class="description">Compute the length of an IPP message.</p>
3856 <p class="code">
3857 size_t ippLength (<br>
3858 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3859 );</p>
3860 <h4 class="parameters">Parameters</h4>
3861 <dl>
3862 <dt>ipp</dt>
3863 <dd class="description">IPP message</dd>
3864 </dl>
3865 <h4 class="returnvalue">Return Value</h4>
3866 <p class="description">Size of IPP message</p>
3867 <h3 class="function"><a name="ippNew">ippNew</a></h3>
3868 <p class="description">Allocate a new IPP message.</p>
3869 <p class="code">
3870 <a href="#ipp_t">ipp_t</a> *ippNew (void);</p>
3871 <h4 class="returnvalue">Return Value</h4>
3872 <p class="description">New IPP message</p>
3873 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ippNewRequest">ippNewRequest</a></h3>
3874 <p class="description">Allocate a new IPP request message.</p>
3875 <p class="code">
3876 <a href="#ipp_t">ipp_t</a> *ippNewRequest (<br>
3877 &nbsp;&nbsp;&nbsp;&nbsp;ipp_op_t op<br>
3878 );</p>
3879 <h4 class="parameters">Parameters</h4>
3880 <dl>
3881 <dt>op</dt>
3882 <dd class="description">Operation code</dd>
3883 </dl>
3884 <h4 class="returnvalue">Return Value</h4>
3885 <p class="description">IPP request message</p>
3886 <h4 class="discussion">Discussion</h4>
3887 <p class="discussion">The new request message is initialized with the attributes-charset and
3888 attributes-natural-language attributes added. The
3889 attributes-natural-language value is derived from the current locale.
3890
3891 </p>
3892 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippNextAttribute">ippNextAttribute</a></h3>
3893 <p class="description">Return the next attribute in the message.</p>
3894 <p class="code">
3895 <a href="#ipp_attribute_t">ipp_attribute_t</a> *ippNextAttribute (<br>
3896 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3897 );</p>
3898 <h4 class="parameters">Parameters</h4>
3899 <dl>
3900 <dt>ipp</dt>
3901 <dd class="description">IPP message</dd>
3902 </dl>
3903 <h4 class="returnvalue">Return Value</h4>
3904 <p class="description">Next attribute or <code>NULL</code> if none</p>
3905 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ippOpString">ippOpString</a></h3>
3906 <p class="description">Return a name for the given operation id.</p>
3907 <p class="code">
3908 const char *ippOpString (<br>
3909 &nbsp;&nbsp;&nbsp;&nbsp;ipp_op_t op<br>
3910 );</p>
3911 <h4 class="parameters">Parameters</h4>
3912 <dl>
3913 <dt>op</dt>
3914 <dd class="description">Operation ID</dd>
3915 </dl>
3916 <h4 class="returnvalue">Return Value</h4>
3917 <p class="description">Name</p>
3918 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ippOpValue">ippOpValue</a></h3>
3919 <p class="description">Return an operation id for the given name.</p>
3920 <p class="code">
3921 ipp_op_t ippOpValue (<br>
3922 &nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
3923 );</p>
3924 <h4 class="parameters">Parameters</h4>
3925 <dl>
3926 <dt>name</dt>
3927 <dd class="description">Textual name</dd>
3928 </dl>
3929 <h4 class="returnvalue">Return Value</h4>
3930 <p class="description">Operation ID</p>
3931 <h3 class="function"><a name="ippPort">ippPort</a></h3>
3932 <p class="description">Return the default IPP port number.</p>
3933 <p class="code">
3934 int ippPort (void);</p>
3935 <h4 class="returnvalue">Return Value</h4>
3936 <p class="description">Port number</p>
3937 <h3 class="function"><a name="ippRead">ippRead</a></h3>
3938 <p class="description">Read data for an IPP message from a HTTP connection.</p>
3939 <p class="code">
3940 <a href="#ipp_state_t">ipp_state_t</a> ippRead (<br>
3941 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
3942 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3943 );</p>
3944 <h4 class="parameters">Parameters</h4>
3945 <dl>
3946 <dt>http</dt>
3947 <dd class="description">HTTP connection</dd>
3948 <dt>ipp</dt>
3949 <dd class="description">IPP data</dd>
3950 </dl>
3951 <h4 class="returnvalue">Return Value</h4>
3952 <p class="description">Current state</p>
3953 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="ippReadFile">ippReadFile</a></h3>
3954 <p class="description">Read data for an IPP message from a file.</p>
3955 <p class="code">
3956 <a href="#ipp_state_t">ipp_state_t</a> ippReadFile (<br>
3957 &nbsp;&nbsp;&nbsp;&nbsp;int fd,<br>
3958 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3959 );</p>
3960 <h4 class="parameters">Parameters</h4>
3961 <dl>
3962 <dt>fd</dt>
3963 <dd class="description">HTTP data</dd>
3964 <dt>ipp</dt>
3965 <dd class="description">IPP data</dd>
3966 </dl>
3967 <h4 class="returnvalue">Return Value</h4>
3968 <p class="description">Current state</p>
3969 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ippReadIO">ippReadIO</a></h3>
3970 <p class="description">Read data for an IPP message.</p>
3971 <p class="code">
3972 <a href="#ipp_state_t">ipp_state_t</a> ippReadIO (<br>
3973 &nbsp;&nbsp;&nbsp;&nbsp;void *src,<br>
3974 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_iocb_t">ipp_iocb_t</a> cb,<br>
3975 &nbsp;&nbsp;&nbsp;&nbsp;int blocking,<br>
3976 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *parent,<br>
3977 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3978 );</p>
3979 <h4 class="parameters">Parameters</h4>
3980 <dl>
3981 <dt>src</dt>
3982 <dd class="description">Data source</dd>
3983 <dt>cb</dt>
3984 <dd class="description">Read callback function</dd>
3985 <dt>blocking</dt>
3986 <dd class="description">Use blocking IO?</dd>
3987 <dt>parent</dt>
3988 <dd class="description">Parent request, if any</dd>
3989 <dt>ipp</dt>
3990 <dd class="description">IPP data</dd>
3991 </dl>
3992 <h4 class="returnvalue">Return Value</h4>
3993 <p class="description">Current state</p>
3994 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippSetBoolean">ippSetBoolean</a></h3>
3995 <p class="description">Set a boolean value in an attribute.</p>
3996 <p class="code">
3997 int ippSetBoolean (<br>
3998 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3999 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
4000 &nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
4001 &nbsp;&nbsp;&nbsp;&nbsp;int boolvalue<br>
4002 );</p>
4003 <h4 class="parameters">Parameters</h4>
4004 <dl>
4005 <dt>ipp</dt>
4006 <dd class="description">IPP message</dd>
4007 <dt>attr</dt>
4008 <dd class="description">IPP attribute</dd>
4009 <dt>element</dt>
4010 <dd class="description">Value number (0-based)</dd>
4011 <dt>boolvalue</dt>
4012 <dd class="description">Boolean value</dd>
4013 </dl>
4014 <h4 class="returnvalue">Return Value</h4>
4015 <p class="description">1 on success, 0 on failure</p>
4016 <h4 class="discussion">Discussion</h4>
4017 <p class="discussion">The <code>ipp</code> parameter refers to the IPP message containing the attribute that was
4018 previously created using the <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
4019 <br>
4020 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4021 <br>
4022 The <code>element</code> parameter specifies which value to set from 0 to
4023 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
4024
4025 </p>
4026 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippSetCollection">ippSetCollection</a></h3>
4027 <p class="description">Set a collection value in an attribute.</p>
4028 <p class="code">
4029 int ippSetCollection (<br>
4030 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4031 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
4032 &nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
4033 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *colvalue<br>
4034 );</p>
4035 <h4 class="parameters">Parameters</h4>
4036 <dl>
4037 <dt>ipp</dt>
4038 <dd class="description">IPP message</dd>
4039 <dt>attr</dt>
4040 <dd class="description">IPP attribute</dd>
4041 <dt>element</dt>
4042 <dd class="description">Value number (0-based)</dd>
4043 <dt>colvalue</dt>
4044 <dd class="description">Collection value</dd>
4045 </dl>
4046 <h4 class="returnvalue">Return Value</h4>
4047 <p class="description">1 on success, 0 on failure</p>
4048 <h4 class="discussion">Discussion</h4>
4049 <p class="discussion">The <code>ipp</code> parameter refers to the IPP message containing the attribute that was
4050 previously created using the <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
4051 <br>
4052 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4053 <br>
4054 The <code>element</code> parameter specifies which value to set from 0 to
4055 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
4056
4057 </p>
4058 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippSetDate">ippSetDate</a></h3>
4059 <p class="description">Set a date value in an attribute.</p>
4060 <p class="code">
4061 int ippSetDate (<br>
4062 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4063 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
4064 &nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
4065 &nbsp;&nbsp;&nbsp;&nbsp;const <a href="#ipp_uchar_t">ipp_uchar_t</a> *datevalue<br>
4066 );</p>
4067 <h4 class="parameters">Parameters</h4>
4068 <dl>
4069 <dt>ipp</dt>
4070 <dd class="description">IPP message</dd>
4071 <dt>attr</dt>
4072 <dd class="description">IPP attribute</dd>
4073 <dt>element</dt>
4074 <dd class="description">Value number (0-based)</dd>
4075 <dt>datevalue</dt>
4076 <dd class="description">Date value</dd>
4077 </dl>
4078 <h4 class="returnvalue">Return Value</h4>
4079 <p class="description">1 on success, 0 on failure</p>
4080 <h4 class="discussion">Discussion</h4>
4081 <p class="discussion">The <code>ipp</code> parameter refers to the IPP message containing the attribute that was
4082 previously created using the <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
4083 <br>
4084 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4085 <br>
4086 The <code>element</code> parameter specifies which value to set from 0 to
4087 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
4088
4089 </p>
4090 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippSetGroupTag">ippSetGroupTag</a></h3>
4091 <p class="description">Set the group tag of an attribute.</p>
4092 <p class="code">
4093 int ippSetGroupTag (<br>
4094 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4095 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
4096 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group_tag<br>
4097 );</p>
4098 <h4 class="parameters">Parameters</h4>
4099 <dl>
4100 <dt>ipp</dt>
4101 <dd class="description">IPP message</dd>
4102 <dt>attr</dt>
4103 <dd class="description">Attribute</dd>
4104 <dt>group_tag</dt>
4105 <dd class="description">Group tag</dd>
4106 </dl>
4107 <h4 class="returnvalue">Return Value</h4>
4108 <p class="description">1 on success, 0 on failure</p>
4109 <h4 class="discussion">Discussion</h4>
4110 <p class="discussion">The <code>ipp</code> parameter refers to the IPP message containing the attribute that was
4111 previously created using the <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
4112 <br>
4113 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4114 <br>
4115 The <code>group</code> parameter specifies the IPP attribute group tag: none
4116 (<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4117 event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4118 (<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4119 (<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
4120
4121 </p>
4122 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippSetInteger">ippSetInteger</a></h3>
4123 <p class="description">Set an integer or enum value in an attribute.</p>
4124 <p class="code">
4125 int ippSetInteger (<br>
4126 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4127 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
4128 &nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
4129 &nbsp;&nbsp;&nbsp;&nbsp;int intvalue<br>
4130 );</p>
4131 <h4 class="parameters">Parameters</h4>
4132 <dl>
4133 <dt>ipp</dt>
4134 <dd class="description">IPP message</dd>
4135 <dt>attr</dt>
4136 <dd class="description">IPP attribute</dd>
4137 <dt>element</dt>
4138 <dd class="description">Value number (0-based)</dd>
4139 <dt>intvalue</dt>
4140 <dd class="description">Integer/enum value</dd>
4141 </dl>
4142 <h4 class="returnvalue">Return Value</h4>
4143 <p class="description">1 on success, 0 on failure</p>
4144 <h4 class="discussion">Discussion</h4>
4145 <p class="discussion">The <code>ipp</code> parameter refers to the IPP message containing the attribute that was
4146 previously created using the <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
4147 <br>
4148 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4149 <br>
4150 The <code>element</code> parameter specifies which value to set from 0 to
4151 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
4152
4153 </p>
4154 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippSetName">ippSetName</a></h3>
4155 <p class="description">Set the name of an attribute.</p>
4156 <p class="code">
4157 int ippSetName (<br>
4158 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4159 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
4160 &nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
4161 );</p>
4162 <h4 class="parameters">Parameters</h4>
4163 <dl>
4164 <dt>ipp</dt>
4165 <dd class="description">IPP message</dd>
4166 <dt>attr</dt>
4167 <dd class="description">IPP attribute</dd>
4168 <dt>name</dt>
4169 <dd class="description">Attribute name</dd>
4170 </dl>
4171 <h4 class="returnvalue">Return Value</h4>
4172 <p class="description">1 on success, 0 on failure</p>
4173 <h4 class="discussion">Discussion</h4>
4174 <p class="discussion">The <code>ipp</code> parameter refers to the IPP message containing the attribute that was
4175 previously created using the <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
4176 <br>
4177 The <code>attr</code> parameter may be modified as a result of setting the value.
4178
4179 </p>
4180 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippSetOperation">ippSetOperation</a></h3>
4181 <p class="description">Set the operation ID in an IPP request message.</p>
4182 <p class="code">
4183 int ippSetOperation (<br>
4184 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4185 &nbsp;&nbsp;&nbsp;&nbsp;ipp_op_t op<br>
4186 );</p>
4187 <h4 class="parameters">Parameters</h4>
4188 <dl>
4189 <dt>ipp</dt>
4190 <dd class="description">IPP request message</dd>
4191 <dt>op</dt>
4192 <dd class="description">Operation ID</dd>
4193 </dl>
4194 <h4 class="returnvalue">Return Value</h4>
4195 <p class="description">1 on success, 0 on failure</p>
4196 <h4 class="discussion">Discussion</h4>
4197 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
4198 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.
4199
4200 </p>
4201 <h3 class="function"><a name="ippSetPort">ippSetPort</a></h3>
4202 <p class="description">Set the default port number.</p>
4203 <p class="code">
4204 void ippSetPort (<br>
4205 &nbsp;&nbsp;&nbsp;&nbsp;int p<br>
4206 );</p>
4207 <h4 class="parameters">Parameters</h4>
4208 <dl>
4209 <dt>p</dt>
4210 <dd class="description">Port number to use</dd>
4211 </dl>
4212 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippSetRange">ippSetRange</a></h3>
4213 <p class="description">Set a rangeOfInteger value in an attribute.</p>
4214 <p class="code">
4215 int ippSetRange (<br>
4216 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4217 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
4218 &nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
4219 &nbsp;&nbsp;&nbsp;&nbsp;int lowervalue,<br>
4220 &nbsp;&nbsp;&nbsp;&nbsp;int uppervalue<br>
4221 );</p>
4222 <h4 class="parameters">Parameters</h4>
4223 <dl>
4224 <dt>ipp</dt>
4225 <dd class="description">IPP message</dd>
4226 <dt>attr</dt>
4227 <dd class="description">IPP attribute</dd>
4228 <dt>element</dt>
4229 <dd class="description">Value number (0-based)</dd>
4230 <dt>lowervalue</dt>
4231 <dd class="description">Lower bound for range</dd>
4232 <dt>uppervalue</dt>
4233 <dd class="description">Upper bound for range</dd>
4234 </dl>
4235 <h4 class="returnvalue">Return Value</h4>
4236 <p class="description">1 on success, 0 on failure</p>
4237 <h4 class="discussion">Discussion</h4>
4238 <p class="discussion">The <code>ipp</code> parameter refers to the IPP message containing the attribute that was
4239 previously created using the <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
4240 <br>
4241 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4242 <br>
4243 The <code>element</code> parameter specifies which value to set from 0 to
4244 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
4245
4246 </p>
4247 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippSetRequestId">ippSetRequestId</a></h3>
4248 <p class="description">Set the request ID in an IPP message.</p>
4249 <p class="code">
4250 int ippSetRequestId (<br>
4251 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4252 &nbsp;&nbsp;&nbsp;&nbsp;int request_id<br>
4253 );</p>
4254 <h4 class="parameters">Parameters</h4>
4255 <dl>
4256 <dt>ipp</dt>
4257 <dd class="description">IPP message</dd>
4258 <dt>request_id</dt>
4259 <dd class="description">Request ID</dd>
4260 </dl>
4261 <h4 class="returnvalue">Return Value</h4>
4262 <p class="description">1 on success, 0 on failure</p>
4263 <h4 class="discussion">Discussion</h4>
4264 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
4265 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
4266 <br>
4267 The <code>request_id</code> parameter must be greater than 0.
4268
4269 </p>
4270 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippSetResolution">ippSetResolution</a></h3>
4271 <p class="description">Set a resolution value in an attribute.</p>
4272 <p class="code">
4273 int ippSetResolution (<br>
4274 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4275 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
4276 &nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
4277 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_res_t">ipp_res_t</a> unitsvalue,<br>
4278 &nbsp;&nbsp;&nbsp;&nbsp;int xresvalue,<br>
4279 &nbsp;&nbsp;&nbsp;&nbsp;int yresvalue<br>
4280 );</p>
4281 <h4 class="parameters">Parameters</h4>
4282 <dl>
4283 <dt>ipp</dt>
4284 <dd class="description">IPP message</dd>
4285 <dt>attr</dt>
4286 <dd class="description">IPP attribute</dd>
4287 <dt>element</dt>
4288 <dd class="description">Value number (0-based)</dd>
4289 <dt>unitsvalue</dt>
4290 <dd class="description">Resolution units</dd>
4291 <dt>xresvalue</dt>
4292 <dd class="description">Horizontal/cross feed resolution</dd>
4293 <dt>yresvalue</dt>
4294 <dd class="description">Vertical/feed resolution</dd>
4295 </dl>
4296 <h4 class="returnvalue">Return Value</h4>
4297 <p class="description">1 on success, 0 on failure</p>
4298 <h4 class="discussion">Discussion</h4>
4299 <p class="discussion">The <code>ipp</code> parameter refers to the IPP message containing the attribute that was
4300 previously created using the <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
4301 <br>
4302 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4303 <br>
4304 The <code>element</code> parameter specifies which value to set from 0 to
4305 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
4306
4307 </p>
4308 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippSetState">ippSetState</a></h3>
4309 <p class="description">Set the current state of the IPP message.</p>
4310 <p class="code">
4311 int ippSetState (<br>
4312 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4313 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_state_t">ipp_state_t</a> state<br>
4314 );</p>
4315 <h4 class="parameters">Parameters</h4>
4316 <dl>
4317 <dt>ipp</dt>
4318 <dd class="description">IPP message</dd>
4319 <dt>state</dt>
4320 <dd class="description">IPP state value</dd>
4321 </dl>
4322 <h4 class="returnvalue">Return Value</h4>
4323 <p class="description">1 on success, 0 on failure</p>
4324 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippSetStatusCode">ippSetStatusCode</a></h3>
4325 <p class="description">Set the status code in an IPP response or event message.</p>
4326 <p class="code">
4327 int ippSetStatusCode (<br>
4328 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4329 &nbsp;&nbsp;&nbsp;&nbsp;ipp_status_t status<br>
4330 );</p>
4331 <h4 class="parameters">Parameters</h4>
4332 <dl>
4333 <dt>ipp</dt>
4334 <dd class="description">IPP response or event message</dd>
4335 <dt>status</dt>
4336 <dd class="description">Status code</dd>
4337 </dl>
4338 <h4 class="returnvalue">Return Value</h4>
4339 <p class="description">1 on success, 0 on failure</p>
4340 <h4 class="discussion">Discussion</h4>
4341 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
4342 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.
4343
4344 </p>
4345 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippSetString">ippSetString</a></h3>
4346 <p class="description">Set a string value in an attribute.</p>
4347 <p class="code">
4348 int ippSetString (<br>
4349 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4350 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
4351 &nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
4352 &nbsp;&nbsp;&nbsp;&nbsp;const char *strvalue<br>
4353 );</p>
4354 <h4 class="parameters">Parameters</h4>
4355 <dl>
4356 <dt>ipp</dt>
4357 <dd class="description">IPP message</dd>
4358 <dt>attr</dt>
4359 <dd class="description">IPP attribute</dd>
4360 <dt>element</dt>
4361 <dd class="description">Value number (0-based)</dd>
4362 <dt>strvalue</dt>
4363 <dd class="description">String value</dd>
4364 </dl>
4365 <h4 class="returnvalue">Return Value</h4>
4366 <p class="description">1 on success, 0 on failure</p>
4367 <h4 class="discussion">Discussion</h4>
4368 <p class="discussion">The <code>ipp</code> parameter refers to the IPP message containing the attribute that was
4369 previously created using the <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
4370 <br>
4371 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4372 <br>
4373 The <code>element</code> parameter specifies which value to set from 0 to
4374 <a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
4375
4376 </p>
4377 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippSetValueTag">ippSetValueTag</a></h3>
4378 <p class="description">Set the value tag of an attribute.</p>
4379 <p class="code">
4380 int ippSetValueTag (<br>
4381 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4382 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
4383 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t value_tag<br>
4384 );</p>
4385 <h4 class="parameters">Parameters</h4>
4386 <dl>
4387 <dt>ipp</dt>
4388 <dd class="description">IPP message</dd>
4389 <dt>attr</dt>
4390 <dd class="description">IPP attribute</dd>
4391 <dt>value_tag</dt>
4392 <dd class="description">Value tag</dd>
4393 </dl>
4394 <h4 class="returnvalue">Return Value</h4>
4395 <p class="description">1 on success, 0 on failure</p>
4396 <h4 class="discussion">Discussion</h4>
4397 <p class="discussion">The <code>ipp</code> parameter refers to the IPP message containing the attribute that was
4398 previously created using the <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
4399 <br>
4400 The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4401 <br>
4402 Integer (<code>IPP_TAG_INTEGER</code>) values can be promoted to rangeOfInteger
4403 (<code>IPP_TAG_RANGE</code>) values, the various string tags can be promoted to name
4404 (<code>IPP_TAG_NAME</code>) or nameWithLanguage (<code>IPP_TAG_NAMELANG</code>) values, text
4405 (<code>IPP_TAG_TEXT</code>) values can be promoted to textWithLanguage
4406 (<code>IPP_TAG_TEXTLANG</code>) values, and all values can be demoted to the various
4407 out-of-band value tags such as no-value (<code>IPP_TAG_NOVALUE</code>). All other changes
4408 will be rejected.<br>
4409 <br>
4410 Promoting a string attribute to nameWithLanguage or textWithLanguage adds the language
4411 code in the &quot;attributes-natural-language&quot; attribute or, if not present, the language
4412 code for the current locale.
4413
4414 </p>
4415 <h3 class="function"><span class="info">&nbsp;CUPS 1.6&nbsp;</span><a name="ippSetVersion">ippSetVersion</a></h3>
4416 <p class="description">Set the version number in an IPP message.</p>
4417 <p class="code">
4418 int ippSetVersion (<br>
4419 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4420 &nbsp;&nbsp;&nbsp;&nbsp;int major,<br>
4421 &nbsp;&nbsp;&nbsp;&nbsp;int minor<br>
4422 );</p>
4423 <h4 class="parameters">Parameters</h4>
4424 <dl>
4425 <dt>ipp</dt>
4426 <dd class="description">IPP message</dd>
4427 <dt>major</dt>
4428 <dd class="description">Major version number (major.minor)</dd>
4429 <dt>minor</dt>
4430 <dd class="description">Minor version number (major.minor)</dd>
4431 </dl>
4432 <h4 class="returnvalue">Return Value</h4>
4433 <p class="description">1 on success, 0 on failure</p>
4434 <h4 class="discussion">Discussion</h4>
4435 <p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using the
4436 <a href="#ippNew"><code>ippNew</code></a> or <a href="#ippNewRequest"><code>ippNewRequest</code></a> functions.<br>
4437 <br>
4438 The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2.
4439
4440 </p>
4441 <h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="ippTagString">ippTagString</a></h3>
4442 <p class="description">Return the tag name corresponding to a tag value.</p>
4443 <p class="code">
4444 const char *ippTagString (<br>
4445 &nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t tag<br>
4446 );</p>
4447 <h4 class="parameters">Parameters</h4>
4448 <dl>
4449 <dt>tag</dt>
4450 <dd class="description">Tag value</dd>
4451 </dl>
4452 <h4 class="returnvalue">Return Value</h4>
4453 <p class="description">Tag name</p>
4454 <h4 class="discussion">Discussion</h4>
4455 <p class="discussion">The returned names are defined in RFC 2911 and 3382.
4456
4457 </p>
4458 <h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="ippTagValue">ippTagValue</a></h3>
4459 <p class="description">Return the tag value corresponding to a tag name.</p>
4460 <p class="code">
4461 ipp_tag_t ippTagValue (<br>
4462 &nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
4463 );</p>
4464 <h4 class="parameters">Parameters</h4>
4465 <dl>
4466 <dt>name</dt>
4467 <dd class="description">Tag name</dd>
4468 </dl>
4469 <h4 class="returnvalue">Return Value</h4>
4470 <p class="description">Tag value</p>
4471 <h4 class="discussion">Discussion</h4>
4472 <p class="discussion">The tag names are defined in RFC 2911 and 3382.
4473
4474 </p>
4475 <h3 class="function"><a name="ippTimeToDate">ippTimeToDate</a></h3>
4476 <p class="description">Convert from UNIX time to RFC 1903 format.</p>
4477 <p class="code">
4478 const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippTimeToDate (<br>
4479 &nbsp;&nbsp;&nbsp;&nbsp;time_t t<br>
4480 );</p>
4481 <h4 class="parameters">Parameters</h4>
4482 <dl>
4483 <dt>t</dt>
4484 <dd class="description">UNIX time value</dd>
4485 </dl>
4486 <h4 class="returnvalue">Return Value</h4>
4487 <p class="description">RFC-1903 date/time data</p>
4488 <h3 class="function"><a name="ippWrite">ippWrite</a></h3>
4489 <p class="description">Write data for an IPP message to a HTTP connection.</p>
4490 <p class="code">
4491 <a href="#ipp_state_t">ipp_state_t</a> ippWrite (<br>
4492 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
4493 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
4494 );</p>
4495 <h4 class="parameters">Parameters</h4>
4496 <dl>
4497 <dt>http</dt>
4498 <dd class="description">HTTP connection</dd>
4499 <dt>ipp</dt>
4500 <dd class="description">IPP data</dd>
4501 </dl>
4502 <h4 class="returnvalue">Return Value</h4>
4503 <p class="description">Current state</p>
4504 <h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="ippWriteFile">ippWriteFile</a></h3>
4505 <p class="description">Write data for an IPP message to a file.</p>
4506 <p class="code">
4507 <a href="#ipp_state_t">ipp_state_t</a> ippWriteFile (<br>
4508 &nbsp;&nbsp;&nbsp;&nbsp;int fd,<br>
4509 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
4510 );</p>
4511 <h4 class="parameters">Parameters</h4>
4512 <dl>
4513 <dt>fd</dt>
4514 <dd class="description">HTTP data</dd>
4515 <dt>ipp</dt>
4516 <dd class="description">IPP data</dd>
4517 </dl>
4518 <h4 class="returnvalue">Return Value</h4>
4519 <p class="description">Current state</p>
4520 <h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ippWriteIO">ippWriteIO</a></h3>
4521 <p class="description">Write data for an IPP message.</p>
4522 <p class="code">
4523 <a href="#ipp_state_t">ipp_state_t</a> ippWriteIO (<br>
4524 &nbsp;&nbsp;&nbsp;&nbsp;void *dst,<br>
4525 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_iocb_t">ipp_iocb_t</a> cb,<br>
4526 &nbsp;&nbsp;&nbsp;&nbsp;int blocking,<br>
4527 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *parent,<br>
4528 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
4529 );</p>
4530 <h4 class="parameters">Parameters</h4>
4531 <dl>
4532 <dt>dst</dt>
4533 <dd class="description">Destination</dd>
4534 <dt>cb</dt>
4535 <dd class="description">Write callback function</dd>
4536 <dt>blocking</dt>
4537 <dd class="description">Use blocking IO?</dd>
4538 <dt>parent</dt>
4539 <dd class="description">Parent IPP message</dd>
4540 <dt>ipp</dt>
4541 <dd class="description">IPP data</dd>
4542 </dl>
4543 <h4 class="returnvalue">Return Value</h4>
4544 <p class="description">Current state</p>
4545 <h2 class="title"><a name="TYPES">Data Types</a></h2>
4546 <h3 class="typedef"><a name="gss_auth_identity_desc">gss_auth_identity_desc</a></h3>
4547 <p class="description">Local functions...</p>
4548 <p class="code">
4549 typedef struct <a href="#gss_auth_identity">gss_auth_identity</a> gss_auth_identity_desc;
4550 </p>
4551 <h3 class="typedef"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="http_addr_t">http_addr_t</a></h3>
4552 <p class="description">Socket address union, which
4553 makes using IPv6 and other
4554 address types easier and
4555 more portable. </p>
4556 <p class="code">
4557 typedef union _http_addr_u / http_addr_t;
4558 </p>
4559 <h3 class="typedef"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="http_addrlist_t">http_addrlist_t</a></h3>
4560 <p class="description">Socket address list, which is
4561 used to enumerate all of the
4562 addresses that are associated
4563 with a hostname. </p>
4564 <p class="code">
4565 typedef struct <a href="#http_addrlist_s">http_addrlist_s</a> / http_addrlist_t;
4566 </p>
4567 <h3 class="typedef"><a name="http_auth_t">http_auth_t</a></h3>
4568 <p class="description">HTTP authentication types</p>
4569 <p class="code">
4570 typedef enum <a href="#http_auth_e">http_auth_e</a> http_auth_t;
4571 </p>
4572 <h3 class="typedef"><span class="info">&nbsp;CUPS 1.5/Mac OS X 10.7&nbsp;</span><a name="http_credential_t">http_credential_t</a></h3>
4573 <p class="description">HTTP credential data </p>
4574 <p class="code">
4575 typedef struct <a href="#http_credential_s">http_credential_s</a> http_credential_t;
4576 </p>
4577 <h3 class="typedef"><a name="http_encoding_t">http_encoding_t</a></h3>
4578 <p class="description">HTTP transfer encoding values</p>
4579 <p class="code">
4580 typedef enum <a href="#http_encoding_e">http_encoding_e</a> http_encoding_t;
4581 </p>
4582 <h3 class="typedef"><a name="http_encryption_t">http_encryption_t</a></h3>
4583 <p class="description">HTTP encryption values</p>
4584 <p class="code">
4585 typedef enum <a href="#http_encryption_e">http_encryption_e</a> http_encryption_t;
4586 </p>
4587 <h3 class="typedef"><a name="http_field_t">http_field_t</a></h3>
4588 <p class="description">HTTP field names</p>
4589 <p class="code">
4590 typedef enum <a href="#http_field_e">http_field_e</a> http_field_t;
4591 </p>
4592 <h3 class="typedef"><a name="http_keepalive_t">http_keepalive_t</a></h3>
4593 <p class="description">HTTP keep-alive values</p>
4594 <p class="code">
4595 typedef enum <a href="#http_keepalive_e">http_keepalive_e</a> http_keepalive_t;
4596 </p>
4597 <h3 class="typedef"><a name="http_state_t">http_state_t</a></h3>
4598 <p class="description">HTTP state values; states
4599 are server-oriented...</p>
4600 <p class="code">
4601 typedef enum <a href="#http_state_e">http_state_e</a> / http_state_t;
4602 </p>
4603 <h3 class="typedef"><a name="http_status_t">http_status_t</a></h3>
4604 <p class="description">HTTP status codes</p>
4605 <p class="code">
4606 typedef enum <a href="#http_status_e">http_status_e</a> http_status_t;
4607 </p>
4608 <h3 class="typedef"><a name="http_t">http_t</a></h3>
4609 <p class="description">HTTP connection type</p>
4610 <p class="code">
4611 typedef struct _http_s http_t;
4612 </p>
4613 <h3 class="typedef"><span class="info">&nbsp;CUPS 1.5/Mac OS X 10.7&nbsp;</span><a name="http_timeout_cb_t">http_timeout_cb_t</a></h3>
4614 <p class="description">HTTP timeout callback </p>
4615 <p class="code">
4616 typedef int (*http_timeout_cb_t)(<a href="#http_t">http_t</a> *http, void *user_data);
4617 </p>
4618 <h3 class="typedef"><a name="http_uri_coding_t">http_uri_coding_t</a></h3>
4619 <p class="description">URI en/decode flags</p>
4620 <p class="code">
4621 typedef enum <a href="#http_uri_coding_e">http_uri_coding_e</a> http_uri_coding_t;
4622 </p>
4623 <h3 class="typedef"><span class="info">&nbsp;CUPS 1.2&nbsp;</span><a name="http_uri_status_t">http_uri_status_t</a></h3>
4624 <p class="description">URI separation status </p>
4625 <p class="code">
4626 typedef enum <a href="#http_uri_status_e">http_uri_status_e</a> http_uri_status_t;
4627 </p>
4628 <h3 class="typedef"><a name="http_version_t">http_version_t</a></h3>
4629 <p class="description">HTTP version numbers</p>
4630 <p class="code">
4631 typedef enum <a href="#http_version_e">http_version_e</a> http_version_t;
4632 </p>
4633 <h3 class="typedef"><a name="ipp_attribute_t">ipp_attribute_t</a></h3>
4634 <p class="description">IPP attribute</p>
4635 <p class="code">
4636 typedef struct _ipp_attribute_s ipp_attribute_t;
4637 </p>
4638 <h3 class="typedef"><a name="ipp_copycb_t">ipp_copycb_t</a></h3>
4639 <p class="description">The following structures are PRIVATE starting with CUPS 1.6. Please use the
4640 new accessor functions available in CUPS 1.6 and later, as these definitions
4641 will be moved to a private header file in a future release.</p>
4642 <p class="code">
4643 typedef int (*ipp_copycb_t)(void *context, <a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);
4644 </p>
4645 <h3 class="typedef"><a name="ipp_dstate_t">ipp_dstate_t</a></h3>
4646 <p class="description">Document states</p>
4647 <p class="code">
4648 typedef enum <a href="#ipp_dstate_e">ipp_dstate_e</a> ipp_dstate_t;
4649 </p>
4650 <h3 class="typedef"><a name="ipp_finish_t">ipp_finish_t</a></h3>
4651 <p class="description">Finishings</p>
4652 <p class="code">
4653 typedef enum <a href="#ipp_finish_e">ipp_finish_e</a> ipp_finish_t;
4654 </p>
4655 <h3 class="typedef"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ipp_iocb_t">ipp_iocb_t</a></h3>
4656 <p class="description">IPP IO Callback Function </p>
4657 <p class="code">
4658 typedef ssize_t (*ipp_iocb_t)(void *context, <a href="#ipp_uchar_t">ipp_uchar_t</a> *buffer, size_t bytes);
4659 </p>
4660 <h3 class="typedef"><a name="ipp_jcollate_t">ipp_jcollate_t</a></h3>
4661 <p class="description">Job collation types</p>
4662 <p class="code">
4663 typedef enum <a href="#ipp_jcollate_e">ipp_jcollate_e</a> ipp_jcollate_t;
4664 </p>
4665 <h3 class="typedef"><a name="ipp_orient_t">ipp_orient_t</a></h3>
4666 <p class="description">Orientation values</p>
4667 <p class="code">
4668 typedef enum <a href="#ipp_orient_e">ipp_orient_e</a> ipp_orient_t;
4669 </p>
4670 <h3 class="typedef"><a name="ipp_pstate_t">ipp_pstate_t</a></h3>
4671 <p class="description">Printer states</p>
4672 <p class="code">
4673 typedef enum <a href="#ipp_pstate_e">ipp_pstate_e</a> ipp_pstate_t;
4674 </p>
4675 <h3 class="typedef"><a name="ipp_quality_t">ipp_quality_t</a></h3>
4676 <p class="description">Qualities</p>
4677 <p class="code">
4678 typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t;
4679 </p>
4680 <h3 class="typedef"><a name="ipp_res_t">ipp_res_t</a></h3>
4681 <p class="description">Resolution units</p>
4682 <p class="code">
4683 typedef enum <a href="#ipp_res_e">ipp_res_e</a> ipp_res_t;
4684 </p>
4685 <h3 class="typedef"><a name="ipp_state_t">ipp_state_t</a></h3>
4686 <p class="description">IPP states</p>
4687 <p class="code">
4688 typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t;
4689 </p>
4690 <h3 class="typedef"><a name="ipp_t">ipp_t</a></h3>
4691 <p class="description">IPP request/response data</p>
4692 <p class="code">
4693 typedef struct _ipp_s ipp_t;
4694 </p>
4695 <h3 class="typedef"><a name="ipp_uchar_t">ipp_uchar_t</a></h3>
4696 <p class="description">Unsigned 8-bit integer/character</p>
4697 <p class="code">
4698 typedef unsigned char ipp_uchar_t;
4699 </p>
4700 <h2 class="title"><a name="STRUCTURES">Structures</a></h2>
4701 <h3 class="struct"><a name="gss_auth_identity">gss_auth_identity</a></h3>
4702 <p class="description">Local functions...</p>
4703 <p class="code">struct gss_auth_identity {<br>
4704 &nbsp;&nbsp;&nbsp;&nbsp;gss_buffer_t *credentialsRef;<br>
4705 &nbsp;&nbsp;&nbsp;&nbsp;uint32_t flags;<br>
4706 &nbsp;&nbsp;&nbsp;&nbsp;char *password;<br>
4707 &nbsp;&nbsp;&nbsp;&nbsp;char *realm;<br>
4708 &nbsp;&nbsp;&nbsp;&nbsp;uint32_t type;<br>
4709 &nbsp;&nbsp;&nbsp;&nbsp;char *username;<br>
4710 };</p>
4711 <h4 class="members">Members</h4>
4712 <dl>
4713 <dt>credentialsRef </dt>
4714 <dt>flags </dt>
4715 <dt>password </dt>
4716 <dt>realm </dt>
4717 <dt>type </dt>
4718 <dt>username </dt>
4719 </dl>
4720 <h3 class="struct"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="http_addrlist_s">http_addrlist_s</a></h3>
4721 <p class="description">Socket address list, which is
4722 used to enumerate all of the
4723 addresses that are associated
4724 with a hostname. </p>
4725 <p class="code">struct http_addrlist_s {<br>
4726 &nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_addr_t">http_addr_t</a> addr;<br>
4727 &nbsp;&nbsp;&nbsp;&nbsp;struct <a href="#http_addrlist_s">http_addrlist_s</a> *next;<br>
4728 };</p>
4729 <h4 class="members">Members</h4>
4730 <dl>
4731 <dt>addr </dt>
4732 <dd class="description">Address</dd>
4733 <dt>next </dt>
4734 <dd class="description">Pointer to next address in list</dd>
4735 </dl>
4736 <h3 class="struct"><span class="info">&nbsp;CUPS 1.5/Mac OS X 10.7&nbsp;</span><a name="http_credential_s">http_credential_s</a></h3>
4737 <p class="description">HTTP credential data </p>
4738 <p class="code">struct http_credential_s {<br>
4739 &nbsp;&nbsp;&nbsp;&nbsp;void *data;<br>
4740 &nbsp;&nbsp;&nbsp;&nbsp;size_t datalen;<br>
4741 };</p>
4742 <h4 class="members">Members</h4>
4743 <dl>
4744 <dt>data </dt>
4745 <dd class="description">Pointer to credential data</dd>
4746 <dt>datalen </dt>
4747 <dd class="description">Credential length</dd>
4748 </dl>
4749 <h2 class="title"><a name="ENUMERATIONS">Constants</a></h2>
4750 <h3 class="enumeration"><a name="http_auth_e">http_auth_e</a></h3>
4751 <p class="description">HTTP authentication types</p>
4752 <h4 class="constants">Constants</h4>
4753 <dl>
4754 <dt>HTTP_AUTH_BASIC </dt>
4755 <dd class="description">Basic authentication in use</dd>
4756 <dt>HTTP_AUTH_MD5 </dt>
4757 <dd class="description">Digest authentication in use</dd>
4758 <dt>HTTP_AUTH_MD5_INT </dt>
4759 <dd class="description">Digest authentication in use for body</dd>
4760 <dt>HTTP_AUTH_MD5_SESS </dt>
4761 <dd class="description">MD5-session authentication in use</dd>
4762 <dt>HTTP_AUTH_MD5_SESS_INT </dt>
4763 <dd class="description">MD5-session authentication in use for body</dd>
4764 <dt>HTTP_AUTH_NEGOTIATE <span class="info">&nbsp;CUPS 1.3/Mac OS X 10.5&nbsp;</span></dt>
4765 <dd class="description">GSSAPI authentication in use </dd>
4766 <dt>HTTP_AUTH_NONE </dt>
4767 <dd class="description">No authentication in use</dd>
4768 </dl>
4769 <h3 class="enumeration"><a name="http_encoding_e">http_encoding_e</a></h3>
4770 <p class="description">HTTP transfer encoding values</p>
4771 <h4 class="constants">Constants</h4>
4772 <dl>
4773 <dt>HTTP_ENCODE_CHUNKED </dt>
4774 <dd class="description">Data is chunked</dd>
4775 <dt>HTTP_ENCODE_FIELDS </dt>
4776 <dd class="description">Sending HTTP fields</dd>
4777 <dt>HTTP_ENCODE_LENGTH </dt>
4778 <dd class="description">Data is sent with Content-Length</dd>
4779 </dl>
4780 <h3 class="enumeration"><a name="http_encryption_e">http_encryption_e</a></h3>
4781 <p class="description">HTTP encryption values</p>
4782 <h4 class="constants">Constants</h4>
4783 <dl>
4784 <dt>HTTP_ENCRYPT_ALWAYS </dt>
4785 <dd class="description">Always encrypt (SSL)</dd>
4786 <dt>HTTP_ENCRYPT_IF_REQUESTED </dt>
4787 <dd class="description">Encrypt if requested (TLS upgrade)</dd>
4788 <dt>HTTP_ENCRYPT_NEVER </dt>
4789 <dd class="description">Never encrypt</dd>
4790 <dt>HTTP_ENCRYPT_REQUIRED </dt>
4791 <dd class="description">Encryption is required (TLS upgrade)</dd>
4792 </dl>
4793 <h3 class="enumeration"><a name="http_field_e">http_field_e</a></h3>
4794 <p class="description">HTTP field names</p>
4795 <h4 class="constants">Constants</h4>
4796 <dl>
4797 <dt>HTTP_FIELD_ACCEPT_LANGUAGE </dt>
4798 <dd class="description">Accept-Language field</dd>
4799 <dt>HTTP_FIELD_ACCEPT_RANGES </dt>
4800 <dd class="description">Accept-Ranges field</dd>
4801 <dt>HTTP_FIELD_AUTHORIZATION </dt>
4802 <dd class="description">Authorization field</dd>
4803 <dt>HTTP_FIELD_CONNECTION </dt>
4804 <dd class="description">Connection field</dd>
4805 <dt>HTTP_FIELD_CONTENT_ENCODING </dt>
4806 <dd class="description">Content-Encoding field</dd>
4807 <dt>HTTP_FIELD_CONTENT_LANGUAGE </dt>
4808 <dd class="description">Content-Language field</dd>
4809 <dt>HTTP_FIELD_CONTENT_LENGTH </dt>
4810 <dd class="description">Content-Length field</dd>
4811 <dt>HTTP_FIELD_CONTENT_LOCATION </dt>
4812 <dd class="description">Content-Location field</dd>
4813 <dt>HTTP_FIELD_CONTENT_MD5 </dt>
4814 <dd class="description">Content-MD5 field</dd>
4815 <dt>HTTP_FIELD_CONTENT_RANGE </dt>
4816 <dd class="description">Content-Range field</dd>
4817 <dt>HTTP_FIELD_CONTENT_TYPE </dt>
4818 <dd class="description">Content-Type field</dd>
4819 <dt>HTTP_FIELD_CONTENT_VERSION </dt>
4820 <dd class="description">Content-Version field</dd>
4821 <dt>HTTP_FIELD_DATE </dt>
4822 <dd class="description">Date field</dd>
4823 <dt>HTTP_FIELD_HOST </dt>
4824 <dd class="description">Host field</dd>
4825 <dt>HTTP_FIELD_IF_MODIFIED_SINCE </dt>
4826 <dd class="description">If-Modified-Since field</dd>
4827 <dt>HTTP_FIELD_IF_UNMODIFIED_SINCE </dt>
4828 <dd class="description">If-Unmodified-Since field</dd>
4829 <dt>HTTP_FIELD_KEEP_ALIVE </dt>
4830 <dd class="description">Keep-Alive field</dd>
4831 <dt>HTTP_FIELD_LAST_MODIFIED </dt>
4832 <dd class="description">Last-Modified field</dd>
4833 <dt>HTTP_FIELD_LINK </dt>
4834 <dd class="description">Link field</dd>
4835 <dt>HTTP_FIELD_LOCATION </dt>
4836 <dd class="description">Location field</dd>
4837 <dt>HTTP_FIELD_MAX </dt>
4838 <dd class="description">Maximum field index</dd>
4839 <dt>HTTP_FIELD_RANGE </dt>
4840 <dd class="description">Range field</dd>
4841 <dt>HTTP_FIELD_REFERER </dt>
4842 <dd class="description">Referer field</dd>
4843 <dt>HTTP_FIELD_RETRY_AFTER </dt>
4844 <dd class="description">Retry-After field</dd>
4845 <dt>HTTP_FIELD_TRANSFER_ENCODING </dt>
4846 <dd class="description">Transfer-Encoding field</dd>
4847 <dt>HTTP_FIELD_UNKNOWN </dt>
4848 <dd class="description">Unknown field</dd>
4849 <dt>HTTP_FIELD_UPGRADE </dt>
4850 <dd class="description">Upgrade field</dd>
4851 <dt>HTTP_FIELD_USER_AGENT </dt>
4852 <dd class="description">User-Agent field</dd>
4853 <dt>HTTP_FIELD_WWW_AUTHENTICATE </dt>
4854 <dd class="description">WWW-Authenticate field</dd>
4855 </dl>
4856 <h3 class="enumeration"><a name="http_keepalive_e">http_keepalive_e</a></h3>
4857 <p class="description">HTTP keep-alive values</p>
4858 <h4 class="constants">Constants</h4>
4859 <dl>
4860 <dt>HTTP_KEEPALIVE_OFF </dt>
4861 <dd class="description">No keep alive support</dd>
4862 <dt>HTTP_KEEPALIVE_ON </dt>
4863 <dd class="description">Use keep alive</dd>
4864 </dl>
4865 <h3 class="enumeration"><a name="http_state_e">http_state_e</a></h3>
4866 <p class="description">HTTP state values; states
4867 are server-oriented...</p>
4868 <h4 class="constants">Constants</h4>
4869 <dl>
4870 <dt>HTTP_CLOSE </dt>
4871 <dd class="description">CLOSE command, waiting for blank line</dd>
4872 <dt>HTTP_DELETE </dt>
4873 <dd class="description">DELETE command, waiting for blank line</dd>
4874 <dt>HTTP_GET </dt>
4875 <dd class="description">GET command, waiting for blank line</dd>
4876 <dt>HTTP_GET_SEND </dt>
4877 <dd class="description">GET command, sending data</dd>
4878 <dt>HTTP_HEAD </dt>
4879 <dd class="description">HEAD command, waiting for blank line</dd>
4880 <dt>HTTP_OPTIONS </dt>
4881 <dd class="description">OPTIONS command, waiting for blank line</dd>
4882 <dt>HTTP_POST </dt>
4883 <dd class="description">POST command, waiting for blank line</dd>
4884 <dt>HTTP_POST_RECV </dt>
4885 <dd class="description">POST command, receiving data</dd>
4886 <dt>HTTP_POST_SEND </dt>
4887 <dd class="description">POST command, sending data</dd>
4888 <dt>HTTP_PUT </dt>
4889 <dd class="description">PUT command, waiting for blank line</dd>
4890 <dt>HTTP_PUT_RECV </dt>
4891 <dd class="description">PUT command, receiving data</dd>
4892 <dt>HTTP_STATUS </dt>
4893 <dd class="description">Command complete, sending status</dd>
4894 <dt>HTTP_TRACE </dt>
4895 <dd class="description">TRACE command, waiting for blank line</dd>
4896 <dt>HTTP_WAITING </dt>
4897 <dd class="description">Waiting for command</dd>
4898 </dl>
4899 <h3 class="enumeration"><a name="http_status_e">http_status_e</a></h3>
4900 <p class="description">HTTP status codes</p>
4901 <h4 class="constants">Constants</h4>
4902 <dl>
4903 <dt>HTTP_ACCEPTED </dt>
4904 <dd class="description">DELETE command was successful</dd>
4905 <dt>HTTP_AUTHORIZATION_CANCELED <span class="info">&nbsp;CUPS 1.4&nbsp;</span></dt>
4906 <dd class="description">User canceled authorization </dd>
4907 <dt>HTTP_BAD_GATEWAY </dt>
4908 <dd class="description">Bad gateway</dd>
4909 <dt>HTTP_BAD_REQUEST </dt>
4910 <dd class="description">Bad request</dd>
4911 <dt>HTTP_CONFLICT </dt>
4912 <dd class="description">Request is self-conflicting</dd>
4913 <dt>HTTP_CONTINUE </dt>
4914 <dd class="description">Everything OK, keep going...</dd>
4915 <dt>HTTP_CREATED </dt>
4916 <dd class="description">PUT command was successful</dd>
4917 <dt>HTTP_ERROR </dt>
4918 <dd class="description">An error response from httpXxxx()</dd>
4919 <dt>HTTP_EXPECTATION_FAILED </dt>
4920 <dd class="description">The expectation given in an Expect header field was not met</dd>
4921 <dt>HTTP_FORBIDDEN </dt>
4922 <dd class="description">Forbidden to access this URI</dd>
4923 <dt>HTTP_GATEWAY_TIMEOUT </dt>
4924 <dd class="description">Gateway connection timed out</dd>
4925 <dt>HTTP_GONE </dt>
4926 <dd class="description">Server has gone away</dd>
4927 <dt>HTTP_LENGTH_REQUIRED </dt>
4928 <dd class="description">A content length or encoding is required</dd>
4929 <dt>HTTP_METHOD_NOT_ALLOWED </dt>
4930 <dd class="description">Method is not allowed</dd>
4931 <dt>HTTP_MOVED_PERMANENTLY </dt>
4932 <dd class="description">Document has moved permanently</dd>
4933 <dt>HTTP_MOVED_TEMPORARILY </dt>
4934 <dd class="description">Document has moved temporarily</dd>
4935 <dt>HTTP_MULTIPLE_CHOICES </dt>
4936 <dd class="description">Multiple files match request</dd>
4937 <dt>HTTP_NOT_ACCEPTABLE </dt>
4938 <dd class="description">Not Acceptable</dd>
4939 <dt>HTTP_NOT_AUTHORITATIVE </dt>
4940 <dd class="description">Information isn't authoritative</dd>
4941 <dt>HTTP_NOT_FOUND </dt>
4942 <dd class="description">URI was not found</dd>
4943 <dt>HTTP_NOT_IMPLEMENTED </dt>
4944 <dd class="description">Feature not implemented</dd>
4945 <dt>HTTP_NOT_MODIFIED </dt>
4946 <dd class="description">File not modified</dd>
4947 <dt>HTTP_NOT_SUPPORTED </dt>
4948 <dd class="description">HTTP version not supported</dd>
4949 <dt>HTTP_NO_CONTENT </dt>
4950 <dd class="description">Successful command, no new data</dd>
4951 <dt>HTTP_OK </dt>
4952 <dd class="description">OPTIONS/GET/HEAD/POST/TRACE command was successful</dd>
4953 <dt>HTTP_PARTIAL_CONTENT </dt>
4954 <dd class="description">Only a partial file was recieved/sent</dd>
4955 <dt>HTTP_PAYMENT_REQUIRED </dt>
4956 <dd class="description">Payment required</dd>
4957 <dt>HTTP_PKI_ERROR <span class="info">&nbsp;CUPS 1.5/Mac OS X 10.7&nbsp;</span></dt>
4958 <dd class="description">Error negotiating a secure connection </dd>
4959 <dt>HTTP_PRECONDITION </dt>
4960 <dd class="description">Precondition failed</dd>
4961 <dt>HTTP_PROXY_AUTHENTICATION </dt>
4962 <dd class="description">Proxy Authentication is Required</dd>
4963 <dt>HTTP_REQUESTED_RANGE </dt>
4964 <dd class="description">The requested range is not satisfiable</dd>
4965 <dt>HTTP_REQUEST_TIMEOUT </dt>
4966 <dd class="description">Request timed out</dd>
4967 <dt>HTTP_REQUEST_TOO_LARGE </dt>
4968 <dd class="description">Request entity too large</dd>
4969 <dt>HTTP_RESET_CONTENT </dt>
4970 <dd class="description">Content was reset/recreated</dd>
4971 <dt>HTTP_SEE_OTHER </dt>
4972 <dd class="description">See this other link...</dd>
4973 <dt>HTTP_SERVER_ERROR </dt>
4974 <dd class="description">Internal server error</dd>
4975 <dt>HTTP_SERVICE_UNAVAILABLE </dt>
4976 <dd class="description">Service is unavailable</dd>
4977 <dt>HTTP_SWITCHING_PROTOCOLS </dt>
4978 <dd class="description">HTTP upgrade to TLS/SSL</dd>
4979 <dt>HTTP_UNAUTHORIZED </dt>
4980 <dd class="description">Unauthorized to access host</dd>
4981 <dt>HTTP_UNSUPPORTED_MEDIATYPE </dt>
4982 <dd class="description">The requested media type is unsupported</dd>
4983 <dt>HTTP_UPGRADE_REQUIRED </dt>
4984 <dd class="description">Upgrade to SSL/TLS required</dd>
4985 <dt>HTTP_URI_TOO_LONG </dt>
4986 <dd class="description">URI too long</dd>
4987 <dt>HTTP_USE_PROXY </dt>
4988 <dd class="description">Must use a proxy to access this URI</dd>
4989 </dl>
4990 <h3 class="enumeration"><a name="http_uri_coding_e">http_uri_coding_e</a></h3>
4991 <p class="description">URI en/decode flags</p>
4992 <h4 class="constants">Constants</h4>
4993 <dl>
4994 <dt>HTTP_URI_CODING_ALL </dt>
4995 <dd class="description">En/decode everything</dd>
4996 <dt>HTTP_URI_CODING_HOSTNAME </dt>
4997 <dd class="description">En/decode the hostname portion</dd>
4998 <dt>HTTP_URI_CODING_MOST </dt>
4999 <dd class="description">En/decode all but the query</dd>
5000 <dt>HTTP_URI_CODING_NONE </dt>
5001 <dd class="description">Don't en/decode anything</dd>
5002 <dt>HTTP_URI_CODING_QUERY </dt>
5003 <dd class="description">En/decode the query portion</dd>
5004 <dt>HTTP_URI_CODING_RESOURCE </dt>
5005 <dd class="description">En/decode the resource portion</dd>
5006 <dt>HTTP_URI_CODING_USERNAME </dt>
5007 <dd class="description">En/decode the username portion</dd>
5008 </dl>
5009 <h3 class="enumeration"><span class="info">&nbsp;CUPS 1.2&nbsp;</span><a name="http_uri_status_e">http_uri_status_e</a></h3>
5010 <p class="description">URI separation status </p>
5011 <h4 class="constants">Constants</h4>
5012 <dl>
5013 <dt>HTTP_URI_BAD_ARGUMENTS </dt>
5014 <dd class="description">Bad arguments to function (error)</dd>
5015 <dt>HTTP_URI_BAD_HOSTNAME </dt>
5016 <dd class="description">Bad hostname in URI (error)</dd>
5017 <dt>HTTP_URI_BAD_PORT </dt>
5018 <dd class="description">Bad port number in URI (error)</dd>
5019 <dt>HTTP_URI_BAD_RESOURCE </dt>
5020 <dd class="description">Bad resource in URI (error)</dd>
5021 <dt>HTTP_URI_BAD_SCHEME </dt>
5022 <dd class="description">Bad scheme in URI (error)</dd>
5023 <dt>HTTP_URI_BAD_URI </dt>
5024 <dd class="description">Bad/empty URI (error)</dd>
5025 <dt>HTTP_URI_BAD_USERNAME </dt>
5026 <dd class="description">Bad username in URI (error)</dd>
5027 <dt>HTTP_URI_MISSING_RESOURCE </dt>
5028 <dd class="description">Missing resource in URI (warning)</dd>
5029 <dt>HTTP_URI_MISSING_SCHEME </dt>
5030 <dd class="description">Missing scheme in URI (warning)</dd>
5031 <dt>HTTP_URI_OK </dt>
5032 <dd class="description">URI decoded OK</dd>
5033 <dt>HTTP_URI_OVERFLOW </dt>
5034 <dd class="description">URI buffer for httpAssembleURI is too small</dd>
5035 <dt>HTTP_URI_UNKNOWN_SCHEME </dt>
5036 <dd class="description">Unknown scheme in URI (warning)</dd>
5037 </dl>
5038 <h3 class="enumeration"><a name="http_version_e">http_version_e</a></h3>
5039 <p class="description">HTTP version numbers</p>
5040 <h4 class="constants">Constants</h4>
5041 <dl>
5042 <dt>HTTP_0_9 </dt>
5043 <dd class="description">HTTP/0.9</dd>
5044 <dt>HTTP_1_0 </dt>
5045 <dd class="description">HTTP/1.0</dd>
5046 <dt>HTTP_1_1 </dt>
5047 <dd class="description">HTTP/1.1</dd>
5048 </dl>
5049 <h3 class="enumeration"><a name="ipp_dstate_e">ipp_dstate_e</a></h3>
5050 <p class="description">Document states</p>
5051 <h4 class="constants">Constants</h4>
5052 <dl>
5053 <dt>IPP_DOCUMENT_ABORTED </dt>
5054 <dt>IPP_DOCUMENT_CANCELED </dt>
5055 <dt>IPP_DOCUMENT_COMPLETED </dt>
5056 <dt>IPP_DOCUMENT_PENDING </dt>
5057 <dt>IPP_DOCUMENT_PROCESSING </dt>
5058 </dl>
5059 <h3 class="enumeration"><a name="ipp_finish_e">ipp_finish_e</a></h3>
5060 <p class="description">Finishings</p>
5061 <h4 class="constants">Constants</h4>
5062 <dl>
5063 <dt>IPP_FINISHINGS_BALE </dt>
5064 <dd class="description">Bale (any type)</dd>
5065 <dt>IPP_FINISHINGS_BIND </dt>
5066 <dd class="description">Bind</dd>
5067 <dt>IPP_FINISHINGS_BIND_BOTTOM </dt>
5068 <dd class="description">Bind on bottom</dd>
5069 <dt>IPP_FINISHINGS_BIND_LEFT </dt>
5070 <dd class="description">Bind on left</dd>
5071 <dt>IPP_FINISHINGS_BIND_RIGHT </dt>
5072 <dd class="description">Bind on right</dd>
5073 <dt>IPP_FINISHINGS_BIND_TOP </dt>
5074 <dd class="description">Bind on top</dd>
5075 <dt>IPP_FINISHINGS_BOOKLET_MAKER </dt>
5076 <dd class="description">Fold to make booklet</dd>
5077 <dt>IPP_FINISHINGS_COVER </dt>
5078 <dd class="description">Add cover</dd>
5079 <dt>IPP_FINISHINGS_EDGE_STITCH </dt>
5080 <dd class="description">Stitch along any side</dd>
5081 <dt>IPP_FINISHINGS_EDGE_STITCH_BOTTOM </dt>
5082 <dd class="description">Stitch along bottom edge</dd>
5083 <dt>IPP_FINISHINGS_EDGE_STITCH_LEFT </dt>
5084 <dd class="description">Stitch along left side</dd>
5085 <dt>IPP_FINISHINGS_EDGE_STITCH_RIGHT </dt>
5086 <dd class="description">Stitch along right side</dd>
5087 <dt>IPP_FINISHINGS_EDGE_STITCH_TOP </dt>
5088 <dd class="description">Stitch along top edge</dd>
5089 <dt>IPP_FINISHINGS_FOLD </dt>
5090 <dd class="description">Fold (any type)</dd>
5091 <dt>IPP_FINISHINGS_JOB_OFFSET </dt>
5092 <dd class="description">Offset for binding (any type)</dd>
5093 <dt>IPP_FINISHINGS_NONE </dt>
5094 <dd class="description">No finishing</dd>
5095 <dt>IPP_FINISHINGS_PUNCH </dt>
5096 <dd class="description">Punch (any location/count)</dd>
5097 <dt>IPP_FINISHINGS_SADDLE_STITCH </dt>
5098 <dd class="description">Staple interior</dd>
5099 <dt>IPP_FINISHINGS_STAPLE </dt>
5100 <dd class="description">Staple (any location)</dd>
5101 <dt>IPP_FINISHINGS_STAPLE_BOTTOM_LEFT </dt>
5102 <dd class="description">Staple bottom left corner</dd>
5103 <dt>IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT </dt>
5104 <dd class="description">Staple bottom right corner</dd>
5105 <dt>IPP_FINISHINGS_STAPLE_DUAL_BOTTOM </dt>
5106 <dd class="description">Two staples on bottom</dd>
5107 <dt>IPP_FINISHINGS_STAPLE_DUAL_LEFT </dt>
5108 <dd class="description">Two staples on left</dd>
5109 <dt>IPP_FINISHINGS_STAPLE_DUAL_RIGHT </dt>
5110 <dd class="description">Two staples on right</dd>
5111 <dt>IPP_FINISHINGS_STAPLE_DUAL_TOP </dt>
5112 <dd class="description">Two staples on top</dd>
5113 <dt>IPP_FINISHINGS_STAPLE_TOP_LEFT </dt>
5114 <dd class="description">Staple top left corner</dd>
5115 <dt>IPP_FINISHINGS_STAPLE_TOP_RIGHT </dt>
5116 <dd class="description">Staple top right corner</dd>
5117 <dt>IPP_FINISHINGS_TRIM </dt>
5118 <dd class="description">Trim (any type)</dd>
5119 <dt>IPP_FINISHINGS_TRIM_AFTER_COPIES </dt>
5120 <dd class="description">Trim output after each copy</dd>
5121 <dt>IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS </dt>
5122 <dd class="description">Trim output after each document</dd>
5123 <dt>IPP_FINISHINGS_TRIM_AFTER_JOB </dt>
5124 <dd class="description">Trim output after job</dd>
5125 <dt>IPP_FINISHINGS_TRIM_AFTER_PAGES </dt>
5126 <dd class="description">Trim output after each page</dd>
5127 </dl>
5128 <h3 class="enumeration"><a name="ipp_jcollate_e">ipp_jcollate_e</a></h3>
5129 <p class="description">Job collation types</p>
5130 <h4 class="constants">Constants</h4>
5131 <dl>
5132 <dt>IPP_JOB_COLLATED_DOCUMENTS </dt>
5133 <dt>IPP_JOB_UNCOLLATED_DOCUMENTS </dt>
5134 <dt>IPP_JOB_UNCOLLATED_SHEETS </dt>
5135 </dl>
5136 <h3 class="enumeration"><a name="ipp_jstate_e">ipp_jstate_e</a></h3>
5137 <p class="description">Job states</p>
5138 <h4 class="constants">Constants</h4>
5139 <dl>
5140 <dt>IPP_JOB_ABORTED </dt>
5141 <dd class="description">Job has aborted due to error</dd>
5142 <dt>IPP_JOB_CANCELED </dt>
5143 <dd class="description">Job has been canceled</dd>
5144 <dt>IPP_JOB_COMPLETED </dt>
5145 <dd class="description">Job has completed successfully</dd>
5146 <dt>IPP_JOB_HELD </dt>
5147 <dd class="description">Job is held for printing</dd>
5148 <dt>IPP_JOB_PENDING </dt>
5149 <dd class="description">Job is waiting to be printed</dd>
5150 <dt>IPP_JOB_PROCESSING </dt>
5151 <dd class="description">Job is currently printing</dd>
5152 <dt>IPP_JOB_STOPPED </dt>
5153 <dd class="description">Job has been stopped</dd>
5154 </dl>
5155 <h3 class="enumeration"><a name="ipp_op_e">ipp_op_e</a></h3>
5156 <p class="description">IPP operations</p>
5157 <h4 class="constants">Constants</h4>
5158 <dl>
5159 <dt>CUPS_ACCEPT_JOBS </dt>
5160 <dd class="description">Accept new jobs on a printer</dd>
5161 <dt>CUPS_ADD_MODIFY_CLASS </dt>
5162 <dd class="description">Add or modify a class</dd>
5163 <dt>CUPS_ADD_MODIFY_PRINTER </dt>
5164 <dd class="description">Add or modify a printer</dd>
5165 <dt>CUPS_AUTHENTICATE_JOB <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
5166 <dd class="description">Authenticate a job </dd>
5167 <dt>CUPS_DELETE_CLASS </dt>
5168 <dd class="description">Delete a class</dd>
5169 <dt>CUPS_DELETE_PRINTER </dt>
5170 <dd class="description">Delete a printer</dd>
5171 <dt>CUPS_GET_CLASSES <span class="info">&nbsp;DEPRECATED&nbsp;</span></dt>
5172 <dd class="description">Get a list of classes </dd>
5173 <dt>CUPS_GET_DEFAULT </dt>
5174 <dd class="description">Get the default printer</dd>
5175 <dt>CUPS_GET_DEVICES </dt>
5176 <dd class="description">Get a list of supported devices</dd>
5177 <dt>CUPS_GET_DOCUMENT <span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span></dt>
5178 <dd class="description">Get a document file </dd>
5179 <dt>CUPS_GET_PPD <span class="info">&nbsp;CUPS 1.3/Mac OS X 10.5&nbsp;</span></dt>
5180 <dd class="description">Get a PPD file </dd>
5181 <dt>CUPS_GET_PPDS </dt>
5182 <dd class="description">Get a list of supported drivers</dd>
5183 <dt>CUPS_GET_PRINTERS </dt>
5184 <dd class="description">Get a list of printers and/or classes</dd>
5185 <dt>CUPS_MOVE_JOB </dt>
5186 <dd class="description">Move a job to a different printer</dd>
5187 <dt>CUPS_REJECT_JOBS </dt>
5188 <dd class="description">Reject new jobs on a printer</dd>
5189 <dt>CUPS_SET_DEFAULT </dt>
5190 <dd class="description">Set the default printer</dd>
5191 <dt>IPP_CANCEL_JOB </dt>
5192 <dd class="description">Cancel a job</dd>
5193 <dt>IPP_CANCEL_JOBS </dt>
5194 <dd class="description">Cancel-Jobs</dd>
5195 <dt>IPP_CANCEL_MY_JOBS </dt>
5196 <dd class="description">Cancel-My-Jobs</dd>
5197 <dt>IPP_CANCEL_SUBSCRIPTION <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
5198 <dd class="description">Cancel a subscription </dd>
5199 <dt>IPP_CLOSE_JOB </dt>
5200 <dd class="description">Close-Job</dd>
5201 <dt>IPP_CREATE_JOB </dt>
5202 <dd class="description">Create an empty print job</dd>
5203 <dt>IPP_CREATE_JOB_SUBSCRIPTION <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
5204 <dd class="description">Create a job subscription </dd>
5205 <dt>IPP_CREATE_PRINTER_SUBSCRIPTION <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
5206 <dd class="description">Create a printer subscription </dd>
5207 <dt>IPP_DISABLE_PRINTER </dt>
5208 <dd class="description">Stop a printer</dd>
5209 <dt>IPP_ENABLE_PRINTER </dt>
5210 <dd class="description">Start a printer</dd>
5211 <dt>IPP_GET_JOBS </dt>
5212 <dd class="description">Get a list of jobs</dd>
5213 <dt>IPP_GET_JOB_ATTRIBUTES </dt>
5214 <dd class="description">Get job attributes</dd>
5215 <dt>IPP_GET_NOTIFICATIONS <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
5216 <dd class="description">Get notification events </dd>
5217 <dt>IPP_GET_PRINTER_ATTRIBUTES </dt>
5218 <dd class="description">Get printer attributes</dd>
5219 <dt>IPP_GET_PRINTER_SUPPORTED_VALUES </dt>
5220 <dd class="description">Get supported attribute values</dd>
5221 <dt>IPP_GET_SUBSCRIPTIONS <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
5222 <dd class="description">Get list of subscriptions </dd>
5223 <dt>IPP_GET_SUBSCRIPTION_ATTRIBUTES <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
5224 <dd class="description">Get subscription attributes </dd>
5225 <dt>IPP_HOLD_JOB </dt>
5226 <dd class="description">Hold a job for printing</dd>
5227 <dt>IPP_IDENTIFY_PRINTER </dt>
5228 <dd class="description">Identify-Printer (proposed IPP JPS3)</dd>
5229 <dt>IPP_OP_CUPS_INVALID </dt>
5230 <dd class="description">Invalid operation name for <a href="#ippOpValue"><code>ippOpValue</code></a></dd>
5231 <dt>IPP_PAUSE_PRINTER </dt>
5232 <dd class="description">Stop a printer</dd>
5233 <dt>IPP_PRINT_JOB </dt>
5234 <dd class="description">Print a single file</dd>
5235 <dt>IPP_PURGE_JOBS </dt>
5236 <dd class="description">Cancel all jobs</dd>
5237 <dt>IPP_RELEASE_JOB </dt>
5238 <dd class="description">Release a job for printing</dd>
5239 <dt>IPP_RENEW_SUBSCRIPTION <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
5240 <dd class="description">Renew a printer subscription </dd>
5241 <dt>IPP_RESTART_JOB </dt>
5242 <dd class="description">Reprint a job</dd>
5243 <dt>IPP_RESUBMIT_JOB </dt>
5244 <dd class="description">Resubmit-Job</dd>
5245 <dt>IPP_RESUME_PRINTER </dt>
5246 <dd class="description">Start a printer</dd>
5247 <dt>IPP_SEND_DOCUMENT </dt>
5248 <dd class="description">Add a file to a job</dd>
5249 <dt>IPP_SET_JOB_ATTRIBUTES </dt>
5250 <dd class="description">Set job attributes</dd>
5251 <dt>IPP_VALIDATE_DOCUMENT </dt>
5252 <dd class="description">Validate-Document (proposed IPP JPS3)</dd>
5253 <dt>IPP_VALIDATE_JOB </dt>
5254 <dd class="description">Validate job options</dd>
5255 </dl>
5256 <h3 class="enumeration"><a name="ipp_orient_e">ipp_orient_e</a></h3>
5257 <p class="description">Orientation values</p>
5258 <h4 class="constants">Constants</h4>
5259 <dl>
5260 <dt>IPP_LANDSCAPE </dt>
5261 <dd class="description">90 degrees counter-clockwise</dd>
5262 <dt>IPP_PORTRAIT </dt>
5263 <dd class="description">No rotation</dd>
5264 <dt>IPP_REVERSE_LANDSCAPE </dt>
5265 <dd class="description">90 degrees clockwise</dd>
5266 <dt>IPP_REVERSE_PORTRAIT </dt>
5267 <dd class="description">180 degrees</dd>
5268 </dl>
5269 <h3 class="enumeration"><a name="ipp_pstate_e">ipp_pstate_e</a></h3>
5270 <p class="description">Printer states</p>
5271 <h4 class="constants">Constants</h4>
5272 <dl>
5273 <dt>IPP_PRINTER_IDLE </dt>
5274 <dd class="description">Printer is idle</dd>
5275 <dt>IPP_PRINTER_PROCESSING </dt>
5276 <dd class="description">Printer is working</dd>
5277 <dt>IPP_PRINTER_STOPPED </dt>
5278 <dd class="description">Printer is stopped</dd>
5279 </dl>
5280 <h3 class="enumeration"><a name="ipp_quality_e">ipp_quality_e</a></h3>
5281 <p class="description">Qualities</p>
5282 <h4 class="constants">Constants</h4>
5283 <dl>
5284 <dt>IPP_QUALITY_DRAFT </dt>
5285 <dd class="description">Draft quality</dd>
5286 <dt>IPP_QUALITY_HIGH </dt>
5287 <dd class="description">High quality</dd>
5288 <dt>IPP_QUALITY_NORMAL </dt>
5289 <dd class="description">Normal quality</dd>
5290 </dl>
5291 <h3 class="enumeration"><a name="ipp_res_e">ipp_res_e</a></h3>
5292 <p class="description">Resolution units</p>
5293 <h4 class="constants">Constants</h4>
5294 <dl>
5295 <dt>IPP_RES_PER_CM </dt>
5296 <dd class="description">Pixels per centimeter</dd>
5297 <dt>IPP_RES_PER_INCH </dt>
5298 <dd class="description">Pixels per inch</dd>
5299 </dl>
5300 <h3 class="enumeration"><a name="ipp_state_e">ipp_state_e</a></h3>
5301 <p class="description">IPP states</p>
5302 <h4 class="constants">Constants</h4>
5303 <dl>
5304 <dt>IPP_ATTRIBUTE </dt>
5305 <dd class="description">One or more attributes need to be sent/received</dd>
5306 <dt>IPP_DATA </dt>
5307 <dd class="description">IPP request data needs to be sent/received</dd>
5308 <dt>IPP_ERROR </dt>
5309 <dd class="description">An error occurred</dd>
5310 <dt>IPP_HEADER </dt>
5311 <dd class="description">The request header needs to be sent/received</dd>
5312 <dt>IPP_IDLE </dt>
5313 <dd class="description">Nothing is happening/request completed</dd>
5314 </dl>
5315 <h3 class="enumeration"><a name="ipp_status_e">ipp_status_e</a></h3>
5316 <p class="description">IPP status codes</p>
5317 <h4 class="constants">Constants</h4>
5318 <dl>
5319 <dt>CUPS_SEE_OTHER </dt>
5320 <dd class="description">cups-see-other</dd>
5321 <dt>IPP_ATTRIBUTES </dt>
5322 <dd class="description">client-error-attributes-or-values-not-supported</dd>
5323 <dt>IPP_ATTRIBUTES_NOT_SETTABLE </dt>
5324 <dd class="description">client-error-attributes-not-settable</dd>
5325 <dt>IPP_AUTHENTICATION_CANCELED <span class="info">&nbsp;CUPS 1.5/Mac OS X 10.7&nbsp;</span></dt>
5326 <dd class="description">Authentication canceled by user </dd>
5327 <dt>IPP_BAD_REQUEST </dt>
5328 <dd class="description">client-error-bad-request</dd>
5329 <dt>IPP_CHARSET </dt>
5330 <dd class="description">client-error-charset-not-supported</dd>
5331 <dt>IPP_COMPRESSION_ERROR </dt>
5332 <dd class="description">client-error-compression-error</dd>
5333 <dt>IPP_COMPRESSION_NOT_SUPPORTED </dt>
5334 <dd class="description">client-error-compression-not-supported</dd>
5335 <dt>IPP_CONFLICT </dt>
5336 <dd class="description">client-error-conflicting-attributes</dd>
5337 <dt>IPP_DEVICE_ERROR </dt>
5338 <dd class="description">server-error-device-error</dd>
5339 <dt>IPP_DOCUMENT_ACCESS_ERROR </dt>
5340 <dd class="description">client-error-document-access-error</dd>
5341 <dt>IPP_DOCUMENT_FORMAT </dt>
5342 <dd class="description">client-error-document-format-not-supported</dd>
5343 <dt>IPP_DOCUMENT_FORMAT_ERROR </dt>
5344 <dd class="description">client-error-document-format-error</dd>
5345 <dt>IPP_DOCUMENT_PASSWORD_ERROR </dt>
5346 <dd class="description">client-error-document-password-error</dd>
5347 <dt>IPP_DOCUMENT_PERMISSION_ERROR </dt>
5348 <dd class="description">client-error-document-permission-error</dd>
5349 <dt>IPP_DOCUMENT_SECURITY_ERROR </dt>
5350 <dd class="description">client-error-document-security-error</dd>
5351 <dt>IPP_DOCUMENT_UNPRINTABLE_ERROR </dt>
5352 <dd class="description">client-error-document-unprintable-error</dd>
5353 <dt>IPP_ERROR_JOB_CANCELED </dt>
5354 <dd class="description">server-error-job-canceled</dd>
5355 <dt>IPP_FORBIDDEN </dt>
5356 <dd class="description">client-error-forbidden</dd>
5357 <dt>IPP_GONE </dt>
5358 <dd class="description">client-error-gone</dd>
5359 <dt>IPP_IGNORED_ALL_SUBSCRIPTIONS </dt>
5360 <dd class="description">client-error-ignored-all-subscriptions</dd>
5361 <dt>IPP_INTERNAL_ERROR </dt>
5362 <dd class="description">server-error-internal-error</dd>
5363 <dt>IPP_MULTIPLE_JOBS_NOT_SUPPORTED </dt>
5364 <dd class="description">server-error-multiple-document-jobs-not-supported</dd>
5365 <dt>IPP_NOT_ACCEPTING </dt>
5366 <dd class="description">server-error-not-accepting-jobs</dd>
5367 <dt>IPP_NOT_AUTHENTICATED </dt>
5368 <dd class="description">client-error-not-authenticated</dd>
5369 <dt>IPP_NOT_AUTHORIZED </dt>
5370 <dd class="description">client-error-not-authorized</dd>
5371 <dt>IPP_NOT_FOUND </dt>
5372 <dd class="description">client-error-not-found</dd>
5373 <dt>IPP_NOT_POSSIBLE </dt>
5374 <dd class="description">client-error-not-possible</dd>
5375 <dt>IPP_OK </dt>
5376 <dd class="description">successful-ok</dd>
5377 <dt>IPP_OK_CONFLICT </dt>
5378 <dd class="description">successful-ok-conflicting-attributes</dd>
5379 <dt>IPP_OK_EVENTS_COMPLETE </dt>
5380 <dd class="description">successful-ok-events-complete</dd>
5381 <dt>IPP_OK_IGNORED_SUBSCRIPTIONS </dt>
5382 <dd class="description">successful-ok-ignored-subscriptions</dd>
5383 <dt>IPP_OK_SUBST </dt>
5384 <dd class="description">successful-ok-ignored-or-substituted-attributes</dd>
5385 <dt>IPP_OK_TOO_MANY_EVENTS </dt>
5386 <dd class="description">successful-ok-too-many-events</dd>
5387 <dt>IPP_OPERATION_NOT_SUPPORTED </dt>
5388 <dd class="description">server-error-operation-not-supported</dd>
5389 <dt>IPP_PKI_ERROR <span class="info">&nbsp;CUPS 1.5/Mac OS X 10.7&nbsp;</span></dt>
5390 <dd class="description">Error negotiating a secure connection </dd>
5391 <dt>IPP_PRINTER_BUSY </dt>
5392 <dd class="description">server-error-busy</dd>
5393 <dt>IPP_PRINTER_IS_DEACTIVATED </dt>
5394 <dd class="description">server-error-printer-is-deactivated</dd>
5395 <dt>IPP_REQUEST_ENTITY </dt>
5396 <dd class="description">client-error-request-entity-too-large</dd>
5397 <dt>IPP_REQUEST_VALUE </dt>
5398 <dd class="description">client-error-request-value-too-long</dd>
5399 <dt>IPP_SERVICE_UNAVAILABLE </dt>
5400 <dd class="description">server-error-service-unavailable</dd>
5401 <dt>IPP_STATUS_CUPS_INVALID </dt>
5402 <dd class="description">Invalid status name for <a href="#ippErrorValue"><code>ippErrorValue</code></a></dd>
5403 <dt>IPP_TEMPORARY_ERROR </dt>
5404 <dd class="description">server-error-temporary-error</dd>
5405 <dt>IPP_TIMEOUT </dt>
5406 <dd class="description">client-error-timeout</dd>
5407 <dt>IPP_TOO_MANY_DOCUMENTS </dt>
5408 <dd class="description">server-error-too-many-documents</dd>
5409 <dt>IPP_TOO_MANY_JOBS </dt>
5410 <dd class="description">server-error-too-many-jobs</dd>
5411 <dt>IPP_TOO_MANY_SUBSCRIPTIONS </dt>
5412 <dd class="description">client-error-too-many-subscriptions</dd>
5413 <dt>IPP_UPGRADE_REQUIRED </dt>
5414 <dd class="description">TLS upgrade required</dd>
5415 <dt>IPP_URI_SCHEME </dt>
5416 <dd class="description">client-error-uri-scheme-not-supported</dd>
5417 <dt>IPP_VERSION_NOT_SUPPORTED </dt>
5418 <dd class="description">server-error-version-not-supported</dd>
5419 </dl>
5420 <h3 class="enumeration"><a name="ipp_tag_e">ipp_tag_e</a></h3>
5421 <p class="description">Format tags for attributes</p>
5422 <h4 class="constants">Constants</h4>
5423 <dl>
5424 <dt>IPP_TAG_ADMINDEFINE </dt>
5425 <dd class="description">Admin-defined value</dd>
5426 <dt>IPP_TAG_BEGIN_COLLECTION </dt>
5427 <dd class="description">Beginning of collection value</dd>
5428 <dt>IPP_TAG_BOOLEAN </dt>
5429 <dd class="description">Boolean value</dd>
5430 <dt>IPP_TAG_CHARSET </dt>
5431 <dd class="description">Character set value</dd>
5432 <dt>IPP_TAG_CUPS_INVALID </dt>
5433 <dd class="description">Invalid tag name for <a href="#ippTagValue"><code>ippTagValue</code></a></dd>
5434 <dt>IPP_TAG_DATE </dt>
5435 <dd class="description">Date/time value</dd>
5436 <dt>IPP_TAG_DEFAULT </dt>
5437 <dd class="description">Default value</dd>
5438 <dt>IPP_TAG_DELETEATTR </dt>
5439 <dd class="description">Delete-attribute value</dd>
5440 <dt>IPP_TAG_DOCUMENT </dt>
5441 <dd class="description">Document group</dd>
5442 <dt>IPP_TAG_END </dt>
5443 <dd class="description">End-of-attributes</dd>
5444 <dt>IPP_TAG_END_COLLECTION </dt>
5445 <dd class="description">End of collection value</dd>
5446 <dt>IPP_TAG_ENUM </dt>
5447 <dd class="description">Enumeration value</dd>
5448 <dt>IPP_TAG_EVENT_NOTIFICATION </dt>
5449 <dd class="description">Event group</dd>
5450 <dt>IPP_TAG_EXTENSION </dt>
5451 <dd class="description">Extension point for 32-bit tags</dd>
5452 <dt>IPP_TAG_INTEGER </dt>
5453 <dd class="description">Integer value</dd>
5454 <dt>IPP_TAG_JOB </dt>
5455 <dd class="description">Job group</dd>
5456 <dt>IPP_TAG_KEYWORD </dt>
5457 <dd class="description">Keyword value</dd>
5458 <dt>IPP_TAG_LANGUAGE </dt>
5459 <dd class="description">Language value</dd>
5460 <dt>IPP_TAG_MEMBERNAME </dt>
5461 <dd class="description">Collection member name value</dd>
5462 <dt>IPP_TAG_MIMETYPE </dt>
5463 <dd class="description">MIME media type value</dd>
5464 <dt>IPP_TAG_NAME </dt>
5465 <dd class="description">Name value</dd>
5466 <dt>IPP_TAG_NAMELANG </dt>
5467 <dd class="description">Name-with-language value</dd>
5468 <dt>IPP_TAG_NOTSETTABLE </dt>
5469 <dd class="description">Not-settable value</dd>
5470 <dt>IPP_TAG_NOVALUE </dt>
5471 <dd class="description">No-value value</dd>
5472 <dt>IPP_TAG_OPERATION </dt>
5473 <dd class="description">Operation group</dd>
5474 <dt>IPP_TAG_PRINTER </dt>
5475 <dd class="description">Printer group</dd>
5476 <dt>IPP_TAG_RANGE </dt>
5477 <dd class="description">Range value</dd>
5478 <dt>IPP_TAG_RESOLUTION </dt>
5479 <dd class="description">Resolution value</dd>
5480 <dt>IPP_TAG_STRING </dt>
5481 <dd class="description">Octet string value</dd>
5482 <dt>IPP_TAG_SUBSCRIPTION </dt>
5483 <dd class="description">Subscription group</dd>
5484 <dt>IPP_TAG_TEXT </dt>
5485 <dd class="description">Text value</dd>
5486 <dt>IPP_TAG_TEXTLANG </dt>
5487 <dd class="description">Text-with-language value</dd>
5488 <dt>IPP_TAG_UNKNOWN </dt>
5489 <dd class="description">Unknown value</dd>
5490 <dt>IPP_TAG_UNSUPPORTED_GROUP </dt>
5491 <dd class="description">Unsupported attributes group</dd>
5492 <dt>IPP_TAG_UNSUPPORTED_VALUE </dt>
5493 <dd class="description">Unsupported value</dd>
5494 <dt>IPP_TAG_URI </dt>
5495 <dd class="description">URI value</dd>
5496 <dt>IPP_TAG_URISCHEME </dt>
5497 <dd class="description">URI scheme value</dd>
5498 <dt>IPP_TAG_ZERO </dt>
5499 <dd class="description">Zero tag - used for separators</dd>
5500 </dl>
5501 </div>
5502 </body>
5503 </html>