]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/api-httpipp.html
Update "since CUPS 2.0" into to mention OS X 10.10.
[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}
ca6b43fc 41
240214ef
MS
42DL.man DD {
43 margin-left: 5em;
44}
45
46DL.man DT {
47 margin-left: 0;
48}
49
50PRE.man {
51 margin: 0;
52}
53
5a738aea
MS
54PRE.example {
55 background: #eeeeee;
56 border: dotted thin #999999;
57 margin-left: 36pt;
178cb736 58 padding: 10pt;
5a738aea
MS
59}
60
61PRE.command EM, PRE.example EM {
62 font-family: lucida grande, geneva, helvetica, arial, sans-serif;
63}
64
65P.command {
66 font-family: monaco, courier, monospace;
67 margin-left: 36pt;
68}
69
70P.formula {
71 font-style: italic;
72 margin-left: 36pt;
73}
74
75BLOCKQUOTE {
178cb736 76 background: #eeeeee;
5a738aea
MS
77 border: solid thin #999999;
78 padding: 10pt;
79}
80
e4572d57
MS
81A IMG {
82 border: none;
83}
84
85A:link:hover IMG {
86 background: #f0f0f0;
87 border-radius: 10px;
88 -moz-border-radius: 10px;
89}
90
5a738aea 91A:link, A:visited {
ca6b43fc 92 font-weight: inherit;
5a738aea 93 text-decoration: none;
5a738aea
MS
94}
95
96A:link:hover, A:visited:hover, A:active {
97 text-decoration: underline;
5a738aea
MS
98}
99
100SUB, SUP {
101 font-size: 50%;
102}
103
e4572d57
MS
104TR.data, TD.data, TR.data TD {
105 margin-top: 10pt;
106 padding: 5pt;
107 border-bottom: solid 1pt #999999;
108}
109
110TR.data TH {
111 border-bottom: solid 1pt #999999;
112 padding-top: 10pt;
113 padding-left: 5pt;
114 text-align: left;
115}
116
5a738aea
MS
117DIV.table TABLE {
118 border: solid thin #999999;
119 border-collapse: collapse;
120 border-spacing: 0;
121 margin-left: auto;
122 margin-right: auto;
123}
124
125DIV.table CAPTION {
126 caption-side: top;
127 font-size: 120%;
128 font-style: italic;
129 font-weight: bold;
130 margin-left: auto;
131 margin-right: auto;
132}
133
134DIV.table TABLE TD {
135 border: solid thin #cccccc;
136 padding-top: 5pt;
137}
138
139DIV.table TABLE TH {
140 background: #cccccc;
141 border: none;
142 border-bottom: solid thin #999999;
143}
144
145DIV.figure TABLE {
146 margin-left: auto;
147 margin-right: auto;
148}
149
150DIV.figure CAPTION {
151 caption-side: bottom;
152 font-size: 120%;
153 font-style: italic;
154 font-weight: bold;
155 margin-left: auto;
156 margin-right: auto;
157}
158
159TH.label {
5a738aea
MS
160 text-align: right;
161 vertical-align: top;
162}
163
e4572d57
MS
164TH.sublabel {
165 text-align: right;
166 font-weight: normal;
167}
168
5a738aea
MS
169HR {
170 border: solid thin;
171}
172
173SPAN.info {
e4572d57
MS
174 background: black;
175 border: thin solid black;
176 color: white;
5a738aea
MS
177 font-size: 80%;
178 font-style: italic;
179 font-weight: bold;
180 white-space: nowrap;
181}
182
183H2 SPAN.info, H3 SPAN.info, H4 SPAN.info {
184 float: right;
185 font-size: 100%;
186}
187
178cb736
MS
188H1.title {
189}
190
5a738aea
MS
191H2.title, H3.title {
192 border-bottom: solid 2pt #000000;
193}
194
e4572d57
MS
195DIV.indent, TABLE.indent {
196 margin-top: 2em;
197 margin-left: auto;
198 margin-right: auto;
199 width: 90%;
200}
201
202TABLE.indent {
203 border-collapse: collapse;
204}
205
206TABLE.indent TD, TABLE.indent TH {
207 padding: 0;
208}
209
210TABLE.list {
211 border-collapse: collapse;
212 margin-left: auto;
213 margin-right: auto;
214 width: 90%;
215}
216
217TABLE.list TH {
218 background: white;
219 border-bottom: solid thin #cccccc;
220 color: #444444;
221 padding-top: 10pt;
222 padding-left: 5pt;
223 text-align: left;
224 vertical-align: bottom;
225 white-space: nowrap;
226}
227
228TABLE.list TH A {
229 color: #4444cc;
230}
231
232TABLE.list TD {
233 border-bottom: solid thin #eeeeee;
234 padding-top: 5pt;
235 padding-left: 5pt;
236}
237
238TABLE.list TR:nth-child(even) {
239 background: #f8f8f8;
240}
241
242TABLE.list TR:nth-child(odd) {
243 background: #f4f4f4;
244}
245
5a738aea
MS
246DT {
247 margin-left: 36pt;
248 margin-top: 12pt;
249}
250
251DD {
252 margin-left: 54pt;
253}
254
255DL.category DT {
256 font-weight: bold;
257}
258
259P.summary {
260 margin-left: 36pt;
261 font-family: monaco, courier, monospace;
262}
263
5a738aea
MS
264DIV.summary TABLE {
265 border: solid thin #999999;
266 border-collapse: collapse;
267 border-spacing: 0;
268 margin: 10px;
269}
270
271DIV.summary TABLE TD, DIV.summary TABLE TH {
272 border: solid thin #999999;
273 padding: 5px;
274 text-align: left;
275 vertical-align: top;
276}
277
278DIV.summary TABLE THEAD TH {
279 background: #eeeeee;
280}
281
282/* API documentation styles... */
283div.body h1 {
284 margin: 0;
285}
286div.body h2 {
287 margin-top: 1.5em;
288}
289div.body h3, div.body h4, div.body h5 {
290 margin-bottom: 0.5em;
291 margin-top: 1.5em;
292}
293.class, .enumeration, .function, .struct, .typedef, .union {
294 border-bottom: solid thin #999999;
295 margin-bottom: 0;
296 margin-top: 2em;
297}
298.description {
299 margin-top: 0.5em;
300}
301code, p.code, pre, ul.code li {
302 font-family: monaco, courier, monospace;
303 font-size: 90%;
304}
305ul.code, ul.contents, ul.subcontents {
306 list-style-type: none;
307 margin: 0;
308 padding-left: 0;
309}
310ul.code li {
311 margin: 0;
312}
313ul.contents > li {
314 margin-top: 1em;
315}
316ul.contents li ul.code, ul.contents li ul.subcontents {
317 padding-left: 2em;
318}
319div.body dl {
320 margin-left: 0;
321 margin-top: 0;
322}
323div.body dt {
324 font-style: italic;
325 margin-left: 0;
326 margin-top: 0;
327}
328div.body dd {
329 margin-bottom: 0.5em;
330}
331
332/* This is just for the HTML files generated with the framedhelp target */
333div.contents {
334 background: #e8e8e8;
335 border: solid thin black;
336 padding: 10px;
337}
338div.contents h1 {
339 font-size: 110%;
340}
341div.contents h2 {
342 font-size: 100%;
343}
344div.contents ul.contents {
345 font-size: 80%;
346}
ac884b6a
MS
347div.contents ul.subcontents li {
348 margin-left: 1em;
349 text-indent: -1em;
350}
5a738aea 351--></style>
ef416fc2 352</head>
353<body>
5a738aea 354<div class='body'>
ef416fc2 355<!--
9c0e8e5d 356 "$Id: api-httpipp.header 7258 2008-01-28 00:15:05Z mike $"
5a738aea 357
321d8d57 358 HTTP and IPP API header for CUPS.
5a738aea 359
321d8d57 360 Copyright 2007-2011 by Apple Inc.
5a738aea
MS
361 Copyright 1997-2006 by Easy Software Products, all rights reserved.
362
363 These coded instructions, statements, and computer programs are the
364 property of Apple Inc. and are protected by Federal copyright
365 law. Distribution and use rights are outlined in the file "LICENSE.txt"
366 which should have been included with this file. If this file is
367 file is missing or damaged, see the license at "http://www.cups.org/".
368-->
369
178cb736
MS
370<h1 class='title'>HTTP and IPP APIs</h1>
371
5a738aea
MS
372<div class='summary'><table summary='General Information'>
373<thead>
374<tr>
375 <th>Header</th>
376 <th>cups/cups.h</th>
377</tr>
378</thead>
379<tbody>
380<tr>
381 <th>Library</th>
382 <td>-lcups</td>
383</tr>
384<tr>
385 <th>See Also</th>
386 <td>Programming: <a href='api-overview.html'>Introduction to CUPS Programming</a><br>
387 Programming: <a href='api-cups.html'>CUPS API</a><br>
388 References: <a href='spec-ipp.html'>CUPS Implementation of IPP</a></td>
389</tr>
390</tbody>
391</table></div>
392<h2 class="title">Contents</h2>
393<ul class="contents">
5a738aea 394<li><a href="#OVERVIEW">Overview</a><ul class="subcontents">
0268488e
MS
395 <li><a href="#CREATING_URI_STRINGS">Creating URI Strings</a></li>
396 <li><a href="#SENDING_REQUESTS_WITH_FILES">Sending Requests with Files</a></li>
397 <li><a href="#ASYNCHRONOUS_REQUEST_PROCESSING">Asynchronous Request Processing</a></li>
5a738aea
MS
398</ul></li>
399<li><a href="#FUNCTIONS">Functions</a><ul class="code">
0268488e
MS
400 <li><a href="#cupsDoAuthentication" title="Authenticate a request.">cupsDoAuthentication</a></li>
401 <li><a href="#cupsDoFileRequest" title="Do an IPP request with a file.">cupsDoFileRequest</a></li>
402 <li><a href="#cupsDoIORequest" title="Do an IPP request with file descriptors.">cupsDoIORequest</a></li>
403 <li><a href="#cupsDoRequest" title="Do an IPP request.">cupsDoRequest</a></li>
404 <li><a href="#cupsEncodeOptions" title="Encode printer options into IPP attributes.">cupsEncodeOptions</a></li>
405 <li><a href="#cupsEncodeOptions2" title="Encode printer options into IPP attributes for a group.">cupsEncodeOptions2</a></li>
406 <li><a href="#cupsGetDevices" title="Get available printer devices.">cupsGetDevices</a></li>
407 <li><a href="#cupsGetFd" title="Get a file from the server.">cupsGetFd</a></li>
408 <li><a href="#cupsGetFile" title="Get a file from the server.">cupsGetFile</a></li>
409 <li><a href="#cupsGetResponse" title="Get a response to an IPP request.">cupsGetResponse</a></li>
5a9febac
MS
410 <li><a href="#cupsLastError" title="Return the last IPP status code received on the current
411thread.">cupsLastError</a></li>
412 <li><a href="#cupsLastErrorString" title="Return the last IPP status-message received on the
413current thread.">cupsLastErrorString</a></li>
0268488e
MS
414 <li><a href="#cupsPutFd" title="Put a file on the server.">cupsPutFd</a></li>
415 <li><a href="#cupsPutFile" title="Put a file on the server.">cupsPutFile</a></li>
416 <li><a href="#cupsReadResponseData" title="Read additional data after the IPP response.">cupsReadResponseData</a></li>
417 <li><a href="#cupsSendRequest" title="Send an IPP request.">cupsSendRequest</a></li>
418 <li><a href="#cupsWriteRequestData" title="Write additional data after an IPP request.">cupsWriteRequestData</a></li>
a469f8a5
MS
419 <li><a href="#httpAcceptConnection" title="Accept a new HTTP client connection from the
420specified listening socket.">httpAcceptConnection</a></li>
0268488e
MS
421 <li><a href="#httpAddCredential" title="Allocates and adds a single credential to an array.">httpAddCredential</a></li>
422 <li><a href="#httpAddrAny" title="Check for the &quot;any&quot; address.">httpAddrAny</a></li>
ca6b43fc
MS
423 <li><a href="#httpAddrClose" title="Close a socket created by httpAddrConnect or
424httpAddrListen.">httpAddrClose</a></li>
0268488e 425 <li><a href="#httpAddrEqual" title="Compare two addresses.">httpAddrEqual</a></li>
ca6b43fc 426 <li><a href="#httpAddrFamily" title="Get the address family of an address.">httpAddrFamily</a></li>
0268488e 427 <li><a href="#httpAddrLength" title="Return the length of the address in bytes.">httpAddrLength</a></li>
a469f8a5
MS
428 <li><a href="#httpAddrListen" title="Create a listening socket bound to the specified
429address and port.">httpAddrListen</a></li>
0268488e
MS
430 <li><a href="#httpAddrLocalhost" title="Check for the local loopback address.">httpAddrLocalhost</a></li>
431 <li><a href="#httpAddrLookup" title="Lookup the hostname associated with the address.">httpAddrLookup</a></li>
a469f8a5 432 <li><a href="#httpAddrPort" title="Get the port number associated with an address.">httpAddrPort</a></li>
0268488e
MS
433 <li><a href="#httpAddrString" title="Convert an address to a numeric string.">httpAddrString</a></li>
434 <li><a href="#httpAssembleURI" title="Assemble a uniform resource identifier from its
5a738aea 435components.">httpAssembleURI</a></li>
0268488e 436 <li><a href="#httpAssembleURIf" title="Assemble a uniform resource identifier from its
5a738aea 437components with a formatted resource.">httpAssembleURIf</a></li>
db8b865d 438 <li><a href="#httpAssembleUUID" title="Assemble a name-based UUID URN conforming to RFC 4122.">httpAssembleUUID</a></li>
0268488e
MS
439 <li><a href="#httpBlocking" title="Set blocking/non-blocking behavior on a connection.">httpBlocking</a></li>
440 <li><a href="#httpCheck" title="Check to see if there is a pending response from the server.">httpCheck</a></li>
441 <li><a href="#httpClearCookie" title="Clear the cookie value(s).">httpClearCookie</a></li>
442 <li><a href="#httpClearFields" title="Clear HTTP request fields.">httpClearFields</a></li>
443 <li><a href="#httpClose" title="Close an HTTP connection.">httpClose</a></li>
ca6b43fc 444 <li><a href="#httpCompareCredentials" title="Compare two sets of X.509 credentials.">httpCompareCredentials</a></li>
0268488e 445 <li><a href="#httpConnect" title="Connect to a HTTP server.">httpConnect</a></li>
a469f8a5 446 <li><a href="#httpConnect2" title="Connect to a HTTP server.">httpConnect2</a></li>
0268488e 447 <li><a href="#httpConnectEncrypt" title="Connect to a HTTP server using encryption.">httpConnectEncrypt</a></li>
0268488e
MS
448 <li><a href="#httpDecode64" title="Base64-decode a string.">httpDecode64</a></li>
449 <li><a href="#httpDecode64_2" title="Base64-decode a string.">httpDecode64_2</a></li>
450 <li><a href="#httpDelete" title="Send a DELETE request to the server.">httpDelete</a></li>
451 <li><a href="#httpEncode64" title="Base64-encode a string.">httpEncode64</a></li>
452 <li><a href="#httpEncode64_2" title="Base64-encode a string.">httpEncode64_2</a></li>
453 <li><a href="#httpEncryption" title="Set the required encryption on the link.">httpEncryption</a></li>
454 <li><a href="#httpError" title="Get the last error on a connection.">httpError</a></li>
ca6b43fc
MS
455 <li><a href="#httpFieldValue" title="Return the HTTP field enumeration value for a field
456name.">httpFieldValue</a></li>
0268488e
MS
457 <li><a href="#httpFlush" title="Flush data from a HTTP connection.">httpFlush</a></li>
458 <li><a href="#httpFlushWrite" title="Flush data in write buffer.">httpFlushWrite</a></li>
459 <li><a href="#httpFreeCredentials" title="Free an array of credentials.">httpFreeCredentials</a></li>
460 <li><a href="#httpGet" title="Send a GET request to the server.">httpGet</a></li>
ca6b43fc
MS
461 <li><a href="#httpGetActivity" title="Get the most recent activity for a connection.">httpGetActivity</a></li>
462 <li><a href="#httpGetAddress" title="Get the address of the connected peer of a connection.">httpGetAddress</a></li>
0268488e
MS
463 <li><a href="#httpGetAuthString" title="Get the current authorization string.">httpGetAuthString</a></li>
464 <li><a href="#httpGetBlocking" title="Get the blocking/non-block state of a connection.">httpGetBlocking</a></li>
a469f8a5
MS
465 <li><a href="#httpGetContentEncoding" title="Get a common content encoding, if any, between
466the client and server.">httpGetContentEncoding</a></li>
0268488e
MS
467 <li><a href="#httpGetCookie" title="Get any cookie data from the response.">httpGetCookie</a></li>
468 <li><a href="#httpGetDateString" title="Get a formatted date/time string from a time value.">httpGetDateString</a></li>
469 <li><a href="#httpGetDateString2" title="Get a formatted date/time string from a time value.">httpGetDateString2</a></li>
470 <li><a href="#httpGetDateTime" title="Get a time value from a formatted date/time string.">httpGetDateTime</a></li>
ca6b43fc 471 <li><a href="#httpGetEncryption" title="Get the current encryption mode of a connection.">httpGetEncryption</a></li>
a469f8a5 472 <li><a href="#httpGetExpect" title="Get the value of the Expect header, if any.">httpGetExpect</a></li>
0268488e
MS
473 <li><a href="#httpGetFd" title="Get the file descriptor associated with a connection.">httpGetFd</a></li>
474 <li><a href="#httpGetField" title="Get a field value from a request/response.">httpGetField</a></li>
475 <li><a href="#httpGetHostByName" title="Lookup a hostname or IPv4 address, and return
5a738aea 476address records for the specified name.">httpGetHostByName</a></li>
0268488e 477 <li><a href="#httpGetHostname" title="Get the FQDN for the connection or local system.">httpGetHostname</a></li>
ca6b43fc 478 <li><a href="#httpGetKeepAlive" title="Get the current Keep-Alive state of the connection.">httpGetKeepAlive</a></li>
0268488e 479 <li><a href="#httpGetLength" title="Get the amount of data remaining from the
5a738aea 480content-length or transfer-encoding fields.">httpGetLength</a></li>
0268488e 481 <li><a href="#httpGetLength2" title="Get the amount of data remaining from the
5a738aea 482content-length or transfer-encoding fields.">httpGetLength2</a></li>
ca6b43fc
MS
483 <li><a href="#httpGetPending" title="Get the number of bytes that are buffered for writing.">httpGetPending</a></li>
484 <li><a href="#httpGetReady" title="Get the number of bytes that can be read without blocking.">httpGetReady</a></li>
485 <li><a href="#httpGetRemaining" title="Get the number of remaining bytes in the message
486body or current chunk.">httpGetRemaining</a></li>
a2326b5b 487 <li><a href="#httpGetState" title="Get the current state of the HTTP request.">httpGetState</a></li>
0268488e
MS
488 <li><a href="#httpGetStatus" title="Get the status of the last HTTP request.">httpGetStatus</a></li>
489 <li><a href="#httpGetSubField" title="Get a sub-field value.">httpGetSubField</a></li>
490 <li><a href="#httpGetSubField2" title="Get a sub-field value.">httpGetSubField2</a></li>
a2326b5b 491 <li><a href="#httpGetVersion" title="Get the HTTP version at the other end.">httpGetVersion</a></li>
0268488e
MS
492 <li><a href="#httpGets" title="Get a line of text from a HTTP connection.">httpGets</a></li>
493 <li><a href="#httpHead" title="Send a HEAD request to the server.">httpHead</a></li>
494 <li><a href="#httpInitialize" title="Initialize the HTTP interface library and set the
5a738aea 495default HTTP proxy (if any).">httpInitialize</a></li>
ca6b43fc
MS
496 <li><a href="#httpIsChunked" title="Report whether a message body is chunked.">httpIsChunked</a></li>
497 <li><a href="#httpIsEncrypted" title="Report whether a connection is encrypted.">httpIsEncrypted</a></li>
0268488e
MS
498 <li><a href="#httpMD5" title="Compute the MD5 sum of the username:group:password.">httpMD5</a></li>
499 <li><a href="#httpMD5Final" title="Combine the MD5 sum of the username, group, and password
5a738aea
MS
500with the server-supplied nonce value, method, and
501request-uri.">httpMD5Final</a></li>
0268488e
MS
502 <li><a href="#httpMD5String" title="Convert an MD5 sum to a character string.">httpMD5String</a></li>
503 <li><a href="#httpOptions" title="Send an OPTIONS request to the server.">httpOptions</a></li>
a469f8a5 504 <li><a href="#httpPeek" title="Peek at data from a HTTP connection.">httpPeek</a></li>
0268488e
MS
505 <li><a href="#httpPost" title="Send a POST request to the server.">httpPost</a></li>
506 <li><a href="#httpPut" title="Send a PUT request to the server.">httpPut</a></li>
507 <li><a href="#httpRead" title="Read data from a HTTP connection.">httpRead</a></li>
508 <li><a href="#httpRead2" title="Read data from a HTTP connection.">httpRead2</a></li>
a469f8a5 509 <li><a href="#httpReadRequest" title="Read a HTTP request from a connection.">httpReadRequest</a></li>
0268488e 510 <li><a href="#httpReconnect" title="Reconnect to a HTTP server.">httpReconnect</a></li>
3e7fe0ca
MS
511 <li><a href="#httpReconnect2" title="Reconnect to a HTTP server with timeout and optional
512cancel.">httpReconnect2</a></li>
ca6b43fc
MS
513 <li><a href="#httpResolveHostname" title="Resolve the hostname of the HTTP connection
514address.">httpResolveHostname</a></li>
0268488e 515 <li><a href="#httpSeparate" title="Separate a Universal Resource Identifier into its
5a738aea 516components.">httpSeparate</a></li>
0268488e 517 <li><a href="#httpSeparate2" title="Separate a Universal Resource Identifier into its
5a738aea 518components.">httpSeparate2</a></li>
0268488e 519 <li><a href="#httpSeparateURI" title="Separate a Universal Resource Identifier into its
5a738aea 520components.">httpSeparateURI</a></li>
0268488e
MS
521 <li><a href="#httpSetAuthString" title="Set the current authorization string.">httpSetAuthString</a></li>
522 <li><a href="#httpSetCookie" title="Set the cookie value(s).">httpSetCookie</a></li>
523 <li><a href="#httpSetCredentials" title="Set the credentials associated with an encrypted
10d09e33 524connection.">httpSetCredentials</a></li>
db8b865d 525 <li><a href="#httpSetDefaultField" title="Set the default value of an HTTP header.">httpSetDefaultField</a></li>
0268488e
MS
526 <li><a href="#httpSetExpect" title="Set the Expect: header in a request.">httpSetExpect</a></li>
527 <li><a href="#httpSetField" title="Set the value of an HTTP header.">httpSetField</a></li>
ca6b43fc 528 <li><a href="#httpSetKeepAlive" title="Set the current Keep-Alive state of a connection.">httpSetKeepAlive</a></li>
0268488e 529 <li><a href="#httpSetLength" title="Set the content-length and content-encoding.">httpSetLength</a></li>
f228370c 530 <li><a href="#httpSetTimeout" title="Set read/write timeouts and an optional callback.">httpSetTimeout</a></li>
ca6b43fc
MS
531 <li><a href="#httpShutdown" title="Shutdown one side of an HTTP connection.">httpShutdown</a></li>
532 <li><a href="#httpStateString" title="Return the string describing a HTTP state value.">httpStateString</a></li>
0268488e
MS
533 <li><a href="#httpStatus" title="Return a short string describing a HTTP status code.">httpStatus</a></li>
534 <li><a href="#httpTrace" title="Send an TRACE request to the server.">httpTrace</a></li>
ca6b43fc 535 <li><a href="#httpURIStatusString" title="Return a string describing a URI status code.">httpURIStatusString</a></li>
0268488e
MS
536 <li><a href="#httpUpdate" title="Update the current HTTP state for incoming data.">httpUpdate</a></li>
537 <li><a href="#httpWait" title="Wait for data available on a connection.">httpWait</a></li>
538 <li><a href="#httpWrite" title="Write data to a HTTP connection.">httpWrite</a></li>
539 <li><a href="#httpWrite2" title="Write data to a HTTP connection.">httpWrite2</a></li>
a469f8a5 540 <li><a href="#httpWriteResponse" title="Write a HTTP response to a client connection.">httpWriteResponse</a></li>
0268488e
MS
541 <li><a href="#ippAddBoolean" title="Add a boolean attribute to an IPP message.">ippAddBoolean</a></li>
542 <li><a href="#ippAddBooleans" title="Add an array of boolean values.">ippAddBooleans</a></li>
543 <li><a href="#ippAddCollection" title="Add a collection value.">ippAddCollection</a></li>
544 <li><a href="#ippAddCollections" title="Add an array of collection values.">ippAddCollections</a></li>
545 <li><a href="#ippAddDate" title="Add a date attribute to an IPP message.">ippAddDate</a></li>
546 <li><a href="#ippAddInteger" title="Add a integer attribute to an IPP message.">ippAddInteger</a></li>
547 <li><a href="#ippAddIntegers" title="Add an array of integer values.">ippAddIntegers</a></li>
548 <li><a href="#ippAddOctetString" title="Add an octetString value to an IPP message.">ippAddOctetString</a></li>
a2326b5b 549 <li><a href="#ippAddOutOfBand" title="Add an out-of-band value to an IPP message.">ippAddOutOfBand</a></li>
0268488e
MS
550 <li><a href="#ippAddRange" title="Add a range of values to an IPP message.">ippAddRange</a></li>
551 <li><a href="#ippAddRanges" title="Add ranges of values to an IPP message.">ippAddRanges</a></li>
552 <li><a href="#ippAddResolution" title="Add a resolution value to an IPP message.">ippAddResolution</a></li>
553 <li><a href="#ippAddResolutions" title="Add resolution values to an IPP message.">ippAddResolutions</a></li>
554 <li><a href="#ippAddSeparator" title="Add a group separator to an IPP message.">ippAddSeparator</a></li>
555 <li><a href="#ippAddString" title="Add a language-encoded string to an IPP message.">ippAddString</a></li>
a469f8a5
MS
556 <li><a href="#ippAddStringf" title="Add a formatted string to an IPP message.">ippAddStringf</a></li>
557 <li><a href="#ippAddStringfv" title="Add a formatted string to an IPP message.">ippAddStringfv</a></li>
0268488e 558 <li><a href="#ippAddStrings" title="Add language-encoded strings to an IPP message.">ippAddStrings</a></li>
a2326b5b 559 <li><a href="#ippAttributeString" title="Convert the attribute's value to a string.">ippAttributeString</a></li>
a469f8a5
MS
560 <li><a href="#ippContainsInteger" title="Determine whether an attribute contains the
561specified value or is within the list of ranges.">ippContainsInteger</a></li>
562 <li><a href="#ippContainsString" title="Determine whether an attribute contains the
563specified string value.">ippContainsString</a></li>
a2326b5b
MS
564 <li><a href="#ippCopyAttribute" title="Copy an attribute.">ippCopyAttribute</a></li>
565 <li><a href="#ippCopyAttributes" title="Copy attributes from one IPP message to another.">ippCopyAttributes</a></li>
db8b865d
MS
566 <li><a href="#ippCreateRequestedArray" title="Create a CUPS array of attribute names from the
567given requested-attributes attribute.">ippCreateRequestedArray</a></li>
0268488e 568 <li><a href="#ippDateToTime" title="Convert from RFC 1903 Date/Time format to UNIX time
5a738aea 569in seconds.">ippDateToTime</a></li>
0268488e
MS
570 <li><a href="#ippDelete" title="Delete an IPP message.">ippDelete</a></li>
571 <li><a href="#ippDeleteAttribute" title="Delete a single attribute in an IPP message.">ippDeleteAttribute</a></li>
a2326b5b
MS
572 <li><a href="#ippDeleteValues" title="Delete values in an attribute.">ippDeleteValues</a></li>
573 <li><a href="#ippEnumString" title="Return a string corresponding to the enum value.">ippEnumString</a></li>
574 <li><a href="#ippEnumValue" title="Return the value associated with a given enum string.">ippEnumValue</a></li>
0268488e
MS
575 <li><a href="#ippErrorString" title="Return a name for the given status code.">ippErrorString</a></li>
576 <li><a href="#ippErrorValue" title="Return a status code for the given name.">ippErrorValue</a></li>
3e7fe0ca
MS
577 <li><a href="#ippFindAttribute" title="Find a named attribute in a request.">ippFindAttribute</a></li>
578 <li><a href="#ippFindNextAttribute" title="Find the next named attribute in a request.">ippFindNextAttribute</a></li>
a2326b5b
MS
579 <li><a href="#ippFirstAttribute" title="Return the first attribute in the message.">ippFirstAttribute</a></li>
580 <li><a href="#ippGetBoolean" title="Get a boolean value for an attribute.">ippGetBoolean</a></li>
581 <li><a href="#ippGetCollection" title="Get a collection value for an attribute.">ippGetCollection</a></li>
582 <li><a href="#ippGetCount" title="Get the number of values in an attribute.">ippGetCount</a></li>
3e7fe0ca 583 <li><a href="#ippGetDate" title="Get a date value for an attribute.">ippGetDate</a></li>
a2326b5b
MS
584 <li><a href="#ippGetGroupTag" title="Get the group associated with an attribute.">ippGetGroupTag</a></li>
585 <li><a href="#ippGetInteger" title="Get the integer/enum value for an attribute.">ippGetInteger</a></li>
586 <li><a href="#ippGetName" title="Get the attribute name.">ippGetName</a></li>
6961465f 587 <li><a href="#ippGetOctetString" title="Get an octetString value from an IPP attribute.">ippGetOctetString</a></li>
a2326b5b 588 <li><a href="#ippGetOperation" title="Get the operation ID in an IPP message.">ippGetOperation</a></li>
3e7fe0ca 589 <li><a href="#ippGetRange" title="Get a rangeOfInteger value from an attribute.">ippGetRange</a></li>
a2326b5b
MS
590 <li><a href="#ippGetRequestId" title="Get the request ID from an IPP message.">ippGetRequestId</a></li>
591 <li><a href="#ippGetResolution" title="Get a resolution value for an attribute.">ippGetResolution</a></li>
3e7fe0ca 592 <li><a href="#ippGetState" title="Get the IPP message state.">ippGetState</a></li>
a2326b5b
MS
593 <li><a href="#ippGetStatusCode" title="Get the status code from an IPP response or event message.">ippGetStatusCode</a></li>
594 <li><a href="#ippGetString" title="Return the value...">ippGetString</a></li>
595 <li><a href="#ippGetValueTag" title="Get the value tag for an attribute.">ippGetValueTag</a></li>
596 <li><a href="#ippGetVersion" title="Get the major and minor version number from an IPP message.">ippGetVersion</a></li>
0268488e
MS
597 <li><a href="#ippLength" title="Compute the length of an IPP message.">ippLength</a></li>
598 <li><a href="#ippNew" title="Allocate a new IPP message.">ippNew</a></li>
599 <li><a href="#ippNewRequest" title="Allocate a new IPP request message.">ippNewRequest</a></li>
a469f8a5 600 <li><a href="#ippNewResponse" title="Allocate a new IPP response message.">ippNewResponse</a></li>
a2326b5b 601 <li><a href="#ippNextAttribute" title="Return the next attribute in the message.">ippNextAttribute</a></li>
0268488e
MS
602 <li><a href="#ippOpString" title="Return a name for the given operation id.">ippOpString</a></li>
603 <li><a href="#ippOpValue" title="Return an operation id for the given name.">ippOpValue</a></li>
604 <li><a href="#ippPort" title="Return the default IPP port number.">ippPort</a></li>
605 <li><a href="#ippRead" title="Read data for an IPP message from a HTTP connection.">ippRead</a></li>
606 <li><a href="#ippReadFile" title="Read data for an IPP message from a file.">ippReadFile</a></li>
607 <li><a href="#ippReadIO" title="Read data for an IPP message.">ippReadIO</a></li>
a2326b5b
MS
608 <li><a href="#ippSetBoolean" title="Set a boolean value in an attribute.">ippSetBoolean</a></li>
609 <li><a href="#ippSetCollection" title="Set a collection value in an attribute.">ippSetCollection</a></li>
3e7fe0ca 610 <li><a href="#ippSetDate" title="Set a date value in an attribute.">ippSetDate</a></li>
a2326b5b
MS
611 <li><a href="#ippSetGroupTag" title="Set the group tag of an attribute.">ippSetGroupTag</a></li>
612 <li><a href="#ippSetInteger" title="Set an integer or enum value in an attribute.">ippSetInteger</a></li>
613 <li><a href="#ippSetName" title="Set the name of an attribute.">ippSetName</a></li>
6961465f 614 <li><a href="#ippSetOctetString" title="Set an octetString value in an IPP attribute.">ippSetOctetString</a></li>
a2326b5b 615 <li><a href="#ippSetOperation" title="Set the operation ID in an IPP request message.">ippSetOperation</a></li>
0268488e 616 <li><a href="#ippSetPort" title="Set the default port number.">ippSetPort</a></li>
a2326b5b
MS
617 <li><a href="#ippSetRange" title="Set a rangeOfInteger value in an attribute.">ippSetRange</a></li>
618 <li><a href="#ippSetRequestId" title="Set the request ID in an IPP message.">ippSetRequestId</a></li>
619 <li><a href="#ippSetResolution" title="Set a resolution value in an attribute.">ippSetResolution</a></li>
3e7fe0ca 620 <li><a href="#ippSetState" title="Set the current state of the IPP message.">ippSetState</a></li>
a2326b5b
MS
621 <li><a href="#ippSetStatusCode" title="Set the status code in an IPP response or event message.">ippSetStatusCode</a></li>
622 <li><a href="#ippSetString" title="Set a string value in an attribute.">ippSetString</a></li>
a469f8a5
MS
623 <li><a href="#ippSetStringf" title="Set a formatted string value of an attribute.">ippSetStringf</a></li>
624 <li><a href="#ippSetStringfv" title="Set a formatted string value of an attribute.">ippSetStringfv</a></li>
a2326b5b
MS
625 <li><a href="#ippSetValueTag" title="Set the value tag of an attribute.">ippSetValueTag</a></li>
626 <li><a href="#ippSetVersion" title="Set the version number in an IPP message.">ippSetVersion</a></li>
ca6b43fc 627 <li><a href="#ippStateString" title="Return the name corresponding to a state value.">ippStateString</a></li>
0268488e
MS
628 <li><a href="#ippTagString" title="Return the tag name corresponding to a tag value.">ippTagString</a></li>
629 <li><a href="#ippTagValue" title="Return the tag value corresponding to a tag name.">ippTagValue</a></li>
630 <li><a href="#ippTimeToDate" title="Convert from UNIX time to RFC 1903 format.">ippTimeToDate</a></li>
db8b865d
MS
631 <li><a href="#ippValidateAttribute" title="Validate the contents of an attribute.">ippValidateAttribute</a></li>
632 <li><a href="#ippValidateAttributes" title="Validate all attributes in an IPP message.">ippValidateAttributes</a></li>
0268488e
MS
633 <li><a href="#ippWrite" title="Write data for an IPP message to a HTTP connection.">ippWrite</a></li>
634 <li><a href="#ippWriteFile" title="Write data for an IPP message to a file.">ippWriteFile</a></li>
635 <li><a href="#ippWriteIO" title="Write data for an IPP message.">ippWriteIO</a></li>
8b450588 636</ul></li>
5a738aea 637<li><a href="#TYPES">Data Types</a><ul class="code">
eac3a0a0 638 <li><a href="#gss_auth_identity_desc" title="Local functions...">gss_auth_identity_desc</a></li>
f11a948a
MS
639 <li><a href="#http_addr_t" title="Socket address union, which
640makes using IPv6 and other
641address types easier and
642more portable. ">http_addr_t</a></li>
5a738aea
MS
643 <li><a href="#http_addrlist_t" title="Socket address list, which is
644used to enumerate all of the
645addresses that are associated
646with a hostname. ">http_addrlist_t</a></li>
647 <li><a href="#http_auth_t" title="HTTP authentication types">http_auth_t</a></li>
f228370c 648 <li><a href="#http_credential_t" title="HTTP credential data ">http_credential_t</a></li>
5a738aea
MS
649 <li><a href="#http_encoding_t" title="HTTP transfer encoding values">http_encoding_t</a></li>
650 <li><a href="#http_encryption_t" title="HTTP encryption values">http_encryption_t</a></li>
79e1d494 651 <li><a href="#http_field_t" title="HTTP field names">http_field_t</a></li>
f11a948a
MS
652 <li><a href="#http_keepalive_t" title="HTTP keep-alive values">http_keepalive_t</a></li>
653 <li><a href="#http_state_t" title="HTTP state values; states
654are server-oriented...">http_state_t</a></li>
5a738aea 655 <li><a href="#http_t" title="HTTP connection type">http_t</a></li>
f228370c 656 <li><a href="#http_timeout_cb_t" title="HTTP timeout callback ">http_timeout_cb_t</a></li>
240214ef 657 <li><a href="#http_trust_t" title="Level of trust for credentials ">http_trust_t</a></li>
f11a948a
MS
658 <li><a href="#http_uri_coding_t" title="URI en/decode flags">http_uri_coding_t</a></li>
659 <li><a href="#http_uri_status_t" title="URI separation status ">http_uri_status_t</a></li>
660 <li><a href="#http_version_t" title="HTTP version numbers">http_version_t</a></li>
a2326b5b 661 <li><a href="#ipp_attribute_t" title="IPP attribute">ipp_attribute_t</a></li>
f3c17241
MS
662 <li><a href="#ipp_copycb_t" title="The following structures are PRIVATE starting with CUPS 1.6/OS X 10.8.
663Please use the new accessor functions available in CUPS 1.6 and later, as
664these definitions will be moved to a private header file in a future release.">ipp_copycb_t</a></li>
a2326b5b 665 <li><a href="#ipp_dstate_t" title="Document states">ipp_dstate_t</a></li>
a469f8a5 666 <li><a href="#ipp_finish_t" title="Job collation types">ipp_finish_t</a></li>
5a738aea 667 <li><a href="#ipp_iocb_t" title="IPP IO Callback Function ">ipp_iocb_t</a></li>
a2326b5b 668 <li><a href="#ipp_jcollate_t" title="Job collation types">ipp_jcollate_t</a></li>
aaf19ab0
MS
669 <li><a href="#ipp_orient_t" title="Orientation values">ipp_orient_t</a></li>
670 <li><a href="#ipp_pstate_t" title="Printer states">ipp_pstate_t</a></li>
671 <li><a href="#ipp_quality_t" title="Qualities">ipp_quality_t</a></li>
aaf19ab0
MS
672 <li><a href="#ipp_res_t" title="Resolution units">ipp_res_t</a></li>
673 <li><a href="#ipp_state_t" title="IPP states">ipp_state_t</a></li>
a2326b5b
MS
674 <li><a href="#ipp_t" title="IPP request/response data">ipp_t</a></li>
675 <li><a href="#ipp_uchar_t" title="Unsigned 8-bit integer/character">ipp_uchar_t</a></li>
5a738aea
MS
676</ul></li>
677<li><a href="#STRUCTURES">Structures</a><ul class="code">
eac3a0a0 678 <li><a href="#gss_auth_identity" title="Local functions...">gss_auth_identity</a></li>
5a738aea
MS
679 <li><a href="#http_addrlist_s" title="Socket address list, which is
680used to enumerate all of the
681addresses that are associated
682with a hostname. ">http_addrlist_s</a></li>
f228370c 683 <li><a href="#http_credential_s" title="HTTP credential data ">http_credential_s</a></li>
f3c17241 684 <li><a href="#pollfd" title="User data (unused)">pollfd</a></li>
5a738aea
MS
685</ul></li>
686<li><a href="#ENUMERATIONS">Constants</a><ul class="code">
687 <li><a href="#http_auth_e" title="HTTP authentication types">http_auth_e</a></li>
688 <li><a href="#http_encoding_e" title="HTTP transfer encoding values">http_encoding_e</a></li>
689 <li><a href="#http_encryption_e" title="HTTP encryption values">http_encryption_e</a></li>
690 <li><a href="#http_field_e" title="HTTP field names">http_field_e</a></li>
f11a948a
MS
691 <li><a href="#http_keepalive_e" title="HTTP keep-alive values">http_keepalive_e</a></li>
692 <li><a href="#http_state_e" title="HTTP state values; states
693are server-oriented...">http_state_e</a></li>
5a738aea 694 <li><a href="#http_status_e" title="HTTP status codes">http_status_e</a></li>
240214ef 695 <li><a href="#http_trust_e" title="Level of trust for credentials ">http_trust_e</a></li>
f11a948a
MS
696 <li><a href="#http_uri_coding_e" title="URI en/decode flags">http_uri_coding_e</a></li>
697 <li><a href="#http_uri_status_e" title="URI separation status ">http_uri_status_e</a></li>
698 <li><a href="#http_version_e" title="HTTP version numbers">http_version_e</a></li>
a2326b5b 699 <li><a href="#ipp_dstate_e" title="Document states">ipp_dstate_e</a></li>
a469f8a5 700 <li><a href="#ipp_finishings_e" title="Finishings">ipp_finishings_e</a></li>
a2326b5b 701 <li><a href="#ipp_jcollate_e" title="Job collation types">ipp_jcollate_e</a></li>
aaf19ab0
MS
702 <li><a href="#ipp_jstate_e" title="Job states">ipp_jstate_e</a></li>
703 <li><a href="#ipp_op_e" title="IPP operations">ipp_op_e</a></li>
704 <li><a href="#ipp_orient_e" title="Orientation values">ipp_orient_e</a></li>
705 <li><a href="#ipp_pstate_e" title="Printer states">ipp_pstate_e</a></li>
706 <li><a href="#ipp_quality_e" title="Qualities">ipp_quality_e</a></li>
707 <li><a href="#ipp_res_e" title="Resolution units">ipp_res_e</a></li>
708 <li><a href="#ipp_state_e" title="IPP states">ipp_state_e</a></li>
709 <li><a href="#ipp_status_e" title="IPP status codes">ipp_status_e</a></li>
710 <li><a href="#ipp_tag_e" title="Format tags for attributes">ipp_tag_e</a></li>
5a738aea 711</ul></li>
0268488e 712</ul>
5a738aea 713<!--
9c0e8e5d 714 "$Id: api-httpipp.shtml 7684 2008-06-23 16:47:38Z mike $"
ef416fc2 715
eac3a0a0 716 HTTP and IPP API introduction for CUPS.
ef416fc2 717
82cc1f9a 718 Copyright 2007-2012 by Apple Inc.
bc44d920 719 Copyright 1997-2006 by Easy Software Products, all rights reserved.
ef416fc2 720
721 These coded instructions, statements, and computer programs are the
bc44d920 722 property of Apple Inc. and are protected by Federal copyright
723 law. Distribution and use rights are outlined in the file "LICENSE.txt"
724 which should have been included with this file. If this file is
725 file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 726-->
727
5a738aea
MS
728<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
729
730<p>The CUPS HTTP and IPP APIs provide low-level access to the HTTP and IPP
731protocols and CUPS scheduler. They are typically used by monitoring and
732administration programs to perform specific functions not supported by the
733high-level CUPS API functions.</p>
734
735<p>The HTTP APIs use an opaque structure called
736<a href='#http_t'><code>http_t</code></a> to manage connections to
737a particular HTTP or IPP server. The
738<a href='#httpConnectEncrypt'><code>httpConnectEncrypt</code></a> function is
739used to create an instance of this structure for a particular server.
740The constant <code>CUPS_HTTP_DEFAULT</code> can be used with all of the
741<code>cups</code> functions to refer to the default CUPS server - the functions
742create a per-thread <a href='#http_t'><code>http_t</code></a> as needed.</p>
743
82cc1f9a
MS
744<p>The IPP APIs use two opaque structures for requests (messages sent to the CUPS scheduler) and responses (messages sent back to your application from the scheduler). The <a href='#ipp_t'><code>ipp_t</code></a> type holds a complete request or response and is allocated using the <a href='#ippNew'><code>ippNew</code></a> or <a href='#ippNewRequest'><code>ippNewRequest</code></a> functions and freed using the <a href='#ippDelete'><code>ippDelete</code></a> function.</p>
745
746<p>The second opaque structure is called <a href='#ipp_attribute_t'><code>ipp_attribute_t</code></a> and holds a single IPP attribute which consists of a group tag (<a href='#ippGetGroupTag'><code>ippGetGroupTag</code></a>), a value type tag (<a href='#ippGetValueTag'><code>ippGetValueTag</code></a>), the attribute name (<a href='#ippGetName'><code>ippGetName</code></a>), and 1 or more values (<a href='#ippGetCount'><code>ippGetCount</code></a>, <a href='#ippGetBoolean'><code>ippGetBoolean</code></a>, <a href='#ippGetCollection'><code>ippGetCollection</code></a>, <a href='#ippGetDate'><code>ippGetDate</code></a>, <a href='#ippGetInteger'><code>ippGetInteger</code></a>, <a href='#ippGetRange'><code>ippGetRange</code></a>, <a href='#ippGetResolution'><code>ippGetResolution</code></a>, and <a href='#ippGetString'><code>ippGetString</code></a>). Attributes are added to an <a href='#ipp_t'><code>ipp_t</code></a> pointer using one of the <code>ippAdd</code> functions. For example, use <a href='#ippAddString'><code>ippAddString</code></a> to add the "printer-uri" and "requesting-user-name" string attributes to a request:</p>
5a738aea
MS
747
748<pre class='example'>
749<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(IPP_GET_JOBS);
750
82cc1f9a
MS
751<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
752 NULL, "ipp://localhost/printers/");
5a738aea
MS
753<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
754 NULL, cupsUser());
755</pre>
ef416fc2 756
82cc1f9a 757<p>Once you have created an IPP request, use the <code>cups</code> functions to send the request to and read the response from the server. For example, the <a href='#cupsDoRequest'><code>cupsDoRequest</code></a> function can be used for simple query operations that do not involve files:</p>
ef416fc2 758
5a738aea
MS
759<pre class='example'>
760#include &lt;cups/cups.h&gt;
ef416fc2 761
ef416fc2 762
5a738aea
MS
763<a href='#ipp_t'>ipp_t</a> *<a name='get_jobs'>get_jobs</a>(void)
764{
765 <a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(IPP_GET_JOBS);
ef416fc2 766
82cc1f9a
MS
767 <a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
768 NULL, "ipp://localhost/printers/");
5a738aea
MS
769 <a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
770 NULL, cupsUser());
771
772 return (<a href='#cupsDoRequest'>cupsDoRequest</a>(CUPS_HTTP_DEFAULT, request, "/"));
773}
ef416fc2 774</pre>
775
82cc1f9a 776<p>The <a href='#cupsDoRequest'><code>cupsDoRequest</code></a> function frees the request and returns an IPP response or <code>NULL</code> pointer if the request could not be sent to the server. Once you have a response from the server, you can either use the <a href='#ippFindAttribute'><code>ippFindAttribute</code></a> and <a href='#ippFindNextAttribute'><code>ippFindNextAttribute</code></a> functions to find specific attributes, for example:</p>
ef416fc2 777
5a738aea
MS
778<pre class='example'>
779<a href='#ipp_t'>ipp_t</a> *response;
780<a href='#ipp_attribute_t'>ipp_attribute_t</a> *attr;
bc44d920 781
5a738aea
MS
782attr = <a href='#ippFindAttribute'>ippFindAttribute</a>(response, "printer-state", IPP_TAG_ENUM);
783</pre>
784
82cc1f9a 785<p>You can also walk the list of attributes with a simple <code>for</code> loop like this:</p>
5a738aea
MS
786
787<pre class='example'>
788<a href='#ipp_t'>ipp_t</a> *response;
789<a href='#ipp_attribute_t'>ipp_attribute_t</a> *attr;
790
82cc1f9a
MS
791for (attr = <a href='#ippFirstAttribute'>ippFirstAttribute</a>(response); attr != NULL; attr = <a href='#ippNextAttribute'>ippNextAttribute</a>(response))
792 if (ippGetName(attr) == NULL)
5a738aea
MS
793 puts("--SEPARATOR--");
794 else
82cc1f9a 795 puts(ippGetName(attr));
5a738aea
MS
796</pre>
797
82cc1f9a 798<p>The <code>for</code> loop approach is normally used when collecting attributes for multiple objects (jobs, printers, etc.) in a response. Attributes with <code>NULL</code> names indicate a separator between the attributes of each object. For example, the following code will list the jobs returned from our previous <a href='#get_jobs'><code>get_jobs</code></a> example code:</p>
5a738aea
MS
799
800<pre class='example'>
801<a href='#ipp_t'>ipp_t</a> *response = <a href='#get_jobs'>get_jobs</a>();
802
803if (response != NULL)
804{
805 <a href='#ipp_attribute_t'>ipp_attribute_t</a> *attr;
82cc1f9a 806 const char *attrname;
5a738aea 807 int job_id = 0;
82cc1f9a
MS
808 const char *job_name = NULL;
809 const char *job_originating_user_name = NULL;
5a738aea
MS
810
811 puts("Job ID Owner Title");
812 puts("------ ---------------- ---------------------------------");
813
82cc1f9a 814 for (attr = <a href='#ippFirstAttribute'>ippFirstAttribute</a>(response); attr != NULL; attr = <a href='#ippNextAttribute'>ippNextAttribute</a>(response))
5a738aea
MS
815 {
816 /* Attributes without names are separators between jobs */
82cc1f9a
MS
817 attrname = ippGetName(attr);
818 if (attrname == NULL)
5a738aea 819 {
82cc1f9a
MS
820 if (job_id > 0)
821 {
822 if (job_name == NULL)
823 job_name = "(withheld)";
824
825 if (job_originating_user_name == NULL)
826 job_originating_user_name = "(withheld)";
827
5a738aea 828 printf("%5d %-16s %s\n", job_id, job_originating_user_name, job_name);
82cc1f9a 829 }
5a738aea
MS
830
831 job_id = 0;
832 job_name = NULL;
833 job_originating_user_name = NULL;
834 continue;
835 }
82cc1f9a
MS
836 else if (!strcmp(attrname, "job-id") &amp;&amp; ippGetValueTag(attr) == IPP_TAG_INTEGER)
837 job_id = ippGetInteger(attr, 0);
838 else if (!strcmp(attrname, "job-name") &amp;&amp; ippGetValueTag(attr) == IPP_TAG_NAME)
839 job_name = ippGetString(attr, 0, NULL);
840 else if (!strcmp(attrname, "job-originating-user-name") &amp;&amp;
841 ippGetValueTag(attr) == IPP_TAG_NAME)
842 job_originating_user_name = ippGetString(attr, 0, NULL);
5a738aea
MS
843 }
844
82cc1f9a
MS
845 if (job_id > 0)
846 {
847 if (job_name == NULL)
848 job_name = "(withheld)";
849
850 if (job_originating_user_name == NULL)
851 job_originating_user_name = "(withheld)";
852
5a738aea 853 printf("%5d %-16s %s\n", job_id, job_originating_user_name, job_name);
82cc1f9a 854 }
5a738aea
MS
855}
856</pre>
857
858<h3><a name='CREATING_URI_STRINGS'>Creating URI Strings</a></h3>
859
860<p>To ensure proper encoding, the
861<a href='#httpAssembleURIf'><code>httpAssembleURIf</code></a> function must be
862used to format a "printer-uri" string for all printer-based requests:</p>
863
864<pre class='example'>
865const char *name = "Foo";
866char uri[1024];
867<a href='#ipp_t'>ipp_t</a> *request;
868
869<a href='#httpAssembleURIf'>httpAssembleURIf</a>(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, cupsServer(),
870 ippPort(), "/printers/%s", name);
871<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
872</pre>
873
874<h3><a name='SENDING_REQUESTS_WITH_FILES'>Sending Requests with Files</a></h3>
875
876<p>The <a href='#cupsDoFileRequest'><code>cupsDoFileRequest</code></a> and
877<a href='#cupsDoIORequest'><code>cupsDoIORequest</code></a> functions are
878used for requests involving files. The
879<a href='#cupsDoFileRequest'><code>cupsDoFileRequest</code></a> function
880attaches the named file to a request and is typically used when sending a print
881file or changing a printer's PPD file:</p>
882
883<pre class='example'>
884const char *filename = "/usr/share/cups/data/testprint.ps";
885const char *name = "Foo";
886char uri[1024];
887char resource[1024];
888<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(IPP_PRINT_JOB);
889<a href='#ipp_t'>ipp_t</a> *response;
890
891/* Use httpAssembleURIf for the printer-uri string */
892<a href='#httpAssembleURIf'>httpAssembleURIf</a>(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, cupsServer(),
893 ippPort(), "/printers/%s", name);
894<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
895<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
896 NULL, cupsUser());
897<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name",
898 NULL, "testprint.ps");
899
900/* Use snprintf for the resource path */
901snprintf(resource, sizeof(resource), "/printers/%s", name);
902
903response = <a href='#cupsDoFileRequest'>cupsDoFileRequest</a>(CUPS_HTTP_DEFAULT, request, resource, filename);
904</pre>
905
906<p>The <a href='#cupsDoIORequest'><code>cupsDoIORequest</code></a> function
907optionally attaches a file to the request and optionally saves a file in the
908response from the server. It is used when using a pipe for the request
909attachment or when using a request that returns a file, currently only
910<code>CUPS_GET_DOCUMENT</code> and <code>CUPS_GET_PPD</code>. For example,
911the following code will download the PPD file for the sample HP LaserJet
912printer driver:</p>
913
914<pre class='example'>
915char tempfile[1024];
916int tempfd;
917<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(CUPS_GET_PPD);
918<a href='#ipp_t'>ipp_t</a> *response;
919
920<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
921 NULL, "laserjet.ppd");
922
923tempfd = cupsTempFd(tempfile, sizeof(tempfile));
924
925response = <a href='#cupsDoIORequest'>cupsDoIORequest</a>(CUPS_HTTP_DEFAULT, request, "/", -1, tempfd);
926</pre>
927
928<p>The example passes <code>-1</code> for the input file descriptor to specify
929that no file is to be attached to the request. The PPD file attached to the
930response is written to the temporary file descriptor we created using the
931<code>cupsTempFd</code> function.</p>
932
933<h3><a name='ASYNCHRONOUS_REQUEST_PROCESSING'>Asynchronous Request Processing</a></h3>
934
935<p>The <a href='#cupsSendRequest'><code>cupsSendRequest</code></a> and
936<a href='#cupsGetResponse'><code>cupsGetResponse</code></a> support
937asynchronous communications with the server. Unlike the other request
938functions, the IPP request is not automatically freed, so remember to
939free your request with the <a href='#ippDelete'><code>ippDelete</code></a>
940function.</p>
941
942<p>File data is attached to the request using the
943<a href='#cupsWriteRequestData'><code>cupsWriteRequestData</code></a>
944function, while file data returned from the server is read using the
945<a href='#cupsReadResponseData'><code>cupsReadResponseData</code></a>
946function. We can rewrite the previous <code>CUPS_GET_PPD</code> example
947to use the asynchronous functions quite easily:</p>
948
949<pre class='example'>
950char tempfile[1024];
951int tempfd;
952<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(CUPS_GET_PPD);
953<a href='#ipp_t'>ipp_t</a> *response;
954
955<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
956 NULL, "laserjet.ppd");
957
958tempfd = cupsTempFd(tempfile, sizeof(tempfile));
959
960if (<a href='#cupsSendRequest'>cupsSendRequest</a>(CUPS_HTTP_DEFAULT, request, "/") == HTTP_CONTINUE)
961{
962 response = <a href='#cupsGetResponse'>cupsGetResponse</a>(CUPS_HTTP_DEFAULT, "/");
963
964 if (response != NULL)
965 {
966 ssize_t bytes;
967 char buffer[8192];
968
969 while ((bytes = <a href='#cupsReadResponseData'>cupsReadResponseData</a>(CUPS_HTTP_DEFAULT, buffer, sizeof(buffer))) > 0)
970 write(tempfd, buffer, bytes);
971 }
972}
973
974/* Free the request! */
975<a href='#ippDelete'>ippDelete</a>(request);
976</pre>
977
978<p>The <a href='#cupsSendRequest'><code>cupsSendRequest</code></a> function
979returns the initial HTTP request status, typically either
980<code>HTTP_CONTINUE</code> or <code>HTTP_UNAUTHORIZED</code>. The latter status
981is returned when the request requires authentication of some sort. The
982<a href='#cupsDoAuthentication'><code>cupsDoAuthentication</code></a> function
983must be called when your see <code>HTTP_UNAUTHORIZED</code> and the request
984re-sent. We can add authentication support to our example code by using a
985<code>do ... while</code> loop:</p>
986
987<pre class='example'>
988char tempfile[1024];
989int tempfd;
990<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(CUPS_GET_PPD);
991<a href='#ipp_t'>ipp_t</a> *response;
992http_status_t status;
993
994<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
995 NULL, "laserjet.ppd");
996
997tempfd = cupsTempFd(tempfile, sizeof(tempfile));
998
999/* Loop for authentication */
1000do
1001{
75bd9771 1002 status = <a href='#cupsSendRequest'>cupsSendRequest</a>(CUPS_HTTP_DEFAULT, request, "/");
5a738aea
MS
1003
1004 if (status == HTTP_UNAUTHORIZED)
1005 {
1006 /* Try to authenticate, break out of the loop if that fails */
1007 if (<a href='#cupsDoAuthentication'>cupsDoAuthentication</a>(CUPS_HTTP_DEFAULT, "POST", "/"))
1008 break;
1009 }
1010}
1011while (status != HTTP_CONTINUE &amp;&amp; status != HTTP_UNAUTHORIZED);
1012
1013if (status == HTTP_CONTINUE)
1014{
1015 response = <a href='#cupsGetResponse'>cupsGetResponse</a>(CUPS_HTTP_DEFAULT, "/");
1016
1017 if (response != NULL)
1018 {
1019 ssize_t bytes;
1020 char buffer[8192];
1021
1022 while ((bytes = <a href='#cupsReadResponseData'>cupsReadResponseData</a>(CUPS_HTTP_DEFAULT, buffer, sizeof(buffer))) > 0)
1023 write(tempfd, buffer, bytes);
1024 }
1025}
1026
1027/* Free the request! */
1028<a href='#ippDelete'>ippDelete</a>(request);
1029</pre>
1030<h2 class="title"><a name="FUNCTIONS">Functions</a></h2>
f3c17241 1031<h3 class="function"><span class="info">&nbsp;CUPS 1.1.20/OS X 10.4&nbsp;</span><a name="cupsDoAuthentication">cupsDoAuthentication</a></h3>
5a738aea
MS
1032<p class="description">Authenticate a request.</p>
1033<p class="code">
1034int cupsDoAuthentication (<br>
1035&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1036&nbsp;&nbsp;&nbsp;&nbsp;const char *method,<br>
1037&nbsp;&nbsp;&nbsp;&nbsp;const char *resource<br>
1038);</p>
1039<h4 class="parameters">Parameters</h4>
1040<dl>
1041<dt>http</dt>
568fa3fa 1042<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
1043<dt>method</dt>
1044<dd class="description">Request method (&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;)</dd>
1045<dt>resource</dt>
1046<dd class="description">Resource path</dd>
1047</dl>
1048<h4 class="returnvalue">Return Value</h4>
1049<p class="description">0 on success, -1 on error</p>
1050<h4 class="discussion">Discussion</h4>
6961465f 1051<p class="discussion">This function should be called in response to a <code>HTTP_STATUS_UNAUTHORIZED</code>
5a738aea
MS
1052status, prior to resubmitting your request.
1053
1054</p>
1055<h3 class="function"><a name="cupsDoFileRequest">cupsDoFileRequest</a></h3>
1056<p class="description">Do an IPP request with a file.</p>
1057<p class="code">
1058<a href="#ipp_t">ipp_t</a> *cupsDoFileRequest (<br>
1059&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1060&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *request,<br>
1061&nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1062&nbsp;&nbsp;&nbsp;&nbsp;const char *filename<br>
1063);</p>
1064<h4 class="parameters">Parameters</h4>
1065<dl>
1066<dt>http</dt>
568fa3fa 1067<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
1068<dt>request</dt>
1069<dd class="description">IPP request</dd>
1070<dt>resource</dt>
1071<dd class="description">HTTP resource for POST</dd>
1072<dt>filename</dt>
568fa3fa 1073<dd class="description">File to send or <code>NULL</code> for none</dd>
5a738aea
MS
1074</dl>
1075<h4 class="returnvalue">Return Value</h4>
1076<p class="description">Response data</p>
1077<h4 class="discussion">Discussion</h4>
5a9febac
MS
1078<p class="discussion">This function sends the IPP request and attached file to the specified
1079server, retrying and authenticating as necessary. The request is freed with
1080<a href="#ippDelete"><code>ippDelete</code></a>.</p>
f3c17241 1081<h3 class="function"><span class="info">&nbsp;CUPS 1.3/OS X 10.5&nbsp;</span><a name="cupsDoIORequest">cupsDoIORequest</a></h3>
5a738aea
MS
1082<p class="description">Do an IPP request with file descriptors.</p>
1083<p class="code">
1084<a href="#ipp_t">ipp_t</a> *cupsDoIORequest (<br>
1085&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1086&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *request,<br>
1087&nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1088&nbsp;&nbsp;&nbsp;&nbsp;int infile,<br>
1089&nbsp;&nbsp;&nbsp;&nbsp;int outfile<br>
1090);</p>
1091<h4 class="parameters">Parameters</h4>
1092<dl>
1093<dt>http</dt>
568fa3fa 1094<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
1095<dt>request</dt>
1096<dd class="description">IPP request</dd>
1097<dt>resource</dt>
1098<dd class="description">HTTP resource for POST</dd>
1099<dt>infile</dt>
1100<dd class="description">File to read from or -1 for none</dd>
1101<dt>outfile</dt>
1102<dd class="description">File to write to or -1 for none</dd>
1103</dl>
1104<h4 class="returnvalue">Return Value</h4>
1105<p class="description">Response data</p>
1106<h4 class="discussion">Discussion</h4>
5a9febac
MS
1107<p class="discussion">This function sends the IPP request with the optional input file &quot;infile&quot; to
1108the specified server, retrying and authenticating as necessary. The request
1109is freed with <a href="#ippDelete"><code>ippDelete</code></a>.<br>
5a738aea 1110<br>
5a9febac 1111If &quot;infile&quot; is a valid file descriptor, <code>cupsDoIORequest</code> copies
5a738aea
MS
1112all of the data from the file after the IPP request message.<br>
1113<br>
5a9febac 1114If &quot;outfile&quot; is a valid file descriptor, <code>cupsDoIORequest</code> copies
bc44d920 1115all of the data after the IPP response message to the file.
1116
5a738aea
MS
1117</p>
1118<h3 class="function"><a name="cupsDoRequest">cupsDoRequest</a></h3>
1119<p class="description">Do an IPP request.</p>
1120<p class="code">
1121<a href="#ipp_t">ipp_t</a> *cupsDoRequest (<br>
1122&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1123&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *request,<br>
1124&nbsp;&nbsp;&nbsp;&nbsp;const char *resource<br>
1125);</p>
1126<h4 class="parameters">Parameters</h4>
1127<dl>
1128<dt>http</dt>
568fa3fa 1129<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
1130<dt>request</dt>
1131<dd class="description">IPP request</dd>
1132<dt>resource</dt>
1133<dd class="description">HTTP resource for POST</dd>
1134</dl>
1135<h4 class="returnvalue">Return Value</h4>
1136<p class="description">Response data</p>
1137<h4 class="discussion">Discussion</h4>
1138<p class="discussion">This function sends the IPP request to the specified server, retrying
5a9febac 1139and authenticating as necessary. The request is freed with <a href="#ippDelete"><code>ippDelete</code></a>.</p>
5a738aea
MS
1140<h3 class="function"><a name="cupsEncodeOptions">cupsEncodeOptions</a></h3>
1141<p class="description">Encode printer options into IPP attributes.</p>
1142<p class="code">
1143void cupsEncodeOptions (<br>
1144&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
1145&nbsp;&nbsp;&nbsp;&nbsp;int num_options,<br>
1146&nbsp;&nbsp;&nbsp;&nbsp;cups_option_t *options<br>
1147);</p>
1148<h4 class="parameters">Parameters</h4>
1149<dl>
1150<dt>ipp</dt>
1151<dd class="description">Request to add to</dd>
1152<dt>num_options</dt>
1153<dd class="description">Number of options</dd>
1154<dt>options</dt>
1155<dd class="description">Options</dd>
1156</dl>
1157<h4 class="discussion">Discussion</h4>
1158<p class="discussion">This function adds operation, job, and then subscription attributes,
ecdc0628 1159in that order. Use the cupsEncodeOptions2() function to add attributes
5a738aea 1160for a single group.</p>
f3c17241 1161<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="cupsEncodeOptions2">cupsEncodeOptions2</a></h3>
5a738aea
MS
1162<p class="description">Encode printer options into IPP attributes for a group.</p>
1163<p class="code">
1164void cupsEncodeOptions2 (<br>
1165&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
1166&nbsp;&nbsp;&nbsp;&nbsp;int num_options,<br>
1167&nbsp;&nbsp;&nbsp;&nbsp;cups_option_t *options,<br>
a2326b5b 1168&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group_tag<br>
5a738aea
MS
1169);</p>
1170<h4 class="parameters">Parameters</h4>
1171<dl>
1172<dt>ipp</dt>
1173<dd class="description">Request to add to</dd>
1174<dt>num_options</dt>
1175<dd class="description">Number of options</dd>
1176<dt>options</dt>
1177<dd class="description">Options</dd>
1178<dt>group_tag</dt>
1179<dd class="description">Group to encode</dd>
1180</dl>
1181<h4 class="discussion">Discussion</h4>
1182<p class="discussion">This function only adds attributes for a single group. Call this
ecdc0628 1183function multiple times for each group, or use cupsEncodeOptions()
1184to add the standard groups.
ef416fc2 1185
ae71f5de 1186</p>
f3c17241 1187<h3 class="function"><span class="info">&nbsp;CUPS 1.4/OS X 10.6&nbsp;</span><a name="cupsGetDevices">cupsGetDevices</a></h3>
ae71f5de
MS
1188<p class="description">Get available printer devices.</p>
1189<p class="code">
1190ipp_status_t cupsGetDevices (<br>
1191&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1192&nbsp;&nbsp;&nbsp;&nbsp;int timeout,<br>
8b450588 1193&nbsp;&nbsp;&nbsp;&nbsp;const char *include_schemes,<br>
ae71f5de
MS
1194&nbsp;&nbsp;&nbsp;&nbsp;const char *exclude_schemes,<br>
1195&nbsp;&nbsp;&nbsp;&nbsp;cups_device_cb_t callback,<br>
1196&nbsp;&nbsp;&nbsp;&nbsp;void *user_data<br>
1197);</p>
1198<h4 class="parameters">Parameters</h4>
1199<dl>
1200<dt>http</dt>
1201<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1202<dt>timeout</dt>
1203<dd class="description">Timeout in seconds or <code>CUPS_TIMEOUT_DEFAULT</code></dd>
8b450588
MS
1204<dt>include_schemes</dt>
1205<dd class="description">Comma-separated URI schemes to include or <code>CUPS_INCLUDE_ALL</code></dd>
ae71f5de
MS
1206<dt>exclude_schemes</dt>
1207<dd class="description">Comma-separated URI schemes to exclude or <code>CUPS_EXCLUDE_NONE</code></dd>
1208<dt>callback</dt>
1209<dd class="description">Callback function</dd>
1210<dt>user_data</dt>
1211<dd class="description">User data pointer</dd>
1212</dl>
1213<h4 class="returnvalue">Return Value</h4>
1214<p class="description">Request status - <code>IPP_OK</code> on success.</p>
1215<h4 class="discussion">Discussion</h4>
1216<p class="discussion">This function sends a CUPS-Get-Devices request and streams the discovered
1217devices to the specified callback function. The &quot;timeout&quot; parameter controls
8b450588
MS
1218how long the request lasts, while the &quot;include_schemes&quot; and &quot;exclude_schemes&quot;
1219parameters provide comma-delimited lists of backends to include or omit from
1220the request respectively.
ae71f5de
MS
1221
1222</p>
f3c17241 1223<h3 class="function"><span class="info">&nbsp;CUPS 1.1.20/OS X 10.4&nbsp;</span><a name="cupsGetFd">cupsGetFd</a></h3>
ae71f5de
MS
1224<p class="description">Get a file from the server.</p>
1225<p class="code">
a469f8a5 1226http_status_t cupsGetFd (<br>
ae71f5de
MS
1227&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1228&nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1229&nbsp;&nbsp;&nbsp;&nbsp;int fd<br>
1230);</p>
1231<h4 class="parameters">Parameters</h4>
1232<dl>
1233<dt>http</dt>
1234<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1235<dt>resource</dt>
1236<dd class="description">Resource name</dd>
1237<dt>fd</dt>
1238<dd class="description">File descriptor</dd>
1239</dl>
1240<h4 class="returnvalue">Return Value</h4>
1241<p class="description">HTTP status</p>
1242<h4 class="discussion">Discussion</h4>
6961465f 1243<p class="discussion">This function returns <code>HTTP_STATUS_OK</code> when the file is successfully retrieved.
ae71f5de
MS
1244
1245</p>
f3c17241 1246<h3 class="function"><span class="info">&nbsp;CUPS 1.1.20/OS X 10.4&nbsp;</span><a name="cupsGetFile">cupsGetFile</a></h3>
ae71f5de
MS
1247<p class="description">Get a file from the server.</p>
1248<p class="code">
a469f8a5 1249http_status_t cupsGetFile (<br>
ae71f5de
MS
1250&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1251&nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1252&nbsp;&nbsp;&nbsp;&nbsp;const char *filename<br>
1253);</p>
1254<h4 class="parameters">Parameters</h4>
1255<dl>
1256<dt>http</dt>
1257<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1258<dt>resource</dt>
1259<dd class="description">Resource name</dd>
1260<dt>filename</dt>
1261<dd class="description">Filename</dd>
1262</dl>
1263<h4 class="returnvalue">Return Value</h4>
1264<p class="description">HTTP status</p>
1265<h4 class="discussion">Discussion</h4>
6961465f 1266<p class="discussion">This function returns <code>HTTP_STATUS_OK</code> when the file is successfully retrieved.
ae71f5de 1267
5a738aea 1268</p>
f3c17241 1269<h3 class="function"><span class="info">&nbsp;CUPS 1.4/OS X 10.6&nbsp;</span><a name="cupsGetResponse">cupsGetResponse</a></h3>
5a738aea
MS
1270<p class="description">Get a response to an IPP request.</p>
1271<p class="code">
1272<a href="#ipp_t">ipp_t</a> *cupsGetResponse (<br>
1273&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1274&nbsp;&nbsp;&nbsp;&nbsp;const char *resource<br>
1275);</p>
1276<h4 class="parameters">Parameters</h4>
1277<dl>
1278<dt>http</dt>
568fa3fa 1279<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
1280<dt>resource</dt>
1281<dd class="description">HTTP resource for POST</dd>
1282</dl>
1283<h4 class="returnvalue">Return Value</h4>
568fa3fa 1284<p class="description">Response or <code>NULL</code> on HTTP error</p>
5a738aea
MS
1285<h4 class="discussion">Discussion</h4>
1286<p class="discussion">Use this function to get the response for an IPP request sent using
5a9febac
MS
1287<a href="#cupsSendRequest"><code>cupsSendRequest</code></a>. For requests that return additional data, use
1288<a href="#cupsReadResponseData"><code>cupsReadResponseData</code></a> after getting a successful response,
1289otherwise call <a href="#httpFlush"><code>httpFlush</code></a> to complete the response processing.
5a738aea 1290
ae71f5de 1291</p>
10d09e33 1292<h3 class="function"><a name="cupsLastError">cupsLastError</a></h3>
5a9febac
MS
1293<p class="description">Return the last IPP status code received on the current
1294thread.</p>
10d09e33
MS
1295<p class="code">
1296ipp_status_t cupsLastError (void);</p>
1297<h4 class="returnvalue">Return Value</h4>
1298<p class="description">IPP status code from last request</p>
f3c17241 1299<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="cupsLastErrorString">cupsLastErrorString</a></h3>
5a9febac
MS
1300<p class="description">Return the last IPP status-message received on the
1301current thread.</p>
10d09e33
MS
1302<p class="code">
1303const char *cupsLastErrorString (void);</p>
1304<h4 class="returnvalue">Return Value</h4>
1305<p class="description">status-message text from last request</p>
f3c17241 1306<h3 class="function"><span class="info">&nbsp;CUPS 1.1.20/OS X 10.4&nbsp;</span><a name="cupsPutFd">cupsPutFd</a></h3>
ae71f5de
MS
1307<p class="description">Put a file on the server.</p>
1308<p class="code">
a469f8a5 1309http_status_t cupsPutFd (<br>
ae71f5de
MS
1310&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1311&nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1312&nbsp;&nbsp;&nbsp;&nbsp;int fd<br>
1313);</p>
1314<h4 class="parameters">Parameters</h4>
1315<dl>
1316<dt>http</dt>
1317<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1318<dt>resource</dt>
1319<dd class="description">Resource name</dd>
1320<dt>fd</dt>
1321<dd class="description">File descriptor</dd>
1322</dl>
1323<h4 class="returnvalue">Return Value</h4>
1324<p class="description">HTTP status</p>
1325<h4 class="discussion">Discussion</h4>
6961465f 1326<p class="discussion">This function returns <code>HTTP_STATUS_CREATED</code> when the file is stored
ae71f5de
MS
1327successfully.
1328
1329</p>
f3c17241 1330<h3 class="function"><span class="info">&nbsp;CUPS 1.1.20/OS X 10.4&nbsp;</span><a name="cupsPutFile">cupsPutFile</a></h3>
ae71f5de
MS
1331<p class="description">Put a file on the server.</p>
1332<p class="code">
a469f8a5 1333http_status_t cupsPutFile (<br>
ae71f5de
MS
1334&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1335&nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1336&nbsp;&nbsp;&nbsp;&nbsp;const char *filename<br>
1337);</p>
1338<h4 class="parameters">Parameters</h4>
1339<dl>
1340<dt>http</dt>
1341<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
1342<dt>resource</dt>
1343<dd class="description">Resource name</dd>
1344<dt>filename</dt>
1345<dd class="description">Filename</dd>
1346</dl>
1347<h4 class="returnvalue">Return Value</h4>
1348<p class="description">HTTP status</p>
1349<h4 class="discussion">Discussion</h4>
1350<p class="discussion">This function returns <code>HTTP_CREATED</code> when the file is stored
1351successfully.
1352
5a738aea 1353</p>
f3c17241 1354<h3 class="function"><span class="info">&nbsp;CUPS 1.4/OS X 10.6&nbsp;</span><a name="cupsReadResponseData">cupsReadResponseData</a></h3>
5a738aea
MS
1355<p class="description">Read additional data after the IPP response.</p>
1356<p class="code">
1357ssize_t cupsReadResponseData (<br>
1358&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1359&nbsp;&nbsp;&nbsp;&nbsp;char *buffer,<br>
1360&nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
1361);</p>
1362<h4 class="parameters">Parameters</h4>
1363<dl>
1364<dt>http</dt>
568fa3fa 1365<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
1366<dt>buffer</dt>
1367<dd class="description">Buffer to use</dd>
1368<dt>length</dt>
1369<dd class="description">Number of bytes to read</dd>
1370</dl>
1371<h4 class="returnvalue">Return Value</h4>
1372<p class="description">Bytes read, 0 on EOF, -1 on error</p>
1373<h4 class="discussion">Discussion</h4>
5a9febac
MS
1374<p class="discussion">This function is used after <a href="#cupsGetResponse"><code>cupsGetResponse</code></a> to read the PPD or document
1375files from <code>CUPS_GET_PPD</code> and <code>CUPS_GET_DOCUMENT</code> requests,
1376respectively.
5a738aea
MS
1377
1378</p>
f3c17241 1379<h3 class="function"><span class="info">&nbsp;CUPS 1.4/OS X 10.6&nbsp;</span><a name="cupsSendRequest">cupsSendRequest</a></h3>
5a738aea
MS
1380<p class="description">Send an IPP request.</p>
1381<p class="code">
a469f8a5 1382http_status_t cupsSendRequest (<br>
5a738aea
MS
1383&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1384&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *request,<br>
1385&nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
1386&nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
1387);</p>
1388<h4 class="parameters">Parameters</h4>
1389<dl>
1390<dt>http</dt>
568fa3fa 1391<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
1392<dt>request</dt>
1393<dd class="description">IPP request</dd>
1394<dt>resource</dt>
1395<dd class="description">Resource path</dd>
1396<dt>length</dt>
ae71f5de 1397<dd class="description">Length of data to follow or <code>CUPS_LENGTH_VARIABLE</code></dd>
5a738aea
MS
1398</dl>
1399<h4 class="returnvalue">Return Value</h4>
1400<p class="description">Initial HTTP status</p>
1401<h4 class="discussion">Discussion</h4>
5a9febac
MS
1402<p class="discussion">Use <a href="#cupsWriteRequestData"><code>cupsWriteRequestData</code></a> to write any additional data (document, PPD
1403file, etc.) for the request, <a href="#cupsGetResponse"><code>cupsGetResponse</code></a> to get the IPP response,
1404and <a href="#cupsReadResponseData"><code>cupsReadResponseData</code></a> to read any additional data following the
1405response. Only one request can be sent/queued at a time per <code>http_t</code>
1406connection.<br>
1407<br>
6961465f 1408Returns the initial HTTP status code, which will be <code>HTTP_STATUS_CONTINUE</code>
5a9febac 1409on a successful send of the request.<br>
5a738aea 1410<br>
5a9febac
MS
1411Note: Unlike <a href="#cupsDoFileRequest"><code>cupsDoFileRequest</code></a>, <a href="#cupsDoIORequest"><code>cupsDoIORequest</code></a>, and
1412<a href="#cupsDoRequest"><code>cupsDoRequest</code></a>, the request is NOT freed with <a href="#ippDelete"><code>ippDelete</code></a>.
5a738aea
MS
1413
1414</p>
f3c17241 1415<h3 class="function"><span class="info">&nbsp;CUPS 1.4/OS X 10.6&nbsp;</span><a name="cupsWriteRequestData">cupsWriteRequestData</a></h3>
5a738aea
MS
1416<p class="description">Write additional data after an IPP request.</p>
1417<p class="code">
a469f8a5 1418http_status_t cupsWriteRequestData (<br>
5a738aea
MS
1419&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1420&nbsp;&nbsp;&nbsp;&nbsp;const char *buffer,<br>
1421&nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
1422);</p>
1423<h4 class="parameters">Parameters</h4>
1424<dl>
1425<dt>http</dt>
568fa3fa 1426<dd class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></dd>
5a738aea
MS
1427<dt>buffer</dt>
1428<dd class="description">Bytes to write</dd>
1429<dt>length</dt>
1430<dd class="description">Number of bytes to write</dd>
1431</dl>
1432<h4 class="returnvalue">Return Value</h4>
6961465f 1433<p class="description"><code>HTTP_STATUS_CONTINUE</code> if OK or HTTP status on error</p>
5a738aea 1434<h4 class="discussion">Discussion</h4>
568fa3fa
MS
1435<p class="discussion">This function is used after <a href="#cupsSendRequest"><code>cupsSendRequest</code></a> to provide a PPD and
1436after <a href="#cupsStartDocument"><code>cupsStartDocument</code></a> to provide a document file.
5a738aea 1437
10d09e33 1438</p>
9c0e8e5d 1439<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="httpAcceptConnection">httpAcceptConnection</a></h3>
a469f8a5
MS
1440<p class="description">Accept a new HTTP client connection from the
1441specified listening socket.</p>
1442<p class="code">
1443<a href="#http_t">http_t</a> *httpAcceptConnection (<br>
1444&nbsp;&nbsp;&nbsp;&nbsp;int fd,<br>
1445&nbsp;&nbsp;&nbsp;&nbsp;int blocking<br>
1446);</p>
1447<h4 class="parameters">Parameters</h4>
1448<dl>
1449<dt>fd</dt>
1450<dd class="description">Listen socket file descriptor</dd>
1451<dt>blocking</dt>
1452<dd class="description">1 if the connection should be
1453blocking, 0 otherwise</dd>
1454</dl>
1455<h4 class="returnvalue">Return Value</h4>
1456<p class="description">HTTP connection or <code>NULL</code></p>
f3c17241 1457<h3 class="function"><span class="info">&nbsp;CUPS 1.5/OS X 10.7&nbsp;</span><a name="httpAddCredential">httpAddCredential</a></h3>
10d09e33
MS
1458<p class="description">Allocates and adds a single credential to an array.</p>
1459<p class="code">
1460int httpAddCredential (<br>
1461&nbsp;&nbsp;&nbsp;&nbsp;cups_array_t *credentials,<br>
1462&nbsp;&nbsp;&nbsp;&nbsp;const void *data,<br>
1463&nbsp;&nbsp;&nbsp;&nbsp;size_t datalen<br>
1464);</p>
1465<h4 class="parameters">Parameters</h4>
1466<dl>
1467<dt>credentials</dt>
1468<dd class="description">Credentials array</dd>
1469<dt>data</dt>
1470<dd class="description">PEM-encoded X.509 data</dd>
1471<dt>datalen</dt>
1472<dd class="description">Length of data</dd>
1473</dl>
1474<h4 class="returnvalue">Return Value</h4>
1475<p class="description">0 on success, -1 on error</p>
1476<h4 class="discussion">Discussion</h4>
1477<p class="discussion">Use <code>cupsArrayNew(NULL, NULL)</code> to create a credentials array.
1478
5a738aea 1479</p>
f3c17241 1480<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpAddrAny">httpAddrAny</a></h3>
5a738aea
MS
1481<p class="description">Check for the &quot;any&quot; address.</p>
1482<p class="code">
1483int httpAddrAny (<br>
1484&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr<br>
1485);</p>
1486<h4 class="parameters">Parameters</h4>
1487<dl>
1488<dt>addr</dt>
1489<dd class="description">Address to check</dd>
1490</dl>
1491<h4 class="returnvalue">Return Value</h4>
1492<p class="description">1 if &quot;any&quot;, 0 otherwise</p>
e1f19878 1493<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="httpAddrClose">httpAddrClose</a></h3>
ca6b43fc
MS
1494<p class="description">Close a socket created by <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> or
1495<a href="#httpAddrListen"><code>httpAddrListen</code></a>.</p>
1496<p class="code">
1497int httpAddrClose (<br>
1498&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_addr_t">http_addr_t</a> *addr,<br>
1499&nbsp;&nbsp;&nbsp;&nbsp;int fd<br>
1500);</p>
1501<h4 class="parameters">Parameters</h4>
1502<dl>
1503<dt>addr</dt>
1504<dd class="description">Listen address or <code>NULL</code></dd>
1505<dt>fd</dt>
1506<dd class="description">Socket file descriptor</dd>
1507</dl>
1508<h4 class="returnvalue">Return Value</h4>
1509<p class="description">0 on success, -1 on failure</p>
1510<h4 class="discussion">Discussion</h4>
1511<p class="discussion">Pass <code>NULL</code> for sockets created with <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> and the
1512listen address for sockets created with <a href="#httpAddrListen"><code>httpAddrListen</code></a>. This will
1513ensure that domain sockets are removed when closed.
1514
1515</p>
f3c17241 1516<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpAddrEqual">httpAddrEqual</a></h3>
5a738aea
MS
1517<p class="description">Compare two addresses.</p>
1518<p class="code">
1519int httpAddrEqual (<br>
1520&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr1,<br>
1521&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr2<br>
1522);</p>
1523<h4 class="parameters">Parameters</h4>
1524<dl>
1525<dt>addr1</dt>
1526<dd class="description">First address</dd>
1527<dt>addr2</dt>
1528<dd class="description">Second address</dd>
1529</dl>
1530<h4 class="returnvalue">Return Value</h4>
1531<p class="description">1 if equal, 0 if not</p>
ca6b43fc
MS
1532<h3 class="function"><a name="httpAddrFamily">httpAddrFamily</a></h3>
1533<p class="description">Get the address family of an address.</p>
1534<p class="code">
1535int httpAddrFamily (<br>
1536&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_addr_t">http_addr_t</a> *addr<br>
1537);</p>
1538<h4 class="parameters">Parameters</h4>
1539<dl>
1540<dt>addr</dt>
1541<dd class="description">Address</dd>
1542</dl>
1543<h4 class="returnvalue">Return Value</h4>
1544<p class="description">Address family</p>
f3c17241 1545<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpAddrLength">httpAddrLength</a></h3>
5a738aea
MS
1546<p class="description">Return the length of the address in bytes.</p>
1547<p class="code">
1548int httpAddrLength (<br>
1549&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr<br>
1550);</p>
1551<h4 class="parameters">Parameters</h4>
1552<dl>
1553<dt>addr</dt>
1554<dd class="description">Address</dd>
1555</dl>
1556<h4 class="returnvalue">Return Value</h4>
1557<p class="description">Length in bytes</p>
9c0e8e5d 1558<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="httpAddrListen">httpAddrListen</a></h3>
a469f8a5
MS
1559<p class="description">Create a listening socket bound to the specified
1560address and port.</p>
1561<p class="code">
1562int httpAddrListen (<br>
1563&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_addr_t">http_addr_t</a> *addr,<br>
1564&nbsp;&nbsp;&nbsp;&nbsp;int port<br>
1565);</p>
1566<h4 class="parameters">Parameters</h4>
1567<dl>
1568<dt>addr</dt>
1569<dd class="description">Address to bind to</dd>
1570<dt>port</dt>
1571<dd class="description">Port number to bind to</dd>
1572</dl>
1573<h4 class="returnvalue">Return Value</h4>
1574<p class="description">Socket or -1 on error</p>
f3c17241 1575<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpAddrLocalhost">httpAddrLocalhost</a></h3>
5a738aea
MS
1576<p class="description">Check for the local loopback address.</p>
1577<p class="code">
1578int httpAddrLocalhost (<br>
1579&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr<br>
1580);</p>
1581<h4 class="parameters">Parameters</h4>
1582<dl>
1583<dt>addr</dt>
1584<dd class="description">Address to check</dd>
1585</dl>
1586<h4 class="returnvalue">Return Value</h4>
1587<p class="description">1 if local host, 0 otherwise</p>
f3c17241 1588<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpAddrLookup">httpAddrLookup</a></h3>
5a738aea
MS
1589<p class="description">Lookup the hostname associated with the address.</p>
1590<p class="code">
1591char *httpAddrLookup (<br>
1592&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr,<br>
1593&nbsp;&nbsp;&nbsp;&nbsp;char *name,<br>
1594&nbsp;&nbsp;&nbsp;&nbsp;int namelen<br>
1595);</p>
1596<h4 class="parameters">Parameters</h4>
1597<dl>
1598<dt>addr</dt>
1599<dd class="description">Address to lookup</dd>
1600<dt>name</dt>
1601<dd class="description">Host name buffer</dd>
1602<dt>namelen</dt>
1603<dd class="description">Size of name buffer</dd>
1604</dl>
1605<h4 class="returnvalue">Return Value</h4>
1606<p class="description">Host name</p>
9c0e8e5d 1607<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="httpAddrPort">httpAddrPort</a></h3>
a469f8a5
MS
1608<p class="description">Get the port number associated with an address.</p>
1609<p class="code">
1610int httpAddrPort (<br>
1611&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_addr_t">http_addr_t</a> *addr<br>
1612);</p>
1613<h4 class="parameters">Parameters</h4>
1614<dl>
1615<dt>addr</dt>
1616<dd class="description">Address</dd>
1617</dl>
1618<h4 class="returnvalue">Return Value</h4>
1619<p class="description">Port number</p>
f3c17241 1620<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpAddrString">httpAddrString</a></h3>
5a738aea
MS
1621<p class="description">Convert an address to a numeric string.</p>
1622<p class="code">
1623char *httpAddrString (<br>
1624&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#http_addr_t">http_addr_t</a> *addr,<br>
1625&nbsp;&nbsp;&nbsp;&nbsp;char *s,<br>
1626&nbsp;&nbsp;&nbsp;&nbsp;int slen<br>
1627);</p>
1628<h4 class="parameters">Parameters</h4>
1629<dl>
1630<dt>addr</dt>
1631<dd class="description">Address to convert</dd>
1632<dt>s</dt>
1633<dd class="description">String buffer</dd>
1634<dt>slen</dt>
1635<dd class="description">Length of string</dd>
1636</dl>
1637<h4 class="returnvalue">Return Value</h4>
1638<p class="description">Numeric address string</p>
f3c17241 1639<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpAssembleURI">httpAssembleURI</a></h3>
5a738aea
MS
1640<p class="description">Assemble a uniform resource identifier from its
1641components.</p>
1642<p class="code">
79e1d494
MS
1643<a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURI (<br>
1644&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding,<br>
5a738aea
MS
1645&nbsp;&nbsp;&nbsp;&nbsp;char *uri,<br>
1646&nbsp;&nbsp;&nbsp;&nbsp;int urilen,<br>
1647&nbsp;&nbsp;&nbsp;&nbsp;const char *scheme,<br>
1648&nbsp;&nbsp;&nbsp;&nbsp;const char *username,<br>
1649&nbsp;&nbsp;&nbsp;&nbsp;const char *host,<br>
1650&nbsp;&nbsp;&nbsp;&nbsp;int port,<br>
1651&nbsp;&nbsp;&nbsp;&nbsp;const char *resource<br>
1652);</p>
1653<h4 class="parameters">Parameters</h4>
1654<dl>
1655<dt>encoding</dt>
1656<dd class="description">Encoding flags</dd>
1657<dt>uri</dt>
1658<dd class="description">URI buffer</dd>
1659<dt>urilen</dt>
1660<dd class="description">Size of URI buffer</dd>
1661<dt>scheme</dt>
1662<dd class="description">Scheme name</dd>
1663<dt>username</dt>
1664<dd class="description">Username</dd>
1665<dt>host</dt>
1666<dd class="description">Hostname or address</dd>
1667<dt>port</dt>
1668<dd class="description">Port number</dd>
1669<dt>resource</dt>
1670<dd class="description">Resource</dd>
1671</dl>
1672<h4 class="returnvalue">Return Value</h4>
1673<p class="description">URI status</p>
1674<h4 class="discussion">Discussion</h4>
1675<p class="discussion">This function escapes reserved characters in the URI depending on the
ecdc0628 1676value of the &quot;encoding&quot; argument. You should use this function in
1677place of traditional string functions whenever you need to create a
1678URI string.
ef416fc2 1679
5a738aea 1680</p>
f3c17241 1681<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpAssembleURIf">httpAssembleURIf</a></h3>
5a738aea
MS
1682<p class="description">Assemble a uniform resource identifier from its
1683components with a formatted resource.</p>
1684<p class="code">
79e1d494
MS
1685<a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURIf (<br>
1686&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding,<br>
5a738aea
MS
1687&nbsp;&nbsp;&nbsp;&nbsp;char *uri,<br>
1688&nbsp;&nbsp;&nbsp;&nbsp;int urilen,<br>
1689&nbsp;&nbsp;&nbsp;&nbsp;const char *scheme,<br>
1690&nbsp;&nbsp;&nbsp;&nbsp;const char *username,<br>
1691&nbsp;&nbsp;&nbsp;&nbsp;const char *host,<br>
1692&nbsp;&nbsp;&nbsp;&nbsp;int port,<br>
1693&nbsp;&nbsp;&nbsp;&nbsp;const char *resourcef,<br>
1694&nbsp;&nbsp;&nbsp;&nbsp;...<br>
1695);</p>
1696<h4 class="parameters">Parameters</h4>
1697<dl>
1698<dt>encoding</dt>
1699<dd class="description">Encoding flags</dd>
1700<dt>uri</dt>
1701<dd class="description">URI buffer</dd>
1702<dt>urilen</dt>
1703<dd class="description">Size of URI buffer</dd>
1704<dt>scheme</dt>
1705<dd class="description">Scheme name</dd>
1706<dt>username</dt>
1707<dd class="description">Username</dd>
1708<dt>host</dt>
1709<dd class="description">Hostname or address</dd>
1710<dt>port</dt>
1711<dd class="description">Port number</dd>
1712<dt>resourcef</dt>
1713<dd class="description">Printf-style resource</dd>
1714<dt>...</dt>
1715<dd class="description">Additional arguments as needed</dd>
1716</dl>
1717<h4 class="returnvalue">Return Value</h4>
1718<p class="description">URI status</p>
1719<h4 class="discussion">Discussion</h4>
1720<p class="discussion">This function creates a formatted version of the resource string
ecdc0628 1721argument &quot;resourcef&quot; and escapes reserved characters in the URI
1722depending on the value of the &quot;encoding&quot; argument. You should use
1723this function in place of traditional string functions whenever
1724you need to create a URI string.
ef416fc2 1725
5a738aea 1726</p>
9c0e8e5d 1727<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="httpAssembleUUID">httpAssembleUUID</a></h3>
db8b865d
MS
1728<p class="description">Assemble a name-based UUID URN conforming to RFC 4122.</p>
1729<p class="code">
1730char *httpAssembleUUID (<br>
1731&nbsp;&nbsp;&nbsp;&nbsp;const char *server,<br>
1732&nbsp;&nbsp;&nbsp;&nbsp;int port,<br>
1733&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
1734&nbsp;&nbsp;&nbsp;&nbsp;int number,<br>
1735&nbsp;&nbsp;&nbsp;&nbsp;char *buffer,<br>
1736&nbsp;&nbsp;&nbsp;&nbsp;size_t bufsize<br>
1737);</p>
1738<h4 class="parameters">Parameters</h4>
1739<dl>
1740<dt>server</dt>
1741<dd class="description">Server name</dd>
1742<dt>port</dt>
1743<dd class="description">Port number</dd>
1744<dt>name</dt>
1745<dd class="description">Object name or NULL</dd>
1746<dt>number</dt>
1747<dd class="description">Object number or 0</dd>
1748<dt>buffer</dt>
1749<dd class="description">String buffer</dd>
1750<dt>bufsize</dt>
1751<dd class="description">Size of buffer</dd>
1752</dl>
1753<h4 class="returnvalue">Return Value</h4>
1754<p class="description">UUID string</p>
1755<h4 class="discussion">Discussion</h4>
1756<p class="discussion">This function creates a unique 128-bit identifying number using the server
1757name, port number, random data, and optionally an object name and/or object
1758number. The result is formatted as a UUID URN as defined in RFC 4122.<br>
1759<br>
6961465f
MS
1760The buffer needs to be at least 46 bytes in size.
1761
1762</p>
5a738aea
MS
1763<h3 class="function"><a name="httpBlocking">httpBlocking</a></h3>
1764<p class="description">Set blocking/non-blocking behavior on a connection.</p>
1765<p class="code">
1766void httpBlocking (<br>
1767&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1768&nbsp;&nbsp;&nbsp;&nbsp;int b<br>
1769);</p>
1770<h4 class="parameters">Parameters</h4>
1771<dl>
1772<dt>http</dt>
ca6b43fc 1773<dd class="description">HTTP connection</dd>
5a738aea
MS
1774<dt>b</dt>
1775<dd class="description">1 = blocking, 0 = non-blocking</dd>
1776</dl>
1777<h3 class="function"><a name="httpCheck">httpCheck</a></h3>
1778<p class="description">Check to see if there is a pending response from the server.</p>
1779<p class="code">
1780int httpCheck (<br>
1781&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1782);</p>
1783<h4 class="parameters">Parameters</h4>
1784<dl>
1785<dt>http</dt>
ca6b43fc 1786<dd class="description">HTTP connection</dd>
5a738aea
MS
1787</dl>
1788<h4 class="returnvalue">Return Value</h4>
1789<p class="description">0 = no data, 1 = data available</p>
f3c17241 1790<h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/OS X 10.3&nbsp;</span><a name="httpClearCookie">httpClearCookie</a></h3>
5a738aea
MS
1791<p class="description">Clear the cookie value(s).</p>
1792<p class="code">
1793void httpClearCookie (<br>
1794&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1795);</p>
1796<h4 class="parameters">Parameters</h4>
1797<dl>
1798<dt>http</dt>
ca6b43fc 1799<dd class="description">HTTP connection</dd>
5a738aea
MS
1800</dl>
1801<h3 class="function"><a name="httpClearFields">httpClearFields</a></h3>
1802<p class="description">Clear HTTP request fields.</p>
1803<p class="code">
1804void httpClearFields (<br>
1805&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1806);</p>
1807<h4 class="parameters">Parameters</h4>
1808<dl>
1809<dt>http</dt>
ca6b43fc 1810<dd class="description">HTTP connection</dd>
5a738aea
MS
1811</dl>
1812<h3 class="function"><a name="httpClose">httpClose</a></h3>
10d09e33 1813<p class="description">Close an HTTP connection.</p>
5a738aea
MS
1814<p class="code">
1815void httpClose (<br>
1816&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
1817);</p>
1818<h4 class="parameters">Parameters</h4>
1819<dl>
1820<dt>http</dt>
ca6b43fc 1821<dd class="description">HTTP connection</dd>
5a738aea 1822</dl>
e1f19878 1823<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="httpCompareCredentials">httpCompareCredentials</a></h3>
ca6b43fc
MS
1824<p class="description">Compare two sets of X.509 credentials.</p>
1825<p class="code">
1826int httpCompareCredentials (<br>
1827&nbsp;&nbsp;&nbsp;&nbsp;cups_array_t *cred1,<br>
1828&nbsp;&nbsp;&nbsp;&nbsp;cups_array_t *cred2<br>
1829);</p>
1830<h4 class="parameters">Parameters</h4>
1831<dl>
1832<dt>cred1</dt>
1833<dd class="description">First set of X.509 credentials</dd>
1834<dt>cred2</dt>
1835<dd class="description">Second set of X.509 credentials</dd>
1836</dl>
1837<h4 class="returnvalue">Return Value</h4>
1838<p class="description">1 if they match, 0 if they do not</p>
06d4e77b 1839<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpConnect">httpConnect</a></h3>
5a738aea
MS
1840<p class="description">Connect to a HTTP server.</p>
1841<p class="code">
1842<a href="#http_t">http_t</a> *httpConnect (<br>
1843&nbsp;&nbsp;&nbsp;&nbsp;const char *host,<br>
1844&nbsp;&nbsp;&nbsp;&nbsp;int port<br>
1845);</p>
1846<h4 class="parameters">Parameters</h4>
1847<dl>
1848<dt>host</dt>
1849<dd class="description">Host to connect to</dd>
1850<dt>port</dt>
1851<dd class="description">Port number</dd>
1852</dl>
1853<h4 class="returnvalue">Return Value</h4>
1854<p class="description">New HTTP connection</p>
06d4e77b 1855<h4 class="discussion">Discussion</h4>
a469f8a5 1856<p class="discussion">This function is deprecated - use <a href="#httpConnect2"><code>httpConnect2</code></a> instead.
06d4e77b
MS
1857
1858</p>
9c0e8e5d 1859<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="httpConnect2">httpConnect2</a></h3>
a469f8a5
MS
1860<p class="description">Connect to a HTTP server.</p>
1861<p class="code">
1862<a href="#http_t">http_t</a> *httpConnect2 (<br>
1863&nbsp;&nbsp;&nbsp;&nbsp;const char *host,<br>
1864&nbsp;&nbsp;&nbsp;&nbsp;int port,<br>
1865&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist,<br>
1866&nbsp;&nbsp;&nbsp;&nbsp;int family,<br>
1867&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_encryption_t">http_encryption_t</a> encryption,<br>
1868&nbsp;&nbsp;&nbsp;&nbsp;int blocking,<br>
1869&nbsp;&nbsp;&nbsp;&nbsp;int msec,<br>
1870&nbsp;&nbsp;&nbsp;&nbsp;int *cancel<br>
1871);</p>
1872<h4 class="parameters">Parameters</h4>
1873<dl>
1874<dt>host</dt>
1875<dd class="description">Host to connect to</dd>
1876<dt>port</dt>
1877<dd class="description">Port number</dd>
1878<dt>addrlist</dt>
1879<dd class="description">List of addresses or NULL to lookup</dd>
1880<dt>family</dt>
1881<dd class="description">Address family to use or <code>AF_UNSPEC</code> for any</dd>
1882<dt>encryption</dt>
1883<dd class="description">Type of encryption to use</dd>
1884<dt>blocking</dt>
1885<dd class="description">1 for blocking connection, 0 for non-blocking</dd>
1886<dt>msec</dt>
db8b865d 1887<dd class="description">Connection timeout in milliseconds, 0 means don't connect</dd>
a469f8a5
MS
1888<dt>cancel</dt>
1889<dd class="description">Pointer to &quot;cancel&quot; variable</dd>
1890</dl>
1891<h4 class="returnvalue">Return Value</h4>
1892<p class="description">New HTTP connection</p>
1893<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpConnectEncrypt">httpConnectEncrypt</a></h3>
5a738aea
MS
1894<p class="description">Connect to a HTTP server using encryption.</p>
1895<p class="code">
1896<a href="#http_t">http_t</a> *httpConnectEncrypt (<br>
1897&nbsp;&nbsp;&nbsp;&nbsp;const char *host,<br>
1898&nbsp;&nbsp;&nbsp;&nbsp;int port,<br>
1899&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_encryption_t">http_encryption_t</a> encryption<br>
1900);</p>
1901<h4 class="parameters">Parameters</h4>
1902<dl>
1903<dt>host</dt>
1904<dd class="description">Host to connect to</dd>
1905<dt>port</dt>
1906<dd class="description">Port number</dd>
1907<dt>encryption</dt>
1908<dd class="description">Type of encryption to use</dd>
1909</dl>
1910<h4 class="returnvalue">Return Value</h4>
1911<p class="description">New HTTP connection</p>
a469f8a5
MS
1912<h4 class="discussion">Discussion</h4>
1913<p class="discussion">This function is now deprecated. Please use the <a href="#httpConnect2"><code>httpConnect2</code></a> function
1914instead.
1915
1916</p>
5a738aea
MS
1917<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpDecode64">httpDecode64</a></h3>
1918<p class="description">Base64-decode a string.</p>
1919<p class="code">
1920char *httpDecode64 (<br>
1921&nbsp;&nbsp;&nbsp;&nbsp;char *out,<br>
1922&nbsp;&nbsp;&nbsp;&nbsp;const char *in<br>
1923);</p>
1924<h4 class="parameters">Parameters</h4>
1925<dl>
1926<dt>out</dt>
1927<dd class="description">String to write to</dd>
1928<dt>in</dt>
1929<dd class="description">String to read from</dd>
1930</dl>
1931<h4 class="returnvalue">Return Value</h4>
1932<p class="description">Decoded string</p>
1933<h4 class="discussion">Discussion</h4>
1934<p class="discussion">This function is deprecated. Use the httpDecode64_2() function instead
ecdc0628 1935which provides buffer length arguments.
1936
5a738aea 1937</p>
f3c17241 1938<h3 class="function"><span class="info">&nbsp;CUPS 1.1.21/OS X 10.4&nbsp;</span><a name="httpDecode64_2">httpDecode64_2</a></h3>
5a738aea
MS
1939<p class="description">Base64-decode a string.</p>
1940<p class="code">
1941char *httpDecode64_2 (<br>
1942&nbsp;&nbsp;&nbsp;&nbsp;char *out,<br>
1943&nbsp;&nbsp;&nbsp;&nbsp;int *outlen,<br>
1944&nbsp;&nbsp;&nbsp;&nbsp;const char *in<br>
1945);</p>
1946<h4 class="parameters">Parameters</h4>
1947<dl>
1948<dt>out</dt>
1949<dd class="description">String to write to</dd>
1950<dt>outlen</dt>
1951<dd class="description">Size of output string</dd>
1952<dt>in</dt>
1953<dd class="description">String to read from</dd>
1954</dl>
1955<h4 class="returnvalue">Return Value</h4>
1956<p class="description">Decoded string</p>
1957<h3 class="function"><a name="httpDelete">httpDelete</a></h3>
1958<p class="description">Send a DELETE request to the server.</p>
1959<p class="code">
1960int httpDelete (<br>
1961&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
1962&nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
1963);</p>
1964<h4 class="parameters">Parameters</h4>
1965<dl>
1966<dt>http</dt>
ca6b43fc 1967<dd class="description">HTTP connection</dd>
5a738aea
MS
1968<dt>uri</dt>
1969<dd class="description">URI to delete</dd>
1970</dl>
1971<h4 class="returnvalue">Return Value</h4>
1972<p class="description">Status of call (0 = success)</p>
1973<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpEncode64">httpEncode64</a></h3>
1974<p class="description">Base64-encode a string.</p>
1975<p class="code">
1976char *httpEncode64 (<br>
1977&nbsp;&nbsp;&nbsp;&nbsp;char *out,<br>
1978&nbsp;&nbsp;&nbsp;&nbsp;const char *in<br>
1979);</p>
1980<h4 class="parameters">Parameters</h4>
1981<dl>
1982<dt>out</dt>
1983<dd class="description">String to write to</dd>
1984<dt>in</dt>
1985<dd class="description">String to read from</dd>
1986</dl>
1987<h4 class="returnvalue">Return Value</h4>
1988<p class="description">Encoded string</p>
1989<h4 class="discussion">Discussion</h4>
1990<p class="discussion">This function is deprecated. Use the httpEncode64_2() function instead
ecdc0628 1991which provides buffer length arguments.
1992
5a738aea 1993</p>
f3c17241 1994<h3 class="function"><span class="info">&nbsp;CUPS 1.1.21/OS X 10.4&nbsp;</span><a name="httpEncode64_2">httpEncode64_2</a></h3>
5a738aea
MS
1995<p class="description">Base64-encode a string.</p>
1996<p class="code">
1997char *httpEncode64_2 (<br>
1998&nbsp;&nbsp;&nbsp;&nbsp;char *out,<br>
1999&nbsp;&nbsp;&nbsp;&nbsp;int outlen,<br>
2000&nbsp;&nbsp;&nbsp;&nbsp;const char *in,<br>
2001&nbsp;&nbsp;&nbsp;&nbsp;int inlen<br>
2002);</p>
2003<h4 class="parameters">Parameters</h4>
2004<dl>
2005<dt>out</dt>
2006<dd class="description">String to write to</dd>
2007<dt>outlen</dt>
2008<dd class="description">Size of output string</dd>
2009<dt>in</dt>
2010<dd class="description">String to read from</dd>
2011<dt>inlen</dt>
2012<dd class="description">Size of input string</dd>
2013</dl>
2014<h4 class="returnvalue">Return Value</h4>
2015<p class="description">Encoded string</p>
2016<h3 class="function"><a name="httpEncryption">httpEncryption</a></h3>
2017<p class="description">Set the required encryption on the link.</p>
2018<p class="code">
2019int httpEncryption (<br>
2020&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2021&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_encryption_t">http_encryption_t</a> e<br>
2022);</p>
2023<h4 class="parameters">Parameters</h4>
2024<dl>
2025<dt>http</dt>
ca6b43fc 2026<dd class="description">HTTP connection</dd>
5a738aea
MS
2027<dt>e</dt>
2028<dd class="description">New encryption preference</dd>
2029</dl>
2030<h4 class="returnvalue">Return Value</h4>
2031<p class="description">-1 on error, 0 on success</p>
2032<h3 class="function"><a name="httpError">httpError</a></h3>
2033<p class="description">Get the last error on a connection.</p>
2034<p class="code">
2035int httpError (<br>
2036&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2037);</p>
2038<h4 class="parameters">Parameters</h4>
2039<dl>
2040<dt>http</dt>
ca6b43fc 2041<dd class="description">HTTP connection</dd>
5a738aea
MS
2042</dl>
2043<h4 class="returnvalue">Return Value</h4>
2044<p class="description">Error code (errno) value</p>
ca6b43fc
MS
2045<h3 class="function"><a name="httpFieldValue">httpFieldValue</a></h3>
2046<p class="description">Return the HTTP field enumeration value for a field
2047name.</p>
2048<p class="code">
2049<a href="#http_field_t">http_field_t</a> httpFieldValue (<br>
2050&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
2051);</p>
2052<h4 class="parameters">Parameters</h4>
2053<dl>
2054<dt>name</dt>
2055<dd class="description">String name</dd>
2056</dl>
2057<h4 class="returnvalue">Return Value</h4>
2058<p class="description">Field index</p>
5a738aea
MS
2059<h3 class="function"><a name="httpFlush">httpFlush</a></h3>
2060<p class="description">Flush data from a HTTP connection.</p>
2061<p class="code">
2062void httpFlush (<br>
2063&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2064);</p>
2065<h4 class="parameters">Parameters</h4>
2066<dl>
2067<dt>http</dt>
ca6b43fc 2068<dd class="description">HTTP connection</dd>
5a738aea 2069</dl>
f3c17241 2070<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpFlushWrite">httpFlushWrite</a></h3>
5a738aea
MS
2071<p class="description">Flush data in write buffer.</p>
2072<p class="code">
2073int httpFlushWrite (<br>
2074&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2075);</p>
2076<h4 class="parameters">Parameters</h4>
2077<dl>
2078<dt>http</dt>
ca6b43fc 2079<dd class="description">HTTP connection</dd>
5a738aea
MS
2080</dl>
2081<h4 class="returnvalue">Return Value</h4>
2082<p class="description">Bytes written or -1 on error</p>
10d09e33
MS
2083<h3 class="function"><a name="httpFreeCredentials">httpFreeCredentials</a></h3>
2084<p class="description">Free an array of credentials.</p>
2085<p class="code">
2086void httpFreeCredentials (<br>
2087&nbsp;&nbsp;&nbsp;&nbsp;cups_array_t *credentials<br>
2088);</p>
2089<h4 class="parameters">Parameters</h4>
2090<dl>
2091<dt>credentials</dt>
2092<dd class="description">Array of credentials</dd>
2093</dl>
5a738aea
MS
2094<h3 class="function"><a name="httpGet">httpGet</a></h3>
2095<p class="description">Send a GET request to the server.</p>
2096<p class="code">
2097int httpGet (<br>
2098&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2099&nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
2100);</p>
2101<h4 class="parameters">Parameters</h4>
2102<dl>
2103<dt>http</dt>
ca6b43fc 2104<dd class="description">HTTP connection</dd>
5a738aea
MS
2105<dt>uri</dt>
2106<dd class="description">URI to get</dd>
2107</dl>
2108<h4 class="returnvalue">Return Value</h4>
2109<p class="description">Status of call (0 = success)</p>
e1f19878 2110<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="httpGetActivity">httpGetActivity</a></h3>
ca6b43fc
MS
2111<p class="description">Get the most recent activity for a connection.</p>
2112<p class="code">
2113time_t httpGetActivity (<br>
2114&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2115);</p>
2116<h4 class="parameters">Parameters</h4>
2117<dl>
2118<dt>http</dt>
2119<dd class="description">HTTP connection</dd>
2120</dl>
2121<h4 class="returnvalue">Return Value</h4>
2122<p class="description">Time of last read or write</p>
2123<h4 class="discussion">Discussion</h4>
2124<p class="discussion">The return value is the UNIX time of the last read or write.
2125
2126</p>
e1f19878 2127<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="httpGetAddress">httpGetAddress</a></h3>
ca6b43fc
MS
2128<p class="description">Get the address of the connected peer of a connection.</p>
2129<p class="code">
2130<a href="#http_addr_t">http_addr_t</a> *httpGetAddress (<br>
2131&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2132);</p>
2133<h4 class="parameters">Parameters</h4>
2134<dl>
2135<dt>http</dt>
2136<dd class="description">HTTP connection</dd>
2137</dl>
2138<h4 class="returnvalue">Return Value</h4>
2139<p class="description">Connected address or <code>NULL</code></p>
2140<h4 class="discussion">Discussion</h4>
2141<p class="discussion">Returns <code>NULL</code> if the socket is currently unconnected.
2142
2143</p>
f3c17241 2144<h3 class="function"><span class="info">&nbsp;CUPS 1.3/OS X 10.5&nbsp;</span><a name="httpGetAuthString">httpGetAuthString</a></h3>
5a738aea
MS
2145<p class="description">Get the current authorization string.</p>
2146<p class="code">
2147char *httpGetAuthString (<br>
2148&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2149);</p>
2150<h4 class="parameters">Parameters</h4>
2151<dl>
2152<dt>http</dt>
ca6b43fc 2153<dd class="description">HTTP connection</dd>
5a738aea
MS
2154</dl>
2155<h4 class="returnvalue">Return Value</h4>
2156<p class="description">Authorization string</p>
2157<h4 class="discussion">Discussion</h4>
2158<p class="discussion">The authorization string is set by cupsDoAuthentication() and
355e94dc
MS
2159httpSetAuthString(). Use httpGetAuthString() to retrieve the
2160string to use with httpSetField() for the HTTP_FIELD_AUTHORIZATION
2161value.
2162
5a738aea 2163</p>
f3c17241 2164<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpGetBlocking">httpGetBlocking</a></h3>
5a738aea
MS
2165<p class="description">Get the blocking/non-block state of a connection.</p>
2166<p class="code">
2167int httpGetBlocking (<br>
2168&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2169);</p>
2170<h4 class="parameters">Parameters</h4>
2171<dl>
2172<dt>http</dt>
ca6b43fc 2173<dd class="description">HTTP connection</dd>
5a738aea
MS
2174</dl>
2175<h4 class="returnvalue">Return Value</h4>
2176<p class="description">1 if blocking, 0 if non-blocking</p>
9c0e8e5d 2177<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="httpGetContentEncoding">httpGetContentEncoding</a></h3>
a469f8a5
MS
2178<p class="description">Get a common content encoding, if any, between
2179the client and server.</p>
2180<p class="code">
2181const char *httpGetContentEncoding (<br>
2182&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2183);</p>
2184<h4 class="parameters">Parameters</h4>
2185<dl>
2186<dt>http</dt>
ca6b43fc 2187<dd class="description">HTTP connection</dd>
a469f8a5
MS
2188</dl>
2189<h4 class="returnvalue">Return Value</h4>
2190<p class="description">Content-Coding value or
2191<code>NULL</code> for the identity
2192coding.</p>
2193<h4 class="discussion">Discussion</h4>
2194<p class="discussion">This function uses the value of the Accepts-Encoding HTTP header and must be
2195called after receiving a response from the server or a request from the
2196client. The value returned can be use in subsequent requests (for clients)
2197or in the response (for servers) in order to compress the content stream.
2198
2199</p>
f3c17241 2200<h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/OS X 10.3&nbsp;</span><a name="httpGetCookie">httpGetCookie</a></h3>
5a738aea
MS
2201<p class="description">Get any cookie data from the response.</p>
2202<p class="code">
2203const char *httpGetCookie (<br>
2204&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2205);</p>
2206<h4 class="parameters">Parameters</h4>
2207<dl>
2208<dt>http</dt>
2209<dd class="description">HTTP connecion</dd>
2210</dl>
2211<h4 class="returnvalue">Return Value</h4>
2212<p class="description">Cookie data or NULL</p>
2213<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpGetDateString">httpGetDateString</a></h3>
2214<p class="description">Get a formatted date/time string from a time value.</p>
2215<p class="code">
2216const char *httpGetDateString (<br>
2217&nbsp;&nbsp;&nbsp;&nbsp;time_t t<br>
2218);</p>
2219<h4 class="parameters">Parameters</h4>
2220<dl>
2221<dt>t</dt>
2222<dd class="description">UNIX time</dd>
2223</dl>
2224<h4 class="returnvalue">Return Value</h4>
2225<p class="description">Date/time string</p>
f3c17241 2226<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpGetDateString2">httpGetDateString2</a></h3>
5a738aea
MS
2227<p class="description">Get a formatted date/time string from a time value.</p>
2228<p class="code">
2229const char *httpGetDateString2 (<br>
2230&nbsp;&nbsp;&nbsp;&nbsp;time_t t,<br>
2231&nbsp;&nbsp;&nbsp;&nbsp;char *s,<br>
2232&nbsp;&nbsp;&nbsp;&nbsp;int slen<br>
2233);</p>
2234<h4 class="parameters">Parameters</h4>
2235<dl>
2236<dt>t</dt>
2237<dd class="description">UNIX time</dd>
2238<dt>s</dt>
2239<dd class="description">String buffer</dd>
2240<dt>slen</dt>
2241<dd class="description">Size of string buffer</dd>
2242</dl>
2243<h4 class="returnvalue">Return Value</h4>
2244<p class="description">Date/time string</p>
2245<h3 class="function"><a name="httpGetDateTime">httpGetDateTime</a></h3>
2246<p class="description">Get a time value from a formatted date/time string.</p>
2247<p class="code">
2248time_t httpGetDateTime (<br>
2249&nbsp;&nbsp;&nbsp;&nbsp;const char *s<br>
2250);</p>
2251<h4 class="parameters">Parameters</h4>
2252<dl>
2253<dt>s</dt>
2254<dd class="description">Date/time string</dd>
2255</dl>
2256<h4 class="returnvalue">Return Value</h4>
2257<p class="description">UNIX time</p>
e1f19878 2258<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="httpGetEncryption">httpGetEncryption</a></h3>
ca6b43fc
MS
2259<p class="description">Get the current encryption mode of a connection.</p>
2260<p class="code">
2261<a href="#http_encryption_t">http_encryption_t</a> httpGetEncryption (<br>
2262&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2263);</p>
2264<h4 class="parameters">Parameters</h4>
2265<dl>
2266<dt>http</dt>
2267<dd class="description">HTTP connection</dd>
2268</dl>
2269<h4 class="returnvalue">Return Value</h4>
2270<p class="description">Current encryption mode</p>
2271<h4 class="discussion">Discussion</h4>
2272<p class="discussion">This function returns the encryption mode for the connection. Use the
2273<a href="#httpIsEncrypted"><code>httpIsEncrypted</code></a> function to determine whether a TLS session has
2274been established.
2275
2276</p>
9c0e8e5d 2277<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="httpGetExpect">httpGetExpect</a></h3>
a469f8a5
MS
2278<p class="description">Get the value of the Expect header, if any.</p>
2279<p class="code">
2280http_status_t httpGetExpect (<br>
2281&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2282);</p>
2283<h4 class="parameters">Parameters</h4>
2284<dl>
2285<dt>http</dt>
ca6b43fc 2286<dd class="description">HTTP connection</dd>
a469f8a5
MS
2287</dl>
2288<h4 class="returnvalue">Return Value</h4>
2289<p class="description">Expect: status, if any</p>
2290<h4 class="discussion">Discussion</h4>
2291<p class="discussion">Returns <code>HTTP_STATUS_NONE</code> if there is no Expect header, otherwise
2292returns the expected HTTP status code, typically <code>HTTP_STATUS_CONTINUE</code>.
2293
2294</p>
f3c17241 2295<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpGetFd">httpGetFd</a></h3>
5a738aea
MS
2296<p class="description">Get the file descriptor associated with a connection.</p>
2297<p class="code">
2298int httpGetFd (<br>
2299&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2300);</p>
2301<h4 class="parameters">Parameters</h4>
2302<dl>
2303<dt>http</dt>
ca6b43fc 2304<dd class="description">HTTP connection</dd>
5a738aea
MS
2305</dl>
2306<h4 class="returnvalue">Return Value</h4>
2307<p class="description">File descriptor or -1 if none</p>
2308<h3 class="function"><a name="httpGetField">httpGetField</a></h3>
2309<p class="description">Get a field value from a request/response.</p>
2310<p class="code">
2311const char *httpGetField (<br>
2312&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
79e1d494 2313&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_field_t">http_field_t</a> field<br>
5a738aea
MS
2314);</p>
2315<h4 class="parameters">Parameters</h4>
2316<dl>
2317<dt>http</dt>
ca6b43fc 2318<dd class="description">HTTP connection</dd>
5a738aea
MS
2319<dt>field</dt>
2320<dd class="description">Field to get</dd>
2321</dl>
2322<h4 class="returnvalue">Return Value</h4>
2323<p class="description">Field value</p>
2324<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpGetHostByName">httpGetHostByName</a></h3>
2325<p class="description">Lookup a hostname or IPv4 address, and return
2326address records for the specified name.</p>
2327<p class="code">
2328struct hostent *httpGetHostByName (<br>
2329&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
2330);</p>
2331<h4 class="parameters">Parameters</h4>
2332<dl>
2333<dt>name</dt>
2334<dd class="description">Hostname or IP address</dd>
2335</dl>
2336<h4 class="returnvalue">Return Value</h4>
2337<p class="description">Host entry</p>
f3c17241 2338<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpGetHostname">httpGetHostname</a></h3>
5a738aea
MS
2339<p class="description">Get the FQDN for the connection or local system.</p>
2340<p class="code">
2341const char *httpGetHostname (<br>
2342&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2343&nbsp;&nbsp;&nbsp;&nbsp;char *s,<br>
2344&nbsp;&nbsp;&nbsp;&nbsp;int slen<br>
2345);</p>
2346<h4 class="parameters">Parameters</h4>
2347<dl>
2348<dt>http</dt>
2349<dd class="description">HTTP connection or NULL</dd>
2350<dt>s</dt>
2351<dd class="description">String buffer for name</dd>
2352<dt>slen</dt>
2353<dd class="description">Size of buffer</dd>
2354</dl>
2355<h4 class="returnvalue">Return Value</h4>
2356<p class="description">FQDN for connection or system</p>
2357<h4 class="discussion">Discussion</h4>
2358<p class="discussion">When &quot;http&quot; points to a connected socket, return the hostname or
ca6b43fc
MS
2359address that was used in the call to httpConnect() or httpConnectEncrypt(),
2360or the address of the client for the connection from httpAcceptConnection().
80ca4592 2361Otherwise, return the FQDN for the local system using both gethostname()
2362and gethostbyname() to get the local hostname with domain.
ef416fc2 2363
5a738aea 2364</p>
e1f19878 2365<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="httpGetKeepAlive">httpGetKeepAlive</a></h3>
ca6b43fc
MS
2366<p class="description">Get the current Keep-Alive state of the connection.</p>
2367<p class="code">
2368<a href="#http_keepalive_t">http_keepalive_t</a> httpGetKeepAlive (<br>
2369&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2370);</p>
2371<h4 class="parameters">Parameters</h4>
2372<dl>
2373<dt>http</dt>
2374<dd class="description">HTTP connection</dd>
2375</dl>
2376<h4 class="returnvalue">Return Value</h4>
2377<p class="description">Keep-Alive state</p>
5a738aea
MS
2378<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpGetLength">httpGetLength</a></h3>
2379<p class="description">Get the amount of data remaining from the
2380content-length or transfer-encoding fields.</p>
2381<p class="code">
2382int httpGetLength (<br>
2383&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2384);</p>
2385<h4 class="parameters">Parameters</h4>
2386<dl>
2387<dt>http</dt>
ca6b43fc 2388<dd class="description">HTTP connection</dd>
5a738aea
MS
2389</dl>
2390<h4 class="returnvalue">Return Value</h4>
2391<p class="description">Content length</p>
2392<h4 class="discussion">Discussion</h4>
2393<p class="discussion">This function is deprecated and will not return lengths larger than
ef416fc2 23942^31 - 1; use httpGetLength2() instead.
2395
5a738aea 2396</p>
f3c17241 2397<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpGetLength2">httpGetLength2</a></h3>
5a738aea
MS
2398<p class="description">Get the amount of data remaining from the
2399content-length or transfer-encoding fields.</p>
2400<p class="code">
2401off_t httpGetLength2 (<br>
2402&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2403);</p>
2404<h4 class="parameters">Parameters</h4>
2405<dl>
2406<dt>http</dt>
ca6b43fc 2407<dd class="description">HTTP connection</dd>
5a738aea
MS
2408</dl>
2409<h4 class="returnvalue">Return Value</h4>
2410<p class="description">Content length</p>
2411<h4 class="discussion">Discussion</h4>
2412<p class="discussion">This function returns the complete content length, even for
ecdc0628 2413content larger than 2^31 - 1.
2414
ca6b43fc 2415</p>
e1f19878 2416<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="httpGetPending">httpGetPending</a></h3>
ca6b43fc
MS
2417<p class="description">Get the number of bytes that are buffered for writing.</p>
2418<p class="code">
2419size_t httpGetPending (<br>
2420&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2421);</p>
2422<h4 class="parameters">Parameters</h4>
2423<dl>
2424<dt>http</dt>
2425<dd class="description">HTTP connection</dd>
2426</dl>
2427<h4 class="returnvalue">Return Value</h4>
2428<p class="description">Number of bytes buffered</p>
e1f19878 2429<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="httpGetReady">httpGetReady</a></h3>
ca6b43fc
MS
2430<p class="description">Get the number of bytes that can be read without blocking.</p>
2431<p class="code">
2432size_t httpGetReady (<br>
2433&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2434);</p>
2435<h4 class="parameters">Parameters</h4>
2436<dl>
2437<dt>http</dt>
2438<dd class="description">HTTP connection</dd>
2439</dl>
2440<h4 class="returnvalue">Return Value</h4>
2441<p class="description">Number of bytes available</p>
e1f19878 2442<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="httpGetRemaining">httpGetRemaining</a></h3>
ca6b43fc
MS
2443<p class="description">Get the number of remaining bytes in the message
2444body or current chunk.</p>
2445<p class="code">
2446size_t httpGetRemaining (<br>
2447&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2448);</p>
2449<h4 class="parameters">Parameters</h4>
2450<dl>
2451<dt>http</dt>
2452<dd class="description">HTTP connection</dd>
2453</dl>
2454<h4 class="returnvalue">Return Value</h4>
2455<p class="description">Remaining bytes</p>
2456<h4 class="discussion">Discussion</h4>
2457<p class="discussion">The <a href="#httpIsChunked"><code>httpIsChunked</code></a> function can be used to determine whether the
2458message body is chunked or fixed-length.
2459
5a738aea 2460</p>
a2326b5b
MS
2461<h3 class="function"><a name="httpGetState">httpGetState</a></h3>
2462<p class="description">Get the current state of the HTTP request.</p>
2463<p class="code">
2464<a href="#http_state_t">http_state_t</a> httpGetState (<br>
2465&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2466);</p>
2467<h4 class="parameters">Parameters</h4>
2468<dl>
2469<dt>http</dt>
ca6b43fc 2470<dd class="description">HTTP connection</dd>
a2326b5b
MS
2471</dl>
2472<h4 class="returnvalue">Return Value</h4>
2473<p class="description">HTTP state</p>
f3c17241 2474<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpGetStatus">httpGetStatus</a></h3>
5a738aea
MS
2475<p class="description">Get the status of the last HTTP request.</p>
2476<p class="code">
a469f8a5 2477http_status_t httpGetStatus (<br>
5a738aea
MS
2478&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2479);</p>
2480<h4 class="parameters">Parameters</h4>
2481<dl>
2482<dt>http</dt>
ca6b43fc 2483<dd class="description">HTTP connection</dd>
5a738aea
MS
2484</dl>
2485<h4 class="returnvalue">Return Value</h4>
2486<p class="description">HTTP status</p>
2487<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpGetSubField">httpGetSubField</a></h3>
2488<p class="description">Get a sub-field value.</p>
2489<p class="code">
2490char *httpGetSubField (<br>
2491&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
79e1d494 2492&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_field_t">http_field_t</a> field,<br>
5a738aea
MS
2493&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2494&nbsp;&nbsp;&nbsp;&nbsp;char *value<br>
2495);</p>
2496<h4 class="parameters">Parameters</h4>
2497<dl>
2498<dt>http</dt>
ca6b43fc 2499<dd class="description">HTTP connection</dd>
5a738aea
MS
2500<dt>field</dt>
2501<dd class="description">Field index</dd>
2502<dt>name</dt>
2503<dd class="description">Name of sub-field</dd>
2504<dt>value</dt>
2505<dd class="description">Value string</dd>
2506</dl>
2507<h4 class="returnvalue">Return Value</h4>
2508<p class="description">Value or NULL</p>
f3c17241 2509<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpGetSubField2">httpGetSubField2</a></h3>
5a738aea
MS
2510<p class="description">Get a sub-field value.</p>
2511<p class="code">
2512char *httpGetSubField2 (<br>
2513&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
79e1d494 2514&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_field_t">http_field_t</a> field,<br>
5a738aea
MS
2515&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
2516&nbsp;&nbsp;&nbsp;&nbsp;char *value,<br>
2517&nbsp;&nbsp;&nbsp;&nbsp;int valuelen<br>
2518);</p>
2519<h4 class="parameters">Parameters</h4>
2520<dl>
2521<dt>http</dt>
ca6b43fc 2522<dd class="description">HTTP connection</dd>
5a738aea
MS
2523<dt>field</dt>
2524<dd class="description">Field index</dd>
2525<dt>name</dt>
2526<dd class="description">Name of sub-field</dd>
2527<dt>value</dt>
2528<dd class="description">Value string</dd>
2529<dt>valuelen</dt>
2530<dd class="description">Size of value buffer</dd>
2531</dl>
2532<h4 class="returnvalue">Return Value</h4>
2533<p class="description">Value or NULL</p>
a2326b5b
MS
2534<h3 class="function"><a name="httpGetVersion">httpGetVersion</a></h3>
2535<p class="description">Get the HTTP version at the other end.</p>
2536<p class="code">
2537<a href="#http_version_t">http_version_t</a> httpGetVersion (<br>
2538&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2539);</p>
2540<h4 class="parameters">Parameters</h4>
2541<dl>
2542<dt>http</dt>
ca6b43fc 2543<dd class="description">HTTP connection</dd>
a2326b5b
MS
2544</dl>
2545<h4 class="returnvalue">Return Value</h4>
2546<p class="description">Version number</p>
5a738aea
MS
2547<h3 class="function"><a name="httpGets">httpGets</a></h3>
2548<p class="description">Get a line of text from a HTTP connection.</p>
2549<p class="code">
2550char *httpGets (<br>
2551&nbsp;&nbsp;&nbsp;&nbsp;char *line,<br>
2552&nbsp;&nbsp;&nbsp;&nbsp;int length,<br>
2553&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2554);</p>
2555<h4 class="parameters">Parameters</h4>
2556<dl>
2557<dt>line</dt>
2558<dd class="description">Line to read into</dd>
2559<dt>length</dt>
2560<dd class="description">Max length of buffer</dd>
2561<dt>http</dt>
ca6b43fc 2562<dd class="description">HTTP connection</dd>
5a738aea
MS
2563</dl>
2564<h4 class="returnvalue">Return Value</h4>
2565<p class="description">Line or NULL</p>
2566<h3 class="function"><a name="httpHead">httpHead</a></h3>
2567<p class="description">Send a HEAD request to the server.</p>
2568<p class="code">
2569int httpHead (<br>
2570&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2571&nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
2572);</p>
2573<h4 class="parameters">Parameters</h4>
2574<dl>
2575<dt>http</dt>
ca6b43fc 2576<dd class="description">HTTP connection</dd>
5a738aea
MS
2577<dt>uri</dt>
2578<dd class="description">URI for head</dd>
2579</dl>
2580<h4 class="returnvalue">Return Value</h4>
2581<p class="description">Status of call (0 = success)</p>
2582<h3 class="function"><a name="httpInitialize">httpInitialize</a></h3>
2583<p class="description">Initialize the HTTP interface library and set the
2584default HTTP proxy (if any).</p>
2585<p class="code">
2586void httpInitialize (void);</p>
e1f19878 2587<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="httpIsChunked">httpIsChunked</a></h3>
ca6b43fc
MS
2588<p class="description">Report whether a message body is chunked.</p>
2589<p class="code">
2590int httpIsChunked (<br>
2591&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2592);</p>
2593<h4 class="parameters">Parameters</h4>
2594<dl>
2595<dt>http</dt>
2596<dd class="description">HTTP connection</dd>
2597</dl>
2598<h4 class="returnvalue">Return Value</h4>
2599<p class="description">1 if chunked, 0 if not</p>
2600<h4 class="discussion">Discussion</h4>
2601<p class="discussion">This function returns non-zero if the message body is composed of
2602variable-length chunks.
2603
2604</p>
e1f19878 2605<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="httpIsEncrypted">httpIsEncrypted</a></h3>
ca6b43fc
MS
2606<p class="description">Report whether a connection is encrypted.</p>
2607<p class="code">
2608int httpIsEncrypted (<br>
2609&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2610);</p>
2611<h4 class="parameters">Parameters</h4>
2612<dl>
2613<dt>http</dt>
2614<dd class="description">HTTP connection</dd>
2615</dl>
2616<h4 class="returnvalue">Return Value</h4>
2617<p class="description">1 if encrypted, 0 if not</p>
2618<h4 class="discussion">Discussion</h4>
2619<p class="discussion">This function returns non-zero if the connection is currently encrypted.
2620
2621</p>
5a738aea
MS
2622<h3 class="function"><a name="httpMD5">httpMD5</a></h3>
2623<p class="description">Compute the MD5 sum of the username:group:password.</p>
2624<p class="code">
2625char *httpMD5 (<br>
2626&nbsp;&nbsp;&nbsp;&nbsp;const char *username,<br>
2627&nbsp;&nbsp;&nbsp;&nbsp;const char *realm,<br>
2628&nbsp;&nbsp;&nbsp;&nbsp;const char *passwd,<br>
2629&nbsp;&nbsp;&nbsp;&nbsp;char md5[33]<br>
2630);</p>
2631<h4 class="parameters">Parameters</h4>
2632<dl>
2633<dt>username</dt>
2634<dd class="description">User name</dd>
2635<dt>realm</dt>
2636<dd class="description">Realm name</dd>
2637<dt>passwd</dt>
2638<dd class="description">Password string</dd>
2639<dt>md5[33]</dt>
2640<dd class="description">MD5 string</dd>
2641</dl>
2642<h4 class="returnvalue">Return Value</h4>
2643<p class="description">MD5 sum</p>
2644<h3 class="function"><a name="httpMD5Final">httpMD5Final</a></h3>
2645<p class="description">Combine the MD5 sum of the username, group, and password
ef416fc2 2646with the server-supplied nonce value, method, and
5a738aea
MS
2647request-uri.</p>
2648<p class="code">
2649char *httpMD5Final (<br>
2650&nbsp;&nbsp;&nbsp;&nbsp;const char *nonce,<br>
2651&nbsp;&nbsp;&nbsp;&nbsp;const char *method,<br>
2652&nbsp;&nbsp;&nbsp;&nbsp;const char *resource,<br>
2653&nbsp;&nbsp;&nbsp;&nbsp;char md5[33]<br>
2654);</p>
2655<h4 class="parameters">Parameters</h4>
2656<dl>
2657<dt>nonce</dt>
2658<dd class="description">Server nonce value</dd>
2659<dt>method</dt>
2660<dd class="description">METHOD (GET, POST, etc.)</dd>
2661<dt>resource</dt>
2662<dd class="description">Resource path</dd>
2663<dt>md5[33]</dt>
2664<dd class="description">MD5 sum</dd>
2665</dl>
2666<h4 class="returnvalue">Return Value</h4>
2667<p class="description">New sum</p>
2668<h3 class="function"><a name="httpMD5String">httpMD5String</a></h3>
2669<p class="description">Convert an MD5 sum to a character string.</p>
2670<p class="code">
2671char *httpMD5String (<br>
2672&nbsp;&nbsp;&nbsp;&nbsp;const unsigned char *sum,<br>
2673&nbsp;&nbsp;&nbsp;&nbsp;char md5[33]<br>
2674);</p>
2675<h4 class="parameters">Parameters</h4>
2676<dl>
2677<dt>sum</dt>
2678<dd class="description">MD5 sum data</dd>
2679<dt>md5[33]</dt>
2680<dd class="description">MD5 sum in hex</dd>
2681</dl>
2682<h4 class="returnvalue">Return Value</h4>
2683<p class="description">MD5 sum in hex</p>
2684<h3 class="function"><a name="httpOptions">httpOptions</a></h3>
2685<p class="description">Send an OPTIONS request to the server.</p>
2686<p class="code">
2687int httpOptions (<br>
2688&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2689&nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
2690);</p>
2691<h4 class="parameters">Parameters</h4>
2692<dl>
2693<dt>http</dt>
ca6b43fc 2694<dd class="description">HTTP connection</dd>
5a738aea
MS
2695<dt>uri</dt>
2696<dd class="description">URI for options</dd>
2697</dl>
2698<h4 class="returnvalue">Return Value</h4>
2699<p class="description">Status of call (0 = success)</p>
9c0e8e5d 2700<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="httpPeek">httpPeek</a></h3>
a469f8a5
MS
2701<p class="description">Peek at data from a HTTP connection.</p>
2702<p class="code">
2703ssize_t httpPeek (<br>
2704&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2705&nbsp;&nbsp;&nbsp;&nbsp;char *buffer,<br>
2706&nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
2707);</p>
2708<h4 class="parameters">Parameters</h4>
2709<dl>
2710<dt>http</dt>
ca6b43fc 2711<dd class="description">HTTP connection</dd>
a469f8a5
MS
2712<dt>buffer</dt>
2713<dd class="description">Buffer for data</dd>
2714<dt>length</dt>
2715<dd class="description">Maximum number of bytes</dd>
2716</dl>
2717<h4 class="returnvalue">Return Value</h4>
2718<p class="description">Number of bytes copied</p>
2719<h4 class="discussion">Discussion</h4>
2720<p class="discussion">This function copies available data from the given HTTP connection, reading
2721a buffer as needed. The data is still available for reading using
2722<a href="#httpRead"><code>httpRead</code></a> or <a href="#httpRead2"><code>httpRead2</code></a>.<br>
2723<br>
2724For non-blocking connections the usual timeouts apply.
2725
2726</p>
5a738aea
MS
2727<h3 class="function"><a name="httpPost">httpPost</a></h3>
2728<p class="description">Send a POST request to the server.</p>
2729<p class="code">
2730int httpPost (<br>
2731&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2732&nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
2733);</p>
2734<h4 class="parameters">Parameters</h4>
2735<dl>
2736<dt>http</dt>
ca6b43fc 2737<dd class="description">HTTP connection</dd>
5a738aea
MS
2738<dt>uri</dt>
2739<dd class="description">URI for post</dd>
2740</dl>
2741<h4 class="returnvalue">Return Value</h4>
2742<p class="description">Status of call (0 = success)</p>
2743<h3 class="function"><a name="httpPut">httpPut</a></h3>
2744<p class="description">Send a PUT request to the server.</p>
2745<p class="code">
2746int httpPut (<br>
2747&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2748&nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
2749);</p>
2750<h4 class="parameters">Parameters</h4>
2751<dl>
2752<dt>http</dt>
ca6b43fc 2753<dd class="description">HTTP connection</dd>
5a738aea
MS
2754<dt>uri</dt>
2755<dd class="description">URI to put</dd>
2756</dl>
2757<h4 class="returnvalue">Return Value</h4>
2758<p class="description">Status of call (0 = success)</p>
2759<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpRead">httpRead</a></h3>
2760<p class="description">Read data from a HTTP connection.</p>
2761<p class="code">
2762int httpRead (<br>
2763&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2764&nbsp;&nbsp;&nbsp;&nbsp;char *buffer,<br>
2765&nbsp;&nbsp;&nbsp;&nbsp;int length<br>
2766);</p>
2767<h4 class="parameters">Parameters</h4>
2768<dl>
2769<dt>http</dt>
ca6b43fc 2770<dd class="description">HTTP connection</dd>
5a738aea
MS
2771<dt>buffer</dt>
2772<dd class="description">Buffer for data</dd>
2773<dt>length</dt>
2774<dd class="description">Maximum number of bytes</dd>
2775</dl>
2776<h4 class="returnvalue">Return Value</h4>
2777<p class="description">Number of bytes read</p>
2778<h4 class="discussion">Discussion</h4>
2779<p class="discussion">This function is deprecated. Use the httpRead2() function which can
ecdc0628 2780read more than 2GB of data.
2781
5a738aea 2782</p>
f3c17241 2783<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpRead2">httpRead2</a></h3>
5a738aea
MS
2784<p class="description">Read data from a HTTP connection.</p>
2785<p class="code">
2786ssize_t httpRead2 (<br>
2787&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2788&nbsp;&nbsp;&nbsp;&nbsp;char *buffer,<br>
2789&nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
2790);</p>
2791<h4 class="parameters">Parameters</h4>
2792<dl>
2793<dt>http</dt>
ca6b43fc 2794<dd class="description">HTTP connection</dd>
5a738aea
MS
2795<dt>buffer</dt>
2796<dd class="description">Buffer for data</dd>
2797<dt>length</dt>
2798<dd class="description">Maximum number of bytes</dd>
2799</dl>
2800<h4 class="returnvalue">Return Value</h4>
2801<p class="description">Number of bytes read</p>
9c0e8e5d 2802<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="httpReadRequest">httpReadRequest</a></h3>
a469f8a5
MS
2803<p class="description">Read a HTTP request from a connection.</p>
2804<p class="code">
2805<a href="#http_state_t">http_state_t</a> httpReadRequest (<br>
2806&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2807&nbsp;&nbsp;&nbsp;&nbsp;char *uri,<br>
2808&nbsp;&nbsp;&nbsp;&nbsp;size_t urilen<br>
2809);</p>
2810<h4 class="parameters">Parameters</h4>
2811<dl>
2812<dt>http</dt>
2813<dd class="description">HTTP connection</dd>
2814<dt>uri</dt>
2815<dd class="description">URI buffer</dd>
2816<dt>urilen</dt>
2817<dd class="description">Size of URI buffer</dd>
2818</dl>
2819<h4 class="returnvalue">Return Value</h4>
2820<p class="description">New state of connection</p>
2821<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpReconnect">httpReconnect</a></h3>
5a738aea
MS
2822<p class="description">Reconnect to a HTTP server.</p>
2823<p class="code">
2824int httpReconnect (<br>
2825&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
2826);</p>
2827<h4 class="parameters">Parameters</h4>
2828<dl>
2829<dt>http</dt>
ca6b43fc 2830<dd class="description">HTTP connection</dd>
5a738aea
MS
2831</dl>
2832<h4 class="returnvalue">Return Value</h4>
2833<p class="description">0 on success, non-zero on failure</p>
a469f8a5
MS
2834<h4 class="discussion">Discussion</h4>
2835<p class="discussion">This function is deprecated. Please use the <a href="#httpReconnect2"><code>httpReconnect2</code></a> function
2836instead.
2837
2838</p>
3e7fe0ca
MS
2839<h3 class="function"><a name="httpReconnect2">httpReconnect2</a></h3>
2840<p class="description">Reconnect to a HTTP server with timeout and optional
2841cancel.</p>
2842<p class="code">
2843int httpReconnect2 (<br>
2844&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2845&nbsp;&nbsp;&nbsp;&nbsp;int msec,<br>
2846&nbsp;&nbsp;&nbsp;&nbsp;int *cancel<br>
2847);</p>
2848<h4 class="parameters">Parameters</h4>
2849<dl>
2850<dt>http</dt>
ca6b43fc 2851<dd class="description">HTTP connection</dd>
3e7fe0ca
MS
2852<dt>msec</dt>
2853<dd class="description">Timeout in milliseconds</dd>
2854<dt>cancel</dt>
2855<dd class="description">Pointer to &quot;cancel&quot; variable</dd>
2856</dl>
2857<h4 class="returnvalue">Return Value</h4>
2858<p class="description">0 on success, non-zero on failure</p>
e1f19878 2859<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="httpResolveHostname">httpResolveHostname</a></h3>
ca6b43fc
MS
2860<p class="description">Resolve the hostname of the HTTP connection
2861address.</p>
2862<p class="code">
2863const char *httpResolveHostname (<br>
2864&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
2865&nbsp;&nbsp;&nbsp;&nbsp;char *buffer,<br>
2866&nbsp;&nbsp;&nbsp;&nbsp;size_t bufsize<br>
2867);</p>
2868<h4 class="parameters">Parameters</h4>
2869<dl>
2870<dt>http</dt>
2871<dd class="description">HTTP connection</dd>
2872<dt>buffer</dt>
2873<dd class="description">Hostname buffer</dd>
2874<dt>bufsize</dt>
2875<dd class="description">Size of buffer</dd>
2876</dl>
2877<h4 class="returnvalue">Return Value</h4>
2878<p class="description">Resolved hostname or <code>NULL</code></p>
5a738aea
MS
2879<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpSeparate">httpSeparate</a></h3>
2880<p class="description">Separate a Universal Resource Identifier into its
2881components.</p>
2882<p class="code">
2883void httpSeparate (<br>
2884&nbsp;&nbsp;&nbsp;&nbsp;const char *uri,<br>
2885&nbsp;&nbsp;&nbsp;&nbsp;char *scheme,<br>
2886&nbsp;&nbsp;&nbsp;&nbsp;char *username,<br>
2887&nbsp;&nbsp;&nbsp;&nbsp;char *host,<br>
2888&nbsp;&nbsp;&nbsp;&nbsp;int *port,<br>
2889&nbsp;&nbsp;&nbsp;&nbsp;char *resource<br>
2890);</p>
2891<h4 class="parameters">Parameters</h4>
2892<dl>
2893<dt>uri</dt>
2894<dd class="description">Universal Resource Identifier</dd>
2895<dt>scheme</dt>
2896<dd class="description">Scheme [32] (http, https, etc.)</dd>
2897<dt>username</dt>
2898<dd class="description">Username [1024]</dd>
2899<dt>host</dt>
2900<dd class="description">Hostname [1024]</dd>
2901<dt>port</dt>
2902<dd class="description">Port number to use</dd>
2903<dt>resource</dt>
2904<dd class="description">Resource/filename [1024]</dd>
2905</dl>
2906<h4 class="discussion">Discussion</h4>
2907<p class="discussion">This function is deprecated; use the httpSeparateURI() function instead.
2908
2909</p>
f3c17241 2910<h3 class="function"><span class="info">&nbsp;CUPS 1.1.21/OS X 10.4&nbsp;</span><a name="httpSeparate2">httpSeparate2</a></h3>
5a738aea
MS
2911<p class="description">Separate a Universal Resource Identifier into its
2912components.</p>
2913<p class="code">
2914void httpSeparate2 (<br>
2915&nbsp;&nbsp;&nbsp;&nbsp;const char *uri,<br>
2916&nbsp;&nbsp;&nbsp;&nbsp;char *scheme,<br>
2917&nbsp;&nbsp;&nbsp;&nbsp;int schemelen,<br>
2918&nbsp;&nbsp;&nbsp;&nbsp;char *username,<br>
2919&nbsp;&nbsp;&nbsp;&nbsp;int usernamelen,<br>
2920&nbsp;&nbsp;&nbsp;&nbsp;char *host,<br>
2921&nbsp;&nbsp;&nbsp;&nbsp;int hostlen,<br>
2922&nbsp;&nbsp;&nbsp;&nbsp;int *port,<br>
2923&nbsp;&nbsp;&nbsp;&nbsp;char *resource,<br>
2924&nbsp;&nbsp;&nbsp;&nbsp;int resourcelen<br>
2925);</p>
2926<h4 class="parameters">Parameters</h4>
2927<dl>
2928<dt>uri</dt>
2929<dd class="description">Universal Resource Identifier</dd>
2930<dt>scheme</dt>
2931<dd class="description">Scheme (http, https, etc.)</dd>
2932<dt>schemelen</dt>
2933<dd class="description">Size of scheme buffer</dd>
2934<dt>username</dt>
2935<dd class="description">Username</dd>
2936<dt>usernamelen</dt>
2937<dd class="description">Size of username buffer</dd>
2938<dt>host</dt>
2939<dd class="description">Hostname</dd>
2940<dt>hostlen</dt>
2941<dd class="description">Size of hostname buffer</dd>
2942<dt>port</dt>
2943<dd class="description">Port number to use</dd>
2944<dt>resource</dt>
2945<dd class="description">Resource/filename</dd>
2946<dt>resourcelen</dt>
2947<dd class="description">Size of resource buffer</dd>
2948</dl>
2949<h4 class="discussion">Discussion</h4>
2950<p class="discussion">This function is deprecated; use the httpSeparateURI() function instead.
2951
2952
2953</p>
f3c17241 2954<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpSeparateURI">httpSeparateURI</a></h3>
5a738aea
MS
2955<p class="description">Separate a Universal Resource Identifier into its
2956components.</p>
2957<p class="code">
79e1d494
MS
2958<a href="#http_uri_status_t">http_uri_status_t</a> httpSeparateURI (<br>
2959&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_uri_coding_t">http_uri_coding_t</a> decoding,<br>
5a738aea
MS
2960&nbsp;&nbsp;&nbsp;&nbsp;const char *uri,<br>
2961&nbsp;&nbsp;&nbsp;&nbsp;char *scheme,<br>
2962&nbsp;&nbsp;&nbsp;&nbsp;int schemelen,<br>
2963&nbsp;&nbsp;&nbsp;&nbsp;char *username,<br>
2964&nbsp;&nbsp;&nbsp;&nbsp;int usernamelen,<br>
2965&nbsp;&nbsp;&nbsp;&nbsp;char *host,<br>
2966&nbsp;&nbsp;&nbsp;&nbsp;int hostlen,<br>
2967&nbsp;&nbsp;&nbsp;&nbsp;int *port,<br>
2968&nbsp;&nbsp;&nbsp;&nbsp;char *resource,<br>
2969&nbsp;&nbsp;&nbsp;&nbsp;int resourcelen<br>
2970);</p>
2971<h4 class="parameters">Parameters</h4>
2972<dl>
2973<dt>decoding</dt>
2974<dd class="description">Decoding flags</dd>
2975<dt>uri</dt>
2976<dd class="description">Universal Resource Identifier</dd>
2977<dt>scheme</dt>
2978<dd class="description">Scheme (http, https, etc.)</dd>
2979<dt>schemelen</dt>
2980<dd class="description">Size of scheme buffer</dd>
2981<dt>username</dt>
2982<dd class="description">Username</dd>
2983<dt>usernamelen</dt>
2984<dd class="description">Size of username buffer</dd>
2985<dt>host</dt>
2986<dd class="description">Hostname</dd>
2987<dt>hostlen</dt>
2988<dd class="description">Size of hostname buffer</dd>
2989<dt>port</dt>
2990<dd class="description">Port number to use</dd>
2991<dt>resource</dt>
2992<dd class="description">Resource/filename</dd>
2993<dt>resourcelen</dt>
2994<dd class="description">Size of resource buffer</dd>
2995</dl>
2996<h4 class="returnvalue">Return Value</h4>
2997<p class="description">Result of separation</p>
f3c17241 2998<h3 class="function"><span class="info">&nbsp;CUPS 1.3/OS X 10.5&nbsp;</span><a name="httpSetAuthString">httpSetAuthString</a></h3>
5a738aea
MS
2999<p class="description">Set the current authorization string.</p>
3000<p class="code">
3001void httpSetAuthString (<br>
3002&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
3003&nbsp;&nbsp;&nbsp;&nbsp;const char *scheme,<br>
3004&nbsp;&nbsp;&nbsp;&nbsp;const char *data<br>
3005);</p>
3006<h4 class="parameters">Parameters</h4>
3007<dl>
3008<dt>http</dt>
ca6b43fc 3009<dd class="description">HTTP connection</dd>
5a738aea
MS
3010<dt>scheme</dt>
3011<dd class="description">Auth scheme (NULL to clear it)</dd>
3012<dt>data</dt>
3013<dd class="description">Auth data (NULL for none)</dd>
3014</dl>
3015<h4 class="discussion">Discussion</h4>
3016<p class="discussion">This function just stores a copy of the current authorization string in
355e94dc
MS
3017the HTTP connection object. You must still call httpSetField() to set
3018HTTP_FIELD_AUTHORIZATION prior to issuing a HTTP request using httpGet(),
3019httpHead(), httpOptions(), httpPost, or httpPut().
3020
5a738aea 3021</p>
f3c17241 3022<h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/OS X 10.3&nbsp;</span><a name="httpSetCookie">httpSetCookie</a></h3>
10d09e33 3023<p class="description">Set the cookie value(s).</p>
5a738aea
MS
3024<p class="code">
3025void httpSetCookie (<br>
3026&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
3027&nbsp;&nbsp;&nbsp;&nbsp;const char *cookie<br>
3028);</p>
3029<h4 class="parameters">Parameters</h4>
3030<dl>
3031<dt>http</dt>
3032<dd class="description">Connection</dd>
3033<dt>cookie</dt>
3034<dd class="description">Cookie string</dd>
3035</dl>
f3c17241 3036<h3 class="function"><span class="info">&nbsp;CUPS 1.5/OS X 10.7&nbsp;</span><a name="httpSetCredentials">httpSetCredentials</a></h3>
10d09e33
MS
3037<p class="description">Set the credentials associated with an encrypted
3038connection.</p>
3039<p class="code">
3040int httpSetCredentials (<br>
3041&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
3042&nbsp;&nbsp;&nbsp;&nbsp;cups_array_t *credentials<br>
3043);</p>
3044<h4 class="parameters">Parameters</h4>
3045<dl>
3046<dt>http</dt>
ca6b43fc 3047<dd class="description">HTTP connection</dd>
10d09e33
MS
3048<dt>credentials</dt>
3049<dd class="description">Array of credentials</dd>
3050</dl>
3051<h4 class="returnvalue">Return Value</h4>
3052<p class="description">Status of call (0 = success)</p>
9c0e8e5d 3053<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="httpSetDefaultField">httpSetDefaultField</a></h3>
db8b865d
MS
3054<p class="description">Set the default value of an HTTP header.</p>
3055<p class="code">
3056void httpSetDefaultField (<br>
3057&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
3058&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_field_t">http_field_t</a> field,<br>
3059&nbsp;&nbsp;&nbsp;&nbsp;const char *value<br>
3060);</p>
3061<h4 class="parameters">Parameters</h4>
3062<dl>
3063<dt>http</dt>
ca6b43fc 3064<dd class="description">HTTP connection</dd>
db8b865d
MS
3065<dt>field</dt>
3066<dd class="description">Field index</dd>
3067<dt>value</dt>
3068<dd class="description">Value</dd>
3069</dl>
3070<h4 class="discussion">Discussion</h4>
6961465f
MS
3071<p class="discussion">Currently only <code>HTTP_FIELD_ACCEPT_ENCODING</code>, <code>HTTP_FIELD_SERVER</code>,
3072and <code>HTTP_FIELD_USER_AGENT</code> can be set.
db8b865d
MS
3073
3074</p>
f3c17241 3075<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpSetExpect">httpSetExpect</a></h3>
5a738aea
MS
3076<p class="description">Set the Expect: header in a request.</p>
3077<p class="code">
3078void httpSetExpect (<br>
3079&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
a469f8a5 3080&nbsp;&nbsp;&nbsp;&nbsp;http_status_t expect<br>
5a738aea
MS
3081);</p>
3082<h4 class="parameters">Parameters</h4>
3083<dl>
3084<dt>http</dt>
ca6b43fc 3085<dd class="description">HTTP connection</dd>
5a738aea 3086<dt>expect</dt>
a469f8a5 3087<dd class="description">HTTP status to expect
6961465f 3088(<code>HTTP_STATUS_CONTINUE</code>)</dd>
5a738aea
MS
3089</dl>
3090<h4 class="discussion">Discussion</h4>
a469f8a5
MS
3091<p class="discussion">Currently only <code>HTTP_STATUS_CONTINUE</code> is supported for the &quot;expect&quot;
3092argument.
5a738aea
MS
3093
3094</p>
3095<h3 class="function"><a name="httpSetField">httpSetField</a></h3>
3096<p class="description">Set the value of an HTTP header.</p>
3097<p class="code">
3098void httpSetField (<br>
3099&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
79e1d494 3100&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_field_t">http_field_t</a> field,<br>
5a738aea
MS
3101&nbsp;&nbsp;&nbsp;&nbsp;const char *value<br>
3102);</p>
3103<h4 class="parameters">Parameters</h4>
3104<dl>
3105<dt>http</dt>
ca6b43fc 3106<dd class="description">HTTP connection</dd>
5a738aea
MS
3107<dt>field</dt>
3108<dd class="description">Field index</dd>
3109<dt>value</dt>
3110<dd class="description">Value</dd>
3111</dl>
e1f19878 3112<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="httpSetKeepAlive">httpSetKeepAlive</a></h3>
ca6b43fc
MS
3113<p class="description">Set the current Keep-Alive state of a connection.</p>
3114<p class="code">
3115void httpSetKeepAlive (<br>
3116&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
3117&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_keepalive_t">http_keepalive_t</a> keep_alive<br>
3118);</p>
3119<h4 class="parameters">Parameters</h4>
3120<dl>
3121<dt>http</dt>
3122<dd class="description">HTTP connection</dd>
3123<dt>keep_alive</dt>
3124<dd class="description">New Keep-Alive value</dd>
3125</dl>
f3c17241 3126<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpSetLength">httpSetLength</a></h3>
5a738aea
MS
3127<p class="description">Set the content-length and content-encoding.</p>
3128<p class="code">
3129void httpSetLength (<br>
3130&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
3131&nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
3132);</p>
3133<h4 class="parameters">Parameters</h4>
3134<dl>
3135<dt>http</dt>
ca6b43fc 3136<dd class="description">HTTP connection</dd>
5a738aea
MS
3137<dt>length</dt>
3138<dd class="description">Length (0 for chunked)</dd>
3139</dl>
f3c17241 3140<h3 class="function"><span class="info">&nbsp;CUPS 1.5/OS X 10.7&nbsp;</span><a name="httpSetTimeout">httpSetTimeout</a></h3>
f228370c
MS
3141<p class="description">Set read/write timeouts and an optional callback.</p>
3142<p class="code">
3143void httpSetTimeout (<br>
3144&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
3145&nbsp;&nbsp;&nbsp;&nbsp;double timeout,<br>
3146&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_timeout_cb_t">http_timeout_cb_t</a> cb,<br>
3147&nbsp;&nbsp;&nbsp;&nbsp;void *user_data<br>
3148);</p>
3149<h4 class="parameters">Parameters</h4>
3150<dl>
3151<dt>http</dt>
ca6b43fc 3152<dd class="description">HTTP connection</dd>
f228370c
MS
3153<dt>timeout</dt>
3154<dd class="description">Number of seconds for timeout,
3155must be greater than 0</dd>
3156<dt>cb</dt>
3157<dd class="description">Callback function or NULL</dd>
3158<dt>user_data</dt>
3159<dd class="description">User data pointer</dd>
3160</dl>
3161<h4 class="discussion">Discussion</h4>
3162<p class="discussion">The optional timeout callback receives both the HTTP connection and a user
3163data pointer and must return 1 to continue or 0 to error (time) out.
3164
3165</p>
e1f19878 3166<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="httpShutdown">httpShutdown</a></h3>
ca6b43fc
MS
3167<p class="description">Shutdown one side of an HTTP connection.</p>
3168<p class="code">
3169void httpShutdown (<br>
3170&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
3171);</p>
3172<h4 class="parameters">Parameters</h4>
3173<dl>
3174<dt>http</dt>
3175<dd class="description">HTTP connection</dd>
3176</dl>
e1f19878 3177<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="httpStateString">httpStateString</a></h3>
ca6b43fc
MS
3178<p class="description">Return the string describing a HTTP state value.</p>
3179<p class="code">
3180const char *httpStateString (<br>
3181&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_state_t">http_state_t</a> state<br>
3182);</p>
3183<h4 class="parameters">Parameters</h4>
3184<dl>
3185<dt>state</dt>
3186<dd class="description">HTTP state value</dd>
3187</dl>
3188<h4 class="returnvalue">Return Value</h4>
3189<p class="description">State string</p>
5a738aea
MS
3190<h3 class="function"><a name="httpStatus">httpStatus</a></h3>
3191<p class="description">Return a short string describing a HTTP status code.</p>
3192<p class="code">
3193const char *httpStatus (<br>
a469f8a5 3194&nbsp;&nbsp;&nbsp;&nbsp;http_status_t status<br>
5a738aea
MS
3195);</p>
3196<h4 class="parameters">Parameters</h4>
3197<dl>
3198<dt>status</dt>
3199<dd class="description">HTTP status code</dd>
3200</dl>
3201<h4 class="returnvalue">Return Value</h4>
06d4e77b
MS
3202<p class="description">Localized status string</p>
3203<h4 class="discussion">Discussion</h4>
3204<p class="discussion">The returned string is localized to the current POSIX locale and is based
3205on the status strings defined in RFC 2616.</p>
5a738aea
MS
3206<h3 class="function"><a name="httpTrace">httpTrace</a></h3>
3207<p class="description">Send an TRACE request to the server.</p>
3208<p class="code">
3209int httpTrace (<br>
3210&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
3211&nbsp;&nbsp;&nbsp;&nbsp;const char *uri<br>
3212);</p>
3213<h4 class="parameters">Parameters</h4>
3214<dl>
3215<dt>http</dt>
ca6b43fc 3216<dd class="description">HTTP connection</dd>
5a738aea
MS
3217<dt>uri</dt>
3218<dd class="description">URI for trace</dd>
3219</dl>
3220<h4 class="returnvalue">Return Value</h4>
3221<p class="description">Status of call (0 = success)</p>
e1f19878 3222<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="httpURIStatusString">httpURIStatusString</a></h3>
ca6b43fc
MS
3223<p class="description">Return a string describing a URI status code.</p>
3224<p class="code">
3225const char *httpURIStatusString (<br>
3226&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_uri_status_t">http_uri_status_t</a> status<br>
3227);</p>
3228<h4 class="parameters">Parameters</h4>
3229<dl>
3230<dt>status</dt>
3231<dd class="description">URI status code</dd>
3232</dl>
3233<h4 class="returnvalue">Return Value</h4>
3234<p class="description">Localized status string</p>
5a738aea
MS
3235<h3 class="function"><a name="httpUpdate">httpUpdate</a></h3>
3236<p class="description">Update the current HTTP state for incoming data.</p>
3237<p class="code">
a469f8a5 3238http_status_t httpUpdate (<br>
5a738aea
MS
3239&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http<br>
3240);</p>
3241<h4 class="parameters">Parameters</h4>
3242<dl>
3243<dt>http</dt>
ca6b43fc 3244<dd class="description">HTTP connection</dd>
5a738aea
MS
3245</dl>
3246<h4 class="returnvalue">Return Value</h4>
3247<p class="description">HTTP status</p>
f3c17241 3248<h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/OS X 10.3&nbsp;</span><a name="httpWait">httpWait</a></h3>
5a738aea
MS
3249<p class="description">Wait for data available on a connection.</p>
3250<p class="code">
3251int httpWait (<br>
3252&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
3253&nbsp;&nbsp;&nbsp;&nbsp;int msec<br>
3254);</p>
3255<h4 class="parameters">Parameters</h4>
3256<dl>
3257<dt>http</dt>
ca6b43fc 3258<dd class="description">HTTP connection</dd>
5a738aea
MS
3259<dt>msec</dt>
3260<dd class="description">Milliseconds to wait</dd>
3261</dl>
3262<h4 class="returnvalue">Return Value</h4>
3263<p class="description">1 if data is available, 0 otherwise</p>
3264<h3 class="function"><span class="info">&nbsp;DEPRECATED&nbsp;</span><a name="httpWrite">httpWrite</a></h3>
3265<p class="description">Write data to a HTTP connection.</p>
3266<p class="code">
3267int httpWrite (<br>
3268&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
3269&nbsp;&nbsp;&nbsp;&nbsp;const char *buffer,<br>
3270&nbsp;&nbsp;&nbsp;&nbsp;int length<br>
3271);</p>
3272<h4 class="parameters">Parameters</h4>
3273<dl>
3274<dt>http</dt>
ca6b43fc 3275<dd class="description">HTTP connection</dd>
5a738aea
MS
3276<dt>buffer</dt>
3277<dd class="description">Buffer for data</dd>
3278<dt>length</dt>
3279<dd class="description">Number of bytes to write</dd>
3280</dl>
3281<h4 class="returnvalue">Return Value</h4>
3282<p class="description">Number of bytes written</p>
3283<h4 class="discussion">Discussion</h4>
3284<p class="discussion">This function is deprecated. Use the httpWrite2() function which can
ecdc0628 3285write more than 2GB of data.
3286
5a738aea 3287</p>
f3c17241 3288<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="httpWrite2">httpWrite2</a></h3>
5a738aea
MS
3289<p class="description">Write data to a HTTP connection.</p>
3290<p class="code">
3291ssize_t httpWrite2 (<br>
3292&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
3293&nbsp;&nbsp;&nbsp;&nbsp;const char *buffer,<br>
3294&nbsp;&nbsp;&nbsp;&nbsp;size_t length<br>
3295);</p>
3296<h4 class="parameters">Parameters</h4>
3297<dl>
3298<dt>http</dt>
ca6b43fc 3299<dd class="description">HTTP connection</dd>
5a738aea
MS
3300<dt>buffer</dt>
3301<dd class="description">Buffer for data</dd>
3302<dt>length</dt>
3303<dd class="description">Number of bytes to write</dd>
3304</dl>
3305<h4 class="returnvalue">Return Value</h4>
3306<p class="description">Number of bytes written</p>
9c0e8e5d 3307<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="httpWriteResponse">httpWriteResponse</a></h3>
a469f8a5
MS
3308<p class="description">Write a HTTP response to a client connection.</p>
3309<p class="code">
3310int httpWriteResponse (<br>
3311&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
3312&nbsp;&nbsp;&nbsp;&nbsp;http_status_t status<br>
3313);</p>
3314<h4 class="parameters">Parameters</h4>
3315<dl>
3316<dt>http</dt>
3317<dd class="description">HTTP connection</dd>
3318<dt>status</dt>
3319<dd class="description">Status code</dd>
3320</dl>
3321<h4 class="returnvalue">Return Value</h4>
3322<p class="description">0 on success, -1 on error</p>
5a738aea
MS
3323<h3 class="function"><a name="ippAddBoolean">ippAddBoolean</a></h3>
3324<p class="description">Add a boolean attribute to an IPP message.</p>
3325<p class="code">
3326<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBoolean (<br>
3327&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
a2326b5b 3328&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
5a738aea
MS
3329&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3330&nbsp;&nbsp;&nbsp;&nbsp;char value<br>
3331);</p>
3332<h4 class="parameters">Parameters</h4>
3333<dl>
3334<dt>ipp</dt>
3335<dd class="description">IPP message</dd>
3336<dt>group</dt>
3337<dd class="description">IPP group</dd>
3338<dt>name</dt>
3339<dd class="description">Name of attribute</dd>
3340<dt>value</dt>
3341<dd class="description">Value of attribute</dd>
3342</dl>
3343<h4 class="returnvalue">Return Value</h4>
3344<p class="description">New attribute</p>
a2326b5b 3345<h4 class="discussion">Discussion</h4>
a469f8a5
MS
3346<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3347the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
3348<br>
3349The <code>group</code> parameter specifies the IPP attribute group tag: none
3350(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3351event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3352(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3353(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
5a738aea
MS
3354<h3 class="function"><a name="ippAddBooleans">ippAddBooleans</a></h3>
3355<p class="description">Add an array of boolean values.</p>
3356<p class="code">
3357<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBooleans (<br>
3358&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
a2326b5b 3359&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
5a738aea
MS
3360&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3361&nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
3362&nbsp;&nbsp;&nbsp;&nbsp;const char *values<br>
3363);</p>
3364<h4 class="parameters">Parameters</h4>
3365<dl>
3366<dt>ipp</dt>
3367<dd class="description">IPP message</dd>
3368<dt>group</dt>
3369<dd class="description">IPP group</dd>
3370<dt>name</dt>
3371<dd class="description">Name of attribute</dd>
3372<dt>num_values</dt>
3373<dd class="description">Number of values</dd>
3374<dt>values</dt>
3375<dd class="description">Values</dd>
3376</dl>
3377<h4 class="returnvalue">Return Value</h4>
3378<p class="description">New attribute</p>
a2326b5b 3379<h4 class="discussion">Discussion</h4>
a469f8a5
MS
3380<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3381the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
3382<br>
3383The <code>group</code> parameter specifies the IPP attribute group tag: none
3384(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3385event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3386(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3387(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
f3c17241 3388<h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/OS X 10.3&nbsp;</span><a name="ippAddCollection">ippAddCollection</a></h3>
5a738aea
MS
3389<p class="description">Add a collection value.</p>
3390<p class="code">
3391<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollection (<br>
3392&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
a2326b5b 3393&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
5a738aea
MS
3394&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3395&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *value<br>
3396);</p>
3397<h4 class="parameters">Parameters</h4>
3398<dl>
3399<dt>ipp</dt>
3400<dd class="description">IPP message</dd>
3401<dt>group</dt>
3402<dd class="description">IPP group</dd>
3403<dt>name</dt>
3404<dd class="description">Name of attribute</dd>
3405<dt>value</dt>
3406<dd class="description">Value</dd>
3407</dl>
3408<h4 class="returnvalue">Return Value</h4>
3409<p class="description">New attribute</p>
a2326b5b 3410<h4 class="discussion">Discussion</h4>
a469f8a5
MS
3411<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3412the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
3413<br>
3414The <code>group</code> parameter specifies the IPP attribute group tag: none
3415(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3416event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3417(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3418(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
3419
3420</p>
f3c17241 3421<h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/OS X 10.3&nbsp;</span><a name="ippAddCollections">ippAddCollections</a></h3>
5a738aea
MS
3422<p class="description">Add an array of collection values.</p>
3423<p class="code">
3424<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollections (<br>
3425&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
a2326b5b 3426&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
5a738aea
MS
3427&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3428&nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
3429&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#ipp_t">ipp_t</a> **values<br>
3430);</p>
3431<h4 class="parameters">Parameters</h4>
3432<dl>
3433<dt>ipp</dt>
3434<dd class="description">IPP message</dd>
3435<dt>group</dt>
3436<dd class="description">IPP group</dd>
3437<dt>name</dt>
3438<dd class="description">Name of attribute</dd>
3439<dt>num_values</dt>
3440<dd class="description">Number of values</dd>
3441<dt>values</dt>
3442<dd class="description">Values</dd>
3443</dl>
3444<h4 class="returnvalue">Return Value</h4>
3445<p class="description">New attribute</p>
a2326b5b 3446<h4 class="discussion">Discussion</h4>
a469f8a5
MS
3447<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3448the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
3449<br>
3450The <code>group</code> parameter specifies the IPP attribute group tag: none
3451(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3452event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3453(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3454(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
3455
3456</p>
5a738aea
MS
3457<h3 class="function"><a name="ippAddDate">ippAddDate</a></h3>
3458<p class="description">Add a date attribute to an IPP message.</p>
3459<p class="code">
3460<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddDate (<br>
3461&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
a2326b5b 3462&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
5a738aea
MS
3463&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3464&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#ipp_uchar_t">ipp_uchar_t</a> *value<br>
3465);</p>
3466<h4 class="parameters">Parameters</h4>
3467<dl>
3468<dt>ipp</dt>
3469<dd class="description">IPP message</dd>
3470<dt>group</dt>
3471<dd class="description">IPP group</dd>
3472<dt>name</dt>
3473<dd class="description">Name of attribute</dd>
3474<dt>value</dt>
3475<dd class="description">Value</dd>
3476</dl>
3477<h4 class="returnvalue">Return Value</h4>
3478<p class="description">New attribute</p>
a2326b5b 3479<h4 class="discussion">Discussion</h4>
a469f8a5
MS
3480<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3481the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
3482<br>
3483The <code>group</code> parameter specifies the IPP attribute group tag: none
3484(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3485event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3486(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3487(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
5a738aea
MS
3488<h3 class="function"><a name="ippAddInteger">ippAddInteger</a></h3>
3489<p class="description">Add a integer attribute to an IPP message.</p>
3490<p class="code">
3491<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddInteger (<br>
3492&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
a2326b5b
MS
3493&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
3494&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t value_tag,<br>
5a738aea
MS
3495&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3496&nbsp;&nbsp;&nbsp;&nbsp;int value<br>
3497);</p>
3498<h4 class="parameters">Parameters</h4>
3499<dl>
3500<dt>ipp</dt>
3501<dd class="description">IPP message</dd>
3502<dt>group</dt>
3503<dd class="description">IPP group</dd>
a2326b5b 3504<dt>value_tag</dt>
5a738aea
MS
3505<dd class="description">Type of attribute</dd>
3506<dt>name</dt>
3507<dd class="description">Name of attribute</dd>
3508<dt>value</dt>
3509<dd class="description">Value of attribute</dd>
3510</dl>
3511<h4 class="returnvalue">Return Value</h4>
3512<p class="description">New attribute</p>
a2326b5b 3513<h4 class="discussion">Discussion</h4>
a469f8a5
MS
3514<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3515the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
3516<br>
3517The <code>group</code> parameter specifies the IPP attribute group tag: none
3518(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3519event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3520(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3521(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
3522<br>
3523Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
3524(<code>IPP_TAG_INTEGER</code>).</p>
5a738aea
MS
3525<h3 class="function"><a name="ippAddIntegers">ippAddIntegers</a></h3>
3526<p class="description">Add an array of integer values.</p>
3527<p class="code">
3528<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddIntegers (<br>
3529&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
a2326b5b
MS
3530&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
3531&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t value_tag,<br>
5a738aea
MS
3532&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3533&nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
3534&nbsp;&nbsp;&nbsp;&nbsp;const int *values<br>
3535);</p>
3536<h4 class="parameters">Parameters</h4>
3537<dl>
3538<dt>ipp</dt>
3539<dd class="description">IPP message</dd>
3540<dt>group</dt>
3541<dd class="description">IPP group</dd>
a2326b5b 3542<dt>value_tag</dt>
5a738aea
MS
3543<dd class="description">Type of attribute</dd>
3544<dt>name</dt>
3545<dd class="description">Name of attribute</dd>
3546<dt>num_values</dt>
3547<dd class="description">Number of values</dd>
3548<dt>values</dt>
3549<dd class="description">Values</dd>
3550</dl>
3551<h4 class="returnvalue">Return Value</h4>
3552<p class="description">New attribute</p>
a2326b5b 3553<h4 class="discussion">Discussion</h4>
a469f8a5
MS
3554<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3555the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
3556<br>
3557The <code>group</code> parameter specifies the IPP attribute group tag: none
3558(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3559event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3560(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3561(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
3562<br>
3563Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
3564(<code>IPP_TAG_INTEGER</code>).</p>
f3c17241 3565<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="ippAddOctetString">ippAddOctetString</a></h3>
5a738aea
MS
3566<p class="description">Add an octetString value to an IPP message.</p>
3567<p class="code">
3568<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOctetString (<br>
3569&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
a2326b5b 3570&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
5a738aea
MS
3571&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3572&nbsp;&nbsp;&nbsp;&nbsp;const void *data,<br>
3573&nbsp;&nbsp;&nbsp;&nbsp;int datalen<br>
3574);</p>
3575<h4 class="parameters">Parameters</h4>
3576<dl>
3577<dt>ipp</dt>
3578<dd class="description">IPP message</dd>
3579<dt>group</dt>
3580<dd class="description">IPP group</dd>
3581<dt>name</dt>
3582<dd class="description">Name of attribute</dd>
3583<dt>data</dt>
3584<dd class="description">octetString data</dd>
3585<dt>datalen</dt>
3586<dd class="description">Length of data in bytes</dd>
3587</dl>
3588<h4 class="returnvalue">Return Value</h4>
3589<p class="description">New attribute</p>
a2326b5b 3590<h4 class="discussion">Discussion</h4>
a469f8a5
MS
3591<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3592the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
3593<br>
3594The <code>group</code> parameter specifies the IPP attribute group tag: none
3595(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3596event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3597(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3598(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
3599
3600</p>
f3c17241 3601<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippAddOutOfBand">ippAddOutOfBand</a></h3>
a2326b5b
MS
3602<p class="description">Add an out-of-band value to an IPP message.</p>
3603<p class="code">
3604<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOutOfBand (<br>
3605&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3606&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
3607&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t value_tag,<br>
3608&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
3609);</p>
3610<h4 class="parameters">Parameters</h4>
3611<dl>
3612<dt>ipp</dt>
3613<dd class="description">IPP message</dd>
3614<dt>group</dt>
3615<dd class="description">IPP group</dd>
3616<dt>value_tag</dt>
3617<dd class="description">Type of attribute</dd>
3618<dt>name</dt>
3619<dd class="description">Name of attribute</dd>
3620</dl>
3621<h4 class="returnvalue">Return Value</h4>
3622<p class="description">New attribute</p>
3623<h4 class="discussion">Discussion</h4>
a469f8a5
MS
3624<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3625the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
3626<br>
3627The <code>group</code> parameter specifies the IPP attribute group tag: none
3628(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3629event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3630(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3631(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
3632<br>
3633Supported out-of-band values include unsupported-value
3634(<code>IPP_TAG_UNSUPPORTED_VALUE</code>), default (<code>IPP_TAG_DEFAULT</code>), unknown
3635(<code>IPP_TAG_UNKNOWN</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable
3636(<code>IPP_TAG_NOTSETTABLE</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), and
3637admin-define (<code>IPP_TAG_ADMINDEFINE</code>).
3638
3639</p>
5a738aea
MS
3640<h3 class="function"><a name="ippAddRange">ippAddRange</a></h3>
3641<p class="description">Add a range of values to an IPP message.</p>
3642<p class="code">
3643<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRange (<br>
3644&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
a2326b5b 3645&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
5a738aea
MS
3646&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3647&nbsp;&nbsp;&nbsp;&nbsp;int lower,<br>
3648&nbsp;&nbsp;&nbsp;&nbsp;int upper<br>
3649);</p>
3650<h4 class="parameters">Parameters</h4>
3651<dl>
3652<dt>ipp</dt>
3653<dd class="description">IPP message</dd>
3654<dt>group</dt>
3655<dd class="description">IPP group</dd>
3656<dt>name</dt>
3657<dd class="description">Name of attribute</dd>
3658<dt>lower</dt>
3659<dd class="description">Lower value</dd>
3660<dt>upper</dt>
3661<dd class="description">Upper value</dd>
3662</dl>
3663<h4 class="returnvalue">Return Value</h4>
3664<p class="description">New attribute</p>
a2326b5b 3665<h4 class="discussion">Discussion</h4>
a469f8a5
MS
3666<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3667the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
3668<br>
3669The <code>group</code> parameter specifies the IPP attribute group tag: none
3670(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3671event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3672(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3673(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
3674<br>
3675The <code>lower</code> parameter must be less than or equal to the <code>upper</code> parameter.</p>
5a738aea
MS
3676<h3 class="function"><a name="ippAddRanges">ippAddRanges</a></h3>
3677<p class="description">Add ranges of values to an IPP message.</p>
3678<p class="code">
3679<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRanges (<br>
3680&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
a2326b5b 3681&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
5a738aea
MS
3682&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3683&nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
3684&nbsp;&nbsp;&nbsp;&nbsp;const int *lower,<br>
3685&nbsp;&nbsp;&nbsp;&nbsp;const int *upper<br>
3686);</p>
3687<h4 class="parameters">Parameters</h4>
3688<dl>
3689<dt>ipp</dt>
3690<dd class="description">IPP message</dd>
3691<dt>group</dt>
3692<dd class="description">IPP group</dd>
3693<dt>name</dt>
3694<dd class="description">Name of attribute</dd>
3695<dt>num_values</dt>
3696<dd class="description">Number of values</dd>
3697<dt>lower</dt>
3698<dd class="description">Lower values</dd>
3699<dt>upper</dt>
3700<dd class="description">Upper values</dd>
3701</dl>
3702<h4 class="returnvalue">Return Value</h4>
3703<p class="description">New attribute</p>
a2326b5b 3704<h4 class="discussion">Discussion</h4>
a469f8a5
MS
3705<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3706the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
3707<br>
3708The <code>group</code> parameter specifies the IPP attribute group tag: none
3709(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3710event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3711(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3712(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
5a738aea
MS
3713<h3 class="function"><a name="ippAddResolution">ippAddResolution</a></h3>
3714<p class="description">Add a resolution value to an IPP message.</p>
3715<p class="code">
3716<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolution (<br>
3717&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
a2326b5b 3718&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
5a738aea 3719&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
79e1d494 3720&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_res_t">ipp_res_t</a> units,<br>
5a738aea
MS
3721&nbsp;&nbsp;&nbsp;&nbsp;int xres,<br>
3722&nbsp;&nbsp;&nbsp;&nbsp;int yres<br>
3723);</p>
3724<h4 class="parameters">Parameters</h4>
3725<dl>
3726<dt>ipp</dt>
3727<dd class="description">IPP message</dd>
3728<dt>group</dt>
3729<dd class="description">IPP group</dd>
3730<dt>name</dt>
3731<dd class="description">Name of attribute</dd>
3732<dt>units</dt>
3733<dd class="description">Units for resolution</dd>
3734<dt>xres</dt>
3735<dd class="description">X resolution</dd>
3736<dt>yres</dt>
3737<dd class="description">Y resolution</dd>
3738</dl>
3739<h4 class="returnvalue">Return Value</h4>
3740<p class="description">New attribute</p>
a2326b5b 3741<h4 class="discussion">Discussion</h4>
a469f8a5
MS
3742<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3743the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
3744<br>
3745The <code>group</code> parameter specifies the IPP attribute group tag: none
3746(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3747event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3748(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3749(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
5a738aea
MS
3750<h3 class="function"><a name="ippAddResolutions">ippAddResolutions</a></h3>
3751<p class="description">Add resolution values to an IPP message.</p>
3752<p class="code">
3753<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolutions (<br>
3754&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
a2326b5b 3755&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
5a738aea
MS
3756&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3757&nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
79e1d494 3758&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_res_t">ipp_res_t</a> units,<br>
5a738aea
MS
3759&nbsp;&nbsp;&nbsp;&nbsp;const int *xres,<br>
3760&nbsp;&nbsp;&nbsp;&nbsp;const int *yres<br>
3761);</p>
3762<h4 class="parameters">Parameters</h4>
3763<dl>
3764<dt>ipp</dt>
3765<dd class="description">IPP message</dd>
3766<dt>group</dt>
3767<dd class="description">IPP group</dd>
3768<dt>name</dt>
3769<dd class="description">Name of attribute</dd>
3770<dt>num_values</dt>
3771<dd class="description">Number of values</dd>
3772<dt>units</dt>
3773<dd class="description">Units for resolution</dd>
3774<dt>xres</dt>
3775<dd class="description">X resolutions</dd>
3776<dt>yres</dt>
3777<dd class="description">Y resolutions</dd>
3778</dl>
3779<h4 class="returnvalue">Return Value</h4>
3780<p class="description">New attribute</p>
a2326b5b 3781<h4 class="discussion">Discussion</h4>
a469f8a5
MS
3782<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3783the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
3784<br>
3785The <code>group</code> parameter specifies the IPP attribute group tag: none
3786(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3787event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3788(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3789(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
5a738aea
MS
3790<h3 class="function"><a name="ippAddSeparator">ippAddSeparator</a></h3>
3791<p class="description">Add a group separator to an IPP message.</p>
3792<p class="code">
3793<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddSeparator (<br>
3794&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
3795);</p>
3796<h4 class="parameters">Parameters</h4>
3797<dl>
3798<dt>ipp</dt>
3799<dd class="description">IPP message</dd>
3800</dl>
3801<h4 class="returnvalue">Return Value</h4>
3802<p class="description">New attribute</p>
a2326b5b 3803<h4 class="discussion">Discussion</h4>
a469f8a5
MS
3804<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3805the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.</p>
5a738aea
MS
3806<h3 class="function"><a name="ippAddString">ippAddString</a></h3>
3807<p class="description">Add a language-encoded string to an IPP message.</p>
3808<p class="code">
3809<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddString (<br>
3810&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
a2326b5b
MS
3811&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
3812&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t value_tag,<br>
5a738aea 3813&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
a2326b5b 3814&nbsp;&nbsp;&nbsp;&nbsp;const char *language,<br>
5a738aea
MS
3815&nbsp;&nbsp;&nbsp;&nbsp;const char *value<br>
3816);</p>
3817<h4 class="parameters">Parameters</h4>
3818<dl>
3819<dt>ipp</dt>
3820<dd class="description">IPP message</dd>
3821<dt>group</dt>
3822<dd class="description">IPP group</dd>
a2326b5b 3823<dt>value_tag</dt>
5a738aea
MS
3824<dd class="description">Type of attribute</dd>
3825<dt>name</dt>
3826<dd class="description">Name of attribute</dd>
a2326b5b
MS
3827<dt>language</dt>
3828<dd class="description">Language code</dd>
5a738aea
MS
3829<dt>value</dt>
3830<dd class="description">Value</dd>
3831</dl>
3832<h4 class="returnvalue">Return Value</h4>
3833<p class="description">New attribute</p>
a2326b5b 3834<h4 class="discussion">Discussion</h4>
a469f8a5
MS
3835<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3836the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
3837<br>
3838The <code>group</code> parameter specifies the IPP attribute group tag: none
3839(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
3840event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
3841(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
3842(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
3843<br>
3844Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
3845(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
3846(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
3847(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
3848(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
3849(<code>IPP_TAG_URISCHEME</code>).<br>
3850<br>
3851The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
3852textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
9c0e8e5d 3853<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="ippAddStringf">ippAddStringf</a></h3>
a469f8a5
MS
3854<p class="description">Add a formatted string to an IPP message.</p>
3855<p class="code">
3856<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStringf (<br>
3857&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3858&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
3859&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t value_tag,<br>
3860&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3861&nbsp;&nbsp;&nbsp;&nbsp;const char *language,<br>
3862&nbsp;&nbsp;&nbsp;&nbsp;const char *format,<br>
3863&nbsp;&nbsp;&nbsp;&nbsp;...<br>
3864);</p>
3865<h4 class="parameters">Parameters</h4>
3866<dl>
3867<dt>ipp</dt>
3868<dd class="description">IPP message</dd>
3869<dt>group</dt>
3870<dd class="description">IPP group</dd>
3871<dt>value_tag</dt>
3872<dd class="description">Type of attribute</dd>
3873<dt>name</dt>
3874<dd class="description">Name of attribute</dd>
3875<dt>language</dt>
3876<dd class="description">Language code (<code>NULL</code> for default)</dd>
3877<dt>format</dt>
3878<dd class="description">Printf-style format string</dd>
3879<dt>...</dt>
3880<dd class="description">Additional arguments as needed</dd>
3881</dl>
3882<h4 class="returnvalue">Return Value</h4>
3883<p class="description">New attribute</p>
3884<h4 class="discussion">Discussion</h4>
3885<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3886the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3887<br>
3888The <code>group</code> parameter specifies the IPP attribute group tag: none
3889(<code>IPP_TAG_ZERO</code>, for member attributes), document
3890(<code>IPP_TAG_DOCUMENT</code>), event notification
3891(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
3892printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
3893or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
3894<br>
3895Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
3896(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
3897(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
3898(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
3899(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
3900(<code>IPP_TAG_URISCHEME</code>).<br>
3901<br>
3902The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
3903and textWithLanguage string values and must be <code>NULL</code> for all other
3904string values.<br>
3905<br>
3906The <code>format</code> parameter uses formatting characters compatible with the
3907printf family of standard functions. Additional arguments follow it as
3908needed. The formatted string is truncated as needed to the maximum length of
3909the corresponding value type.
3910
3911</p>
9c0e8e5d 3912<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="ippAddStringfv">ippAddStringfv</a></h3>
a469f8a5
MS
3913<p class="description">Add a formatted string to an IPP message.</p>
3914<p class="code">
3915<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStringfv (<br>
3916&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3917&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
3918&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t value_tag,<br>
3919&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3920&nbsp;&nbsp;&nbsp;&nbsp;const char *language,<br>
3921&nbsp;&nbsp;&nbsp;&nbsp;const char *format,<br>
3922&nbsp;&nbsp;&nbsp;&nbsp;va_list ap<br>
3923);</p>
3924<h4 class="parameters">Parameters</h4>
3925<dl>
3926<dt>ipp</dt>
3927<dd class="description">IPP message</dd>
3928<dt>group</dt>
3929<dd class="description">IPP group</dd>
3930<dt>value_tag</dt>
3931<dd class="description">Type of attribute</dd>
3932<dt>name</dt>
3933<dd class="description">Name of attribute</dd>
3934<dt>language</dt>
3935<dd class="description">Language code (<code>NULL</code> for default)</dd>
3936<dt>format</dt>
3937<dd class="description">Printf-style format string</dd>
3938<dt>ap</dt>
3939<dd class="description">Additional arguments</dd>
3940</dl>
3941<h4 class="returnvalue">Return Value</h4>
3942<p class="description">New attribute</p>
3943<h4 class="discussion">Discussion</h4>
3944<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
3945the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3946<br>
3947The <code>group</code> parameter specifies the IPP attribute group tag: none
3948(<code>IPP_TAG_ZERO</code>, for member attributes), document
3949(<code>IPP_TAG_DOCUMENT</code>), event notification
3950(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
3951printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
3952or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
3953<br>
3954Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
3955(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
3956(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
3957(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
3958(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
3959(<code>IPP_TAG_URISCHEME</code>).<br>
3960<br>
3961The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
3962and textWithLanguage string values and must be <code>NULL</code> for all other
3963string values.<br>
3964<br>
3965The <code>format</code> parameter uses formatting characters compatible with the
3966printf family of standard functions. Additional arguments are passed in the
3967stdarg pointer <code>ap</code>. The formatted string is truncated as needed to the
3968maximum length of the corresponding value type.
3969
3970</p>
5a738aea
MS
3971<h3 class="function"><a name="ippAddStrings">ippAddStrings</a></h3>
3972<p class="description">Add language-encoded strings to an IPP message.</p>
3973<p class="code">
3974<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStrings (<br>
3975&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
a2326b5b
MS
3976&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group,<br>
3977&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t value_tag,<br>
5a738aea
MS
3978&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
3979&nbsp;&nbsp;&nbsp;&nbsp;int num_values,<br>
a2326b5b 3980&nbsp;&nbsp;&nbsp;&nbsp;const char *language,<br>
5a738aea
MS
3981&nbsp;&nbsp;&nbsp;&nbsp;const char *const *values<br>
3982);</p>
3983<h4 class="parameters">Parameters</h4>
3984<dl>
3985<dt>ipp</dt>
3986<dd class="description">IPP message</dd>
3987<dt>group</dt>
3988<dd class="description">IPP group</dd>
a2326b5b 3989<dt>value_tag</dt>
5a738aea
MS
3990<dd class="description">Type of attribute</dd>
3991<dt>name</dt>
3992<dd class="description">Name of attribute</dd>
3993<dt>num_values</dt>
3994<dd class="description">Number of values</dd>
a2326b5b
MS
3995<dt>language</dt>
3996<dd class="description">Language code (<code>NULL</code> for default)</dd>
5a738aea
MS
3997<dt>values</dt>
3998<dd class="description">Values</dd>
3999</dl>
4000<h4 class="returnvalue">Return Value</h4>
4001<p class="description">New attribute</p>
a2326b5b 4002<h4 class="discussion">Discussion</h4>
a469f8a5
MS
4003<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4004the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
4005<br>
4006The <code>group</code> parameter specifies the IPP attribute group tag: none
4007(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4008event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4009(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4010(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
4011<br>
4012Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
4013(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
4014(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
4015(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
4016(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
4017(<code>IPP_TAG_URISCHEME</code>).<br>
4018<br>
4019The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
4020textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
f3c17241 4021<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippAttributeString">ippAttributeString</a></h3>
a2326b5b
MS
4022<p class="description">Convert the attribute's value to a string.</p>
4023<p class="code">
4024size_t ippAttributeString (<br>
4025&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
4026&nbsp;&nbsp;&nbsp;&nbsp;char *buffer,<br>
4027&nbsp;&nbsp;&nbsp;&nbsp;size_t bufsize<br>
4028);</p>
4029<h4 class="parameters">Parameters</h4>
4030<dl>
4031<dt>attr</dt>
4032<dd class="description">Attribute</dd>
4033<dt>buffer</dt>
4034<dd class="description">String buffer or NULL</dd>
4035<dt>bufsize</dt>
4036<dd class="description">Size of string buffer</dd>
4037</dl>
4038<h4 class="returnvalue">Return Value</h4>
4039<p class="description">Number of bytes less nul</p>
4040<h4 class="discussion">Discussion</h4>
4041<p class="discussion">Returns the number of bytes that would be written, not including the
4042trailing nul. The buffer pointer can be NULL to get the required length,
4043just like (v)snprintf.
4044
a469f8a5 4045</p>
9c0e8e5d 4046<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="ippContainsInteger">ippContainsInteger</a></h3>
a469f8a5
MS
4047<p class="description">Determine whether an attribute contains the
4048specified value or is within the list of ranges.</p>
4049<p class="code">
4050int ippContainsInteger (<br>
4051&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
4052&nbsp;&nbsp;&nbsp;&nbsp;int value<br>
4053);</p>
4054<h4 class="parameters">Parameters</h4>
4055<dl>
4056<dt>attr</dt>
4057<dd class="description">Attribute</dd>
4058<dt>value</dt>
4059<dd class="description">Integer/enum value</dd>
4060</dl>
4061<h4 class="returnvalue">Return Value</h4>
4062<p class="description">1 on a match, 0 on no match</p>
4063<h4 class="discussion">Discussion</h4>
4064<p class="discussion">Returns non-zero when the attribute contains either a matching integer or
4065enum value, or the value falls within one of the rangeOfInteger values for
4066the attribute.
4067
4068</p>
9c0e8e5d 4069<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="ippContainsString">ippContainsString</a></h3>
a469f8a5
MS
4070<p class="description">Determine whether an attribute contains the
4071specified string value.</p>
4072<p class="code">
4073int ippContainsString (<br>
4074&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
4075&nbsp;&nbsp;&nbsp;&nbsp;const char *value<br>
4076);</p>
4077<h4 class="parameters">Parameters</h4>
4078<dl>
4079<dt>attr</dt>
4080<dd class="description">Attribute</dd>
4081<dt>value</dt>
4082<dd class="description">String value</dd>
4083</dl>
4084<h4 class="returnvalue">Return Value</h4>
4085<p class="description">1 on a match, 0 on no match</p>
4086<h4 class="discussion">Discussion</h4>
4087<p class="discussion">Returns non-zero when the attribute contains a matching charset, keyword,
4088language, mimeMediaType, name, text, URI, or URI scheme value.
4089
a2326b5b 4090</p>
f3c17241 4091<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippCopyAttribute">ippCopyAttribute</a></h3>
a2326b5b
MS
4092<p class="description">Copy an attribute.</p>
4093<p class="code">
4094<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippCopyAttribute (<br>
4095&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *dst,<br>
4096&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *srcattr,<br>
4097&nbsp;&nbsp;&nbsp;&nbsp;int quickcopy<br>
4098);</p>
4099<h4 class="parameters">Parameters</h4>
4100<dl>
4101<dt>dst</dt>
4102<dd class="description">Destination IPP message</dd>
4103<dt>srcattr</dt>
4104<dd class="description">Attribute to copy</dd>
4105<dt>quickcopy</dt>
4106<dd class="description">1 for a referenced copy, 0 for normal</dd>
4107</dl>
4108<h4 class="returnvalue">Return Value</h4>
4109<p class="description">New attribute</p>
4110<h4 class="discussion">Discussion</h4>
4111<p class="discussion">The specified attribute, <code>attr</code>, is copied to the destination IPP message.
4112When <code>quickcopy</code> is non-zero, a &quot;shallow&quot; reference copy of the attribute is
4113created - this should only be done as long as the original source IPP message will
4114not be freed for the life of the destination.
4115
4116</p>
f3c17241 4117<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippCopyAttributes">ippCopyAttributes</a></h3>
a2326b5b
MS
4118<p class="description">Copy attributes from one IPP message to another.</p>
4119<p class="code">
4120int ippCopyAttributes (<br>
4121&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *dst,<br>
4122&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *src,<br>
4123&nbsp;&nbsp;&nbsp;&nbsp;int quickcopy,<br>
4124&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_copycb_t">ipp_copycb_t</a> cb,<br>
4125&nbsp;&nbsp;&nbsp;&nbsp;void *context<br>
4126);</p>
4127<h4 class="parameters">Parameters</h4>
4128<dl>
4129<dt>dst</dt>
4130<dd class="description">Destination IPP message</dd>
4131<dt>src</dt>
4132<dd class="description">Source IPP message</dd>
4133<dt>quickcopy</dt>
4134<dd class="description">1 for a referenced copy, 0 for normal</dd>
4135<dt>cb</dt>
4136<dd class="description">Copy callback or <code>NULL</code> for none</dd>
4137<dt>context</dt>
4138<dd class="description">Context pointer</dd>
4139</dl>
4140<h4 class="returnvalue">Return Value</h4>
4141<p class="description">1 on success, 0 on error</p>
4142<h4 class="discussion">Discussion</h4>
58fce51f 4143<p class="discussion">Zero or more attributes are copied from the source IPP message, <code>src</code>, to the
a2326b5b
MS
4144destination IPP message, <code>dst</code>. When <code>quickcopy</code> is non-zero, a &quot;shallow&quot;
4145reference copy of the attribute is created - this should only be done as long as the
4146original source IPP message will not be freed for the life of the destination.<br>
4147<br>
4148The <code>cb</code> and <code>context</code> parameters provide a generic way to &quot;filter&quot; the
4149attributes that are copied - the function must return 1 to copy the attribute or
41500 to skip it. The function may also choose to do a partial copy of the source attribute
4151itself.
4152
db8b865d 4153</p>
9c0e8e5d 4154<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="ippCreateRequestedArray">ippCreateRequestedArray</a></h3>
db8b865d
MS
4155<p class="description">Create a CUPS array of attribute names from the
4156given requested-attributes attribute.</p>
4157<p class="code">
4158cups_array_t *ippCreateRequestedArray (<br>
4159&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *request<br>
4160);</p>
4161<h4 class="parameters">Parameters</h4>
4162<dl>
4163<dt>request</dt>
4164<dd class="description">IPP request</dd>
4165</dl>
4166<h4 class="returnvalue">Return Value</h4>
4167<p class="description">CUPS array or <code>NULL</code> if all</p>
4168<h4 class="discussion">Discussion</h4>
4169<p class="discussion">This function creates a (sorted) CUPS array of attribute names matching the
4170list of &quot;requested-attribute&quot; values supplied in an IPP request. All IANA-
4171registered values are supported in addition to the CUPS IPP extension
4172attributes.<br>
4173<br>
4174The <code>request</code> parameter specifies the request message that was read from
4175the client.
4176
4177<code>NULL</code> is returned if all attributes should be returned. Otherwise, the
4178result is a sorted array of attribute names, where <code>cupsArrayFind(array,
4179"attribute-name")</code> will return a non-NULL pointer. The array must be freed
4180using the <code>cupsArrayDelete</code> function.
4181
a2326b5b 4182</p>
5a738aea
MS
4183<h3 class="function"><a name="ippDateToTime">ippDateToTime</a></h3>
4184<p class="description">Convert from RFC 1903 Date/Time format to UNIX time
4185in seconds.</p>
4186<p class="code">
4187time_t ippDateToTime (<br>
4188&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#ipp_uchar_t">ipp_uchar_t</a> *date<br>
4189);</p>
4190<h4 class="parameters">Parameters</h4>
4191<dl>
4192<dt>date</dt>
4193<dd class="description">RFC 1903 date info</dd>
4194</dl>
4195<h4 class="returnvalue">Return Value</h4>
4196<p class="description">UNIX time value</p>
4197<h3 class="function"><a name="ippDelete">ippDelete</a></h3>
4198<p class="description">Delete an IPP message.</p>
4199<p class="code">
4200void ippDelete (<br>
4201&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
4202);</p>
4203<h4 class="parameters">Parameters</h4>
4204<dl>
4205<dt>ipp</dt>
4206<dd class="description">IPP message</dd>
4207</dl>
f3c17241 4208<h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/OS X 10.3&nbsp;</span><a name="ippDeleteAttribute">ippDeleteAttribute</a></h3>
5a738aea
MS
4209<p class="description">Delete a single attribute in an IPP message.</p>
4210<p class="code">
4211void ippDeleteAttribute (<br>
4212&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4213&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
4214);</p>
4215<h4 class="parameters">Parameters</h4>
4216<dl>
4217<dt>ipp</dt>
4218<dd class="description">IPP message</dd>
4219<dt>attr</dt>
4220<dd class="description">Attribute to delete</dd>
4221</dl>
f3c17241 4222<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippDeleteValues">ippDeleteValues</a></h3>
a2326b5b
MS
4223<p class="description">Delete values in an attribute.</p>
4224<p class="code">
4225int ippDeleteValues (<br>
4226&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
3e7fe0ca 4227&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
a2326b5b
MS
4228&nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
4229&nbsp;&nbsp;&nbsp;&nbsp;int count<br>
4230);</p>
4231<h4 class="parameters">Parameters</h4>
4232<dl>
4233<dt>ipp</dt>
4234<dd class="description">IPP message</dd>
4235<dt>attr</dt>
4236<dd class="description">Attribute</dd>
4237<dt>element</dt>
4238<dd class="description">Index of first value to delete (0-based)</dd>
4239<dt>count</dt>
4240<dd class="description">Number of values to delete</dd>
4241</dl>
4242<h4 class="returnvalue">Return Value</h4>
4243<p class="description">1 on success, 0 on failure</p>
4244<h4 class="discussion">Discussion</h4>
3e7fe0ca
MS
4245<p class="discussion">The <code>element</code> parameter specifies the first value to delete, starting at
42460. It must be less than the number of values returned by <a href="#ippGetCount"><code>ippGetCount</code></a>.<br>
4247<br>
4248The <code>attr</code> parameter may be modified as a result of setting the value.<br>
a2326b5b
MS
4249<br>
4250Deleting all values in an attribute deletes the attribute.
4251
4252</p>
4253<h3 class="function"><a name="ippEnumString">ippEnumString</a></h3>
4254<p class="description">Return a string corresponding to the enum value.</p>
4255<p class="code">
4256const char *ippEnumString (<br>
4257&nbsp;&nbsp;&nbsp;&nbsp;const char *attrname,<br>
4258&nbsp;&nbsp;&nbsp;&nbsp;int enumvalue<br>
4259);</p>
4260<h4 class="parameters">Parameters</h4>
4261<dl>
4262<dt>attrname</dt>
4263<dd class="description">Attribute name</dd>
4264<dt>enumvalue</dt>
4265<dd class="description">Enum value</dd>
4266</dl>
4267<h4 class="returnvalue">Return Value</h4>
4268<p class="description">Enum string</p>
4269<h3 class="function"><a name="ippEnumValue">ippEnumValue</a></h3>
4270<p class="description">Return the value associated with a given enum string.</p>
4271<p class="code">
4272int ippEnumValue (<br>
4273&nbsp;&nbsp;&nbsp;&nbsp;const char *attrname,<br>
4274&nbsp;&nbsp;&nbsp;&nbsp;const char *enumstring<br>
4275);</p>
4276<h4 class="parameters">Parameters</h4>
4277<dl>
4278<dt>attrname</dt>
4279<dd class="description">Attribute name</dd>
4280<dt>enumstring</dt>
4281<dd class="description">Enum string</dd>
4282</dl>
4283<h4 class="returnvalue">Return Value</h4>
4284<p class="description">Enum value or -1 if unknown</p>
5a738aea
MS
4285<h3 class="function"><a name="ippErrorString">ippErrorString</a></h3>
4286<p class="description">Return a name for the given status code.</p>
4287<p class="code">
4288const char *ippErrorString (<br>
4289&nbsp;&nbsp;&nbsp;&nbsp;ipp_status_t error<br>
4290);</p>
4291<h4 class="parameters">Parameters</h4>
4292<dl>
4293<dt>error</dt>
4294<dd class="description">Error status</dd>
4295</dl>
4296<h4 class="returnvalue">Return Value</h4>
4297<p class="description">Text string</p>
f3c17241 4298<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="ippErrorValue">ippErrorValue</a></h3>
5a738aea
MS
4299<p class="description">Return a status code for the given name.</p>
4300<p class="code">
4301ipp_status_t ippErrorValue (<br>
4302&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
4303);</p>
4304<h4 class="parameters">Parameters</h4>
4305<dl>
4306<dt>name</dt>
4307<dd class="description">Name</dd>
4308</dl>
4309<h4 class="returnvalue">Return Value</h4>
4310<p class="description">IPP status code</p>
4311<h3 class="function"><a name="ippFindAttribute">ippFindAttribute</a></h3>
3e7fe0ca 4312<p class="description">Find a named attribute in a request.</p>
5a738aea
MS
4313<p class="code">
4314<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindAttribute (<br>
4315&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4316&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
a2326b5b 4317&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t type<br>
5a738aea
MS
4318);</p>
4319<h4 class="parameters">Parameters</h4>
4320<dl>
4321<dt>ipp</dt>
4322<dd class="description">IPP message</dd>
4323<dt>name</dt>
4324<dd class="description">Name of attribute</dd>
4325<dt>type</dt>
4326<dd class="description">Type of attribute</dd>
4327</dl>
4328<h4 class="returnvalue">Return Value</h4>
4329<p class="description">Matching attribute</p>
240214ef
MS
4330<h4 class="discussion">Discussion</h4>
4331<p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
4332of attribute and member names separated by slashes, for example
4333&quot;media-col/media-size&quot;.</p>
5a738aea 4334<h3 class="function"><a name="ippFindNextAttribute">ippFindNextAttribute</a></h3>
3e7fe0ca 4335<p class="description">Find the next named attribute in a request.</p>
5a738aea
MS
4336<p class="code">
4337<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindNextAttribute (<br>
4338&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4339&nbsp;&nbsp;&nbsp;&nbsp;const char *name,<br>
a2326b5b 4340&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t type<br>
5a738aea
MS
4341);</p>
4342<h4 class="parameters">Parameters</h4>
4343<dl>
4344<dt>ipp</dt>
4345<dd class="description">IPP message</dd>
4346<dt>name</dt>
4347<dd class="description">Name of attribute</dd>
4348<dt>type</dt>
4349<dd class="description">Type of attribute</dd>
4350</dl>
4351<h4 class="returnvalue">Return Value</h4>
4352<p class="description">Matching attribute</p>
240214ef
MS
4353<h4 class="discussion">Discussion</h4>
4354<p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
4355of attribute and member names separated by slashes, for example
4356&quot;media-col/media-size&quot;.</p>
f3c17241 4357<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippFirstAttribute">ippFirstAttribute</a></h3>
a2326b5b 4358<p class="description">Return the first attribute in the message.</p>
5a738aea 4359<p class="code">
a2326b5b 4360<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFirstAttribute (<br>
5a738aea
MS
4361&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
4362);</p>
4363<h4 class="parameters">Parameters</h4>
4364<dl>
4365<dt>ipp</dt>
4366<dd class="description">IPP message</dd>
4367</dl>
4368<h4 class="returnvalue">Return Value</h4>
a2326b5b 4369<p class="description">First attribute or <code>NULL</code> if none</p>
f3c17241 4370<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippGetBoolean">ippGetBoolean</a></h3>
a2326b5b 4371<p class="description">Get a boolean value for an attribute.</p>
5a738aea 4372<p class="code">
a2326b5b
MS
4373int ippGetBoolean (<br>
4374&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
4375&nbsp;&nbsp;&nbsp;&nbsp;int element<br>
5a738aea
MS
4376);</p>
4377<h4 class="parameters">Parameters</h4>
4378<dl>
a2326b5b
MS
4379<dt>attr</dt>
4380<dd class="description">IPP attribute</dd>
4381<dt>element</dt>
4382<dd class="description">Value number (0-based)</dd>
5a738aea
MS
4383</dl>
4384<h4 class="returnvalue">Return Value</h4>
240214ef 4385<p class="description">Boolean value or 0 on error</p>
5a738aea 4386<h4 class="discussion">Discussion</h4>
a2326b5b
MS
4387<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4388<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
ecdc0628 4389
5a738aea 4390</p>
f3c17241 4391<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippGetCollection">ippGetCollection</a></h3>
a2326b5b 4392<p class="description">Get a collection value for an attribute.</p>
5a738aea 4393<p class="code">
a2326b5b
MS
4394<a href="#ipp_t">ipp_t</a> *ippGetCollection (<br>
4395&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
4396&nbsp;&nbsp;&nbsp;&nbsp;int element<br>
5a738aea
MS
4397);</p>
4398<h4 class="parameters">Parameters</h4>
4399<dl>
a2326b5b
MS
4400<dt>attr</dt>
4401<dd class="description">IPP attribute</dd>
4402<dt>element</dt>
4403<dd class="description">Value number (0-based)</dd>
5a738aea
MS
4404</dl>
4405<h4 class="returnvalue">Return Value</h4>
a2326b5b
MS
4406<p class="description">Collection value or <code>NULL</code> on error</p>
4407<h4 class="discussion">Discussion</h4>
4408<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4409<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
4410
4411</p>
f3c17241 4412<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippGetCount">ippGetCount</a></h3>
a2326b5b 4413<p class="description">Get the number of values in an attribute.</p>
5a738aea 4414<p class="code">
a2326b5b
MS
4415int ippGetCount (<br>
4416&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
5a738aea
MS
4417);</p>
4418<h4 class="parameters">Parameters</h4>
4419<dl>
a2326b5b
MS
4420<dt>attr</dt>
4421<dd class="description">IPP attribute</dd>
5a738aea
MS
4422</dl>
4423<h4 class="returnvalue">Return Value</h4>
240214ef 4424<p class="description">Number of values or 0 on error</p>
f3c17241 4425<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippGetDate">ippGetDate</a></h3>
3e7fe0ca
MS
4426<p class="description">Get a date value for an attribute.</p>
4427<p class="code">
4428const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippGetDate (<br>
4429&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
4430&nbsp;&nbsp;&nbsp;&nbsp;int element<br>
4431);</p>
4432<h4 class="parameters">Parameters</h4>
4433<dl>
4434<dt>attr</dt>
4435<dd class="description">IPP attribute</dd>
4436<dt>element</dt>
4437<dd class="description">Value number (0-based)</dd>
4438</dl>
4439<h4 class="returnvalue">Return Value</h4>
4440<p class="description">Date value or <code>NULL</code></p>
4441<h4 class="discussion">Discussion</h4>
4442<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4443<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
4444
4445</p>
f3c17241 4446<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippGetGroupTag">ippGetGroupTag</a></h3>
a2326b5b 4447<p class="description">Get the group associated with an attribute.</p>
5a738aea 4448<p class="code">
a2326b5b
MS
4449ipp_tag_t ippGetGroupTag (<br>
4450&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
4451);</p>
4452<h4 class="parameters">Parameters</h4>
4453<dl>
4454<dt>attr</dt>
4455<dd class="description">IPP attribute</dd>
4456</dl>
5a738aea 4457<h4 class="returnvalue">Return Value</h4>
a2326b5b 4458<p class="description">Group tag or <code>IPP_TAG_ZERO</code> on error</p>
f3c17241 4459<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippGetInteger">ippGetInteger</a></h3>
a2326b5b 4460<p class="description">Get the integer/enum value for an attribute.</p>
5a738aea 4461<p class="code">
a2326b5b
MS
4462int ippGetInteger (<br>
4463&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
4464&nbsp;&nbsp;&nbsp;&nbsp;int element<br>
5a738aea
MS
4465);</p>
4466<h4 class="parameters">Parameters</h4>
4467<dl>
a2326b5b
MS
4468<dt>attr</dt>
4469<dd class="description">IPP attribute</dd>
4470<dt>element</dt>
4471<dd class="description">Value number (0-based)</dd>
5a738aea
MS
4472</dl>
4473<h4 class="returnvalue">Return Value</h4>
240214ef 4474<p class="description">Value or 0 on error</p>
a2326b5b
MS
4475<h4 class="discussion">Discussion</h4>
4476<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4477<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
4478
4479</p>
f3c17241 4480<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippGetName">ippGetName</a></h3>
a2326b5b 4481<p class="description">Get the attribute name.</p>
5a738aea 4482<p class="code">
a2326b5b
MS
4483const char *ippGetName (<br>
4484&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
5a738aea
MS
4485);</p>
4486<h4 class="parameters">Parameters</h4>
4487<dl>
a2326b5b
MS
4488<dt>attr</dt>
4489<dd class="description">IPP attribute</dd>
5a738aea
MS
4490</dl>
4491<h4 class="returnvalue">Return Value</h4>
a2326b5b 4492<p class="description">Attribute name or <code>NULL</code> for separators</p>
9c0e8e5d 4493<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="ippGetOctetString">ippGetOctetString</a></h3>
6961465f
MS
4494<p class="description">Get an octetString value from an IPP attribute.</p>
4495<p class="code">
4496void *ippGetOctetString (<br>
4497&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
4498&nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
4499&nbsp;&nbsp;&nbsp;&nbsp;int *datalen<br>
4500);</p>
4501<h4 class="parameters">Parameters</h4>
4502<dl>
4503<dt>attr</dt>
4504<dd class="description">IPP attribute</dd>
4505<dt>element</dt>
4506<dd class="description">Value number (0-based)</dd>
4507<dt>datalen</dt>
4508<dd class="description">Length of octetString data</dd>
4509</dl>
4510<h4 class="returnvalue">Return Value</h4>
4511<p class="description">Pointer to octetString data</p>
4512<h4 class="discussion">Discussion</h4>
4513<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4514<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
4515
4516</p>
f3c17241 4517<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippGetOperation">ippGetOperation</a></h3>
a2326b5b 4518<p class="description">Get the operation ID in an IPP message.</p>
5a738aea 4519<p class="code">
a2326b5b 4520ipp_op_t ippGetOperation (<br>
5a738aea
MS
4521&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
4522);</p>
4523<h4 class="parameters">Parameters</h4>
4524<dl>
5a738aea 4525<dt>ipp</dt>
a2326b5b 4526<dd class="description">IPP request message</dd>
5a738aea
MS
4527</dl>
4528<h4 class="returnvalue">Return Value</h4>
240214ef 4529<p class="description">Operation ID or 0 on error</p>
f3c17241 4530<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippGetRange">ippGetRange</a></h3>
3e7fe0ca
MS
4531<p class="description">Get a rangeOfInteger value from an attribute.</p>
4532<p class="code">
4533int ippGetRange (<br>
4534&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
4535&nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
4536&nbsp;&nbsp;&nbsp;&nbsp;int *uppervalue<br>
4537);</p>
4538<h4 class="parameters">Parameters</h4>
4539<dl>
4540<dt>attr</dt>
4541<dd class="description">IPP attribute</dd>
4542<dt>element</dt>
4543<dd class="description">Value number (0-based)</dd>
4544<dt>uppervalue</dt>
4545<dd class="description">Upper value of range</dd>
4546</dl>
4547<h4 class="returnvalue">Return Value</h4>
240214ef 4548<p class="description">Lower value of range or 0</p>
3e7fe0ca
MS
4549<h4 class="discussion">Discussion</h4>
4550<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4551<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
4552
4553</p>
f3c17241 4554<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippGetRequestId">ippGetRequestId</a></h3>
a2326b5b 4555<p class="description">Get the request ID from an IPP message.</p>
5a738aea 4556<p class="code">
a2326b5b
MS
4557int ippGetRequestId (<br>
4558&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
5a738aea
MS
4559);</p>
4560<h4 class="parameters">Parameters</h4>
4561<dl>
a2326b5b
MS
4562<dt>ipp</dt>
4563<dd class="description">IPP message</dd>
5a738aea 4564</dl>
a2326b5b 4565<h4 class="returnvalue">Return Value</h4>
240214ef 4566<p class="description">Request ID or 0 on error</p>
f3c17241 4567<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippGetResolution">ippGetResolution</a></h3>
a2326b5b
MS
4568<p class="description">Get a resolution value for an attribute.</p>
4569<p class="code">
4570int ippGetResolution (<br>
4571&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
4572&nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
4573&nbsp;&nbsp;&nbsp;&nbsp;int *yres,<br>
4574&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_res_t">ipp_res_t</a> *units<br>
06d4e77b
MS
4575);</p>
4576<h4 class="parameters">Parameters</h4>
4577<dl>
a2326b5b
MS
4578<dt>attr</dt>
4579<dd class="description">IPP attribute</dd>
4580<dt>element</dt>
4581<dd class="description">Value number (0-based)</dd>
4582<dt>yres</dt>
4583<dd class="description">Vertical/feed resolution</dd>
4584<dt>units</dt>
4585<dd class="description">Units for resolution</dd>
4586</dl>
4587<h4 class="returnvalue">Return Value</h4>
240214ef 4588<p class="description">Horizontal/cross feed resolution or 0</p>
a2326b5b
MS
4589<h4 class="discussion">Discussion</h4>
4590<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4591<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
4592
4593</p>
f3c17241 4594<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippGetState">ippGetState</a></h3>
3e7fe0ca
MS
4595<p class="description">Get the IPP message state.</p>
4596<p class="code">
4597<a href="#ipp_state_t">ipp_state_t</a> ippGetState (<br>
4598&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
4599);</p>
4600<h4 class="parameters">Parameters</h4>
4601<dl>
4602<dt>ipp</dt>
4603<dd class="description">IPP message</dd>
4604</dl>
4605<h4 class="returnvalue">Return Value</h4>
4606<p class="description">IPP message state value</p>
f3c17241 4607<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippGetStatusCode">ippGetStatusCode</a></h3>
a2326b5b
MS
4608<p class="description">Get the status code from an IPP response or event message.</p>
4609<p class="code">
4610ipp_status_t ippGetStatusCode (<br>
4611&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
4612);</p>
4613<h4 class="parameters">Parameters</h4>
4614<dl>
4615<dt>ipp</dt>
4616<dd class="description">IPP response or event message</dd>
4617</dl>
4618<h4 class="returnvalue">Return Value</h4>
4619<p class="description">Status code in IPP message</p>
4620<h3 class="function"><a name="ippGetString">ippGetString</a></h3>
4621<p class="description">Return the value...</p>
4622<p class="code">
4623const char *ippGetString (<br>
4624&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr,<br>
4625&nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
4626&nbsp;&nbsp;&nbsp;&nbsp;const char **language<br>
4627);</p>
4628<h4 class="parameters">Parameters</h4>
4629<dl>
4630<dt>attr</dt>
4631<dd class="description">IPP attribute</dd>
4632<dt>element</dt>
4633<dd class="description">Value number (0-based)</dd>
4634<dt>language</dt>
4635<dd class="description">Language code (<code>NULL</code> for don't care)</dd>
4636</dl>
4637<h4 class="returnvalue">Return Value</h4>
4638<p class="description">Get the string and optionally the language code for an attribute.</p>
4639<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
4640<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a> - 1.
4641
4642</p>
f3c17241 4643<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippGetValueTag">ippGetValueTag</a></h3>
a2326b5b
MS
4644<p class="description">Get the value tag for an attribute.</p>
4645<p class="code">
4646ipp_tag_t ippGetValueTag (<br>
4647&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
4648);</p>
4649<h4 class="parameters">Parameters</h4>
4650<dl>
4651<dt>attr</dt>
4652<dd class="description">IPP attribute</dd>
4653</dl>
4654<h4 class="returnvalue">Return Value</h4>
4655<p class="description">Value tag or <code>IPP_TAG_ZERO</code> on error</p>
f3c17241 4656<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippGetVersion">ippGetVersion</a></h3>
a2326b5b
MS
4657<p class="description">Get the major and minor version number from an IPP message.</p>
4658<p class="code">
4659int ippGetVersion (<br>
4660&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4661&nbsp;&nbsp;&nbsp;&nbsp;int *minor<br>
4662);</p>
4663<h4 class="parameters">Parameters</h4>
4664<dl>
4665<dt>ipp</dt>
4666<dd class="description">IPP message</dd>
4667<dt>minor</dt>
4668<dd class="description">Minor version number or <code>NULL</code></dd>
4669</dl>
4670<h4 class="returnvalue">Return Value</h4>
240214ef 4671<p class="description">Major version number or 0 on error</p>
a2326b5b
MS
4672<h3 class="function"><a name="ippLength">ippLength</a></h3>
4673<p class="description">Compute the length of an IPP message.</p>
4674<p class="code">
4675size_t ippLength (<br>
4676&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
4677);</p>
4678<h4 class="parameters">Parameters</h4>
4679<dl>
4680<dt>ipp</dt>
4681<dd class="description">IPP message</dd>
4682</dl>
4683<h4 class="returnvalue">Return Value</h4>
4684<p class="description">Size of IPP message</p>
4685<h3 class="function"><a name="ippNew">ippNew</a></h3>
4686<p class="description">Allocate a new IPP message.</p>
4687<p class="code">
4688<a href="#ipp_t">ipp_t</a> *ippNew (void);</p>
4689<h4 class="returnvalue">Return Value</h4>
4690<p class="description">New IPP message</p>
f3c17241 4691<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="ippNewRequest">ippNewRequest</a></h3>
a2326b5b
MS
4692<p class="description">Allocate a new IPP request message.</p>
4693<p class="code">
4694<a href="#ipp_t">ipp_t</a> *ippNewRequest (<br>
4695&nbsp;&nbsp;&nbsp;&nbsp;ipp_op_t op<br>
4696);</p>
4697<h4 class="parameters">Parameters</h4>
4698<dl>
4699<dt>op</dt>
4700<dd class="description">Operation code</dd>
4701</dl>
4702<h4 class="returnvalue">Return Value</h4>
4703<p class="description">IPP request message</p>
4704<h4 class="discussion">Discussion</h4>
4705<p class="discussion">The new request message is initialized with the attributes-charset and
4706attributes-natural-language attributes added. The
4707attributes-natural-language value is derived from the current locale.
4708
a469f8a5 4709</p>
9c0e8e5d 4710<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="ippNewResponse">ippNewResponse</a></h3>
a469f8a5
MS
4711<p class="description">Allocate a new IPP response message.</p>
4712<p class="code">
4713<a href="#ipp_t">ipp_t</a> *ippNewResponse (<br>
4714&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *request<br>
4715);</p>
4716<h4 class="parameters">Parameters</h4>
4717<dl>
4718<dt>request</dt>
4719<dd class="description">IPP request message</dd>
4720</dl>
4721<h4 class="returnvalue">Return Value</h4>
4722<p class="description">IPP response message</p>
4723<h4 class="discussion">Discussion</h4>
4724<p class="discussion">The new response message is initialized with the same version-number,
4725request-id, attributes-charset, and attributes-natural-language as the
4726provided request message. If the attributes-charset or
4727attributes-natural-language attributes are missing from the request,
4728&quot;utf-8&quot; and a value derived from the current locale are substituted,
4729respectively.
4730
a2326b5b 4731</p>
f3c17241 4732<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippNextAttribute">ippNextAttribute</a></h3>
a2326b5b
MS
4733<p class="description">Return the next attribute in the message.</p>
4734<p class="code">
4735<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippNextAttribute (<br>
4736&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
4737);</p>
4738<h4 class="parameters">Parameters</h4>
4739<dl>
4740<dt>ipp</dt>
4741<dd class="description">IPP message</dd>
4742</dl>
4743<h4 class="returnvalue">Return Value</h4>
4744<p class="description">Next attribute or <code>NULL</code> if none</p>
f3c17241 4745<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="ippOpString">ippOpString</a></h3>
a2326b5b
MS
4746<p class="description">Return a name for the given operation id.</p>
4747<p class="code">
4748const char *ippOpString (<br>
4749&nbsp;&nbsp;&nbsp;&nbsp;ipp_op_t op<br>
4750);</p>
4751<h4 class="parameters">Parameters</h4>
4752<dl>
4753<dt>op</dt>
4754<dd class="description">Operation ID</dd>
4755</dl>
4756<h4 class="returnvalue">Return Value</h4>
4757<p class="description">Name</p>
f3c17241 4758<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="ippOpValue">ippOpValue</a></h3>
a2326b5b
MS
4759<p class="description">Return an operation id for the given name.</p>
4760<p class="code">
4761ipp_op_t ippOpValue (<br>
4762&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
4763);</p>
4764<h4 class="parameters">Parameters</h4>
4765<dl>
4766<dt>name</dt>
4767<dd class="description">Textual name</dd>
4768</dl>
4769<h4 class="returnvalue">Return Value</h4>
4770<p class="description">Operation ID</p>
4771<h3 class="function"><a name="ippPort">ippPort</a></h3>
4772<p class="description">Return the default IPP port number.</p>
4773<p class="code">
4774int ippPort (void);</p>
4775<h4 class="returnvalue">Return Value</h4>
4776<p class="description">Port number</p>
4777<h3 class="function"><a name="ippRead">ippRead</a></h3>
4778<p class="description">Read data for an IPP message from a HTTP connection.</p>
4779<p class="code">
4780<a href="#ipp_state_t">ipp_state_t</a> ippRead (<br>
4781&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
4782&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
4783);</p>
4784<h4 class="parameters">Parameters</h4>
4785<dl>
4786<dt>http</dt>
4787<dd class="description">HTTP connection</dd>
4788<dt>ipp</dt>
4789<dd class="description">IPP data</dd>
4790</dl>
4791<h4 class="returnvalue">Return Value</h4>
4792<p class="description">Current state</p>
f3c17241 4793<h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/OS X 10.3&nbsp;</span><a name="ippReadFile">ippReadFile</a></h3>
a2326b5b
MS
4794<p class="description">Read data for an IPP message from a file.</p>
4795<p class="code">
4796<a href="#ipp_state_t">ipp_state_t</a> ippReadFile (<br>
4797&nbsp;&nbsp;&nbsp;&nbsp;int fd,<br>
4798&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
4799);</p>
4800<h4 class="parameters">Parameters</h4>
4801<dl>
4802<dt>fd</dt>
4803<dd class="description">HTTP data</dd>
4804<dt>ipp</dt>
4805<dd class="description">IPP data</dd>
4806</dl>
4807<h4 class="returnvalue">Return Value</h4>
4808<p class="description">Current state</p>
f3c17241 4809<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="ippReadIO">ippReadIO</a></h3>
a2326b5b
MS
4810<p class="description">Read data for an IPP message.</p>
4811<p class="code">
4812<a href="#ipp_state_t">ipp_state_t</a> ippReadIO (<br>
4813&nbsp;&nbsp;&nbsp;&nbsp;void *src,<br>
4814&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_iocb_t">ipp_iocb_t</a> cb,<br>
4815&nbsp;&nbsp;&nbsp;&nbsp;int blocking,<br>
4816&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *parent,<br>
4817&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
4818);</p>
4819<h4 class="parameters">Parameters</h4>
4820<dl>
4821<dt>src</dt>
4822<dd class="description">Data source</dd>
4823<dt>cb</dt>
4824<dd class="description">Read callback function</dd>
4825<dt>blocking</dt>
4826<dd class="description">Use blocking IO?</dd>
4827<dt>parent</dt>
4828<dd class="description">Parent request, if any</dd>
4829<dt>ipp</dt>
4830<dd class="description">IPP data</dd>
4831</dl>
4832<h4 class="returnvalue">Return Value</h4>
4833<p class="description">Current state</p>
f3c17241 4834<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippSetBoolean">ippSetBoolean</a></h3>
a2326b5b
MS
4835<p class="description">Set a boolean value in an attribute.</p>
4836<p class="code">
4837int ippSetBoolean (<br>
4838&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4839&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
4840&nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
4841&nbsp;&nbsp;&nbsp;&nbsp;int boolvalue<br>
4842);</p>
4843<h4 class="parameters">Parameters</h4>
4844<dl>
4845<dt>ipp</dt>
4846<dd class="description">IPP message</dd>
4847<dt>attr</dt>
4848<dd class="description">IPP attribute</dd>
4849<dt>element</dt>
4850<dd class="description">Value number (0-based)</dd>
4851<dt>boolvalue</dt>
4852<dd class="description">Boolean value</dd>
4853</dl>
4854<h4 class="returnvalue">Return Value</h4>
4855<p class="description">1 on success, 0 on failure</p>
4856<h4 class="discussion">Discussion</h4>
a469f8a5
MS
4857<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4858the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
4859<br>
4860The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4861<br>
4862The <code>element</code> parameter specifies which value to set from 0 to
4863<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
4864
4865</p>
f3c17241 4866<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippSetCollection">ippSetCollection</a></h3>
a2326b5b
MS
4867<p class="description">Set a collection value in an attribute.</p>
4868<p class="code">
4869int ippSetCollection (<br>
4870&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4871&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
4872&nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
4873&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *colvalue<br>
4874);</p>
4875<h4 class="parameters">Parameters</h4>
4876<dl>
4877<dt>ipp</dt>
4878<dd class="description">IPP message</dd>
4879<dt>attr</dt>
4880<dd class="description">IPP attribute</dd>
4881<dt>element</dt>
4882<dd class="description">Value number (0-based)</dd>
4883<dt>colvalue</dt>
4884<dd class="description">Collection value</dd>
4885</dl>
4886<h4 class="returnvalue">Return Value</h4>
4887<p class="description">1 on success, 0 on failure</p>
4888<h4 class="discussion">Discussion</h4>
a469f8a5
MS
4889<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4890the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
4891<br>
4892The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4893<br>
4894The <code>element</code> parameter specifies which value to set from 0 to
4895<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
4896
3e7fe0ca 4897</p>
f3c17241 4898<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippSetDate">ippSetDate</a></h3>
3e7fe0ca
MS
4899<p class="description">Set a date value in an attribute.</p>
4900<p class="code">
4901int ippSetDate (<br>
4902&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4903&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
4904&nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
4905&nbsp;&nbsp;&nbsp;&nbsp;const <a href="#ipp_uchar_t">ipp_uchar_t</a> *datevalue<br>
4906);</p>
4907<h4 class="parameters">Parameters</h4>
4908<dl>
4909<dt>ipp</dt>
4910<dd class="description">IPP message</dd>
4911<dt>attr</dt>
4912<dd class="description">IPP attribute</dd>
4913<dt>element</dt>
4914<dd class="description">Value number (0-based)</dd>
4915<dt>datevalue</dt>
4916<dd class="description">Date value</dd>
4917</dl>
4918<h4 class="returnvalue">Return Value</h4>
4919<p class="description">1 on success, 0 on failure</p>
4920<h4 class="discussion">Discussion</h4>
a469f8a5
MS
4921<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4922the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
3e7fe0ca
MS
4923<br>
4924The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4925<br>
4926The <code>element</code> parameter specifies which value to set from 0 to
4927<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
4928
a2326b5b 4929</p>
f3c17241 4930<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippSetGroupTag">ippSetGroupTag</a></h3>
a2326b5b
MS
4931<p class="description">Set the group tag of an attribute.</p>
4932<p class="code">
4933int ippSetGroupTag (<br>
4934&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4935&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
4936&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t group_tag<br>
4937);</p>
4938<h4 class="parameters">Parameters</h4>
4939<dl>
4940<dt>ipp</dt>
4941<dd class="description">IPP message</dd>
4942<dt>attr</dt>
4943<dd class="description">Attribute</dd>
4944<dt>group_tag</dt>
4945<dd class="description">Group tag</dd>
4946</dl>
4947<h4 class="returnvalue">Return Value</h4>
4948<p class="description">1 on success, 0 on failure</p>
4949<h4 class="discussion">Discussion</h4>
a469f8a5
MS
4950<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4951the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
4952<br>
4953The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4954<br>
4955The <code>group</code> parameter specifies the IPP attribute group tag: none
4956(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
4957event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
4958(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
4959(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
4960
4961</p>
f3c17241 4962<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippSetInteger">ippSetInteger</a></h3>
a2326b5b
MS
4963<p class="description">Set an integer or enum value in an attribute.</p>
4964<p class="code">
4965int ippSetInteger (<br>
4966&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4967&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
4968&nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
4969&nbsp;&nbsp;&nbsp;&nbsp;int intvalue<br>
4970);</p>
4971<h4 class="parameters">Parameters</h4>
4972<dl>
4973<dt>ipp</dt>
4974<dd class="description">IPP message</dd>
4975<dt>attr</dt>
4976<dd class="description">IPP attribute</dd>
4977<dt>element</dt>
4978<dd class="description">Value number (0-based)</dd>
4979<dt>intvalue</dt>
4980<dd class="description">Integer/enum value</dd>
4981</dl>
4982<h4 class="returnvalue">Return Value</h4>
4983<p class="description">1 on success, 0 on failure</p>
4984<h4 class="discussion">Discussion</h4>
a469f8a5
MS
4985<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
4986the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
4987<br>
4988The <code>attr</code> parameter may be modified as a result of setting the value.<br>
4989<br>
4990The <code>element</code> parameter specifies which value to set from 0 to
4991<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
4992
4993</p>
f3c17241 4994<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippSetName">ippSetName</a></h3>
a2326b5b
MS
4995<p class="description">Set the name of an attribute.</p>
4996<p class="code">
4997int ippSetName (<br>
4998&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
4999&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
5000&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
5001);</p>
5002<h4 class="parameters">Parameters</h4>
5003<dl>
5004<dt>ipp</dt>
5005<dd class="description">IPP message</dd>
5006<dt>attr</dt>
5007<dd class="description">IPP attribute</dd>
5008<dt>name</dt>
5009<dd class="description">Attribute name</dd>
5010</dl>
5011<h4 class="returnvalue">Return Value</h4>
5012<p class="description">1 on success, 0 on failure</p>
5013<h4 class="discussion">Discussion</h4>
a469f8a5
MS
5014<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5015the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
5016<br>
5017The <code>attr</code> parameter may be modified as a result of setting the value.
5018
6961465f 5019</p>
9c0e8e5d 5020<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="ippSetOctetString">ippSetOctetString</a></h3>
6961465f
MS
5021<p class="description">Set an octetString value in an IPP attribute.</p>
5022<p class="code">
5023int ippSetOctetString (<br>
5024&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5025&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
5026&nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
5027&nbsp;&nbsp;&nbsp;&nbsp;const void *data,<br>
5028&nbsp;&nbsp;&nbsp;&nbsp;int datalen<br>
5029);</p>
5030<h4 class="parameters">Parameters</h4>
5031<dl>
5032<dt>ipp</dt>
5033<dd class="description">IPP message</dd>
5034<dt>attr</dt>
5035<dd class="description">IPP attribute</dd>
5036<dt>element</dt>
5037<dd class="description">Value number (0-based)</dd>
5038<dt>data</dt>
5039<dd class="description">Pointer to octetString data</dd>
5040<dt>datalen</dt>
5041<dd class="description">Length of octetString data</dd>
5042</dl>
5043<h4 class="returnvalue">Return Value</h4>
5044<p class="description">1 on success, 0 on failure</p>
5045<h4 class="discussion">Discussion</h4>
5046<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5047the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5048<br>
5049The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5050<br>
5051The <code>element</code> parameter specifies which value to set from 0 to
5052<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
5053
a2326b5b 5054</p>
f3c17241 5055<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippSetOperation">ippSetOperation</a></h3>
a2326b5b
MS
5056<p class="description">Set the operation ID in an IPP request message.</p>
5057<p class="code">
5058int ippSetOperation (<br>
5059&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5060&nbsp;&nbsp;&nbsp;&nbsp;ipp_op_t op<br>
5061);</p>
5062<h4 class="parameters">Parameters</h4>
5063<dl>
5064<dt>ipp</dt>
5065<dd class="description">IPP request message</dd>
5066<dt>op</dt>
5067<dd class="description">Operation ID</dd>
5068</dl>
5069<h4 class="returnvalue">Return Value</h4>
5070<p class="description">1 on success, 0 on failure</p>
5071<h4 class="discussion">Discussion</h4>
a469f8a5
MS
5072<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5073the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
a2326b5b
MS
5074
5075</p>
5076<h3 class="function"><a name="ippSetPort">ippSetPort</a></h3>
5077<p class="description">Set the default port number.</p>
5078<p class="code">
5079void ippSetPort (<br>
5080&nbsp;&nbsp;&nbsp;&nbsp;int p<br>
5081);</p>
5082<h4 class="parameters">Parameters</h4>
5083<dl>
5084<dt>p</dt>
5085<dd class="description">Port number to use</dd>
5086</dl>
f3c17241 5087<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippSetRange">ippSetRange</a></h3>
a2326b5b
MS
5088<p class="description">Set a rangeOfInteger value in an attribute.</p>
5089<p class="code">
5090int ippSetRange (<br>
5091&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5092&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
5093&nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
5094&nbsp;&nbsp;&nbsp;&nbsp;int lowervalue,<br>
5095&nbsp;&nbsp;&nbsp;&nbsp;int uppervalue<br>
5096);</p>
5097<h4 class="parameters">Parameters</h4>
5098<dl>
5099<dt>ipp</dt>
5100<dd class="description">IPP message</dd>
5101<dt>attr</dt>
5102<dd class="description">IPP attribute</dd>
5103<dt>element</dt>
5104<dd class="description">Value number (0-based)</dd>
5105<dt>lowervalue</dt>
5106<dd class="description">Lower bound for range</dd>
5107<dt>uppervalue</dt>
5108<dd class="description">Upper bound for range</dd>
5109</dl>
5110<h4 class="returnvalue">Return Value</h4>
5111<p class="description">1 on success, 0 on failure</p>
5112<h4 class="discussion">Discussion</h4>
a469f8a5
MS
5113<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5114the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
5115<br>
5116The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5117<br>
5118The <code>element</code> parameter specifies which value to set from 0 to
5119<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
5120
5121</p>
f3c17241 5122<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippSetRequestId">ippSetRequestId</a></h3>
a2326b5b
MS
5123<p class="description">Set the request ID in an IPP message.</p>
5124<p class="code">
5125int ippSetRequestId (<br>
5126&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5127&nbsp;&nbsp;&nbsp;&nbsp;int request_id<br>
5128);</p>
5129<h4 class="parameters">Parameters</h4>
5130<dl>
5131<dt>ipp</dt>
5132<dd class="description">IPP message</dd>
5133<dt>request_id</dt>
5134<dd class="description">Request ID</dd>
5135</dl>
5136<h4 class="returnvalue">Return Value</h4>
5137<p class="description">1 on success, 0 on failure</p>
5138<h4 class="discussion">Discussion</h4>
a469f8a5
MS
5139<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5140the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
5141<br>
5142The <code>request_id</code> parameter must be greater than 0.
5143
5144</p>
f3c17241 5145<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippSetResolution">ippSetResolution</a></h3>
a2326b5b
MS
5146<p class="description">Set a resolution value in an attribute.</p>
5147<p class="code">
5148int ippSetResolution (<br>
5149&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5150&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
5151&nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
5152&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_res_t">ipp_res_t</a> unitsvalue,<br>
5153&nbsp;&nbsp;&nbsp;&nbsp;int xresvalue,<br>
5154&nbsp;&nbsp;&nbsp;&nbsp;int yresvalue<br>
5155);</p>
5156<h4 class="parameters">Parameters</h4>
5157<dl>
5158<dt>ipp</dt>
5159<dd class="description">IPP message</dd>
5160<dt>attr</dt>
5161<dd class="description">IPP attribute</dd>
5162<dt>element</dt>
5163<dd class="description">Value number (0-based)</dd>
5164<dt>unitsvalue</dt>
5165<dd class="description">Resolution units</dd>
5166<dt>xresvalue</dt>
5167<dd class="description">Horizontal/cross feed resolution</dd>
5168<dt>yresvalue</dt>
5169<dd class="description">Vertical/feed resolution</dd>
5170</dl>
5171<h4 class="returnvalue">Return Value</h4>
5172<p class="description">1 on success, 0 on failure</p>
5173<h4 class="discussion">Discussion</h4>
a469f8a5
MS
5174<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5175the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
5176<br>
5177The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5178<br>
5179The <code>element</code> parameter specifies which value to set from 0 to
5180<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
5181
5182</p>
f3c17241 5183<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippSetState">ippSetState</a></h3>
3e7fe0ca
MS
5184<p class="description">Set the current state of the IPP message.</p>
5185<p class="code">
5186int ippSetState (<br>
5187&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5188&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_state_t">ipp_state_t</a> state<br>
5189);</p>
5190<h4 class="parameters">Parameters</h4>
5191<dl>
5192<dt>ipp</dt>
5193<dd class="description">IPP message</dd>
5194<dt>state</dt>
5195<dd class="description">IPP state value</dd>
5196</dl>
5197<h4 class="returnvalue">Return Value</h4>
5198<p class="description">1 on success, 0 on failure</p>
f3c17241 5199<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippSetStatusCode">ippSetStatusCode</a></h3>
a2326b5b
MS
5200<p class="description">Set the status code in an IPP response or event message.</p>
5201<p class="code">
5202int ippSetStatusCode (<br>
5203&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5204&nbsp;&nbsp;&nbsp;&nbsp;ipp_status_t status<br>
5205);</p>
5206<h4 class="parameters">Parameters</h4>
5207<dl>
5208<dt>ipp</dt>
5209<dd class="description">IPP response or event message</dd>
5210<dt>status</dt>
5211<dd class="description">Status code</dd>
5212</dl>
5213<h4 class="returnvalue">Return Value</h4>
5214<p class="description">1 on success, 0 on failure</p>
5215<h4 class="discussion">Discussion</h4>
a469f8a5
MS
5216<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5217the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
a2326b5b
MS
5218
5219</p>
f3c17241 5220<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippSetString">ippSetString</a></h3>
a2326b5b
MS
5221<p class="description">Set a string value in an attribute.</p>
5222<p class="code">
5223int ippSetString (<br>
5224&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5225&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
5226&nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
5227&nbsp;&nbsp;&nbsp;&nbsp;const char *strvalue<br>
5228);</p>
5229<h4 class="parameters">Parameters</h4>
5230<dl>
5231<dt>ipp</dt>
5232<dd class="description">IPP message</dd>
5233<dt>attr</dt>
5234<dd class="description">IPP attribute</dd>
5235<dt>element</dt>
5236<dd class="description">Value number (0-based)</dd>
5237<dt>strvalue</dt>
5238<dd class="description">String value</dd>
5239</dl>
5240<h4 class="returnvalue">Return Value</h4>
5241<p class="description">1 on success, 0 on failure</p>
5242<h4 class="discussion">Discussion</h4>
a469f8a5
MS
5243<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5244the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
5245<br>
5246The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5247<br>
5248The <code>element</code> parameter specifies which value to set from 0 to
5249<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.
5250
a469f8a5 5251</p>
9c0e8e5d 5252<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="ippSetStringf">ippSetStringf</a></h3>
a469f8a5
MS
5253<p class="description">Set a formatted string value of an attribute.</p>
5254<p class="code">
5255int ippSetStringf (<br>
5256&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5257&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
5258&nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
5259&nbsp;&nbsp;&nbsp;&nbsp;const char *format,<br>
5260&nbsp;&nbsp;&nbsp;&nbsp;...<br>
5261);</p>
5262<h4 class="parameters">Parameters</h4>
5263<dl>
5264<dt>ipp</dt>
5265<dd class="description">IPP message</dd>
5266<dt>attr</dt>
5267<dd class="description">IPP attribute</dd>
5268<dt>element</dt>
5269<dd class="description">Value number (0-based)</dd>
5270<dt>format</dt>
5271<dd class="description">Printf-style format string</dd>
5272<dt>...</dt>
5273<dd class="description">Additional arguments as needed</dd>
5274</dl>
5275<h4 class="returnvalue">Return Value</h4>
5276<p class="description">1 on success, 0 on failure</p>
5277<h4 class="discussion">Discussion</h4>
5278<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5279the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5280<br>
5281The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5282<br>
5283The <code>element</code> parameter specifies which value to set from 0 to
5284<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.<br>
5285<br>
5286The <code>format</code> parameter uses formatting characters compatible with the
5287printf family of standard functions. Additional arguments follow it as
5288needed. The formatted string is truncated as needed to the maximum length of
5289the corresponding value type.
5290
5291</p>
9c0e8e5d 5292<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="ippSetStringfv">ippSetStringfv</a></h3>
a469f8a5
MS
5293<p class="description">Set a formatted string value of an attribute.</p>
5294<p class="code">
5295int ippSetStringfv (<br>
5296&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5297&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
5298&nbsp;&nbsp;&nbsp;&nbsp;int element,<br>
5299&nbsp;&nbsp;&nbsp;&nbsp;const char *format,<br>
5300&nbsp;&nbsp;&nbsp;&nbsp;va_list ap<br>
5301);</p>
5302<h4 class="parameters">Parameters</h4>
5303<dl>
5304<dt>ipp</dt>
5305<dd class="description">IPP message</dd>
5306<dt>attr</dt>
5307<dd class="description">IPP attribute</dd>
5308<dt>element</dt>
5309<dd class="description">Value number (0-based)</dd>
5310<dt>format</dt>
5311<dd class="description">Printf-style format string</dd>
5312<dt>ap</dt>
5313<dd class="description">Pointer to additional arguments</dd>
5314</dl>
5315<h4 class="returnvalue">Return Value</h4>
5316<p class="description">1 on success, 0 on failure</p>
5317<h4 class="discussion">Discussion</h4>
5318<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5319the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
5320<br>
5321The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5322<br>
5323The <code>element</code> parameter specifies which value to set from 0 to
5324<a href="#ippGetCount(attr)"><code>ippGetCount(attr)</code></a>.<br>
5325<br>
5326The <code>format</code> parameter uses formatting characters compatible with the
5327printf family of standard functions. Additional arguments follow it as
5328needed. The formatted string is truncated as needed to the maximum length of
5329the corresponding value type.
5330
a2326b5b 5331</p>
f3c17241 5332<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippSetValueTag">ippSetValueTag</a></h3>
a2326b5b
MS
5333<p class="description">Set the value tag of an attribute.</p>
5334<p class="code">
5335int ippSetValueTag (<br>
5336&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5337&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> **attr,<br>
5338&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t value_tag<br>
5339);</p>
5340<h4 class="parameters">Parameters</h4>
5341<dl>
5342<dt>ipp</dt>
5343<dd class="description">IPP message</dd>
5344<dt>attr</dt>
5345<dd class="description">IPP attribute</dd>
5346<dt>value_tag</dt>
5347<dd class="description">Value tag</dd>
5348</dl>
5349<h4 class="returnvalue">Return Value</h4>
5350<p class="description">1 on success, 0 on failure</p>
5351<h4 class="discussion">Discussion</h4>
a469f8a5
MS
5352<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5353the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
5354<br>
5355The <code>attr</code> parameter may be modified as a result of setting the value.<br>
5356<br>
5357Integer (<code>IPP_TAG_INTEGER</code>) values can be promoted to rangeOfInteger
5358(<code>IPP_TAG_RANGE</code>) values, the various string tags can be promoted to name
5359(<code>IPP_TAG_NAME</code>) or nameWithLanguage (<code>IPP_TAG_NAMELANG</code>) values, text
5360(<code>IPP_TAG_TEXT</code>) values can be promoted to textWithLanguage
5361(<code>IPP_TAG_TEXTLANG</code>) values, and all values can be demoted to the various
5362out-of-band value tags such as no-value (<code>IPP_TAG_NOVALUE</code>). All other changes
5363will be rejected.<br>
5364<br>
5365Promoting a string attribute to nameWithLanguage or textWithLanguage adds the language
5366code in the &quot;attributes-natural-language&quot; attribute or, if not present, the language
5367code for the current locale.
5368
5369</p>
f3c17241 5370<h3 class="function"><span class="info">&nbsp;CUPS 1.6/OS X 10.8&nbsp;</span><a name="ippSetVersion">ippSetVersion</a></h3>
a2326b5b
MS
5371<p class="description">Set the version number in an IPP message.</p>
5372<p class="code">
5373int ippSetVersion (<br>
5374&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp,<br>
5375&nbsp;&nbsp;&nbsp;&nbsp;int major,<br>
5376&nbsp;&nbsp;&nbsp;&nbsp;int minor<br>
5377);</p>
5378<h4 class="parameters">Parameters</h4>
5379<dl>
5380<dt>ipp</dt>
5381<dd class="description">IPP message</dd>
5382<dt>major</dt>
5383<dd class="description">Major version number (major.minor)</dd>
5384<dt>minor</dt>
5385<dd class="description">Minor version number (major.minor)</dd>
5386</dl>
5387<h4 class="returnvalue">Return Value</h4>
5388<p class="description">1 on success, 0 on failure</p>
5389<h4 class="discussion">Discussion</h4>
a469f8a5
MS
5390<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
5391the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
a2326b5b
MS
5392<br>
5393The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2.
5394
5395</p>
e1f19878 5396<h3 class="function"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="ippStateString">ippStateString</a></h3>
ca6b43fc
MS
5397<p class="description">Return the name corresponding to a state value.</p>
5398<p class="code">
5399const char *ippStateString (<br>
5400&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_state_t">ipp_state_t</a> state<br>
5401);</p>
5402<h4 class="parameters">Parameters</h4>
5403<dl>
5404<dt>state</dt>
5405<dd class="description">State value</dd>
5406</dl>
5407<h4 class="returnvalue">Return Value</h4>
5408<p class="description">State name</p>
f3c17241 5409<h3 class="function"><span class="info">&nbsp;CUPS 1.4/OS X 10.6&nbsp;</span><a name="ippTagString">ippTagString</a></h3>
a2326b5b
MS
5410<p class="description">Return the tag name corresponding to a tag value.</p>
5411<p class="code">
5412const char *ippTagString (<br>
5413&nbsp;&nbsp;&nbsp;&nbsp;ipp_tag_t tag<br>
5414);</p>
5415<h4 class="parameters">Parameters</h4>
5416<dl>
5417<dt>tag</dt>
5418<dd class="description">Tag value</dd>
5419</dl>
06d4e77b
MS
5420<h4 class="returnvalue">Return Value</h4>
5421<p class="description">Tag name</p>
5422<h4 class="discussion">Discussion</h4>
5423<p class="discussion">The returned names are defined in RFC 2911 and 3382.
5424
5425</p>
f3c17241 5426<h3 class="function"><span class="info">&nbsp;CUPS 1.4/OS X 10.6&nbsp;</span><a name="ippTagValue">ippTagValue</a></h3>
06d4e77b
MS
5427<p class="description">Return the tag value corresponding to a tag name.</p>
5428<p class="code">
a2326b5b 5429ipp_tag_t ippTagValue (<br>
06d4e77b
MS
5430&nbsp;&nbsp;&nbsp;&nbsp;const char *name<br>
5431);</p>
5432<h4 class="parameters">Parameters</h4>
5433<dl>
5434<dt>name</dt>
5435<dd class="description">Tag name</dd>
5436</dl>
5437<h4 class="returnvalue">Return Value</h4>
5438<p class="description">Tag value</p>
5439<h4 class="discussion">Discussion</h4>
5440<p class="discussion">The tag names are defined in RFC 2911 and 3382.
5441
5442</p>
5a738aea
MS
5443<h3 class="function"><a name="ippTimeToDate">ippTimeToDate</a></h3>
5444<p class="description">Convert from UNIX time to RFC 1903 format.</p>
5445<p class="code">
5446const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippTimeToDate (<br>
5447&nbsp;&nbsp;&nbsp;&nbsp;time_t t<br>
5448);</p>
5449<h4 class="parameters">Parameters</h4>
5450<dl>
5451<dt>t</dt>
5452<dd class="description">UNIX time value</dd>
5453</dl>
5454<h4 class="returnvalue">Return Value</h4>
5455<p class="description">RFC-1903 date/time data</p>
9c0e8e5d 5456<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="ippValidateAttribute">ippValidateAttribute</a></h3>
db8b865d
MS
5457<p class="description">Validate the contents of an attribute.</p>
5458<p class="code">
5459int ippValidateAttribute (<br>
5460&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr<br>
5461);</p>
5462<h4 class="parameters">Parameters</h4>
5463<dl>
5464<dt>attr</dt>
5465<dd class="description">Attribute</dd>
5466</dl>
5467<h4 class="returnvalue">Return Value</h4>
5468<p class="description">1 if valid, 0 otherwise</p>
5469<h4 class="discussion">Discussion</h4>
5470<p class="discussion">This function validates the contents of an attribute based on the name and
5471value tag. 1 is returned if the attribute is valid, 0 otherwise. On
5472failure, cupsLastErrorString() is set to a human-readable message.
5473
5474</p>
9c0e8e5d 5475<h3 class="function"><span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span><a name="ippValidateAttributes">ippValidateAttributes</a></h3>
db8b865d
MS
5476<p class="description">Validate all attributes in an IPP message.</p>
5477<p class="code">
5478int ippValidateAttributes (<br>
5479&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
5480);</p>
5481<h4 class="parameters">Parameters</h4>
5482<dl>
5483<dt>ipp</dt>
5484<dd class="description">IPP message</dd>
5485</dl>
5486<h4 class="returnvalue">Return Value</h4>
5487<p class="description">1 if valid, 0 otherwise</p>
5488<h4 class="discussion">Discussion</h4>
5489<p class="discussion">This function validates the contents of the IPP message, including each
5490attribute. Like <a href="#ippValidateAttribute"><code>ippValidateAttribute</code></a>, cupsLastErrorString() is set
5491to a human-readable message on failure.
5492
5493</p>
5a738aea
MS
5494<h3 class="function"><a name="ippWrite">ippWrite</a></h3>
5495<p class="description">Write data for an IPP message to a HTTP connection.</p>
5496<p class="code">
79e1d494 5497<a href="#ipp_state_t">ipp_state_t</a> ippWrite (<br>
5a738aea
MS
5498&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_t">http_t</a> *http,<br>
5499&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
5500);</p>
5501<h4 class="parameters">Parameters</h4>
5502<dl>
5503<dt>http</dt>
5504<dd class="description">HTTP connection</dd>
5505<dt>ipp</dt>
5506<dd class="description">IPP data</dd>
5507</dl>
5508<h4 class="returnvalue">Return Value</h4>
5509<p class="description">Current state</p>
f3c17241 5510<h3 class="function"><span class="info">&nbsp;CUPS 1.1.19/OS X 10.3&nbsp;</span><a name="ippWriteFile">ippWriteFile</a></h3>
5a738aea
MS
5511<p class="description">Write data for an IPP message to a file.</p>
5512<p class="code">
79e1d494 5513<a href="#ipp_state_t">ipp_state_t</a> ippWriteFile (<br>
5a738aea
MS
5514&nbsp;&nbsp;&nbsp;&nbsp;int fd,<br>
5515&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
5516);</p>
5517<h4 class="parameters">Parameters</h4>
5518<dl>
5519<dt>fd</dt>
5520<dd class="description">HTTP data</dd>
5521<dt>ipp</dt>
5522<dd class="description">IPP data</dd>
5523</dl>
5524<h4 class="returnvalue">Return Value</h4>
5525<p class="description">Current state</p>
f3c17241 5526<h3 class="function"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="ippWriteIO">ippWriteIO</a></h3>
5a738aea
MS
5527<p class="description">Write data for an IPP message.</p>
5528<p class="code">
79e1d494 5529<a href="#ipp_state_t">ipp_state_t</a> ippWriteIO (<br>
5a738aea
MS
5530&nbsp;&nbsp;&nbsp;&nbsp;void *dst,<br>
5531&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_iocb_t">ipp_iocb_t</a> cb,<br>
5532&nbsp;&nbsp;&nbsp;&nbsp;int blocking,<br>
5533&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *parent,<br>
5534&nbsp;&nbsp;&nbsp;&nbsp;<a href="#ipp_t">ipp_t</a> *ipp<br>
5535);</p>
5536<h4 class="parameters">Parameters</h4>
5537<dl>
5538<dt>dst</dt>
5539<dd class="description">Destination</dd>
5540<dt>cb</dt>
5541<dd class="description">Write callback function</dd>
5542<dt>blocking</dt>
5543<dd class="description">Use blocking IO?</dd>
5544<dt>parent</dt>
5545<dd class="description">Parent IPP message</dd>
5546<dt>ipp</dt>
5547<dd class="description">IPP data</dd>
5548</dl>
5549<h4 class="returnvalue">Return Value</h4>
5550<p class="description">Current state</p>
5551<h2 class="title"><a name="TYPES">Data Types</a></h2>
eac3a0a0
MS
5552<h3 class="typedef"><a name="gss_auth_identity_desc">gss_auth_identity_desc</a></h3>
5553<p class="description">Local functions...</p>
5554<p class="code">
5555typedef struct <a href="#gss_auth_identity">gss_auth_identity</a> gss_auth_identity_desc;
5556</p>
f3c17241 5557<h3 class="typedef"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="http_addr_t">http_addr_t</a></h3>
f11a948a
MS
5558<p class="description">Socket address union, which
5559makes using IPv6 and other
5560address types easier and
5561more portable. </p>
5562<p class="code">
5563typedef union _http_addr_u / http_addr_t;
5564</p>
f3c17241 5565<h3 class="typedef"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="http_addrlist_t">http_addrlist_t</a></h3>
5a738aea 5566<p class="description">Socket address list, which is
ef416fc2 5567used to enumerate all of the
5568addresses that are associated
5a738aea
MS
5569with a hostname. </p>
5570<p class="code">
5571typedef struct <a href="#http_addrlist_s">http_addrlist_s</a> / http_addrlist_t;
5572</p>
5573<h3 class="typedef"><a name="http_auth_t">http_auth_t</a></h3>
5574<p class="description">HTTP authentication types</p>
5575<p class="code">
5576typedef enum <a href="#http_auth_e">http_auth_e</a> http_auth_t;
5577</p>
f3c17241 5578<h3 class="typedef"><span class="info">&nbsp;CUPS 1.5/OS X 10.7&nbsp;</span><a name="http_credential_t">http_credential_t</a></h3>
f228370c 5579<p class="description">HTTP credential data </p>
10d09e33
MS
5580<p class="code">
5581typedef struct <a href="#http_credential_s">http_credential_s</a> http_credential_t;
5582</p>
5a738aea
MS
5583<h3 class="typedef"><a name="http_encoding_t">http_encoding_t</a></h3>
5584<p class="description">HTTP transfer encoding values</p>
5585<p class="code">
5586typedef enum <a href="#http_encoding_e">http_encoding_e</a> http_encoding_t;
5587</p>
5588<h3 class="typedef"><a name="http_encryption_t">http_encryption_t</a></h3>
5589<p class="description">HTTP encryption values</p>
5590<p class="code">
5591typedef enum <a href="#http_encryption_e">http_encryption_e</a> http_encryption_t;
5592</p>
79e1d494
MS
5593<h3 class="typedef"><a name="http_field_t">http_field_t</a></h3>
5594<p class="description">HTTP field names</p>
5595<p class="code">
5596typedef enum <a href="#http_field_e">http_field_e</a> http_field_t;
5597</p>
5598<h3 class="typedef"><a name="http_keepalive_t">http_keepalive_t</a></h3>
f11a948a 5599<p class="description">HTTP keep-alive values</p>
79e1d494
MS
5600<p class="code">
5601typedef enum <a href="#http_keepalive_e">http_keepalive_e</a> http_keepalive_t;
5602</p>
f11a948a
MS
5603<h3 class="typedef"><a name="http_state_t">http_state_t</a></h3>
5604<p class="description">HTTP state values; states
5605are server-oriented...</p>
5606<p class="code">
a469f8a5 5607typedef enum <a href="#http_state_e">http_state_e</a> http_state_t;
79e1d494 5608</p>
5a738aea
MS
5609<h3 class="typedef"><a name="http_t">http_t</a></h3>
5610<p class="description">HTTP connection type</p>
5611<p class="code">
ecdc0628 5612typedef struct _http_s http_t;
5a738aea 5613</p>
f3c17241 5614<h3 class="typedef"><span class="info">&nbsp;CUPS 1.5/OS X 10.7&nbsp;</span><a name="http_timeout_cb_t">http_timeout_cb_t</a></h3>
f228370c
MS
5615<p class="description">HTTP timeout callback </p>
5616<p class="code">
5617typedef int (*http_timeout_cb_t)(<a href="#http_t">http_t</a> *http, void *user_data);
5618</p>
e1f19878 5619<h3 class="typedef"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="http_trust_t">http_trust_t</a></h3>
240214ef
MS
5620<p class="description">Level of trust for credentials </p>
5621<p class="code">
5622typedef enum <a href="#http_trust_e">http_trust_e</a> http_trust_t;
5623</p>
79e1d494 5624<h3 class="typedef"><a name="http_uri_coding_t">http_uri_coding_t</a></h3>
f11a948a 5625<p class="description">URI en/decode flags</p>
79e1d494
MS
5626<p class="code">
5627typedef enum <a href="#http_uri_coding_e">http_uri_coding_e</a> http_uri_coding_t;
5628</p>
10d09e33 5629<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 5630<p class="description">URI separation status </p>
79e1d494
MS
5631<p class="code">
5632typedef enum <a href="#http_uri_status_e">http_uri_status_e</a> http_uri_status_t;
5633</p>
f11a948a
MS
5634<h3 class="typedef"><a name="http_version_t">http_version_t</a></h3>
5635<p class="description">HTTP version numbers</p>
79e1d494
MS
5636<p class="code">
5637typedef enum <a href="#http_version_e">http_version_e</a> http_version_t;
5638</p>
5a738aea 5639<h3 class="typedef"><a name="ipp_attribute_t">ipp_attribute_t</a></h3>
a2326b5b 5640<p class="description">IPP attribute</p>
5a738aea 5641<p class="code">
a2326b5b
MS
5642typedef struct _ipp_attribute_s ipp_attribute_t;
5643</p>
5644<h3 class="typedef"><a name="ipp_copycb_t">ipp_copycb_t</a></h3>
f3c17241
MS
5645<p class="description">The following structures are PRIVATE starting with CUPS 1.6/OS X 10.8.
5646Please use the new accessor functions available in CUPS 1.6 and later, as
5647these definitions will be moved to a private header file in a future release.</p>
a2326b5b
MS
5648<p class="code">
5649typedef int (*ipp_copycb_t)(void *context, <a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);
5650</p>
5651<h3 class="typedef"><a name="ipp_dstate_t">ipp_dstate_t</a></h3>
5652<p class="description">Document states</p>
5653<p class="code">
5654typedef enum <a href="#ipp_dstate_e">ipp_dstate_e</a> ipp_dstate_t;
5a738aea 5655</p>
79e1d494 5656<h3 class="typedef"><a name="ipp_finish_t">ipp_finish_t</a></h3>
a469f8a5 5657<p class="description">Job collation types</p>
79e1d494 5658<p class="code">
a469f8a5 5659typedef enum <a href="#ipp_finishings_e">ipp_finishings_e</a> ipp_finish_t;
79e1d494 5660</p>
f3c17241 5661<h3 class="typedef"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="ipp_iocb_t">ipp_iocb_t</a></h3>
5a738aea
MS
5662<p class="description">IPP IO Callback Function </p>
5663<p class="code">
a2326b5b 5664typedef ssize_t (*ipp_iocb_t)(void *context, <a href="#ipp_uchar_t">ipp_uchar_t</a> *buffer, size_t bytes);
5a738aea 5665</p>
a2326b5b
MS
5666<h3 class="typedef"><a name="ipp_jcollate_t">ipp_jcollate_t</a></h3>
5667<p class="description">Job collation types</p>
79e1d494 5668<p class="code">
a2326b5b 5669typedef enum <a href="#ipp_jcollate_e">ipp_jcollate_e</a> ipp_jcollate_t;
79e1d494
MS
5670</p>
5671<h3 class="typedef"><a name="ipp_orient_t">ipp_orient_t</a></h3>
aaf19ab0 5672<p class="description">Orientation values</p>
79e1d494
MS
5673<p class="code">
5674typedef enum <a href="#ipp_orient_e">ipp_orient_e</a> ipp_orient_t;
5675</p>
5676<h3 class="typedef"><a name="ipp_pstate_t">ipp_pstate_t</a></h3>
aaf19ab0 5677<p class="description">Printer states</p>
79e1d494
MS
5678<p class="code">
5679typedef enum <a href="#ipp_pstate_e">ipp_pstate_e</a> ipp_pstate_t;
5680</p>
5681<h3 class="typedef"><a name="ipp_quality_t">ipp_quality_t</a></h3>
aaf19ab0 5682<p class="description">Qualities</p>
79e1d494
MS
5683<p class="code">
5684typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t;
5685</p>
79e1d494 5686<h3 class="typedef"><a name="ipp_res_t">ipp_res_t</a></h3>
aaf19ab0 5687<p class="description">Resolution units</p>
79e1d494
MS
5688<p class="code">
5689typedef enum <a href="#ipp_res_e">ipp_res_e</a> ipp_res_t;
5690</p>
5691<h3 class="typedef"><a name="ipp_state_t">ipp_state_t</a></h3>
aaf19ab0 5692<p class="description">IPP states</p>
79e1d494
MS
5693<p class="code">
5694typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t;
5695</p>
5a738aea 5696<h3 class="typedef"><a name="ipp_t">ipp_t</a></h3>
a2326b5b 5697<p class="description">IPP request/response data</p>
5a738aea 5698<p class="code">
a2326b5b 5699typedef struct _ipp_s ipp_t;
5a738aea
MS
5700</p>
5701<h3 class="typedef"><a name="ipp_uchar_t">ipp_uchar_t</a></h3>
a2326b5b 5702<p class="description">Unsigned 8-bit integer/character</p>
5a738aea 5703<p class="code">
a2326b5b 5704typedef unsigned char ipp_uchar_t;
5a738aea
MS
5705</p>
5706<h2 class="title"><a name="STRUCTURES">Structures</a></h2>
eac3a0a0
MS
5707<h3 class="struct"><a name="gss_auth_identity">gss_auth_identity</a></h3>
5708<p class="description">Local functions...</p>
5709<p class="code">struct gss_auth_identity {<br>
5710&nbsp;&nbsp;&nbsp;&nbsp;gss_buffer_t *credentialsRef;<br>
5711&nbsp;&nbsp;&nbsp;&nbsp;uint32_t flags;<br>
5712&nbsp;&nbsp;&nbsp;&nbsp;char *password;<br>
5713&nbsp;&nbsp;&nbsp;&nbsp;char *realm;<br>
5714&nbsp;&nbsp;&nbsp;&nbsp;uint32_t type;<br>
5715&nbsp;&nbsp;&nbsp;&nbsp;char *username;<br>
5716};</p>
5717<h4 class="members">Members</h4>
5718<dl>
5719<dt>credentialsRef </dt>
5720<dt>flags </dt>
5721<dt>password </dt>
5722<dt>realm </dt>
5723<dt>type </dt>
5724<dt>username </dt>
5725</dl>
f3c17241 5726<h3 class="struct"><span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span><a name="http_addrlist_s">http_addrlist_s</a></h3>
5a738aea
MS
5727<p class="description">Socket address list, which is
5728used to enumerate all of the
5729addresses that are associated
5730with a hostname. </p>
5731<p class="code">struct http_addrlist_s {<br>
5732&nbsp;&nbsp;&nbsp;&nbsp;<a href="#http_addr_t">http_addr_t</a> addr;<br>
5733&nbsp;&nbsp;&nbsp;&nbsp;struct <a href="#http_addrlist_s">http_addrlist_s</a> *next;<br>
5734};</p>
5735<h4 class="members">Members</h4>
5736<dl>
5737<dt>addr </dt>
5738<dd class="description">Address</dd>
5739<dt>next </dt>
5740<dd class="description">Pointer to next address in list</dd>
5741</dl>
f3c17241 5742<h3 class="struct"><span class="info">&nbsp;CUPS 1.5/OS X 10.7&nbsp;</span><a name="http_credential_s">http_credential_s</a></h3>
f228370c 5743<p class="description">HTTP credential data </p>
10d09e33
MS
5744<p class="code">struct http_credential_s {<br>
5745&nbsp;&nbsp;&nbsp;&nbsp;void *data;<br>
5746&nbsp;&nbsp;&nbsp;&nbsp;size_t datalen;<br>
5747};</p>
5748<h4 class="members">Members</h4>
5749<dl>
5750<dt>data </dt>
5751<dd class="description">Pointer to credential data</dd>
5752<dt>datalen </dt>
5753<dd class="description">Credential length</dd>
5754</dl>
f3c17241
MS
5755<h3 class="struct"><a name="pollfd">pollfd</a></h3>
5756<p class="description">User data (unused)</p>
5757<p class="code">struct pollfd *pollfds, unsigned int num_pollfds, int timeout, void *context) {<br>
5758&nbsp;&nbsp;&nbsp;&nbsp;void) context;<br>
5759&nbsp;&nbsp;&nbsp;&nbsp;void) timeout;<br>
5760};</p>
5761<h4 class="members">Members</h4>
5762<dl>
5763<dt>context </dt>
5764<dt>timeout </dt>
5765</dl>
5a738aea
MS
5766<h2 class="title"><a name="ENUMERATIONS">Constants</a></h2>
5767<h3 class="enumeration"><a name="http_auth_e">http_auth_e</a></h3>
5768<p class="description">HTTP authentication types</p>
5769<h4 class="constants">Constants</h4>
5770<dl>
5771<dt>HTTP_AUTH_BASIC </dt>
5772<dd class="description">Basic authentication in use</dd>
5773<dt>HTTP_AUTH_MD5 </dt>
5774<dd class="description">Digest authentication in use</dd>
5775<dt>HTTP_AUTH_MD5_INT </dt>
5776<dd class="description">Digest authentication in use for body</dd>
5777<dt>HTTP_AUTH_MD5_SESS </dt>
5778<dd class="description">MD5-session authentication in use</dd>
5779<dt>HTTP_AUTH_MD5_SESS_INT </dt>
5780<dd class="description">MD5-session authentication in use for body</dd>
f3c17241 5781<dt>HTTP_AUTH_NEGOTIATE <span class="info">&nbsp;CUPS 1.3/OS X 10.5&nbsp;</span></dt>
5a738aea
MS
5782<dd class="description">GSSAPI authentication in use </dd>
5783<dt>HTTP_AUTH_NONE </dt>
5784<dd class="description">No authentication in use</dd>
5785</dl>
5786<h3 class="enumeration"><a name="http_encoding_e">http_encoding_e</a></h3>
5787<p class="description">HTTP transfer encoding values</p>
5788<h4 class="constants">Constants</h4>
5789<dl>
a469f8a5 5790<dt>HTTP_ENCODING_CHUNKED </dt>
5a738aea 5791<dd class="description">Data is chunked</dd>
a469f8a5 5792<dt>HTTP_ENCODING_FIELDS </dt>
5a738aea 5793<dd class="description">Sending HTTP fields</dd>
a469f8a5 5794<dt>HTTP_ENCODING_LENGTH </dt>
5a738aea
MS
5795<dd class="description">Data is sent with Content-Length</dd>
5796</dl>
5797<h3 class="enumeration"><a name="http_encryption_e">http_encryption_e</a></h3>
5798<p class="description">HTTP encryption values</p>
5799<h4 class="constants">Constants</h4>
5800<dl>
a469f8a5 5801<dt>HTTP_ENCRYPTION_ALWAYS </dt>
5a738aea 5802<dd class="description">Always encrypt (SSL)</dd>
a469f8a5 5803<dt>HTTP_ENCRYPTION_IF_REQUESTED </dt>
5a738aea 5804<dd class="description">Encrypt if requested (TLS upgrade)</dd>
a469f8a5 5805<dt>HTTP_ENCRYPTION_NEVER </dt>
5a738aea 5806<dd class="description">Never encrypt</dd>
a469f8a5 5807<dt>HTTP_ENCRYPTION_REQUIRED </dt>
5a738aea
MS
5808<dd class="description">Encryption is required (TLS upgrade)</dd>
5809</dl>
5810<h3 class="enumeration"><a name="http_field_e">http_field_e</a></h3>
5811<p class="description">HTTP field names</p>
5812<h4 class="constants">Constants</h4>
5813<dl>
9c0e8e5d 5814<dt>HTTP_FIELD_ACCEPT_ENCODING <span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span></dt>
a469f8a5 5815<dd class="description">Accepting-Encoding field </dd>
5a738aea
MS
5816<dt>HTTP_FIELD_ACCEPT_LANGUAGE </dt>
5817<dd class="description">Accept-Language field</dd>
5818<dt>HTTP_FIELD_ACCEPT_RANGES </dt>
5819<dd class="description">Accept-Ranges field</dd>
9c0e8e5d 5820<dt>HTTP_FIELD_ALLOW <span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span></dt>
a469f8a5 5821<dd class="description">Allow field </dd>
5a738aea
MS
5822<dt>HTTP_FIELD_AUTHORIZATION </dt>
5823<dd class="description">Authorization field</dd>
5824<dt>HTTP_FIELD_CONNECTION </dt>
5825<dd class="description">Connection field</dd>
5826<dt>HTTP_FIELD_CONTENT_ENCODING </dt>
5827<dd class="description">Content-Encoding field</dd>
5828<dt>HTTP_FIELD_CONTENT_LANGUAGE </dt>
5829<dd class="description">Content-Language field</dd>
5830<dt>HTTP_FIELD_CONTENT_LENGTH </dt>
5831<dd class="description">Content-Length field</dd>
5832<dt>HTTP_FIELD_CONTENT_LOCATION </dt>
5833<dd class="description">Content-Location field</dd>
5834<dt>HTTP_FIELD_CONTENT_MD5 </dt>
5835<dd class="description">Content-MD5 field</dd>
5836<dt>HTTP_FIELD_CONTENT_RANGE </dt>
5837<dd class="description">Content-Range field</dd>
5838<dt>HTTP_FIELD_CONTENT_TYPE </dt>
5839<dd class="description">Content-Type field</dd>
5840<dt>HTTP_FIELD_CONTENT_VERSION </dt>
5841<dd class="description">Content-Version field</dd>
5842<dt>HTTP_FIELD_DATE </dt>
5843<dd class="description">Date field</dd>
5844<dt>HTTP_FIELD_HOST </dt>
5845<dd class="description">Host field</dd>
5846<dt>HTTP_FIELD_IF_MODIFIED_SINCE </dt>
5847<dd class="description">If-Modified-Since field</dd>
5848<dt>HTTP_FIELD_IF_UNMODIFIED_SINCE </dt>
5849<dd class="description">If-Unmodified-Since field</dd>
5850<dt>HTTP_FIELD_KEEP_ALIVE </dt>
5851<dd class="description">Keep-Alive field</dd>
5852<dt>HTTP_FIELD_LAST_MODIFIED </dt>
5853<dd class="description">Last-Modified field</dd>
5854<dt>HTTP_FIELD_LINK </dt>
5855<dd class="description">Link field</dd>
5856<dt>HTTP_FIELD_LOCATION </dt>
5857<dd class="description">Location field</dd>
5858<dt>HTTP_FIELD_MAX </dt>
5859<dd class="description">Maximum field index</dd>
5860<dt>HTTP_FIELD_RANGE </dt>
5861<dd class="description">Range field</dd>
5862<dt>HTTP_FIELD_REFERER </dt>
5863<dd class="description">Referer field</dd>
5864<dt>HTTP_FIELD_RETRY_AFTER </dt>
5865<dd class="description">Retry-After field</dd>
9c0e8e5d 5866<dt>HTTP_FIELD_SERVER <span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span></dt>
a469f8a5 5867<dd class="description">Server field </dd>
5a738aea
MS
5868<dt>HTTP_FIELD_TRANSFER_ENCODING </dt>
5869<dd class="description">Transfer-Encoding field</dd>
5870<dt>HTTP_FIELD_UNKNOWN </dt>
5871<dd class="description">Unknown field</dd>
5872<dt>HTTP_FIELD_UPGRADE </dt>
5873<dd class="description">Upgrade field</dd>
5874<dt>HTTP_FIELD_USER_AGENT </dt>
5875<dd class="description">User-Agent field</dd>
5876<dt>HTTP_FIELD_WWW_AUTHENTICATE </dt>
5877<dd class="description">WWW-Authenticate field</dd>
5878</dl>
5879<h3 class="enumeration"><a name="http_keepalive_e">http_keepalive_e</a></h3>
f11a948a 5880<p class="description">HTTP keep-alive values</p>
5a738aea
MS
5881<h4 class="constants">Constants</h4>
5882<dl>
5883<dt>HTTP_KEEPALIVE_OFF </dt>
5884<dd class="description">No keep alive support</dd>
5885<dt>HTTP_KEEPALIVE_ON </dt>
5886<dd class="description">Use keep alive</dd>
5887</dl>
5888<h3 class="enumeration"><a name="http_state_e">http_state_e</a></h3>
f11a948a
MS
5889<p class="description">HTTP state values; states
5890are server-oriented...</p>
5a738aea
MS
5891<h4 class="constants">Constants</h4>
5892<dl>
a469f8a5
MS
5893<dt>HTTP_STATE_CONNECT </dt>
5894<dd class="description">CONNECT command, waiting for blank line</dd>
5895<dt>HTTP_STATE_DELETE </dt>
5a738aea 5896<dd class="description">DELETE command, waiting for blank line</dd>
a469f8a5
MS
5897<dt>HTTP_STATE_ERROR </dt>
5898<dd class="description">Error on socket</dd>
5899<dt>HTTP_STATE_GET </dt>
5a738aea 5900<dd class="description">GET command, waiting for blank line</dd>
a469f8a5 5901<dt>HTTP_STATE_GET_SEND </dt>
5a738aea 5902<dd class="description">GET command, sending data</dd>
a469f8a5 5903<dt>HTTP_STATE_HEAD </dt>
5a738aea 5904<dd class="description">HEAD command, waiting for blank line</dd>
a469f8a5 5905<dt>HTTP_STATE_OPTIONS </dt>
5a738aea 5906<dd class="description">OPTIONS command, waiting for blank line</dd>
a469f8a5 5907<dt>HTTP_STATE_POST </dt>
5a738aea 5908<dd class="description">POST command, waiting for blank line</dd>
a469f8a5 5909<dt>HTTP_STATE_POST_RECV </dt>
5a738aea 5910<dd class="description">POST command, receiving data</dd>
a469f8a5 5911<dt>HTTP_STATE_POST_SEND </dt>
5a738aea 5912<dd class="description">POST command, sending data</dd>
a469f8a5 5913<dt>HTTP_STATE_PUT </dt>
5a738aea 5914<dd class="description">PUT command, waiting for blank line</dd>
a469f8a5 5915<dt>HTTP_STATE_PUT_RECV </dt>
5a738aea 5916<dd class="description">PUT command, receiving data</dd>
a469f8a5 5917<dt>HTTP_STATE_STATUS </dt>
5a738aea 5918<dd class="description">Command complete, sending status</dd>
a469f8a5 5919<dt>HTTP_STATE_TRACE </dt>
5a738aea 5920<dd class="description">TRACE command, waiting for blank line</dd>
9c0e8e5d 5921<dt>HTTP_STATE_UNKNOWN_METHOD <span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span></dt>
a469f8a5 5922<dd class="description">Unknown request method, waiting for blank line </dd>
9c0e8e5d 5923<dt>HTTP_STATE_UNKNOWN_VERSION <span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span></dt>
a469f8a5
MS
5924<dd class="description">Unknown request method, waiting for blank line </dd>
5925<dt>HTTP_STATE_WAITING </dt>
5a738aea
MS
5926<dd class="description">Waiting for command</dd>
5927</dl>
5928<h3 class="enumeration"><a name="http_status_e">http_status_e</a></h3>
5929<p class="description">HTTP status codes</p>
5930<h4 class="constants">Constants</h4>
5931<dl>
a469f8a5
MS
5932<dt>HTTP_STATUS_ACCEPTED </dt>
5933<dd class="description">DELETE command was successful</dd>
5934<dt>HTTP_STATUS_BAD_GATEWAY </dt>
5a738aea 5935<dd class="description">Bad gateway</dd>
a469f8a5 5936<dt>HTTP_STATUS_BAD_REQUEST </dt>
5a738aea 5937<dd class="description">Bad request</dd>
a469f8a5 5938<dt>HTTP_STATUS_CONFLICT </dt>
5a738aea 5939<dd class="description">Request is self-conflicting</dd>
a469f8a5 5940<dt>HTTP_STATUS_CONTINUE </dt>
5a738aea 5941<dd class="description">Everything OK, keep going...</dd>
a469f8a5 5942<dt>HTTP_STATUS_CREATED </dt>
5a738aea 5943<dd class="description">PUT command was successful</dd>
6961465f
MS
5944<dt>HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED <span class="info">&nbsp;CUPS 1.4&nbsp;</span></dt>
5945<dd class="description">User canceled authorization </dd>
5946<dt>HTTP_STATUS_CUPS_PKI_ERROR <span class="info">&nbsp;CUPS 1.5/OS X 10.7&nbsp;</span></dt>
5947<dd class="description">Error negotiating a secure connection </dd>
a469f8a5 5948<dt>HTTP_STATUS_ERROR </dt>
5a738aea 5949<dd class="description">An error response from httpXxxx()</dd>
a469f8a5 5950<dt>HTTP_STATUS_EXPECTATION_FAILED </dt>
5a738aea 5951<dd class="description">The expectation given in an Expect header field was not met</dd>
a469f8a5 5952<dt>HTTP_STATUS_FORBIDDEN </dt>
5a738aea 5953<dd class="description">Forbidden to access this URI</dd>
a469f8a5 5954<dt>HTTP_STATUS_GATEWAY_TIMEOUT </dt>
5a738aea 5955<dd class="description">Gateway connection timed out</dd>
a469f8a5 5956<dt>HTTP_STATUS_GONE </dt>
5a738aea 5957<dd class="description">Server has gone away</dd>
a469f8a5 5958<dt>HTTP_STATUS_LENGTH_REQUIRED </dt>
5a738aea 5959<dd class="description">A content length or encoding is required</dd>
a469f8a5 5960<dt>HTTP_STATUS_METHOD_NOT_ALLOWED </dt>
5a738aea 5961<dd class="description">Method is not allowed</dd>
a469f8a5 5962<dt>HTTP_STATUS_MOVED_PERMANENTLY </dt>
5a738aea 5963<dd class="description">Document has moved permanently</dd>
a469f8a5 5964<dt>HTTP_STATUS_MOVED_TEMPORARILY </dt>
5a738aea 5965<dd class="description">Document has moved temporarily</dd>
a469f8a5 5966<dt>HTTP_STATUS_MULTIPLE_CHOICES </dt>
5a738aea 5967<dd class="description">Multiple files match request</dd>
9c0e8e5d 5968<dt>HTTP_STATUS_NONE <span class="info">&nbsp;CUPS 1.7/OS X 10.9&nbsp;</span></dt>
a469f8a5
MS
5969<dd class="description">No Expect value </dd>
5970<dt>HTTP_STATUS_NOT_ACCEPTABLE </dt>
5a738aea 5971<dd class="description">Not Acceptable</dd>
a469f8a5 5972<dt>HTTP_STATUS_NOT_AUTHORITATIVE </dt>
5a738aea 5973<dd class="description">Information isn't authoritative</dd>
a469f8a5 5974<dt>HTTP_STATUS_NOT_FOUND </dt>
5a738aea 5975<dd class="description">URI was not found</dd>
a469f8a5 5976<dt>HTTP_STATUS_NOT_IMPLEMENTED </dt>
5a738aea 5977<dd class="description">Feature not implemented</dd>
a469f8a5 5978<dt>HTTP_STATUS_NOT_MODIFIED </dt>
5a738aea 5979<dd class="description">File not modified</dd>
a469f8a5 5980<dt>HTTP_STATUS_NOT_SUPPORTED </dt>
5a738aea 5981<dd class="description">HTTP version not supported</dd>
a469f8a5 5982<dt>HTTP_STATUS_NO_CONTENT </dt>
5a738aea 5983<dd class="description">Successful command, no new data</dd>
a469f8a5 5984<dt>HTTP_STATUS_OK </dt>
5a738aea 5985<dd class="description">OPTIONS/GET/HEAD/POST/TRACE command was successful</dd>
a469f8a5 5986<dt>HTTP_STATUS_PARTIAL_CONTENT </dt>
5a738aea 5987<dd class="description">Only a partial file was recieved/sent</dd>
a469f8a5 5988<dt>HTTP_STATUS_PAYMENT_REQUIRED </dt>
5a738aea 5989<dd class="description">Payment required</dd>
a469f8a5 5990<dt>HTTP_STATUS_PRECONDITION </dt>
5a738aea 5991<dd class="description">Precondition failed</dd>
a469f8a5 5992<dt>HTTP_STATUS_PROXY_AUTHENTICATION </dt>
5a738aea 5993<dd class="description">Proxy Authentication is Required</dd>
a469f8a5 5994<dt>HTTP_STATUS_REQUESTED_RANGE </dt>
5a738aea 5995<dd class="description">The requested range is not satisfiable</dd>
a469f8a5 5996<dt>HTTP_STATUS_REQUEST_TIMEOUT </dt>
5a738aea 5997<dd class="description">Request timed out</dd>
a469f8a5 5998<dt>HTTP_STATUS_REQUEST_TOO_LARGE </dt>
5a738aea 5999<dd class="description">Request entity too large</dd>
a469f8a5 6000<dt>HTTP_STATUS_RESET_CONTENT </dt>
5a738aea 6001<dd class="description">Content was reset/recreated</dd>
a469f8a5 6002<dt>HTTP_STATUS_SEE_OTHER </dt>
5a738aea 6003<dd class="description">See this other link...</dd>
a469f8a5 6004<dt>HTTP_STATUS_SERVER_ERROR </dt>
5a738aea 6005<dd class="description">Internal server error</dd>
a469f8a5 6006<dt>HTTP_STATUS_SERVICE_UNAVAILABLE </dt>
5a738aea 6007<dd class="description">Service is unavailable</dd>
a469f8a5 6008<dt>HTTP_STATUS_SWITCHING_PROTOCOLS </dt>
5a738aea 6009<dd class="description">HTTP upgrade to TLS/SSL</dd>
a469f8a5 6010<dt>HTTP_STATUS_UNAUTHORIZED </dt>
5a738aea 6011<dd class="description">Unauthorized to access host</dd>
a469f8a5 6012<dt>HTTP_STATUS_UNSUPPORTED_MEDIATYPE </dt>
5a738aea 6013<dd class="description">The requested media type is unsupported</dd>
a469f8a5 6014<dt>HTTP_STATUS_UPGRADE_REQUIRED </dt>
5a738aea 6015<dd class="description">Upgrade to SSL/TLS required</dd>
a469f8a5 6016<dt>HTTP_STATUS_URI_TOO_LONG </dt>
5a738aea 6017<dd class="description">URI too long</dd>
a469f8a5 6018<dt>HTTP_STATUS_USE_PROXY </dt>
5a738aea
MS
6019<dd class="description">Must use a proxy to access this URI</dd>
6020</dl>
e1f19878 6021<h3 class="enumeration"><span class="info">&nbsp;CUPS 2.0/OS 10.10&nbsp;</span><a name="http_trust_e">http_trust_e</a></h3>
240214ef
MS
6022<p class="description">Level of trust for credentials </p>
6023<h4 class="constants">Constants</h4>
6024<dl>
6025<dt>HTTP_TRUST_CHANGED </dt>
6026<dd class="description">Credentials have changed</dd>
6027<dt>HTTP_TRUST_EXPIRED </dt>
6028<dd class="description">Credentials are expired</dd>
6029<dt>HTTP_TRUST_INVALID </dt>
6030<dd class="description">Credentials are invalid</dd>
6031<dt>HTTP_TRUST_OK </dt>
6032<dd class="description">Credentials are OK/trusted</dd>
6033<dt>HTTP_TRUST_RENEWED </dt>
6034<dd class="description">Credentials have been renewed</dd>
6035<dt>HTTP_TRUST_UNKNOWN </dt>
6036<dd class="description">Credentials are unknown/new</dd>
6037</dl>
5a738aea 6038<h3 class="enumeration"><a name="http_uri_coding_e">http_uri_coding_e</a></h3>
f11a948a 6039<p class="description">URI en/decode flags</p>
5a738aea
MS
6040<h4 class="constants">Constants</h4>
6041<dl>
6042<dt>HTTP_URI_CODING_ALL </dt>
6043<dd class="description">En/decode everything</dd>
6044<dt>HTTP_URI_CODING_HOSTNAME </dt>
6045<dd class="description">En/decode the hostname portion</dd>
6046<dt>HTTP_URI_CODING_MOST </dt>
6047<dd class="description">En/decode all but the query</dd>
6048<dt>HTTP_URI_CODING_NONE </dt>
6049<dd class="description">Don't en/decode anything</dd>
6050<dt>HTTP_URI_CODING_QUERY </dt>
6051<dd class="description">En/decode the query portion</dd>
6052<dt>HTTP_URI_CODING_RESOURCE </dt>
6053<dd class="description">En/decode the resource portion</dd>
9c0e8e5d
MS
6054<dt>HTTP_URI_CODING_RFC6874 </dt>
6055<dd class="description">Use RFC 6874 address format</dd>
5a738aea
MS
6056<dt>HTTP_URI_CODING_USERNAME </dt>
6057<dd class="description">En/decode the username portion</dd>
6058</dl>
10d09e33 6059<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 6060<p class="description">URI separation status </p>
5a738aea
MS
6061<h4 class="constants">Constants</h4>
6062<dl>
a469f8a5 6063<dt>HTTP_URI_STATUS_BAD_ARGUMENTS </dt>
5a738aea 6064<dd class="description">Bad arguments to function (error)</dd>
a469f8a5 6065<dt>HTTP_URI_STATUS_BAD_HOSTNAME </dt>
5a738aea 6066<dd class="description">Bad hostname in URI (error)</dd>
a469f8a5 6067<dt>HTTP_URI_STATUS_BAD_PORT </dt>
5a738aea 6068<dd class="description">Bad port number in URI (error)</dd>
a469f8a5 6069<dt>HTTP_URI_STATUS_BAD_RESOURCE </dt>
5a738aea 6070<dd class="description">Bad resource in URI (error)</dd>
a469f8a5 6071<dt>HTTP_URI_STATUS_BAD_SCHEME </dt>
5a738aea 6072<dd class="description">Bad scheme in URI (error)</dd>
a469f8a5 6073<dt>HTTP_URI_STATUS_BAD_URI </dt>
5a738aea 6074<dd class="description">Bad/empty URI (error)</dd>
a469f8a5 6075<dt>HTTP_URI_STATUS_BAD_USERNAME </dt>
5a738aea 6076<dd class="description">Bad username in URI (error)</dd>
a469f8a5 6077<dt>HTTP_URI_STATUS_MISSING_RESOURCE </dt>
5a738aea 6078<dd class="description">Missing resource in URI (warning)</dd>
a469f8a5 6079<dt>HTTP_URI_STATUS_MISSING_SCHEME </dt>
5a738aea 6080<dd class="description">Missing scheme in URI (warning)</dd>
a469f8a5 6081<dt>HTTP_URI_STATUS_OK </dt>
5a738aea 6082<dd class="description">URI decoded OK</dd>
a469f8a5 6083<dt>HTTP_URI_STATUS_OVERFLOW </dt>
5a738aea 6084<dd class="description">URI buffer for httpAssembleURI is too small</dd>
a469f8a5 6085<dt>HTTP_URI_STATUS_UNKNOWN_SCHEME </dt>
5a738aea
MS
6086<dd class="description">Unknown scheme in URI (warning)</dd>
6087</dl>
6088<h3 class="enumeration"><a name="http_version_e">http_version_e</a></h3>
f11a948a 6089<p class="description">HTTP version numbers</p>
5a738aea
MS
6090<h4 class="constants">Constants</h4>
6091<dl>
a469f8a5 6092<dt>HTTP_VERSION_0_9 </dt>
5a738aea 6093<dd class="description">HTTP/0.9</dd>
a469f8a5 6094<dt>HTTP_VERSION_1_0 </dt>
5a738aea 6095<dd class="description">HTTP/1.0</dd>
a469f8a5 6096<dt>HTTP_VERSION_1_1 </dt>
5a738aea
MS
6097<dd class="description">HTTP/1.1</dd>
6098</dl>
a2326b5b
MS
6099<h3 class="enumeration"><a name="ipp_dstate_e">ipp_dstate_e</a></h3>
6100<p class="description">Document states</p>
6101<h4 class="constants">Constants</h4>
6102<dl>
6103<dt>IPP_DOCUMENT_ABORTED </dt>
a469f8a5 6104<dd class="description">Document is aborted</dd>
a2326b5b 6105<dt>IPP_DOCUMENT_CANCELED </dt>
a469f8a5 6106<dd class="description">Document is canceled</dd>
a2326b5b 6107<dt>IPP_DOCUMENT_COMPLETED </dt>
a469f8a5 6108<dd class="description">Document is completed</dd>
a2326b5b 6109<dt>IPP_DOCUMENT_PENDING </dt>
a469f8a5 6110<dd class="description">Document is pending</dd>
a2326b5b 6111<dt>IPP_DOCUMENT_PROCESSING </dt>
a469f8a5 6112<dd class="description">Document is processing</dd>
a2326b5b 6113</dl>
a469f8a5 6114<h3 class="enumeration"><a name="ipp_finishings_e">ipp_finishings_e</a></h3>
aaf19ab0 6115<p class="description">Finishings</p>
5a738aea
MS
6116<h4 class="constants">Constants</h4>
6117<dl>
6118<dt>IPP_FINISHINGS_BALE </dt>
6119<dd class="description">Bale (any type)</dd>
6120<dt>IPP_FINISHINGS_BIND </dt>
6121<dd class="description">Bind</dd>
6122<dt>IPP_FINISHINGS_BIND_BOTTOM </dt>
6123<dd class="description">Bind on bottom</dd>
6124<dt>IPP_FINISHINGS_BIND_LEFT </dt>
6125<dd class="description">Bind on left</dd>
6126<dt>IPP_FINISHINGS_BIND_RIGHT </dt>
6127<dd class="description">Bind on right</dd>
6128<dt>IPP_FINISHINGS_BIND_TOP </dt>
6129<dd class="description">Bind on top</dd>
6130<dt>IPP_FINISHINGS_BOOKLET_MAKER </dt>
6131<dd class="description">Fold to make booklet</dd>
ca6b43fc
MS
6132<dt>IPP_FINISHINGS_COAT </dt>
6133<dd class="description">Apply protective liquid or powder coating</dd>
5a738aea
MS
6134<dt>IPP_FINISHINGS_COVER </dt>
6135<dd class="description">Add cover</dd>
6961465f
MS
6136<dt>IPP_FINISHINGS_CUPS_FOLD_ACCORDIAN </dt>
6137<dd class="description">Accordian-fold the paper vertically into four sections</dd>
6138<dt>IPP_FINISHINGS_CUPS_FOLD_DOUBLE_GATE </dt>
6139<dd class="description">Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically</dd>
6140<dt>IPP_FINISHINGS_CUPS_FOLD_GATE </dt>
6141<dd class="description">Fold the top and bottom quarters of the paper towards the midline</dd>
6142<dt>IPP_FINISHINGS_CUPS_FOLD_HALF </dt>
6143<dd class="description">Fold the paper in half vertically</dd>
6144<dt>IPP_FINISHINGS_CUPS_FOLD_HALF_Z </dt>
6145<dd class="description">Fold the paper in half horizontally, then Z-fold the paper vertically</dd>
6146<dt>IPP_FINISHINGS_CUPS_FOLD_LEFT_GATE </dt>
6147<dd class="description">Fold the top quarter of the paper towards the midline</dd>
6148<dt>IPP_FINISHINGS_CUPS_FOLD_LETTER </dt>
6149<dd class="description">Fold the paper into three sections vertically; sometimes also known as a C fold</dd>
6150<dt>IPP_FINISHINGS_CUPS_FOLD_PARALLEL </dt>
6151<dd class="description">Fold the paper in half vertically two times, yielding four sections</dd>
6152<dt>IPP_FINISHINGS_CUPS_FOLD_POSTER </dt>
6153<dd class="description">Fold the paper in half horizontally and vertically; sometimes also called a cross fold</dd>
6154<dt>IPP_FINISHINGS_CUPS_FOLD_RIGHT_GATE </dt>
6155<dd class="description">Fold the bottom quarter of the paper towards the midline</dd>
6156<dt>IPP_FINISHINGS_CUPS_FOLD_Z </dt>
6157<dd class="description">Fold the paper vertically into three sections, forming a Z</dd>
a469f8a5
MS
6158<dt>IPP_FINISHINGS_CUPS_PUNCH_BOTTOM_LEFT </dt>
6159<dd class="description">Punch 1 hole bottom left</dd>
6160<dt>IPP_FINISHINGS_CUPS_PUNCH_BOTTOM_RIGHT </dt>
6161<dd class="description">Punch 1 hole bottom right</dd>
6162<dt>IPP_FINISHINGS_CUPS_PUNCH_DUAL_BOTTOM </dt>
6163<dd class="description">Punch 2 holes bottom edge</dd>
6164<dt>IPP_FINISHINGS_CUPS_PUNCH_DUAL_LEFT </dt>
6165<dd class="description">Punch 2 holes left side</dd>
6166<dt>IPP_FINISHINGS_CUPS_PUNCH_DUAL_RIGHT </dt>
6167<dd class="description">Punch 2 holes right side</dd>
6168<dt>IPP_FINISHINGS_CUPS_PUNCH_DUAL_TOP </dt>
6169<dd class="description">Punch 2 holes top edge</dd>
6170<dt>IPP_FINISHINGS_CUPS_PUNCH_QUAD_BOTTOM </dt>
6171<dd class="description">Punch 4 holes bottom edge</dd>
6172<dt>IPP_FINISHINGS_CUPS_PUNCH_QUAD_LEFT </dt>
6173<dd class="description">Punch 4 holes left side</dd>
6174<dt>IPP_FINISHINGS_CUPS_PUNCH_QUAD_RIGHT </dt>
6175<dd class="description">Punch 4 holes right side</dd>
6176<dt>IPP_FINISHINGS_CUPS_PUNCH_QUAD_TOP </dt>
6177<dd class="description">Punch 4 holes top edge</dd>
6178<dt>IPP_FINISHINGS_CUPS_PUNCH_TOP_LEFT </dt>
6179<dd class="description">Punch 1 hole top left</dd>
6180<dt>IPP_FINISHINGS_CUPS_PUNCH_TOP_RIGHT </dt>
6181<dd class="description">Punch 1 hole top right</dd>
6182<dt>IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_BOTTOM </dt>
6183<dd class="description">Punch 3 holes bottom edge</dd>
6184<dt>IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_LEFT </dt>
6185<dd class="description">Punch 3 holes left side</dd>
6186<dt>IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_RIGHT </dt>
6187<dd class="description">Punch 3 holes right side</dd>
6188<dt>IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_TOP </dt>
6189<dd class="description">Punch 3 holes top edge</dd>
5a738aea
MS
6190<dt>IPP_FINISHINGS_EDGE_STITCH </dt>
6191<dd class="description">Stitch along any side</dd>
6192<dt>IPP_FINISHINGS_EDGE_STITCH_BOTTOM </dt>
6193<dd class="description">Stitch along bottom edge</dd>
6194<dt>IPP_FINISHINGS_EDGE_STITCH_LEFT </dt>
6195<dd class="description">Stitch along left side</dd>
6196<dt>IPP_FINISHINGS_EDGE_STITCH_RIGHT </dt>
6197<dd class="description">Stitch along right side</dd>
6198<dt>IPP_FINISHINGS_EDGE_STITCH_TOP </dt>
6199<dd class="description">Stitch along top edge</dd>
6200<dt>IPP_FINISHINGS_FOLD </dt>
6201<dd class="description">Fold (any type)</dd>
9c0e8e5d
MS
6202<dt>IPP_FINISHINGS_FOLD_ACCORDIAN </dt>
6203<dd class="description">Accordian-fold the paper vertically into four sections</dd>
6204<dt>IPP_FINISHINGS_FOLD_DOUBLE_GATE </dt>
6205<dd class="description">Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically</dd>
6206<dt>IPP_FINISHINGS_FOLD_GATE </dt>
6207<dd class="description">Fold the top and bottom quarters of the paper towards the midline</dd>
6208<dt>IPP_FINISHINGS_FOLD_HALF </dt>
6209<dd class="description">Fold the paper in half vertically</dd>
6210<dt>IPP_FINISHINGS_FOLD_HALF_Z </dt>
6211<dd class="description">Fold the paper in half horizontally, then Z-fold the paper vertically</dd>
6212<dt>IPP_FINISHINGS_FOLD_LEFT_GATE </dt>
6213<dd class="description">Fold the top quarter of the paper towards the midline</dd>
6214<dt>IPP_FINISHINGS_FOLD_LETTER </dt>
6215<dd class="description">Fold the paper into three sections vertically; sometimes also known as a C fold</dd>
6216<dt>IPP_FINISHINGS_FOLD_PARALLEL </dt>
6217<dd class="description">Fold the paper in half vertically two times, yielding four sections</dd>
6218<dt>IPP_FINISHINGS_FOLD_POSTER </dt>
6219<dd class="description">Fold the paper in half horizontally and vertically; sometimes also called a cross fold</dd>
6220<dt>IPP_FINISHINGS_FOLD_RIGHT_GATE </dt>
6221<dd class="description">Fold the bottom quarter of the paper towards the midline</dd>
6222<dt>IPP_FINISHINGS_FOLD_Z </dt>
6223<dd class="description">Fold the paper vertically into three sections, forming a Z</dd>
6961465f 6224<dt>IPP_FINISHINGS_JOG_OFFSET </dt>
5a738aea 6225<dd class="description">Offset for binding (any type)</dd>
ca6b43fc
MS
6226<dt>IPP_FINISHINGS_LAMINATE </dt>
6227<dd class="description">Apply protective (solid) material</dd>
5a738aea
MS
6228<dt>IPP_FINISHINGS_NONE </dt>
6229<dd class="description">No finishing</dd>
6230<dt>IPP_FINISHINGS_PUNCH </dt>
6231<dd class="description">Punch (any location/count)</dd>
9c0e8e5d
MS
6232<dt>IPP_FINISHINGS_PUNCH_BOTTOM_LEFT </dt>
6233<dd class="description">Punch 1 hole bottom left</dd>
6234<dt>IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT </dt>
6235<dd class="description">Punch 1 hole bottom right</dd>
6236<dt>IPP_FINISHINGS_PUNCH_DUAL_BOTTOM </dt>
6237<dd class="description">Punch 2 holes bottom edge</dd>
6238<dt>IPP_FINISHINGS_PUNCH_DUAL_LEFT </dt>
6239<dd class="description">Punch 2 holes left side</dd>
6240<dt>IPP_FINISHINGS_PUNCH_DUAL_RIGHT </dt>
6241<dd class="description">Punch 2 holes right side</dd>
6242<dt>IPP_FINISHINGS_PUNCH_DUAL_TOP </dt>
6243<dd class="description">Punch 2 holes top edge</dd>
6244<dt>IPP_FINISHINGS_PUNCH_QUAD_BOTTOM </dt>
6245<dd class="description">Punch 4 holes bottom edge</dd>
6246<dt>IPP_FINISHINGS_PUNCH_QUAD_LEFT </dt>
6247<dd class="description">Punch 4 holes left side</dd>
6248<dt>IPP_FINISHINGS_PUNCH_QUAD_RIGHT </dt>
6249<dd class="description">Punch 4 holes right side</dd>
6250<dt>IPP_FINISHINGS_PUNCH_QUAD_TOP </dt>
6251<dd class="description">Punch 4 holes top edge</dd>
6252<dt>IPP_FINISHINGS_PUNCH_TOP_LEFT </dt>
6253<dd class="description">Punch 1 hole top left</dd>
6254<dt>IPP_FINISHINGS_PUNCH_TOP_RIGHT </dt>
6255<dd class="description">Punch 1 hole top right</dd>
6256<dt>IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM </dt>
6257<dd class="description">Punch 3 holes bottom edge</dd>
6258<dt>IPP_FINISHINGS_PUNCH_TRIPLE_LEFT </dt>
6259<dd class="description">Punch 3 holes left side</dd>
6260<dt>IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT </dt>
6261<dd class="description">Punch 3 holes right side</dd>
6262<dt>IPP_FINISHINGS_PUNCH_TRIPLE_TOP </dt>
6263<dd class="description">Punch 3 holes top edge</dd>
5a738aea
MS
6264<dt>IPP_FINISHINGS_SADDLE_STITCH </dt>
6265<dd class="description">Staple interior</dd>
6266<dt>IPP_FINISHINGS_STAPLE </dt>
6267<dd class="description">Staple (any location)</dd>
6268<dt>IPP_FINISHINGS_STAPLE_BOTTOM_LEFT </dt>
6269<dd class="description">Staple bottom left corner</dd>
6270<dt>IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT </dt>
6271<dd class="description">Staple bottom right corner</dd>
6272<dt>IPP_FINISHINGS_STAPLE_DUAL_BOTTOM </dt>
6273<dd class="description">Two staples on bottom</dd>
6274<dt>IPP_FINISHINGS_STAPLE_DUAL_LEFT </dt>
6275<dd class="description">Two staples on left</dd>
6276<dt>IPP_FINISHINGS_STAPLE_DUAL_RIGHT </dt>
6277<dd class="description">Two staples on right</dd>
6278<dt>IPP_FINISHINGS_STAPLE_DUAL_TOP </dt>
6279<dd class="description">Two staples on top</dd>
6280<dt>IPP_FINISHINGS_STAPLE_TOP_LEFT </dt>
6281<dd class="description">Staple top left corner</dd>
6282<dt>IPP_FINISHINGS_STAPLE_TOP_RIGHT </dt>
6283<dd class="description">Staple top right corner</dd>
ca6b43fc
MS
6284<dt>IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM </dt>
6285<dd class="description">Three staples on bottom</dd>
6286<dt>IPP_FINISHINGS_STAPLE_TRIPLE_LEFT </dt>
6287<dd class="description">Three staples on left</dd>
6288<dt>IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT </dt>
6289<dd class="description">Three staples on right</dd>
6290<dt>IPP_FINISHINGS_STAPLE_TRIPLE_TOP </dt>
6291<dd class="description">Three staples on top</dd>
5a738aea
MS
6292<dt>IPP_FINISHINGS_TRIM </dt>
6293<dd class="description">Trim (any type)</dd>
a2326b5b
MS
6294<dt>IPP_FINISHINGS_TRIM_AFTER_COPIES </dt>
6295<dd class="description">Trim output after each copy</dd>
6296<dt>IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS </dt>
6297<dd class="description">Trim output after each document</dd>
6298<dt>IPP_FINISHINGS_TRIM_AFTER_JOB </dt>
6299<dd class="description">Trim output after job</dd>
6300<dt>IPP_FINISHINGS_TRIM_AFTER_PAGES </dt>
6301<dd class="description">Trim output after each page</dd>
6302</dl>
6303<h3 class="enumeration"><a name="ipp_jcollate_e">ipp_jcollate_e</a></h3>
6304<p class="description">Job collation types</p>
6305<h4 class="constants">Constants</h4>
6306<dl>
a469f8a5
MS
6307<dt>IPP_JCOLLATE_COLLATED_DOCUMENTS </dt>
6308<dt>IPP_JCOLLATE_UNCOLLATED_DOCUMENTS </dt>
6309<dt>IPP_JCOLLATE_UNCOLLATED_SHEETS </dt>
5a738aea
MS
6310</dl>
6311<h3 class="enumeration"><a name="ipp_jstate_e">ipp_jstate_e</a></h3>
aaf19ab0 6312<p class="description">Job states</p>
5a738aea
MS
6313<h4 class="constants">Constants</h4>
6314<dl>
a469f8a5 6315<dt>IPP_JSTATE_ABORTED </dt>
5a738aea 6316<dd class="description">Job has aborted due to error</dd>
a469f8a5 6317<dt>IPP_JSTATE_CANCELED </dt>
5a738aea 6318<dd class="description">Job has been canceled</dd>
a469f8a5 6319<dt>IPP_JSTATE_COMPLETED </dt>
5a738aea 6320<dd class="description">Job has completed successfully</dd>
a469f8a5 6321<dt>IPP_JSTATE_HELD </dt>
5a738aea 6322<dd class="description">Job is held for printing</dd>
a469f8a5 6323<dt>IPP_JSTATE_PENDING </dt>
5a738aea 6324<dd class="description">Job is waiting to be printed</dd>
a469f8a5 6325<dt>IPP_JSTATE_PROCESSING </dt>
5a738aea 6326<dd class="description">Job is currently printing</dd>
a469f8a5 6327<dt>IPP_JSTATE_STOPPED </dt>
5a738aea
MS
6328<dd class="description">Job has been stopped</dd>
6329</dl>
6330<h3 class="enumeration"><a name="ipp_op_e">ipp_op_e</a></h3>
aaf19ab0 6331<p class="description">IPP operations</p>
5a738aea
MS
6332<h4 class="constants">Constants</h4>
6333<dl>
a469f8a5
MS
6334<dt>IPP_OP_CANCEL_JOB </dt>
6335<dd class="description">Cancel a job</dd>
6336<dt>IPP_OP_CANCEL_JOBS </dt>
6337<dd class="description">Cancel-Jobs</dd>
6338<dt>IPP_OP_CANCEL_MY_JOBS </dt>
6339<dd class="description">Cancel-My-Jobs</dd>
6340<dt>IPP_OP_CANCEL_SUBSCRIPTION <span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span></dt>
6341<dd class="description">Cancel a subscription </dd>
6342<dt>IPP_OP_CLOSE_JOB </dt>
6343<dd class="description">Close-Job</dd>
6344<dt>IPP_OP_CREATE_JOB </dt>
6345<dd class="description">Create an empty print job</dd>
ca6b43fc
MS
6346<dt>IPP_OP_CREATE_JOB_SUBSCRIPTIONS <span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span></dt>
6347<dd class="description">Create one of more job subscriptions </dd>
6348<dt>IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS <span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span></dt>
6349<dd class="description">Create one or more printer subscriptions </dd>
a469f8a5 6350<dt>IPP_OP_CUPS_ACCEPT_JOBS </dt>
5a738aea 6351<dd class="description">Accept new jobs on a printer</dd>
a469f8a5 6352<dt>IPP_OP_CUPS_ADD_MODIFY_CLASS </dt>
5a738aea 6353<dd class="description">Add or modify a class</dd>
a469f8a5 6354<dt>IPP_OP_CUPS_ADD_MODIFY_PRINTER </dt>
5a738aea 6355<dd class="description">Add or modify a printer</dd>
a469f8a5 6356<dt>IPP_OP_CUPS_AUTHENTICATE_JOB <span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span></dt>
5a738aea 6357<dd class="description">Authenticate a job </dd>
a469f8a5 6358<dt>IPP_OP_CUPS_DELETE_CLASS </dt>
5a738aea 6359<dd class="description">Delete a class</dd>
a469f8a5 6360<dt>IPP_OP_CUPS_DELETE_PRINTER </dt>
5a738aea 6361<dd class="description">Delete a printer</dd>
a469f8a5 6362<dt>IPP_OP_CUPS_GET_CLASSES <span class="info">&nbsp;DEPRECATED&nbsp;</span></dt>
5a738aea 6363<dd class="description">Get a list of classes </dd>
a469f8a5 6364<dt>IPP_OP_CUPS_GET_DEFAULT </dt>
5a738aea 6365<dd class="description">Get the default printer</dd>
a469f8a5 6366<dt>IPP_OP_CUPS_GET_DEVICES </dt>
5a738aea 6367<dd class="description">Get a list of supported devices</dd>
a469f8a5 6368<dt>IPP_OP_CUPS_GET_DOCUMENT <span class="info">&nbsp;CUPS 1.4/OS X 10.6&nbsp;</span></dt>
5a738aea 6369<dd class="description">Get a document file </dd>
a469f8a5 6370<dt>IPP_OP_CUPS_GET_PPD <span class="info">&nbsp;CUPS 1.3/OS X 10.5&nbsp;</span></dt>
5a738aea 6371<dd class="description">Get a PPD file </dd>
a469f8a5 6372<dt>IPP_OP_CUPS_GET_PPDS </dt>
5a738aea 6373<dd class="description">Get a list of supported drivers</dd>
a469f8a5 6374<dt>IPP_OP_CUPS_GET_PRINTERS </dt>
5a738aea 6375<dd class="description">Get a list of printers and/or classes</dd>
a469f8a5
MS
6376<dt>IPP_OP_CUPS_INVALID </dt>
6377<dd class="description">Invalid operation name for <a href="#ippOpValue"><code>ippOpValue</code></a></dd>
6378<dt>IPP_OP_CUPS_MOVE_JOB </dt>
5a738aea 6379<dd class="description">Move a job to a different printer</dd>
a469f8a5 6380<dt>IPP_OP_CUPS_REJECT_JOBS </dt>
5a738aea 6381<dd class="description">Reject new jobs on a printer</dd>
a469f8a5 6382<dt>IPP_OP_CUPS_SET_DEFAULT </dt>
5a738aea 6383<dd class="description">Set the default printer</dd>
a469f8a5 6384<dt>IPP_OP_DISABLE_PRINTER </dt>
5a738aea 6385<dd class="description">Stop a printer</dd>
a469f8a5 6386<dt>IPP_OP_ENABLE_PRINTER </dt>
5a738aea 6387<dd class="description">Start a printer</dd>
a469f8a5 6388<dt>IPP_OP_GET_JOBS </dt>
5a738aea 6389<dd class="description">Get a list of jobs</dd>
a469f8a5 6390<dt>IPP_OP_GET_JOB_ATTRIBUTES </dt>
5a738aea 6391<dd class="description">Get job attributes</dd>
a469f8a5 6392<dt>IPP_OP_GET_NOTIFICATIONS <span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span></dt>
5a738aea 6393<dd class="description">Get notification events </dd>
a469f8a5 6394<dt>IPP_OP_GET_PRINTER_ATTRIBUTES </dt>
5a738aea 6395<dd class="description">Get printer attributes</dd>
a469f8a5 6396<dt>IPP_OP_GET_PRINTER_SUPPORTED_VALUES </dt>
5a738aea 6397<dd class="description">Get supported attribute values</dd>
a469f8a5 6398<dt>IPP_OP_GET_SUBSCRIPTIONS <span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span></dt>
5a738aea 6399<dd class="description">Get list of subscriptions </dd>
a469f8a5 6400<dt>IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES <span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span></dt>
5a738aea 6401<dd class="description">Get subscription attributes </dd>
a469f8a5 6402<dt>IPP_OP_HOLD_JOB </dt>
5a738aea 6403<dd class="description">Hold a job for printing</dd>
a469f8a5 6404<dt>IPP_OP_PAUSE_PRINTER </dt>
5a738aea 6405<dd class="description">Stop a printer</dd>
a469f8a5 6406<dt>IPP_OP_PRINT_JOB </dt>
5a738aea 6407<dd class="description">Print a single file</dd>
a469f8a5 6408<dt>IPP_OP_PURGE_JOBS </dt>
5a738aea 6409<dd class="description">Cancel all jobs</dd>
a469f8a5 6410<dt>IPP_OP_RELEASE_JOB </dt>
5a738aea 6411<dd class="description">Release a job for printing</dd>
a469f8a5 6412<dt>IPP_OP_RENEW_SUBSCRIPTION <span class="info">&nbsp;CUPS 1.2/OS X 10.5&nbsp;</span></dt>
5a738aea 6413<dd class="description">Renew a printer subscription </dd>
a469f8a5 6414<dt>IPP_OP_RESTART_JOB </dt>
5a738aea 6415<dd class="description">Reprint a job</dd>
a469f8a5 6416<dt>IPP_OP_RESUBMIT_JOB </dt>
aaf19ab0 6417<dd class="description">Resubmit-Job</dd>
a469f8a5 6418<dt>IPP_OP_RESUME_PRINTER </dt>
5a738aea 6419<dd class="description">Start a printer</dd>
a469f8a5 6420<dt>IPP_OP_SEND_DOCUMENT </dt>
5a738aea 6421<dd class="description">Add a file to a job</dd>
a469f8a5 6422<dt>IPP_OP_SET_JOB_ATTRIBUTES </dt>
5a738aea 6423<dd class="description">Set job attributes</dd>
a469f8a5 6424<dt>IPP_OP_VALIDATE_JOB </dt>
5a738aea
MS
6425<dd class="description">Validate job options</dd>
6426</dl>
6427<h3 class="enumeration"><a name="ipp_orient_e">ipp_orient_e</a></h3>
aaf19ab0 6428<p class="description">Orientation values</p>
5a738aea
MS
6429<h4 class="constants">Constants</h4>
6430<dl>
a469f8a5 6431<dt>IPP_ORIENT_LANDSCAPE </dt>
5a738aea 6432<dd class="description">90 degrees counter-clockwise</dd>
ca6b43fc
MS
6433<dt>IPP_ORIENT_NONE </dt>
6434<dd class="description">No rotation</dd>
a469f8a5 6435<dt>IPP_ORIENT_PORTRAIT </dt>
5a738aea 6436<dd class="description">No rotation</dd>
a469f8a5 6437<dt>IPP_ORIENT_REVERSE_LANDSCAPE </dt>
5a738aea 6438<dd class="description">90 degrees clockwise</dd>
a469f8a5 6439<dt>IPP_ORIENT_REVERSE_PORTRAIT </dt>
5a738aea
MS
6440<dd class="description">180 degrees</dd>
6441</dl>
6442<h3 class="enumeration"><a name="ipp_pstate_e">ipp_pstate_e</a></h3>
aaf19ab0 6443<p class="description">Printer states</p>
5a738aea
MS
6444<h4 class="constants">Constants</h4>
6445<dl>
a469f8a5 6446<dt>IPP_PSTATE_IDLE </dt>
5a738aea 6447<dd class="description">Printer is idle</dd>
a469f8a5 6448<dt>IPP_PSTATE_PROCESSING </dt>
5a738aea 6449<dd class="description">Printer is working</dd>
a469f8a5 6450<dt>IPP_PSTATE_STOPPED </dt>
5a738aea
MS
6451<dd class="description">Printer is stopped</dd>
6452</dl>
6453<h3 class="enumeration"><a name="ipp_quality_e">ipp_quality_e</a></h3>
aaf19ab0 6454<p class="description">Qualities</p>
5a738aea
MS
6455<h4 class="constants">Constants</h4>
6456<dl>
6457<dt>IPP_QUALITY_DRAFT </dt>
6458<dd class="description">Draft quality</dd>
6459<dt>IPP_QUALITY_HIGH </dt>
6460<dd class="description">High quality</dd>
6461<dt>IPP_QUALITY_NORMAL </dt>
6462<dd class="description">Normal quality</dd>
6463</dl>
6464<h3 class="enumeration"><a name="ipp_res_e">ipp_res_e</a></h3>
aaf19ab0 6465<p class="description">Resolution units</p>
5a738aea
MS
6466<h4 class="constants">Constants</h4>
6467<dl>
6468<dt>IPP_RES_PER_CM </dt>
6469<dd class="description">Pixels per centimeter</dd>
6470<dt>IPP_RES_PER_INCH </dt>
6471<dd class="description">Pixels per inch</dd>
6472</dl>
6473<h3 class="enumeration"><a name="ipp_state_e">ipp_state_e</a></h3>
aaf19ab0 6474<p class="description">IPP states</p>
5a738aea
MS
6475<h4 class="constants">Constants</h4>
6476<dl>
a469f8a5 6477<dt>IPP_STATE_ATTRIBUTE </dt>
5a738aea 6478<dd class="description">One or more attributes need to be sent/received</dd>
a469f8a5 6479<dt>IPP_STATE_DATA </dt>
5a738aea 6480<dd class="description">IPP request data needs to be sent/received</dd>
a469f8a5 6481<dt>IPP_STATE_ERROR </dt>
5a738aea 6482<dd class="description">An error occurred</dd>
a469f8a5 6483<dt>IPP_STATE_HEADER </dt>
5a738aea 6484<dd class="description">The request header needs to be sent/received</dd>
a469f8a5 6485<dt>IPP_STATE_IDLE </dt>
5a738aea
MS
6486<dd class="description">Nothing is happening/request completed</dd>
6487</dl>
6488<h3 class="enumeration"><a name="ipp_status_e">ipp_status_e</a></h3>
aaf19ab0 6489<p class="description">IPP status codes</p>
5a738aea
MS
6490<h4 class="constants">Constants</h4>
6491<dl>
a469f8a5
MS
6492<dt>IPP_STATUS_CUPS_INVALID </dt>
6493<dd class="description">Invalid status name for <a href="#ippErrorValue"><code>ippErrorValue</code></a></dd>
6494<dt>IPP_STATUS_CUPS_SEE_OTHER </dt>
5a738aea 6495<dd class="description">cups-see-other</dd>
240214ef
MS
6496<dt>IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED </dt>
6497<dd class="description">client-error-account-authorization-failed</dd>
6498<dt>IPP_STATUS_ERROR_ACCOUNT_CLOSED </dt>
6499<dd class="description">client-error-account-closed</dd>
6500<dt>IPP_STATUS_ERROR_ACCOUNT_INFO_NEEDED </dt>
6501<dd class="description">client-error-account-info-needed</dd>
6502<dt>IPP_STATUS_ERROR_ACCOUNT_LIMIT_REACHED </dt>
6503<dd class="description">client-error-account-limit-reached</dd>
a469f8a5 6504<dt>IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE </dt>
5a738aea 6505<dd class="description">client-error-attributes-not-settable</dd>
a469f8a5
MS
6506<dt>IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES </dt>
6507<dd class="description">client-error-attributes-or-values-not-supported</dd>
6508<dt>IPP_STATUS_ERROR_BAD_REQUEST </dt>
5a738aea 6509<dd class="description">client-error-bad-request</dd>
a469f8a5
MS
6510<dt>IPP_STATUS_ERROR_BUSY </dt>
6511<dd class="description">server-error-busy</dd>
6512<dt>IPP_STATUS_ERROR_CHARSET </dt>
5a738aea 6513<dd class="description">client-error-charset-not-supported</dd>
a469f8a5 6514<dt>IPP_STATUS_ERROR_COMPRESSION_ERROR </dt>
5a738aea 6515<dd class="description">client-error-compression-error</dd>
a469f8a5 6516<dt>IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED </dt>
5a738aea 6517<dd class="description">client-error-compression-not-supported</dd>
a469f8a5 6518<dt>IPP_STATUS_ERROR_CONFLICTING </dt>
5a738aea 6519<dd class="description">client-error-conflicting-attributes</dd>
240214ef 6520<dt>IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED <span class="info">&nbsp;DEPRECATED&nbsp;</span></dt>
a469f8a5 6521<dd class="description">cups-error-account-authorization-failed </dd>
240214ef
MS
6522<dt>IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED </dt>
6523<dd class="description">cups-error-account-closed @deprecate@</dd>
6524<dt>IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED <span class="info">&nbsp;DEPRECATED&nbsp;</span></dt>
a469f8a5 6525<dd class="description">cups-error-account-info-needed </dd>
240214ef 6526<dt>IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED <span class="info">&nbsp;DEPRECATED&nbsp;</span></dt>
a469f8a5
MS
6527<dd class="description">cups-error-account-limit-reached </dd>
6528<dt>IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED <span class="info">&nbsp;CUPS 1.5/OS X 10.7&nbsp;</span></dt>
6529<dd class="description">cups-authentication-canceled - Authentication canceled by user </dd>
6530<dt>IPP_STATUS_ERROR_CUPS_PKI <span class="info">&nbsp;CUPS 1.5/OS X 10.7&nbsp;</span></dt>
6531<dd class="description">cups-pki-error - Error negotiating a secure connection </dd>
6532<dt>IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED </dt>
6533<dd class="description">cups-upgrade-required - TLS upgrade required</dd>
6534<dt>IPP_STATUS_ERROR_DEVICE </dt>
5a738aea 6535<dd class="description">server-error-device-error</dd>
a469f8a5 6536<dt>IPP_STATUS_ERROR_DOCUMENT_ACCESS </dt>
5a738aea 6537<dd class="description">client-error-document-access-error</dd>
a469f8a5 6538<dt>IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR </dt>
5a738aea 6539<dd class="description">client-error-document-format-error</dd>
a469f8a5
MS
6540<dt>IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED </dt>
6541<dd class="description">client-error-document-format-not-supported</dd>
6542<dt>IPP_STATUS_ERROR_DOCUMENT_PASSWORD </dt>
a2326b5b 6543<dd class="description">client-error-document-password-error</dd>
a469f8a5 6544<dt>IPP_STATUS_ERROR_DOCUMENT_PERMISSION </dt>
a2326b5b 6545<dd class="description">client-error-document-permission-error</dd>
a469f8a5 6546<dt>IPP_STATUS_ERROR_DOCUMENT_SECURITY </dt>
a2326b5b 6547<dd class="description">client-error-document-security-error</dd>
a469f8a5 6548<dt>IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE </dt>
a2326b5b 6549<dd class="description">client-error-document-unprintable-error</dd>
a469f8a5 6550<dt>IPP_STATUS_ERROR_FORBIDDEN </dt>
5a738aea 6551<dd class="description">client-error-forbidden</dd>
a469f8a5 6552<dt>IPP_STATUS_ERROR_GONE </dt>
5a738aea 6553<dd class="description">client-error-gone</dd>
a469f8a5 6554<dt>IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS </dt>
5a738aea 6555<dd class="description">client-error-ignored-all-subscriptions</dd>
a469f8a5 6556<dt>IPP_STATUS_ERROR_INTERNAL </dt>
5a738aea 6557<dd class="description">server-error-internal-error</dd>
a469f8a5
MS
6558<dt>IPP_STATUS_ERROR_JOB_CANCELED </dt>
6559<dd class="description">server-error-job-canceled</dd>
6560<dt>IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED </dt>
5a738aea 6561<dd class="description">server-error-multiple-document-jobs-not-supported</dd>
a469f8a5 6562<dt>IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS </dt>
5a738aea 6563<dd class="description">server-error-not-accepting-jobs</dd>
a469f8a5 6564<dt>IPP_STATUS_ERROR_NOT_AUTHENTICATED </dt>
5a738aea 6565<dd class="description">client-error-not-authenticated</dd>
a469f8a5 6566<dt>IPP_STATUS_ERROR_NOT_AUTHORIZED </dt>
5a738aea 6567<dd class="description">client-error-not-authorized</dd>
a469f8a5 6568<dt>IPP_STATUS_ERROR_NOT_FOUND </dt>
5a738aea 6569<dd class="description">client-error-not-found</dd>
a469f8a5 6570<dt>IPP_STATUS_ERROR_NOT_POSSIBLE </dt>
5a738aea 6571<dd class="description">client-error-not-possible</dd>
a469f8a5 6572<dt>IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED </dt>
5a738aea 6573<dd class="description">server-error-operation-not-supported</dd>
a469f8a5 6574<dt>IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED </dt>
5a738aea 6575<dd class="description">server-error-printer-is-deactivated</dd>
a469f8a5 6576<dt>IPP_STATUS_ERROR_REQUEST_ENTITY </dt>
5a738aea 6577<dd class="description">client-error-request-entity-too-large</dd>
a469f8a5 6578<dt>IPP_STATUS_ERROR_REQUEST_VALUE </dt>
5a738aea 6579<dd class="description">client-error-request-value-too-long</dd>
a469f8a5 6580<dt>IPP_STATUS_ERROR_SERVICE_UNAVAILABLE </dt>
5a738aea 6581<dd class="description">server-error-service-unavailable</dd>
a469f8a5 6582<dt>IPP_STATUS_ERROR_TEMPORARY </dt>
5a738aea 6583<dd class="description">server-error-temporary-error</dd>
a469f8a5 6584<dt>IPP_STATUS_ERROR_TIMEOUT </dt>
5a738aea 6585<dd class="description">client-error-timeout</dd>
a469f8a5 6586<dt>IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS </dt>
3e7fe0ca 6587<dd class="description">server-error-too-many-documents</dd>
a469f8a5 6588<dt>IPP_STATUS_ERROR_TOO_MANY_JOBS </dt>
3e7fe0ca 6589<dd class="description">server-error-too-many-jobs</dd>
a469f8a5 6590<dt>IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS </dt>
5a738aea 6591<dd class="description">client-error-too-many-subscriptions</dd>
a469f8a5 6592<dt>IPP_STATUS_ERROR_URI_SCHEME </dt>
5a738aea 6593<dd class="description">client-error-uri-scheme-not-supported</dd>
a469f8a5 6594<dt>IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED </dt>
5a738aea 6595<dd class="description">server-error-version-not-supported</dd>
a469f8a5
MS
6596<dt>IPP_STATUS_OK </dt>
6597<dd class="description">successful-ok</dd>
6598<dt>IPP_STATUS_OK_CONFLICTING </dt>
6599<dd class="description">successful-ok-conflicting-attributes</dd>
6600<dt>IPP_STATUS_OK_EVENTS_COMPLETE </dt>
6601<dd class="description">successful-ok-events-complete</dd>
6602<dt>IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED </dt>
6603<dd class="description">successful-ok-ignored-or-substituted-attributes</dd>
6604<dt>IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS </dt>
6605<dd class="description">successful-ok-ignored-subscriptions</dd>
6606<dt>IPP_STATUS_OK_TOO_MANY_EVENTS </dt>
6607<dd class="description">successful-ok-too-many-events</dd>
5a738aea
MS
6608</dl>
6609<h3 class="enumeration"><a name="ipp_tag_e">ipp_tag_e</a></h3>
aaf19ab0 6610<p class="description">Format tags for attributes</p>
5a738aea
MS
6611<h4 class="constants">Constants</h4>
6612<dl>
6613<dt>IPP_TAG_ADMINDEFINE </dt>
6614<dd class="description">Admin-defined value</dd>
6615<dt>IPP_TAG_BEGIN_COLLECTION </dt>
6616<dd class="description">Beginning of collection value</dd>
6617<dt>IPP_TAG_BOOLEAN </dt>
6618<dd class="description">Boolean value</dd>
6619<dt>IPP_TAG_CHARSET </dt>
6620<dd class="description">Character set value</dd>
3e7fe0ca
MS
6621<dt>IPP_TAG_CUPS_INVALID </dt>
6622<dd class="description">Invalid tag name for <a href="#ippTagValue"><code>ippTagValue</code></a></dd>
5a738aea
MS
6623<dt>IPP_TAG_DATE </dt>
6624<dd class="description">Date/time value</dd>
6625<dt>IPP_TAG_DEFAULT </dt>
6626<dd class="description">Default value</dd>
6627<dt>IPP_TAG_DELETEATTR </dt>
6628<dd class="description">Delete-attribute value</dd>
a2326b5b
MS
6629<dt>IPP_TAG_DOCUMENT </dt>
6630<dd class="description">Document group</dd>
5a738aea
MS
6631<dt>IPP_TAG_END </dt>
6632<dd class="description">End-of-attributes</dd>
6633<dt>IPP_TAG_END_COLLECTION </dt>
6634<dd class="description">End of collection value</dd>
6635<dt>IPP_TAG_ENUM </dt>
6636<dd class="description">Enumeration value</dd>
6637<dt>IPP_TAG_EVENT_NOTIFICATION </dt>
6638<dd class="description">Event group</dd>
a2326b5b
MS
6639<dt>IPP_TAG_EXTENSION </dt>
6640<dd class="description">Extension point for 32-bit tags</dd>
5a738aea
MS
6641<dt>IPP_TAG_INTEGER </dt>
6642<dd class="description">Integer value</dd>
6643<dt>IPP_TAG_JOB </dt>
6644<dd class="description">Job group</dd>
6645<dt>IPP_TAG_KEYWORD </dt>
6646<dd class="description">Keyword value</dd>
6647<dt>IPP_TAG_LANGUAGE </dt>
6648<dd class="description">Language value</dd>
5a738aea
MS
6649<dt>IPP_TAG_MEMBERNAME </dt>
6650<dd class="description">Collection member name value</dd>
6651<dt>IPP_TAG_MIMETYPE </dt>
6652<dd class="description">MIME media type value</dd>
6653<dt>IPP_TAG_NAME </dt>
6654<dd class="description">Name value</dd>
6655<dt>IPP_TAG_NAMELANG </dt>
6656<dd class="description">Name-with-language value</dd>
6657<dt>IPP_TAG_NOTSETTABLE </dt>
6658<dd class="description">Not-settable value</dd>
6659<dt>IPP_TAG_NOVALUE </dt>
6660<dd class="description">No-value value</dd>
6661<dt>IPP_TAG_OPERATION </dt>
6662<dd class="description">Operation group</dd>
6663<dt>IPP_TAG_PRINTER </dt>
6664<dd class="description">Printer group</dd>
6665<dt>IPP_TAG_RANGE </dt>
6666<dd class="description">Range value</dd>
6667<dt>IPP_TAG_RESOLUTION </dt>
6668<dd class="description">Resolution value</dd>
6669<dt>IPP_TAG_STRING </dt>
6670<dd class="description">Octet string value</dd>
6671<dt>IPP_TAG_SUBSCRIPTION </dt>
6672<dd class="description">Subscription group</dd>
6673<dt>IPP_TAG_TEXT </dt>
6674<dd class="description">Text value</dd>
6675<dt>IPP_TAG_TEXTLANG </dt>
6676<dd class="description">Text-with-language value</dd>
6677<dt>IPP_TAG_UNKNOWN </dt>
6678<dd class="description">Unknown value</dd>
6679<dt>IPP_TAG_UNSUPPORTED_GROUP </dt>
6680<dd class="description">Unsupported attributes group</dd>
6681<dt>IPP_TAG_UNSUPPORTED_VALUE </dt>
6682<dd class="description">Unsupported value</dd>
6683<dt>IPP_TAG_URI </dt>
6684<dd class="description">URI value</dd>
6685<dt>IPP_TAG_URISCHEME </dt>
6686<dd class="description">URI scheme value</dd>
6687<dt>IPP_TAG_ZERO </dt>
6688<dd class="description">Zero tag - used for separators</dd>
6689</dl>
6690</div>
ef416fc2 6691</body>
6692</html>