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