]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/api-httpipp.html
Merge changes from CUPS 1.5svn-r9717.
[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
MS
345
346 HTTP and IPP API header for the Common UNIX Printing System (CUPS).
347
178cb736 348 Copyright 2007-2009 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>
0268488e
MS
451 <li><a href="#httpGetStatus" title="Get the status of the last HTTP request.">httpGetStatus</a></li>
452 <li><a href="#httpGetSubField" title="Get a sub-field value.">httpGetSubField</a></li>
453 <li><a href="#httpGetSubField2" title="Get a sub-field value.">httpGetSubField2</a></li>
454 <li><a href="#httpGets" title="Get a line of text from a HTTP connection.">httpGets</a></li>
455 <li><a href="#httpHead" title="Send a HEAD request to the server.">httpHead</a></li>
456 <li><a href="#httpInitialize" title="Initialize the HTTP interface library and set the
5a738aea 457default HTTP proxy (if any).">httpInitialize</a></li>
0268488e
MS
458 <li><a href="#httpMD5" title="Compute the MD5 sum of the username:group:password.">httpMD5</a></li>
459 <li><a href="#httpMD5Final" title="Combine the MD5 sum of the username, group, and password
5a738aea
MS
460with the server-supplied nonce value, method, and
461request-uri.">httpMD5Final</a></li>
0268488e
MS
462 <li><a href="#httpMD5String" title="Convert an MD5 sum to a character string.">httpMD5String</a></li>
463 <li><a href="#httpOptions" title="Send an OPTIONS request to the server.">httpOptions</a></li>
464 <li><a href="#httpPost" title="Send a POST request to the server.">httpPost</a></li>
465 <li><a href="#httpPut" title="Send a PUT request to the server.">httpPut</a></li>
466 <li><a href="#httpRead" title="Read data from a HTTP connection.">httpRead</a></li>
467 <li><a href="#httpRead2" title="Read data from a HTTP connection.">httpRead2</a></li>
468 <li><a href="#httpReconnect" title="Reconnect to a HTTP server.">httpReconnect</a></li>
469 <li><a href="#httpSeparate" title="Separate a Universal Resource Identifier into its
5a738aea 470components.">httpSeparate</a></li>
0268488e 471 <li><a href="#httpSeparate2" title="Separate a Universal Resource Identifier into its
5a738aea 472components.">httpSeparate2</a></li>
0268488e 473 <li><a href="#httpSeparateURI" title="Separate a Universal Resource Identifier into its
5a738aea 474components.">httpSeparateURI</a></li>
0268488e
MS
475 <li><a href="#httpSetAuthString" title="Set the current authorization string.">httpSetAuthString</a></li>
476 <li><a href="#httpSetCookie" title="Set the cookie value(s).">httpSetCookie</a></li>
477 <li><a href="#httpSetCredentials" title="Set the credentials associated with an encrypted
10d09e33 478connection.">httpSetCredentials</a></li>
0268488e
MS
479 <li><a href="#httpSetExpect" title="Set the Expect: header in a request.">httpSetExpect</a></li>
480 <li><a href="#httpSetField" title="Set the value of an HTTP header.">httpSetField</a></li>
481 <li><a href="#httpSetLength" title="Set the content-length and content-encoding.">httpSetLength</a></li>
482 <li><a href="#httpStatus" title="Return a short string describing a HTTP status code.">httpStatus</a></li>
483 <li><a href="#httpTrace" title="Send an TRACE request to the server.">httpTrace</a></li>
484 <li><a href="#httpUpdate" title="Update the current HTTP state for incoming data.">httpUpdate</a></li>
485 <li><a href="#httpWait" title="Wait for data available on a connection.">httpWait</a></li>
486 <li><a href="#httpWrite" title="Write data to a HTTP connection.">httpWrite</a></li>
487 <li><a href="#httpWrite2" title="Write data to a HTTP connection.">httpWrite2</a></li>
488 <li><a href="#ippAddBoolean" title="Add a boolean attribute to an IPP message.">ippAddBoolean</a></li>
489 <li><a href="#ippAddBooleans" title="Add an array of boolean values.">ippAddBooleans</a></li>
490 <li><a href="#ippAddCollection" title="Add a collection value.">ippAddCollection</a></li>
491 <li><a href="#ippAddCollections" title="Add an array of collection values.">ippAddCollections</a></li>
492 <li><a href="#ippAddDate" title="Add a date attribute to an IPP message.">ippAddDate</a></li>
493 <li><a href="#ippAddInteger" title="Add a integer attribute to an IPP message.">ippAddInteger</a></li>
494 <li><a href="#ippAddIntegers" title="Add an array of integer values.">ippAddIntegers</a></li>
495 <li><a href="#ippAddOctetString" title="Add an octetString value to an IPP message.">ippAddOctetString</a></li>
496 <li><a href="#ippAddRange" title="Add a range of values to an IPP message.">ippAddRange</a></li>
497 <li><a href="#ippAddRanges" title="Add ranges of values to an IPP message.">ippAddRanges</a></li>
498 <li><a href="#ippAddResolution" title="Add a resolution value to an IPP message.">ippAddResolution</a></li>
499 <li><a href="#ippAddResolutions" title="Add resolution values to an IPP message.">ippAddResolutions</a></li>
500 <li><a href="#ippAddSeparator" title="Add a group separator to an IPP message.">ippAddSeparator</a></li>
501 <li><a href="#ippAddString" title="Add a language-encoded string to an IPP message.">ippAddString</a></li>
502 <li><a href="#ippAddStrings" title="Add language-encoded strings to an IPP message.">ippAddStrings</a></li>
503 <li><a href="#ippDateToTime" title="Convert from RFC 1903 Date/Time format to UNIX time
5a738aea 504in seconds.">ippDateToTime</a></li>
0268488e
MS
505 <li><a href="#ippDelete" title="Delete an IPP message.">ippDelete</a></li>
506 <li><a href="#ippDeleteAttribute" title="Delete a single attribute in an IPP message.">ippDeleteAttribute</a></li>
507 <li><a href="#ippErrorString" title="Return a name for the given status code.">ippErrorString</a></li>
508 <li><a href="#ippErrorValue" title="Return a status code for the given name.">ippErrorValue</a></li>
509 <li><a href="#ippFindAttribute" title="Find a named attribute in a request...">ippFindAttribute</a></li>
510 <li><a href="#ippFindNextAttribute" title="Find the next named attribute in a request...">ippFindNextAttribute</a></li>
511 <li><a href="#ippLength" title="Compute the length of an IPP message.">ippLength</a></li>
512 <li><a href="#ippNew" title="Allocate a new IPP message.">ippNew</a></li>
513 <li><a href="#ippNewRequest" title="Allocate a new IPP request message.">ippNewRequest</a></li>
514 <li><a href="#ippOpString" title="Return a name for the given operation id.">ippOpString</a></li>
515 <li><a href="#ippOpValue" title="Return an operation id for the given name.">ippOpValue</a></li>
516 <li><a href="#ippPort" title="Return the default IPP port number.">ippPort</a></li>
517 <li><a href="#ippRead" title="Read data for an IPP message from a HTTP connection.">ippRead</a></li>
518 <li><a href="#ippReadFile" title="Read data for an IPP message from a file.">ippReadFile</a></li>
519 <li><a href="#ippReadIO" title="Read data for an IPP message.">ippReadIO</a></li>
520 <li><a href="#ippSetPort" title="Set the default port number.">ippSetPort</a></li>
521 <li><a href="#ippTagString" title="Return the tag name corresponding to a tag value.">ippTagString</a></li>
522 <li><a href="#ippTagValue" title="Return the tag value corresponding to a tag name.">ippTagValue</a></li>
523 <li><a href="#ippTimeToDate" title="Convert from UNIX time to RFC 1903 format.">ippTimeToDate</a></li>
524 <li><a href="#ippWrite" title="Write data for an IPP message to a HTTP connection.">ippWrite</a></li>
525 <li><a href="#ippWriteFile" title="Write data for an IPP message to a file.">ippWriteFile</a></li>
526 <li><a href="#ippWriteIO" title="Write data for an IPP message.">ippWriteIO</a></li>
8b450588 527</ul></li>
5a738aea 528<li><a href="#TYPES">Data Types</a><ul class="code">
f11a948a
MS
529 <li><a href="#http_addr_t" title="Socket address union, which
530makes using IPv6 and other
531address types easier and
532more portable. ">http_addr_t</a></li>
5a738aea
MS
533 <li><a href="#http_addrlist_t" title="Socket address list, which is
534used to enumerate all of the
535addresses that are associated
536with a hostname. ">http_addrlist_t</a></li>
537 <li><a href="#http_auth_t" title="HTTP authentication types">http_auth_t</a></li>
10d09e33 538 <li><a href="#http_credential_t" title="Credential data ">http_credential_t</a></li>
5a738aea
MS
539 <li><a href="#http_encoding_t" title="HTTP transfer encoding values">http_encoding_t</a></li>
540 <li><a href="#http_encryption_t" title="HTTP encryption values">http_encryption_t</a></li>
79e1d494 541 <li><a href="#http_field_t" title="HTTP field names">http_field_t</a></li>
f11a948a
MS
542 <li><a href="#http_keepalive_t" title="HTTP keep-alive values">http_keepalive_t</a></li>
543 <li><a href="#http_state_t" title="HTTP state values; states
544are server-oriented...">http_state_t</a></li>
79e1d494 545 <li><a href="#http_status_t" title="HTTP status codes">http_status_t</a></li>
5a738aea 546 <li><a href="#http_t" title="HTTP connection type">http_t</a></li>
f11a948a
MS
547 <li><a href="#http_uri_coding_t" title="URI en/decode flags">http_uri_coding_t</a></li>
548 <li><a href="#http_uri_status_t" title="URI separation status ">http_uri_status_t</a></li>
549 <li><a href="#http_version_t" title="HTTP version numbers">http_version_t</a></li>
5a738aea 550 <li><a href="#ipp_attribute_t" title="Attribute">ipp_attribute_t</a></li>
aaf19ab0 551 <li><a href="#ipp_finish_t" title="Finishings">ipp_finish_t</a></li>
5a738aea 552 <li><a href="#ipp_iocb_t" title="IPP IO Callback Function ">ipp_iocb_t</a></li>
aaf19ab0
MS
553 <li><a href="#ipp_jstate_t" title="Job states">ipp_jstate_t</a></li>
554 <li><a href="#ipp_op_t" title="IPP operations">ipp_op_t</a></li>
555 <li><a href="#ipp_orient_t" title="Orientation values">ipp_orient_t</a></li>
556 <li><a href="#ipp_pstate_t" title="Printer states">ipp_pstate_t</a></li>
557 <li><a href="#ipp_quality_t" title="Qualities">ipp_quality_t</a></li>
5a738aea 558 <li><a href="#ipp_request_t" title="Request Header">ipp_request_t</a></li>
aaf19ab0
MS
559 <li><a href="#ipp_res_t" title="Resolution units">ipp_res_t</a></li>
560 <li><a href="#ipp_state_t" title="IPP states">ipp_state_t</a></li>
5a738aea 561 <li><a href="#ipp_t" title="Attribute Value">ipp_t</a></li>
aaf19ab0
MS
562 <li><a href="#ipp_uchar_t" title="IPP status codes">ipp_uchar_t</a></li>
563 <li><a href="#ipp_tag_t" title="Format tags for attributes">ipp_tag_t</a></li>
f11a948a 564 <li><a href="#ipp_value_t" title="Attribute Value">ipp_value_t</a></li>
5a738aea
MS
565</ul></li>
566<li><a href="#STRUCTURES">Structures</a><ul class="code">
567 <li><a href="#http_addrlist_s" title="Socket address list, which is
568used to enumerate all of the
569addresses that are associated
570with a hostname. ">http_addrlist_s</a></li>
10d09e33 571 <li><a href="#http_credential_s" title="Credential data ">http_credential_s</a></li>
5a738aea
MS
572 <li><a href="#ipp_attribute_s" title="Attribute">ipp_attribute_s</a></li>
573 <li><a href="#ipp_s" title="IPP Request/Response/Notification">ipp_s</a></li>
574</ul></li>
575<li><a href="#UNIONS">Unions</a><ul class="code">
576 <li><a href="#ipp_request_u" title="Request Header">ipp_request_u</a></li>
f11a948a 577 <li><a href="#ipp_value_u" title="Attribute Value">ipp_value_u</a></li>
5a738aea
MS
578</ul></li>
579<li><a href="#ENUMERATIONS">Constants</a><ul class="code">
580 <li><a href="#http_auth_e" title="HTTP authentication types">http_auth_e</a></li>
581 <li><a href="#http_encoding_e" title="HTTP transfer encoding values">http_encoding_e</a></li>
582 <li><a href="#http_encryption_e" title="HTTP encryption values">http_encryption_e</a></li>
583 <li><a href="#http_field_e" title="HTTP field names">http_field_e</a></li>
f11a948a
MS
584 <li><a href="#http_keepalive_e" title="HTTP keep-alive values">http_keepalive_e</a></li>
585 <li><a href="#http_state_e" title="HTTP state values; states
586are server-oriented...">http_state_e</a></li>
5a738aea 587 <li><a href="#http_status_e" title="HTTP status codes">http_status_e</a></li>
f11a948a
MS
588 <li><a href="#http_uri_coding_e" title="URI en/decode flags">http_uri_coding_e</a></li>
589 <li><a href="#http_uri_status_e" title="URI separation status ">http_uri_status_e</a></li>
590 <li><a href="#http_version_e" title="HTTP version numbers">http_version_e</a></li>
aaf19ab0
MS
591 <li><a href="#ipp_finish_e" title="Finishings">ipp_finish_e</a></li>
592 <li><a href="#ipp_jstate_e" title="Job states">ipp_jstate_e</a></li>
593 <li><a href="#ipp_op_e" title="IPP operations">ipp_op_e</a></li>
594 <li><a href="#ipp_orient_e" title="Orientation values">ipp_orient_e</a></li>
595 <li><a href="#ipp_pstate_e" title="Printer states">ipp_pstate_e</a></li>
596 <li><a href="#ipp_quality_e" title="Qualities">ipp_quality_e</a></li>
597 <li><a href="#ipp_res_e" title="Resolution units">ipp_res_e</a></li>
598 <li><a href="#ipp_state_e" title="IPP states">ipp_state_e</a></li>
599 <li><a href="#ipp_status_e" title="IPP status codes">ipp_status_e</a></li>
600 <li><a href="#ipp_tag_e" title="Format tags for attributes">ipp_tag_e</a></li>
5a738aea 601</ul></li>
0268488e 602</ul>
5a738aea 603<!--
68b10830 604 "$Id$"
ef416fc2 605
606 HTTP and IPP API introduction for the Common UNIX Printing System (CUPS).
607
5a738aea 608 Copyright 2007-2008 by Apple Inc.
bc44d920 609 Copyright 1997-2006 by Easy Software Products, all rights reserved.
ef416fc2 610
611 These coded instructions, statements, and computer programs are the
bc44d920 612 property of Apple Inc. and are protected by Federal copyright
613 law. Distribution and use rights are outlined in the file "LICENSE.txt"
614 which should have been included with this file. If this file is
615 file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 616-->
617
5a738aea
MS
618<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
619
620<p>The CUPS HTTP and IPP APIs provide low-level access to the HTTP and IPP
621protocols and CUPS scheduler. They are typically used by monitoring and
622administration programs to perform specific functions not supported by the
623high-level CUPS API functions.</p>
624
625<p>The HTTP APIs use an opaque structure called
626<a href='#http_t'><code>http_t</code></a> to manage connections to
627a particular HTTP or IPP server. The
628<a href='#httpConnectEncrypt'><code>httpConnectEncrypt</code></a> function is
629used to create an instance of this structure for a particular server.
630The constant <code>CUPS_HTTP_DEFAULT</code> can be used with all of the
631<code>cups</code> functions to refer to the default CUPS server - the functions
632create a per-thread <a href='#http_t'><code>http_t</code></a> as needed.</p>
633
634<p>The IPP APIs use two structures for requests (messages sent to the CUPS
635scheduler) and responses (messages sent back to your application from the
636scheduler). The <a href='#ipp_t'><code>ipp_t</code></a> structure holds a
637complete request or response and is allocated using the
638<a href='#ippNew'><code>ippNew</code></a> or
639<a href='#ippNewRequest'><code>ippNewRequest</code></a> functions and
640freed using the <a href='#ippDelete'><code>ippDelete</code></a> function.</p>
641
642<p>The second structure is called
643<a href='#ipp_attribute_t'><code>ipp_attribute_t</code></a> and holds a
644single IPP attribute which consists of a group tag (<code>group_tag</code>), a
645value type tag (<code>value_tag</code>), the attribute name (<code>name</code>),
646and 1 or more values (<code>values[]</code>). Attributes are added to an
647<a href='#ipp_t'><code>ipp_t</code></a> structure using one of the
648<code>ippAdd</code> functions. For example, use
649<a href='#ippAddString'><code>ippAddString</code></a> to add a
650"requesting-user-name" string attribute to a request:</p>
651
652<pre class='example'>
653<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(IPP_GET_JOBS);
654
655<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
656 NULL, cupsUser());
657</pre>
ef416fc2 658
5a738aea
MS
659<p>Once you have created an IPP request, use the <code>cups</code>
660functions to send the request to and read the response from the server.
661For example, the <a href='#cupsDoRequest'><code>cupsDoRequest</code></a>
662function can be used for simple query operations that do not involve files:</p>
ef416fc2 663
5a738aea
MS
664<pre class='example'>
665#include &lt;cups/cups.h&gt;
ef416fc2 666
ef416fc2 667
5a738aea
MS
668<a href='#ipp_t'>ipp_t</a> *<a name='get_jobs'>get_jobs</a>(void)
669{
670 <a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(IPP_GET_JOBS);
ef416fc2 671
5a738aea
MS
672 <a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
673 NULL, cupsUser());
674
675 return (<a href='#cupsDoRequest'>cupsDoRequest</a>(CUPS_HTTP_DEFAULT, request, "/"));
676}
ef416fc2 677</pre>
678
5a738aea
MS
679<p>The <a href='#cupsDoRequest'><code>cupsDoRequest</code></a> function frees
680the request structure and returns an IPP response structure or NULL pointer if
681the request could not be sent to the server. Once you have a response from
682the server, you can either use the
683<a href='#ippFindAttribute'><code>ippFindAttribute</code></a> and
684<a href='#ippFindNextAttribute'><code>ippFindNextAttribute</code></a> functions
685to find specific attributes, for example:</p>
ef416fc2 686
5a738aea
MS
687<pre class='example'>
688<a href='#ipp_t'>ipp_t</a> *response;
689<a href='#ipp_attribute_t'>ipp_attribute_t</a> *attr;
bc44d920 690
5a738aea
MS
691attr = <a href='#ippFindAttribute'>ippFindAttribute</a>(response, "printer-state", IPP_TAG_ENUM);
692</pre>
693
694<p>You can also walk the list of attributes with a simple <code>for</code> loop
695like this:</p>
696
697<pre class='example'>
698<a href='#ipp_t'>ipp_t</a> *response;
699<a href='#ipp_attribute_t'>ipp_attribute_t</a> *attr;
700
701for (attr = response->attrs; attr != NULL; attr = attr->next)
702 if (attr->name == NULL)
703 puts("--SEPARATOR--");
704 else
705 puts(attr->name);
706</pre>
707
708<p>The <code>for</code> loop approach is normally used when collecting
709attributes for multiple objects (jobs, printers, etc.) in a response. Attributes
710with <code>NULL</code> names indicate a separator between the attributes of
711each object. For example, the following code will list the jobs returned from
712our previous <a href='#get_jobs'><code>get_jobs</code></a> example code:</p>
713
714<pre class='example'>
715<a href='#ipp_t'>ipp_t</a> *response = <a href='#get_jobs'>get_jobs</a>();
716
717if (response != NULL)
718{
719 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *attr;
720 int job_id = 0;
721 char *job_name = NULL;
722 char *job_originating_user_name = NULL;
723
724 puts("Job ID Owner Title");
725 puts("------ ---------------- ---------------------------------");
726
727 for (attr = response->attrs; attr != NULL; attr = attr->next)
728 {
729 /* Attributes without names are separators between jobs */
730 if (attr->name == NULL)
731 {
732 if (job_id > 0 &amp;&amp; job_name != NULL &amp;&amp; job_originating_user_name != NULL)
733 printf("%5d %-16s %s\n", job_id, job_originating_user_name, job_name);
734
735 job_id = 0;
736 job_name = NULL;
737 job_originating_user_name = NULL;
738 continue;
739 }
740 else if (!strcmp(attr->name, "job-id") &amp;&amp; attr->value_tag == IPP_TAG_INTEGER)
741 job_id = attr->values[0].integer;
742 else if (!strcmp(attr->name, "job-name") &amp;&amp; attr->value_tag == IPP_TAG_NAME)
743 job_name = attr->values[0].string.text;
744 else if (!strcmp(attr->name, "job-originating-user-name") &amp;&amp;
745 attr->value_tag == IPP_TAG_NAME)
746 job_originating_user_name = attr->values[0].string.text;
747 }
748
749 if (job_id > 0 &amp;&amp; job_name != NULL &amp;&amp; job_originating_user_name != NULL)
750 printf("%5d %-16s %s\n", job_id, job_originating_user_name, job_name);
751}
752</pre>
753
754<h3><a name='CREATING_URI_STRINGS'>Creating URI Strings</a></h3>
755
756<p>To ensure proper encoding, the
757<a href='#httpAssembleURIf'><code>httpAssembleURIf</code></a> function must be
758used to format a "printer-uri" string for all printer-based requests:</p>
759
760<pre class='example'>
761const char *name = "Foo";
762char uri[1024];
763<a href='#ipp_t'>ipp_t</a> *request;
764
765<a href='#httpAssembleURIf'>httpAssembleURIf</a>(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, cupsServer(),
766 ippPort(), "/printers/%s", name);
767<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
768</pre>
769
770<h3><a name='SENDING_REQUESTS_WITH_FILES'>Sending Requests with Files</a></h3>
771
772<p>The <a href='#cupsDoFileRequest'><code>cupsDoFileRequest</code></a> and
773<a href='#cupsDoIORequest'><code>cupsDoIORequest</code></a> functions are
774used for requests involving files. The
775<a href='#cupsDoFileRequest'><code>cupsDoFileRequest</code></a> function
776attaches the named file to a request and is typically used when sending a print
777file or changing a printer's PPD file:</p>
778
779<pre class='example'>
780const char *filename = "/usr/share/cups/data/testprint.ps";
781const char *name = "Foo";
782char uri[1024];
783char resource[1024];
784<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(IPP_PRINT_JOB);
785<a href='#ipp_t'>ipp_t</a> *response;
786
787/* Use httpAssembleURIf for the printer-uri string */
788<a href='#httpAssembleURIf'>httpAssembleURIf</a>(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, cupsServer(),
789 ippPort(), "/printers/%s", name);
790<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
791<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
792 NULL, cupsUser());
793<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name",
794 NULL, "testprint.ps");
795
796/* Use snprintf for the resource path */
797snprintf(resource, sizeof(resource), "/printers/%s", name);
798
799response = <a href='#cupsDoFileRequest'>cupsDoFileRequest</a>(CUPS_HTTP_DEFAULT, request, resource, filename);
800</pre>
801
802<p>The <a href='#cupsDoIORequest'><code>cupsDoIORequest</code></a> function
803optionally attaches a file to the request and optionally saves a file in the
804response from the server. It is used when using a pipe for the request
805attachment or when using a request that returns a file, currently only
806<code>CUPS_GET_DOCUMENT</code> and <code>CUPS_GET_PPD</code>. For example,
807the following code will download the PPD file for the sample HP LaserJet
808printer driver:</p>
809
810<pre class='example'>
811char tempfile[1024];
812int tempfd;
813<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(CUPS_GET_PPD);
814<a href='#ipp_t'>ipp_t</a> *response;
815
816<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
817 NULL, "laserjet.ppd");
818
819tempfd = cupsTempFd(tempfile, sizeof(tempfile));
820
821response = <a href='#cupsDoIORequest'>cupsDoIORequest</a>(CUPS_HTTP_DEFAULT, request, "/", -1, tempfd);
822</pre>
823
824<p>The example passes <code>-1</code> for the input file descriptor to specify
825that no file is to be attached to the request. The PPD file attached to the
826response is written to the temporary file descriptor we created using the
827<code>cupsTempFd</code> function.</p>
828
829<h3><a name='ASYNCHRONOUS_REQUEST_PROCESSING'>Asynchronous Request Processing</a></h3>
830
831<p>The <a href='#cupsSendRequest'><code>cupsSendRequest</code></a> and
832<a href='#cupsGetResponse'><code>cupsGetResponse</code></a> support
833asynchronous communications with the server. Unlike the other request
834functions, the IPP request is not automatically freed, so remember to
835free your request with the <a href='#ippDelete'><code>ippDelete</code></a>
836function.</p>
837
838<p>File data is attached to the request using the
839<a href='#cupsWriteRequestData'><code>cupsWriteRequestData</code></a>
840function, while file data returned from the server is read using the
841<a href='#cupsReadResponseData'><code>cupsReadResponseData</code></a>
842function. We can rewrite the previous <code>CUPS_GET_PPD</code> example
843to use the asynchronous functions quite easily:</p>
844
845<pre class='example'>
846char tempfile[1024];
847int tempfd;
848<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(CUPS_GET_PPD);
849<a href='#ipp_t'>ipp_t</a> *response;
850
851<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
852 NULL, "laserjet.ppd");
853
854tempfd = cupsTempFd(tempfile, sizeof(tempfile));
855
856if (<a href='#cupsSendRequest'>cupsSendRequest</a>(CUPS_HTTP_DEFAULT, request, "/") == HTTP_CONTINUE)
857{
858 response = <a href='#cupsGetResponse'>cupsGetResponse</a>(CUPS_HTTP_DEFAULT, "/");
859
860 if (response != NULL)
861 {
862 ssize_t bytes;
863 char buffer[8192];
864
865 while ((bytes = <a href='#cupsReadResponseData'>cupsReadResponseData</a>(CUPS_HTTP_DEFAULT, buffer, sizeof(buffer))) > 0)
866 write(tempfd, buffer, bytes);
867 }
868}
869
870/* Free the request! */
871<a href='#ippDelete'>ippDelete</a>(request);
872</pre>
873
874<p>The <a href='#cupsSendRequest'><code>cupsSendRequest</code></a> function
875returns the initial HTTP request status, typically either
876<code>HTTP_CONTINUE</code> or <code>HTTP_UNAUTHORIZED</code>. The latter status
877is returned when the request requires authentication of some sort. The
878<a href='#cupsDoAuthentication'><code>cupsDoAuthentication</code></a> function
879must be called when your see <code>HTTP_UNAUTHORIZED</code> and the request
880re-sent. We can add authentication support to our example code by using a
881<code>do ... while</code> loop:</p>
882
883<pre class='example'>
884char tempfile[1024];
885int tempfd;
886<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(CUPS_GET_PPD);
887<a href='#ipp_t'>ipp_t</a> *response;
888http_status_t status;
889
890<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
891 NULL, "laserjet.ppd");
892
893tempfd = cupsTempFd(tempfile, sizeof(tempfile));
894
895/* Loop for authentication */
896do
897{
75bd9771 898 status = <a href='#cupsSendRequest'>cupsSendRequest</a>(CUPS_HTTP_DEFAULT, request, "/");
5a738aea
MS
899
900 if (status == HTTP_UNAUTHORIZED)
901 {
902 /* Try to authenticate, break out of the loop if that fails */
903 if (<a href='#cupsDoAuthentication'>cupsDoAuthentication</a>(CUPS_HTTP_DEFAULT, "POST", "/"))
904 break;
905 }
906}
907while (status != HTTP_CONTINUE &amp;&amp; status != HTTP_UNAUTHORIZED);
908
909if (status == HTTP_CONTINUE)
910{
911 response = <a href='#cupsGetResponse'>cupsGetResponse</a>(CUPS_HTTP_DEFAULT, "/");
912
913 if (response != NULL)
914 {
915 ssize_t bytes;
916 char buffer[8192];
917
918 while ((bytes = <a href='#cupsReadResponseData'>cupsReadResponseData</a>(CUPS_HTTP_DEFAULT, buffer, sizeof(buffer))) > 0)
919 write(tempfd, buffer, bytes);
920 }
921}
922
923/* Free the request! */
924<a href='#ippDelete'>ippDelete</a>(request);
925</pre>
926<h2 class="title"><a name="FUNCTIONS">Functions</a></h2>
426c6a59 927<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
928<p class="description">Authenticate a request.</p>
929<p class="code">
930int cupsDoAuthentication (<br>
931&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
932&nbsp;&nbsp;&nbsp;&nbsp;const char *method,<br>
933&nbsp;&nbsp;&nbsp;&nbsp;const char *resource<br>
934);</p>
935<h4 class="parameters">Parameters</h4>
936<dl>
937<dt>http</dt>
568fa3fa 938<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
939<dt>method</dt>
940<dd class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</dd>
941<dt>resource</dt>
942<dd class="description">Resource path</dd>
943</dl>
944<h4 class="returnvalue">Return Value</h4>
945<p class="description">0 on success, -1 on error</p>
946<h4 class="discussion">Discussion</h4>
947<p class="discussion">This function should be called in response to a <code>HTTP_UNAUTHORIZED</code>
948status, prior to resubmitting your request.
949
950</p>
951<h3 class="function"><a name="cupsDoFileRequest">cupsDoFileRequest</a></h3>
952<p class="description">Do an IPP request with a file.</p>
953<p class="code">
954<a href="#ipp_t">ipp_t</a> *cupsDoFileRequest (<br>
955&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
956&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *request,<br>
957&nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
958&nbsp;&nbsp;&nbsp;&nbsp;const char *filename<br>
959);</p>
960<h4 class="parameters">Parameters</h4>
961<dl>
962<dt>http</dt>
568fa3fa 963<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
964<dt>request</dt>
965<dd class="description">IPP request</dd>
966<dt>resource</dt>
967<dd class="description">HTTP resource for POST</dd>
968<dt>filename</dt>
568fa3fa 969<dd class="description">File to send or <code>NULL</code> for none</dd>
5a738aea
MS
970</dl>
971<h4 class="returnvalue">Return Value</h4>
972<p class="description">Response data</p>
973<h4 class="discussion">Discussion</h4>
974<p class="discussion">This function sends the IPP request to the specified server, retrying
568fa3fa 975and authenticating as necessary. The request is freed with <a href="#ippDelete"><code>ippDelete</code></a>
5a738aea 976after receiving a valid IPP response.</p>
426c6a59 977<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
978<p class="description">Do an IPP request with file descriptors.</p>
979<p class="code">
980<a href="#ipp_t">ipp_t</a> *cupsDoIORequest (<br>
981&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
982&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *request,<br>
983&nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
984&nbsp;&nbsp;&nbsp;&nbsp;int infile,<br>
985&nbsp;&nbsp;&nbsp;&nbsp;int outfile<br>
986);</p>
987<h4 class="parameters">Parameters</h4>
988<dl>
989<dt>http</dt>
568fa3fa 990<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
991<dt>request</dt>
992<dd class="description">IPP request</dd>
993<dt>resource</dt>
994<dd class="description">HTTP resource for POST</dd>
995<dt>infile</dt>
996<dd class="description">File to read from or -1 for none</dd>
997<dt>outfile</dt>
998<dd class="description">File to write to or -1 for none</dd>
999</dl>
1000<h4 class="returnvalue">Return Value</h4>
1001<p class="description">Response data</p>
1002<h4 class="discussion">Discussion</h4>
1003<p class="discussion">This function sends the IPP request to the specified server, retrying
bc44d920 1004and authenticating as necessary. The request is freed with ippDelete()
5a738aea
MS
1005after receiving a valid IPP response.<br>
1006<br>
1007If &quot;infile&quot; is a valid file descriptor, cupsDoIORequest() copies
1008all of the data from the file after the IPP request message.<br>
1009<br>
1010If &quot;outfile&quot; is a valid file descriptor, cupsDoIORequest() copies
bc44d920 1011all of the data after the IPP response message to the file.
1012
5a738aea
MS
1013</p>
1014<h3 class="function"><a name="cupsDoRequest">cupsDoRequest</a></h3>
1015<p class="description">Do an IPP request.</p>
1016<p class="code">
1017<a href="#ipp_t">ipp_t</a> *cupsDoRequest (<br>
1018&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1019&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *request,<br>
1020&nbsp;&nbsp;&nbsp;&nbsp;const char *resource<br>
1021);</p>
1022<h4 class="parameters">Parameters</h4>
1023<dl>
1024<dt>http</dt>
568fa3fa 1025<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
1026<dt>request</dt>
1027<dd class="description">IPP request</dd>
1028<dt>resource</dt>
1029<dd class="description">HTTP resource for POST</dd>
1030</dl>
1031<h4 class="returnvalue">Return Value</h4>
1032<p class="description">Response data</p>
1033<h4 class="discussion">Discussion</h4>
1034<p class="discussion">This function sends the IPP request to the specified server, retrying
ecdc0628 1035and authenticating as necessary. The request is freed with ippDelete()
5a738aea
MS
1036after receiving a valid IPP response.</p>
1037<h3 class="function"><a name="cupsEncodeOptions">cupsEncodeOptions</a></h3>
1038<p class="description">Encode printer options into IPP attributes.</p>
1039<p class="code">
1040void cupsEncodeOptions (<br>
1041&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
1042&nbsp;&nbsp;&nbsp;&nbsp;int num_options,<br>
1043&nbsp;&nbsp;&nbsp;&nbsp;cups_option_t *options<br>
1044);</p>
1045<h4 class="parameters">Parameters</h4>
1046<dl>
1047<dt>ipp</dt>
1048<dd class="description">Request to add to</dd>
1049<dt>num_options</dt>
1050<dd class="description">Number of options</dd>
1051<dt>options</dt>
1052<dd class="description">Options</dd>
1053</dl>
1054<h4 class="discussion">Discussion</h4>
1055<p class="discussion">This function adds operation, job, and then subscription attributes,
ecdc0628 1056in that order. Use the cupsEncodeOptions2() function to add attributes
5a738aea 1057for a single group.</p>
426c6a59 1058<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
1059<p class="description">Encode printer options into IPP attributes for a group.</p>
1060<p class="code">
1061void cupsEncodeOptions2 (<br>
1062&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
1063&nbsp;&nbsp;&nbsp;&nbsp;int num_options,<br>
1064&nbsp;&nbsp;&nbsp;&nbsp;cups_option_t *options,<br>
79e1d494 1065&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> group_tag<br>
5a738aea
MS
1066);</p>
1067<h4 class="parameters">Parameters</h4>
1068<dl>
1069<dt>ipp</dt>
1070<dd class="description">Request to add to</dd>
1071<dt>num_options</dt>
1072<dd class="description">Number of options</dd>
1073<dt>options</dt>
1074<dd class="description">Options</dd>
1075<dt>group_tag</dt>
1076<dd class="description">Group to encode</dd>
1077</dl>
1078<h4 class="discussion">Discussion</h4>
1079<p class="discussion">This function only adds attributes for a single group. Call this
ecdc0628 1080function multiple times for each group, or use cupsEncodeOptions()
1081to add the standard groups.
ef416fc2 1082
ae71f5de 1083</p>
178cb736 1084<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
1085<p class="description">Get available printer devices.</p>
1086<p class="code">
1087ipp_status_t cupsGetDevices (<br>
1088&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1089&nbsp;&nbsp;&nbsp;&nbsp;int timeout,<br>
8b450588 1090&nbsp;&nbsp;&nbsp;&nbsp;const char *include_schemes,<br>
ae71f5de
MS
1091&nbsp;&nbsp;&nbsp;&nbsp;const char *exclude_schemes,<br>
1092&nbsp;&nbsp;&nbsp;&nbsp;cups_device_cb_t callback,<br>
1093&nbsp;&nbsp;&nbsp;&nbsp;void *user_data<br>
1094);</p>
1095<h4 class="parameters">Parameters</h4>
1096<dl>
1097<dt>http</dt>
1098<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1099<dt>timeout</dt>
1100<dd class="description">Timeout in seconds or <code>CUPS_TIMEOUT_DEFAULT</code></dd>
8b450588
MS
1101<dt>include_schemes</dt>
1102<dd class="description">Comma-separated URI schemes to include or <code>CUPS_INCLUDE_ALL</code></dd>
ae71f5de
MS
1103<dt>exclude_schemes</dt>
1104<dd class="description">Comma-separated URI schemes to exclude or <code>CUPS_EXCLUDE_NONE</code></dd>
1105<dt>callback</dt>
1106<dd class="description">Callback function</dd>
1107<dt>user_data</dt>
1108<dd class="description">User data pointer</dd>
1109</dl>
1110<h4 class="returnvalue">Return Value</h4>
1111<p class="description">Request status - <code>IPP_OK</code> on success.</p>
1112<h4 class="discussion">Discussion</h4>
1113<p class="discussion">This function sends a CUPS-Get-Devices request and streams the discovered
1114devices to the specified callback function. The &quot;timeout&quot; parameter controls
8b450588
MS
1115how long the request lasts, while the &quot;include_schemes&quot; and &quot;exclude_schemes&quot;
1116parameters provide comma-delimited lists of backends to include or omit from
1117the request respectively.
ae71f5de
MS
1118
1119</p>
426c6a59 1120<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
1121<p class="description">Get a file from the server.</p>
1122<p class="code">
79e1d494 1123<a href="#http_status_t">http_status_t</a> cupsGetFd (<br>
ae71f5de
MS
1124&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1125&nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1126&nbsp;&nbsp;&nbsp;&nbsp;int fd<br>
1127);</p>
1128<h4 class="parameters">Parameters</h4>
1129<dl>
1130<dt>http</dt>
1131<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1132<dt>resource</dt>
1133<dd class="description">Resource name</dd>
1134<dt>fd</dt>
1135<dd class="description">File descriptor</dd>
1136</dl>
1137<h4 class="returnvalue">Return Value</h4>
1138<p class="description">HTTP status</p>
1139<h4 class="discussion">Discussion</h4>
1140<p class="discussion">This function returns <code>HTTP_OK</code> when the file is successfully retrieved.
1141
1142</p>
426c6a59 1143<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
1144<p class="description">Get a file from the server.</p>
1145<p class="code">
79e1d494 1146<a href="#http_status_t">http_status_t</a> cupsGetFile (<br>
ae71f5de
MS
1147&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1148&nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1149&nbsp;&nbsp;&nbsp;&nbsp;const char *filename<br>
1150);</p>
1151<h4 class="parameters">Parameters</h4>
1152<dl>
1153<dt>http</dt>
1154<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1155<dt>resource</dt>
1156<dd class="description">Resource name</dd>
1157<dt>filename</dt>
1158<dd class="description">Filename</dd>
1159</dl>
1160<h4 class="returnvalue">Return Value</h4>
1161<p class="description">HTTP status</p>
1162<h4 class="discussion">Discussion</h4>
1163<p class="discussion">This function returns <code>HTTP_OK</code> when the file is successfully retrieved.
1164
5a738aea 1165</p>
178cb736 1166<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
1167<p class="description">Get a response to an IPP request.</p>
1168<p class="code">
1169<a href="#ipp_t">ipp_t</a> *cupsGetResponse (<br>
1170&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1171&nbsp;&nbsp;&nbsp;&nbsp;const char *resource<br>
1172);</p>
1173<h4 class="parameters">Parameters</h4>
1174<dl>
1175<dt>http</dt>
568fa3fa 1176<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
1177<dt>resource</dt>
1178<dd class="description">HTTP resource for POST</dd>
1179</dl>
1180<h4 class="returnvalue">Return Value</h4>
568fa3fa 1181<p class="description">Response or <code>NULL</code> on HTTP error</p>
5a738aea
MS
1182<h4 class="discussion">Discussion</h4>
1183<p class="discussion">Use this function to get the response for an IPP request sent using
1184cupsSendDocument() or cupsSendRequest(). For requests that return
1185additional data, use httpRead() after getting a successful response.
1186
ae71f5de 1187</p>
10d09e33
MS
1188<h3 class="function"><a name="cupsLastError">cupsLastError</a></h3>
1189<p class="description">Return the last IPP status code.</p>
1190<p class="code">
1191ipp_status_t cupsLastError (void);</p>
1192<h4 class="returnvalue">Return Value</h4>
1193<p class="description">IPP status code from last request</p>
1194<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="cupsLastErrorString">cupsLastErrorString</a></h3>
1195<p class="description">Return the last IPP status-message.</p>
1196<p class="code">
1197const char *cupsLastErrorString (void);</p>
1198<h4 class="returnvalue">Return Value</h4>
1199<p class="description">status-message text from last request</p>
426c6a59 1200<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
1201<p class="description">Put a file on the server.</p>
1202<p class="code">
79e1d494 1203<a href="#http_status_t">http_status_t</a> cupsPutFd (<br>
ae71f5de
MS
1204&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1205&nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1206&nbsp;&nbsp;&nbsp;&nbsp;int fd<br>
1207);</p>
1208<h4 class="parameters">Parameters</h4>
1209<dl>
1210<dt>http</dt>
1211<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1212<dt>resource</dt>
1213<dd class="description">Resource name</dd>
1214<dt>fd</dt>
1215<dd class="description">File descriptor</dd>
1216</dl>
1217<h4 class="returnvalue">Return Value</h4>
1218<p class="description">HTTP status</p>
1219<h4 class="discussion">Discussion</h4>
1220<p class="discussion">This function returns <code>HTTP_CREATED</code> when the file is stored
1221successfully.
1222
1223</p>
426c6a59 1224<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
1225<p class="description">Put a file on the server.</p>
1226<p class="code">
79e1d494 1227<a href="#http_status_t">http_status_t</a> cupsPutFile (<br>
ae71f5de
MS
1228&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1229&nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1230&nbsp;&nbsp;&nbsp;&nbsp;const char *filename<br>
1231);</p>
1232<h4 class="parameters">Parameters</h4>
1233<dl>
1234<dt>http</dt>
1235<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1236<dt>resource</dt>
1237<dd class="description">Resource name</dd>
1238<dt>filename</dt>
1239<dd class="description">Filename</dd>
1240</dl>
1241<h4 class="returnvalue">Return Value</h4>
1242<p class="description">HTTP status</p>
1243<h4 class="discussion">Discussion</h4>
1244<p class="discussion">This function returns <code>HTTP_CREATED</code> when the file is stored
1245successfully.
1246
5a738aea 1247</p>
178cb736 1248<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
1249<p class="description">Read additional data after the IPP response.</p>
1250<p class="code">
1251ssize_t cupsReadResponseData (<br>
1252&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1253&nbsp;&nbsp;&nbsp;&nbsp;char *buffer,<br>
1254&nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
1255);</p>
1256<h4 class="parameters">Parameters</h4>
1257<dl>
1258<dt>http</dt>
568fa3fa 1259<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
1260<dt>buffer</dt>
1261<dd class="description">Buffer to use</dd>
1262<dt>length</dt>
1263<dd class="description">Number of bytes to read</dd>
1264</dl>
1265<h4 class="returnvalue">Return Value</h4>
1266<p class="description">Bytes read, 0 on EOF, -1 on error</p>
1267<h4 class="discussion">Discussion</h4>
1268<p class="discussion">This function is used after cupsGetResponse() to read the PPD or document
1269files for CUPS_GET_PPD and CUPS_GET_DOCUMENT requests, respectively.
1270
1271</p>
178cb736 1272<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
1273<p class="description">Send an IPP request.</p>
1274<p class="code">
79e1d494 1275<a href="#http_status_t">http_status_t</a> cupsSendRequest (<br>
5a738aea
MS
1276&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1277&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *request,<br>
1278&nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1279&nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
1280);</p>
1281<h4 class="parameters">Parameters</h4>
1282<dl>
1283<dt>http</dt>
568fa3fa 1284<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
1285<dt>request</dt>
1286<dd class="description">IPP request</dd>
1287<dt>resource</dt>
1288<dd class="description">Resource path</dd>
1289<dt>length</dt>
ae71f5de 1290<dd class="description">Length of data to follow or <code>CUPS_LENGTH_VARIABLE</code></dd>
5a738aea
MS
1291</dl>
1292<h4 class="returnvalue">Return Value</h4>
1293<p class="description">Initial HTTP status</p>
1294<h4 class="discussion">Discussion</h4>
1295<p class="discussion">Use httpWrite() to write any additional data (document, PPD file, etc.)
1296for the request, cupsGetResponse() to get the IPP response, and httpRead()
10d09e33 1297to read any additional data following the response. Only one request can be
5a738aea
MS
1298sent/queued at a time.<br>
1299<br>
1300Unlike cupsDoFileRequest(), cupsDoIORequest(), and cupsDoRequest(), the
1301request is not freed.
1302
1303</p>
178cb736 1304<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
1305<p class="description">Write additional data after an IPP request.</p>
1306<p class="code">
79e1d494 1307<a href="#http_status_t">http_status_t</a> cupsWriteRequestData (<br>
5a738aea
MS
1308&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1309&nbsp;&nbsp;&nbsp;&nbsp;const char *buffer,<br>
1310&nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
1311);</p>
1312<h4 class="parameters">Parameters</h4>
1313<dl>
1314<dt>http</dt>
568fa3fa 1315<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
1316<dt>buffer</dt>
1317<dd class="description">Bytes to write</dd>
1318<dt>length</dt>
1319<dd class="description">Number of bytes to write</dd>
1320</dl>
1321<h4 class="returnvalue">Return Value</h4>
568fa3fa 1322<p class="description"><code>HTTP_CONTINUE</code> if OK or HTTP status on error</p>
5a738aea 1323<h4 class="discussion">Discussion</h4>
568fa3fa
MS
1324<p class="discussion">This function is used after <a href="#cupsSendRequest"><code>cupsSendRequest</code></a> to provide a PPD and
1325after <a href="#cupsStartDocument"><code>cupsStartDocument</code></a> to provide a document file.
5a738aea 1326
10d09e33
MS
1327</p>
1328<h3 class="function"><span class="info">&nbsp;CUPS 1.5&nbsp;</span><a name="httpAddCredential">httpAddCredential</a></h3>
1329<p class="description">Allocates and adds a single credential to an array.</p>
1330<p class="code">
1331int httpAddCredential (<br>
1332&nbsp;&nbsp;&nbsp;&nbsp;cups_array_t *credentials,<br>
1333&nbsp;&nbsp;&nbsp;&nbsp;const void *data,<br>
1334&nbsp;&nbsp;&nbsp;&nbsp;size_t datalen<br>
1335);</p>
1336<h4 class="parameters">Parameters</h4>
1337<dl>
1338<dt>credentials</dt>
1339<dd class="description">Credentials array</dd>
1340<dt>data</dt>
1341<dd class="description">PEM-encoded X.509 data</dd>
1342<dt>datalen</dt>
1343<dd class="description">Length of data</dd>
1344</dl>
1345<h4 class="returnvalue">Return Value</h4>
1346<p class="description">0 on success, -1 on error</p>
1347<h4 class="discussion">Discussion</h4>
1348<p class="discussion">Use <code>cupsArrayNew(NULL, NULL)</code> to create a credentials array.
1349
5a738aea 1350</p>
426c6a59 1351<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
1352<p class="description">Check for the &quot;any&quot; address.</p>
1353<p class="code">
1354int httpAddrAny (<br>
1355&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr<br>
1356);</p>
1357<h4 class="parameters">Parameters</h4>
1358<dl>
1359<dt>addr</dt>
1360<dd class="description">Address to check</dd>
1361</dl>
1362<h4 class="returnvalue">Return Value</h4>
1363<p class="description">1 if &quot;any&quot;, 0 otherwise</p>
426c6a59 1364<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
1365<p class="description">Compare two addresses.</p>
1366<p class="code">
1367int httpAddrEqual (<br>
1368&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr1,<br>
1369&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr2<br>
1370);</p>
1371<h4 class="parameters">Parameters</h4>
1372<dl>
1373<dt>addr1</dt>
1374<dd class="description">First address</dd>
1375<dt>addr2</dt>
1376<dd class="description">Second address</dd>
1377</dl>
1378<h4 class="returnvalue">Return Value</h4>
1379<p class="description">1 if equal, 0 if not</p>
426c6a59 1380<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
1381<p class="description">Return the length of the address in bytes.</p>
1382<p class="code">
1383int httpAddrLength (<br>
1384&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr<br>
1385);</p>
1386<h4 class="parameters">Parameters</h4>
1387<dl>
1388<dt>addr</dt>
1389<dd class="description">Address</dd>
1390</dl>
1391<h4 class="returnvalue">Return Value</h4>
1392<p class="description">Length in bytes</p>
426c6a59 1393<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
1394<p class="description">Check for the local loopback address.</p>
1395<p class="code">
1396int httpAddrLocalhost (<br>
1397&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr<br>
1398);</p>
1399<h4 class="parameters">Parameters</h4>
1400<dl>
1401<dt>addr</dt>
1402<dd class="description">Address to check</dd>
1403</dl>
1404<h4 class="returnvalue">Return Value</h4>
1405<p class="description">1 if local host, 0 otherwise</p>
426c6a59 1406<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
1407<p class="description">Lookup the hostname associated with the address.</p>
1408<p class="code">
1409char *httpAddrLookup (<br>
1410&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr,<br>
1411&nbsp;&nbsp;&nbsp;&nbsp;char *name,<br>
1412&nbsp;&nbsp;&nbsp;&nbsp;int namelen<br>
1413);</p>
1414<h4 class="parameters">Parameters</h4>
1415<dl>
1416<dt>addr</dt>
1417<dd class="description">Address to lookup</dd>
1418<dt>name</dt>
1419<dd class="description">Host name buffer</dd>
1420<dt>namelen</dt>
1421<dd class="description">Size of name buffer</dd>
1422</dl>
1423<h4 class="returnvalue">Return Value</h4>
1424<p class="description">Host name</p>
426c6a59 1425<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
1426<p class="description">Convert an address to a numeric string.</p>
1427<p class="code">
1428char *httpAddrString (<br>
1429&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr,<br>
1430&nbsp;&nbsp;&nbsp;&nbsp;char *s,<br>
1431&nbsp;&nbsp;&nbsp;&nbsp;int slen<br>
1432);</p>
1433<h4 class="parameters">Parameters</h4>
1434<dl>
1435<dt>addr</dt>
1436<dd class="description">Address to convert</dd>
1437<dt>s</dt>
1438<dd class="description">String buffer</dd>
1439<dt>slen</dt>
1440<dd class="description">Length of string</dd>
1441</dl>
1442<h4 class="returnvalue">Return Value</h4>
1443<p class="description">Numeric address string</p>
426c6a59 1444<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
1445<p class="description">Assemble a uniform resource identifier from its
1446components.</p>
1447<p class="code">
79e1d494
MS
1448<a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURI (<br>
1449&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding,<br>
5a738aea
MS
1450&nbsp;&nbsp;&nbsp;&nbsp;char *uri,<br>
1451&nbsp;&nbsp;&nbsp;&nbsp;int urilen,<br>
1452&nbsp;&nbsp;&nbsp;&nbsp;const char *scheme,<br>
1453&nbsp;&nbsp;&nbsp;&nbsp;const char *username,<br>
1454&nbsp;&nbsp;&nbsp;&nbsp;const char *host,<br>
1455&nbsp;&nbsp;&nbsp;&nbsp;int port,<br>
1456&nbsp;&nbsp;&nbsp;&nbsp;const char *resource<br>
1457);</p>
1458<h4 class="parameters">Parameters</h4>
1459<dl>
1460<dt>encoding</dt>
1461<dd class="description">Encoding flags</dd>
1462<dt>uri</dt>
1463<dd class="description">URI buffer</dd>
1464<dt>urilen</dt>
1465<dd class="description">Size of URI buffer</dd>
1466<dt>scheme</dt>
1467<dd class="description">Scheme name</dd>
1468<dt>username</dt>
1469<dd class="description">Username</dd>
1470<dt>host</dt>
1471<dd class="description">Hostname or address</dd>
1472<dt>port</dt>
1473<dd class="description">Port number</dd>
1474<dt>resource</dt>
1475<dd class="description">Resource</dd>
1476</dl>
1477<h4 class="returnvalue">Return Value</h4>
1478<p class="description">URI status</p>
1479<h4 class="discussion">Discussion</h4>
1480<p class="discussion">This function escapes reserved characters in the URI depending on the
ecdc0628 1481value of the &quot;encoding&quot; argument. You should use this function in
1482place of traditional string functions whenever you need to create a
1483URI string.
ef416fc2 1484
5a738aea 1485</p>
426c6a59 1486<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
1487<p class="description">Assemble a uniform resource identifier from its
1488components with a formatted resource.</p>
1489<p class="code">
79e1d494
MS
1490<a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURIf (<br>
1491&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding,<br>
5a738aea
MS
1492&nbsp;&nbsp;&nbsp;&nbsp;char *uri,<br>
1493&nbsp;&nbsp;&nbsp;&nbsp;int urilen,<br>
1494&nbsp;&nbsp;&nbsp;&nbsp;const char *scheme,<br>
1495&nbsp;&nbsp;&nbsp;&nbsp;const char *username,<br>
1496&nbsp;&nbsp;&nbsp;&nbsp;const char *host,<br>
1497&nbsp;&nbsp;&nbsp;&nbsp;int port,<br>
1498&nbsp;&nbsp;&nbsp;&nbsp;const char *resourcef,<br>
1499&nbsp;&nbsp;&nbsp;&nbsp;...<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>resourcef</dt>
1518<dd class="description">Printf-style resource</dd>
1519<dt>...</dt>
1520<dd class="description">Additional arguments as needed</dd>
1521</dl>
1522<h4 class="returnvalue">Return Value</h4>
1523<p class="description">URI status</p>
1524<h4 class="discussion">Discussion</h4>
1525<p class="discussion">This function creates a formatted version of the resource string
ecdc0628 1526argument &quot;resourcef&quot; and escapes reserved characters in the URI
1527depending on the value of the &quot;encoding&quot; argument. You should use
1528this function in place of traditional string functions whenever
1529you need to create a URI string.
ef416fc2 1530
5a738aea
MS
1531</p>
1532<h3 class="function"><a name="httpBlocking">httpBlocking</a></h3>
1533<p class="description">Set blocking/non-blocking behavior on a connection.</p>
1534<p class="code">
1535void httpBlocking (<br>
1536&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1537&nbsp;&nbsp;&nbsp;&nbsp;int b<br>
1538);</p>
1539<h4 class="parameters">Parameters</h4>
1540<dl>
1541<dt>http</dt>
568fa3fa 1542<dd class="description">Connection to server</dd>
5a738aea
MS
1543<dt>b</dt>
1544<dd class="description">1 = blocking, 0 = non-blocking</dd>
1545</dl>
1546<h3 class="function"><a name="httpCheck">httpCheck</a></h3>
1547<p class="description">Check to see if there is a pending response from the server.</p>
1548<p class="code">
1549int httpCheck (<br>
1550&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1551);</p>
1552<h4 class="parameters">Parameters</h4>
1553<dl>
1554<dt>http</dt>
568fa3fa 1555<dd class="description">Connection to server</dd>
5a738aea
MS
1556</dl>
1557<h4 class="returnvalue">Return Value</h4>
1558<p class="description">0 = no data, 1 = data available</p>
426c6a59 1559<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
1560<p class="description">Clear the cookie value(s).</p>
1561<p class="code">
1562void httpClearCookie (<br>
1563&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1564);</p>
1565<h4 class="parameters">Parameters</h4>
1566<dl>
1567<dt>http</dt>
568fa3fa 1568<dd class="description">Connection to server</dd>
5a738aea
MS
1569</dl>
1570<h3 class="function"><a name="httpClearFields">httpClearFields</a></h3>
1571<p class="description">Clear HTTP request fields.</p>
1572<p class="code">
1573void httpClearFields (<br>
1574&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1575);</p>
1576<h4 class="parameters">Parameters</h4>
1577<dl>
1578<dt>http</dt>
568fa3fa 1579<dd class="description">Connection to server</dd>
5a738aea
MS
1580</dl>
1581<h3 class="function"><a name="httpClose">httpClose</a></h3>
10d09e33 1582<p class="description">Close an HTTP connection.</p>
5a738aea
MS
1583<p class="code">
1584void httpClose (<br>
1585&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1586);</p>
1587<h4 class="parameters">Parameters</h4>
1588<dl>
1589<dt>http</dt>
568fa3fa 1590<dd class="description">Connection to server</dd>
5a738aea 1591</dl>
06d4e77b 1592<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpConnect">httpConnect</a></h3>
5a738aea
MS
1593<p class="description">Connect to a HTTP server.</p>
1594<p class="code">
1595<a href="#http_t">http_t</a> *httpConnect (<br>
1596&nbsp;&nbsp;&nbsp;&nbsp;const char *host,<br>
1597&nbsp;&nbsp;&nbsp;&nbsp;int port<br>
1598);</p>
1599<h4 class="parameters">Parameters</h4>
1600<dl>
1601<dt>host</dt>
1602<dd class="description">Host to connect to</dd>
1603<dt>port</dt>
1604<dd class="description">Port number</dd>
1605</dl>
1606<h4 class="returnvalue">Return Value</h4>
1607<p class="description">New HTTP connection</p>
06d4e77b
MS
1608<h4 class="discussion">Discussion</h4>
1609<p class="discussion">This function is deprecated - use <a href="#httpConnectEncrypt"><code>httpConnectEncrypt</code></a> instead.
1610
1611</p>
5a738aea
MS
1612<h3 class="function"><a name="httpConnectEncrypt">httpConnectEncrypt</a></h3>
1613<p class="description">Connect to a HTTP server using encryption.</p>
1614<p class="code">
1615<a href="#http_t">http_t</a> *httpConnectEncrypt (<br>
1616&nbsp;&nbsp;&nbsp;&nbsp;const char *host,<br>
1617&nbsp;&nbsp;&nbsp;&nbsp;int port,<br>
1618&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_encryption_t">http_encryption_t</a> encryption<br>
1619);</p>
1620<h4 class="parameters">Parameters</h4>
1621<dl>
1622<dt>host</dt>
1623<dd class="description">Host to connect to</dd>
1624<dt>port</dt>
1625<dd class="description">Port number</dd>
1626<dt>encryption</dt>
1627<dd class="description">Type of encryption to use</dd>
1628</dl>
1629<h4 class="returnvalue">Return Value</h4>
1630<p class="description">New HTTP connection</p>
10d09e33
MS
1631<h3 class="function"><span class="info">&nbsp;CUPS 1.5&nbsp;</span><a name="httpCopyCredentials">httpCopyCredentials</a></h3>
1632<p class="description">Copy the credentials associated with an encrypted
1633connection.</p>
1634<p class="code">
1635int httpCopyCredentials (<br>
1636&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1637&nbsp;&nbsp;&nbsp;&nbsp;cups_array_t **credentials<br>
1638);</p>
1639<h4 class="parameters">Parameters</h4>
1640<dl>
1641<dt>http</dt>
1642<dd class="description">Connection to server</dd>
1643<dt>credentials</dt>
1644<dd class="description">Array of credentials</dd>
1645</dl>
1646<h4 class="returnvalue">Return Value</h4>
1647<p class="description">Status of call (0 = success)</p>
5a738aea
MS
1648<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpDecode64">httpDecode64</a></h3>
1649<p class="description">Base64-decode a string.</p>
1650<p class="code">
1651char *httpDecode64 (<br>
1652&nbsp;&nbsp;&nbsp;&nbsp;char *out,<br>
1653&nbsp;&nbsp;&nbsp;&nbsp;const char *in<br>
1654);</p>
1655<h4 class="parameters">Parameters</h4>
1656<dl>
1657<dt>out</dt>
1658<dd class="description">String to write to</dd>
1659<dt>in</dt>
1660<dd class="description">String to read from</dd>
1661</dl>
1662<h4 class="returnvalue">Return Value</h4>
1663<p class="description">Decoded string</p>
1664<h4 class="discussion">Discussion</h4>
1665<p class="discussion">This function is deprecated. Use the httpDecode64_2() function instead
ecdc0628 1666which provides buffer length arguments.
1667
5a738aea 1668</p>
426c6a59 1669<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
1670<p class="description">Base64-decode a string.</p>
1671<p class="code">
1672char *httpDecode64_2 (<br>
1673&nbsp;&nbsp;&nbsp;&nbsp;char *out,<br>
1674&nbsp;&nbsp;&nbsp;&nbsp;int *outlen,<br>
1675&nbsp;&nbsp;&nbsp;&nbsp;const char *in<br>
1676);</p>
1677<h4 class="parameters">Parameters</h4>
1678<dl>
1679<dt>out</dt>
1680<dd class="description">String to write to</dd>
1681<dt>outlen</dt>
1682<dd class="description">Size of output string</dd>
1683<dt>in</dt>
1684<dd class="description">String to read from</dd>
1685</dl>
1686<h4 class="returnvalue">Return Value</h4>
1687<p class="description">Decoded string</p>
1688<h3 class="function"><a name="httpDelete">httpDelete</a></h3>
1689<p class="description">Send a DELETE request to the server.</p>
1690<p class="code">
1691int httpDelete (<br>
1692&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1693&nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
1694);</p>
1695<h4 class="parameters">Parameters</h4>
1696<dl>
1697<dt>http</dt>
568fa3fa 1698<dd class="description">Connection to server</dd>
5a738aea
MS
1699<dt>uri</dt>
1700<dd class="description">URI to delete</dd>
1701</dl>
1702<h4 class="returnvalue">Return Value</h4>
1703<p class="description">Status of call (0 = success)</p>
1704<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpEncode64">httpEncode64</a></h3>
1705<p class="description">Base64-encode a string.</p>
1706<p class="code">
1707char *httpEncode64 (<br>
1708&nbsp;&nbsp;&nbsp;&nbsp;char *out,<br>
1709&nbsp;&nbsp;&nbsp;&nbsp;const char *in<br>
1710);</p>
1711<h4 class="parameters">Parameters</h4>
1712<dl>
1713<dt>out</dt>
1714<dd class="description">String to write to</dd>
1715<dt>in</dt>
1716<dd class="description">String to read from</dd>
1717</dl>
1718<h4 class="returnvalue">Return Value</h4>
1719<p class="description">Encoded string</p>
1720<h4 class="discussion">Discussion</h4>
1721<p class="discussion">This function is deprecated. Use the httpEncode64_2() function instead
ecdc0628 1722which provides buffer length arguments.
1723
5a738aea 1724</p>
426c6a59 1725<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
1726<p class="description">Base64-encode a string.</p>
1727<p class="code">
1728char *httpEncode64_2 (<br>
1729&nbsp;&nbsp;&nbsp;&nbsp;char *out,<br>
1730&nbsp;&nbsp;&nbsp;&nbsp;int outlen,<br>
1731&nbsp;&nbsp;&nbsp;&nbsp;const char *in,<br>
1732&nbsp;&nbsp;&nbsp;&nbsp;int inlen<br>
1733);</p>
1734<h4 class="parameters">Parameters</h4>
1735<dl>
1736<dt>out</dt>
1737<dd class="description">String to write to</dd>
1738<dt>outlen</dt>
1739<dd class="description">Size of output string</dd>
1740<dt>in</dt>
1741<dd class="description">String to read from</dd>
1742<dt>inlen</dt>
1743<dd class="description">Size of input string</dd>
1744</dl>
1745<h4 class="returnvalue">Return Value</h4>
1746<p class="description">Encoded string</p>
1747<h3 class="function"><a name="httpEncryption">httpEncryption</a></h3>
1748<p class="description">Set the required encryption on the link.</p>
1749<p class="code">
1750int httpEncryption (<br>
1751&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1752&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_encryption_t">http_encryption_t</a> e<br>
1753);</p>
1754<h4 class="parameters">Parameters</h4>
1755<dl>
1756<dt>http</dt>
568fa3fa 1757<dd class="description">Connection to server</dd>
5a738aea
MS
1758<dt>e</dt>
1759<dd class="description">New encryption preference</dd>
1760</dl>
1761<h4 class="returnvalue">Return Value</h4>
1762<p class="description">-1 on error, 0 on success</p>
1763<h3 class="function"><a name="httpError">httpError</a></h3>
1764<p class="description">Get the last error on a connection.</p>
1765<p class="code">
1766int httpError (<br>
1767&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1768);</p>
1769<h4 class="parameters">Parameters</h4>
1770<dl>
1771<dt>http</dt>
568fa3fa 1772<dd class="description">Connection to server</dd>
5a738aea
MS
1773</dl>
1774<h4 class="returnvalue">Return Value</h4>
1775<p class="description">Error code (errno) value</p>
1776<h3 class="function"><a name="httpFlush">httpFlush</a></h3>
1777<p class="description">Flush data from a HTTP connection.</p>
1778<p class="code">
1779void httpFlush (<br>
1780&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1781);</p>
1782<h4 class="parameters">Parameters</h4>
1783<dl>
1784<dt>http</dt>
568fa3fa 1785<dd class="description">Connection to server</dd>
5a738aea 1786</dl>
426c6a59 1787<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
1788<p class="description">Flush data in write buffer.</p>
1789<p class="code">
1790int httpFlushWrite (<br>
1791&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1792);</p>
1793<h4 class="parameters">Parameters</h4>
1794<dl>
1795<dt>http</dt>
568fa3fa 1796<dd class="description">Connection to server</dd>
5a738aea
MS
1797</dl>
1798<h4 class="returnvalue">Return Value</h4>
1799<p class="description">Bytes written or -1 on error</p>
10d09e33
MS
1800<h3 class="function"><a name="httpFreeCredentials">httpFreeCredentials</a></h3>
1801<p class="description">Free an array of credentials.</p>
1802<p class="code">
1803void httpFreeCredentials (<br>
1804&nbsp;&nbsp;&nbsp;&nbsp;cups_array_t *credentials<br>
1805);</p>
1806<h4 class="parameters">Parameters</h4>
1807<dl>
1808<dt>credentials</dt>
1809<dd class="description">Array of credentials</dd>
1810</dl>
5a738aea
MS
1811<h3 class="function"><a name="httpGet">httpGet</a></h3>
1812<p class="description">Send a GET request to the server.</p>
1813<p class="code">
1814int httpGet (<br>
1815&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1816&nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
1817);</p>
1818<h4 class="parameters">Parameters</h4>
1819<dl>
1820<dt>http</dt>
568fa3fa 1821<dd class="description">Connection to server</dd>
5a738aea
MS
1822<dt>uri</dt>
1823<dd class="description">URI to get</dd>
1824</dl>
1825<h4 class="returnvalue">Return Value</h4>
1826<p class="description">Status of call (0 = success)</p>
426c6a59 1827<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
1828<p class="description">Get the current authorization string.</p>
1829<p class="code">
1830char *httpGetAuthString (<br>
1831&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1832);</p>
1833<h4 class="parameters">Parameters</h4>
1834<dl>
1835<dt>http</dt>
568fa3fa 1836<dd class="description">Connection to server</dd>
5a738aea
MS
1837</dl>
1838<h4 class="returnvalue">Return Value</h4>
1839<p class="description">Authorization string</p>
1840<h4 class="discussion">Discussion</h4>
1841<p class="discussion">The authorization string is set by cupsDoAuthentication() and
355e94dc
MS
1842httpSetAuthString(). Use httpGetAuthString() to retrieve the
1843string to use with httpSetField() for the HTTP_FIELD_AUTHORIZATION
1844value.
1845
5a738aea 1846</p>
426c6a59 1847<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
1848<p class="description">Get the blocking/non-block state of a connection.</p>
1849<p class="code">
1850int httpGetBlocking (<br>
1851&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1852);</p>
1853<h4 class="parameters">Parameters</h4>
1854<dl>
1855<dt>http</dt>
568fa3fa 1856<dd class="description">Connection to server</dd>
5a738aea
MS
1857</dl>
1858<h4 class="returnvalue">Return Value</h4>
1859<p class="description">1 if blocking, 0 if non-blocking</p>
426c6a59 1860<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
1861<p class="description">Get any cookie data from the response.</p>
1862<p class="code">
1863const char *httpGetCookie (<br>
1864&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1865);</p>
1866<h4 class="parameters">Parameters</h4>
1867<dl>
1868<dt>http</dt>
1869<dd class="description">HTTP connecion</dd>
1870</dl>
1871<h4 class="returnvalue">Return Value</h4>
1872<p class="description">Cookie data or NULL</p>
1873<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpGetDateString">httpGetDateString</a></h3>
1874<p class="description">Get a formatted date/time string from a time value.</p>
1875<p class="code">
1876const char *httpGetDateString (<br>
1877&nbsp;&nbsp;&nbsp;&nbsp;time_t t<br>
1878);</p>
1879<h4 class="parameters">Parameters</h4>
1880<dl>
1881<dt>t</dt>
1882<dd class="description">UNIX time</dd>
1883</dl>
1884<h4 class="returnvalue">Return Value</h4>
1885<p class="description">Date/time string</p>
426c6a59 1886<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
1887<p class="description">Get a formatted date/time string from a time value.</p>
1888<p class="code">
1889const char *httpGetDateString2 (<br>
1890&nbsp;&nbsp;&nbsp;&nbsp;time_t t,<br>
1891&nbsp;&nbsp;&nbsp;&nbsp;char *s,<br>
1892&nbsp;&nbsp;&nbsp;&nbsp;int slen<br>
1893);</p>
1894<h4 class="parameters">Parameters</h4>
1895<dl>
1896<dt>t</dt>
1897<dd class="description">UNIX time</dd>
1898<dt>s</dt>
1899<dd class="description">String buffer</dd>
1900<dt>slen</dt>
1901<dd class="description">Size of string buffer</dd>
1902</dl>
1903<h4 class="returnvalue">Return Value</h4>
1904<p class="description">Date/time string</p>
1905<h3 class="function"><a name="httpGetDateTime">httpGetDateTime</a></h3>
1906<p class="description">Get a time value from a formatted date/time string.</p>
1907<p class="code">
1908time_t httpGetDateTime (<br>
1909&nbsp;&nbsp;&nbsp;&nbsp;const char *s<br>
1910);</p>
1911<h4 class="parameters">Parameters</h4>
1912<dl>
1913<dt>s</dt>
1914<dd class="description">Date/time string</dd>
1915</dl>
1916<h4 class="returnvalue">Return Value</h4>
1917<p class="description">UNIX time</p>
426c6a59 1918<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
1919<p class="description">Get the file descriptor associated with a connection.</p>
1920<p class="code">
1921int httpGetFd (<br>
1922&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1923);</p>
1924<h4 class="parameters">Parameters</h4>
1925<dl>
1926<dt>http</dt>
568fa3fa 1927<dd class="description">Connection to server</dd>
5a738aea
MS
1928</dl>
1929<h4 class="returnvalue">Return Value</h4>
1930<p class="description">File descriptor or -1 if none</p>
1931<h3 class="function"><a name="httpGetField">httpGetField</a></h3>
1932<p class="description">Get a field value from a request/response.</p>
1933<p class="code">
1934const char *httpGetField (<br>
1935&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
79e1d494 1936&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_field_t">http_field_t</a> field<br>
5a738aea
MS
1937);</p>
1938<h4 class="parameters">Parameters</h4>
1939<dl>
1940<dt>http</dt>
568fa3fa 1941<dd class="description">Connection to server</dd>
5a738aea
MS
1942<dt>field</dt>
1943<dd class="description">Field to get</dd>
1944</dl>
1945<h4 class="returnvalue">Return Value</h4>
1946<p class="description">Field value</p>
1947<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpGetHostByName">httpGetHostByName</a></h3>
1948<p class="description">Lookup a hostname or IPv4 address, and return
1949address records for the specified name.</p>
1950<p class="code">
1951struct hostent *httpGetHostByName (<br>
1952&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
1953);</p>
1954<h4 class="parameters">Parameters</h4>
1955<dl>
1956<dt>name</dt>
1957<dd class="description">Hostname or IP address</dd>
1958</dl>
1959<h4 class="returnvalue">Return Value</h4>
1960<p class="description">Host entry</p>
426c6a59 1961<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
1962<p class="description">Get the FQDN for the connection or local system.</p>
1963<p class="code">
1964const char *httpGetHostname (<br>
1965&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1966&nbsp;&nbsp;&nbsp;&nbsp;char *s,<br>
1967&nbsp;&nbsp;&nbsp;&nbsp;int slen<br>
1968);</p>
1969<h4 class="parameters">Parameters</h4>
1970<dl>
1971<dt>http</dt>
1972<dd class="description">HTTP connection or NULL</dd>
1973<dt>s</dt>
1974<dd class="description">String buffer for name</dd>
1975<dt>slen</dt>
1976<dd class="description">Size of buffer</dd>
1977</dl>
1978<h4 class="returnvalue">Return Value</h4>
1979<p class="description">FQDN for connection or system</p>
1980<h4 class="discussion">Discussion</h4>
1981<p class="discussion">When &quot;http&quot; points to a connected socket, return the hostname or
80ca4592 1982address that was used in the call to httpConnect() or httpConnectEncrypt().
1983Otherwise, return the FQDN for the local system using both gethostname()
1984and gethostbyname() to get the local hostname with domain.
ef416fc2 1985
5a738aea
MS
1986</p>
1987<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpGetLength">httpGetLength</a></h3>
1988<p class="description">Get the amount of data remaining from the
1989content-length or transfer-encoding fields.</p>
1990<p class="code">
1991int httpGetLength (<br>
1992&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1993);</p>
1994<h4 class="parameters">Parameters</h4>
1995<dl>
1996<dt>http</dt>
568fa3fa 1997<dd class="description">Connection to server</dd>
5a738aea
MS
1998</dl>
1999<h4 class="returnvalue">Return Value</h4>
2000<p class="description">Content length</p>
2001<h4 class="discussion">Discussion</h4>
2002<p class="discussion">This function is deprecated and will not return lengths larger than
ef416fc2 20032^31 - 1; use httpGetLength2() instead.
2004
5a738aea 2005</p>
426c6a59 2006<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
2007<p class="description">Get the amount of data remaining from the
2008content-length or transfer-encoding fields.</p>
2009<p class="code">
2010off_t httpGetLength2 (<br>
2011&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2012);</p>
2013<h4 class="parameters">Parameters</h4>
2014<dl>
2015<dt>http</dt>
568fa3fa 2016<dd class="description">Connection to server</dd>
5a738aea
MS
2017</dl>
2018<h4 class="returnvalue">Return Value</h4>
2019<p class="description">Content length</p>
2020<h4 class="discussion">Discussion</h4>
2021<p class="discussion">This function returns the complete content length, even for
ecdc0628 2022content larger than 2^31 - 1.
2023
5a738aea 2024</p>
426c6a59 2025<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
2026<p class="description">Get the status of the last HTTP request.</p>
2027<p class="code">
79e1d494 2028<a href="#http_status_t">http_status_t</a> httpGetStatus (<br>
5a738aea
MS
2029&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2030);</p>
2031<h4 class="parameters">Parameters</h4>
2032<dl>
2033<dt>http</dt>
568fa3fa 2034<dd class="description">Connection to server</dd>
5a738aea
MS
2035</dl>
2036<h4 class="returnvalue">Return Value</h4>
2037<p class="description">HTTP status</p>
2038<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpGetSubField">httpGetSubField</a></h3>
2039<p class="description">Get a sub-field value.</p>
2040<p class="code">
2041char *httpGetSubField (<br>
2042&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
79e1d494 2043&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_field_t">http_field_t</a> field,<br>
5a738aea
MS
2044&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2045&nbsp;&nbsp;&nbsp;&nbsp;char *value<br>
2046);</p>
2047<h4 class="parameters">Parameters</h4>
2048<dl>
2049<dt>http</dt>
568fa3fa 2050<dd class="description">Connection to server</dd>
5a738aea
MS
2051<dt>field</dt>
2052<dd class="description">Field index</dd>
2053<dt>name</dt>
2054<dd class="description">Name of sub-field</dd>
2055<dt>value</dt>
2056<dd class="description">Value string</dd>
2057</dl>
2058<h4 class="returnvalue">Return Value</h4>
2059<p class="description">Value or NULL</p>
426c6a59 2060<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
2061<p class="description">Get a sub-field value.</p>
2062<p class="code">
2063char *httpGetSubField2 (<br>
2064&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
79e1d494 2065&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_field_t">http_field_t</a> field,<br>
5a738aea
MS
2066&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2067&nbsp;&nbsp;&nbsp;&nbsp;char *value,<br>
2068&nbsp;&nbsp;&nbsp;&nbsp;int valuelen<br>
2069);</p>
2070<h4 class="parameters">Parameters</h4>
2071<dl>
2072<dt>http</dt>
568fa3fa 2073<dd class="description">Connection to server</dd>
5a738aea
MS
2074<dt>field</dt>
2075<dd class="description">Field index</dd>
2076<dt>name</dt>
2077<dd class="description">Name of sub-field</dd>
2078<dt>value</dt>
2079<dd class="description">Value string</dd>
2080<dt>valuelen</dt>
2081<dd class="description">Size of value buffer</dd>
2082</dl>
2083<h4 class="returnvalue">Return Value</h4>
2084<p class="description">Value or NULL</p>
2085<h3 class="function"><a name="httpGets">httpGets</a></h3>
2086<p class="description">Get a line of text from a HTTP connection.</p>
2087<p class="code">
2088char *httpGets (<br>
2089&nbsp;&nbsp;&nbsp;&nbsp;char *line,<br>
2090&nbsp;&nbsp;&nbsp;&nbsp;int length,<br>
2091&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2092);</p>
2093<h4 class="parameters">Parameters</h4>
2094<dl>
2095<dt>line</dt>
2096<dd class="description">Line to read into</dd>
2097<dt>length</dt>
2098<dd class="description">Max length of buffer</dd>
2099<dt>http</dt>
568fa3fa 2100<dd class="description">Connection to server</dd>
5a738aea
MS
2101</dl>
2102<h4 class="returnvalue">Return Value</h4>
2103<p class="description">Line or NULL</p>
2104<h3 class="function"><a name="httpHead">httpHead</a></h3>
2105<p class="description">Send a HEAD request to the server.</p>
2106<p class="code">
2107int httpHead (<br>
2108&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2109&nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
2110);</p>
2111<h4 class="parameters">Parameters</h4>
2112<dl>
2113<dt>http</dt>
568fa3fa 2114<dd class="description">Connection to server</dd>
5a738aea
MS
2115<dt>uri</dt>
2116<dd class="description">URI for head</dd>
2117</dl>
2118<h4 class="returnvalue">Return Value</h4>
2119<p class="description">Status of call (0 = success)</p>
2120<h3 class="function"><a name="httpInitialize">httpInitialize</a></h3>
2121<p class="description">Initialize the HTTP interface library and set the
2122default HTTP proxy (if any).</p>
2123<p class="code">
2124void httpInitialize (void);</p>
2125<h3 class="function"><a name="httpMD5">httpMD5</a></h3>
2126<p class="description">Compute the MD5 sum of the username:group:password.</p>
2127<p class="code">
2128char *httpMD5 (<br>
2129&nbsp;&nbsp;&nbsp;&nbsp;const char *username,<br>
2130&nbsp;&nbsp;&nbsp;&nbsp;const char *realm,<br>
2131&nbsp;&nbsp;&nbsp;&nbsp;const char *passwd,<br>
2132&nbsp;&nbsp;&nbsp;&nbsp;char md5[33]<br>
2133);</p>
2134<h4 class="parameters">Parameters</h4>
2135<dl>
2136<dt>username</dt>
2137<dd class="description">User name</dd>
2138<dt>realm</dt>
2139<dd class="description">Realm name</dd>
2140<dt>passwd</dt>
2141<dd class="description">Password string</dd>
2142<dt>md5[33]</dt>
2143<dd class="description">MD5 string</dd>
2144</dl>
2145<h4 class="returnvalue">Return Value</h4>
2146<p class="description">MD5 sum</p>
2147<h3 class="function"><a name="httpMD5Final">httpMD5Final</a></h3>
2148<p class="description">Combine the MD5 sum of the username, group, and password
ef416fc2 2149with the server-supplied nonce value, method, and
5a738aea
MS
2150request-uri.</p>
2151<p class="code">
2152char *httpMD5Final (<br>
2153&nbsp;&nbsp;&nbsp;&nbsp;const char *nonce,<br>
2154&nbsp;&nbsp;&nbsp;&nbsp;const char *method,<br>
2155&nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
2156&nbsp;&nbsp;&nbsp;&nbsp;char md5[33]<br>
2157);</p>
2158<h4 class="parameters">Parameters</h4>
2159<dl>
2160<dt>nonce</dt>
2161<dd class="description">Server nonce value</dd>
2162<dt>method</dt>
2163<dd class="description">METHOD (GET, POST, etc.)</dd>
2164<dt>resource</dt>
2165<dd class="description">Resource path</dd>
2166<dt>md5[33]</dt>
2167<dd class="description">MD5 sum</dd>
2168</dl>
2169<h4 class="returnvalue">Return Value</h4>
2170<p class="description">New sum</p>
2171<h3 class="function"><a name="httpMD5String">httpMD5String</a></h3>
2172<p class="description">Convert an MD5 sum to a character string.</p>
2173<p class="code">
2174char *httpMD5String (<br>
2175&nbsp;&nbsp;&nbsp;&nbsp;const unsigned char *sum,<br>
2176&nbsp;&nbsp;&nbsp;&nbsp;char md5[33]<br>
2177);</p>
2178<h4 class="parameters">Parameters</h4>
2179<dl>
2180<dt>sum</dt>
2181<dd class="description">MD5 sum data</dd>
2182<dt>md5[33]</dt>
2183<dd class="description">MD5 sum in hex</dd>
2184</dl>
2185<h4 class="returnvalue">Return Value</h4>
2186<p class="description">MD5 sum in hex</p>
2187<h3 class="function"><a name="httpOptions">httpOptions</a></h3>
2188<p class="description">Send an OPTIONS request to the server.</p>
2189<p class="code">
2190int httpOptions (<br>
2191&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2192&nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
2193);</p>
2194<h4 class="parameters">Parameters</h4>
2195<dl>
2196<dt>http</dt>
568fa3fa 2197<dd class="description">Connection to server</dd>
5a738aea
MS
2198<dt>uri</dt>
2199<dd class="description">URI for options</dd>
2200</dl>
2201<h4 class="returnvalue">Return Value</h4>
2202<p class="description">Status of call (0 = success)</p>
2203<h3 class="function"><a name="httpPost">httpPost</a></h3>
2204<p class="description">Send a POST request to the server.</p>
2205<p class="code">
2206int httpPost (<br>
2207&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2208&nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
2209);</p>
2210<h4 class="parameters">Parameters</h4>
2211<dl>
2212<dt>http</dt>
568fa3fa 2213<dd class="description">Connection to server</dd>
5a738aea
MS
2214<dt>uri</dt>
2215<dd class="description">URI for post</dd>
2216</dl>
2217<h4 class="returnvalue">Return Value</h4>
2218<p class="description">Status of call (0 = success)</p>
2219<h3 class="function"><a name="httpPut">httpPut</a></h3>
2220<p class="description">Send a PUT request to the server.</p>
2221<p class="code">
2222int httpPut (<br>
2223&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2224&nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
2225);</p>
2226<h4 class="parameters">Parameters</h4>
2227<dl>
2228<dt>http</dt>
568fa3fa 2229<dd class="description">Connection to server</dd>
5a738aea
MS
2230<dt>uri</dt>
2231<dd class="description">URI to put</dd>
2232</dl>
2233<h4 class="returnvalue">Return Value</h4>
2234<p class="description">Status of call (0 = success)</p>
2235<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpRead">httpRead</a></h3>
2236<p class="description">Read data from a HTTP connection.</p>
2237<p class="code">
2238int httpRead (<br>
2239&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2240&nbsp;&nbsp;&nbsp;&nbsp;char *buffer,<br>
2241&nbsp;&nbsp;&nbsp;&nbsp;int length<br>
2242);</p>
2243<h4 class="parameters">Parameters</h4>
2244<dl>
2245<dt>http</dt>
568fa3fa 2246<dd class="description">Connection to server</dd>
5a738aea
MS
2247<dt>buffer</dt>
2248<dd class="description">Buffer for data</dd>
2249<dt>length</dt>
2250<dd class="description">Maximum number of bytes</dd>
2251</dl>
2252<h4 class="returnvalue">Return Value</h4>
2253<p class="description">Number of bytes read</p>
2254<h4 class="discussion">Discussion</h4>
2255<p class="discussion">This function is deprecated. Use the httpRead2() function which can
ecdc0628 2256read more than 2GB of data.
2257
5a738aea 2258</p>
426c6a59 2259<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
2260<p class="description">Read data from a HTTP connection.</p>
2261<p class="code">
2262ssize_t httpRead2 (<br>
2263&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2264&nbsp;&nbsp;&nbsp;&nbsp;char *buffer,<br>
2265&nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
2266);</p>
2267<h4 class="parameters">Parameters</h4>
2268<dl>
2269<dt>http</dt>
568fa3fa 2270<dd class="description">Connection to server</dd>
5a738aea
MS
2271<dt>buffer</dt>
2272<dd class="description">Buffer for data</dd>
2273<dt>length</dt>
2274<dd class="description">Maximum number of bytes</dd>
2275</dl>
2276<h4 class="returnvalue">Return Value</h4>
2277<p class="description">Number of bytes read</p>
2278<h3 class="function"><a name="httpReconnect">httpReconnect</a></h3>
2279<p class="description">Reconnect to a HTTP server.</p>
2280<p class="code">
2281int httpReconnect (<br>
2282&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2283);</p>
2284<h4 class="parameters">Parameters</h4>
2285<dl>
2286<dt>http</dt>
568fa3fa 2287<dd class="description">Connection to server</dd>
5a738aea
MS
2288</dl>
2289<h4 class="returnvalue">Return Value</h4>
2290<p class="description">0 on success, non-zero on failure</p>
2291<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpSeparate">httpSeparate</a></h3>
2292<p class="description">Separate a Universal Resource Identifier into its
2293components.</p>
2294<p class="code">
2295void httpSeparate (<br>
2296&nbsp;&nbsp;&nbsp;&nbsp;const char *uri,<br>
2297&nbsp;&nbsp;&nbsp;&nbsp;char *scheme,<br>
2298&nbsp;&nbsp;&nbsp;&nbsp;char *username,<br>
2299&nbsp;&nbsp;&nbsp;&nbsp;char *host,<br>
2300&nbsp;&nbsp;&nbsp;&nbsp;int *port,<br>
2301&nbsp;&nbsp;&nbsp;&nbsp;char *resource<br>
2302);</p>
2303<h4 class="parameters">Parameters</h4>
2304<dl>
2305<dt>uri</dt>
2306<dd class="description">Universal Resource Identifier</dd>
2307<dt>scheme</dt>
2308<dd class="description">Scheme [32] (http, https, etc.)</dd>
2309<dt>username</dt>
2310<dd class="description">Username [1024]</dd>
2311<dt>host</dt>
2312<dd class="description">Hostname [1024]</dd>
2313<dt>port</dt>
2314<dd class="description">Port number to use</dd>
2315<dt>resource</dt>
2316<dd class="description">Resource/filename [1024]</dd>
2317</dl>
2318<h4 class="discussion">Discussion</h4>
2319<p class="discussion">This function is deprecated; use the httpSeparateURI() function instead.
2320
2321</p>
426c6a59 2322<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
2323<p class="description">Separate a Universal Resource Identifier into its
2324components.</p>
2325<p class="code">
2326void httpSeparate2 (<br>
2327&nbsp;&nbsp;&nbsp;&nbsp;const char *uri,<br>
2328&nbsp;&nbsp;&nbsp;&nbsp;char *scheme,<br>
2329&nbsp;&nbsp;&nbsp;&nbsp;int schemelen,<br>
2330&nbsp;&nbsp;&nbsp;&nbsp;char *username,<br>
2331&nbsp;&nbsp;&nbsp;&nbsp;int usernamelen,<br>
2332&nbsp;&nbsp;&nbsp;&nbsp;char *host,<br>
2333&nbsp;&nbsp;&nbsp;&nbsp;int hostlen,<br>
2334&nbsp;&nbsp;&nbsp;&nbsp;int *port,<br>
2335&nbsp;&nbsp;&nbsp;&nbsp;char *resource,<br>
2336&nbsp;&nbsp;&nbsp;&nbsp;int resourcelen<br>
2337);</p>
2338<h4 class="parameters">Parameters</h4>
2339<dl>
2340<dt>uri</dt>
2341<dd class="description">Universal Resource Identifier</dd>
2342<dt>scheme</dt>
2343<dd class="description">Scheme (http, https, etc.)</dd>
2344<dt>schemelen</dt>
2345<dd class="description">Size of scheme buffer</dd>
2346<dt>username</dt>
2347<dd class="description">Username</dd>
2348<dt>usernamelen</dt>
2349<dd class="description">Size of username buffer</dd>
2350<dt>host</dt>
2351<dd class="description">Hostname</dd>
2352<dt>hostlen</dt>
2353<dd class="description">Size of hostname buffer</dd>
2354<dt>port</dt>
2355<dd class="description">Port number to use</dd>
2356<dt>resource</dt>
2357<dd class="description">Resource/filename</dd>
2358<dt>resourcelen</dt>
2359<dd class="description">Size of resource buffer</dd>
2360</dl>
2361<h4 class="discussion">Discussion</h4>
2362<p class="discussion">This function is deprecated; use the httpSeparateURI() function instead.
2363
2364
2365</p>
426c6a59 2366<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
2367<p class="description">Separate a Universal Resource Identifier into its
2368components.</p>
2369<p class="code">
79e1d494
MS
2370<a href="#http_uri_status_t">http_uri_status_t</a> httpSeparateURI (<br>
2371&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_uri_coding_t">http_uri_coding_t</a> decoding,<br>
5a738aea
MS
2372&nbsp;&nbsp;&nbsp;&nbsp;const char *uri,<br>
2373&nbsp;&nbsp;&nbsp;&nbsp;char *scheme,<br>
2374&nbsp;&nbsp;&nbsp;&nbsp;int schemelen,<br>
2375&nbsp;&nbsp;&nbsp;&nbsp;char *username,<br>
2376&nbsp;&nbsp;&nbsp;&nbsp;int usernamelen,<br>
2377&nbsp;&nbsp;&nbsp;&nbsp;char *host,<br>
2378&nbsp;&nbsp;&nbsp;&nbsp;int hostlen,<br>
2379&nbsp;&nbsp;&nbsp;&nbsp;int *port,<br>
2380&nbsp;&nbsp;&nbsp;&nbsp;char *resource,<br>
2381&nbsp;&nbsp;&nbsp;&nbsp;int resourcelen<br>
2382);</p>
2383<h4 class="parameters">Parameters</h4>
2384<dl>
2385<dt>decoding</dt>
2386<dd class="description">Decoding flags</dd>
2387<dt>uri</dt>
2388<dd class="description">Universal Resource Identifier</dd>
2389<dt>scheme</dt>
2390<dd class="description">Scheme (http, https, etc.)</dd>
2391<dt>schemelen</dt>
2392<dd class="description">Size of scheme buffer</dd>
2393<dt>username</dt>
2394<dd class="description">Username</dd>
2395<dt>usernamelen</dt>
2396<dd class="description">Size of username buffer</dd>
2397<dt>host</dt>
2398<dd class="description">Hostname</dd>
2399<dt>hostlen</dt>
2400<dd class="description">Size of hostname buffer</dd>
2401<dt>port</dt>
2402<dd class="description">Port number to use</dd>
2403<dt>resource</dt>
2404<dd class="description">Resource/filename</dd>
2405<dt>resourcelen</dt>
2406<dd class="description">Size of resource buffer</dd>
2407</dl>
2408<h4 class="returnvalue">Return Value</h4>
2409<p class="description">Result of separation</p>
426c6a59 2410<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
2411<p class="description">Set the current authorization string.</p>
2412<p class="code">
2413void httpSetAuthString (<br>
2414&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2415&nbsp;&nbsp;&nbsp;&nbsp;const char *scheme,<br>
2416&nbsp;&nbsp;&nbsp;&nbsp;const char *data<br>
2417);</p>
2418<h4 class="parameters">Parameters</h4>
2419<dl>
2420<dt>http</dt>
568fa3fa 2421<dd class="description">Connection to server</dd>
5a738aea
MS
2422<dt>scheme</dt>
2423<dd class="description">Auth scheme (NULL to clear it)</dd>
2424<dt>data</dt>
2425<dd class="description">Auth data (NULL for none)</dd>
2426</dl>
2427<h4 class="discussion">Discussion</h4>
2428<p class="discussion">This function just stores a copy of the current authorization string in
355e94dc
MS
2429the HTTP connection object. You must still call httpSetField() to set
2430HTTP_FIELD_AUTHORIZATION prior to issuing a HTTP request using httpGet(),
2431httpHead(), httpOptions(), httpPost, or httpPut().
2432
5a738aea 2433</p>
426c6a59 2434<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 2435<p class="description">Set the cookie value(s).</p>
5a738aea
MS
2436<p class="code">
2437void httpSetCookie (<br>
2438&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2439&nbsp;&nbsp;&nbsp;&nbsp;const char *cookie<br>
2440);</p>
2441<h4 class="parameters">Parameters</h4>
2442<dl>
2443<dt>http</dt>
2444<dd class="description">Connection</dd>
2445<dt>cookie</dt>
2446<dd class="description">Cookie string</dd>
2447</dl>
10d09e33
MS
2448<h3 class="function"><span class="info">&nbsp;CUPS 1.5&nbsp;</span><a name="httpSetCredentials">httpSetCredentials</a></h3>
2449<p class="description">Set the credentials associated with an encrypted
2450connection.</p>
2451<p class="code">
2452int httpSetCredentials (<br>
2453&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2454&nbsp;&nbsp;&nbsp;&nbsp;cups_array_t *credentials<br>
2455);</p>
2456<h4 class="parameters">Parameters</h4>
2457<dl>
2458<dt>http</dt>
2459<dd class="description">Connection to server</dd>
2460<dt>credentials</dt>
2461<dd class="description">Array of credentials</dd>
2462</dl>
2463<h4 class="returnvalue">Return Value</h4>
2464<p class="description">Status of call (0 = success)</p>
426c6a59 2465<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
2466<p class="description">Set the Expect: header in a request.</p>
2467<p class="code">
2468void httpSetExpect (<br>
2469&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
79e1d494 2470&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_status_t">http_status_t</a> expect<br>
5a738aea
MS
2471);</p>
2472<h4 class="parameters">Parameters</h4>
2473<dl>
2474<dt>http</dt>
568fa3fa 2475<dd class="description">Connection to server</dd>
5a738aea
MS
2476<dt>expect</dt>
2477<dd class="description">HTTP status to expect (HTTP_CONTINUE)</dd>
2478</dl>
2479<h4 class="discussion">Discussion</h4>
2480<p class="discussion">Currently only HTTP_CONTINUE is supported for the &quot;expect&quot; argument.
2481
2482</p>
2483<h3 class="function"><a name="httpSetField">httpSetField</a></h3>
2484<p class="description">Set the value of an HTTP header.</p>
2485<p class="code">
2486void httpSetField (<br>
2487&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
79e1d494 2488&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_field_t">http_field_t</a> field,<br>
5a738aea
MS
2489&nbsp;&nbsp;&nbsp;&nbsp;const char *value<br>
2490);</p>
2491<h4 class="parameters">Parameters</h4>
2492<dl>
2493<dt>http</dt>
568fa3fa 2494<dd class="description">Connection to server</dd>
5a738aea
MS
2495<dt>field</dt>
2496<dd class="description">Field index</dd>
2497<dt>value</dt>
2498<dd class="description">Value</dd>
2499</dl>
426c6a59 2500<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
2501<p class="description">Set the content-length and content-encoding.</p>
2502<p class="code">
2503void httpSetLength (<br>
2504&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2505&nbsp;&nbsp;&nbsp;&nbsp;size_t length<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>length</dt>
2512<dd class="description">Length (0 for chunked)</dd>
2513</dl>
2514<h3 class="function"><a name="httpStatus">httpStatus</a></h3>
2515<p class="description">Return a short string describing a HTTP status code.</p>
2516<p class="code">
2517const char *httpStatus (<br>
79e1d494 2518&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_status_t">http_status_t</a> status<br>
5a738aea
MS
2519);</p>
2520<h4 class="parameters">Parameters</h4>
2521<dl>
2522<dt>status</dt>
2523<dd class="description">HTTP status code</dd>
2524</dl>
2525<h4 class="returnvalue">Return Value</h4>
06d4e77b
MS
2526<p class="description">Localized status string</p>
2527<h4 class="discussion">Discussion</h4>
2528<p class="discussion">The returned string is localized to the current POSIX locale and is based
2529on the status strings defined in RFC 2616.</p>
5a738aea
MS
2530<h3 class="function"><a name="httpTrace">httpTrace</a></h3>
2531<p class="description">Send an TRACE request to the server.</p>
2532<p class="code">
2533int httpTrace (<br>
2534&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2535&nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
2536);</p>
2537<h4 class="parameters">Parameters</h4>
2538<dl>
2539<dt>http</dt>
568fa3fa 2540<dd class="description">Connection to server</dd>
5a738aea
MS
2541<dt>uri</dt>
2542<dd class="description">URI for trace</dd>
2543</dl>
2544<h4 class="returnvalue">Return Value</h4>
2545<p class="description">Status of call (0 = success)</p>
2546<h3 class="function"><a name="httpUpdate">httpUpdate</a></h3>
2547<p class="description">Update the current HTTP state for incoming data.</p>
2548<p class="code">
79e1d494 2549<a href="#http_status_t">http_status_t</a> httpUpdate (<br>
5a738aea
MS
2550&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2551);</p>
2552<h4 class="parameters">Parameters</h4>
2553<dl>
2554<dt>http</dt>
568fa3fa 2555<dd class="description">Connection to server</dd>
5a738aea
MS
2556</dl>
2557<h4 class="returnvalue">Return Value</h4>
2558<p class="description">HTTP status</p>
426c6a59 2559<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
2560<p class="description">Wait for data available on a connection.</p>
2561<p class="code">
2562int httpWait (<br>
2563&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2564&nbsp;&nbsp;&nbsp;&nbsp;int msec<br>
2565);</p>
2566<h4 class="parameters">Parameters</h4>
2567<dl>
2568<dt>http</dt>
568fa3fa 2569<dd class="description">Connection to server</dd>
5a738aea
MS
2570<dt>msec</dt>
2571<dd class="description">Milliseconds to wait</dd>
2572</dl>
2573<h4 class="returnvalue">Return Value</h4>
2574<p class="description">1 if data is available, 0 otherwise</p>
2575<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpWrite">httpWrite</a></h3>
2576<p class="description">Write data to a HTTP connection.</p>
2577<p class="code">
2578int httpWrite (<br>
2579&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2580&nbsp;&nbsp;&nbsp;&nbsp;const char *buffer,<br>
2581&nbsp;&nbsp;&nbsp;&nbsp;int length<br>
2582);</p>
2583<h4 class="parameters">Parameters</h4>
2584<dl>
2585<dt>http</dt>
568fa3fa 2586<dd class="description">Connection to server</dd>
5a738aea
MS
2587<dt>buffer</dt>
2588<dd class="description">Buffer for data</dd>
2589<dt>length</dt>
2590<dd class="description">Number of bytes to write</dd>
2591</dl>
2592<h4 class="returnvalue">Return Value</h4>
2593<p class="description">Number of bytes written</p>
2594<h4 class="discussion">Discussion</h4>
2595<p class="discussion">This function is deprecated. Use the httpWrite2() function which can
ecdc0628 2596write more than 2GB of data.
2597
5a738aea 2598</p>
426c6a59 2599<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
2600<p class="description">Write data to a HTTP connection.</p>
2601<p class="code">
2602ssize_t httpWrite2 (<br>
2603&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2604&nbsp;&nbsp;&nbsp;&nbsp;const char *buffer,<br>
2605&nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
2606);</p>
2607<h4 class="parameters">Parameters</h4>
2608<dl>
2609<dt>http</dt>
568fa3fa 2610<dd class="description">Connection to server</dd>
5a738aea
MS
2611<dt>buffer</dt>
2612<dd class="description">Buffer for data</dd>
2613<dt>length</dt>
2614<dd class="description">Number of bytes to write</dd>
2615</dl>
2616<h4 class="returnvalue">Return Value</h4>
2617<p class="description">Number of bytes written</p>
2618<h3 class="function"><a name="ippAddBoolean">ippAddBoolean</a></h3>
2619<p class="description">Add a boolean attribute to an IPP message.</p>
2620<p class="code">
2621<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBoolean (<br>
2622&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
79e1d494 2623&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> group,<br>
5a738aea
MS
2624&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2625&nbsp;&nbsp;&nbsp;&nbsp;char value<br>
2626);</p>
2627<h4 class="parameters">Parameters</h4>
2628<dl>
2629<dt>ipp</dt>
2630<dd class="description">IPP message</dd>
2631<dt>group</dt>
2632<dd class="description">IPP group</dd>
2633<dt>name</dt>
2634<dd class="description">Name of attribute</dd>
2635<dt>value</dt>
2636<dd class="description">Value of attribute</dd>
2637</dl>
2638<h4 class="returnvalue">Return Value</h4>
2639<p class="description">New attribute</p>
2640<h3 class="function"><a name="ippAddBooleans">ippAddBooleans</a></h3>
2641<p class="description">Add an array of boolean values.</p>
2642<p class="code">
2643<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBooleans (<br>
2644&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
79e1d494 2645&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> group,<br>
5a738aea
MS
2646&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2647&nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
2648&nbsp;&nbsp;&nbsp;&nbsp;const char *values<br>
2649);</p>
2650<h4 class="parameters">Parameters</h4>
2651<dl>
2652<dt>ipp</dt>
2653<dd class="description">IPP message</dd>
2654<dt>group</dt>
2655<dd class="description">IPP group</dd>
2656<dt>name</dt>
2657<dd class="description">Name of attribute</dd>
2658<dt>num_values</dt>
2659<dd class="description">Number of values</dd>
2660<dt>values</dt>
2661<dd class="description">Values</dd>
2662</dl>
2663<h4 class="returnvalue">Return Value</h4>
2664<p class="description">New attribute</p>
426c6a59 2665<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
2666<p class="description">Add a collection value.</p>
2667<p class="code">
2668<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollection (<br>
2669&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
79e1d494 2670&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> group,<br>
5a738aea
MS
2671&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2672&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *value<br>
2673);</p>
2674<h4 class="parameters">Parameters</h4>
2675<dl>
2676<dt>ipp</dt>
2677<dd class="description">IPP message</dd>
2678<dt>group</dt>
2679<dd class="description">IPP group</dd>
2680<dt>name</dt>
2681<dd class="description">Name of attribute</dd>
2682<dt>value</dt>
2683<dd class="description">Value</dd>
2684</dl>
2685<h4 class="returnvalue">Return Value</h4>
2686<p class="description">New attribute</p>
426c6a59 2687<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
2688<p class="description">Add an array of collection values.</p>
2689<p class="code">
2690<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollections (<br>
2691&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
79e1d494 2692&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> group,<br>
5a738aea
MS
2693&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2694&nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
2695&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#ipp_t">ipp_t</a> **values<br>
2696);</p>
2697<h4 class="parameters">Parameters</h4>
2698<dl>
2699<dt>ipp</dt>
2700<dd class="description">IPP message</dd>
2701<dt>group</dt>
2702<dd class="description">IPP group</dd>
2703<dt>name</dt>
2704<dd class="description">Name of attribute</dd>
2705<dt>num_values</dt>
2706<dd class="description">Number of values</dd>
2707<dt>values</dt>
2708<dd class="description">Values</dd>
2709</dl>
2710<h4 class="returnvalue">Return Value</h4>
2711<p class="description">New attribute</p>
2712<h3 class="function"><a name="ippAddDate">ippAddDate</a></h3>
2713<p class="description">Add a date attribute to an IPP message.</p>
2714<p class="code">
2715<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddDate (<br>
2716&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
79e1d494 2717&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> group,<br>
5a738aea
MS
2718&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2719&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#ipp_uchar_t">ipp_uchar_t</a> *value<br>
2720);</p>
2721<h4 class="parameters">Parameters</h4>
2722<dl>
2723<dt>ipp</dt>
2724<dd class="description">IPP message</dd>
2725<dt>group</dt>
2726<dd class="description">IPP group</dd>
2727<dt>name</dt>
2728<dd class="description">Name of attribute</dd>
2729<dt>value</dt>
2730<dd class="description">Value</dd>
2731</dl>
2732<h4 class="returnvalue">Return Value</h4>
2733<p class="description">New attribute</p>
2734<h3 class="function"><a name="ippAddInteger">ippAddInteger</a></h3>
2735<p class="description">Add a integer attribute to an IPP message.</p>
2736<p class="code">
2737<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddInteger (<br>
2738&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
79e1d494
MS
2739&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> group,<br>
2740&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> type,<br>
5a738aea
MS
2741&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2742&nbsp;&nbsp;&nbsp;&nbsp;int value<br>
2743);</p>
2744<h4 class="parameters">Parameters</h4>
2745<dl>
2746<dt>ipp</dt>
2747<dd class="description">IPP message</dd>
2748<dt>group</dt>
2749<dd class="description">IPP group</dd>
2750<dt>type</dt>
2751<dd class="description">Type of attribute</dd>
2752<dt>name</dt>
2753<dd class="description">Name of attribute</dd>
2754<dt>value</dt>
2755<dd class="description">Value of attribute</dd>
2756</dl>
2757<h4 class="returnvalue">Return Value</h4>
2758<p class="description">New attribute</p>
2759<h3 class="function"><a name="ippAddIntegers">ippAddIntegers</a></h3>
2760<p class="description">Add an array of integer values.</p>
2761<p class="code">
2762<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddIntegers (<br>
2763&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
79e1d494
MS
2764&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> group,<br>
2765&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> type,<br>
5a738aea
MS
2766&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2767&nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
2768&nbsp;&nbsp;&nbsp;&nbsp;const int *values<br>
2769);</p>
2770<h4 class="parameters">Parameters</h4>
2771<dl>
2772<dt>ipp</dt>
2773<dd class="description">IPP message</dd>
2774<dt>group</dt>
2775<dd class="description">IPP group</dd>
2776<dt>type</dt>
2777<dd class="description">Type of attribute</dd>
2778<dt>name</dt>
2779<dd class="description">Name of attribute</dd>
2780<dt>num_values</dt>
2781<dd class="description">Number of values</dd>
2782<dt>values</dt>
2783<dd class="description">Values</dd>
2784</dl>
2785<h4 class="returnvalue">Return Value</h4>
2786<p class="description">New attribute</p>
426c6a59 2787<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
2788<p class="description">Add an octetString value to an IPP message.</p>
2789<p class="code">
2790<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOctetString (<br>
2791&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
79e1d494 2792&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> group,<br>
5a738aea
MS
2793&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2794&nbsp;&nbsp;&nbsp;&nbsp;const void *data,<br>
2795&nbsp;&nbsp;&nbsp;&nbsp;int datalen<br>
2796);</p>
2797<h4 class="parameters">Parameters</h4>
2798<dl>
2799<dt>ipp</dt>
2800<dd class="description">IPP message</dd>
2801<dt>group</dt>
2802<dd class="description">IPP group</dd>
2803<dt>name</dt>
2804<dd class="description">Name of attribute</dd>
2805<dt>data</dt>
2806<dd class="description">octetString data</dd>
2807<dt>datalen</dt>
2808<dd class="description">Length of data in bytes</dd>
2809</dl>
2810<h4 class="returnvalue">Return Value</h4>
2811<p class="description">New attribute</p>
2812<h3 class="function"><a name="ippAddRange">ippAddRange</a></h3>
2813<p class="description">Add a range of values to an IPP message.</p>
2814<p class="code">
2815<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRange (<br>
2816&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
79e1d494 2817&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> group,<br>
5a738aea
MS
2818&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2819&nbsp;&nbsp;&nbsp;&nbsp;int lower,<br>
2820&nbsp;&nbsp;&nbsp;&nbsp;int upper<br>
2821);</p>
2822<h4 class="parameters">Parameters</h4>
2823<dl>
2824<dt>ipp</dt>
2825<dd class="description">IPP message</dd>
2826<dt>group</dt>
2827<dd class="description">IPP group</dd>
2828<dt>name</dt>
2829<dd class="description">Name of attribute</dd>
2830<dt>lower</dt>
2831<dd class="description">Lower value</dd>
2832<dt>upper</dt>
2833<dd class="description">Upper value</dd>
2834</dl>
2835<h4 class="returnvalue">Return Value</h4>
2836<p class="description">New attribute</p>
2837<h3 class="function"><a name="ippAddRanges">ippAddRanges</a></h3>
2838<p class="description">Add ranges of values to an IPP message.</p>
2839<p class="code">
2840<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRanges (<br>
2841&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
79e1d494 2842&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> group,<br>
5a738aea
MS
2843&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2844&nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
2845&nbsp;&nbsp;&nbsp;&nbsp;const int *lower,<br>
2846&nbsp;&nbsp;&nbsp;&nbsp;const int *upper<br>
2847);</p>
2848<h4 class="parameters">Parameters</h4>
2849<dl>
2850<dt>ipp</dt>
2851<dd class="description">IPP message</dd>
2852<dt>group</dt>
2853<dd class="description">IPP group</dd>
2854<dt>name</dt>
2855<dd class="description">Name of attribute</dd>
2856<dt>num_values</dt>
2857<dd class="description">Number of values</dd>
2858<dt>lower</dt>
2859<dd class="description">Lower values</dd>
2860<dt>upper</dt>
2861<dd class="description">Upper values</dd>
2862</dl>
2863<h4 class="returnvalue">Return Value</h4>
2864<p class="description">New attribute</p>
2865<h3 class="function"><a name="ippAddResolution">ippAddResolution</a></h3>
2866<p class="description">Add a resolution value to an IPP message.</p>
2867<p class="code">
2868<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolution (<br>
2869&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
79e1d494 2870&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> group,<br>
5a738aea 2871&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
79e1d494 2872&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_res_t">ipp_res_t</a> units,<br>
5a738aea
MS
2873&nbsp;&nbsp;&nbsp;&nbsp;int xres,<br>
2874&nbsp;&nbsp;&nbsp;&nbsp;int yres<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>units</dt>
2885<dd class="description">Units for resolution</dd>
2886<dt>xres</dt>
2887<dd class="description">X resolution</dd>
2888<dt>yres</dt>
2889<dd class="description">Y resolution</dd>
2890</dl>
2891<h4 class="returnvalue">Return Value</h4>
2892<p class="description">New attribute</p>
2893<h3 class="function"><a name="ippAddResolutions">ippAddResolutions</a></h3>
2894<p class="description">Add resolution values to an IPP message.</p>
2895<p class="code">
2896<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolutions (<br>
2897&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
79e1d494 2898&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> group,<br>
5a738aea
MS
2899&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2900&nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
79e1d494 2901&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_res_t">ipp_res_t</a> units,<br>
5a738aea
MS
2902&nbsp;&nbsp;&nbsp;&nbsp;const int *xres,<br>
2903&nbsp;&nbsp;&nbsp;&nbsp;const int *yres<br>
2904);</p>
2905<h4 class="parameters">Parameters</h4>
2906<dl>
2907<dt>ipp</dt>
2908<dd class="description">IPP message</dd>
2909<dt>group</dt>
2910<dd class="description">IPP group</dd>
2911<dt>name</dt>
2912<dd class="description">Name of attribute</dd>
2913<dt>num_values</dt>
2914<dd class="description">Number of values</dd>
2915<dt>units</dt>
2916<dd class="description">Units for resolution</dd>
2917<dt>xres</dt>
2918<dd class="description">X resolutions</dd>
2919<dt>yres</dt>
2920<dd class="description">Y resolutions</dd>
2921</dl>
2922<h4 class="returnvalue">Return Value</h4>
2923<p class="description">New attribute</p>
2924<h3 class="function"><a name="ippAddSeparator">ippAddSeparator</a></h3>
2925<p class="description">Add a group separator to an IPP message.</p>
2926<p class="code">
2927<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddSeparator (<br>
2928&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
2929);</p>
2930<h4 class="parameters">Parameters</h4>
2931<dl>
2932<dt>ipp</dt>
2933<dd class="description">IPP message</dd>
2934</dl>
2935<h4 class="returnvalue">Return Value</h4>
2936<p class="description">New attribute</p>
2937<h3 class="function"><a name="ippAddString">ippAddString</a></h3>
2938<p class="description">Add a language-encoded string to an IPP message.</p>
2939<p class="code">
2940<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddString (<br>
2941&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
79e1d494
MS
2942&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> group,<br>
2943&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> type,<br>
5a738aea
MS
2944&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2945&nbsp;&nbsp;&nbsp;&nbsp;const char *charset,<br>
2946&nbsp;&nbsp;&nbsp;&nbsp;const char *value<br>
2947);</p>
2948<h4 class="parameters">Parameters</h4>
2949<dl>
2950<dt>ipp</dt>
2951<dd class="description">IPP message</dd>
2952<dt>group</dt>
2953<dd class="description">IPP group</dd>
2954<dt>type</dt>
2955<dd class="description">Type of attribute</dd>
2956<dt>name</dt>
2957<dd class="description">Name of attribute</dd>
2958<dt>charset</dt>
2959<dd class="description">Character set</dd>
2960<dt>value</dt>
2961<dd class="description">Value</dd>
2962</dl>
2963<h4 class="returnvalue">Return Value</h4>
2964<p class="description">New attribute</p>
2965<h3 class="function"><a name="ippAddStrings">ippAddStrings</a></h3>
2966<p class="description">Add language-encoded strings to an IPP message.</p>
2967<p class="code">
2968<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStrings (<br>
2969&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
79e1d494
MS
2970&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> group,<br>
2971&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> type,<br>
5a738aea
MS
2972&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2973&nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
2974&nbsp;&nbsp;&nbsp;&nbsp;const char *charset,<br>
2975&nbsp;&nbsp;&nbsp;&nbsp;const char *const *values<br>
2976);</p>
2977<h4 class="parameters">Parameters</h4>
2978<dl>
2979<dt>ipp</dt>
2980<dd class="description">IPP message</dd>
2981<dt>group</dt>
2982<dd class="description">IPP group</dd>
2983<dt>type</dt>
2984<dd class="description">Type of attribute</dd>
2985<dt>name</dt>
2986<dd class="description">Name of attribute</dd>
2987<dt>num_values</dt>
2988<dd class="description">Number of values</dd>
2989<dt>charset</dt>
2990<dd class="description">Character set</dd>
2991<dt>values</dt>
2992<dd class="description">Values</dd>
2993</dl>
2994<h4 class="returnvalue">Return Value</h4>
2995<p class="description">New attribute</p>
2996<h3 class="function"><a name="ippDateToTime">ippDateToTime</a></h3>
2997<p class="description">Convert from RFC 1903 Date/Time format to UNIX time
2998in seconds.</p>
2999<p class="code">
3000time_t ippDateToTime (<br>
3001&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#ipp_uchar_t">ipp_uchar_t</a> *date<br>
3002);</p>
3003<h4 class="parameters">Parameters</h4>
3004<dl>
3005<dt>date</dt>
3006<dd class="description">RFC 1903 date info</dd>
3007</dl>
3008<h4 class="returnvalue">Return Value</h4>
3009<p class="description">UNIX time value</p>
3010<h3 class="function"><a name="ippDelete">ippDelete</a></h3>
3011<p class="description">Delete an IPP message.</p>
3012<p class="code">
3013void ippDelete (<br>
3014&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3015);</p>
3016<h4 class="parameters">Parameters</h4>
3017<dl>
3018<dt>ipp</dt>
3019<dd class="description">IPP message</dd>
3020</dl>
426c6a59 3021<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
3022<p class="description">Delete a single attribute in an IPP message.</p>
3023<p class="code">
3024void ippDeleteAttribute (<br>
3025&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3026&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
3027);</p>
3028<h4 class="parameters">Parameters</h4>
3029<dl>
3030<dt>ipp</dt>
3031<dd class="description">IPP message</dd>
3032<dt>attr</dt>
3033<dd class="description">Attribute to delete</dd>
3034</dl>
3035<h3 class="function"><a name="ippErrorString">ippErrorString</a></h3>
3036<p class="description">Return a name for the given status code.</p>
3037<p class="code">
3038const char *ippErrorString (<br>
3039&nbsp;&nbsp;&nbsp;&nbsp;ipp_status_t error<br>
3040);</p>
3041<h4 class="parameters">Parameters</h4>
3042<dl>
3043<dt>error</dt>
3044<dd class="description">Error status</dd>
3045</dl>
3046<h4 class="returnvalue">Return Value</h4>
3047<p class="description">Text string</p>
426c6a59 3048<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
3049<p class="description">Return a status code for the given name.</p>
3050<p class="code">
3051ipp_status_t ippErrorValue (<br>
3052&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
3053);</p>
3054<h4 class="parameters">Parameters</h4>
3055<dl>
3056<dt>name</dt>
3057<dd class="description">Name</dd>
3058</dl>
3059<h4 class="returnvalue">Return Value</h4>
3060<p class="description">IPP status code</p>
3061<h3 class="function"><a name="ippFindAttribute">ippFindAttribute</a></h3>
3062<p class="description">Find a named attribute in a request...</p>
3063<p class="code">
3064<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindAttribute (<br>
3065&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3066&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
79e1d494 3067&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> type<br>
5a738aea
MS
3068);</p>
3069<h4 class="parameters">Parameters</h4>
3070<dl>
3071<dt>ipp</dt>
3072<dd class="description">IPP message</dd>
3073<dt>name</dt>
3074<dd class="description">Name of attribute</dd>
3075<dt>type</dt>
3076<dd class="description">Type of attribute</dd>
3077</dl>
3078<h4 class="returnvalue">Return Value</h4>
3079<p class="description">Matching attribute</p>
3080<h3 class="function"><a name="ippFindNextAttribute">ippFindNextAttribute</a></h3>
3081<p class="description">Find the next named attribute in a request...</p>
3082<p class="code">
3083<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindNextAttribute (<br>
3084&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3085&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
79e1d494 3086&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> type<br>
5a738aea
MS
3087);</p>
3088<h4 class="parameters">Parameters</h4>
3089<dl>
3090<dt>ipp</dt>
3091<dd class="description">IPP message</dd>
3092<dt>name</dt>
3093<dd class="description">Name of attribute</dd>
3094<dt>type</dt>
3095<dd class="description">Type of attribute</dd>
3096</dl>
3097<h4 class="returnvalue">Return Value</h4>
3098<p class="description">Matching attribute</p>
3099<h3 class="function"><a name="ippLength">ippLength</a></h3>
3100<p class="description">Compute the length of an IPP message.</p>
3101<p class="code">
3102size_t ippLength (<br>
3103&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3104);</p>
3105<h4 class="parameters">Parameters</h4>
3106<dl>
3107<dt>ipp</dt>
3108<dd class="description">IPP message</dd>
3109</dl>
3110<h4 class="returnvalue">Return Value</h4>
3111<p class="description">Size of IPP message</p>
3112<h3 class="function"><a name="ippNew">ippNew</a></h3>
3113<p class="description">Allocate a new IPP message.</p>
3114<p class="code">
3115<a href="#ipp_t">ipp_t</a> *ippNew (void);</p>
3116<h4 class="returnvalue">Return Value</h4>
3117<p class="description">New IPP message</p>
426c6a59 3118<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ippNewRequest">ippNewRequest</a></h3>
5a738aea
MS
3119<p class="description">Allocate a new IPP request message.</p>
3120<p class="code">
3121<a href="#ipp_t">ipp_t</a> *ippNewRequest (<br>
79e1d494 3122&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_op_t">ipp_op_t</a> op<br>
5a738aea
MS
3123);</p>
3124<h4 class="parameters">Parameters</h4>
3125<dl>
3126<dt>op</dt>
3127<dd class="description">Operation code</dd>
3128</dl>
3129<h4 class="returnvalue">Return Value</h4>
3130<p class="description">IPP request message</p>
3131<h4 class="discussion">Discussion</h4>
3132<p class="discussion">The new request message is initialized with the attributes-charset and
ecdc0628 3133attributes-natural-language attributes added. The
3134attributes-natural-language value is derived from the current locale.
3135
5a738aea 3136</p>
426c6a59 3137<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ippOpString">ippOpString</a></h3>
5a738aea
MS
3138<p class="description">Return a name for the given operation id.</p>
3139<p class="code">
3140const char *ippOpString (<br>
79e1d494 3141&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_op_t">ipp_op_t</a> op<br>
5a738aea
MS
3142);</p>
3143<h4 class="parameters">Parameters</h4>
3144<dl>
3145<dt>op</dt>
3146<dd class="description">Operation ID</dd>
3147</dl>
3148<h4 class="returnvalue">Return Value</h4>
3149<p class="description">Name</p>
426c6a59 3150<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ippOpValue">ippOpValue</a></h3>
5a738aea
MS
3151<p class="description">Return an operation id for the given name.</p>
3152<p class="code">
79e1d494 3153<a href="#ipp_op_t">ipp_op_t</a> ippOpValue (<br>
5a738aea
MS
3154&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
3155);</p>
3156<h4 class="parameters">Parameters</h4>
3157<dl>
3158<dt>name</dt>
3159<dd class="description">Textual name</dd>
3160</dl>
3161<h4 class="returnvalue">Return Value</h4>
3162<p class="description">Operation ID</p>
3163<h3 class="function"><a name="ippPort">ippPort</a></h3>
3164<p class="description">Return the default IPP port number.</p>
3165<p class="code">
3166int ippPort (void);</p>
3167<h4 class="returnvalue">Return Value</h4>
3168<p class="description">Port number</p>
3169<h3 class="function"><a name="ippRead">ippRead</a></h3>
3170<p class="description">Read data for an IPP message from a HTTP connection.</p>
3171<p class="code">
79e1d494 3172<a href="#ipp_state_t">ipp_state_t</a> ippRead (<br>
5a738aea
MS
3173&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
3174&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3175);</p>
3176<h4 class="parameters">Parameters</h4>
3177<dl>
3178<dt>http</dt>
3179<dd class="description">HTTP connection</dd>
3180<dt>ipp</dt>
3181<dd class="description">IPP data</dd>
3182</dl>
3183<h4 class="returnvalue">Return Value</h4>
3184<p class="description">Current state</p>
426c6a59 3185<h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span><a name="ippReadFile">ippReadFile</a></h3>
5a738aea
MS
3186<p class="description">Read data for an IPP message from a file.</p>
3187<p class="code">
79e1d494 3188<a href="#ipp_state_t">ipp_state_t</a> ippReadFile (<br>
5a738aea
MS
3189&nbsp;&nbsp;&nbsp;&nbsp;int fd,<br>
3190&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3191);</p>
3192<h4 class="parameters">Parameters</h4>
3193<dl>
3194<dt>fd</dt>
3195<dd class="description">HTTP data</dd>
3196<dt>ipp</dt>
3197<dd class="description">IPP data</dd>
3198</dl>
3199<h4 class="returnvalue">Return Value</h4>
3200<p class="description">Current state</p>
426c6a59 3201<h3 class="function"><span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span><a name="ippReadIO">ippReadIO</a></h3>
5a738aea
MS
3202<p class="description">Read data for an IPP message.</p>
3203<p class="code">
79e1d494 3204<a href="#ipp_state_t">ipp_state_t</a> ippReadIO (<br>
5a738aea
MS
3205&nbsp;&nbsp;&nbsp;&nbsp;void *src,<br>
3206&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_iocb_t">ipp_iocb_t</a> cb,<br>
3207&nbsp;&nbsp;&nbsp;&nbsp;int blocking,<br>
3208&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *parent,<br>
3209&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3210);</p>
3211<h4 class="parameters">Parameters</h4>
3212<dl>
3213<dt>src</dt>
3214<dd class="description">Data source</dd>
3215<dt>cb</dt>
3216<dd class="description">Read callback function</dd>
3217<dt>blocking</dt>
3218<dd class="description">Use blocking IO?</dd>
3219<dt>parent</dt>
3220<dd class="description">Parent request, if any</dd>
3221<dt>ipp</dt>
3222<dd class="description">IPP data</dd>
3223</dl>
3224<h4 class="returnvalue">Return Value</h4>
3225<p class="description">Current state</p>
3226<h3 class="function"><a name="ippSetPort">ippSetPort</a></h3>
3227<p class="description">Set the default port number.</p>
3228<p class="code">
3229void ippSetPort (<br>
3230&nbsp;&nbsp;&nbsp;&nbsp;int p<br>
3231);</p>
3232<h4 class="parameters">Parameters</h4>
3233<dl>
3234<dt>p</dt>
3235<dd class="description">Port number to use</dd>
3236</dl>
178cb736 3237<h3 class="function"><span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span><a name="ippTagString">ippTagString</a></h3>
06d4e77b
MS
3238<p class="description">Return the tag name corresponding to a tag value.</p>
3239<p class="code">
3240const char *ippTagString (<br>
3241&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> tag<br>
3242);</p>
3243<h4 class="parameters">Parameters</h4>
3244<dl>
3245<dt>tag</dt>
3246<dd class="description">Tag value</dd>
3247</dl>
3248<h4 class="returnvalue">Return Value</h4>
3249<p class="description">Tag name</p>
3250<h4 class="discussion">Discussion</h4>
3251<p class="discussion">The returned names are defined in RFC 2911 and 3382.
3252
3253</p>
178cb736 3254<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
3255<p class="description">Return the tag value corresponding to a tag name.</p>
3256<p class="code">
3257<a href="#ipp_tag_t">ipp_tag_t</a> ippTagValue (<br>
3258&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
3259);</p>
3260<h4 class="parameters">Parameters</h4>
3261<dl>
3262<dt>name</dt>
3263<dd class="description">Tag name</dd>
3264</dl>
3265<h4 class="returnvalue">Return Value</h4>
3266<p class="description">Tag value</p>
3267<h4 class="discussion">Discussion</h4>
3268<p class="discussion">The tag names are defined in RFC 2911 and 3382.
3269
3270</p>
5a738aea
MS
3271<h3 class="function"><a name="ippTimeToDate">ippTimeToDate</a></h3>
3272<p class="description">Convert from UNIX time to RFC 1903 format.</p>
3273<p class="code">
3274const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippTimeToDate (<br>
3275&nbsp;&nbsp;&nbsp;&nbsp;time_t t<br>
3276);</p>
3277<h4 class="parameters">Parameters</h4>
3278<dl>
3279<dt>t</dt>
3280<dd class="description">UNIX time value</dd>
3281</dl>
3282<h4 class="returnvalue">Return Value</h4>
3283<p class="description">RFC-1903 date/time data</p>
3284<h3 class="function"><a name="ippWrite">ippWrite</a></h3>
3285<p class="description">Write data for an IPP message to a HTTP connection.</p>
3286<p class="code">
79e1d494 3287<a href="#ipp_state_t">ipp_state_t</a> ippWrite (<br>
5a738aea
MS
3288&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
3289&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3290);</p>
3291<h4 class="parameters">Parameters</h4>
3292<dl>
3293<dt>http</dt>
3294<dd class="description">HTTP connection</dd>
3295<dt>ipp</dt>
3296<dd class="description">IPP data</dd>
3297</dl>
3298<h4 class="returnvalue">Return Value</h4>
3299<p class="description">Current state</p>
426c6a59 3300<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
3301<p class="description">Write data for an IPP message to a file.</p>
3302<p class="code">
79e1d494 3303<a href="#ipp_state_t">ipp_state_t</a> ippWriteFile (<br>
5a738aea
MS
3304&nbsp;&nbsp;&nbsp;&nbsp;int fd,<br>
3305&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3306);</p>
3307<h4 class="parameters">Parameters</h4>
3308<dl>
3309<dt>fd</dt>
3310<dd class="description">HTTP data</dd>
3311<dt>ipp</dt>
3312<dd class="description">IPP data</dd>
3313</dl>
3314<h4 class="returnvalue">Return Value</h4>
3315<p class="description">Current state</p>
426c6a59 3316<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
3317<p class="description">Write data for an IPP message.</p>
3318<p class="code">
79e1d494 3319<a href="#ipp_state_t">ipp_state_t</a> ippWriteIO (<br>
5a738aea
MS
3320&nbsp;&nbsp;&nbsp;&nbsp;void *dst,<br>
3321&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_iocb_t">ipp_iocb_t</a> cb,<br>
3322&nbsp;&nbsp;&nbsp;&nbsp;int blocking,<br>
3323&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *parent,<br>
3324&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3325);</p>
3326<h4 class="parameters">Parameters</h4>
3327<dl>
3328<dt>dst</dt>
3329<dd class="description">Destination</dd>
3330<dt>cb</dt>
3331<dd class="description">Write callback function</dd>
3332<dt>blocking</dt>
3333<dd class="description">Use blocking IO?</dd>
3334<dt>parent</dt>
3335<dd class="description">Parent IPP message</dd>
3336<dt>ipp</dt>
3337<dd class="description">IPP data</dd>
3338</dl>
3339<h4 class="returnvalue">Return Value</h4>
3340<p class="description">Current state</p>
3341<h2 class="title"><a name="TYPES">Data Types</a></h2>
f11a948a
MS
3342<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>
3343<p class="description">Socket address union, which
3344makes using IPv6 and other
3345address types easier and
3346more portable. </p>
3347<p class="code">
3348typedef union _http_addr_u / http_addr_t;
3349</p>
426c6a59 3350<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 3351<p class="description">Socket address list, which is
ef416fc2 3352used to enumerate all of the
3353addresses that are associated
5a738aea
MS
3354with a hostname. </p>
3355<p class="code">
3356typedef struct <a href="#http_addrlist_s">http_addrlist_s</a> / http_addrlist_t;
3357</p>
3358<h3 class="typedef"><a name="http_auth_t">http_auth_t</a></h3>
3359<p class="description">HTTP authentication types</p>
3360<p class="code">
3361typedef enum <a href="#http_auth_e">http_auth_e</a> http_auth_t;
3362</p>
10d09e33
MS
3363<h3 class="typedef"><span class="info">&nbsp;CUPS 1.5&nbsp;</span><a name="http_credential_t">http_credential_t</a></h3>
3364<p class="description">Credential data </p>
3365<p class="code">
3366typedef struct <a href="#http_credential_s">http_credential_s</a> http_credential_t;
3367</p>
5a738aea
MS
3368<h3 class="typedef"><a name="http_encoding_t">http_encoding_t</a></h3>
3369<p class="description">HTTP transfer encoding values</p>
3370<p class="code">
3371typedef enum <a href="#http_encoding_e">http_encoding_e</a> http_encoding_t;
3372</p>
3373<h3 class="typedef"><a name="http_encryption_t">http_encryption_t</a></h3>
3374<p class="description">HTTP encryption values</p>
3375<p class="code">
3376typedef enum <a href="#http_encryption_e">http_encryption_e</a> http_encryption_t;
3377</p>
79e1d494
MS
3378<h3 class="typedef"><a name="http_field_t">http_field_t</a></h3>
3379<p class="description">HTTP field names</p>
3380<p class="code">
3381typedef enum <a href="#http_field_e">http_field_e</a> http_field_t;
3382</p>
3383<h3 class="typedef"><a name="http_keepalive_t">http_keepalive_t</a></h3>
f11a948a 3384<p class="description">HTTP keep-alive values</p>
79e1d494
MS
3385<p class="code">
3386typedef enum <a href="#http_keepalive_e">http_keepalive_e</a> http_keepalive_t;
3387</p>
f11a948a
MS
3388<h3 class="typedef"><a name="http_state_t">http_state_t</a></h3>
3389<p class="description">HTTP state values; states
3390are server-oriented...</p>
3391<p class="code">
3392typedef enum <a href="#http_state_e">http_state_e</a> / http_state_t;
3393</p>
79e1d494
MS
3394<h3 class="typedef"><a name="http_status_t">http_status_t</a></h3>
3395<p class="description">HTTP status codes</p>
3396<p class="code">
3397typedef enum <a href="#http_status_e">http_status_e</a> http_status_t;
3398</p>
5a738aea
MS
3399<h3 class="typedef"><a name="http_t">http_t</a></h3>
3400<p class="description">HTTP connection type</p>
3401<p class="code">
ecdc0628 3402typedef struct _http_s http_t;
5a738aea 3403</p>
79e1d494 3404<h3 class="typedef"><a name="http_uri_coding_t">http_uri_coding_t</a></h3>
f11a948a 3405<p class="description">URI en/decode flags</p>
79e1d494
MS
3406<p class="code">
3407typedef enum <a href="#http_uri_coding_e">http_uri_coding_e</a> http_uri_coding_t;
3408</p>
10d09e33 3409<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 3410<p class="description">URI separation status </p>
79e1d494
MS
3411<p class="code">
3412typedef enum <a href="#http_uri_status_e">http_uri_status_e</a> http_uri_status_t;
3413</p>
f11a948a
MS
3414<h3 class="typedef"><a name="http_version_t">http_version_t</a></h3>
3415<p class="description">HTTP version numbers</p>
79e1d494
MS
3416<p class="code">
3417typedef enum <a href="#http_version_e">http_version_e</a> http_version_t;
3418</p>
5a738aea
MS
3419<h3 class="typedef"><a name="ipp_attribute_t">ipp_attribute_t</a></h3>
3420<p class="description">Attribute</p>
3421<p class="code">
3422typedef struct <a href="#ipp_attribute_s">ipp_attribute_s</a> ipp_attribute_t;
3423</p>
79e1d494 3424<h3 class="typedef"><a name="ipp_finish_t">ipp_finish_t</a></h3>
aaf19ab0 3425<p class="description">Finishings</p>
79e1d494
MS
3426<p class="code">
3427typedef enum <a href="#ipp_finish_e">ipp_finish_e</a> ipp_finish_t;
3428</p>
426c6a59 3429<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
3430<p class="description">IPP IO Callback Function </p>
3431<p class="code">
3432typedef ssize_t (*ipp_iocb_t)(void *, <a href="#ipp_uchar_t">ipp_uchar_t</a> *, size_t);
3433</p>
79e1d494 3434<h3 class="typedef"><a name="ipp_jstate_t">ipp_jstate_t</a></h3>
aaf19ab0 3435<p class="description">Job states</p>
79e1d494
MS
3436<p class="code">
3437typedef enum <a href="#ipp_jstate_e">ipp_jstate_e</a> ipp_jstate_t;
3438</p>
3439<h3 class="typedef"><a name="ipp_op_t">ipp_op_t</a></h3>
aaf19ab0 3440<p class="description">IPP operations</p>
79e1d494
MS
3441<p class="code">
3442typedef enum <a href="#ipp_op_e">ipp_op_e</a> ipp_op_t;
3443</p>
3444<h3 class="typedef"><a name="ipp_orient_t">ipp_orient_t</a></h3>
aaf19ab0 3445<p class="description">Orientation values</p>
79e1d494
MS
3446<p class="code">
3447typedef enum <a href="#ipp_orient_e">ipp_orient_e</a> ipp_orient_t;
3448</p>
3449<h3 class="typedef"><a name="ipp_pstate_t">ipp_pstate_t</a></h3>
aaf19ab0 3450<p class="description">Printer states</p>
79e1d494
MS
3451<p class="code">
3452typedef enum <a href="#ipp_pstate_e">ipp_pstate_e</a> ipp_pstate_t;
3453</p>
3454<h3 class="typedef"><a name="ipp_quality_t">ipp_quality_t</a></h3>
aaf19ab0 3455<p class="description">Qualities</p>
79e1d494
MS
3456<p class="code">
3457typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t;
3458</p>
5a738aea
MS
3459<h3 class="typedef"><a name="ipp_request_t">ipp_request_t</a></h3>
3460<p class="description">Request Header</p>
3461<p class="code">
3462typedef union <a href="#ipp_request_u">ipp_request_u</a> ipp_request_t;
3463</p>
79e1d494 3464<h3 class="typedef"><a name="ipp_res_t">ipp_res_t</a></h3>
aaf19ab0 3465<p class="description">Resolution units</p>
79e1d494
MS
3466<p class="code">
3467typedef enum <a href="#ipp_res_e">ipp_res_e</a> ipp_res_t;
3468</p>
3469<h3 class="typedef"><a name="ipp_state_t">ipp_state_t</a></h3>
aaf19ab0 3470<p class="description">IPP states</p>
79e1d494
MS
3471<p class="code">
3472typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t;
3473</p>
5a738aea
MS
3474<h3 class="typedef"><a name="ipp_t">ipp_t</a></h3>
3475<p class="description">Attribute Value</p>
3476<p class="code">
3477typedef struct <a href="#ipp_s">ipp_s</a> ipp_t;
3478</p>
3479<h3 class="typedef"><a name="ipp_uchar_t">ipp_uchar_t</a></h3>
aaf19ab0 3480<p class="description">IPP status codes</p>
5a738aea 3481<p class="code">
ecdc0628 3482typedef typedef unsigned char ipp_uchar_t;
5a738aea 3483</p>
79e1d494 3484<h3 class="typedef"><a name="ipp_tag_t">ipp_tag_t</a></h3>
aaf19ab0 3485<p class="description">Format tags for attributes</p>
79e1d494
MS
3486<p class="code">
3487typedef enum <a href="#ipp_tag_e">ipp_tag_e</a> ipp_tag_t;
3488</p>
5a738aea 3489<h3 class="typedef"><a name="ipp_value_t">ipp_value_t</a></h3>
f11a948a 3490<p class="description">Attribute Value</p>
5a738aea
MS
3491<p class="code">
3492typedef union <a href="#ipp_value_u">ipp_value_u</a> ipp_value_t;
3493</p>
3494<h2 class="title"><a name="STRUCTURES">Structures</a></h2>
426c6a59 3495<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
3496<p class="description">Socket address list, which is
3497used to enumerate all of the
3498addresses that are associated
3499with a hostname. </p>
3500<p class="code">struct http_addrlist_s {<br>
3501&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_addr_t">http_addr_t</a> addr;<br>
3502&nbsp;&nbsp;&nbsp;&nbsp;struct <a href="#http_addrlist_s">http_addrlist_s</a> *next;<br>
3503};</p>
3504<h4 class="members">Members</h4>
3505<dl>
3506<dt>addr </dt>
3507<dd class="description">Address</dd>
3508<dt>next </dt>
3509<dd class="description">Pointer to next address in list</dd>
3510</dl>
10d09e33
MS
3511<h3 class="struct"><span class="info">&nbsp;CUPS 1.5&nbsp;</span><a name="http_credential_s">http_credential_s</a></h3>
3512<p class="description">Credential data </p>
3513<p class="code">struct http_credential_s {<br>
3514&nbsp;&nbsp;&nbsp;&nbsp;void *data;<br>
3515&nbsp;&nbsp;&nbsp;&nbsp;size_t datalen;<br>
3516};</p>
3517<h4 class="members">Members</h4>
3518<dl>
3519<dt>data </dt>
3520<dd class="description">Pointer to credential data</dd>
3521<dt>datalen </dt>
3522<dd class="description">Credential length</dd>
3523</dl>
5a738aea
MS
3524<h3 class="struct"><a name="ipp_attribute_s">ipp_attribute_s</a></h3>
3525<p class="description">Attribute</p>
3526<p class="code">struct ipp_attribute_s {<br>
3527&nbsp;&nbsp;&nbsp;&nbsp;char *name;<br>
3528&nbsp;&nbsp;&nbsp;&nbsp;struct <a href="#ipp_attribute_s">ipp_attribute_s</a> *next;<br>
3529&nbsp;&nbsp;&nbsp;&nbsp;int num_values;<br>
79e1d494 3530&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> group_tag, value_tag;<br>
5a738aea
MS
3531&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_value_t">ipp_value_t</a> values[1];<br>
3532};</p>
3533<h4 class="members">Members</h4>
3534<dl>
3535<dt>name </dt>
3536<dd class="description">Name of attribute</dd>
3537<dt>next </dt>
3538<dd class="description">Next attribute in list</dd>
3539<dt>num_values </dt>
3540<dd class="description">Number of values</dd>
3541<dt>value_tag </dt>
3542<dd class="description">What type of value is it?</dd>
3543<dt>values[1] </dt>
3544<dd class="description">Values</dd>
3545</dl>
3546<h3 class="struct"><a name="ipp_s">ipp_s</a></h3>
3547<p class="description">IPP Request/Response/Notification</p>
3548<p class="code">struct ipp_s {<br>
3549&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attrs;<br>
3550&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *current;<br>
79e1d494 3551&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_tag_t">ipp_tag_t</a> curtag;<br>
5a738aea
MS
3552&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *last;<br>
3553&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *prev;<br>
3554&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_request_t">ipp_request_t</a> request;<br>
79e1d494 3555&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_state_t">ipp_state_t</a> state;<br>
aaf19ab0 3556&nbsp;&nbsp;&nbsp;&nbsp;int use;<br>
5a738aea
MS
3557};</p>
3558<h4 class="members">Members</h4>
3559<dl>
3560<dt>attrs </dt>
3561<dd class="description">Attributes</dd>
3562<dt>current </dt>
3563<dd class="description">Current attribute (for read/write)</dd>
3564<dt>curtag </dt>
3565<dd class="description">Current attribute group tag</dd>
3566<dt>last </dt>
3567<dd class="description">Last attribute in list</dd>
426c6a59
MS
3568<dt>prev <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
3569<dd class="description">Previous attribute (for read) </dd>
5a738aea
MS
3570<dt>request </dt>
3571<dd class="description">Request header</dd>
3572<dt>state </dt>
3573<dd class="description">State of request</dd>
10d09e33
MS
3574<dt>use <span class="info">&nbsp;CUPS 1.4.4/Mac OS X 10.6.?&nbsp;</span></dt>
3575<dd class="description">Use count </dd>
5a738aea
MS
3576</dl>
3577<h2 class="title"><a name="UNIONS">Unions</a></h2>
3578<h3 class="union"><a name="ipp_request_u">ipp_request_u</a></h3>
3579<p class="description">Request Header</p>
3580<p class="code">union ipp_request_u {<br>
3581};</p>
3582<h4 class="members">Members</h4>
3583<dl>
3584</dl>
3585<h3 class="union"><a name="ipp_value_u">ipp_value_u</a></h3>
f11a948a 3586<p class="description">Attribute Value</p>
5a738aea
MS
3587<p class="code">union ipp_value_u {<br>
3588&nbsp;&nbsp;&nbsp;&nbsp;char boolean;<br>
3589&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *collection;<br>
3590&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_uchar_t">ipp_uchar_t</a> date[11];<br>
3591&nbsp;&nbsp;&nbsp;&nbsp;int integer;<br>
3592};</p>
3593<h4 class="members">Members</h4>
3594<dl>
3595<dt>boolean </dt>
3596<dd class="description">Boolean value</dd>
426c6a59
MS
3597<dt>collection <span class="info">&nbsp;CUPS 1.1.19/Mac OS X 10.3&nbsp;</span></dt>
3598<dd class="description">Collection value </dd>
5a738aea
MS
3599<dt>date[11] </dt>
3600<dd class="description">Date/time value</dd>
3601<dt>integer </dt>
3602<dd class="description">Integer/enumerated value</dd>
3603</dl>
3604<h2 class="title"><a name="ENUMERATIONS">Constants</a></h2>
3605<h3 class="enumeration"><a name="http_auth_e">http_auth_e</a></h3>
3606<p class="description">HTTP authentication types</p>
3607<h4 class="constants">Constants</h4>
3608<dl>
3609<dt>HTTP_AUTH_BASIC </dt>
3610<dd class="description">Basic authentication in use</dd>
3611<dt>HTTP_AUTH_MD5 </dt>
3612<dd class="description">Digest authentication in use</dd>
3613<dt>HTTP_AUTH_MD5_INT </dt>
3614<dd class="description">Digest authentication in use for body</dd>
3615<dt>HTTP_AUTH_MD5_SESS </dt>
3616<dd class="description">MD5-session authentication in use</dd>
3617<dt>HTTP_AUTH_MD5_SESS_INT </dt>
3618<dd class="description">MD5-session authentication in use for body</dd>
426c6a59 3619<dt>HTTP_AUTH_NEGOTIATE <span class="info">&nbsp;CUPS 1.3/Mac OS X 10.5&nbsp;</span></dt>
5a738aea
MS
3620<dd class="description">GSSAPI authentication in use </dd>
3621<dt>HTTP_AUTH_NONE </dt>
3622<dd class="description">No authentication in use</dd>
3623</dl>
3624<h3 class="enumeration"><a name="http_encoding_e">http_encoding_e</a></h3>
3625<p class="description">HTTP transfer encoding values</p>
3626<h4 class="constants">Constants</h4>
3627<dl>
3628<dt>HTTP_ENCODE_CHUNKED </dt>
3629<dd class="description">Data is chunked</dd>
3630<dt>HTTP_ENCODE_FIELDS </dt>
3631<dd class="description">Sending HTTP fields</dd>
3632<dt>HTTP_ENCODE_LENGTH </dt>
3633<dd class="description">Data is sent with Content-Length</dd>
3634</dl>
3635<h3 class="enumeration"><a name="http_encryption_e">http_encryption_e</a></h3>
3636<p class="description">HTTP encryption values</p>
3637<h4 class="constants">Constants</h4>
3638<dl>
3639<dt>HTTP_ENCRYPT_ALWAYS </dt>
3640<dd class="description">Always encrypt (SSL)</dd>
3641<dt>HTTP_ENCRYPT_IF_REQUESTED </dt>
3642<dd class="description">Encrypt if requested (TLS upgrade)</dd>
3643<dt>HTTP_ENCRYPT_NEVER </dt>
3644<dd class="description">Never encrypt</dd>
3645<dt>HTTP_ENCRYPT_REQUIRED </dt>
3646<dd class="description">Encryption is required (TLS upgrade)</dd>
3647</dl>
3648<h3 class="enumeration"><a name="http_field_e">http_field_e</a></h3>
3649<p class="description">HTTP field names</p>
3650<h4 class="constants">Constants</h4>
3651<dl>
3652<dt>HTTP_FIELD_ACCEPT_LANGUAGE </dt>
3653<dd class="description">Accept-Language field</dd>
3654<dt>HTTP_FIELD_ACCEPT_RANGES </dt>
3655<dd class="description">Accept-Ranges field</dd>
3656<dt>HTTP_FIELD_AUTHORIZATION </dt>
3657<dd class="description">Authorization field</dd>
3658<dt>HTTP_FIELD_CONNECTION </dt>
3659<dd class="description">Connection field</dd>
3660<dt>HTTP_FIELD_CONTENT_ENCODING </dt>
3661<dd class="description">Content-Encoding field</dd>
3662<dt>HTTP_FIELD_CONTENT_LANGUAGE </dt>
3663<dd class="description">Content-Language field</dd>
3664<dt>HTTP_FIELD_CONTENT_LENGTH </dt>
3665<dd class="description">Content-Length field</dd>
3666<dt>HTTP_FIELD_CONTENT_LOCATION </dt>
3667<dd class="description">Content-Location field</dd>
3668<dt>HTTP_FIELD_CONTENT_MD5 </dt>
3669<dd class="description">Content-MD5 field</dd>
3670<dt>HTTP_FIELD_CONTENT_RANGE </dt>
3671<dd class="description">Content-Range field</dd>
3672<dt>HTTP_FIELD_CONTENT_TYPE </dt>
3673<dd class="description">Content-Type field</dd>
3674<dt>HTTP_FIELD_CONTENT_VERSION </dt>
3675<dd class="description">Content-Version field</dd>
3676<dt>HTTP_FIELD_DATE </dt>
3677<dd class="description">Date field</dd>
3678<dt>HTTP_FIELD_HOST </dt>
3679<dd class="description">Host field</dd>
3680<dt>HTTP_FIELD_IF_MODIFIED_SINCE </dt>
3681<dd class="description">If-Modified-Since field</dd>
3682<dt>HTTP_FIELD_IF_UNMODIFIED_SINCE </dt>
3683<dd class="description">If-Unmodified-Since field</dd>
3684<dt>HTTP_FIELD_KEEP_ALIVE </dt>
3685<dd class="description">Keep-Alive field</dd>
3686<dt>HTTP_FIELD_LAST_MODIFIED </dt>
3687<dd class="description">Last-Modified field</dd>
3688<dt>HTTP_FIELD_LINK </dt>
3689<dd class="description">Link field</dd>
3690<dt>HTTP_FIELD_LOCATION </dt>
3691<dd class="description">Location field</dd>
3692<dt>HTTP_FIELD_MAX </dt>
3693<dd class="description">Maximum field index</dd>
3694<dt>HTTP_FIELD_RANGE </dt>
3695<dd class="description">Range field</dd>
3696<dt>HTTP_FIELD_REFERER </dt>
3697<dd class="description">Referer field</dd>
3698<dt>HTTP_FIELD_RETRY_AFTER </dt>
3699<dd class="description">Retry-After field</dd>
3700<dt>HTTP_FIELD_TRANSFER_ENCODING </dt>
3701<dd class="description">Transfer-Encoding field</dd>
3702<dt>HTTP_FIELD_UNKNOWN </dt>
3703<dd class="description">Unknown field</dd>
3704<dt>HTTP_FIELD_UPGRADE </dt>
3705<dd class="description">Upgrade field</dd>
3706<dt>HTTP_FIELD_USER_AGENT </dt>
3707<dd class="description">User-Agent field</dd>
3708<dt>HTTP_FIELD_WWW_AUTHENTICATE </dt>
3709<dd class="description">WWW-Authenticate field</dd>
3710</dl>
3711<h3 class="enumeration"><a name="http_keepalive_e">http_keepalive_e</a></h3>
f11a948a 3712<p class="description">HTTP keep-alive values</p>
5a738aea
MS
3713<h4 class="constants">Constants</h4>
3714<dl>
3715<dt>HTTP_KEEPALIVE_OFF </dt>
3716<dd class="description">No keep alive support</dd>
3717<dt>HTTP_KEEPALIVE_ON </dt>
3718<dd class="description">Use keep alive</dd>
3719</dl>
3720<h3 class="enumeration"><a name="http_state_e">http_state_e</a></h3>
f11a948a
MS
3721<p class="description">HTTP state values; states
3722are server-oriented...</p>
5a738aea
MS
3723<h4 class="constants">Constants</h4>
3724<dl>
3725<dt>HTTP_CLOSE </dt>
3726<dd class="description">CLOSE command, waiting for blank line</dd>
3727<dt>HTTP_DELETE </dt>
3728<dd class="description">DELETE command, waiting for blank line</dd>
3729<dt>HTTP_GET </dt>
3730<dd class="description">GET command, waiting for blank line</dd>
3731<dt>HTTP_GET_SEND </dt>
3732<dd class="description">GET command, sending data</dd>
3733<dt>HTTP_HEAD </dt>
3734<dd class="description">HEAD command, waiting for blank line</dd>
3735<dt>HTTP_OPTIONS </dt>
3736<dd class="description">OPTIONS command, waiting for blank line</dd>
3737<dt>HTTP_POST </dt>
3738<dd class="description">POST command, waiting for blank line</dd>
3739<dt>HTTP_POST_RECV </dt>
3740<dd class="description">POST command, receiving data</dd>
3741<dt>HTTP_POST_SEND </dt>
3742<dd class="description">POST command, sending data</dd>
3743<dt>HTTP_PUT </dt>
3744<dd class="description">PUT command, waiting for blank line</dd>
3745<dt>HTTP_PUT_RECV </dt>
3746<dd class="description">PUT command, receiving data</dd>
3747<dt>HTTP_STATUS </dt>
3748<dd class="description">Command complete, sending status</dd>
3749<dt>HTTP_TRACE </dt>
3750<dd class="description">TRACE command, waiting for blank line</dd>
3751<dt>HTTP_WAITING </dt>
3752<dd class="description">Waiting for command</dd>
3753</dl>
3754<h3 class="enumeration"><a name="http_status_e">http_status_e</a></h3>
3755<p class="description">HTTP status codes</p>
3756<h4 class="constants">Constants</h4>
3757<dl>
3758<dt>HTTP_ACCEPTED </dt>
3759<dd class="description">DELETE command was successful</dd>
10d09e33
MS
3760<dt>HTTP_AUTHORIZATION_CANCELED <span class="info">&nbsp;CUPS 1.4&nbsp;</span></dt>
3761<dd class="description">User canceled authorization </dd>
5a738aea
MS
3762<dt>HTTP_BAD_GATEWAY </dt>
3763<dd class="description">Bad gateway</dd>
3764<dt>HTTP_BAD_REQUEST </dt>
3765<dd class="description">Bad request</dd>
3766<dt>HTTP_CONFLICT </dt>
3767<dd class="description">Request is self-conflicting</dd>
3768<dt>HTTP_CONTINUE </dt>
3769<dd class="description">Everything OK, keep going...</dd>
3770<dt>HTTP_CREATED </dt>
3771<dd class="description">PUT command was successful</dd>
3772<dt>HTTP_ERROR </dt>
3773<dd class="description">An error response from httpXxxx()</dd>
3774<dt>HTTP_EXPECTATION_FAILED </dt>
3775<dd class="description">The expectation given in an Expect header field was not met</dd>
3776<dt>HTTP_FORBIDDEN </dt>
3777<dd class="description">Forbidden to access this URI</dd>
3778<dt>HTTP_GATEWAY_TIMEOUT </dt>
3779<dd class="description">Gateway connection timed out</dd>
3780<dt>HTTP_GONE </dt>
3781<dd class="description">Server has gone away</dd>
3782<dt>HTTP_LENGTH_REQUIRED </dt>
3783<dd class="description">A content length or encoding is required</dd>
3784<dt>HTTP_METHOD_NOT_ALLOWED </dt>
3785<dd class="description">Method is not allowed</dd>
3786<dt>HTTP_MOVED_PERMANENTLY </dt>
3787<dd class="description">Document has moved permanently</dd>
3788<dt>HTTP_MOVED_TEMPORARILY </dt>
3789<dd class="description">Document has moved temporarily</dd>
3790<dt>HTTP_MULTIPLE_CHOICES </dt>
3791<dd class="description">Multiple files match request</dd>
3792<dt>HTTP_NOT_ACCEPTABLE </dt>
3793<dd class="description">Not Acceptable</dd>
3794<dt>HTTP_NOT_AUTHORITATIVE </dt>
3795<dd class="description">Information isn't authoritative</dd>
3796<dt>HTTP_NOT_FOUND </dt>
3797<dd class="description">URI was not found</dd>
3798<dt>HTTP_NOT_IMPLEMENTED </dt>
3799<dd class="description">Feature not implemented</dd>
3800<dt>HTTP_NOT_MODIFIED </dt>
3801<dd class="description">File not modified</dd>
3802<dt>HTTP_NOT_SUPPORTED </dt>
3803<dd class="description">HTTP version not supported</dd>
3804<dt>HTTP_NO_CONTENT </dt>
3805<dd class="description">Successful command, no new data</dd>
3806<dt>HTTP_OK </dt>
3807<dd class="description">OPTIONS/GET/HEAD/POST/TRACE command was successful</dd>
3808<dt>HTTP_PARTIAL_CONTENT </dt>
3809<dd class="description">Only a partial file was recieved/sent</dd>
3810<dt>HTTP_PAYMENT_REQUIRED </dt>
3811<dd class="description">Payment required</dd>
10d09e33
MS
3812<dt>HTTP_PKI_ERROR <span class="info">&nbsp;CUPS 1.5&nbsp;</span></dt>
3813<dd class="description">Error negotiating a secure connection </dd>
5a738aea
MS
3814<dt>HTTP_PRECONDITION </dt>
3815<dd class="description">Precondition failed</dd>
3816<dt>HTTP_PROXY_AUTHENTICATION </dt>
3817<dd class="description">Proxy Authentication is Required</dd>
3818<dt>HTTP_REQUESTED_RANGE </dt>
3819<dd class="description">The requested range is not satisfiable</dd>
3820<dt>HTTP_REQUEST_TIMEOUT </dt>
3821<dd class="description">Request timed out</dd>
3822<dt>HTTP_REQUEST_TOO_LARGE </dt>
3823<dd class="description">Request entity too large</dd>
3824<dt>HTTP_RESET_CONTENT </dt>
3825<dd class="description">Content was reset/recreated</dd>
3826<dt>HTTP_SEE_OTHER </dt>
3827<dd class="description">See this other link...</dd>
3828<dt>HTTP_SERVER_ERROR </dt>
3829<dd class="description">Internal server error</dd>
3830<dt>HTTP_SERVICE_UNAVAILABLE </dt>
3831<dd class="description">Service is unavailable</dd>
3832<dt>HTTP_SWITCHING_PROTOCOLS </dt>
3833<dd class="description">HTTP upgrade to TLS/SSL</dd>
3834<dt>HTTP_UNAUTHORIZED </dt>
3835<dd class="description">Unauthorized to access host</dd>
3836<dt>HTTP_UNSUPPORTED_MEDIATYPE </dt>
3837<dd class="description">The requested media type is unsupported</dd>
3838<dt>HTTP_UPGRADE_REQUIRED </dt>
3839<dd class="description">Upgrade to SSL/TLS required</dd>
3840<dt>HTTP_URI_TOO_LONG </dt>
3841<dd class="description">URI too long</dd>
3842<dt>HTTP_USE_PROXY </dt>
3843<dd class="description">Must use a proxy to access this URI</dd>
3844</dl>
3845<h3 class="enumeration"><a name="http_uri_coding_e">http_uri_coding_e</a></h3>
f11a948a 3846<p class="description">URI en/decode flags</p>
5a738aea
MS
3847<h4 class="constants">Constants</h4>
3848<dl>
3849<dt>HTTP_URI_CODING_ALL </dt>
3850<dd class="description">En/decode everything</dd>
3851<dt>HTTP_URI_CODING_HOSTNAME </dt>
3852<dd class="description">En/decode the hostname portion</dd>
3853<dt>HTTP_URI_CODING_MOST </dt>
3854<dd class="description">En/decode all but the query</dd>
3855<dt>HTTP_URI_CODING_NONE </dt>
3856<dd class="description">Don't en/decode anything</dd>
3857<dt>HTTP_URI_CODING_QUERY </dt>
3858<dd class="description">En/decode the query portion</dd>
3859<dt>HTTP_URI_CODING_RESOURCE </dt>
3860<dd class="description">En/decode the resource portion</dd>
3861<dt>HTTP_URI_CODING_USERNAME </dt>
3862<dd class="description">En/decode the username portion</dd>
3863</dl>
10d09e33 3864<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 3865<p class="description">URI separation status </p>
5a738aea
MS
3866<h4 class="constants">Constants</h4>
3867<dl>
3868<dt>HTTP_URI_BAD_ARGUMENTS </dt>
3869<dd class="description">Bad arguments to function (error)</dd>
3870<dt>HTTP_URI_BAD_HOSTNAME </dt>
3871<dd class="description">Bad hostname in URI (error)</dd>
3872<dt>HTTP_URI_BAD_PORT </dt>
3873<dd class="description">Bad port number in URI (error)</dd>
3874<dt>HTTP_URI_BAD_RESOURCE </dt>
3875<dd class="description">Bad resource in URI (error)</dd>
3876<dt>HTTP_URI_BAD_SCHEME </dt>
3877<dd class="description">Bad scheme in URI (error)</dd>
3878<dt>HTTP_URI_BAD_URI </dt>
3879<dd class="description">Bad/empty URI (error)</dd>
3880<dt>HTTP_URI_BAD_USERNAME </dt>
3881<dd class="description">Bad username in URI (error)</dd>
3882<dt>HTTP_URI_MISSING_RESOURCE </dt>
3883<dd class="description">Missing resource in URI (warning)</dd>
3884<dt>HTTP_URI_MISSING_SCHEME </dt>
3885<dd class="description">Missing scheme in URI (warning)</dd>
3886<dt>HTTP_URI_OK </dt>
3887<dd class="description">URI decoded OK</dd>
3888<dt>HTTP_URI_OVERFLOW </dt>
3889<dd class="description">URI buffer for httpAssembleURI is too small</dd>
3890<dt>HTTP_URI_UNKNOWN_SCHEME </dt>
3891<dd class="description">Unknown scheme in URI (warning)</dd>
3892</dl>
3893<h3 class="enumeration"><a name="http_version_e">http_version_e</a></h3>
f11a948a 3894<p class="description">HTTP version numbers</p>
5a738aea
MS
3895<h4 class="constants">Constants</h4>
3896<dl>
3897<dt>HTTP_0_9 </dt>
3898<dd class="description">HTTP/0.9</dd>
3899<dt>HTTP_1_0 </dt>
3900<dd class="description">HTTP/1.0</dd>
3901<dt>HTTP_1_1 </dt>
3902<dd class="description">HTTP/1.1</dd>
3903</dl>
3904<h3 class="enumeration"><a name="ipp_finish_e">ipp_finish_e</a></h3>
aaf19ab0 3905<p class="description">Finishings</p>
5a738aea
MS
3906<h4 class="constants">Constants</h4>
3907<dl>
3908<dt>IPP_FINISHINGS_BALE </dt>
3909<dd class="description">Bale (any type)</dd>
3910<dt>IPP_FINISHINGS_BIND </dt>
3911<dd class="description">Bind</dd>
3912<dt>IPP_FINISHINGS_BIND_BOTTOM </dt>
3913<dd class="description">Bind on bottom</dd>
3914<dt>IPP_FINISHINGS_BIND_LEFT </dt>
3915<dd class="description">Bind on left</dd>
3916<dt>IPP_FINISHINGS_BIND_RIGHT </dt>
3917<dd class="description">Bind on right</dd>
3918<dt>IPP_FINISHINGS_BIND_TOP </dt>
3919<dd class="description">Bind on top</dd>
3920<dt>IPP_FINISHINGS_BOOKLET_MAKER </dt>
3921<dd class="description">Fold to make booklet</dd>
3922<dt>IPP_FINISHINGS_COVER </dt>
3923<dd class="description">Add cover</dd>
3924<dt>IPP_FINISHINGS_EDGE_STITCH </dt>
3925<dd class="description">Stitch along any side</dd>
3926<dt>IPP_FINISHINGS_EDGE_STITCH_BOTTOM </dt>
3927<dd class="description">Stitch along bottom edge</dd>
3928<dt>IPP_FINISHINGS_EDGE_STITCH_LEFT </dt>
3929<dd class="description">Stitch along left side</dd>
3930<dt>IPP_FINISHINGS_EDGE_STITCH_RIGHT </dt>
3931<dd class="description">Stitch along right side</dd>
3932<dt>IPP_FINISHINGS_EDGE_STITCH_TOP </dt>
3933<dd class="description">Stitch along top edge</dd>
3934<dt>IPP_FINISHINGS_FOLD </dt>
3935<dd class="description">Fold (any type)</dd>
3936<dt>IPP_FINISHINGS_JOB_OFFSET </dt>
3937<dd class="description">Offset for binding (any type)</dd>
3938<dt>IPP_FINISHINGS_NONE </dt>
3939<dd class="description">No finishing</dd>
3940<dt>IPP_FINISHINGS_PUNCH </dt>
3941<dd class="description">Punch (any location/count)</dd>
3942<dt>IPP_FINISHINGS_SADDLE_STITCH </dt>
3943<dd class="description">Staple interior</dd>
3944<dt>IPP_FINISHINGS_STAPLE </dt>
3945<dd class="description">Staple (any location)</dd>
3946<dt>IPP_FINISHINGS_STAPLE_BOTTOM_LEFT </dt>
3947<dd class="description">Staple bottom left corner</dd>
3948<dt>IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT </dt>
3949<dd class="description">Staple bottom right corner</dd>
3950<dt>IPP_FINISHINGS_STAPLE_DUAL_BOTTOM </dt>
3951<dd class="description">Two staples on bottom</dd>
3952<dt>IPP_FINISHINGS_STAPLE_DUAL_LEFT </dt>
3953<dd class="description">Two staples on left</dd>
3954<dt>IPP_FINISHINGS_STAPLE_DUAL_RIGHT </dt>
3955<dd class="description">Two staples on right</dd>
3956<dt>IPP_FINISHINGS_STAPLE_DUAL_TOP </dt>
3957<dd class="description">Two staples on top</dd>
3958<dt>IPP_FINISHINGS_STAPLE_TOP_LEFT </dt>
3959<dd class="description">Staple top left corner</dd>
3960<dt>IPP_FINISHINGS_STAPLE_TOP_RIGHT </dt>
3961<dd class="description">Staple top right corner</dd>
3962<dt>IPP_FINISHINGS_TRIM </dt>
3963<dd class="description">Trim (any type)</dd>
3964</dl>
3965<h3 class="enumeration"><a name="ipp_jstate_e">ipp_jstate_e</a></h3>
aaf19ab0 3966<p class="description">Job states</p>
5a738aea
MS
3967<h4 class="constants">Constants</h4>
3968<dl>
3969<dt>IPP_JOB_ABORTED </dt>
3970<dd class="description">Job has aborted due to error</dd>
3971<dt>IPP_JOB_CANCELED </dt>
3972<dd class="description">Job has been canceled</dd>
3973<dt>IPP_JOB_COMPLETED </dt>
3974<dd class="description">Job has completed successfully</dd>
3975<dt>IPP_JOB_HELD </dt>
3976<dd class="description">Job is held for printing</dd>
3977<dt>IPP_JOB_PENDING </dt>
3978<dd class="description">Job is waiting to be printed</dd>
3979<dt>IPP_JOB_PROCESSING </dt>
3980<dd class="description">Job is currently printing</dd>
3981<dt>IPP_JOB_STOPPED </dt>
3982<dd class="description">Job has been stopped</dd>
3983</dl>
3984<h3 class="enumeration"><a name="ipp_op_e">ipp_op_e</a></h3>
aaf19ab0 3985<p class="description">IPP operations</p>
5a738aea
MS
3986<h4 class="constants">Constants</h4>
3987<dl>
3988<dt>CUPS_ACCEPT_JOBS </dt>
3989<dd class="description">Accept new jobs on a printer</dd>
3990<dt>CUPS_ADD_MODIFY_CLASS </dt>
3991<dd class="description">Add or modify a class</dd>
3992<dt>CUPS_ADD_MODIFY_PRINTER </dt>
3993<dd class="description">Add or modify a printer</dd>
426c6a59 3994<dt>CUPS_AUTHENTICATE_JOB <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
5a738aea
MS
3995<dd class="description">Authenticate a job </dd>
3996<dt>CUPS_DELETE_CLASS </dt>
3997<dd class="description">Delete a class</dd>
3998<dt>CUPS_DELETE_PRINTER </dt>
3999<dd class="description">Delete a printer</dd>
4000<dt>CUPS_GET_CLASSES <span class="info">&nbsp;DEPRECATED&nbsp;</span></dt>
4001<dd class="description">Get a list of classes </dd>
4002<dt>CUPS_GET_DEFAULT </dt>
4003<dd class="description">Get the default printer</dd>
4004<dt>CUPS_GET_DEVICES </dt>
4005<dd class="description">Get a list of supported devices</dd>
178cb736 4006<dt>CUPS_GET_DOCUMENT <span class="info">&nbsp;CUPS 1.4/Mac OS X 10.6&nbsp;</span></dt>
5a738aea 4007<dd class="description">Get a document file </dd>
426c6a59 4008<dt>CUPS_GET_PPD <span class="info">&nbsp;CUPS 1.3/Mac OS X 10.5&nbsp;</span></dt>
5a738aea
MS
4009<dd class="description">Get a PPD file </dd>
4010<dt>CUPS_GET_PPDS </dt>
4011<dd class="description">Get a list of supported drivers</dd>
4012<dt>CUPS_GET_PRINTERS </dt>
4013<dd class="description">Get a list of printers and/or classes</dd>
4014<dt>CUPS_MOVE_JOB </dt>
4015<dd class="description">Move a job to a different printer</dd>
4016<dt>CUPS_REJECT_JOBS </dt>
4017<dd class="description">Reject new jobs on a printer</dd>
4018<dt>CUPS_SET_DEFAULT </dt>
4019<dd class="description">Set the default printer</dd>
4020<dt>IPP_CANCEL_JOB </dt>
4021<dd class="description">Cancel a job</dd>
aaf19ab0
MS
4022<dt>IPP_CANCEL_JOBS </dt>
4023<dd class="description">Cancel-Jobs</dd>
4024<dt>IPP_CANCEL_MY_JOBS </dt>
4025<dd class="description">Cancel-My-Jobs</dd>
426c6a59 4026<dt>IPP_CANCEL_SUBSCRIPTION <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
5a738aea 4027<dd class="description">Cancel a subscription </dd>
aaf19ab0
MS
4028<dt>IPP_CLOSE_JOB </dt>
4029<dd class="description">Close-Job</dd>
5a738aea
MS
4030<dt>IPP_CREATE_JOB </dt>
4031<dd class="description">Create an empty print job</dd>
426c6a59 4032<dt>IPP_CREATE_JOB_SUBSCRIPTION <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
5a738aea 4033<dd class="description">Create a job subscription </dd>
426c6a59 4034<dt>IPP_CREATE_PRINTER_SUBSCRIPTION <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
5a738aea
MS
4035<dd class="description">Create a printer subscription </dd>
4036<dt>IPP_DISABLE_PRINTER </dt>
4037<dd class="description">Stop a printer</dd>
4038<dt>IPP_ENABLE_PRINTER </dt>
4039<dd class="description">Start a printer</dd>
4040<dt>IPP_GET_JOBS </dt>
4041<dd class="description">Get a list of jobs</dd>
4042<dt>IPP_GET_JOB_ATTRIBUTES </dt>
4043<dd class="description">Get job attributes</dd>
426c6a59 4044<dt>IPP_GET_NOTIFICATIONS <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
5a738aea
MS
4045<dd class="description">Get notification events </dd>
4046<dt>IPP_GET_PRINTER_ATTRIBUTES </dt>
4047<dd class="description">Get printer attributes</dd>
4048<dt>IPP_GET_PRINTER_SUPPORTED_VALUES </dt>
4049<dd class="description">Get supported attribute values</dd>
426c6a59 4050<dt>IPP_GET_SUBSCRIPTIONS <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
5a738aea 4051<dd class="description">Get list of subscriptions </dd>
426c6a59 4052<dt>IPP_GET_SUBSCRIPTION_ATTRIBUTES <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
5a738aea
MS
4053<dd class="description">Get subscription attributes </dd>
4054<dt>IPP_HOLD_JOB </dt>
4055<dd class="description">Hold a job for printing</dd>
4056<dt>IPP_PAUSE_PRINTER </dt>
4057<dd class="description">Stop a printer</dd>
4058<dt>IPP_PRINT_JOB </dt>
4059<dd class="description">Print a single file</dd>
4060<dt>IPP_PURGE_JOBS </dt>
4061<dd class="description">Cancel all jobs</dd>
4062<dt>IPP_RELEASE_JOB </dt>
4063<dd class="description">Release a job for printing</dd>
426c6a59 4064<dt>IPP_RENEW_SUBSCRIPTION <span class="info">&nbsp;CUPS 1.2/Mac OS X 10.5&nbsp;</span></dt>
5a738aea
MS
4065<dd class="description">Renew a printer subscription </dd>
4066<dt>IPP_RESTART_JOB </dt>
4067<dd class="description">Reprint a job</dd>
aaf19ab0
MS
4068<dt>IPP_RESUBMIT_JOB </dt>
4069<dd class="description">Resubmit-Job</dd>
5a738aea
MS
4070<dt>IPP_RESUME_PRINTER </dt>
4071<dd class="description">Start a printer</dd>
4072<dt>IPP_SEND_DOCUMENT </dt>
4073<dd class="description">Add a file to a job</dd>
4074<dt>IPP_SET_JOB_ATTRIBUTES </dt>
4075<dd class="description">Set job attributes</dd>
4076<dt>IPP_VALIDATE_JOB </dt>
4077<dd class="description">Validate job options</dd>
4078</dl>
4079<h3 class="enumeration"><a name="ipp_orient_e">ipp_orient_e</a></h3>
aaf19ab0 4080<p class="description">Orientation values</p>
5a738aea
MS
4081<h4 class="constants">Constants</h4>
4082<dl>
4083<dt>IPP_LANDSCAPE </dt>
4084<dd class="description">90 degrees counter-clockwise</dd>
4085<dt>IPP_PORTRAIT </dt>
4086<dd class="description">No rotation</dd>
4087<dt>IPP_REVERSE_LANDSCAPE </dt>
4088<dd class="description">90 degrees clockwise</dd>
4089<dt>IPP_REVERSE_PORTRAIT </dt>
4090<dd class="description">180 degrees</dd>
4091</dl>
4092<h3 class="enumeration"><a name="ipp_pstate_e">ipp_pstate_e</a></h3>
aaf19ab0 4093<p class="description">Printer states</p>
5a738aea
MS
4094<h4 class="constants">Constants</h4>
4095<dl>
4096<dt>IPP_PRINTER_IDLE </dt>
4097<dd class="description">Printer is idle</dd>
4098<dt>IPP_PRINTER_PROCESSING </dt>
4099<dd class="description">Printer is working</dd>
4100<dt>IPP_PRINTER_STOPPED </dt>
4101<dd class="description">Printer is stopped</dd>
4102</dl>
4103<h3 class="enumeration"><a name="ipp_quality_e">ipp_quality_e</a></h3>
aaf19ab0 4104<p class="description">Qualities</p>
5a738aea
MS
4105<h4 class="constants">Constants</h4>
4106<dl>
4107<dt>IPP_QUALITY_DRAFT </dt>
4108<dd class="description">Draft quality</dd>
4109<dt>IPP_QUALITY_HIGH </dt>
4110<dd class="description">High quality</dd>
4111<dt>IPP_QUALITY_NORMAL </dt>
4112<dd class="description">Normal quality</dd>
4113</dl>
4114<h3 class="enumeration"><a name="ipp_res_e">ipp_res_e</a></h3>
aaf19ab0 4115<p class="description">Resolution units</p>
5a738aea
MS
4116<h4 class="constants">Constants</h4>
4117<dl>
4118<dt>IPP_RES_PER_CM </dt>
4119<dd class="description">Pixels per centimeter</dd>
4120<dt>IPP_RES_PER_INCH </dt>
4121<dd class="description">Pixels per inch</dd>
4122</dl>
4123<h3 class="enumeration"><a name="ipp_state_e">ipp_state_e</a></h3>
aaf19ab0 4124<p class="description">IPP states</p>
5a738aea
MS
4125<h4 class="constants">Constants</h4>
4126<dl>
4127<dt>IPP_ATTRIBUTE </dt>
4128<dd class="description">One or more attributes need to be sent/received</dd>
4129<dt>IPP_DATA </dt>
4130<dd class="description">IPP request data needs to be sent/received</dd>
4131<dt>IPP_ERROR </dt>
4132<dd class="description">An error occurred</dd>
4133<dt>IPP_HEADER </dt>
4134<dd class="description">The request header needs to be sent/received</dd>
4135<dt>IPP_IDLE </dt>
4136<dd class="description">Nothing is happening/request completed</dd>
4137</dl>
4138<h3 class="enumeration"><a name="ipp_status_e">ipp_status_e</a></h3>
aaf19ab0 4139<p class="description">IPP status codes</p>
5a738aea
MS
4140<h4 class="constants">Constants</h4>
4141<dl>
4142<dt>CUPS_SEE_OTHER </dt>
4143<dd class="description">cups-see-other</dd>
4144<dt>IPP_ATTRIBUTES </dt>
4145<dd class="description">client-error-attributes-or-values-not-supported</dd>
4146<dt>IPP_ATTRIBUTES_NOT_SETTABLE </dt>
4147<dd class="description">client-error-attributes-not-settable</dd>
10d09e33
MS
4148<dt>IPP_AUTHENTICATION_CANCELED <span class="info">&nbsp;CUPS 1.5&nbsp;</span></dt>
4149<dd class="description">Authentication canceled by user </dd>
5a738aea
MS
4150<dt>IPP_BAD_REQUEST </dt>
4151<dd class="description">client-error-bad-request</dd>
4152<dt>IPP_CHARSET </dt>
4153<dd class="description">client-error-charset-not-supported</dd>
4154<dt>IPP_COMPRESSION_ERROR </dt>
4155<dd class="description">client-error-compression-error</dd>
4156<dt>IPP_COMPRESSION_NOT_SUPPORTED </dt>
4157<dd class="description">client-error-compression-not-supported</dd>
4158<dt>IPP_CONFLICT </dt>
4159<dd class="description">client-error-conflicting-attributes</dd>
4160<dt>IPP_DEVICE_ERROR </dt>
4161<dd class="description">server-error-device-error</dd>
4162<dt>IPP_DOCUMENT_ACCESS_ERROR </dt>
4163<dd class="description">client-error-document-access-error</dd>
4164<dt>IPP_DOCUMENT_FORMAT </dt>
4165<dd class="description">client-error-document-format-not-supported</dd>
4166<dt>IPP_DOCUMENT_FORMAT_ERROR </dt>
4167<dd class="description">client-error-document-format-error</dd>
4168<dt>IPP_ERROR_JOB_CANCELED </dt>
4169<dd class="description">server-error-job-canceled</dd>
4170<dt>IPP_FORBIDDEN </dt>
4171<dd class="description">client-error-forbidden</dd>
4172<dt>IPP_GONE </dt>
4173<dd class="description">client-error-gone</dd>
4174<dt>IPP_IGNORED_ALL_NOTIFICATIONS </dt>
4175<dd class="description">client-error-ignored-all-notifications</dd>
4176<dt>IPP_IGNORED_ALL_SUBSCRIPTIONS </dt>
4177<dd class="description">client-error-ignored-all-subscriptions</dd>
4178<dt>IPP_INTERNAL_ERROR </dt>
4179<dd class="description">server-error-internal-error</dd>
4180<dt>IPP_MULTIPLE_JOBS_NOT_SUPPORTED </dt>
4181<dd class="description">server-error-multiple-document-jobs-not-supported</dd>
4182<dt>IPP_NOT_ACCEPTING </dt>
4183<dd class="description">server-error-not-accepting-jobs</dd>
4184<dt>IPP_NOT_AUTHENTICATED </dt>
4185<dd class="description">client-error-not-authenticated</dd>
4186<dt>IPP_NOT_AUTHORIZED </dt>
4187<dd class="description">client-error-not-authorized</dd>
4188<dt>IPP_NOT_FOUND </dt>
4189<dd class="description">client-error-not-found</dd>
4190<dt>IPP_NOT_POSSIBLE </dt>
4191<dd class="description">client-error-not-possible</dd>
4192<dt>IPP_OK </dt>
4193<dd class="description">successful-ok</dd>
4194<dt>IPP_OK_BUT_CANCEL_SUBSCRIPTION </dt>
4195<dd class="description">successful-ok-but-cancel-subscription</dd>
4196<dt>IPP_OK_CONFLICT </dt>
4197<dd class="description">successful-ok-conflicting-attributes</dd>
4198<dt>IPP_OK_EVENTS_COMPLETE </dt>
4199<dd class="description">successful-ok-events-complete</dd>
4200<dt>IPP_OK_IGNORED_NOTIFICATIONS </dt>
4201<dd class="description">successful-ok-ignored-notifications</dd>
4202<dt>IPP_OK_IGNORED_SUBSCRIPTIONS </dt>
4203<dd class="description">successful-ok-ignored-subscriptions</dd>
4204<dt>IPP_OK_SUBST </dt>
4205<dd class="description">successful-ok-ignored-or-substituted-attributes</dd>
4206<dt>IPP_OK_TOO_MANY_EVENTS </dt>
4207<dd class="description">successful-ok-too-many-events</dd>
4208<dt>IPP_OPERATION_NOT_SUPPORTED </dt>
4209<dd class="description">server-error-operation-not-supported</dd>
10d09e33
MS
4210<dt>IPP_PKI_ERROR <span class="info">&nbsp;CUPS 1.5&nbsp;</span></dt>
4211<dd class="description">Error negotiating a secure connection </dd>
5a738aea
MS
4212<dt>IPP_PRINTER_BUSY </dt>
4213<dd class="description">server-error-busy</dd>
4214<dt>IPP_PRINTER_IS_DEACTIVATED </dt>
4215<dd class="description">server-error-printer-is-deactivated</dd>
4216<dt>IPP_PRINT_SUPPORT_FILE_NOT_FOUND </dt>
4217<dd class="description">client-error-print-support-file-not-found</dd>
4218<dt>IPP_REQUEST_ENTITY </dt>
4219<dd class="description">client-error-request-entity-too-large</dd>
4220<dt>IPP_REQUEST_VALUE </dt>
4221<dd class="description">client-error-request-value-too-long</dd>
4222<dt>IPP_SERVICE_UNAVAILABLE </dt>
4223<dd class="description">server-error-service-unavailable</dd>
4224<dt>IPP_TEMPORARY_ERROR </dt>
4225<dd class="description">server-error-temporary-error</dd>
4226<dt>IPP_TIMEOUT </dt>
4227<dd class="description">client-error-timeout</dd>
4228<dt>IPP_TOO_MANY_SUBSCRIPTIONS </dt>
4229<dd class="description">client-error-too-many-subscriptions</dd>
10d09e33
MS
4230<dt>IPP_UPGRADE_REQUIRED </dt>
4231<dd class="description">TLS upgrade required</dd>
5a738aea
MS
4232<dt>IPP_URI_SCHEME </dt>
4233<dd class="description">client-error-uri-scheme-not-supported</dd>
4234<dt>IPP_VERSION_NOT_SUPPORTED </dt>
4235<dd class="description">server-error-version-not-supported</dd>
4236</dl>
4237<h3 class="enumeration"><a name="ipp_tag_e">ipp_tag_e</a></h3>
aaf19ab0 4238<p class="description">Format tags for attributes</p>
5a738aea
MS
4239<h4 class="constants">Constants</h4>
4240<dl>
4241<dt>IPP_TAG_ADMINDEFINE </dt>
4242<dd class="description">Admin-defined value</dd>
4243<dt>IPP_TAG_BEGIN_COLLECTION </dt>
4244<dd class="description">Beginning of collection value</dd>
4245<dt>IPP_TAG_BOOLEAN </dt>
4246<dd class="description">Boolean value</dd>
4247<dt>IPP_TAG_CHARSET </dt>
4248<dd class="description">Character set value</dd>
4249<dt>IPP_TAG_COPY </dt>
4250<dd class="description">Bitflag for copied attribute values</dd>
4251<dt>IPP_TAG_DATE </dt>
4252<dd class="description">Date/time value</dd>
4253<dt>IPP_TAG_DEFAULT </dt>
4254<dd class="description">Default value</dd>
4255<dt>IPP_TAG_DELETEATTR </dt>
4256<dd class="description">Delete-attribute value</dd>
4257<dt>IPP_TAG_END </dt>
4258<dd class="description">End-of-attributes</dd>
4259<dt>IPP_TAG_END_COLLECTION </dt>
4260<dd class="description">End of collection value</dd>
4261<dt>IPP_TAG_ENUM </dt>
4262<dd class="description">Enumeration value</dd>
4263<dt>IPP_TAG_EVENT_NOTIFICATION </dt>
4264<dd class="description">Event group</dd>
4265<dt>IPP_TAG_INTEGER </dt>
4266<dd class="description">Integer value</dd>
4267<dt>IPP_TAG_JOB </dt>
4268<dd class="description">Job group</dd>
4269<dt>IPP_TAG_KEYWORD </dt>
4270<dd class="description">Keyword value</dd>
4271<dt>IPP_TAG_LANGUAGE </dt>
4272<dd class="description">Language value</dd>
4273<dt>IPP_TAG_MASK </dt>
4274<dd class="description">Mask for copied attribute values</dd>
4275<dt>IPP_TAG_MEMBERNAME </dt>
4276<dd class="description">Collection member name value</dd>
4277<dt>IPP_TAG_MIMETYPE </dt>
4278<dd class="description">MIME media type value</dd>
4279<dt>IPP_TAG_NAME </dt>
4280<dd class="description">Name value</dd>
4281<dt>IPP_TAG_NAMELANG </dt>
4282<dd class="description">Name-with-language value</dd>
4283<dt>IPP_TAG_NOTSETTABLE </dt>
4284<dd class="description">Not-settable value</dd>
4285<dt>IPP_TAG_NOVALUE </dt>
4286<dd class="description">No-value value</dd>
4287<dt>IPP_TAG_OPERATION </dt>
4288<dd class="description">Operation group</dd>
4289<dt>IPP_TAG_PRINTER </dt>
4290<dd class="description">Printer group</dd>
4291<dt>IPP_TAG_RANGE </dt>
4292<dd class="description">Range value</dd>
4293<dt>IPP_TAG_RESOLUTION </dt>
4294<dd class="description">Resolution value</dd>
4295<dt>IPP_TAG_STRING </dt>
4296<dd class="description">Octet string value</dd>
4297<dt>IPP_TAG_SUBSCRIPTION </dt>
4298<dd class="description">Subscription group</dd>
4299<dt>IPP_TAG_TEXT </dt>
4300<dd class="description">Text value</dd>
4301<dt>IPP_TAG_TEXTLANG </dt>
4302<dd class="description">Text-with-language value</dd>
4303<dt>IPP_TAG_UNKNOWN </dt>
4304<dd class="description">Unknown value</dd>
4305<dt>IPP_TAG_UNSUPPORTED_GROUP </dt>
4306<dd class="description">Unsupported attributes group</dd>
4307<dt>IPP_TAG_UNSUPPORTED_VALUE </dt>
4308<dd class="description">Unsupported value</dd>
4309<dt>IPP_TAG_URI </dt>
4310<dd class="description">URI value</dd>
4311<dt>IPP_TAG_URISCHEME </dt>
4312<dd class="description">URI scheme value</dd>
4313<dt>IPP_TAG_ZERO </dt>
4314<dd class="description">Zero tag - used for separators</dd>
4315</dl>
4316</div>
ef416fc2 4317</body>
4318</html>