1<!DOCTYPE html> 2<html lang="en-US"> 3<!-- SECTION: Programming --> 4<head> 5<title>CUPS Programming Manual</title> 6<meta name="keywords" content="Programming"> 7<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> 8<meta name="generator" content="codedoc v3.7"> 9<meta name="author" content="Michael R Sweet"> 10<meta name="language" content="en-US"> 11<meta name="copyright" content="Copyright © 2020-2024 by OpenPrinting. All Rights Reserved."> 12<meta name="version" content="2.4.0"> 13<style type="text/css"><!-- 14body { 15 background: white; 16 color: black; 17 font-family: sans-serif; 18 font-size: 12pt; 19} 20a { 21 color: black; 22} 23a:link, a:visited { 24 color: #00f; 25} 26a:link:hover, a:visited:hover, a:active { 27 color: #c0c; 28} 29body, p, h1, h2, h3, h4, h5, h6 { 30 font-family: sans-serif; 31 line-height: 1.4; 32} 33h1, h2, h3, h4, h5, h6 { 34 font-weight: bold; 35 page-break-inside: avoid; 36} 37h1 { 38 font-size: 250%; 39 margin: 0; 40} 41h2 { 42 font-size: 250%; 43 margin-top: 1.5em; 44} 45h3 { 46 font-size: 200%; 47 margin-bottom: 0.5em; 48 margin-top: 1.5em; 49} 50h4 { 51 font-size: 150%; 52 margin-bottom: 0.5em; 53 margin-top: 1.5em; 54} 55h5 { 56 font-size: 125%; 57 margin-bottom: 0.5em; 58 margin-top: 1.5em; 59} 60h6 { 61 font-size: 110%; 62 margin-bottom: 0.5em; 63 margin-top: 1.5em; 64} 65img.title { 66 width: 256px; 67} 68div.header h1, div.header p { 69 text-align: center; 70} 71div.contents, div.body, div.footer { 72 page-break-before: always; 73} 74.class, .enumeration, .function, .struct, .typedef, .union { 75 border-bottom: solid 2px gray; 76} 77.description { 78 margin-top: 0.5em; 79} 80.function { 81 margin-bottom: 0; 82} 83blockquote { 84 border: solid thin gray; 85 box-shadow: 3px 3px 5px rgba(127,127,127,0.25); 86 margin: 1em 0; 87 padding: 10px; 88 page-break-inside: avoid; 89} 90p code, li code, p.code, pre, ul.code li { 91 font-family: monospace; 92 hyphens: manual; 93 -webkit-hyphens: manual; 94} 95p.code, pre, ul.code li { 96 background: rgba(127,127,127,0.25); 97 border: thin dotted gray; 98 padding: 10px; 99 page-break-inside: avoid; 100} 101pre { 102 white-space: pre-wrap; 103} 104a:link, a:visited { 105 text-decoration: none; 106} 107span.info { 108 background: black; 109 border: solid thin black; 110 color: white; 111 font-size: 80%; 112 font-style: italic; 113 font-weight: bold; 114 white-space: nowrap; 115} 116h1 span.info, h2 span.info, h3 span.info, h4 span.info { 117 border-top-left-radius: 10px; 118 border-top-right-radius: 10px; 119 float: right; 120 padding: 3px 6px; 121} 122ul.code, ul.contents, ul.subcontents { 123 list-style-type: none; 124 margin: 0; 125 padding-left: 0; 126} 127ul.code li { 128 margin: 0; 129} 130ul.contents > li { 131 margin-top: 1em; 132} 133ul.contents li ul.code, ul.contents li ul.subcontents { 134 padding-left: 2em; 135} 136table { 137 border-collapse: collapse; 138 border-spacing: 0; 139} 140td { 141 border: solid 1px gray; 142 padding: 5px 10px; 143 vertical-align: top; 144} 145td.left { 146 text-align: left; 147} 148td.center { 149 text-align: center; 150} 151td.right { 152 text-align: right; 153} 154th { 155 border-bottom: solid 2px gray; 156 padding: 1px 5px; 157 text-align: center; 158 vertical-align: bottom; 159} 160tr:nth-child(even) { 161 background: rgba(127,127,127,0.25); 162} 163table.list { 164 border-collapse: collapse; 165 width: 100%; 166} 167table.list th { 168 border-bottom: none; 169 border-right: 2px solid gray; 170 font-family: monospace; 171 font-weight: normal; 172 padding: 5px 10px 5px 2px; 173 text-align: right; 174 vertical-align: top; 175} 176table.list td { 177 border: none; 178 padding: 5px 2px 5px 10px; 179 text-align: left; 180 vertical-align: top; 181} 182h2.title, h3.title { 183 border-bottom: solid 2px gray; 184} 185/* Syntax highlighting */ 186span.comment { 187 color: darkgreen; 188} 189span.directive { 190 color: purple; 191} 192span.number { 193 color: brown; 194} 195span.reserved { 196 color: darkcyan; 197} 198span.string { 199 color: magenta; 200} 201/* Dark mode overrides */ 202@media (prefers-color-scheme: dark) { 203 body { 204 background: black; 205 color: #ccc; 206 } 207 a { 208 color: #ccc; 209 } 210 a:link, a:visited { 211 color: #66f; 212 } 213 a:link:hover, a:visited:hover, a:active { 214 color: #f06; 215 } 216} 217/* Show contents on left side in web browser */ 218@media screen and (min-width: 800px) { 219 div.contents { 220 border-right: solid thin gray; 221 bottom: 0px; 222 box-shadow: 3px 3px 5px rgba(127,127,127,0.5); 223 font-size: 10pt; 224 left: 0px; 225 overflow: scroll; 226 padding: 1%; 227 position: fixed; 228 top: 0px; 229 width: 18%; 230 } 231 div.contents h2.title { 232 margin-top: 0px; 233 } 234 div.header, div.body, div.footer { 235 margin-left: 20%; 236 padding: 1% 2%; 237 } 238} 239/* Center title page content vertically */ 240@media print { 241 div.header { 242 padding-top: 33%; 243 } 244} 245--></style> 246</head> 247<body> 248<div class="header"> 249<h1 class="title">CUPS Programming Manual</h1> 250<p>Michael R Sweet</p> 251<p>Copyright © 2020-2024 by OpenPrinting. All Rights Reserved.</p> 252</div> 253<div class="contents"> 254<h2 class="title">Contents</h2> 255<ul class="contents"> 256<li><a href="#introduction">Introduction</a><ul class="subcontents"> 257<li><a href="#guidelines">Guidelines</a></li> 258<li><a href="#terms-used-in-this-document">Terms Used in This Document</a></li> 259<li><a href="#compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></li> 260</ul></li> 261<li><a href="#working-with-destinations">Working with Destinations</a><ul class="subcontents"> 262<li><a href="#finding-available-destinations">Finding Available Destinations</a></li> 263<li><a href="#basic-destination-information">Basic Destination Information</a></li> 264<li><a href="#detailed-destination-information">Detailed Destination Information</a></li> 265<li><a href="#submitting-a-print-job">Submitting a Print Job</a></li> 266</ul></li> 267<li><a href="#sending-ipp-requests">Sending IPP Requests</a><ul class="subcontents"> 268<li><a href="#connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</a></li> 269<li><a href="#creating-an-ipp-request">Creating an IPP Request</a></li> 270<li><a href="#sending-the-ipp-request">Sending the IPP Request</a></li> 271<li><a href="#processing-the-ipp-response">Processing the IPP Response</a></li> 272<li><a href="#authentication">Authentication</a></li> 273</ul></li> 274<li><a href="#FUNCTIONS">Functions</a><ul class="subcontents"> 275<li><a href="#cupsAddDest">cupsAddDest</a></li> 276<li><a href="#cupsAddDestMediaOptions">cupsAddDestMediaOptions</a></li> 277<li><a href="#cupsAddIntegerOption">cupsAddIntegerOption</a></li> 278<li><a href="#cupsAddOption">cupsAddOption</a></li> 279<li><a href="#cupsArrayAdd">cupsArrayAdd</a></li> 280<li><a href="#cupsArrayClear">cupsArrayClear</a></li> 281<li><a href="#cupsArrayCount">cupsArrayCount</a></li> 282<li><a href="#cupsArrayCurrent">cupsArrayCurrent</a></li> 283<li><a href="#cupsArrayDelete">cupsArrayDelete</a></li> 284<li><a href="#cupsArrayDup">cupsArrayDup</a></li> 285<li><a href="#cupsArrayFind">cupsArrayFind</a></li> 286<li><a href="#cupsArrayFirst">cupsArrayFirst</a></li> 287<li><a href="#cupsArrayGetIndex">cupsArrayGetIndex</a></li> 288<li><a href="#cupsArrayGetInsert">cupsArrayGetInsert</a></li> 289<li><a href="#cupsArrayIndex">cupsArrayIndex</a></li> 290<li><a href="#cupsArrayInsert">cupsArrayInsert</a></li> 291<li><a href="#cupsArrayLast">cupsArrayLast</a></li> 292<li><a href="#cupsArrayNew">cupsArrayNew</a></li> 293<li><a href="#cupsArrayNew2">cupsArrayNew2</a></li> 294<li><a href="#cupsArrayNew3">cupsArrayNew3</a></li> 295<li><a href="#cupsArrayNext">cupsArrayNext</a></li> 296<li><a href="#cupsArrayPrev">cupsArrayPrev</a></li> 297<li><a href="#cupsArrayRemove">cupsArrayRemove</a></li> 298<li><a href="#cupsArrayRestore">cupsArrayRestore</a></li> 299<li><a href="#cupsArraySave">cupsArraySave</a></li> 300<li><a href="#cupsArrayUserData">cupsArrayUserData</a></li> 301<li><a href="#cupsCancelDestJob">cupsCancelDestJob</a></li> 302<li><a href="#cupsCheckDestSupported">cupsCheckDestSupported</a></li> 303<li><a href="#cupsCloseDestJob">cupsCloseDestJob</a></li> 304<li><a href="#cupsConnectDest">cupsConnectDest</a></li> 305<li><a href="#cupsCopyDest">cupsCopyDest</a></li> 306<li><a href="#cupsCopyDestConflicts">cupsCopyDestConflicts</a></li> 307<li><a href="#cupsCopyDestInfo">cupsCopyDestInfo</a></li> 308<li><a href="#cupsCreateDestJob">cupsCreateDestJob</a></li> 309<li><a href="#cupsDirClose">cupsDirClose</a></li> 310<li><a href="#cupsDirOpen">cupsDirOpen</a></li> 311<li><a href="#cupsDirRead">cupsDirRead</a></li> 312<li><a href="#cupsDirRewind">cupsDirRewind</a></li> 313<li><a href="#cupsDoAuthentication">cupsDoAuthentication</a></li> 314<li><a href="#cupsEncodeOption">cupsEncodeOption</a></li> 315<li><a href="#cupsEncodeOptions">cupsEncodeOptions</a></li> 316<li><a href="#cupsEncodeOptions2">cupsEncodeOptions2</a></li> 317<li><a href="#cupsEncryption">cupsEncryption</a></li> 318<li><a href="#cupsEnumDests">cupsEnumDests</a></li> 319<li><a href="#cupsFileClose">cupsFileClose</a></li> 320<li><a href="#cupsFileCompression">cupsFileCompression</a></li> 321<li><a href="#cupsFileEOF">cupsFileEOF</a></li> 322<li><a href="#cupsFileFind">cupsFileFind</a></li> 323<li><a href="#cupsFileFlush">cupsFileFlush</a></li> 324<li><a href="#cupsFileGetChar">cupsFileGetChar</a></li> 325<li><a href="#cupsFileGetConf">cupsFileGetConf</a></li> 326<li><a href="#cupsFileGetLine">cupsFileGetLine</a></li> 327<li><a href="#cupsFileGets">cupsFileGets</a></li> 328<li><a href="#cupsFileLock">cupsFileLock</a></li> 329<li><a href="#cupsFileNumber">cupsFileNumber</a></li> 330<li><a href="#cupsFileOpen">cupsFileOpen</a></li> 331<li><a href="#cupsFileOpenFd">cupsFileOpenFd</a></li> 332<li><a href="#cupsFilePeekChar">cupsFilePeekChar</a></li> 333<li><a href="#cupsFilePrintf">cupsFilePrintf</a></li> 334<li><a href="#cupsFilePutChar">cupsFilePutChar</a></li> 335<li><a href="#cupsFilePutConf">cupsFilePutConf</a></li> 336<li><a href="#cupsFilePuts">cupsFilePuts</a></li> 337<li><a href="#cupsFileRead">cupsFileRead</a></li> 338<li><a href="#cupsFileRewind">cupsFileRewind</a></li> 339<li><a href="#cupsFileSeek">cupsFileSeek</a></li> 340<li><a href="#cupsFileStderr">cupsFileStderr</a></li> 341<li><a href="#cupsFileStdin">cupsFileStdin</a></li> 342<li><a href="#cupsFileStdout">cupsFileStdout</a></li> 343<li><a href="#cupsFileTell">cupsFileTell</a></li> 344<li><a href="#cupsFileUnlock">cupsFileUnlock</a></li> 345<li><a href="#cupsFileWrite">cupsFileWrite</a></li> 346<li><a href="#cupsFindDestDefault">cupsFindDestDefault</a></li> 347<li><a href="#cupsFindDestReady">cupsFindDestReady</a></li> 348<li><a href="#cupsFindDestSupported">cupsFindDestSupported</a></li> 349<li><a href="#cupsFinishDestDocument">cupsFinishDestDocument</a></li> 350<li><a href="#cupsFreeDestInfo">cupsFreeDestInfo</a></li> 351<li><a href="#cupsFreeDests">cupsFreeDests</a></li> 352<li><a href="#cupsFreeJobs">cupsFreeJobs</a></li> 353<li><a href="#cupsFreeOptions">cupsFreeOptions</a></li> 354<li><a href="#cupsGetDest">cupsGetDest</a></li> 355<li><a href="#cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></li> 356<li><a href="#cupsGetDestMediaByName">cupsGetDestMediaByName</a></li> 357<li><a href="#cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></li> 358<li><a href="#cupsGetDestMediaCount">cupsGetDestMediaCount</a></li> 359<li><a href="#cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></li> 360<li><a href="#cupsGetDestWithURI">cupsGetDestWithURI</a></li> 361<li><a href="#cupsGetDests2">cupsGetDests2</a></li> 362<li><a href="#cupsGetIntegerOption">cupsGetIntegerOption</a></li> 363<li><a href="#cupsGetJobs2">cupsGetJobs2</a></li> 364<li><a href="#cupsGetNamedDest">cupsGetNamedDest</a></li> 365<li><a href="#cupsGetOption">cupsGetOption</a></li> 366<li><a href="#cupsGetPassword2">cupsGetPassword2</a></li> 367<li><a href="#cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></li> 368<li><a href="#cupsLocalizeDestOption">cupsLocalizeDestOption</a></li> 369<li><a href="#cupsLocalizeDestValue">cupsLocalizeDestValue</a></li> 370<li><a href="#cupsMakeServerCredentials">cupsMakeServerCredentials</a></li> 371<li><a href="#cupsParseOptions">cupsParseOptions</a></li> 372<li><a href="#cupsRasterClose">cupsRasterClose</a></li> 373<li><a href="#cupsRasterErrorString">cupsRasterErrorString</a></li> 374<li><a href="#cupsRasterInitPWGHeader">cupsRasterInitPWGHeader</a></li> 375<li><a href="#cupsRasterOpen">cupsRasterOpen</a></li> 376<li><a href="#cupsRasterOpenIO">cupsRasterOpenIO</a></li> 377<li><a href="#cupsRasterReadHeader">cupsRasterReadHeader</a></li> 378<li><a href="#cupsRasterReadHeader2">cupsRasterReadHeader2</a></li> 379<li><a href="#cupsRasterReadPixels">cupsRasterReadPixels</a></li> 380<li><a href="#cupsRasterWriteHeader">cupsRasterWriteHeader</a></li> 381<li><a href="#cupsRasterWriteHeader2">cupsRasterWriteHeader2</a></li> 382<li><a href="#cupsRasterWritePixels">cupsRasterWritePixels</a></li> 383<li><a href="#cupsRemoveDest">cupsRemoveDest</a></li> 384<li><a href="#cupsRemoveOption">cupsRemoveOption</a></li> 385<li><a href="#cupsServer">cupsServer</a></li> 386<li><a href="#cupsSetClientCertCB">cupsSetClientCertCB</a></li> 387<li><a href="#cupsSetCredentials">cupsSetCredentials</a></li> 388<li><a href="#cupsSetDefaultDest">cupsSetDefaultDest</a></li> 389<li><a href="#cupsSetDests2">cupsSetDests2</a></li> 390<li><a href="#cupsSetEncryption">cupsSetEncryption</a></li> 391<li><a href="#cupsSetPasswordCB2">cupsSetPasswordCB2</a></li> 392<li><a href="#cupsSetServer">cupsSetServer</a></li> 393<li><a href="#cupsSetServerCertCB">cupsSetServerCertCB</a></li> 394<li><a href="#cupsSetServerCredentials">cupsSetServerCredentials</a></li> 395<li><a href="#cupsSetUser">cupsSetUser</a></li> 396<li><a href="#cupsSetUserAgent">cupsSetUserAgent</a></li> 397<li><a href="#cupsStartDestDocument">cupsStartDestDocument</a></li> 398<li><a href="#cupsUser">cupsUser</a></li> 399<li><a href="#cupsUserAgent">cupsUserAgent</a></li> 400<li><a href="#httpAcceptConnection">httpAcceptConnection</a></li> 401<li><a href="#httpAddCredential">httpAddCredential</a></li> 402<li><a href="#httpAddrAny">httpAddrAny</a></li> 403<li><a href="#httpAddrClose">httpAddrClose</a></li> 404<li><a href="#httpAddrConnect2">httpAddrConnect2</a></li> 405<li><a href="#httpAddrCopyList">httpAddrCopyList</a></li> 406<li><a href="#httpAddrEqual">httpAddrEqual</a></li> 407<li><a href="#httpAddrFamily">httpAddrFamily</a></li> 408<li><a href="#httpAddrFreeList">httpAddrFreeList</a></li> 409<li><a href="#httpAddrGetList">httpAddrGetList</a></li> 410<li><a href="#httpAddrLength">httpAddrLength</a></li> 411<li><a href="#httpAddrListen">httpAddrListen</a></li> 412<li><a href="#httpAddrLocalhost">httpAddrLocalhost</a></li> 413<li><a href="#httpAddrLookup">httpAddrLookup</a></li> 414<li><a href="#httpAddrPort">httpAddrPort</a></li> 415<li><a href="#httpAddrString">httpAddrString</a></li> 416<li><a href="#httpAssembleURI">httpAssembleURI</a></li> 417<li><a href="#httpAssembleURIf">httpAssembleURIf</a></li> 418<li><a href="#httpAssembleUUID">httpAssembleUUID</a></li> 419<li><a href="#httpBlocking">httpBlocking</a></li> 420<li><a href="#httpCheck">httpCheck</a></li> 421<li><a href="#httpClearCookie">httpClearCookie</a></li> 422<li><a href="#httpClearFields">httpClearFields</a></li> 423<li><a href="#httpClose">httpClose</a></li> 424<li><a href="#httpCompareCredentials">httpCompareCredentials</a></li> 425<li><a href="#httpConnect2">httpConnect2</a></li> 426<li><a href="#httpCopyCredentials">httpCopyCredentials</a></li> 427<li><a href="#httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></li> 428<li><a href="#httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></li> 429<li><a href="#httpCredentialsGetTrust">httpCredentialsGetTrust</a></li> 430<li><a href="#httpCredentialsString">httpCredentialsString</a></li> 431<li><a href="#httpDecode64_2">httpDecode64_2</a></li> 432<li><a href="#httpDelete">httpDelete</a></li> 433<li><a href="#httpEncode64_2">httpEncode64_2</a></li> 434<li><a href="#httpEncryption">httpEncryption</a></li> 435<li><a href="#httpError">httpError</a></li> 436<li><a href="#httpFieldValue">httpFieldValue</a></li> 437<li><a href="#httpFlush">httpFlush</a></li> 438<li><a href="#httpFlushWrite">httpFlushWrite</a></li> 439<li><a href="#httpFreeCredentials">httpFreeCredentials</a></li> 440<li><a href="#httpGet">httpGet</a></li> 441<li><a href="#httpGetActivity">httpGetActivity</a></li> 442<li><a href="#httpGetAddress">httpGetAddress</a></li> 443<li><a href="#httpGetAuthString">httpGetAuthString</a></li> 444<li><a href="#httpGetBlocking">httpGetBlocking</a></li> 445<li><a href="#httpGetContentEncoding">httpGetContentEncoding</a></li> 446<li><a href="#httpGetCookie">httpGetCookie</a></li> 447<li><a href="#httpGetDateString2">httpGetDateString2</a></li> 448<li><a href="#httpGetDateTime">httpGetDateTime</a></li> 449<li><a href="#httpGetEncryption">httpGetEncryption</a></li> 450<li><a href="#httpGetExpect">httpGetExpect</a></li> 451<li><a href="#httpGetFd">httpGetFd</a></li> 452<li><a href="#httpGetField">httpGetField</a></li> 453<li><a href="#httpGetHostname">httpGetHostname</a></li> 454<li><a href="#httpGetKeepAlive">httpGetKeepAlive</a></li> 455<li><a href="#httpGetLength2">httpGetLength2</a></li> 456<li><a href="#httpGetPending">httpGetPending</a></li> 457<li><a href="#httpGetReady">httpGetReady</a></li> 458<li><a href="#httpGetRemaining">httpGetRemaining</a></li> 459<li><a href="#httpGetState">httpGetState</a></li> 460<li><a href="#httpGetStatus">httpGetStatus</a></li> 461<li><a href="#httpGetSubField2">httpGetSubField2</a></li> 462<li><a href="#httpGetVersion">httpGetVersion</a></li> 463<li><a href="#httpGets">httpGets</a></li> 464<li><a href="#httpHead">httpHead</a></li> 465<li><a href="#httpInitialize">httpInitialize</a></li> 466<li><a href="#httpIsChunked">httpIsChunked</a></li> 467<li><a href="#httpIsEncrypted">httpIsEncrypted</a></li> 468<li><a href="#httpLoadCredentials">httpLoadCredentials</a></li> 469<li><a href="#httpOptions">httpOptions</a></li> 470<li><a href="#httpPeek">httpPeek</a></li> 471<li><a href="#httpPost">httpPost</a></li> 472<li><a href="#httpPut">httpPut</a></li> 473<li><a href="#httpRead2">httpRead2</a></li> 474<li><a href="#httpReadRequest">httpReadRequest</a></li> 475<li><a href="#httpReconnect2">httpReconnect2</a></li> 476<li><a href="#httpResolveHostname">httpResolveHostname</a></li> 477<li><a href="#httpSaveCredentials">httpSaveCredentials</a></li> 478<li><a href="#httpSeparateURI">httpSeparateURI</a></li> 479<li><a href="#httpSetAuthString">httpSetAuthString</a></li> 480<li><a href="#httpSetCookie">httpSetCookie</a></li> 481<li><a href="#httpSetCredentials">httpSetCredentials</a></li> 482<li><a href="#httpSetDefaultField">httpSetDefaultField</a></li> 483<li><a href="#httpSetExpect">httpSetExpect</a></li> 484<li><a href="#httpSetField">httpSetField</a></li> 485<li><a href="#httpSetKeepAlive">httpSetKeepAlive</a></li> 486<li><a href="#httpSetLength">httpSetLength</a></li> 487<li><a href="#httpSetTimeout">httpSetTimeout</a></li> 488<li><a href="#httpShutdown">httpShutdown</a></li> 489<li><a href="#httpStateString">httpStateString</a></li> 490<li><a href="#httpStatus">httpStatus</a></li> 491<li><a href="#httpURIStatusString">httpURIStatusString</a></li> 492<li><a href="#httpUpdate">httpUpdate</a></li> 493<li><a href="#httpWait">httpWait</a></li> 494<li><a href="#httpWrite2">httpWrite2</a></li> 495<li><a href="#httpWriteResponse">httpWriteResponse</a></li> 496<li><a href="#ippAddBoolean">ippAddBoolean</a></li> 497<li><a href="#ippAddBooleans">ippAddBooleans</a></li> 498<li><a href="#ippAddCollection">ippAddCollection</a></li> 499<li><a href="#ippAddCollections">ippAddCollections</a></li> 500<li><a href="#ippAddDate">ippAddDate</a></li> 501<li><a href="#ippAddInteger">ippAddInteger</a></li> 502<li><a href="#ippAddIntegers">ippAddIntegers</a></li> 503<li><a href="#ippAddOctetString">ippAddOctetString</a></li> 504<li><a href="#ippAddOutOfBand">ippAddOutOfBand</a></li> 505<li><a href="#ippAddRange">ippAddRange</a></li> 506<li><a href="#ippAddRanges">ippAddRanges</a></li> 507<li><a href="#ippAddResolution">ippAddResolution</a></li> 508<li><a href="#ippAddResolutions">ippAddResolutions</a></li> 509<li><a href="#ippAddSeparator">ippAddSeparator</a></li> 510<li><a href="#ippAddString">ippAddString</a></li> 511<li><a href="#ippAddStringf">ippAddStringf</a></li> 512<li><a href="#ippAddStringfv">ippAddStringfv</a></li> 513<li><a href="#ippAddStrings">ippAddStrings</a></li> 514<li><a href="#ippAttributeString">ippAttributeString</a></li> 515<li><a href="#ippContainsInteger">ippContainsInteger</a></li> 516<li><a href="#ippContainsString">ippContainsString</a></li> 517<li><a href="#ippCopyAttribute">ippCopyAttribute</a></li> 518<li><a href="#ippCopyAttributes">ippCopyAttributes</a></li> 519<li><a href="#ippCreateRequestedArray">ippCreateRequestedArray</a></li> 520<li><a href="#ippDateToTime">ippDateToTime</a></li> 521<li><a href="#ippDelete">ippDelete</a></li> 522<li><a href="#ippDeleteAttribute">ippDeleteAttribute</a></li> 523<li><a href="#ippDeleteValues">ippDeleteValues</a></li> 524<li><a href="#ippEnumString">ippEnumString</a></li> 525<li><a href="#ippEnumValue">ippEnumValue</a></li> 526<li><a href="#ippErrorString">ippErrorString</a></li> 527<li><a href="#ippErrorValue">ippErrorValue</a></li> 528<li><a href="#ippFindAttribute">ippFindAttribute</a></li> 529<li><a href="#ippFindNextAttribute">ippFindNextAttribute</a></li> 530<li><a href="#ippFirstAttribute">ippFirstAttribute</a></li> 531<li><a href="#ippGetBoolean">ippGetBoolean</a></li> 532<li><a href="#ippGetCollection">ippGetCollection</a></li> 533<li><a href="#ippGetCount">ippGetCount</a></li> 534<li><a href="#ippGetDate">ippGetDate</a></li> 535<li><a href="#ippGetGroupTag">ippGetGroupTag</a></li> 536<li><a href="#ippGetInteger">ippGetInteger</a></li> 537<li><a href="#ippGetName">ippGetName</a></li> 538<li><a href="#ippGetOctetString">ippGetOctetString</a></li> 539<li><a href="#ippGetOperation">ippGetOperation</a></li> 540<li><a href="#ippGetRange">ippGetRange</a></li> 541<li><a href="#ippGetRequestId">ippGetRequestId</a></li> 542<li><a href="#ippGetResolution">ippGetResolution</a></li> 543<li><a href="#ippGetState">ippGetState</a></li> 544<li><a href="#ippGetStatusCode">ippGetStatusCode</a></li> 545<li><a href="#ippGetString">ippGetString</a></li> 546<li><a href="#ippGetValueTag">ippGetValueTag</a></li> 547<li><a href="#ippGetVersion">ippGetVersion</a></li> 548<li><a href="#ippLength">ippLength</a></li> 549<li><a href="#ippNew">ippNew</a></li> 550<li><a href="#ippNewRequest">ippNewRequest</a></li> 551<li><a href="#ippNewResponse">ippNewResponse</a></li> 552<li><a href="#ippNextAttribute">ippNextAttribute</a></li> 553<li><a href="#ippOpString">ippOpString</a></li> 554<li><a href="#ippOpValue">ippOpValue</a></li> 555<li><a href="#ippPort">ippPort</a></li> 556<li><a href="#ippRead">ippRead</a></li> 557<li><a href="#ippReadFile">ippReadFile</a></li> 558<li><a href="#ippReadIO">ippReadIO</a></li> 559<li><a href="#ippSetBoolean">ippSetBoolean</a></li> 560<li><a href="#ippSetCollection">ippSetCollection</a></li> 561<li><a href="#ippSetDate">ippSetDate</a></li> 562<li><a href="#ippSetGroupTag">ippSetGroupTag</a></li> 563<li><a href="#ippSetInteger">ippSetInteger</a></li> 564<li><a href="#ippSetName">ippSetName</a></li> 565<li><a href="#ippSetOctetString">ippSetOctetString</a></li> 566<li><a href="#ippSetOperation">ippSetOperation</a></li> 567<li><a href="#ippSetPort">ippSetPort</a></li> 568<li><a href="#ippSetRange">ippSetRange</a></li> 569<li><a href="#ippSetRequestId">ippSetRequestId</a></li> 570<li><a href="#ippSetResolution">ippSetResolution</a></li> 571<li><a href="#ippSetState">ippSetState</a></li> 572<li><a href="#ippSetStatusCode">ippSetStatusCode</a></li> 573<li><a href="#ippSetString">ippSetString</a></li> 574<li><a href="#ippSetStringf">ippSetStringf</a></li> 575<li><a href="#ippSetStringfv">ippSetStringfv</a></li> 576<li><a href="#ippSetValueTag">ippSetValueTag</a></li> 577<li><a href="#ippSetVersion">ippSetVersion</a></li> 578<li><a href="#ippStateString">ippStateString</a></li> 579<li><a href="#ippTagString">ippTagString</a></li> 580<li><a href="#ippTagValue">ippTagValue</a></li> 581<li><a href="#ippTimeToDate">ippTimeToDate</a></li> 582<li><a href="#ippValidateAttribute">ippValidateAttribute</a></li> 583<li><a href="#ippValidateAttributes">ippValidateAttributes</a></li> 584<li><a href="#ippWrite">ippWrite</a></li> 585<li><a href="#ippWriteFile">ippWriteFile</a></li> 586<li><a href="#ippWriteIO">ippWriteIO</a></li> 587</ul></li> 588<li><a href="#TYPES">Data Types</a><ul class="subcontents"> 589<li><a href="#cups_acopy_func_t">cups_acopy_func_t</a></li> 590<li><a href="#cups_adv_t">cups_adv_t</a></li> 591<li><a href="#cups_afree_func_t">cups_afree_func_t</a></li> 592<li><a href="#cups_ahash_func_t">cups_ahash_func_t</a></li> 593<li><a href="#cups_array_func_t">cups_array_func_t</a></li> 594<li><a href="#cups_array_t">cups_array_t</a></li> 595<li><a href="#cups_bool_t">cups_bool_t</a></li> 596<li><a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a></li> 597<li><a href="#cups_cspace_t">cups_cspace_t</a></li> 598<li><a href="#cups_cut_t">cups_cut_t</a></li> 599<li><a href="#cups_dentry_t">cups_dentry_t</a></li> 600<li><a href="#cups_dest_cb_t">cups_dest_cb_t</a></li> 601<li><a href="#cups_dest_t">cups_dest_t</a></li> 602<li><a href="#cups_dinfo_t">cups_dinfo_t</a></li> 603<li><a href="#cups_dir_t">cups_dir_t</a></li> 604<li><a href="#cups_edge_t">cups_edge_t</a></li> 605<li><a href="#cups_file_t">cups_file_t</a></li> 606<li><a href="#cups_job_t">cups_job_t</a></li> 607<li><a href="#cups_jog_t">cups_jog_t</a></li> 608<li><a href="#cups_mode_t">cups_mode_t</a></li> 609<li><a href="#cups_option_t">cups_option_t</a></li> 610<li><a href="#cups_order_t">cups_order_t</a></li> 611<li><a href="#cups_orient_t">cups_orient_t</a></li> 612<li><a href="#cups_page_header2_t">cups_page_header2_t</a></li> 613<li><a href="#cups_page_header_t">cups_page_header_t</a></li> 614<li><a href="#cups_password_cb2_t">cups_password_cb2_t</a></li> 615<li><a href="#cups_ptype_t">cups_ptype_t</a></li> 616<li><a href="#cups_raster_iocb_t">cups_raster_iocb_t</a></li> 617<li><a href="#cups_raster_t">cups_raster_t</a></li> 618<li><a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a></li> 619<li><a href="#cups_size_t">cups_size_t</a></li> 620<li><a href="#http_addr_t">http_addr_t</a></li> 621<li><a href="#http_encoding_t">http_encoding_t</a></li> 622<li><a href="#http_encryption_t">http_encryption_t</a></li> 623<li><a href="#http_field_t">http_field_t</a></li> 624<li><a href="#http_keepalive_t">http_keepalive_t</a></li> 625<li><a href="#http_state_t">http_state_t</a></li> 626<li><a href="#http_t">http_t</a></li> 627<li><a href="#http_timeout_cb_t">http_timeout_cb_t</a></li> 628<li><a href="#http_trust_t">http_trust_t</a></li> 629<li><a href="#http_uri_coding_t">http_uri_coding_t</a></li> 630<li><a href="#http_uri_status_t">http_uri_status_t</a></li> 631<li><a href="#ipp_attribute_t">ipp_attribute_t</a></li> 632<li><a href="#ipp_copycb_t">ipp_copycb_t</a></li> 633<li><a href="#ipp_iocb_t">ipp_iocb_t</a></li> 634<li><a href="#ipp_orient_t">ipp_orient_t</a></li> 635<li><a href="#ipp_pstate_t">ipp_pstate_t</a></li> 636<li><a href="#ipp_quality_t">ipp_quality_t</a></li> 637<li><a href="#ipp_res_t">ipp_res_t</a></li> 638<li><a href="#ipp_rstate_t">ipp_rstate_t</a></li> 639<li><a href="#ipp_sstate_t">ipp_sstate_t</a></li> 640<li><a href="#ipp_state_t">ipp_state_t</a></li> 641<li><a href="#ipp_t">ipp_t</a></li> 642<li><a href="#pwg_media_t">pwg_media_t</a></li> 643</ul></li> 644<li><a href="#STRUCTURES">Structures</a><ul class="subcontents"> 645<li><a href="#cups_dentry_s">cups_dentry_s</a></li> 646<li><a href="#cups_dest_s">cups_dest_s</a></li> 647<li><a href="#cups_job_s">cups_job_s</a></li> 648<li><a href="#cups_option_s">cups_option_s</a></li> 649<li><a href="#cups_page_header2_s">cups_page_header2_s</a></li> 650<li><a href="#cups_page_header_s">cups_page_header_s</a></li> 651<li><a href="#cups_size_s">cups_size_s</a></li> 652<li><a href="#pwg_media_s">pwg_media_s</a></li> 653</ul></li> 654<li><a href="#ENUMERATIONS">Enumerations</a><ul class="subcontents"> 655<li><a href="#cups_adv_e">cups_adv_e</a></li> 656<li><a href="#cups_bool_e">cups_bool_e</a></li> 657<li><a href="#cups_cspace_e">cups_cspace_e</a></li> 658<li><a href="#cups_cut_e">cups_cut_e</a></li> 659<li><a href="#cups_edge_e">cups_edge_e</a></li> 660<li><a href="#cups_jog_e">cups_jog_e</a></li> 661<li><a href="#cups_mode_e">cups_mode_e</a></li> 662<li><a href="#cups_order_e">cups_order_e</a></li> 663<li><a href="#cups_orient_e">cups_orient_e</a></li> 664<li><a href="#cups_ptype_e">cups_ptype_e</a></li> 665<li><a href="#http_encoding_e">http_encoding_e</a></li> 666<li><a href="#http_encryption_e">http_encryption_e</a></li> 667<li><a href="#http_field_e">http_field_e</a></li> 668<li><a href="#http_keepalive_e">http_keepalive_e</a></li> 669<li><a href="#http_state_e">http_state_e</a></li> 670<li><a href="#http_status_e">http_status_e</a></li> 671<li><a href="#http_trust_e">http_trust_e</a></li> 672<li><a href="#http_uri_coding_e">http_uri_coding_e</a></li> 673<li><a href="#http_uri_status_e">http_uri_status_e</a></li> 674<li><a href="#ipp_finishings_e">ipp_finishings_e</a></li> 675<li><a href="#ipp_jstate_e">ipp_jstate_e</a></li> 676<li><a href="#ipp_op_e">ipp_op_e</a></li> 677<li><a href="#ipp_orient_e">ipp_orient_e</a></li> 678<li><a href="#ipp_pstate_e">ipp_pstate_e</a></li> 679<li><a href="#ipp_quality_e">ipp_quality_e</a></li> 680<li><a href="#ipp_res_e">ipp_res_e</a></li> 681<li><a href="#ipp_rstate_e">ipp_rstate_e</a></li> 682<li><a href="#ipp_sstate_e">ipp_sstate_e</a></li> 683<li><a href="#ipp_state_e">ipp_state_e</a></li> 684<li><a href="#ipp_status_e">ipp_status_e</a></li> 685<li><a href="#ipp_tag_e">ipp_tag_e</a></li> 686</ul></li> 687</ul> 688</div> 689<div class="body"> 690<blockquote> 691<p>Please <a href="https://github.com/openprinting/cups/issues">file issues on GitHub</a> to provide feedback on this document.</p> 692</blockquote> 693<h2 class="title" id="introduction">Introduction</h2> 694<p>CUPS provides the "cups" library to talk to the different parts of CUPS and with Internet Printing Protocol (IPP) printers. The "cups" library functions are accessed by including the <code><cups/cups.h></code> header.</p> 695<p>CUPS is based on the Internet Printing Protocol ("IPP"), which allows clients (applications) to communicate with a server (the scheduler, printers, etc.) to get a list of destinations, send print jobs, and so forth. You identify which server you want to communicate with using a pointer to the opaque structure <code>http_t</code>. The <code>CUPS_HTTP_DEFAULT</code> constant can be used when you want to talk to the CUPS scheduler.</p> 696<h3 class="title" id="guidelines">Guidelines</h3> 697<p>When writing software (other than printer drivers) that uses the "cups" library:</p> 698<ul> 699<li><p>Do not use undocumented or deprecated APIs,</p> 700</li> 701<li><p>Do not rely on pre-configured printers,</p> 702</li> 703<li><p>Do not assume that printers support specific features or formats, and</p> 704</li> 705<li><p>Do not rely on implementation details (PPDs, etc.)</p> 706</li> 707</ul> 708<p>CUPS is designed to insulate users and developers from the implementation details of printers and file formats. The goal is to allow an application to supply a print file in a standard format with the user intent ("print four copies, two-sided on A4 media, and staple each copy") and have the printing system manage the printer communication and format conversion needed.</p> 709<p>Similarly, printer and job management applications can use standard query operations to obtain the status information in a common, generic form and use standard management operations to control the state of those printers and jobs.</p> 710<blockquote> 711<p><strong>Note:</strong></p> 712<p>CUPS printer drivers necessarily depend on specific file formats and certain implementation details of the CUPS software. Please consult the Postscript and raster printer driver developer documentation on the <a href="https://openprinting.github.io/cups">OpenPrinting CUPS website</a> for more information.</p> 713</blockquote> 714<h3 class="title" id="terms-used-in-this-document">Terms Used in This Document</h3> 715<p>A <em>Destination</em> is a printer or print queue that accepts print jobs. A <em>Print Job</em> is a collection of one or more documents that are processed by a destination using options supplied when creating the job. A <em>Document</em> is a file (JPEG image, PDF file, etc.) suitable for printing. An <em>Option</em> controls some aspect of printing, such as the media used. <em>Media</em> is the sheets or roll that is printed on. An <em>Attribute</em> is an option encoded for an Internet Printing Protocol (IPP) request.</p> 716<h3 class="title" id="compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</h3> 717<p>The CUPS libraries can be used from any C, C++, or Objective-C program. The method of compiling against the libraries varies depending on the operating system and installation of CUPS. The following sections show how to compile a simple program (shown below) in two common environments.</p> 718<p>The following simple program lists the available destinations:</p> 719<pre><code>#include <stdio.h> 720#include <cups/cups.h> 721 722int print_dest(void *user_data, unsigned flags, cups_dest_t *dest) 723{ 724 if (dest->instance) 725 printf("%s/%s\n", dest->name, dest->instance); 726 else 727 puts(dest->name); 728 729 return (1); 730} 731 732int main(void) 733{ 734 cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, 0, 0, print_dest, NULL); 735 736 return (0); 737} 738</code></pre> 739<h4 id="compiling-with-xcode">Compiling with Xcode</h4> 740<p>In Xcode, choose <em>New Project...</em> from the <em>File</em> menu (or press SHIFT+CMD+N), then select the <em>Command Line Tool</em> under the macOS Application project type. Click <em>Next</em> and enter a name for the project, for example "firstcups". Click <em>Next</em> and choose a project directory. The click <em>Next</em> to create the project.</p> 741<p>In the project window, click on the <em>Build Phases</em> group and expand the <em>Link Binary with Libraries</em> section. Click <em>+</em>, type "libcups" to show the library, and then double-click on <code>libcups.tbd</code>.</p> 742<p>Finally, click on the <code>main.c</code> file in the sidebar and copy the example program to the file. Build and run (CMD+R) to see the list of destinations.</p> 743<h4 id="compiling-with-gcc">Compiling with GCC</h4> 744<p>From the command-line, create a file called <code>simple.c</code> using your favorite editor, copy the example to this file, and save. Then run the following command to compile it with GCC and run it:</p> 745<pre><code>gcc -o simple `cups-config --cflags` simple.c `cups-config --libs` 746./simple 747</code></pre> 748<p>The <code>cups-config</code> command provides the compiler flags (<code>cups-config --cflags</code>) and libraries (<code>cups-config --libs</code>) needed for the local system.</p> 749<h2 class="title" id="working-with-destinations">Working with Destinations</h2> 750<p>Destinations, which in CUPS represent individual printers or classes (collections or pools) of printers, are represented by the <code>cups_dest_t</code> structure which includes the name (<code>name</code>), instance (<code>instance</code>, saved options/settings), whether the destination is the default for the user (<code>is_default</code>), and the options and basic information associated with that destination (<code>num_options</code> and <code>options</code>).</p> 751<p>Historically destinations have been manually maintained by the administrator of a system or network, but CUPS also supports dynamic discovery of destinations on the current network.</p> 752<h3 class="title" id="finding-available-destinations">Finding Available Destinations</h3> 753<p>The <code>cupsEnumDests</code> function finds all of the available destinations:</p> 754<pre><code> int 755 cupsEnumDests(unsigned flags, int msec, int *cancel, 756 cups_ptype_t type, cups_ptype_t mask, 757 cups_dest_cb_t cb, void *user_data) 758</code></pre> 759<p>The <code>flags</code> argument specifies enumeration options, which at present must be <code>CUPS_DEST_FLAGS_NONE</code>.</p> 760<p>The <code>msec</code> argument specifies the maximum amount of time that should be used for enumeration in milliseconds - interactive applications should keep this value to 5000 or less when run on the main thread.</p> 761<p>The <code>cancel</code> argument points to an integer variable that, when set to a non-zero value, will cause enumeration to stop as soon as possible. It can be <code>NULL</code> if not needed.</p> 762<p>The <code>type</code> and <code>mask</code> arguments are bitfields that allow the caller to filter the destinations based on categories and/or capabilities. The destination's "printer-type" value is masked by the <code>mask</code> value and compared to the <code>type</code> value when filtering. For example, to only enumerate destinations that are hosted on the local system, pass <code>CUPS_PRINTER_LOCAL</code> for the <code>type</code> argument and <code>CUPS_PRINTER_DISCOVERED</code> for the <code>mask</code> argument. The following constants can be used for filtering:</p> 763<ul> 764<li><p><code>CUPS_PRINTER_CLASS</code>: A collection of destinations.</p> 765</li> 766<li><p><code>CUPS_PRINTER_FAX</code>: A facsimile device.</p> 767</li> 768<li><p><code>CUPS_PRINTER_LOCAL</code>: A local printer or class. This constant has the value 0 (no bits set) and is only used for the <code>type</code> argument and is paired with the <code>CUPS_PRINTER_REMOTE</code> or <code>CUPS_PRINTER_DISCOVERED</code> constant passed in the <code>mask</code> argument.</p> 769</li> 770<li><p><code>CUPS_PRINTER_REMOTE</code>: A remote (shared) printer or class.</p> 771</li> 772<li><p><code>CUPS_PRINTER_DISCOVERED</code>: An available network printer or class.</p> 773</li> 774<li><p><code>CUPS_PRINTER_BW</code>: Can do B&W printing.</p> 775</li> 776<li><p><code>CUPS_PRINTER_COLOR</code>: Can do color printing.</p> 777</li> 778<li><p><code>CUPS_PRINTER_DUPLEX</code>: Can do two-sided printing.</p> 779</li> 780<li><p><code>CUPS_PRINTER_STAPLE</code>: Can staple output.</p> 781</li> 782<li><p><code>CUPS_PRINTER_COLLATE</code>: Can quickly collate copies.</p> 783</li> 784<li><p><code>CUPS_PRINTER_PUNCH</code>: Can punch output.</p> 785</li> 786<li><p><code>CUPS_PRINTER_COVER</code>: Can cover output.</p> 787</li> 788<li><p><code>CUPS_PRINTER_BIND</code>: Can bind output.</p> 789</li> 790<li><p><code>CUPS_PRINTER_SORT</code>: Can sort output (mailboxes, etc.)</p> 791</li> 792<li><p><code>CUPS_PRINTER_SMALL</code>: Can print on Letter/Legal/A4-size media.</p> 793</li> 794<li><p><code>CUPS_PRINTER_MEDIUM</code>: Can print on Tabloid/B/C/A3/A2-size media.</p> 795</li> 796<li><p><code>CUPS_PRINTER_LARGE</code>: Can print on D/E/A1/A0-size media.</p> 797</li> 798<li><p><code>CUPS_PRINTER_VARIABLE</code>: Can print on rolls and custom-size media.</p> 799</li> 800</ul> 801<p>The <code>cb</code> argument specifies a function to call for every destination that is found:</p> 802<pre><code>typedef int (*cups_dest_cb_t)(void *user_data, 803 unsigned flags, 804 cups_dest_t *dest); 805</code></pre> 806<p>The callback function receives a copy of the <code>user_data</code> argument along with a bitfield (<code>flags</code>) and the destination that was found. The <code>flags</code> argument can have any of the following constant (bit) values set:</p> 807<ul> 808<li><p><code>CUPS_DEST_FLAGS_MORE</code>: There are more destinations coming.</p> 809</li> 810<li><p><code>CUPS_DEST_FLAGS_REMOVED</code>: The destination has gone away and should be removed from the list of destinations a user can select.</p> 811</li> 812<li><p><code>CUPS_DEST_FLAGS_ERROR</code>: An error occurred. The reason for the error can be found by calling the <code>cupsLastError</code> and/or <code>cupsLastErrorString</code> functions.</p> 813</li> 814</ul> 815<p>The callback function returns 0 to stop enumeration or 1 to continue.</p> 816<blockquote> 817<p><strong>Note:</strong></p> 818<p>The callback function will likely be called multiple times for the same destination, so it is up to the caller to suppress any duplicate destinations.</p> 819</blockquote> 820<p>The following example shows how to use <code>cupsEnumDests</code> to get a filtered array of destinations:</p> 821<pre><code>typedef struct 822{ 823 int num_dests; 824 cups_dest_t *dests; 825} my_user_data_t; 826 827int 828my_dest_cb(my_user_data_t *user_data, unsigned flags, 829 cups_dest_t *dest) 830{ 831 if (flags & CUPS_DEST_FLAGS_REMOVED) 832 { 833 /* 834 * Remove destination from array... 835 */ 836 837 user_data->num_dests = 838 cupsRemoveDest(dest->name, dest->instance, 839 user_data->num_dests, 840 &(user_data->dests)); 841 } 842 else 843 { 844 /* 845 * Add destination to array... 846 */ 847 848 user_data->num_dests = 849 cupsCopyDest(dest, user_data->num_dests, 850 &(user_data->dests)); 851 } 852 853 return (1); 854} 855 856int 857my_get_dests(cups_ptype_t type, cups_ptype_t mask, 858 cups_dest_t **dests) 859{ 860 my_user_data_t user_data = { 0, NULL }; 861 862 if (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, type, 863 mask, (cups_dest_cb_t)my_dest_cb, 864 &user_data)) 865 { 866 /* 867 * An error occurred, free all of the destinations and 868 * return... 869 */ 870 871 cupsFreeDests(user_data.num_dests, user_data.dests); 872 873 *dests = NULL; 874 875 return (0); 876 } 877 878 /* 879 * Return the destination array... 880 */ 881 882 *dests = user_data.dests; 883 884 return (user_data.num_dests); 885} 886</code></pre> 887<h3 class="title" id="basic-destination-information">Basic Destination Information</h3> 888<p>The <code>num_options</code> and <code>options</code> members of the <code>cups_dest_t</code> structure provide basic attributes about the destination in addition to the user default options and values for that destination. The following names are predefined for various destination attributes:</p> 889<ul> 890<li><p>"auth-info-required": The type of authentication required for printing to this destination: "none", "username,password", "domain,username,password", or "negotiate" (Kerberos).</p> 891</li> 892<li><p>"printer-info": The human-readable description of the destination such as "My Laser Printer".</p> 893</li> 894<li><p>"printer-is-accepting-jobs": "true" if the destination is accepting new jobs, "false" otherwise.</p> 895</li> 896<li><p>"printer-is-shared": "true" if the destination is being shared with other computers, "false" otherwise.</p> 897</li> 898<li><p>"printer-location": The human-readable location of the destination such as "Lab 4".</p> 899</li> 900<li><p>"printer-make-and-model": The human-readable make and model of the destination such as "ExampleCorp LaserPrinter 4000 Series".</p> 901</li> 902<li><p>"printer-state": "3" if the destination is idle, "4" if the destination is printing a job, and "5" if the destination is stopped.</p> 903</li> 904<li><p>"printer-state-change-time": The UNIX time when the destination entered the current state.</p> 905</li> 906<li><p>"printer-state-reasons": Additional comma-delimited state keywords for the destination such as "media-tray-empty-error" and "toner-low-warning".</p> 907</li> 908<li><p>"printer-type": The <code>cups_ptype_t</code> value associated with the destination.</p> 909</li> 910<li><p>"printer-uri-supported": The URI associated with the destination; if not set, this destination was discovered but is not yet setup as a local printer.</p> 911</li> 912</ul> 913<p>Use the <code>cupsGetOption</code> function to retrieve the value. For example, the following code gets the make and model of a destination:</p> 914<pre><code>const char *model = cupsGetOption("printer-make-and-model", 915 dest->num_options, 916 dest->options); 917</code></pre> 918<h3 class="title" id="detailed-destination-information">Detailed Destination Information</h3> 919<p>Once a destination has been chosen, the <code>cupsCopyDestInfo</code> function can be used to gather detailed information about the destination:</p> 920<pre><code>cups_dinfo_t * 921cupsCopyDestInfo(http_t *http, cups_dest_t *dest); 922</code></pre> 923<p>The <code>http</code> argument specifies a connection to the CUPS scheduler and is typically the constant <code>CUPS_HTTP_DEFAULT</code>. The <code>dest</code> argument specifies the destination to query.</p> 924<p>The <code>cups_dinfo_t</code> structure that is returned contains a snapshot of the supported options and their supported, ready, and default values. It also can report constraints between different options and values, and recommend changes to resolve those constraints.</p> 925<h4 id="getting-supported-options-and-values">Getting Supported Options and Values</h4> 926<p>The <code>cupsCheckDestSupported</code> function can be used to test whether a particular option or option and value is supported:</p> 927<pre><code>int 928cupsCheckDestSupported(http_t *http, cups_dest_t *dest, 929 cups_dinfo_t *info, 930 const char *option, 931 const char *value); 932</code></pre> 933<p>The <code>option</code> argument specifies the name of the option to check. The following constants can be used to check the various standard options:</p> 934<ul> 935<li><p><code>CUPS_COPIES</code>: Controls the number of copies that are produced.</p> 936</li> 937<li><p><code>CUPS_FINISHINGS</code>: A comma-delimited list of integer constants that control the finishing processes that are applied to the job, including stapling, punching, and folding.</p> 938</li> 939<li><p><code>CUPS_MEDIA</code>: Controls the media size that is used, typically one of the following: <code>CUPS_MEDIA_3X5</code>, <code>CUPS_MEDIA_4X6</code>, <code>CUPS_MEDIA_5X7</code>, <code>CUPS_MEDIA_8X10</code>, <code>CUPS_MEDIA_A3</code>, <code>CUPS_MEDIA_A4</code>, <code>CUPS_MEDIA_A5</code>, <code>CUPS_MEDIA_A6</code>, <code>CUPS_MEDIA_ENV10</code>, <code>CUPS_MEDIA_ENVDL</code>, <code>CUPS_MEDIA_LEGAL</code>, <code>CUPS_MEDIA_LETTER</code>, <code>CUPS_MEDIA_PHOTO_L</code>, <code>CUPS_MEDIA_SUPERBA3</code>, or <code>CUPS_MEDIA_TABLOID</code>.</p> 940</li> 941<li><p><code>CUPS_MEDIA_SOURCE</code>: Controls where the media is pulled from, typically either <code>CUPS_MEDIA_SOURCE_AUTO</code> or <code>CUPS_MEDIA_SOURCE_MANUAL</code>.</p> 942</li> 943<li><p><code>CUPS_MEDIA_TYPE</code>: Controls the type of media that is used, typically one of the following: <code>CUPS_MEDIA_TYPE_AUTO</code>, <code>CUPS_MEDIA_TYPE_ENVELOPE</code>, <code>CUPS_MEDIA_TYPE_LABELS</code>, <code>CUPS_MEDIA_TYPE_LETTERHEAD</code>, <code>CUPS_MEDIA_TYPE_PHOTO</code>, <code>CUPS_MEDIA_TYPE_PHOTO_GLOSSY</code>, <code>CUPS_MEDIA_TYPE_PHOTO_MATTE</code>, <code>CUPS_MEDIA_TYPE_PLAIN</code>, or <code>CUPS_MEDIA_TYPE_TRANSPARENCY</code>.</p> 944</li> 945<li><p><code>CUPS_NUMBER_UP</code>: Controls the number of document pages that are placed on each media side.</p> 946</li> 947<li><p><code>CUPS_ORIENTATION</code>: Controls the orientation of document pages placed on the media: <code>CUPS_ORIENTATION_PORTRAIT</code> or <code>CUPS_ORIENTATION_LANDSCAPE</code>.</p> 948</li> 949<li><p><code>CUPS_PRINT_COLOR_MODE</code>: Controls whether the output is in color (<code>CUPS_PRINT_COLOR_MODE_COLOR</code>), grayscale (<code>CUPS_PRINT_COLOR_MODE_MONOCHROME</code>), or either (<code>CUPS_PRINT_COLOR_MODE_AUTO</code>).</p> 950</li> 951<li><p><code>CUPS_PRINT_QUALITY</code>: Controls the generate quality of the output: <code>CUPS_PRINT_QUALITY_DRAFT</code>, <code>CUPS_PRINT_QUALITY_NORMAL</code>, or <code>CUPS_PRINT_QUALITY_HIGH</code>.</p> 952</li> 953<li><p><code>CUPS_SIDES</code>: Controls whether prints are placed on one or both sides of the media: <code>CUPS_SIDES_ONE_SIDED</code>, <code>CUPS_SIDES_TWO_SIDED_PORTRAIT</code>, or <code>CUPS_SIDES_TWO_SIDED_LANDSCAPE</code>.</p> 954</li> 955</ul> 956<p>If the <code>value</code> argument is <code>NULL</code>, the <code>cupsCheckDestSupported</code> function returns whether the option is supported by the destination. Otherwise, the function returns whether the specified value of the option is supported.</p> 957<p>The <code>cupsFindDestSupported</code> function returns the IPP attribute containing the supported values for a given option:</p> 958<pre><code> ipp_attribute_t * 959 cupsFindDestSupported(http_t *http, cups_dest_t *dest, 960 cups_dinfo_t *dinfo, 961 const char *option); 962</code></pre> 963<p>For example, the following code prints the supported finishing processes for a destination, if any, to the standard output:</p> 964<pre><code>cups_dinfo_t *info = cupsCopyDestInfo(CUPS_HTTP_DEFAULT, 965 dest); 966 967if (cupsCheckDestSupported(CUPS_HTTP_DEFAULT, dest, info, 968 CUPS_FINISHINGS, NULL)) 969{ 970 ipp_attribute_t *finishings = 971 cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info, 972 CUPS_FINISHINGS); 973 int i, count = ippGetCount(finishings); 974 975 puts("finishings supported:"); 976 for (i = 0; i < count; i ++) 977 printf(" %d\n", ippGetInteger(finishings, i)); 978} 979else 980 puts("finishings not supported."); 981</code></pre> 982<p>The "job-creation-attributes" option can be queried to get a list of supported options. For example, the following code prints the list of supported options to the standard output:</p> 983<pre><code>ipp_attribute_t *attrs = 984 cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info, 985 "job-creation-attributes"); 986int i, count = ippGetCount(attrs); 987 988for (i = 0; i < count; i ++) 989 puts(ippGetString(attrs, i, NULL)); 990</code></pre> 991<h4 id="getting-default-values">Getting Default Values</h4> 992<p>There are two sets of default values - user defaults that are available via the <code>num_options</code> and <code>options</code> members of the <code>cups_dest_t</code> structure, and destination defaults that available via the <code>cups_dinfo_t</code> structure and the <code>cupsFindDestDefault</code> function which returns the IPP attribute containing the default value(s) for a given option:</p> 993<pre><code>ipp_attribute_t * 994cupsFindDestDefault(http_t *http, cups_dest_t *dest, 995 cups_dinfo_t *dinfo, 996 const char *option); 997</code></pre> 998<p>The user defaults from <code>cupsGetOption</code> should always take preference over the destination defaults. For example, the following code prints the default finishings value(s) to the standard output:</p> 999<pre><code>const char *def_value = 1000 cupsGetOption(CUPS_FINISHINGS, dest->num_options, 1001 dest->options); 1002ipp_attribute_t *def_attr = 1003 cupsFindDestDefault(CUPS_HTTP_DEFAULT, dest, info, 1004 CUPS_FINISHINGS); 1005 1006if (def_value != NULL) 1007{ 1008 printf("Default finishings: %s\n", def_value); 1009} 1010else 1011{ 1012 int i, count = ippGetCount(def_attr); 1013 1014 printf("Default finishings: %d", 1015 ippGetInteger(def_attr, 0)); 1016 for (i = 1; i < count; i ++) 1017 printf(",%d", ippGetInteger(def_attr, i)); 1018 putchar('\n'); 1019} 1020</code></pre> 1021<h4 id="getting-ready-loaded-values">Getting Ready (Loaded) Values</h4> 1022<p>The finishings and media options also support queries for the ready, or loaded, values. For example, a printer may have punch and staple finishers installed but be out of staples - the supported values will list both punch and staple finishing processes but the ready values will only list the punch processes. Similarly, a printer may support hundreds of different sizes of media but only have a single size loaded at any given time - the ready values are limited to the media that is actually in the printer.</p> 1023<p>The <code>cupsFindDestReady</code> function finds the IPP attribute containing the ready values for a given option:</p> 1024<pre><code>ipp_attribute_t * 1025cupsFindDestReady(http_t *http, cups_dest_t *dest, 1026 cups_dinfo_t *dinfo, const char *option); 1027</code></pre> 1028<p>For example, the following code lists the ready finishing processes:</p> 1029<pre><code>ipp_attribute_t *ready_finishings = 1030 cupsFindDestReady(CUPS_HTTP_DEFAULT, dest, info, 1031 CUPS_FINISHINGS); 1032 1033if (ready_finishings != NULL) 1034{ 1035 int i, count = ippGetCount(ready_finishings); 1036 1037 puts("finishings ready:"); 1038 for (i = 0; i < count; i ++) 1039 printf(" %d\n", ippGetInteger(ready_finishings, i)); 1040} 1041else 1042 puts("no finishings are ready."); 1043</code></pre> 1044<h4 id="media-size-options">Media Size Options</h4> 1045<p>CUPS provides functions for querying the dimensions and margins for each of the supported media size options. The <code>cups_size_t</code> structure is used to describe a media size:</p> 1046<pre><code>typedef struct cups_size_s 1047{ 1048 char media[128]; 1049 int width, length; 1050 int bottom, left, right, top; 1051} cups_size_t; 1052</code></pre> 1053<p>The <code>width</code> and <code>length</code> members specify the dimensions of the media in hundredths of millimeters (1/2540th of an inch). The <code>bottom</code>, <code>left</code>, <code>right</code>, and <code>top</code> members specify the margins of the printable area, also in hundredths of millimeters.</p> 1054<p>The <code>cupsGetDestMediaByName</code> and <code>cupsGetDestMediaBySize</code> functions lookup the media size information using a standard media size name or dimensions in hundredths of millimeters:</p> 1055<pre><code>int 1056cupsGetDestMediaByName(http_t *http, cups_dest_t *dest, 1057 cups_dinfo_t *dinfo, 1058 const char *media, 1059 unsigned flags, cups_size_t *size); 1060 1061int 1062cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest, 1063 cups_dinfo_t *dinfo, 1064 int width, int length, 1065 unsigned flags, cups_size_t *size); 1066</code></pre> 1067<p>The <code>media</code>, <code>width</code>, and <code>length</code> arguments specify the size to lookup. The <code>flags</code> argument specifies a bitfield controlling various lookup options:</p> 1068<ul> 1069<li><p><code>CUPS_MEDIA_FLAGS_DEFAULT</code>: Find the closest size supported by the printer.</p> 1070</li> 1071<li><p><code>CUPS_MEDIA_FLAGS_BORDERLESS</code>: Find a borderless size.</p> 1072</li> 1073<li><p><code>CUPS_MEDIA_FLAGS_DUPLEX</code>: Find a size compatible with two-sided printing.</p> 1074</li> 1075<li><p><code>CUPS_MEDIA_FLAGS_EXACT</code>: Find an exact match for the size.</p> 1076</li> 1077<li><p><code>CUPS_MEDIA_FLAGS_READY</code>: If the printer supports media sensing or configuration of the media in each tray/source, find the size amongst the "ready" media.</p> 1078</li> 1079</ul> 1080<p>If a matching size is found for the destination, the size information is stored in the structure pointed to by the <code>size</code> argument and 1 is returned. Otherwise 0 is returned.</p> 1081<p>For example, the following code prints the margins for two-sided printing on US Letter media:</p> 1082<pre><code>cups_size_t size; 1083 1084if (cupsGetDestMediaByName(CUPS_HTTP_DEFAULT, dest, info, 1085 CUPS_MEDIA_LETTER, 1086 CUPS_MEDIA_FLAGS_DUPLEX, &size)) 1087{ 1088 puts("Margins for duplex US Letter:"); 1089 printf(" Bottom: %.2fin\n", size.bottom / 2540.0); 1090 printf(" Left: %.2fin\n", size.left / 2540.0); 1091 printf(" Right: %.2fin\n", size.right / 2540.0); 1092 printf(" Top: %.2fin\n", size.top / 2540.0); 1093} 1094else 1095 puts("Margins for duplex US Letter are not available."); 1096</code></pre> 1097<p>You can also enumerate all of the sizes that match a given <code>flags</code> value using the <code>cupsGetDestMediaByIndex</code> and <code>cupsGetDestMediaCount</code> functions:</p> 1098<pre><code>int 1099cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest, 1100 cups_dinfo_t *dinfo, int n, 1101 unsigned flags, cups_size_t *size); 1102 1103int 1104cupsGetDestMediaCount(http_t *http, cups_dest_t *dest, 1105 cups_dinfo_t *dinfo, unsigned flags); 1106</code></pre> 1107<p>For example, the following code prints the list of ready media and corresponding margins:</p> 1108<pre><code>cups_size_t size; 1109int i; 1110int count = cupsGetDestMediaCount(CUPS_HTTP_DEFAULT, 1111 dest, info, 1112 CUPS_MEDIA_FLAGS_READY); 1113 1114for (i = 0; i < count; i ++) 1115{ 1116 if (cupsGetDestMediaByIndex(CUPS_HTTP_DEFAULT, dest, info, 1117 i, CUPS_MEDIA_FLAGS_READY, 1118 &size)) 1119 { 1120 printf("%s:\n", size.name); 1121 printf(" Width: %.2fin\n", size.width / 2540.0); 1122 printf(" Length: %.2fin\n", size.length / 2540.0); 1123 printf(" Bottom: %.2fin\n", size.bottom / 2540.0); 1124 printf(" Left: %.2fin\n", size.left / 2540.0); 1125 printf(" Right: %.2fin\n", size.right / 2540.0); 1126 printf(" Top: %.2fin\n", size.top / 2540.0); 1127 } 1128} 1129</code></pre> 1130<p>Finally, the <code>cupsGetDestMediaDefault</code> function returns the default media size:</p> 1131<pre><code>int 1132cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest, 1133 cups_dinfo_t *dinfo, unsigned flags, 1134 cups_size_t *size); 1135</code></pre> 1136<h4 id="localizing-options-and-values">Localizing Options and Values</h4> 1137<p>CUPS provides three functions to get localized, human-readable strings in the user's current locale for options and values: <code>cupsLocalizeDestMedia</code>, <code>cupsLocalizeDestOption</code>, and <code>cupsLocalizeDestValue</code>:</p> 1138<pre><code>const char * 1139cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest, 1140 cups_dinfo_t *info, unsigned flags, 1141 cups_size_t *size); 1142 1143const char * 1144cupsLocalizeDestOption(http_t *http, cups_dest_t *dest, 1145 cups_dinfo_t *info, 1146 const char *option); 1147 1148const char * 1149cupsLocalizeDestValue(http_t *http, cups_dest_t *dest, 1150 cups_dinfo_t *info, 1151 const char *option, const char *value); 1152</code></pre> 1153<h3 class="title" id="submitting-a-print-job">Submitting a Print Job</h3> 1154<p>Once you are ready to submit a print job, you create a job using the <code>cupsCreateDestJob</code> function:</p> 1155<pre><code>ipp_status_t 1156cupsCreateDestJob(http_t *http, cups_dest_t *dest, 1157 cups_dinfo_t *info, int *job_id, 1158 const char *title, int num_options, 1159 cups_option_t *options); 1160</code></pre> 1161<p>The <code>title</code> argument specifies a name for the print job such as "My Document". The <code>num_options</code> and <code>options</code> arguments specify the options for the print job which are allocated using the <code>cupsAddOption</code> function.</p> 1162<p>When successful, the job's numeric identifier is stored in the integer pointed to by the <code>job_id</code> argument and <code>IPP_STATUS_OK</code> is returned. Otherwise, an IPP error status is returned.</p> 1163<p>For example, the following code creates a new job that will print 42 copies of a two-sided US Letter document:</p> 1164<pre><code>int job_id = 0; 1165int num_options = 0; 1166cups_option_t *options = NULL; 1167 1168num_options = cupsAddOption(CUPS_COPIES, "42", 1169 num_options, &options); 1170num_options = cupsAddOption(CUPS_MEDIA, CUPS_MEDIA_LETTER, 1171 num_options, &options); 1172num_options = cupsAddOption(CUPS_SIDES, 1173 CUPS_SIDES_TWO_SIDED_PORTRAIT, 1174 num_options, &options); 1175 1176if (cupsCreateDestJob(CUPS_HTTP_DEFAULT, dest, info, 1177 &job_id, "My Document", num_options, 1178 options) == IPP_STATUS_OK) 1179 printf("Created job: %d\n", job_id); 1180else 1181 printf("Unable to create job: %s\n", 1182 cupsLastErrorString()); 1183</code></pre> 1184<p>Once the job is created, you submit documents for the job using the <code>cupsStartDestDocument</code>, <code>cupsWriteRequestData</code>, and <code>cupsFinishDestDocument</code> functions:</p> 1185<pre><code>http_status_t 1186cupsStartDestDocument(http_t *http, cups_dest_t *dest, 1187 cups_dinfo_t *info, int job_id, 1188 const char *docname, 1189 const char *format, 1190 int num_options, 1191 cups_option_t *options, 1192 int last_document); 1193 1194http_status_t 1195cupsWriteRequestData(http_t *http, const char *buffer, 1196 size_t length); 1197 1198ipp_status_t 1199cupsFinishDestDocument(http_t *http, cups_dest_t *dest, 1200 cups_dinfo_t *info); 1201</code></pre> 1202<p>The <code>docname</code> argument specifies the name of the document, typically the original filename. The <code>format</code> argument specifies the MIME media type of the document, including the following constants:</p> 1203<ul> 1204<li><p><code>CUPS_FORMAT_JPEG</code>: "image/jpeg"</p> 1205</li> 1206<li><p><code>CUPS_FORMAT_PDF</code>: "application/pdf"</p> 1207</li> 1208<li><p><code>CUPS_FORMAT_POSTSCRIPT</code>: "application/postscript"</p> 1209</li> 1210<li><p><code>CUPS_FORMAT_TEXT</code>: "text/plain"</p> 1211</li> 1212</ul> 1213<p>The <code>num_options</code> and <code>options</code> arguments specify per-document print options, which at present must be 0 and <code>NULL</code>. The <code>last_document</code> argument specifies whether this is the last document in the job.</p> 1214<p>For example, the following code submits a PDF file to the job that was just created:</p> 1215<pre><code>FILE *fp = fopen("filename.pdf", "rb"); 1216size_t bytes; 1217char buffer[65536]; 1218 1219if (cupsStartDestDocument(CUPS_HTTP_DEFAULT, dest, info, 1220 job_id, "filename.pdf", 0, NULL, 1221 1) == HTTP_STATUS_CONTINUE) 1222{ 1223 while ((bytes = fread(buffer, 1, sizeof(buffer), fp)) > 0) 1224 if (cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer, 1225 bytes) != HTTP_STATUS_CONTINUE) 1226 break; 1227 1228 if (cupsFinishDestDocument(CUPS_HTTP_DEFAULT, dest, 1229 info) == IPP_STATUS_OK) 1230 puts("Document send succeeded."); 1231 else 1232 printf("Document send failed: %s\n", 1233 cupsLastErrorString()); 1234} 1235 1236fclose(fp); 1237</code></pre> 1238<h2 class="title" id="sending-ipp-requests">Sending IPP Requests</h2> 1239<p>CUPS provides a rich API for sending IPP requests to the scheduler or printers, typically from management or utility applications whose primary purpose is not to send print jobs.</p> 1240<h3 class="title" id="connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</h3> 1241<p>The connection to the scheduler or printer is represented by the HTTP connection type <code>http_t</code>. The <code>cupsConnectDest</code> function connects to the scheduler or printer associated with the destination:</p> 1242<pre><code>http_t * 1243cupsConnectDest(cups_dest_t *dest, unsigned flags, int msec, 1244 int *cancel, char *resource, 1245 size_t resourcesize, cups_dest_cb_t cb, 1246 void *user_data); 1247</code></pre> 1248<p>The <code>dest</code> argument specifies the destination to connect to.</p> 1249<p>The <code>flags</code> argument specifies whether you want to connect to the scheduler (<code>CUPS_DEST_FLAGS_NONE</code>) or device/printer (<code>CUPS_DEST_FLAGS_DEVICE</code>) associated with the destination.</p> 1250<p>The <code>msec</code> argument specifies how long you are willing to wait for the connection to be established in milliseconds. Specify a value of <code>-1</code> to wait indefinitely.</p> 1251<p>The <code>cancel</code> argument specifies the address of an integer variable that can be set to a non-zero value to cancel the connection. Specify a value of <code>NULL</code> to not provide a cancel variable.</p> 1252<p>The <code>resource</code> and <code>resourcesize</code> arguments specify the address and size of a character string array to hold the path to use when sending an IPP request.</p> 1253<p>The <code>cb</code> and <code>user_data</code> arguments specify a destination callback function that returns 1 to continue connecting or 0 to stop. The destination callback work the same way as the one used for the <code>cupsEnumDests</code> function.</p> 1254<p>On success, a HTTP connection is returned that can be used to send IPP requests and get IPP responses.</p> 1255<p>For example, the following code connects to the printer associated with a destination with a 30 second timeout:</p> 1256<pre><code>char resource[256]; 1257http_t *http = cupsConnectDest(dest, CUPS_DEST_FLAGS_DEVICE, 1258 30000, NULL, resource, 1259 sizeof(resource), NULL, NULL); 1260</code></pre> 1261<h3 class="title" id="creating-an-ipp-request">Creating an IPP Request</h3> 1262<p>IPP requests are represented by the IPP message type <code>ipp_t</code> and each IPP attribute in the request is representing using the type <code>ipp_attribute_t</code>. Each IPP request includes an operation code (<code>IPP_OP_CREATE_JOB</code>, <code>IPP_OP_GET_PRINTER_ATTRIBUTES</code>, etc.) and a 32-bit integer identifier.</p> 1263<p>The <code>ippNewRequest</code> function creates a new IPP request:</p> 1264<pre><code>ipp_t * 1265ippNewRequest(ipp_op_t op); 1266</code></pre> 1267<p>The <code>op</code> argument specifies the IPP operation code for the request. For example, the following code creates an IPP Get-Printer-Attributes request:</p> 1268<pre><code>ipp_t *request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES); 1269</code></pre> 1270<p>The request identifier is automatically set to a unique value for the current process.</p> 1271<p>Each IPP request starts with two IPP attributes, "attributes-charset" and "attributes-natural-language", followed by IPP attribute(s) that specify the target of the operation. The <code>ippNewRequest</code> automatically adds the correct "attributes-charset" and "attributes-natural-language" attributes, but you must add the target attribute(s). For example, the following code adds the "printer-uri" attribute to the IPP Get-Printer-Attributes request to specify which printer is being queried:</p> 1272<pre><code>const char *printer_uri = cupsGetOption("device-uri", 1273 dest->num_options, 1274 dest->options); 1275 1276ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, 1277 "printer-uri", NULL, printer_uri); 1278</code></pre> 1279<blockquote> 1280<p><strong>Note:</strong></p> 1281<p>If we wanted to query the scheduler instead of the device, we would look up the "printer-uri-supported" option instead of the "device-uri" value.</p> 1282</blockquote> 1283<p>The <code>ippAddString</code> function adds the "printer-uri" attribute to the IPP request. The <code>IPP_TAG_OPERATION</code> argument specifies that the attribute is part of the operation. The <code>IPP_TAG_URI</code> argument specifies that the value is a Universal Resource Identifier (URI) string. The <code>NULL</code> argument specifies there is no language (English, French, Japanese, etc.) associated with the string, and the <code>printer_uri</code> argument specifies the string value.</p> 1284<p>The IPP Get-Printer-Attributes request also supports an IPP attribute called "requested-attributes" that lists the attributes and values you are interested in. For example, the following code requests the printer state attributes:</p> 1285<pre><code>static const char * const requested_attributes[] = 1286{ 1287 "printer-state", 1288 "printer-state-message", 1289 "printer-state-reasons" 1290}; 1291 1292ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, 1293 "requested-attributes", 3, NULL, 1294 requested_attributes); 1295</code></pre> 1296<p>The <code>ippAddStrings</code> function adds an attribute with one or more strings, in this case three. The <code>IPP_TAG_KEYWORD</code> argument specifies that the strings are keyword values, which are used for attribute names. All strings use the same language (<code>NULL</code>), and the attribute will contain the three strings in the array <code>requested_attributes</code>.</p> 1297<p>CUPS provides many functions to adding attributes of different types:</p> 1298<ul> 1299<li><p><code>ippAddBoolean</code> adds a boolean (<code>IPP_TAG_BOOLEAN</code>) attribute with one value.</p> 1300</li> 1301<li><p><code>ippAddInteger</code> adds an enum (<code>IPP_TAG_ENUM</code>) or integer (<code>IPP_TAG_INTEGER</code>) attribute with one value.</p> 1302</li> 1303<li><p><code>ippAddIntegers</code> adds an enum or integer attribute with one or more values.</p> 1304</li> 1305<li><p><code>ippAddOctetString</code> adds an octetString attribute with one value.</p> 1306</li> 1307<li><p><code>ippAddOutOfBand</code> adds a admin-defined (<code>IPP_TAG_ADMINDEFINE</code>), default (<code>IPP_TAG_DEFAULT</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable (<code>IPP_TAG_NOTSETTABLE</code>), unknown (<code>IPP_TAG_UNKNOWN</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_VALUE</code>) out-of-band attribute.</p> 1308</li> 1309<li><p><code>ippAddRange</code> adds a rangeOfInteger attribute with one range.</p> 1310</li> 1311<li><p><code>ippAddRanges</code> adds a rangeOfInteger attribute with one or more ranges.</p> 1312</li> 1313<li><p><code>ippAddResolution</code> adds a resolution attribute with one resolution.</p> 1314</li> 1315<li><p><code>ippAddResolutions</code> adds a resolution attribute with one or more resolutions.</p> 1316</li> 1317<li><p><code>ippAddString</code> adds a charset (<code>IPP_TAG_CHARSET</code>), keyword (<code>IPP_TAG_KEYWORD</code>), mimeMediaType (<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code> and <code>IPP_TAG_NAMELANG</code>), naturalLanguage (<code>IPP_TAG_NATURAL_LANGUAGE</code>), text (<code>IPP_TAG_TEXT</code> and <code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), or uriScheme (<code>IPP_TAG_URISCHEME</code>) attribute with one value.</p> 1318</li> 1319<li><p><code>ippAddStrings</code> adds a charset, keyword, mimeMediaType, name, naturalLanguage, text, uri, or uriScheme attribute with one or more values.</p> 1320</li> 1321</ul> 1322<h3 class="title" id="sending-the-ipp-request">Sending the IPP Request</h3> 1323<p>Once you have created the IPP request, you can send it using the <code>cupsDoRequest</code> function. For example, the following code sends the IPP Get-Printer-Attributes request to the destination and saves the response:</p> 1324<pre><code>ipp_t *response = cupsDoRequest(http, request, resource); 1325</code></pre> 1326<p>For requests like Send-Document that include a file, the <code>cupsDoFileRequest</code> function should be used:</p> 1327<pre><code>ipp_t *response = cupsDoFileRequest(http, request, resource, 1328 filename); 1329</code></pre> 1330<p>Both <code>cupsDoRequest</code> and <code>cupsDoFileRequest</code> free the IPP request. If a valid IPP response is received, it is stored in a new IPP message (<code>ipp_t</code>) and returned to the caller. Otherwise <code>NULL</code> is returned.</p> 1331<p>The status from the most recent request can be queried using the <code>cupsLastError</code> function, for example:</p> 1332<pre><code>if (cupsLastError() >= IPP_STATUS_ERROR_BAD_REQUEST) 1333{ 1334 /* request failed */ 1335} 1336</code></pre> 1337<p>A human-readable error message is also available using the <code>cupsLastErrorString</code> function:</p> 1338<pre><code>if (cupsLastError() >= IPP_STATUS_ERROR_BAD_REQUEST) 1339{ 1340 /* request failed */ 1341 printf("Request failed: %s\n", cupsLastErrorString()); 1342} 1343</code></pre> 1344<h3 class="title" id="processing-the-ipp-response">Processing the IPP Response</h3> 1345<p>Each response to an IPP request is also an IPP message (<code>ipp_t</code>) with its own IPP attributes (<code>ipp_attribute_t</code>) that includes a status code (<code>IPP_STATUS_OK</code>, <code>IPP_STATUS_ERROR_BAD_REQUEST</code>, etc.) and the corresponding 32-bit integer identifier from the request.</p> 1346<p>For example, the following code finds the printer state attributes and prints their values:</p> 1347<pre><code>ipp_attribute_t *attr; 1348 1349if ((attr = ippFindAttribute(response, "printer-state", 1350 IPP_TAG_ENUM)) != NULL) 1351{ 1352 printf("printer-state=%s\n", 1353 ippEnumString("printer-state", ippGetInteger(attr, 0))); 1354} 1355else 1356 puts("printer-state=unknown"); 1357 1358if ((attr = ippFindAttribute(response, "printer-state-message", 1359 IPP_TAG_TEXT)) != NULL) 1360{ 1361 printf("printer-state-message=\"%s\"\n", 1362 ippGetString(attr, 0, NULL))); 1363} 1364 1365if ((attr = ippFindAttribute(response, "printer-state-reasons", 1366 IPP_TAG_KEYWORD)) != NULL) 1367{ 1368 int i, count = ippGetCount(attr); 1369 1370 puts("printer-state-reasons="); 1371 for (i = 0; i < count; i ++) 1372 printf(" %s\n", ippGetString(attr, i, NULL))); 1373} 1374</code></pre> 1375<p>The <code>ippGetCount</code> function returns the number of values in an attribute.</p> 1376<p>The <code>ippGetInteger</code> and <code>ippGetString</code> functions return a single integer or string value from an attribute.</p> 1377<p>The <code>ippEnumString</code> function converts a enum value to its keyword (string) equivalent.</p> 1378<p>Once you are done using the IPP response message, free it using the <code>ippDelete</code> function:</p> 1379<pre><code>ippDelete(response); 1380</code></pre> 1381<h3 class="title" id="authentication">Authentication</h3> 1382<p>CUPS normally handles authentication through the console. GUI applications should set a password callback using the <code>cupsSetPasswordCB2</code> function:</p> 1383<pre><code>void 1384cupsSetPasswordCB2(cups_password_cb2_t cb, void *user_data); 1385</code></pre> 1386<p>The password callback will be called when needed and is responsible for setting the current user name using <code>cupsSetUser</code> and returning a string:</p> 1387<pre><code>const char * 1388cups_password_cb2(const char *prompt, http_t *http, 1389 const char *method, const char *resource, 1390 void *user_data); 1391</code></pre> 1392<p>The <code>prompt</code> argument is a string from CUPS that should be displayed to the user.</p> 1393<p>The <code>http</code> argument is the connection hosting the request that is being authenticated. The password callback can call the <code>httpGetField</code> and <code>httpGetSubField</code> functions to look for additional details concerning the authentication challenge.</p> 1394<p>The <code>method</code> argument specifies the HTTP method used for the request and is typically "POST".</p> 1395<p>The <code>resource</code> argument specifies the path used for the request.</p> 1396<p>The <code>user_data</code> argument provides the user data pointer from the <code>cupsSetPasswordCB2</code> call.</p> 1397<h2 class="title"><a id="FUNCTIONS">Functions</a></h2> 1398<h3 class="function"><a id="cupsAddDest">cupsAddDest</a></h3> 1399<p class="description">Add a destination to the list of destinations.</p> 1400<p class="code"> 1401int cupsAddDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p> 1402<h4 class="parameters">Parameters</h4> 1403<table class="list"><tbody> 1404<tr><th>name</th> 1405<td class="description">Destination name</td></tr> 1406<tr><th>instance</th> 1407<td class="description">Instance name or <code>NULL</code> for none/primary</td></tr> 1408<tr><th>num_dests</th> 1409<td class="description">Number of destinations</td></tr> 1410<tr><th>dests</th> 1411<td class="description">Destinations</td></tr> 1412</tbody></table> 1413<h4 class="returnvalue">Return Value</h4> 1414<p class="description">New number of destinations</p> 1415<h4 class="discussion">Discussion</h4> 1416<p class="discussion">This function cannot be used to add a new class or printer queue, 1417it only adds a new container of saved options for the named 1418destination or instance.<br> 1419<br> 1420If the named destination already exists, the destination list is 1421returned unchanged. Adding a new instance of a destination creates 1422a copy of that destination's options.<br> 1423<br> 1424Use the <a href="#cupsSaveDests"><code>cupsSaveDests</code></a> function to save the updated list of 1425destinations to the user's lpoptions file.</p> 1426<h3 class="function"><span class="info"> CUPS 2.3/macOS 10.14 </span><a id="cupsAddDestMediaOptions">cupsAddDestMediaOptions</a></h3> 1427<p class="description">Add the option corresponding to the specified media size.</p> 1428<p class="code"> 1429int cupsAddDestMediaOptions(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p> 1430<h4 class="parameters">Parameters</h4> 1431<table class="list"><tbody> 1432<tr><th>http</th> 1433<td class="description">Connection to destination</td></tr> 1434<tr><th>dest</th> 1435<td class="description">Destination</td></tr> 1436<tr><th>dinfo</th> 1437<td class="description">Destination information</td></tr> 1438<tr><th>flags</th> 1439<td class="description">Media matching flags</td></tr> 1440<tr><th>size</th> 1441<td class="description">Media size</td></tr> 1442<tr><th>num_options</th> 1443<td class="description">Current number of options</td></tr> 1444<tr><th>options</th> 1445<td class="description">Options</td></tr> 1446</tbody></table> 1447<h4 class="returnvalue">Return Value</h4> 1448<p class="description">New number of options</p> 1449<h3 class="function"><span class="info"> CUPS 2.2.4/macOS 10.13 </span><a id="cupsAddIntegerOption">cupsAddIntegerOption</a></h3> 1450<p class="description">Add an integer option to an option array.</p> 1451<p class="code"> 1452int cupsAddIntegerOption(const char *name, int value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p> 1453<h4 class="parameters">Parameters</h4> 1454<table class="list"><tbody> 1455<tr><th>name</th> 1456<td class="description">Name of option</td></tr> 1457<tr><th>value</th> 1458<td class="description">Value of option</td></tr> 1459<tr><th>num_options</th> 1460<td class="description">Number of options</td></tr> 1461<tr><th>options</th> 1462<td class="description">Pointer to options</td></tr> 1463</tbody></table> 1464<h4 class="returnvalue">Return Value</h4> 1465<p class="description">Number of options</p> 1466<h4 class="discussion">Discussion</h4> 1467<p class="discussion">New option arrays can be initialized simply by passing 0 for the 1468"num_options" parameter. 1469 1470</p> 1471<h3 class="function"><a id="cupsAddOption">cupsAddOption</a></h3> 1472<p class="description">Add an option to an option array.</p> 1473<p class="code"> 1474int cupsAddOption(const char *name, const char *value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p> 1475<h4 class="parameters">Parameters</h4> 1476<table class="list"><tbody> 1477<tr><th>name</th> 1478<td class="description">Name of option</td></tr> 1479<tr><th>value</th> 1480<td class="description">Value of option</td></tr> 1481<tr><th>num_options</th> 1482<td class="description">Number of options</td></tr> 1483<tr><th>options</th> 1484<td class="description">Pointer to options</td></tr> 1485</tbody></table> 1486<h4 class="returnvalue">Return Value</h4> 1487<p class="description">Number of options</p> 1488<h4 class="discussion">Discussion</h4> 1489<p class="discussion">New option arrays can be initialized simply by passing 0 for the 1490"num_options" parameter.</p> 1491<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayAdd">cupsArrayAdd</a></h3> 1492<p class="description">Add an element to the array.</p> 1493<p class="code"> 1494int cupsArrayAdd(<a href="#cups_array_t">cups_array_t</a> *a, void *e);</p> 1495<h4 class="parameters">Parameters</h4> 1496<table class="list"><tbody> 1497<tr><th>a</th> 1498<td class="description">Array</td></tr> 1499<tr><th>e</th> 1500<td class="description">Element</td></tr> 1501</tbody></table> 1502<h4 class="returnvalue">Return Value</h4> 1503<p class="description">1 on success, 0 on failure</p> 1504<h4 class="discussion">Discussion</h4> 1505<p class="discussion">When adding an element to a sorted array, non-unique elements are 1506appended at the end of the run of identical elements. For unsorted arrays, 1507the element is appended to the end of the array. 1508 1509</p> 1510<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayClear">cupsArrayClear</a></h3> 1511<p class="description">Clear the array.</p> 1512<p class="code"> 1513void cupsArrayClear(<a href="#cups_array_t">cups_array_t</a> *a);</p> 1514<h4 class="parameters">Parameters</h4> 1515<table class="list"><tbody> 1516<tr><th>a</th> 1517<td class="description">Array</td></tr> 1518</tbody></table> 1519<h4 class="discussion">Discussion</h4> 1520<p class="discussion">This function is equivalent to removing all elements in the array. 1521The caller is responsible for freeing the memory used by the 1522elements themselves. 1523 1524</p> 1525<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayCount">cupsArrayCount</a></h3> 1526<p class="description">Get the number of elements in the array.</p> 1527<p class="code"> 1528int cupsArrayCount(<a href="#cups_array_t">cups_array_t</a> *a);</p> 1529<h4 class="parameters">Parameters</h4> 1530<table class="list"><tbody> 1531<tr><th>a</th> 1532<td class="description">Array</td></tr> 1533</tbody></table> 1534<h4 class="returnvalue">Return Value</h4> 1535<p class="description">Number of elements</p> 1536<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayCurrent">cupsArrayCurrent</a></h3> 1537<p class="description">Return the current element in the array.</p> 1538<p class="code"> 1539void *cupsArrayCurrent(<a href="#cups_array_t">cups_array_t</a> *a);</p> 1540<h4 class="parameters">Parameters</h4> 1541<table class="list"><tbody> 1542<tr><th>a</th> 1543<td class="description">Array</td></tr> 1544</tbody></table> 1545<h4 class="returnvalue">Return Value</h4> 1546<p class="description">Element</p> 1547<h4 class="discussion">Discussion</h4> 1548<p class="discussion">The current element is undefined until you call <a href="#cupsArrayFind"><code>cupsArrayFind</code></a>, 1549<a href="#cupsArrayFirst"><code>cupsArrayFirst</code></a>, or <a href="#cupsArrayIndex"><code>cupsArrayIndex</code></a>, or <a href="#cupsArrayLast"><code>cupsArrayLast</code></a>. 1550 1551</p> 1552<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayDelete">cupsArrayDelete</a></h3> 1553<p class="description">Free all memory used by the array.</p> 1554<p class="code"> 1555void cupsArrayDelete(<a href="#cups_array_t">cups_array_t</a> *a);</p> 1556<h4 class="parameters">Parameters</h4> 1557<table class="list"><tbody> 1558<tr><th>a</th> 1559<td class="description">Array</td></tr> 1560</tbody></table> 1561<h4 class="discussion">Discussion</h4> 1562<p class="discussion">The caller is responsible for freeing the memory used by the 1563elements themselves. 1564 1565</p> 1566<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayDup">cupsArrayDup</a></h3> 1567<p class="description">Duplicate the array.</p> 1568<p class="code"> 1569<a href="#cups_array_t">cups_array_t</a> *cupsArrayDup(<a href="#cups_array_t">cups_array_t</a> *a);</p> 1570<h4 class="parameters">Parameters</h4> 1571<table class="list"><tbody> 1572<tr><th>a</th> 1573<td class="description">Array</td></tr> 1574</tbody></table> 1575<h4 class="returnvalue">Return Value</h4> 1576<p class="description">Duplicate array</p> 1577<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayFind">cupsArrayFind</a></h3> 1578<p class="description">Find an element in the array.</p> 1579<p class="code"> 1580void *cupsArrayFind(<a href="#cups_array_t">cups_array_t</a> *a, void *e);</p> 1581<h4 class="parameters">Parameters</h4> 1582<table class="list"><tbody> 1583<tr><th>a</th> 1584<td class="description">Array</td></tr> 1585<tr><th>e</th> 1586<td class="description">Element</td></tr> 1587</tbody></table> 1588<h4 class="returnvalue">Return Value</h4> 1589<p class="description">Element found or <code>NULL</code></p> 1590<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayFirst">cupsArrayFirst</a></h3> 1591<p class="description">Get the first element in the array.</p> 1592<p class="code"> 1593void *cupsArrayFirst(<a href="#cups_array_t">cups_array_t</a> *a);</p> 1594<h4 class="parameters">Parameters</h4> 1595<table class="list"><tbody> 1596<tr><th>a</th> 1597<td class="description">Array</td></tr> 1598</tbody></table> 1599<h4 class="returnvalue">Return Value</h4> 1600<p class="description">First element or <code>NULL</code> if the array is empty</p> 1601<h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="cupsArrayGetIndex">cupsArrayGetIndex</a></h3> 1602<p class="description">Get the index of the current element.</p> 1603<p class="code"> 1604int cupsArrayGetIndex(<a href="#cups_array_t">cups_array_t</a> *a);</p> 1605<h4 class="parameters">Parameters</h4> 1606<table class="list"><tbody> 1607<tr><th>a</th> 1608<td class="description">Array</td></tr> 1609</tbody></table> 1610<h4 class="returnvalue">Return Value</h4> 1611<p class="description">Index of the current element, starting at 0</p> 1612<h4 class="discussion">Discussion</h4> 1613<p class="discussion">The current element is undefined until you call <a href="#cupsArrayFind"><code>cupsArrayFind</code></a>, 1614<a href="#cupsArrayFirst"><code>cupsArrayFirst</code></a>, or <a href="#cupsArrayIndex"><code>cupsArrayIndex</code></a>, or <a href="#cupsArrayLast"><code>cupsArrayLast</code></a>. 1615 1616</p> 1617<h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="cupsArrayGetInsert">cupsArrayGetInsert</a></h3> 1618<p class="description">Get the index of the last inserted element.</p> 1619<p class="code"> 1620int cupsArrayGetInsert(<a href="#cups_array_t">cups_array_t</a> *a);</p> 1621<h4 class="parameters">Parameters</h4> 1622<table class="list"><tbody> 1623<tr><th>a</th> 1624<td class="description">Array</td></tr> 1625</tbody></table> 1626<h4 class="returnvalue">Return Value</h4> 1627<p class="description">Index of the last inserted element, starting at 0</p> 1628<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayIndex">cupsArrayIndex</a></h3> 1629<p class="description">Get the N-th element in the array.</p> 1630<p class="code"> 1631void *cupsArrayIndex(<a href="#cups_array_t">cups_array_t</a> *a, int n);</p> 1632<h4 class="parameters">Parameters</h4> 1633<table class="list"><tbody> 1634<tr><th>a</th> 1635<td class="description">Array</td></tr> 1636<tr><th>n</th> 1637<td class="description">Index into array, starting at 0</td></tr> 1638</tbody></table> 1639<h4 class="returnvalue">Return Value</h4> 1640<p class="description">N-th element or <code>NULL</code></p> 1641<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayInsert">cupsArrayInsert</a></h3> 1642<p class="description">Insert an element in the array.</p> 1643<p class="code"> 1644int cupsArrayInsert(<a href="#cups_array_t">cups_array_t</a> *a, void *e);</p> 1645<h4 class="parameters">Parameters</h4> 1646<table class="list"><tbody> 1647<tr><th>a</th> 1648<td class="description">Array</td></tr> 1649<tr><th>e</th> 1650<td class="description">Element</td></tr> 1651</tbody></table> 1652<h4 class="returnvalue">Return Value</h4> 1653<p class="description">0 on failure, 1 on success</p> 1654<h4 class="discussion">Discussion</h4> 1655<p class="discussion">When inserting an element in a sorted array, non-unique elements are 1656inserted at the beginning of the run of identical elements. For unsorted 1657arrays, the element is inserted at the beginning of the array. 1658 1659</p> 1660<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayLast">cupsArrayLast</a></h3> 1661<p class="description">Get the last element in the array.</p> 1662<p class="code"> 1663void *cupsArrayLast(<a href="#cups_array_t">cups_array_t</a> *a);</p> 1664<h4 class="parameters">Parameters</h4> 1665<table class="list"><tbody> 1666<tr><th>a</th> 1667<td class="description">Array</td></tr> 1668</tbody></table> 1669<h4 class="returnvalue">Return Value</h4> 1670<p class="description">Last element or <code>NULL</code> if the array is empty</p> 1671<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayNew">cupsArrayNew</a></h3> 1672<p class="description">Create a new array.</p> 1673<p class="code"> 1674<a href="#cups_array_t">cups_array_t</a> *cupsArrayNew(<a href="#cups_array_func_t">cups_array_func_t</a> f, void *d);</p> 1675<h4 class="parameters">Parameters</h4> 1676<table class="list"><tbody> 1677<tr><th>f</th> 1678<td class="description">Comparison function or <code>NULL</code> for an unsorted array</td></tr> 1679<tr><th>d</th> 1680<td class="description">User data pointer or <code>NULL</code></td></tr> 1681</tbody></table> 1682<h4 class="returnvalue">Return Value</h4> 1683<p class="description">Array</p> 1684<h4 class="discussion">Discussion</h4> 1685<p class="discussion">The comparison function ("f") is used to create a sorted array. The function 1686receives pointers to two elements and the user data pointer ("d") - the user 1687data pointer argument can safely be omitted when not required so functions 1688like <code>strcmp</code> can be used for sorted string arrays. 1689 1690</p> 1691<h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="cupsArrayNew2">cupsArrayNew2</a></h3> 1692<p class="description">Create a new array with hash.</p> 1693<p class="code"> 1694<a href="#cups_array_t">cups_array_t</a> *cupsArrayNew2(<a href="#cups_array_func_t">cups_array_func_t</a> f, void *d, <a href="#cups_ahash_func_t">cups_ahash_func_t</a> h, int hsize);</p> 1695<h4 class="parameters">Parameters</h4> 1696<table class="list"><tbody> 1697<tr><th>f</th> 1698<td class="description">Comparison function or <code>NULL</code> for an unsorted array</td></tr> 1699<tr><th>d</th> 1700<td class="description">User data or <code>NULL</code></td></tr> 1701<tr><th>h</th> 1702<td class="description">Hash function or <code>NULL</code> for unhashed lookups</td></tr> 1703<tr><th>hsize</th> 1704<td class="description">Hash size (>= 0)</td></tr> 1705</tbody></table> 1706<h4 class="returnvalue">Return Value</h4> 1707<p class="description">Array</p> 1708<h4 class="discussion">Discussion</h4> 1709<p class="discussion">The comparison function ("f") is used to create a sorted array. The function 1710receives pointers to two elements and the user data pointer ("d") - the user 1711data pointer argument can safely be omitted when not required so functions 1712like <code>strcmp</code> can be used for sorted string arrays.<br> 1713<br> 1714The hash function ("h") is used to implement cached lookups with the 1715specified hash size ("hsize"). 1716 1717</p> 1718<h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="cupsArrayNew3">cupsArrayNew3</a></h3> 1719<p class="description">Create a new array with hash and/or free function.</p> 1720<p class="code"> 1721<a href="#cups_array_t">cups_array_t</a> *cupsArrayNew3(<a href="#cups_array_func_t">cups_array_func_t</a> f, void *d, <a href="#cups_ahash_func_t">cups_ahash_func_t</a> h, int hsize, <a href="#cups_acopy_func_t">cups_acopy_func_t</a> cf, <a href="#cups_afree_func_t">cups_afree_func_t</a> ff);</p> 1722<h4 class="parameters">Parameters</h4> 1723<table class="list"><tbody> 1724<tr><th>f</th> 1725<td class="description">Comparison function or <code>NULL</code> for an unsorted array</td></tr> 1726<tr><th>d</th> 1727<td class="description">User data or <code>NULL</code></td></tr> 1728<tr><th>h</th> 1729<td class="description">Hash function or <code>NULL</code> for unhashed lookups</td></tr> 1730<tr><th>hsize</th> 1731<td class="description">Hash size (>= 0)</td></tr> 1732<tr><th>cf</th> 1733<td class="description">Copy function</td></tr> 1734<tr><th>ff</th> 1735<td class="description">Free function</td></tr> 1736</tbody></table> 1737<h4 class="returnvalue">Return Value</h4> 1738<p class="description">Array</p> 1739<h4 class="discussion">Discussion</h4> 1740<p class="discussion">The comparison function ("f") is used to create a sorted array. The function 1741receives pointers to two elements and the user data pointer ("d") - the user 1742data pointer argument can safely be omitted when not required so functions 1743like <code>strcmp</code> can be used for sorted string arrays.<br> 1744<br> 1745The hash function ("h") is used to implement cached lookups with the 1746specified hash size ("hsize").<br> 1747<br> 1748The copy function ("cf") is used to automatically copy/retain elements when 1749added or the array is copied.<br> 1750<br> 1751The free function ("cf") is used to automatically free/release elements when 1752removed or the array is deleted. 1753 1754</p> 1755<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayNext">cupsArrayNext</a></h3> 1756<p class="description">Get the next element in the array.</p> 1757<p class="code"> 1758void *cupsArrayNext(<a href="#cups_array_t">cups_array_t</a> *a);</p> 1759<h4 class="parameters">Parameters</h4> 1760<table class="list"><tbody> 1761<tr><th>a</th> 1762<td class="description">Array</td></tr> 1763</tbody></table> 1764<h4 class="returnvalue">Return Value</h4> 1765<p class="description">Next element or <code>NULL</code></p> 1766<h4 class="discussion">Discussion</h4> 1767<p class="discussion">This function is equivalent to "cupsArrayIndex(a, cupsArrayGetIndex(a) + 1)".<br> 1768<br> 1769The next element is undefined until you call <a href="#cupsArrayFind"><code>cupsArrayFind</code></a>, 1770<a href="#cupsArrayFirst"><code>cupsArrayFirst</code></a>, or <a href="#cupsArrayIndex"><code>cupsArrayIndex</code></a>, or <a href="#cupsArrayLast"><code>cupsArrayLast</code></a> 1771to set the current element. 1772 1773</p> 1774<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayPrev">cupsArrayPrev</a></h3> 1775<p class="description">Get the previous element in the array.</p> 1776<p class="code"> 1777void *cupsArrayPrev(<a href="#cups_array_t">cups_array_t</a> *a);</p> 1778<h4 class="parameters">Parameters</h4> 1779<table class="list"><tbody> 1780<tr><th>a</th> 1781<td class="description">Array</td></tr> 1782</tbody></table> 1783<h4 class="returnvalue">Return Value</h4> 1784<p class="description">Previous element or <code>NULL</code></p> 1785<h4 class="discussion">Discussion</h4> 1786<p class="discussion">This function is equivalent to "cupsArrayIndex(a, cupsArrayGetIndex(a) - 1)".<br> 1787<br> 1788The previous element is undefined until you call <a href="#cupsArrayFind"><code>cupsArrayFind</code></a>, 1789<a href="#cupsArrayFirst"><code>cupsArrayFirst</code></a>, or <a href="#cupsArrayIndex"><code>cupsArrayIndex</code></a>, or <a href="#cupsArrayLast"><code>cupsArrayLast</code></a> 1790to set the current element. 1791 1792</p> 1793<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayRemove">cupsArrayRemove</a></h3> 1794<p class="description">Remove an element from the array.</p> 1795<p class="code"> 1796int cupsArrayRemove(<a href="#cups_array_t">cups_array_t</a> *a, void *e);</p> 1797<h4 class="parameters">Parameters</h4> 1798<table class="list"><tbody> 1799<tr><th>a</th> 1800<td class="description">Array</td></tr> 1801<tr><th>e</th> 1802<td class="description">Element</td></tr> 1803</tbody></table> 1804<h4 class="returnvalue">Return Value</h4> 1805<p class="description">1 on success, 0 on failure</p> 1806<h4 class="discussion">Discussion</h4> 1807<p class="discussion">If more than one element matches "e", only the first matching element is 1808removed.<br> 1809<br> 1810The caller is responsible for freeing the memory used by the 1811removed element. 1812 1813</p> 1814<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayRestore">cupsArrayRestore</a></h3> 1815<p class="description">Reset the current element to the last <a href="#cupsArraySave"><code>cupsArraySave</code></a>.</p> 1816<p class="code"> 1817void *cupsArrayRestore(<a href="#cups_array_t">cups_array_t</a> *a);</p> 1818<h4 class="parameters">Parameters</h4> 1819<table class="list"><tbody> 1820<tr><th>a</th> 1821<td class="description">Array</td></tr> 1822</tbody></table> 1823<h4 class="returnvalue">Return Value</h4> 1824<p class="description">New current element</p> 1825<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArraySave">cupsArraySave</a></h3> 1826<p class="description">Mark the current element for a later <a href="#cupsArrayRestore"><code>cupsArrayRestore</code></a>.</p> 1827<p class="code"> 1828int cupsArraySave(<a href="#cups_array_t">cups_array_t</a> *a);</p> 1829<h4 class="parameters">Parameters</h4> 1830<table class="list"><tbody> 1831<tr><th>a</th> 1832<td class="description">Array</td></tr> 1833</tbody></table> 1834<h4 class="returnvalue">Return Value</h4> 1835<p class="description">1 on success, 0 on failure</p> 1836<h4 class="discussion">Discussion</h4> 1837<p class="discussion">The current element is undefined until you call <a href="#cupsArrayFind"><code>cupsArrayFind</code></a>, 1838<a href="#cupsArrayFirst"><code>cupsArrayFirst</code></a>, or <a href="#cupsArrayIndex"><code>cupsArrayIndex</code></a>, or <a href="#cupsArrayLast"><code>cupsArrayLast</code></a> 1839to set the current element.<br> 1840<br> 1841The save/restore stack is guaranteed to be at least 32 elements deep. 1842 1843</p> 1844<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsArrayUserData">cupsArrayUserData</a></h3> 1845<p class="description">Return the user data for an array.</p> 1846<p class="code"> 1847void *cupsArrayUserData(<a href="#cups_array_t">cups_array_t</a> *a);</p> 1848<h4 class="parameters">Parameters</h4> 1849<table class="list"><tbody> 1850<tr><th>a</th> 1851<td class="description">Array</td></tr> 1852</tbody></table> 1853<h4 class="returnvalue">Return Value</h4> 1854<p class="description">User data</p> 1855<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCancelDestJob">cupsCancelDestJob</a></h3> 1856<p class="description">Cancel a job on a destination.</p> 1857<p class="code"> 1858ipp_status_t cupsCancelDestJob(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, int job_id);</p> 1859<h4 class="parameters">Parameters</h4> 1860<table class="list"><tbody> 1861<tr><th>http</th> 1862<td class="description">Connection to destination</td></tr> 1863<tr><th>dest</th> 1864<td class="description">Destination</td></tr> 1865<tr><th>job_id</th> 1866<td class="description">Job ID</td></tr> 1867</tbody></table> 1868<h4 class="returnvalue">Return Value</h4> 1869<p class="description">Status of cancel operation</p> 1870<h4 class="discussion">Discussion</h4> 1871<p class="discussion">The "job_id" is the number returned by cupsCreateDestJob.<br> 1872<br> 1873Returns <code>IPP_STATUS_OK</code> on success and 1874<code>IPP_STATUS_ERROR_NOT_AUTHORIZED</code> or 1875<code>IPP_STATUS_ERROR_FORBIDDEN</code> on failure. 1876 1877</p> 1878<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCheckDestSupported">cupsCheckDestSupported</a></h3> 1879<p class="description">Check that the option and value are supported 1880by the destination.</p> 1881<p class="code"> 1882int cupsCheckDestSupported(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option, const char *value);</p> 1883<h4 class="parameters">Parameters</h4> 1884<table class="list"><tbody> 1885<tr><th>http</th> 1886<td class="description">Connection to destination</td></tr> 1887<tr><th>dest</th> 1888<td class="description">Destination</td></tr> 1889<tr><th>dinfo</th> 1890<td class="description">Destination information</td></tr> 1891<tr><th>option</th> 1892<td class="description">Option</td></tr> 1893<tr><th>value</th> 1894<td class="description">Value or <code>NULL</code></td></tr> 1895</tbody></table> 1896<h4 class="returnvalue">Return Value</h4> 1897<p class="description">1 if supported, 0 otherwise</p> 1898<h4 class="discussion">Discussion</h4> 1899<p class="discussion">Returns 1 if supported, 0 otherwise. 1900 1901</p> 1902<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCloseDestJob">cupsCloseDestJob</a></h3> 1903<p class="description">Close a job and start printing.</p> 1904<p class="code"> 1905ipp_status_t cupsCloseDestJob(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info, int job_id);</p> 1906<h4 class="parameters">Parameters</h4> 1907<table class="list"><tbody> 1908<tr><th>http</th> 1909<td class="description">Connection to destination</td></tr> 1910<tr><th>dest</th> 1911<td class="description">Destination</td></tr> 1912<tr><th>info</th> 1913<td class="description">Destination information</td></tr> 1914<tr><th>job_id</th> 1915<td class="description">Job ID</td></tr> 1916</tbody></table> 1917<h4 class="returnvalue">Return Value</h4> 1918<p class="description">IPP status code</p> 1919<h4 class="discussion">Discussion</h4> 1920<p class="discussion">Use when the last call to cupsStartDocument passed 0 for "last_document". 1921"job_id" is the job ID returned by cupsCreateDestJob. Returns <code>IPP_STATUS_OK</code> 1922on success. 1923 1924</p> 1925<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsConnectDest">cupsConnectDest</a></h3> 1926<p class="description">Open a connection to the destination.</p> 1927<p class="code"> 1928<a href="#http_t">http_t</a> *cupsConnectDest(<a href="#cups_dest_t">cups_dest_t</a> *dest, unsigned flags, int msec, int *cancel, char *resource, size_t resourcesize, <a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb, void *user_data);</p> 1929<h4 class="parameters">Parameters</h4> 1930<table class="list"><tbody> 1931<tr><th>dest</th> 1932<td class="description">Destination</td></tr> 1933<tr><th>flags</th> 1934<td class="description">Connection flags</td></tr> 1935<tr><th>msec</th> 1936<td class="description">Timeout in milliseconds</td></tr> 1937<tr><th>cancel</th> 1938<td class="description">Pointer to "cancel" variable</td></tr> 1939<tr><th>resource</th> 1940<td class="description">Resource buffer</td></tr> 1941<tr><th>resourcesize</th> 1942<td class="description">Size of resource buffer</td></tr> 1943<tr><th>cb</th> 1944<td class="description">Callback function</td></tr> 1945<tr><th>user_data</th> 1946<td class="description">User data pointer</td></tr> 1947</tbody></table> 1948<h4 class="returnvalue">Return Value</h4> 1949<p class="description">Connection to destination or <code>NULL</code></p> 1950<h4 class="discussion">Discussion</h4> 1951<p class="discussion">Connect to the destination, returning a new <code>http_t</code> connection object 1952and optionally the resource path to use for the destination. These calls 1953will block until a connection is made, the timeout expires, the integer 1954pointed to by "cancel" is non-zero, or the callback function (or block) 1955returns 0. The caller is responsible for calling <a href="#httpClose"><code>httpClose</code></a> on the 1956returned connection.<br> 1957<br> 1958Starting with CUPS 2.2.4, the caller can pass <code>CUPS_DEST_FLAGS_DEVICE</code> 1959for the "flags" argument to connect directly to the device associated with 1960the destination. Otherwise, the connection is made to the CUPS scheduler 1961associated with the destination. 1962 1963</p> 1964<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCopyDest">cupsCopyDest</a></h3> 1965<p class="description">Copy a destination.</p> 1966<p class="code"> 1967int cupsCopyDest(<a href="#cups_dest_t">cups_dest_t</a> *dest, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p> 1968<h4 class="parameters">Parameters</h4> 1969<table class="list"><tbody> 1970<tr><th>dest</th> 1971<td class="description">Destination to copy</td></tr> 1972<tr><th>num_dests</th> 1973<td class="description">Number of destinations</td></tr> 1974<tr><th>dests</th> 1975<td class="description">Destination array</td></tr> 1976</tbody></table> 1977<h4 class="returnvalue">Return Value</h4> 1978<p class="description">New number of destinations</p> 1979<h4 class="discussion">Discussion</h4> 1980<p class="discussion">Make a copy of the destination to an array of destinations (or just a single 1981copy) - for use with the cupsEnumDests* functions. The caller is responsible 1982for calling cupsFreeDests() on the returned object(s). 1983 1984</p> 1985<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCopyDestConflicts">cupsCopyDestConflicts</a></h3> 1986<p class="description">Get conflicts and resolutions for a new 1987option/value pair.</p> 1988<p class="code"> 1989int cupsCopyDestConflicts(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, int num_options, <a href="#cups_option_t">cups_option_t</a> *options, const char *new_option, const char *new_value, int *num_conflicts, <a href="#cups_option_t">cups_option_t</a> **conflicts, int *num_resolved, <a href="#cups_option_t">cups_option_t</a> **resolved);</p> 1990<h4 class="parameters">Parameters</h4> 1991<table class="list"><tbody> 1992<tr><th>http</th> 1993<td class="description">Connection to destination</td></tr> 1994<tr><th>dest</th> 1995<td class="description">Destination</td></tr> 1996<tr><th>dinfo</th> 1997<td class="description">Destination information</td></tr> 1998<tr><th>num_options</th> 1999<td class="description">Number of current options</td></tr> 2000<tr><th>options</th> 2001<td class="description">Current options</td></tr> 2002<tr><th>new_option</th> 2003<td class="description">New option</td></tr> 2004<tr><th>new_value</th> 2005<td class="description">New value</td></tr> 2006<tr><th>num_conflicts</th> 2007<td class="description">Number of conflicting options</td></tr> 2008<tr><th>conflicts</th> 2009<td class="description">Conflicting options</td></tr> 2010<tr><th>num_resolved</th> 2011<td class="description">Number of options to resolve</td></tr> 2012<tr><th>resolved</th> 2013<td class="description">Resolved options</td></tr> 2014</tbody></table> 2015<h4 class="returnvalue">Return Value</h4> 2016<p class="description">1 if there is a conflict, 0 if none, -1 on error</p> 2017<h4 class="discussion">Discussion</h4> 2018<p class="discussion">"num_options" and "options" represent the currently selected options by the 2019user. "new_option" and "new_value" are the setting the user has just 2020changed.<br> 2021<br> 2022Returns 1 if there is a conflict, 0 if there are no conflicts, and -1 if 2023there was an unrecoverable error such as a resolver loop.<br> 2024<br> 2025If "num_conflicts" and "conflicts" are not <code>NULL</code>, they are set to 2026contain the list of conflicting option/value pairs. Similarly, if 2027"num_resolved" and "resolved" are not <code>NULL</code> they will be set to the 2028list of changes needed to resolve the conflict.<br> 2029<br> 2030If cupsCopyDestConflicts returns 1 but "num_resolved" and "resolved" are set 2031to 0 and <code>NULL</code>, respectively, then the conflict cannot be resolved. 2032 2033</p> 2034<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCopyDestInfo">cupsCopyDestInfo</a></h3> 2035<p class="description">Get the supported values/capabilities for the 2036destination.</p> 2037<p class="code"> 2038<a href="#cups_dinfo_t">cups_dinfo_t</a> *cupsCopyDestInfo(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest);</p> 2039<h4 class="parameters">Parameters</h4> 2040<table class="list"><tbody> 2041<tr><th>http</th> 2042<td class="description">Connection to destination</td></tr> 2043<tr><th>dest</th> 2044<td class="description">Destination</td></tr> 2045</tbody></table> 2046<h4 class="returnvalue">Return Value</h4> 2047<p class="description">Destination information</p> 2048<h4 class="discussion">Discussion</h4> 2049<p class="discussion">The caller is responsible for calling <a href="#cupsFreeDestInfo"><code>cupsFreeDestInfo</code></a> on the return 2050value. <code>NULL</code> is returned on error. 2051 2052</p> 2053<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCreateDestJob">cupsCreateDestJob</a></h3> 2054<p class="description">Create a job on a destination.</p> 2055<p class="code"> 2056ipp_status_t cupsCreateDestJob(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info, int *job_id, const char *title, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p> 2057<h4 class="parameters">Parameters</h4> 2058<table class="list"><tbody> 2059<tr><th>http</th> 2060<td class="description">Connection to destination</td></tr> 2061<tr><th>dest</th> 2062<td class="description">Destination</td></tr> 2063<tr><th>info</th> 2064<td class="description">Destination information</td></tr> 2065<tr><th>job_id</th> 2066<td class="description">Job ID or 0 on error</td></tr> 2067<tr><th>title</th> 2068<td class="description">Job name</td></tr> 2069<tr><th>num_options</th> 2070<td class="description">Number of job options</td></tr> 2071<tr><th>options</th> 2072<td class="description">Job options</td></tr> 2073</tbody></table> 2074<h4 class="returnvalue">Return Value</h4> 2075<p class="description">IPP status code</p> 2076<h4 class="discussion">Discussion</h4> 2077<p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success, saving the job ID 2078in the variable pointed to by "job_id". 2079 2080</p> 2081<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsDirClose">cupsDirClose</a></h3> 2082<p class="description">Close a directory.</p> 2083<p class="code"> 2084void cupsDirClose(<a href="#cups_dir_t">cups_dir_t</a> *dp);</p> 2085<h4 class="parameters">Parameters</h4> 2086<table class="list"><tbody> 2087<tr><th>dp</th> 2088<td class="description">Directory pointer</td></tr> 2089</tbody></table> 2090<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsDirOpen">cupsDirOpen</a></h3> 2091<p class="description">Open a directory.</p> 2092<p class="code"> 2093<a href="#cups_dir_t">cups_dir_t</a> *cupsDirOpen(const char *directory);</p> 2094<h4 class="parameters">Parameters</h4> 2095<table class="list"><tbody> 2096<tr><th>directory</th> 2097<td class="description">Directory name</td></tr> 2098</tbody></table> 2099<h4 class="returnvalue">Return Value</h4> 2100<p class="description">Directory pointer or <code>NULL</code> if the directory could not be opened.</p> 2101<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsDirRead">cupsDirRead</a></h3> 2102<p class="description">Read the next directory entry.</p> 2103<p class="code"> 2104<a href="#cups_dentry_t">cups_dentry_t</a> *cupsDirRead(<a href="#cups_dir_t">cups_dir_t</a> *dp);</p> 2105<h4 class="parameters">Parameters</h4> 2106<table class="list"><tbody> 2107<tr><th>dp</th> 2108<td class="description">Directory pointer</td></tr> 2109</tbody></table> 2110<h4 class="returnvalue">Return Value</h4> 2111<p class="description">Directory entry or <code>NULL</code> when there are no more</p> 2112<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsDirRewind">cupsDirRewind</a></h3> 2113<p class="description">Rewind to the start of the directory.</p> 2114<p class="code"> 2115void cupsDirRewind(<a href="#cups_dir_t">cups_dir_t</a> *dp);</p> 2116<h4 class="parameters">Parameters</h4> 2117<table class="list"><tbody> 2118<tr><th>dp</th> 2119<td class="description">Directory pointer</td></tr> 2120</tbody></table> 2121<h3 class="function"><span class="info"> CUPS 1.1.20/macOS 10.4 </span><a id="cupsDoAuthentication">cupsDoAuthentication</a></h3> 2122<p class="description">Authenticate a request.</p> 2123<p class="code"> 2124int cupsDoAuthentication(<a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p> 2125<h4 class="parameters">Parameters</h4> 2126<table class="list"><tbody> 2127<tr><th>http</th> 2128<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> 2129<tr><th>method</th> 2130<td class="description">Request method ("GET", "POST", "PUT")</td></tr> 2131<tr><th>resource</th> 2132<td class="description">Resource path</td></tr> 2133</tbody></table> 2134<h4 class="returnvalue">Return Value</h4> 2135<p class="description">0 on success, -1 on error</p> 2136<h4 class="discussion">Discussion</h4> 2137<p class="discussion">This function should be called in response to a <code>HTTP_STATUS_UNAUTHORIZED</code> 2138status, prior to resubmitting your request. 2139 2140</p> 2141<h3 class="function"><span class="info"> CUPS 2.3/macOS 10.14 </span><a id="cupsEncodeOption">cupsEncodeOption</a></h3> 2142<p class="description">Encode a single option into an IPP attribute.</p> 2143<p class="code"> 2144<a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsEncodeOption(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group_tag, const char *name, const char *value);</p> 2145<h4 class="parameters">Parameters</h4> 2146<table class="list"><tbody> 2147<tr><th>ipp</th> 2148<td class="description">IPP request/response</td></tr> 2149<tr><th>group_tag</th> 2150<td class="description">Attribute group</td></tr> 2151<tr><th>name</th> 2152<td class="description">Option name</td></tr> 2153<tr><th>value</th> 2154<td class="description">Option string value</td></tr> 2155</tbody></table> 2156<h4 class="returnvalue">Return Value</h4> 2157<p class="description">New attribute or <code>NULL</code> on error</p> 2158<h3 class="function"><a id="cupsEncodeOptions">cupsEncodeOptions</a></h3> 2159<p class="description">Encode printer options into IPP attributes.</p> 2160<p class="code"> 2161void cupsEncodeOptions(<a href="#ipp_t">ipp_t</a> *ipp, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p> 2162<h4 class="parameters">Parameters</h4> 2163<table class="list"><tbody> 2164<tr><th>ipp</th> 2165<td class="description">IPP request/response</td></tr> 2166<tr><th>num_options</th> 2167<td class="description">Number of options</td></tr> 2168<tr><th>options</th> 2169<td class="description">Options</td></tr> 2170</tbody></table> 2171<h4 class="discussion">Discussion</h4> 2172<p class="discussion">This function adds operation, job, and then subscription attributes, 2173in that order. Use the <a href="#cupsEncodeOptions2"><code>cupsEncodeOptions2</code></a> function to add attributes 2174for a single group.</p> 2175<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsEncodeOptions2">cupsEncodeOptions2</a></h3> 2176<p class="description">Encode printer options into IPP attributes for a group.</p> 2177<p class="code"> 2178void cupsEncodeOptions2(<a href="#ipp_t">ipp_t</a> *ipp, int num_options, <a href="#cups_option_t">cups_option_t</a> *options, ipp_tag_t group_tag);</p> 2179<h4 class="parameters">Parameters</h4> 2180<table class="list"><tbody> 2181<tr><th>ipp</th> 2182<td class="description">IPP request/response</td></tr> 2183<tr><th>num_options</th> 2184<td class="description">Number of options</td></tr> 2185<tr><th>options</th> 2186<td class="description">Options</td></tr> 2187<tr><th>group_tag</th> 2188<td class="description">Group to encode</td></tr> 2189</tbody></table> 2190<h4 class="discussion">Discussion</h4> 2191<p class="discussion">This function only adds attributes for a single group. Call this 2192function multiple times for each group, or use <a href="#cupsEncodeOptions"><code>cupsEncodeOptions</code></a> 2193to add the standard groups. 2194 2195</p> 2196<h3 class="function"><a id="cupsEncryption">cupsEncryption</a></h3> 2197<p class="description">Get the current encryption settings.</p> 2198<p class="code"> 2199<a href="#http_encryption_t">http_encryption_t</a> cupsEncryption(void);</p> 2200<h4 class="returnvalue">Return Value</h4> 2201<p class="description">Encryption settings</p> 2202<h4 class="discussion">Discussion</h4> 2203<p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION 2204environment variable, then the ~/.cups/client.conf file, and finally the 2205/etc/cups/client.conf file. If not set, the default is 2206<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br> 2207<br> 2208Note: The current encryption setting is tracked separately for each thread 2209in a program. Multi-threaded programs that override the setting via the 2210<a href="#cupsSetEncryption"><code>cupsSetEncryption</code></a> function need to do so in each thread for the same 2211setting to be used.</p> 2212<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsEnumDests">cupsEnumDests</a></h3> 2213<p class="description">Enumerate available destinations with a callback function.</p> 2214<p class="code"> 2215int cupsEnumDests(unsigned flags, int msec, int *cancel, <a href="#cups_ptype_t">cups_ptype_t</a> type, <a href="#cups_ptype_t">cups_ptype_t</a> mask, <a href="#cups_dest_cb_t">cups_dest_cb_t</a> cb, void *user_data);</p> 2216<h4 class="parameters">Parameters</h4> 2217<table class="list"><tbody> 2218<tr><th>flags</th> 2219<td class="description">Enumeration flags</td></tr> 2220<tr><th>msec</th> 2221<td class="description">Timeout in milliseconds, -1 for indefinite</td></tr> 2222<tr><th>cancel</th> 2223<td class="description">Pointer to "cancel" variable</td></tr> 2224<tr><th>type</th> 2225<td class="description">Printer type bits</td></tr> 2226<tr><th>mask</th> 2227<td class="description">Mask for printer type bits</td></tr> 2228<tr><th>cb</th> 2229<td class="description">Callback function</td></tr> 2230<tr><th>user_data</th> 2231<td class="description">User data</td></tr> 2232</tbody></table> 2233<h4 class="returnvalue">Return Value</h4> 2234<p class="description">1 on success, 0 on failure</p> 2235<h4 class="discussion">Discussion</h4> 2236<p class="discussion">Destinations are enumerated from one or more sources. The callback function 2237receives the <code>user_data</code> pointer and the destination pointer which can 2238be used as input to the <a href="#cupsCopyDest"><code>cupsCopyDest</code></a> function. The function must 2239return 1 to continue enumeration or 0 to stop.<br> 2240<br> 2241The <code>type</code> and <code>mask</code> arguments allow the caller to filter the 2242destinations that are enumerated. Passing 0 for both will enumerate all 2243printers. The constant <code>CUPS_PRINTER_DISCOVERED</code> is used to filter on 2244destinations that are available but have not yet been added locally.<br> 2245<br> 2246Enumeration happens on the current thread and does not return until all 2247destinations have been enumerated or the callback function returns 0.<br> 2248<br> 2249Note: The callback function will likely receive multiple updates for the same 2250destinations - it is up to the caller to suppress any duplicate destinations. 2251 2252</p> 2253<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileClose">cupsFileClose</a></h3> 2254<p class="description">Close a CUPS file.</p> 2255<p class="code"> 2256int cupsFileClose(<a href="#cups_file_t">cups_file_t</a> *fp);</p> 2257<h4 class="parameters">Parameters</h4> 2258<table class="list"><tbody> 2259<tr><th>fp</th> 2260<td class="description">CUPS file</td></tr> 2261</tbody></table> 2262<h4 class="returnvalue">Return Value</h4> 2263<p class="description">0 on success, -1 on error</p> 2264<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileCompression">cupsFileCompression</a></h3> 2265<p class="description">Return whether a file is compressed.</p> 2266<p class="code"> 2267int cupsFileCompression(<a href="#cups_file_t">cups_file_t</a> *fp);</p> 2268<h4 class="parameters">Parameters</h4> 2269<table class="list"><tbody> 2270<tr><th>fp</th> 2271<td class="description">CUPS file</td></tr> 2272</tbody></table> 2273<h4 class="returnvalue">Return Value</h4> 2274<p class="description"><code>CUPS_FILE_NONE</code> or <code>CUPS_FILE_GZIP</code></p> 2275<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileEOF">cupsFileEOF</a></h3> 2276<p class="description">Return the end-of-file status.</p> 2277<p class="code"> 2278int cupsFileEOF(<a href="#cups_file_t">cups_file_t</a> *fp);</p> 2279<h4 class="parameters">Parameters</h4> 2280<table class="list"><tbody> 2281<tr><th>fp</th> 2282<td class="description">CUPS file</td></tr> 2283</tbody></table> 2284<h4 class="returnvalue">Return Value</h4> 2285<p class="description">1 on end of file, 0 otherwise</p> 2286<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileFind">cupsFileFind</a></h3> 2287<p class="description">Find a file using the specified path.</p> 2288<p class="code"> 2289const char *cupsFileFind(const char *filename, const char *path, int executable, char *buffer, int bufsize);</p> 2290<h4 class="parameters">Parameters</h4> 2291<table class="list"><tbody> 2292<tr><th>filename</th> 2293<td class="description">File to find</td></tr> 2294<tr><th>path</th> 2295<td class="description">Colon/semicolon-separated path</td></tr> 2296<tr><th>executable</th> 2297<td class="description">1 = executable files, 0 = any file/dir</td></tr> 2298<tr><th>buffer</th> 2299<td class="description">Filename buffer</td></tr> 2300<tr><th>bufsize</th> 2301<td class="description">Size of filename buffer</td></tr> 2302</tbody></table> 2303<h4 class="returnvalue">Return Value</h4> 2304<p class="description">Full path to file or <code>NULL</code> if not found</p> 2305<h4 class="discussion">Discussion</h4> 2306<p class="discussion">This function allows the paths in the path string to be separated by 2307colons (UNIX standard) or semicolons (Windows standard) and stores the 2308result in the buffer supplied. If the file cannot be found in any of 2309the supplied paths, <code>NULL</code> is returned. A <code>NULL</code> path only 2310matches the current directory. 2311 2312</p> 2313<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileFlush">cupsFileFlush</a></h3> 2314<p class="description">Flush pending output.</p> 2315<p class="code"> 2316int cupsFileFlush(<a href="#cups_file_t">cups_file_t</a> *fp);</p> 2317<h4 class="parameters">Parameters</h4> 2318<table class="list"><tbody> 2319<tr><th>fp</th> 2320<td class="description">CUPS file</td></tr> 2321</tbody></table> 2322<h4 class="returnvalue">Return Value</h4> 2323<p class="description">0 on success, -1 on error</p> 2324<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileGetChar">cupsFileGetChar</a></h3> 2325<p class="description">Get a single character from a file.</p> 2326<p class="code"> 2327int cupsFileGetChar(<a href="#cups_file_t">cups_file_t</a> *fp);</p> 2328<h4 class="parameters">Parameters</h4> 2329<table class="list"><tbody> 2330<tr><th>fp</th> 2331<td class="description">CUPS file</td></tr> 2332</tbody></table> 2333<h4 class="returnvalue">Return Value</h4> 2334<p class="description">Character or -1 on end of file</p> 2335<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileGetConf">cupsFileGetConf</a></h3> 2336<p class="description">Get a line from a configuration file.</p> 2337<p class="code"> 2338char *cupsFileGetConf(<a href="#cups_file_t">cups_file_t</a> *fp, char *buf, size_t buflen, char **value, int *linenum);</p> 2339<h4 class="parameters">Parameters</h4> 2340<table class="list"><tbody> 2341<tr><th>fp</th> 2342<td class="description">CUPS file</td></tr> 2343<tr><th>buf</th> 2344<td class="description">String buffer</td></tr> 2345<tr><th>buflen</th> 2346<td class="description">Size of string buffer</td></tr> 2347<tr><th>value</th> 2348<td class="description">Pointer to value</td></tr> 2349<tr><th>linenum</th> 2350<td class="description">Current line number</td></tr> 2351</tbody></table> 2352<h4 class="returnvalue">Return Value</h4> 2353<p class="description">Line read or <code>NULL</code> on end of file or error</p> 2354<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileGetLine">cupsFileGetLine</a></h3> 2355<p class="description">Get a CR and/or LF-terminated line that may 2356contain binary data.</p> 2357<p class="code"> 2358size_t cupsFileGetLine(<a href="#cups_file_t">cups_file_t</a> *fp, char *buf, size_t buflen);</p> 2359<h4 class="parameters">Parameters</h4> 2360<table class="list"><tbody> 2361<tr><th>fp</th> 2362<td class="description">File to read from</td></tr> 2363<tr><th>buf</th> 2364<td class="description">Buffer</td></tr> 2365<tr><th>buflen</th> 2366<td class="description">Size of buffer</td></tr> 2367</tbody></table> 2368<h4 class="returnvalue">Return Value</h4> 2369<p class="description">Number of bytes on line or 0 on end of file</p> 2370<h4 class="discussion">Discussion</h4> 2371<p class="discussion">This function differs from <a href="#cupsFileGets"><code>cupsFileGets</code></a> in that the trailing CR 2372and LF are preserved, as is any binary data on the line. The buffer is 2373nul-terminated, however you should use the returned length to determine 2374the number of bytes on the line. 2375 2376</p> 2377<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileGets">cupsFileGets</a></h3> 2378<p class="description">Get a CR and/or LF-terminated line.</p> 2379<p class="code"> 2380char *cupsFileGets(<a href="#cups_file_t">cups_file_t</a> *fp, char *buf, size_t buflen);</p> 2381<h4 class="parameters">Parameters</h4> 2382<table class="list"><tbody> 2383<tr><th>fp</th> 2384<td class="description">CUPS file</td></tr> 2385<tr><th>buf</th> 2386<td class="description">String buffer</td></tr> 2387<tr><th>buflen</th> 2388<td class="description">Size of string buffer</td></tr> 2389</tbody></table> 2390<h4 class="returnvalue">Return Value</h4> 2391<p class="description">Line read or <code>NULL</code> on end of file or error</p> 2392<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileLock">cupsFileLock</a></h3> 2393<p class="description">Temporarily lock access to a file.</p> 2394<p class="code"> 2395int cupsFileLock(<a href="#cups_file_t">cups_file_t</a> *fp, int block);</p> 2396<h4 class="parameters">Parameters</h4> 2397<table class="list"><tbody> 2398<tr><th>fp</th> 2399<td class="description">CUPS file</td></tr> 2400<tr><th>block</th> 2401<td class="description">1 to wait for the lock, 0 to fail right away</td></tr> 2402</tbody></table> 2403<h4 class="returnvalue">Return Value</h4> 2404<p class="description">0 on success, -1 on error</p> 2405<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileNumber">cupsFileNumber</a></h3> 2406<p class="description">Return the file descriptor associated with a CUPS file.</p> 2407<p class="code"> 2408int cupsFileNumber(<a href="#cups_file_t">cups_file_t</a> *fp);</p> 2409<h4 class="parameters">Parameters</h4> 2410<table class="list"><tbody> 2411<tr><th>fp</th> 2412<td class="description">CUPS file</td></tr> 2413</tbody></table> 2414<h4 class="returnvalue">Return Value</h4> 2415<p class="description">File descriptor</p> 2416<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileOpen">cupsFileOpen</a></h3> 2417<p class="description">Open a CUPS file.</p> 2418<p class="code"> 2419<a href="#cups_file_t">cups_file_t</a> *cupsFileOpen(const char *filename, const char *mode);</p> 2420<h4 class="parameters">Parameters</h4> 2421<table class="list"><tbody> 2422<tr><th>filename</th> 2423<td class="description">Name of file</td></tr> 2424<tr><th>mode</th> 2425<td class="description">Open mode</td></tr> 2426</tbody></table> 2427<h4 class="returnvalue">Return Value</h4> 2428<p class="description">CUPS file or <code>NULL</code> if the file or socket cannot be opened</p> 2429<h4 class="discussion">Discussion</h4> 2430<p class="discussion">The "mode" parameter can be "r" to read, "w" to write, overwriting any 2431existing file, "a" to append to an existing file or create a new file, 2432or "s" to open a socket connection.<br> 2433<br> 2434When opening for writing ("w"), an optional number from 1 to 9 can be 2435supplied which enables Flate compression of the file. Compression is 2436not supported for the "a" (append) mode.<br> 2437<br> 2438When opening a socket connection, the filename is a string of the form 2439"address:port" or "hostname:port". The socket will make an IPv4 or IPv6 2440connection as needed, generally preferring IPv6 connections when there is 2441a choice. 2442 2443</p> 2444<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileOpenFd">cupsFileOpenFd</a></h3> 2445<p class="description">Open a CUPS file using a file descriptor.</p> 2446<p class="code"> 2447<a href="#cups_file_t">cups_file_t</a> *cupsFileOpenFd(int fd, const char *mode);</p> 2448<h4 class="parameters">Parameters</h4> 2449<table class="list"><tbody> 2450<tr><th>fd</th> 2451<td class="description">File descriptor</td></tr> 2452<tr><th>mode</th> 2453<td class="description">Open mode</td></tr> 2454</tbody></table> 2455<h4 class="returnvalue">Return Value</h4> 2456<p class="description">CUPS file or <code>NULL</code> if the file could not be opened</p> 2457<h4 class="discussion">Discussion</h4> 2458<p class="discussion">The "mode" parameter can be "r" to read, "w" to write, "a" to append, 2459or "s" to treat the file descriptor as a bidirectional socket connection.<br> 2460<br> 2461When opening for writing ("w"), an optional number from 1 to 9 can be 2462supplied which enables Flate compression of the file. Compression is 2463not supported for the "a" (append) mode. 2464 2465</p> 2466<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFilePeekChar">cupsFilePeekChar</a></h3> 2467<p class="description">Peek at the next character from a file.</p> 2468<p class="code"> 2469int cupsFilePeekChar(<a href="#cups_file_t">cups_file_t</a> *fp);</p> 2470<h4 class="parameters">Parameters</h4> 2471<table class="list"><tbody> 2472<tr><th>fp</th> 2473<td class="description">CUPS file</td></tr> 2474</tbody></table> 2475<h4 class="returnvalue">Return Value</h4> 2476<p class="description">Character or -1 on end of file</p> 2477<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFilePrintf">cupsFilePrintf</a></h3> 2478<p class="description">Write a formatted string.</p> 2479<p class="code"> 2480int cupsFilePrintf(<a href="#cups_file_t">cups_file_t</a> *fp, const char *format, ...);</p> 2481<h4 class="parameters">Parameters</h4> 2482<table class="list"><tbody> 2483<tr><th>fp</th> 2484<td class="description">CUPS file</td></tr> 2485<tr><th>format</th> 2486<td class="description">Printf-style format string</td></tr> 2487<tr><th>...</th> 2488<td class="description">Additional args as necessary</td></tr> 2489</tbody></table> 2490<h4 class="returnvalue">Return Value</h4> 2491<p class="description">Number of bytes written or -1 on error</p> 2492<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFilePutChar">cupsFilePutChar</a></h3> 2493<p class="description">Write a character.</p> 2494<p class="code"> 2495int cupsFilePutChar(<a href="#cups_file_t">cups_file_t</a> *fp, int c);</p> 2496<h4 class="parameters">Parameters</h4> 2497<table class="list"><tbody> 2498<tr><th>fp</th> 2499<td class="description">CUPS file</td></tr> 2500<tr><th>c</th> 2501<td class="description">Character to write</td></tr> 2502</tbody></table> 2503<h4 class="returnvalue">Return Value</h4> 2504<p class="description">0 on success, -1 on error</p> 2505<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsFilePutConf">cupsFilePutConf</a></h3> 2506<p class="description">Write a configuration line.</p> 2507<p class="code"> 2508ssize_t cupsFilePutConf(<a href="#cups_file_t">cups_file_t</a> *fp, const char *directive, const char *value);</p> 2509<h4 class="parameters">Parameters</h4> 2510<table class="list"><tbody> 2511<tr><th>fp</th> 2512<td class="description">CUPS file</td></tr> 2513<tr><th>directive</th> 2514<td class="description">Directive</td></tr> 2515<tr><th>value</th> 2516<td class="description">Value</td></tr> 2517</tbody></table> 2518<h4 class="returnvalue">Return Value</h4> 2519<p class="description">Number of bytes written or -1 on error</p> 2520<h4 class="discussion">Discussion</h4> 2521<p class="discussion">This function handles any comment escaping of the value. 2522 2523</p> 2524<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFilePuts">cupsFilePuts</a></h3> 2525<p class="description">Write a string.</p> 2526<p class="code"> 2527int cupsFilePuts(<a href="#cups_file_t">cups_file_t</a> *fp, const char *s);</p> 2528<h4 class="parameters">Parameters</h4> 2529<table class="list"><tbody> 2530<tr><th>fp</th> 2531<td class="description">CUPS file</td></tr> 2532<tr><th>s</th> 2533<td class="description">String to write</td></tr> 2534</tbody></table> 2535<h4 class="returnvalue">Return Value</h4> 2536<p class="description">Number of bytes written or -1 on error</p> 2537<h4 class="discussion">Discussion</h4> 2538<p class="discussion">Like the <code>fputs</code> function, no newline is appended to the string. 2539 2540</p> 2541<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileRead">cupsFileRead</a></h3> 2542<p class="description">Read from a file.</p> 2543<p class="code"> 2544ssize_t cupsFileRead(<a href="#cups_file_t">cups_file_t</a> *fp, char *buf, size_t bytes);</p> 2545<h4 class="parameters">Parameters</h4> 2546<table class="list"><tbody> 2547<tr><th>fp</th> 2548<td class="description">CUPS file</td></tr> 2549<tr><th>buf</th> 2550<td class="description">Buffer</td></tr> 2551<tr><th>bytes</th> 2552<td class="description">Number of bytes to read</td></tr> 2553</tbody></table> 2554<h4 class="returnvalue">Return Value</h4> 2555<p class="description">Number of bytes read or -1 on error</p> 2556<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileRewind">cupsFileRewind</a></h3> 2557<p class="description">Set the current file position to the beginning of the 2558file.</p> 2559<p class="code"> 2560off_t cupsFileRewind(<a href="#cups_file_t">cups_file_t</a> *fp);</p> 2561<h4 class="parameters">Parameters</h4> 2562<table class="list"><tbody> 2563<tr><th>fp</th> 2564<td class="description">CUPS file</td></tr> 2565</tbody></table> 2566<h4 class="returnvalue">Return Value</h4> 2567<p class="description">New file position or -1 on error</p> 2568<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileSeek">cupsFileSeek</a></h3> 2569<p class="description">Seek in a file.</p> 2570<p class="code"> 2571off_t cupsFileSeek(<a href="#cups_file_t">cups_file_t</a> *fp, off_t pos);</p> 2572<h4 class="parameters">Parameters</h4> 2573<table class="list"><tbody> 2574<tr><th>fp</th> 2575<td class="description">CUPS file</td></tr> 2576<tr><th>pos</th> 2577<td class="description">Position in file</td></tr> 2578</tbody></table> 2579<h4 class="returnvalue">Return Value</h4> 2580<p class="description">New file position or -1 on error</p> 2581<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileStderr">cupsFileStderr</a></h3> 2582<p class="description">Return a CUPS file associated with stderr.</p> 2583<p class="code"> 2584<a href="#cups_file_t">cups_file_t</a> *cupsFileStderr(void);</p> 2585<h4 class="returnvalue">Return Value</h4> 2586<p class="description">CUPS file</p> 2587<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileStdin">cupsFileStdin</a></h3> 2588<p class="description">Return a CUPS file associated with stdin.</p> 2589<p class="code"> 2590<a href="#cups_file_t">cups_file_t</a> *cupsFileStdin(void);</p> 2591<h4 class="returnvalue">Return Value</h4> 2592<p class="description">CUPS file</p> 2593<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileStdout">cupsFileStdout</a></h3> 2594<p class="description">Return a CUPS file associated with stdout.</p> 2595<p class="code"> 2596<a href="#cups_file_t">cups_file_t</a> *cupsFileStdout(void);</p> 2597<h4 class="returnvalue">Return Value</h4> 2598<p class="description">CUPS file</p> 2599<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileTell">cupsFileTell</a></h3> 2600<p class="description">Return the current file position.</p> 2601<p class="code"> 2602off_t cupsFileTell(<a href="#cups_file_t">cups_file_t</a> *fp);</p> 2603<h4 class="parameters">Parameters</h4> 2604<table class="list"><tbody> 2605<tr><th>fp</th> 2606<td class="description">CUPS file</td></tr> 2607</tbody></table> 2608<h4 class="returnvalue">Return Value</h4> 2609<p class="description">File position</p> 2610<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileUnlock">cupsFileUnlock</a></h3> 2611<p class="description">Unlock access to a file.</p> 2612<p class="code"> 2613int cupsFileUnlock(<a href="#cups_file_t">cups_file_t</a> *fp);</p> 2614<h4 class="parameters">Parameters</h4> 2615<table class="list"><tbody> 2616<tr><th>fp</th> 2617<td class="description">CUPS file</td></tr> 2618</tbody></table> 2619<h4 class="returnvalue">Return Value</h4> 2620<p class="description">0 on success, -1 on error</p> 2621<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsFileWrite">cupsFileWrite</a></h3> 2622<p class="description">Write to a file.</p> 2623<p class="code"> 2624ssize_t cupsFileWrite(<a href="#cups_file_t">cups_file_t</a> *fp, const char *buf, size_t bytes);</p> 2625<h4 class="parameters">Parameters</h4> 2626<table class="list"><tbody> 2627<tr><th>fp</th> 2628<td class="description">CUPS file</td></tr> 2629<tr><th>buf</th> 2630<td class="description">Buffer</td></tr> 2631<tr><th>bytes</th> 2632<td class="description">Number of bytes to write</td></tr> 2633</tbody></table> 2634<h4 class="returnvalue">Return Value</h4> 2635<p class="description">Number of bytes written or -1 on error</p> 2636<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsFindDestDefault">cupsFindDestDefault</a></h3> 2637<p class="description">Find the default value(s) for the given option.</p> 2638<p class="code"> 2639<a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestDefault(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option);</p> 2640<h4 class="parameters">Parameters</h4> 2641<table class="list"><tbody> 2642<tr><th>http</th> 2643<td class="description">Connection to destination</td></tr> 2644<tr><th>dest</th> 2645<td class="description">Destination</td></tr> 2646<tr><th>dinfo</th> 2647<td class="description">Destination information</td></tr> 2648<tr><th>option</th> 2649<td class="description">Option/attribute name</td></tr> 2650</tbody></table> 2651<h4 class="returnvalue">Return Value</h4> 2652<p class="description">Default attribute or <code>NULL</code> for none</p> 2653<h4 class="discussion">Discussion</h4> 2654<p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>, 2655<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>, 2656<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>, 2657<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code> 2658functions to inspect the default value(s) as needed. 2659 2660</p> 2661<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsFindDestReady">cupsFindDestReady</a></h3> 2662<p class="description">Find the default value(s) for the given option.</p> 2663<p class="code"> 2664<a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestReady(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option);</p> 2665<h4 class="parameters">Parameters</h4> 2666<table class="list"><tbody> 2667<tr><th>http</th> 2668<td class="description">Connection to destination</td></tr> 2669<tr><th>dest</th> 2670<td class="description">Destination</td></tr> 2671<tr><th>dinfo</th> 2672<td class="description">Destination information</td></tr> 2673<tr><th>option</th> 2674<td class="description">Option/attribute name</td></tr> 2675</tbody></table> 2676<h4 class="returnvalue">Return Value</h4> 2677<p class="description">Default attribute or <code>NULL</code> for none</p> 2678<h4 class="discussion">Discussion</h4> 2679<p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>, 2680<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>, 2681<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>, 2682<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code> 2683functions to inspect the default value(s) as needed. 2684 2685</p> 2686<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsFindDestSupported">cupsFindDestSupported</a></h3> 2687<p class="description">Find the default value(s) for the given option.</p> 2688<p class="code"> 2689<a href="#ipp_attribute_t">ipp_attribute_t</a> *cupsFindDestSupported(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option);</p> 2690<h4 class="parameters">Parameters</h4> 2691<table class="list"><tbody> 2692<tr><th>http</th> 2693<td class="description">Connection to destination</td></tr> 2694<tr><th>dest</th> 2695<td class="description">Destination</td></tr> 2696<tr><th>dinfo</th> 2697<td class="description">Destination information</td></tr> 2698<tr><th>option</th> 2699<td class="description">Option/attribute name</td></tr> 2700</tbody></table> 2701<h4 class="returnvalue">Return Value</h4> 2702<p class="description">Default attribute or <code>NULL</code> for none</p> 2703<h4 class="discussion">Discussion</h4> 2704<p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>, 2705<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>, 2706<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>, 2707<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code> 2708functions to inspect the default value(s) as needed. 2709 2710</p> 2711<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsFinishDestDocument">cupsFinishDestDocument</a></h3> 2712<p class="description">Finish the current document.</p> 2713<p class="code"> 2714ipp_status_t cupsFinishDestDocument(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info);</p> 2715<h4 class="parameters">Parameters</h4> 2716<table class="list"><tbody> 2717<tr><th>http</th> 2718<td class="description">Connection to destination</td></tr> 2719<tr><th>dest</th> 2720<td class="description">Destination</td></tr> 2721<tr><th>info</th> 2722<td class="description">Destination information</td></tr> 2723</tbody></table> 2724<h4 class="returnvalue">Return Value</h4> 2725<p class="description">Status of document submission</p> 2726<h4 class="discussion">Discussion</h4> 2727<p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success. 2728 2729</p> 2730<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsFreeDestInfo">cupsFreeDestInfo</a></h3> 2731<p class="description">Free destination information obtained using 2732<a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a>.</p> 2733<p class="code"> 2734void cupsFreeDestInfo(<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo);</p> 2735<h4 class="parameters">Parameters</h4> 2736<table class="list"><tbody> 2737<tr><th>dinfo</th> 2738<td class="description">Destination information</td></tr> 2739</tbody></table> 2740<h3 class="function"><a id="cupsFreeDests">cupsFreeDests</a></h3> 2741<p class="description">Free the memory used by the list of destinations.</p> 2742<p class="code"> 2743void cupsFreeDests(int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p> 2744<h4 class="parameters">Parameters</h4> 2745<table class="list"><tbody> 2746<tr><th>num_dests</th> 2747<td class="description">Number of destinations</td></tr> 2748<tr><th>dests</th> 2749<td class="description">Destinations</td></tr> 2750</tbody></table> 2751<h3 class="function"><a id="cupsFreeJobs">cupsFreeJobs</a></h3> 2752<p class="description">Free memory used by job data.</p> 2753<p class="code"> 2754void cupsFreeJobs(int num_jobs, <a href="#cups_job_t">cups_job_t</a> *jobs);</p> 2755<h4 class="parameters">Parameters</h4> 2756<table class="list"><tbody> 2757<tr><th>num_jobs</th> 2758<td class="description">Number of jobs</td></tr> 2759<tr><th>jobs</th> 2760<td class="description">Jobs</td></tr> 2761</tbody></table> 2762<h3 class="function"><a id="cupsFreeOptions">cupsFreeOptions</a></h3> 2763<p class="description">Free all memory used by options.</p> 2764<p class="code"> 2765void cupsFreeOptions(int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p> 2766<h4 class="parameters">Parameters</h4> 2767<table class="list"><tbody> 2768<tr><th>num_options</th> 2769<td class="description">Number of options</td></tr> 2770<tr><th>options</th> 2771<td class="description">Pointer to options</td></tr> 2772</tbody></table> 2773<h3 class="function"><a id="cupsGetDest">cupsGetDest</a></h3> 2774<p class="description">Get the named destination from the list.</p> 2775<p class="code"> 2776<a href="#cups_dest_t">cups_dest_t</a> *cupsGetDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p> 2777<h4 class="parameters">Parameters</h4> 2778<table class="list"><tbody> 2779<tr><th>name</th> 2780<td class="description">Destination name or <code>NULL</code> for the default destination</td></tr> 2781<tr><th>instance</th> 2782<td class="description">Instance name or <code>NULL</code></td></tr> 2783<tr><th>num_dests</th> 2784<td class="description">Number of destinations</td></tr> 2785<tr><th>dests</th> 2786<td class="description">Destinations</td></tr> 2787</tbody></table> 2788<h4 class="returnvalue">Return Value</h4> 2789<p class="description">Destination pointer or <code>NULL</code></p> 2790<h4 class="discussion">Discussion</h4> 2791<p class="discussion">Use the <a href="#cupsEnumDests"><code>cupsEnumDests</code></a> or <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> functions to get a 2792list of supported destinations for the current user.</p> 2793<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></h3> 2794<p class="description">Get a media name, dimension, and margins for a 2795specific size.</p> 2796<p class="code"> 2797int cupsGetDestMediaByIndex(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, int n, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p> 2798<h4 class="parameters">Parameters</h4> 2799<table class="list"><tbody> 2800<tr><th>http</th> 2801<td class="description">Connection to destination</td></tr> 2802<tr><th>dest</th> 2803<td class="description">Destination</td></tr> 2804<tr><th>dinfo</th> 2805<td class="description">Destination information</td></tr> 2806<tr><th>n</th> 2807<td class="description">Media size number (0-based)</td></tr> 2808<tr><th>flags</th> 2809<td class="description">Media flags</td></tr> 2810<tr><th>size</th> 2811<td class="description">Media size information</td></tr> 2812</tbody></table> 2813<h4 class="returnvalue">Return Value</h4> 2814<p class="description">1 on success, 0 on failure</p> 2815<h4 class="discussion">Discussion</h4> 2816<p class="discussion">The <code>flags</code> parameter determines which set of media are indexed. For 2817example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will get the Nth 2818borderless size supported by the printer. 2819 2820</p> 2821<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsGetDestMediaByName">cupsGetDestMediaByName</a></h3> 2822<p class="description">Get media names, dimensions, and margins.</p> 2823<p class="code"> 2824int cupsGetDestMediaByName(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *media, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p> 2825<h4 class="parameters">Parameters</h4> 2826<table class="list"><tbody> 2827<tr><th>http</th> 2828<td class="description">Connection to destination</td></tr> 2829<tr><th>dest</th> 2830<td class="description">Destination</td></tr> 2831<tr><th>dinfo</th> 2832<td class="description">Destination information</td></tr> 2833<tr><th>media</th> 2834<td class="description">Media name</td></tr> 2835<tr><th>flags</th> 2836<td class="description">Media matching flags</td></tr> 2837<tr><th>size</th> 2838<td class="description">Media size information</td></tr> 2839</tbody></table> 2840<h4 class="returnvalue">Return Value</h4> 2841<p class="description">1 on match, 0 on failure</p> 2842<h4 class="discussion">Discussion</h4> 2843<p class="discussion">The "media" string is a PWG media name. "Flags" provides some matching 2844guidance (multiple flags can be combined):<br> 2845<br> 2846CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer, 2847CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size, 2848CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing, 2849CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and 2850CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the 2851size amongst the "ready" media.<br> 2852<br> 2853The matching result (if any) is returned in the "cups_size_t" structure.<br> 2854<br> 2855Returns 1 when there is a match and 0 if there is not a match. 2856 2857</p> 2858<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></h3> 2859<p class="description">Get media names, dimensions, and margins.</p> 2860<p class="code"> 2861int cupsGetDestMediaBySize(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, int width, int length, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p> 2862<h4 class="parameters">Parameters</h4> 2863<table class="list"><tbody> 2864<tr><th>http</th> 2865<td class="description">Connection to destination</td></tr> 2866<tr><th>dest</th> 2867<td class="description">Destination</td></tr> 2868<tr><th>dinfo</th> 2869<td class="description">Destination information</td></tr> 2870<tr><th>width</th> 2871<td class="description">Media width in hundredths of 2872of millimeters</td></tr> 2873<tr><th>length</th> 2874<td class="description">Media length in hundredths of 2875of millimeters</td></tr> 2876<tr><th>flags</th> 2877<td class="description">Media matching flags</td></tr> 2878<tr><th>size</th> 2879<td class="description">Media size information</td></tr> 2880</tbody></table> 2881<h4 class="returnvalue">Return Value</h4> 2882<p class="description">1 on match, 0 on failure</p> 2883<h4 class="discussion">Discussion</h4> 2884<p class="discussion">"Width" and "length" are the dimensions in hundredths of millimeters. 2885"Flags" provides some matching guidance (multiple flags can be combined):<br> 2886<br> 2887CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer, 2888CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size, 2889CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing, 2890CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and 2891CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the 2892size amongst the "ready" media.<br> 2893<br> 2894The matching result (if any) is returned in the "cups_size_t" structure.<br> 2895<br> 2896Returns 1 when there is a match and 0 if there is not a match. 2897 2898</p> 2899<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsGetDestMediaCount">cupsGetDestMediaCount</a></h3> 2900<p class="description">Get the number of sizes supported by a 2901destination.</p> 2902<p class="code"> 2903int cupsGetDestMediaCount(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags);</p> 2904<h4 class="parameters">Parameters</h4> 2905<table class="list"><tbody> 2906<tr><th>http</th> 2907<td class="description">Connection to destination</td></tr> 2908<tr><th>dest</th> 2909<td class="description">Destination</td></tr> 2910<tr><th>dinfo</th> 2911<td class="description">Destination information</td></tr> 2912<tr><th>flags</th> 2913<td class="description">Media flags</td></tr> 2914</tbody></table> 2915<h4 class="returnvalue">Return Value</h4> 2916<p class="description">Number of sizes</p> 2917<h4 class="discussion">Discussion</h4> 2918<p class="discussion">The <code>flags</code> parameter determines the set of media sizes that are 2919counted. For example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return 2920the number of borderless sizes. 2921 2922</p> 2923<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></h3> 2924<p class="description">Get the default size for a destination.</p> 2925<p class="code"> 2926int cupsGetDestMediaDefault(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p> 2927<h4 class="parameters">Parameters</h4> 2928<table class="list"><tbody> 2929<tr><th>http</th> 2930<td class="description">Connection to destination</td></tr> 2931<tr><th>dest</th> 2932<td class="description">Destination</td></tr> 2933<tr><th>dinfo</th> 2934<td class="description">Destination information</td></tr> 2935<tr><th>flags</th> 2936<td class="description">Media flags</td></tr> 2937<tr><th>size</th> 2938<td class="description">Media size information</td></tr> 2939</tbody></table> 2940<h4 class="returnvalue">Return Value</h4> 2941<p class="description">1 on success, 0 on failure</p> 2942<h4 class="discussion">Discussion</h4> 2943<p class="discussion">The <code>flags</code> parameter determines which default size is returned. For 2944example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the default 2945borderless size, typically US Letter or A4, but sometimes 4x6 photo media. 2946 2947</p> 2948<h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="cupsGetDestWithURI">cupsGetDestWithURI</a></h3> 2949<p class="description">Get a destination associated with a URI.</p> 2950<p class="code"> 2951<a href="#cups_dest_t">cups_dest_t</a> *cupsGetDestWithURI(const char *name, const char *uri);</p> 2952<h4 class="parameters">Parameters</h4> 2953<table class="list"><tbody> 2954<tr><th>name</th> 2955<td class="description">Desired printer name or <code>NULL</code></td></tr> 2956<tr><th>uri</th> 2957<td class="description">URI for the printer</td></tr> 2958</tbody></table> 2959<h4 class="returnvalue">Return Value</h4> 2960<p class="description">Destination or <code>NULL</code></p> 2961<h4 class="discussion">Discussion</h4> 2962<p class="discussion">"name" is the desired name for the printer. If <code>NULL</code>, a name will be 2963created using the URI.<br> 2964<br> 2965"uri" is the "ipp" or "ipps" URI for the printer. 2966 2967</p> 2968<h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsGetDests2">cupsGetDests2</a></h3> 2969<p class="description">Get the list of destinations from the specified server.</p> 2970<p class="code"> 2971int cupsGetDests2(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p> 2972<h4 class="parameters">Parameters</h4> 2973<table class="list"><tbody> 2974<tr><th>http</th> 2975<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> 2976<tr><th>dests</th> 2977<td class="description">Destinations</td></tr> 2978</tbody></table> 2979<h4 class="returnvalue">Return Value</h4> 2980<p class="description">Number of destinations</p> 2981<h4 class="discussion">Discussion</h4> 2982<p class="discussion">Starting with CUPS 1.2, the returned list of destinations include the 2983"printer-info", "printer-is-accepting-jobs", "printer-is-shared", 2984"printer-make-and-model", "printer-state", "printer-state-change-time", 2985"printer-state-reasons", "printer-type", and "printer-uri-supported" 2986attributes as options.<br> 2987<br> 2988CUPS 1.4 adds the "marker-change-time", "marker-colors", 2989"marker-high-levels", "marker-levels", "marker-low-levels", "marker-message", 2990"marker-names", "marker-types", and "printer-commands" attributes as options.<br> 2991<br> 2992CUPS 2.2 adds accessible IPP printers to the list of destinations that can 2993be used. The "printer-uri-supported" option will be present for those IPP 2994printers that have been recently used.<br> 2995<br> 2996Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and 2997the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination. 2998 2999</p> 3000<h3 class="function"><span class="info"> CUPS 2.2.4/macOS 10.13 </span><a id="cupsGetIntegerOption">cupsGetIntegerOption</a></h3> 3001<p class="description">Get an integer option value.</p> 3002<p class="code"> 3003int cupsGetIntegerOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p> 3004<h4 class="parameters">Parameters</h4> 3005<table class="list"><tbody> 3006<tr><th>name</th> 3007<td class="description">Name of option</td></tr> 3008<tr><th>num_options</th> 3009<td class="description">Number of options</td></tr> 3010<tr><th>options</th> 3011<td class="description">Options</td></tr> 3012</tbody></table> 3013<h4 class="returnvalue">Return Value</h4> 3014<p class="description">Option value or <code>INT_MIN</code></p> 3015<h4 class="discussion">Discussion</h4> 3016<p class="discussion">INT_MIN is returned when the option does not exist, is not an integer, or 3017exceeds the range of values for the "int" type. 3018 3019</p> 3020<h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsGetJobs2">cupsGetJobs2</a></h3> 3021<p class="description">Get the jobs from the specified server.</p> 3022<p class="code"> 3023int cupsGetJobs2(<a href="#http_t">http_t</a> *http, <a href="#cups_job_t">cups_job_t</a> **jobs, const char *name, int myjobs, int whichjobs);</p> 3024<h4 class="parameters">Parameters</h4> 3025<table class="list"><tbody> 3026<tr><th>http</th> 3027<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> 3028<tr><th>jobs</th> 3029<td class="description">Job data</td></tr> 3030<tr><th>name</th> 3031<td class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</td></tr> 3032<tr><th>myjobs</th> 3033<td class="description">0 = all users, 1 = mine</td></tr> 3034<tr><th>whichjobs</th> 3035<td class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></td></tr> 3036</tbody></table> 3037<h4 class="returnvalue">Return Value</h4> 3038<p class="description">Number of jobs</p> 3039<h4 class="discussion">Discussion</h4> 3040<p class="discussion">A "whichjobs" value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless 3041of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are 3042pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns 3043jobs that are stopped, canceled, aborted, or completed. 3044 3045</p> 3046<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsGetNamedDest">cupsGetNamedDest</a></h3> 3047<p class="description">Get options for the named destination.</p> 3048<p class="code"> 3049<a href="#cups_dest_t">cups_dest_t</a> *cupsGetNamedDest(<a href="#http_t">http_t</a> *http, const char *name, const char *instance);</p> 3050<h4 class="parameters">Parameters</h4> 3051<table class="list"><tbody> 3052<tr><th>http</th> 3053<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> 3054<tr><th>name</th> 3055<td class="description">Destination name or <code>NULL</code> for the default destination</td></tr> 3056<tr><th>instance</th> 3057<td class="description">Instance name or <code>NULL</code></td></tr> 3058</tbody></table> 3059<h4 class="returnvalue">Return Value</h4> 3060<p class="description">Destination or <code>NULL</code></p> 3061<h4 class="discussion">Discussion</h4> 3062<p class="discussion">This function is optimized for retrieving a single destination and should 3063be used instead of <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> when you 3064either know the name of the destination or want to print to the default 3065destination. If <code>NULL</code> is returned, the destination does not exist or 3066there is no default destination.<br> 3067<br> 3068If "http" is <code>CUPS_HTTP_DEFAULT</code>, the connection to the default print 3069server will be used.<br> 3070<br> 3071If "name" is <code>NULL</code>, the default printer for the current user will be 3072returned.<br> 3073<br> 3074The returned destination must be freed using <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> with a 3075"num_dests" value of 1. 3076 3077</p> 3078<h3 class="function"><a id="cupsGetOption">cupsGetOption</a></h3> 3079<p class="description">Get an option value.</p> 3080<p class="code"> 3081const char *cupsGetOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p> 3082<h4 class="parameters">Parameters</h4> 3083<table class="list"><tbody> 3084<tr><th>name</th> 3085<td class="description">Name of option</td></tr> 3086<tr><th>num_options</th> 3087<td class="description">Number of options</td></tr> 3088<tr><th>options</th> 3089<td class="description">Options</td></tr> 3090</tbody></table> 3091<h4 class="returnvalue">Return Value</h4> 3092<p class="description">Option value or <code>NULL</code></p> 3093<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsGetPassword2">cupsGetPassword2</a></h3> 3094<p class="description">Get a password from the user using the current 3095password callback.</p> 3096<p class="code"> 3097const char *cupsGetPassword2(const char *prompt, <a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p> 3098<h4 class="parameters">Parameters</h4> 3099<table class="list"><tbody> 3100<tr><th>prompt</th> 3101<td class="description">Prompt string</td></tr> 3102<tr><th>http</th> 3103<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> 3104<tr><th>method</th> 3105<td class="description">Request method ("GET", "POST", "PUT")</td></tr> 3106<tr><th>resource</th> 3107<td class="description">Resource path</td></tr> 3108</tbody></table> 3109<h4 class="returnvalue">Return Value</h4> 3110<p class="description">Password</p> 3111<h4 class="discussion">Discussion</h4> 3112<p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the 3113user does not provide a password.<br> 3114<br> 3115Note: The current password callback function is tracked separately for each 3116thread in a program. Multi-threaded programs that override the setting via 3117the <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> function need to do so in each thread for the 3118same function to be used. 3119 3120</p> 3121<h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></h3> 3122<p class="description">Get the localized string for a destination media 3123size.</p> 3124<p class="code"> 3125const char *cupsLocalizeDestMedia(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, unsigned flags, <a href="#cups_size_t">cups_size_t</a> *size);</p> 3126<h4 class="parameters">Parameters</h4> 3127<table class="list"><tbody> 3128<tr><th>http</th> 3129<td class="description">Connection to destination</td></tr> 3130<tr><th>dest</th> 3131<td class="description">Destination</td></tr> 3132<tr><th>dinfo</th> 3133<td class="description">Destination information</td></tr> 3134<tr><th>flags</th> 3135<td class="description">Media flags</td></tr> 3136<tr><th>size</th> 3137<td class="description">Media size</td></tr> 3138</tbody></table> 3139<h4 class="returnvalue">Return Value</h4> 3140<p class="description">Localized string</p> 3141<h4 class="discussion">Discussion</h4> 3142<p class="discussion">The returned string is stored in the destination information and will become 3143invalid if the destination information is deleted. 3144 3145</p> 3146<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsLocalizeDestOption">cupsLocalizeDestOption</a></h3> 3147<p class="description">Get the localized string for a destination 3148option.</p> 3149<p class="code"> 3150const char *cupsLocalizeDestOption(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option);</p> 3151<h4 class="parameters">Parameters</h4> 3152<table class="list"><tbody> 3153<tr><th>http</th> 3154<td class="description">Connection to destination</td></tr> 3155<tr><th>dest</th> 3156<td class="description">Destination</td></tr> 3157<tr><th>dinfo</th> 3158<td class="description">Destination information</td></tr> 3159<tr><th>option</th> 3160<td class="description">Option to localize</td></tr> 3161</tbody></table> 3162<h4 class="returnvalue">Return Value</h4> 3163<p class="description">Localized string</p> 3164<h4 class="discussion">Discussion</h4> 3165<p class="discussion">The returned string is stored in the destination information and will become 3166invalid if the destination information is deleted. 3167 3168</p> 3169<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsLocalizeDestValue">cupsLocalizeDestValue</a></h3> 3170<p class="description">Get the localized string for a destination 3171option+value pair.</p> 3172<p class="code"> 3173const char *cupsLocalizeDestValue(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo, const char *option, const char *value);</p> 3174<h4 class="parameters">Parameters</h4> 3175<table class="list"><tbody> 3176<tr><th>http</th> 3177<td class="description">Connection to destination</td></tr> 3178<tr><th>dest</th> 3179<td class="description">Destination</td></tr> 3180<tr><th>dinfo</th> 3181<td class="description">Destination information</td></tr> 3182<tr><th>option</th> 3183<td class="description">Option to localize</td></tr> 3184<tr><th>value</th> 3185<td class="description">Value to localize</td></tr> 3186</tbody></table> 3187<h4 class="returnvalue">Return Value</h4> 3188<p class="description">Localized string</p> 3189<h4 class="discussion">Discussion</h4> 3190<p class="discussion">The returned string is stored in the destination information and will become 3191invalid if the destination information is deleted. 3192 3193</p> 3194<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="cupsMakeServerCredentials">cupsMakeServerCredentials</a></h3> 3195<p class="description">Make a self-signed certificate and private key pair.</p> 3196<p class="code"> 3197int cupsMakeServerCredentials(const char *path, const char *common_name, int num_alt_names, const char **alt_names, time_t expiration_date);</p> 3198<h4 class="parameters">Parameters</h4> 3199<table class="list"><tbody> 3200<tr><th>path</th> 3201<td class="description">Keychain path or <code>NULL</code> for default</td></tr> 3202<tr><th>common_name</th> 3203<td class="description">Common name</td></tr> 3204<tr><th>num_alt_names</th> 3205<td class="description">Number of subject alternate names</td></tr> 3206<tr><th>alt_names</th> 3207<td class="description">Subject Alternate Names</td></tr> 3208<tr><th>expiration_date</th> 3209<td class="description">Expiration date</td></tr> 3210</tbody></table> 3211<h4 class="returnvalue">Return Value</h4> 3212<p class="description">1 on success, 0 on failure</p> 3213<h3 class="function"><a id="cupsParseOptions">cupsParseOptions</a></h3> 3214<p class="description">Parse options from a command-line argument.</p> 3215<p class="code"> 3216int cupsParseOptions(const char *arg, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p> 3217<h4 class="parameters">Parameters</h4> 3218<table class="list"><tbody> 3219<tr><th>arg</th> 3220<td class="description">Argument to parse</td></tr> 3221<tr><th>num_options</th> 3222<td class="description">Number of options</td></tr> 3223<tr><th>options</th> 3224<td class="description">Options found</td></tr> 3225</tbody></table> 3226<h4 class="returnvalue">Return Value</h4> 3227<p class="description">Number of options found</p> 3228<h4 class="discussion">Discussion</h4> 3229<p class="discussion">This function converts space-delimited name/value pairs according 3230to the PAPI text option ABNF specification. Collection values 3231("name={a=... b=... c=...}") are stored with the curley brackets 3232intact - use <code>cupsParseOptions</code> on the value to extract the 3233collection attributes.</p> 3234<h3 class="function"><a id="cupsRasterClose">cupsRasterClose</a></h3> 3235<p class="description">Close a raster stream.</p> 3236<p class="code"> 3237void cupsRasterClose(<a href="#cups_raster_t">cups_raster_t</a> *r);</p> 3238<h4 class="parameters">Parameters</h4> 3239<table class="list"><tbody> 3240<tr><th>r</th> 3241<td class="description">Stream to close</td></tr> 3242</tbody></table> 3243<h4 class="discussion">Discussion</h4> 3244<p class="discussion">The file descriptor associated with the raster stream must be closed 3245separately as needed.</p> 3246<h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="cupsRasterErrorString">cupsRasterErrorString</a></h3> 3247<p class="description">Return the last error from a raster function.</p> 3248<p class="code"> 3249const char *cupsRasterErrorString(void);</p> 3250<h4 class="returnvalue">Return Value</h4> 3251<p class="description">Last error or <code>NULL</code></p> 3252<h4 class="discussion">Discussion</h4> 3253<p class="discussion">If there are no recent errors, <code>NULL</code> is returned. 3254 3255</p> 3256<h3 class="function"><span class="info"> CUPS 2.2/macOS 10.12 </span><a id="cupsRasterInitPWGHeader">cupsRasterInitPWGHeader</a></h3> 3257<p class="description">Initialize a page header for PWG Raster output.</p> 3258<p class="code"> 3259int cupsRasterInitPWGHeader(<a href="#cups_page_header2_t">cups_page_header2_t</a> *h, <a href="#pwg_media_t">pwg_media_t</a> *media, const char *type, int xdpi, int ydpi, const char *sides, const char *sheet_back);</p> 3260<h4 class="parameters">Parameters</h4> 3261<table class="list"><tbody> 3262<tr><th>h</th> 3263<td class="description">Page header</td></tr> 3264<tr><th>media</th> 3265<td class="description">PWG media information</td></tr> 3266<tr><th>type</th> 3267<td class="description">PWG raster type string</td></tr> 3268<tr><th>xdpi</th> 3269<td class="description">Cross-feed direction (horizontal) resolution</td></tr> 3270<tr><th>ydpi</th> 3271<td class="description">Feed direction (vertical) resolution</td></tr> 3272<tr><th>sides</th> 3273<td class="description">IPP "sides" option value</td></tr> 3274<tr><th>sheet_back</th> 3275<td class="description">Transform for back side or <code>NULL</code> for none</td></tr> 3276</tbody></table> 3277<h4 class="returnvalue">Return Value</h4> 3278<p class="description">1 on success, 0 on failure</p> 3279<h4 class="discussion">Discussion</h4> 3280<p class="discussion">The "media" argument specifies the media to use.<br> 3281<br> 3282The "type" argument specifies a "pwg-raster-document-type-supported" value 3283that controls the color space and bit depth of the raster data.<br> 3284<br> 3285The "xres" and "yres" arguments specify the raster resolution in dots per 3286inch.<br> 3287<br> 3288The "sheet_back" argument specifies a "pwg-raster-document-sheet-back" value 3289to apply for the back side of a page. Pass <code>NULL</code> for the front side. 3290 3291</p> 3292<h3 class="function"><a id="cupsRasterOpen">cupsRasterOpen</a></h3> 3293<p class="description">Open a raster stream using a file descriptor.</p> 3294<p class="code"> 3295<a href="#cups_raster_t">cups_raster_t</a> *cupsRasterOpen(int fd, <a href="#cups_mode_t">cups_mode_t</a> mode);</p> 3296<h4 class="parameters">Parameters</h4> 3297<table class="list"><tbody> 3298<tr><th>fd</th> 3299<td class="description">File descriptor</td></tr> 3300<tr><th>mode</th> 3301<td class="description">Mode - <code>CUPS_RASTER_READ</code>, 3302<code>CUPS_RASTER_WRITE</code>, 3303<code>CUPS_RASTER_WRITE_COMPRESSED</code>, 3304or <code>CUPS_RASTER_WRITE_PWG</code></td></tr> 3305</tbody></table> 3306<h4 class="returnvalue">Return Value</h4> 3307<p class="description">New stream</p> 3308<h4 class="discussion">Discussion</h4> 3309<p class="discussion">This function associates a raster stream with the given file descriptor. 3310For most printer driver filters, "fd" will be 0 (stdin). For most raster 3311image processor (RIP) filters that generate raster data, "fd" will be 1 3312(stdout).<br> 3313<br> 3314When writing raster data, the <code>CUPS_RASTER_WRITE</code>, 3315<code>CUPS_RASTER_WRITE_COMPRESS</code>, or <code>CUPS_RASTER_WRITE_PWG</code> mode can 3316be used - compressed and PWG output is generally 25-50% smaller but adds a 3317100-300% execution time overhead.</p> 3318<h3 class="function"><a id="cupsRasterOpenIO">cupsRasterOpenIO</a></h3> 3319<p class="description">Open a raster stream using a callback function.</p> 3320<p class="code"> 3321<a href="#cups_raster_t">cups_raster_t</a> *cupsRasterOpenIO(<a href="#cups_raster_iocb_t">cups_raster_iocb_t</a> iocb, void *ctx, <a href="#cups_mode_t">cups_mode_t</a> mode);</p> 3322<h4 class="parameters">Parameters</h4> 3323<table class="list"><tbody> 3324<tr><th>iocb</th> 3325<td class="description">Read/write callback</td></tr> 3326<tr><th>ctx</th> 3327<td class="description">Context pointer for callback</td></tr> 3328<tr><th>mode</th> 3329<td class="description">Mode - <code>CUPS_RASTER_READ</code>, 3330<code>CUPS_RASTER_WRITE</code>, 3331<code>CUPS_RASTER_WRITE_COMPRESSED</code>, 3332or <code>CUPS_RASTER_WRITE_PWG</code></td></tr> 3333</tbody></table> 3334<h4 class="returnvalue">Return Value</h4> 3335<p class="description">New stream</p> 3336<h4 class="discussion">Discussion</h4> 3337<p class="discussion">This function associates a raster stream with the given callback function and 3338context pointer.<br> 3339<br> 3340When writing raster data, the <code>CUPS_RASTER_WRITE</code>, 3341<code>CUPS_RASTER_WRITE_COMPRESS</code>, or <code>CUPS_RASTER_WRITE_PWG</code> mode can 3342be used - compressed and PWG output is generally 25-50% smaller but adds a 3343100-300% execution time overhead.</p> 3344<h3 class="function"><span class="info"> DEPRECATED </span><a id="cupsRasterReadHeader">cupsRasterReadHeader</a></h3> 3345<p class="description">Read a raster page header and store it in a 3346version 1 page header structure.</p> 3347<p class="code"> 3348unsigned cupsRasterReadHeader(<a href="#cups_raster_t">cups_raster_t</a> *r, <a href="#cups_page_header_t">cups_page_header_t</a> *h);</p> 3349<h4 class="parameters">Parameters</h4> 3350<table class="list"><tbody> 3351<tr><th>r</th> 3352<td class="description">Raster stream</td></tr> 3353<tr><th>h</th> 3354<td class="description">Pointer to header data</td></tr> 3355</tbody></table> 3356<h4 class="returnvalue">Return Value</h4> 3357<p class="description">1 on success, 0 on failure/end-of-file</p> 3358<h4 class="discussion">Discussion</h4> 3359<p class="discussion">This function is deprecated. Use <a href="#cupsRasterReadHeader2"><code>cupsRasterReadHeader2</code></a> instead.<br> 3360<br> 3361Version 1 page headers were used in CUPS 1.0 and 1.1 and contain a subset 3362of the version 2 page header data. This function handles reading version 2 3363page headers and copying only the version 1 data into the provided buffer. 3364 3365</p> 3366<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsRasterReadHeader2">cupsRasterReadHeader2</a></h3> 3367<p class="description">Read a raster page header and store it in a 3368version 2 page header structure.</p> 3369<p class="code"> 3370unsigned cupsRasterReadHeader2(<a href="#cups_raster_t">cups_raster_t</a> *r, <a href="#cups_page_header2_t">cups_page_header2_t</a> *h);</p> 3371<h4 class="parameters">Parameters</h4> 3372<table class="list"><tbody> 3373<tr><th>r</th> 3374<td class="description">Raster stream</td></tr> 3375<tr><th>h</th> 3376<td class="description">Pointer to header data</td></tr> 3377</tbody></table> 3378<h4 class="returnvalue">Return Value</h4> 3379<p class="description">1 on success, 0 on failure/end-of-file</p> 3380<h3 class="function"><a id="cupsRasterReadPixels">cupsRasterReadPixels</a></h3> 3381<p class="description">Read raster pixels.</p> 3382<p class="code"> 3383unsigned cupsRasterReadPixels(<a href="#cups_raster_t">cups_raster_t</a> *r, unsigned char *p, unsigned len);</p> 3384<h4 class="parameters">Parameters</h4> 3385<table class="list"><tbody> 3386<tr><th>r</th> 3387<td class="description">Raster stream</td></tr> 3388<tr><th>p</th> 3389<td class="description">Pointer to pixel buffer</td></tr> 3390<tr><th>len</th> 3391<td class="description">Number of bytes to read</td></tr> 3392</tbody></table> 3393<h4 class="returnvalue">Return Value</h4> 3394<p class="description">Number of bytes read</p> 3395<h4 class="discussion">Discussion</h4> 3396<p class="discussion">For best performance, filters should read one or more whole lines. 3397The "cupsBytesPerLine" value from the page header can be used to allocate 3398the line buffer and as the number of bytes to read.</p> 3399<h3 class="function"><span class="info"> DEPRECATED </span><a id="cupsRasterWriteHeader">cupsRasterWriteHeader</a></h3> 3400<p class="description">Write a raster page header from a version 1 page 3401header structure.</p> 3402<p class="code"> 3403unsigned cupsRasterWriteHeader(<a href="#cups_raster_t">cups_raster_t</a> *r, <a href="#cups_page_header_t">cups_page_header_t</a> *h);</p> 3404<h4 class="parameters">Parameters</h4> 3405<table class="list"><tbody> 3406<tr><th>r</th> 3407<td class="description">Raster stream</td></tr> 3408<tr><th>h</th> 3409<td class="description">Raster page header</td></tr> 3410</tbody></table> 3411<h4 class="returnvalue">Return Value</h4> 3412<p class="description">1 on success, 0 on failure</p> 3413<h4 class="discussion">Discussion</h4> 3414<p class="discussion">This function is deprecated. Use <a href="#cupsRasterWriteHeader2"><code>cupsRasterWriteHeader2</code></a> instead. 3415 3416</p> 3417<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsRasterWriteHeader2">cupsRasterWriteHeader2</a></h3> 3418<p class="description">Write a raster page header from a version 2 3419page header structure.</p> 3420<p class="code"> 3421unsigned cupsRasterWriteHeader2(<a href="#cups_raster_t">cups_raster_t</a> *r, <a href="#cups_page_header2_t">cups_page_header2_t</a> *h);</p> 3422<h4 class="parameters">Parameters</h4> 3423<table class="list"><tbody> 3424<tr><th>r</th> 3425<td class="description">Raster stream</td></tr> 3426<tr><th>h</th> 3427<td class="description">Raster page header</td></tr> 3428</tbody></table> 3429<h4 class="returnvalue">Return Value</h4> 3430<p class="description">1 on success, 0 on failure</p> 3431<h4 class="discussion">Discussion</h4> 3432<p class="discussion">The page header can be initialized using <a href="#cupsRasterInitPWGHeader"><code>cupsRasterInitPWGHeader</code></a>. 3433 3434</p> 3435<h3 class="function"><a id="cupsRasterWritePixels">cupsRasterWritePixels</a></h3> 3436<p class="description">Write raster pixels.</p> 3437<p class="code"> 3438unsigned cupsRasterWritePixels(<a href="#cups_raster_t">cups_raster_t</a> *r, unsigned char *p, unsigned len);</p> 3439<h4 class="parameters">Parameters</h4> 3440<table class="list"><tbody> 3441<tr><th>r</th> 3442<td class="description">Raster stream</td></tr> 3443<tr><th>p</th> 3444<td class="description">Bytes to write</td></tr> 3445<tr><th>len</th> 3446<td class="description">Number of bytes to write</td></tr> 3447</tbody></table> 3448<h4 class="returnvalue">Return Value</h4> 3449<p class="description">Number of bytes written</p> 3450<h4 class="discussion">Discussion</h4> 3451<p class="discussion">For best performance, filters should write one or more whole lines. 3452The "cupsBytesPerLine" value from the page header can be used to allocate 3453the line buffer and as the number of bytes to write.</p> 3454<h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="cupsRemoveDest">cupsRemoveDest</a></h3> 3455<p class="description">Remove a destination from the destination list.</p> 3456<p class="code"> 3457int cupsRemoveDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p> 3458<h4 class="parameters">Parameters</h4> 3459<table class="list"><tbody> 3460<tr><th>name</th> 3461<td class="description">Destination name</td></tr> 3462<tr><th>instance</th> 3463<td class="description">Instance name or <code>NULL</code></td></tr> 3464<tr><th>num_dests</th> 3465<td class="description">Number of destinations</td></tr> 3466<tr><th>dests</th> 3467<td class="description">Destinations</td></tr> 3468</tbody></table> 3469<h4 class="returnvalue">Return Value</h4> 3470<p class="description">New number of destinations</p> 3471<h4 class="discussion">Discussion</h4> 3472<p class="discussion">Removing a destination/instance does not delete the class or printer 3473queue, merely the lpoptions for that destination/instance. Use the 3474<a href="#cupsSetDests"><code>cupsSetDests</code></a> or <a href="#cupsSetDests2"><code>cupsSetDests2</code></a> functions to save the new 3475options for the user. 3476 3477</p> 3478<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsRemoveOption">cupsRemoveOption</a></h3> 3479<p class="description">Remove an option from an option array.</p> 3480<p class="code"> 3481int cupsRemoveOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p> 3482<h4 class="parameters">Parameters</h4> 3483<table class="list"><tbody> 3484<tr><th>name</th> 3485<td class="description">Option name</td></tr> 3486<tr><th>num_options</th> 3487<td class="description">Current number of options</td></tr> 3488<tr><th>options</th> 3489<td class="description">Options</td></tr> 3490</tbody></table> 3491<h4 class="returnvalue">Return Value</h4> 3492<p class="description">New number of options</p> 3493<h3 class="function"><a id="cupsServer">cupsServer</a></h3> 3494<p class="description">Return the hostname/address of the current server.</p> 3495<p class="code"> 3496const char *cupsServer(void);</p> 3497<h4 class="returnvalue">Return Value</h4> 3498<p class="description">Server name</p> 3499<h4 class="discussion">Discussion</h4> 3500<p class="discussion">The default server comes from the CUPS_SERVER environment variable, then the 3501~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not 3502set, the default is the local system - either "localhost" or a domain socket 3503path.<br> 3504<br> 3505The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6 3506address, or a domain socket pathname.<br> 3507<br> 3508Note: The current server is tracked separately for each thread in a program. 3509Multi-threaded programs that override the server via the 3510<a href="#cupsSetServer"><code>cupsSetServer</code></a> function need to do so in each thread for the same 3511server to be used.</p> 3512<h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="cupsSetClientCertCB">cupsSetClientCertCB</a></h3> 3513<p class="description">Set the client certificate callback.</p> 3514<p class="code"> 3515void cupsSetClientCertCB(<a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a> cb, void *user_data);</p> 3516<h4 class="parameters">Parameters</h4> 3517<table class="list"><tbody> 3518<tr><th>cb</th> 3519<td class="description">Callback function</td></tr> 3520<tr><th>user_data</th> 3521<td class="description">User data pointer</td></tr> 3522</tbody></table> 3523<h4 class="discussion">Discussion</h4> 3524<p class="discussion">Pass <code>NULL</code> to restore the default callback.<br> 3525<br> 3526Note: The current certificate callback is tracked separately for each thread 3527in a program. Multi-threaded programs that override the callback need to do 3528so in each thread for the same callback to be used. 3529 3530</p> 3531<h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="cupsSetCredentials">cupsSetCredentials</a></h3> 3532<p class="description">Set the default credentials to be used for SSL/TLS 3533connections.</p> 3534<p class="code"> 3535int cupsSetCredentials(<a href="#cups_array_t">cups_array_t</a> *credentials);</p> 3536<h4 class="parameters">Parameters</h4> 3537<table class="list"><tbody> 3538<tr><th>credentials</th> 3539<td class="description">Array of credentials</td></tr> 3540</tbody></table> 3541<h4 class="returnvalue">Return Value</h4> 3542<p class="description">Status of call (0 = success)</p> 3543<h4 class="discussion">Discussion</h4> 3544<p class="discussion">Note: The default credentials are tracked separately for each thread in a 3545program. Multi-threaded programs that override the setting need to do so in 3546each thread for the same setting to be used. 3547 3548</p> 3549<h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="cupsSetDefaultDest">cupsSetDefaultDest</a></h3> 3550<p class="description">Set the default destination.</p> 3551<p class="code"> 3552void cupsSetDefaultDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p> 3553<h4 class="parameters">Parameters</h4> 3554<table class="list"><tbody> 3555<tr><th>name</th> 3556<td class="description">Destination name</td></tr> 3557<tr><th>instance</th> 3558<td class="description">Instance name or <code>NULL</code></td></tr> 3559<tr><th>num_dests</th> 3560<td class="description">Number of destinations</td></tr> 3561<tr><th>dests</th> 3562<td class="description">Destinations</td></tr> 3563</tbody></table> 3564<h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsSetDests2">cupsSetDests2</a></h3> 3565<p class="description">Save the list of destinations for the specified server.</p> 3566<p class="code"> 3567int cupsSetDests2(<a href="#http_t">http_t</a> *http, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p> 3568<h4 class="parameters">Parameters</h4> 3569<table class="list"><tbody> 3570<tr><th>http</th> 3571<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr> 3572<tr><th>num_dests</th> 3573<td class="description">Number of destinations</td></tr> 3574<tr><th>dests</th> 3575<td class="description">Destinations</td></tr> 3576</tbody></table> 3577<h4 class="returnvalue">Return Value</h4> 3578<p class="description">0 on success, -1 on error</p> 3579<h4 class="discussion">Discussion</h4> 3580<p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run 3581as root and ~/.cups/lpoptions when run as a normal user. 3582 3583</p> 3584<h3 class="function"><a id="cupsSetEncryption">cupsSetEncryption</a></h3> 3585<p class="description">Set the encryption preference.</p> 3586<p class="code"> 3587void cupsSetEncryption(<a href="#http_encryption_t">http_encryption_t</a> e);</p> 3588<h4 class="parameters">Parameters</h4> 3589<table class="list"><tbody> 3590<tr><th>e</th> 3591<td class="description">New encryption preference</td></tr> 3592</tbody></table> 3593<h4 class="discussion">Discussion</h4> 3594<p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION 3595environment variable, then the ~/.cups/client.conf file, and finally the 3596/etc/cups/client.conf file. If not set, the default is 3597<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br> 3598<br> 3599Note: The current encryption setting is tracked separately for each thread 3600in a program. Multi-threaded programs that override the setting need to do 3601so in each thread for the same setting to be used.</p> 3602<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsSetPasswordCB2">cupsSetPasswordCB2</a></h3> 3603<p class="description">Set the advanced password callback for CUPS.</p> 3604<p class="code"> 3605void cupsSetPasswordCB2(<a href="#cups_password_cb2_t">cups_password_cb2_t</a> cb, void *user_data);</p> 3606<h4 class="parameters">Parameters</h4> 3607<table class="list"><tbody> 3608<tr><th>cb</th> 3609<td class="description">Callback function</td></tr> 3610<tr><th>user_data</th> 3611<td class="description">User data pointer</td></tr> 3612</tbody></table> 3613<h4 class="discussion">Discussion</h4> 3614<p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which 3615reads the password from the console. Programs should call either this 3616function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered 3617by a program per thread.<br> 3618<br> 3619Note: The current password callback is tracked separately for each thread 3620in a program. Multi-threaded programs that override the callback need to do 3621so in each thread for the same callback to be used. 3622 3623</p> 3624<h3 class="function"><a id="cupsSetServer">cupsSetServer</a></h3> 3625<p class="description">Set the default server name and port.</p> 3626<p class="code"> 3627void cupsSetServer(const char *server);</p> 3628<h4 class="parameters">Parameters</h4> 3629<table class="list"><tbody> 3630<tr><th>server</th> 3631<td class="description">Server name</td></tr> 3632</tbody></table> 3633<h4 class="discussion">Discussion</h4> 3634<p class="discussion">The "server" string can be a fully-qualified hostname, a numeric 3635IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP 3636addresses can be optionally followed by a colon and port number to override 3637the default port 631, e.g. "hostname:8631". Pass <code>NULL</code> to restore the 3638default server name and port.<br> 3639<br> 3640Note: The current server is tracked separately for each thread in a program. 3641Multi-threaded programs that override the server need to do so in each 3642thread for the same server to be used.</p> 3643<h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="cupsSetServerCertCB">cupsSetServerCertCB</a></h3> 3644<p class="description">Set the server certificate callback.</p> 3645<p class="code"> 3646void cupsSetServerCertCB(<a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a> cb, void *user_data);</p> 3647<h4 class="parameters">Parameters</h4> 3648<table class="list"><tbody> 3649<tr><th>cb</th> 3650<td class="description">Callback function</td></tr> 3651<tr><th>user_data</th> 3652<td class="description">User data pointer</td></tr> 3653</tbody></table> 3654<h4 class="discussion">Discussion</h4> 3655<p class="discussion">Pass <code>NULL</code> to restore the default callback.<br> 3656<br> 3657Note: The current credentials callback is tracked separately for each thread 3658in a program. Multi-threaded programs that override the callback need to do 3659so in each thread for the same callback to be used. 3660 3661</p> 3662<h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="cupsSetServerCredentials">cupsSetServerCredentials</a></h3> 3663<p class="description">Set the default server credentials.</p> 3664<p class="code"> 3665int cupsSetServerCredentials(const char *path, const char *common_name, int auto_create);</p> 3666<h4 class="parameters">Parameters</h4> 3667<table class="list"><tbody> 3668<tr><th>path</th> 3669<td class="description">Keychain path or <code>NULL</code> for default</td></tr> 3670<tr><th>common_name</th> 3671<td class="description">Default common name for server</td></tr> 3672<tr><th>auto_create</th> 3673<td class="description">1 = automatically create self-signed certificates</td></tr> 3674</tbody></table> 3675<h4 class="returnvalue">Return Value</h4> 3676<p class="description">1 on success, 0 on failure</p> 3677<h4 class="discussion">Discussion</h4> 3678<p class="discussion">Note: The server credentials are used by all threads in the running process. 3679This function is threadsafe. 3680 3681</p> 3682<h3 class="function"><a id="cupsSetUser">cupsSetUser</a></h3> 3683<p class="description">Set the default user name.</p> 3684<p class="code"> 3685void cupsSetUser(const char *user);</p> 3686<h4 class="parameters">Parameters</h4> 3687<table class="list"><tbody> 3688<tr><th>user</th> 3689<td class="description">User name</td></tr> 3690</tbody></table> 3691<h4 class="discussion">Discussion</h4> 3692<p class="discussion">Pass <code>NULL</code> to restore the default user name.<br> 3693<br> 3694Note: The current user name is tracked separately for each thread in a 3695program. Multi-threaded programs that override the user name need to do so 3696in each thread for the same user name to be used.</p> 3697<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsSetUserAgent">cupsSetUserAgent</a></h3> 3698<p class="description">Set the default HTTP User-Agent string.</p> 3699<p class="code"> 3700void cupsSetUserAgent(const char *user_agent);</p> 3701<h4 class="parameters">Parameters</h4> 3702<table class="list"><tbody> 3703<tr><th>user_agent</th> 3704<td class="description">User-Agent string or <code>NULL</code></td></tr> 3705</tbody></table> 3706<h4 class="discussion">Discussion</h4> 3707<p class="discussion">Setting the string to NULL forces the default value containing the CUPS 3708version, IPP version, and operating system version and architecture. 3709 3710</p> 3711<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsStartDestDocument">cupsStartDestDocument</a></h3> 3712<p class="description">Start a new document.</p> 3713<p class="code"> 3714http_status_t cupsStartDestDocument(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> *dest, <a href="#cups_dinfo_t">cups_dinfo_t</a> *info, int job_id, const char *docname, const char *format, int num_options, <a href="#cups_option_t">cups_option_t</a> *options, int last_document);</p> 3715<h4 class="parameters">Parameters</h4> 3716<table class="list"><tbody> 3717<tr><th>http</th> 3718<td class="description">Connection to destination</td></tr> 3719<tr><th>dest</th> 3720<td class="description">Destination</td></tr> 3721<tr><th>info</th> 3722<td class="description">Destination information</td></tr> 3723<tr><th>job_id</th> 3724<td class="description">Job ID</td></tr> 3725<tr><th>docname</th> 3726<td class="description">Document name</td></tr> 3727<tr><th>format</th> 3728<td class="description">Document format</td></tr> 3729<tr><th>num_options</th> 3730<td class="description">Number of document options</td></tr> 3731<tr><th>options</th> 3732<td class="description">Document options</td></tr> 3733<tr><th>last_document</th> 3734<td class="description">1 if this is the last document</td></tr> 3735</tbody></table> 3736<h4 class="returnvalue">Return Value</h4> 3737<p class="description">Status of document creation</p> 3738<h4 class="discussion">Discussion</h4> 3739<p class="discussion">"job_id" is the job ID returned by cupsCreateDestJob. "docname" is the name 3740of the document/file being printed, "format" is the MIME media type for the 3741document (see CUPS_FORMAT_xxx constants), and "num_options" and "options" 3742are the options do be applied to the document. "last_document" should be 1 3743if this is the last document to be submitted in the job. Returns 3744<code>HTTP_CONTINUE</code> on success. 3745 3746</p> 3747<h3 class="function"><a id="cupsUser">cupsUser</a></h3> 3748<p class="description">Return the current user's name.</p> 3749<p class="code"> 3750const char *cupsUser(void);</p> 3751<h4 class="returnvalue">Return Value</h4> 3752<p class="description">User name</p> 3753<h4 class="discussion">Discussion</h4> 3754<p class="discussion">Note: The current user name is tracked separately for each thread in a 3755program. Multi-threaded programs that override the user name with the 3756<a href="#cupsSetUser"><code>cupsSetUser</code></a> function need to do so in each thread for the same user 3757name to be used.</p> 3758<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsUserAgent">cupsUserAgent</a></h3> 3759<p class="description">Return the default HTTP User-Agent string.</p> 3760<p class="code"> 3761const char *cupsUserAgent(void);</p> 3762<h4 class="returnvalue">Return Value</h4> 3763<p class="description">User-Agent string</p> 3764<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAcceptConnection">httpAcceptConnection</a></h3> 3765<p class="description">Accept a new HTTP client connection from the 3766specified listening socket.</p> 3767<p class="code"> 3768<a href="#http_t">http_t</a> *httpAcceptConnection(int fd, int blocking);</p> 3769<h4 class="parameters">Parameters</h4> 3770<table class="list"><tbody> 3771<tr><th>fd</th> 3772<td class="description">Listen socket file descriptor</td></tr> 3773<tr><th>blocking</th> 3774<td class="description">1 if the connection should be 3775blocking, 0 otherwise</td></tr> 3776</tbody></table> 3777<h4 class="returnvalue">Return Value</h4> 3778<p class="description">HTTP connection or <code>NULL</code></p> 3779<h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="httpAddCredential">httpAddCredential</a></h3> 3780<p class="description">Allocates and adds a single credential to an array.</p> 3781<p class="code"> 3782int httpAddCredential(<a href="#cups_array_t">cups_array_t</a> *credentials, const void *data, size_t datalen);</p> 3783<h4 class="parameters">Parameters</h4> 3784<table class="list"><tbody> 3785<tr><th>credentials</th> 3786<td class="description">Credentials array</td></tr> 3787<tr><th>data</th> 3788<td class="description">PEM-encoded X.509 data</td></tr> 3789<tr><th>datalen</th> 3790<td class="description">Length of data</td></tr> 3791</tbody></table> 3792<h4 class="returnvalue">Return Value</h4> 3793<p class="description">0 on success, -1 on error</p> 3794<h4 class="discussion">Discussion</h4> 3795<p class="discussion">Use <code>cupsArrayNew(NULL, NULL)</code> to create a credentials array. 3796 3797</p> 3798<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrAny">httpAddrAny</a></h3> 3799<p class="description">Check for the "any" address.</p> 3800<p class="code"> 3801int httpAddrAny(const <a href="#http_addr_t">http_addr_t</a> *addr);</p> 3802<h4 class="parameters">Parameters</h4> 3803<table class="list"><tbody> 3804<tr><th>addr</th> 3805<td class="description">Address to check</td></tr> 3806</tbody></table> 3807<h4 class="returnvalue">Return Value</h4> 3808<p class="description">1 if "any", 0 otherwise</p> 3809<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpAddrClose">httpAddrClose</a></h3> 3810<p class="description">Close a socket created by <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> or 3811<a href="#httpAddrListen"><code>httpAddrListen</code></a>.</p> 3812<p class="code"> 3813int httpAddrClose(<a href="#http_addr_t">http_addr_t</a> *addr, int fd);</p> 3814<h4 class="parameters">Parameters</h4> 3815<table class="list"><tbody> 3816<tr><th>addr</th> 3817<td class="description">Listen address or <code>NULL</code></td></tr> 3818<tr><th>fd</th> 3819<td class="description">Socket file descriptor</td></tr> 3820</tbody></table> 3821<h4 class="returnvalue">Return Value</h4> 3822<p class="description">0 on success, -1 on failure</p> 3823<h4 class="discussion">Discussion</h4> 3824<p class="discussion">Pass <code>NULL</code> for sockets created with <a href="#httpAddrConnect2"><code>httpAddrConnect2</code></a> and the 3825listen address for sockets created with <a href="#httpAddrListen"><code>httpAddrListen</code></a>. This function 3826ensures that domain sockets are removed when closed. 3827 3828</p> 3829<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAddrConnect2">httpAddrConnect2</a></h3> 3830<p class="description">Connect to any of the addresses in the list with a 3831timeout and optional cancel.</p> 3832<p class="code"> 3833<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrConnect2(<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist, int *sock, int msec, int *cancel);</p> 3834<h4 class="parameters">Parameters</h4> 3835<table class="list"><tbody> 3836<tr><th>addrlist</th> 3837<td class="description">List of potential addresses</td></tr> 3838<tr><th>sock</th> 3839<td class="description">Socket</td></tr> 3840<tr><th>msec</th> 3841<td class="description">Timeout in milliseconds</td></tr> 3842<tr><th>cancel</th> 3843<td class="description">Pointer to "cancel" variable</td></tr> 3844</tbody></table> 3845<h4 class="returnvalue">Return Value</h4> 3846<p class="description">Connected address or NULL on failure</p> 3847<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAddrCopyList">httpAddrCopyList</a></h3> 3848<p class="description">Copy an address list.</p> 3849<p class="code"> 3850<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrCopyList(<a href="#http_addrlist_t">http_addrlist_t</a> *src);</p> 3851<h4 class="parameters">Parameters</h4> 3852<table class="list"><tbody> 3853<tr><th>src</th> 3854<td class="description">Source address list</td></tr> 3855</tbody></table> 3856<h4 class="returnvalue">Return Value</h4> 3857<p class="description">New address list or <code>NULL</code> on error</p> 3858<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrEqual">httpAddrEqual</a></h3> 3859<p class="description">Compare two addresses.</p> 3860<p class="code"> 3861int httpAddrEqual(const <a href="#http_addr_t">http_addr_t</a> *addr1, const <a href="#http_addr_t">http_addr_t</a> *addr2);</p> 3862<h4 class="parameters">Parameters</h4> 3863<table class="list"><tbody> 3864<tr><th>addr1</th> 3865<td class="description">First address</td></tr> 3866<tr><th>addr2</th> 3867<td class="description">Second address</td></tr> 3868</tbody></table> 3869<h4 class="returnvalue">Return Value</h4> 3870<p class="description">1 if equal, 0 if not</p> 3871<h3 class="function"><a id="httpAddrFamily">httpAddrFamily</a></h3> 3872<p class="description">Get the address family of an address.</p> 3873<p class="code"> 3874int httpAddrFamily(<a href="#http_addr_t">http_addr_t</a> *addr);</p> 3875<h4 class="parameters">Parameters</h4> 3876<table class="list"><tbody> 3877<tr><th>addr</th> 3878<td class="description">Address</td></tr> 3879</tbody></table> 3880<h4 class="returnvalue">Return Value</h4> 3881<p class="description">Address family</p> 3882<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrFreeList">httpAddrFreeList</a></h3> 3883<p class="description">Free an address list.</p> 3884<p class="code"> 3885void httpAddrFreeList(<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist);</p> 3886<h4 class="parameters">Parameters</h4> 3887<table class="list"><tbody> 3888<tr><th>addrlist</th> 3889<td class="description">Address list to free</td></tr> 3890</tbody></table> 3891<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrGetList">httpAddrGetList</a></h3> 3892<p class="description">Get a list of addresses for a hostname.</p> 3893<p class="code"> 3894<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrGetList(const char *hostname, int family, const char *service);</p> 3895<h4 class="parameters">Parameters</h4> 3896<table class="list"><tbody> 3897<tr><th>hostname</th> 3898<td class="description">Hostname, IP address, or NULL for passive listen address</td></tr> 3899<tr><th>family</th> 3900<td class="description">Address family or AF_UNSPEC</td></tr> 3901<tr><th>service</th> 3902<td class="description">Service name or port number</td></tr> 3903</tbody></table> 3904<h4 class="returnvalue">Return Value</h4> 3905<p class="description">List of addresses or NULL</p> 3906<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrLength">httpAddrLength</a></h3> 3907<p class="description">Return the length of the address in bytes.</p> 3908<p class="code"> 3909int httpAddrLength(const <a href="#http_addr_t">http_addr_t</a> *addr);</p> 3910<h4 class="parameters">Parameters</h4> 3911<table class="list"><tbody> 3912<tr><th>addr</th> 3913<td class="description">Address</td></tr> 3914</tbody></table> 3915<h4 class="returnvalue">Return Value</h4> 3916<p class="description">Length in bytes</p> 3917<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAddrListen">httpAddrListen</a></h3> 3918<p class="description">Create a listening socket bound to the specified 3919address and port.</p> 3920<p class="code"> 3921int httpAddrListen(<a href="#http_addr_t">http_addr_t</a> *addr, int port);</p> 3922<h4 class="parameters">Parameters</h4> 3923<table class="list"><tbody> 3924<tr><th>addr</th> 3925<td class="description">Address to bind to</td></tr> 3926<tr><th>port</th> 3927<td class="description">Port number to bind to</td></tr> 3928</tbody></table> 3929<h4 class="returnvalue">Return Value</h4> 3930<p class="description">Socket or -1 on error</p> 3931<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrLocalhost">httpAddrLocalhost</a></h3> 3932<p class="description">Check for the local loopback address.</p> 3933<p class="code"> 3934int httpAddrLocalhost(const <a href="#http_addr_t">http_addr_t</a> *addr);</p> 3935<h4 class="parameters">Parameters</h4> 3936<table class="list"><tbody> 3937<tr><th>addr</th> 3938<td class="description">Address to check</td></tr> 3939</tbody></table> 3940<h4 class="returnvalue">Return Value</h4> 3941<p class="description">1 if local host, 0 otherwise</p> 3942<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrLookup">httpAddrLookup</a></h3> 3943<p class="description">Lookup the hostname associated with the address.</p> 3944<p class="code"> 3945char *httpAddrLookup(const <a href="#http_addr_t">http_addr_t</a> *addr, char *name, int namelen);</p> 3946<h4 class="parameters">Parameters</h4> 3947<table class="list"><tbody> 3948<tr><th>addr</th> 3949<td class="description">Address to lookup</td></tr> 3950<tr><th>name</th> 3951<td class="description">Host name buffer</td></tr> 3952<tr><th>namelen</th> 3953<td class="description">Size of name buffer</td></tr> 3954</tbody></table> 3955<h4 class="returnvalue">Return Value</h4> 3956<p class="description">Host name</p> 3957<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAddrPort">httpAddrPort</a></h3> 3958<p class="description">Get the port number associated with an address.</p> 3959<p class="code"> 3960int httpAddrPort(<a href="#http_addr_t">http_addr_t</a> *addr);</p> 3961<h4 class="parameters">Parameters</h4> 3962<table class="list"><tbody> 3963<tr><th>addr</th> 3964<td class="description">Address</td></tr> 3965</tbody></table> 3966<h4 class="returnvalue">Return Value</h4> 3967<p class="description">Port number</p> 3968<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrString">httpAddrString</a></h3> 3969<p class="description">Convert an address to a numeric string.</p> 3970<p class="code"> 3971char *httpAddrString(const <a href="#http_addr_t">http_addr_t</a> *addr, char *s, int slen);</p> 3972<h4 class="parameters">Parameters</h4> 3973<table class="list"><tbody> 3974<tr><th>addr</th> 3975<td class="description">Address to convert</td></tr> 3976<tr><th>s</th> 3977<td class="description">String buffer</td></tr> 3978<tr><th>slen</th> 3979<td class="description">Length of string</td></tr> 3980</tbody></table> 3981<h4 class="returnvalue">Return Value</h4> 3982<p class="description">Numeric address string</p> 3983<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAssembleURI">httpAssembleURI</a></h3> 3984<p class="description">Assemble a uniform resource identifier from its 3985components.</p> 3986<p class="code"> 3987<a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURI(<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding, char *uri, int urilen, const char *scheme, const char *username, const char *host, int port, const char *resource);</p> 3988<h4 class="parameters">Parameters</h4> 3989<table class="list"><tbody> 3990<tr><th>encoding</th> 3991<td class="description">Encoding flags</td></tr> 3992<tr><th>uri</th> 3993<td class="description">URI buffer</td></tr> 3994<tr><th>urilen</th> 3995<td class="description">Size of URI buffer</td></tr> 3996<tr><th>scheme</th> 3997<td class="description">Scheme name</td></tr> 3998<tr><th>username</th> 3999<td class="description">Username</td></tr> 4000<tr><th>host</th> 4001<td class="description">Hostname or address</td></tr> 4002<tr><th>port</th> 4003<td class="description">Port number</td></tr> 4004<tr><th>resource</th> 4005<td class="description">Resource</td></tr> 4006</tbody></table> 4007<h4 class="returnvalue">Return Value</h4> 4008<p class="description">URI status</p> 4009<h4 class="discussion">Discussion</h4> 4010<p class="discussion">This function escapes reserved characters in the URI depending on the 4011value of the "encoding" argument. You should use this function in 4012place of traditional string functions whenever you need to create a 4013URI string. 4014 4015</p> 4016<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAssembleURIf">httpAssembleURIf</a></h3> 4017<p class="description">Assemble a uniform resource identifier from its 4018components with a formatted resource.</p> 4019<p class="code"> 4020<a href="#http_uri_status_t">http_uri_status_t</a> httpAssembleURIf(<a href="#http_uri_coding_t">http_uri_coding_t</a> encoding, char *uri, int urilen, const char *scheme, const char *username, const char *host, int port, const char *resourcef, ...);</p> 4021<h4 class="parameters">Parameters</h4> 4022<table class="list"><tbody> 4023<tr><th>encoding</th> 4024<td class="description">Encoding flags</td></tr> 4025<tr><th>uri</th> 4026<td class="description">URI buffer</td></tr> 4027<tr><th>urilen</th> 4028<td class="description">Size of URI buffer</td></tr> 4029<tr><th>scheme</th> 4030<td class="description">Scheme name</td></tr> 4031<tr><th>username</th> 4032<td class="description">Username</td></tr> 4033<tr><th>host</th> 4034<td class="description">Hostname or address</td></tr> 4035<tr><th>port</th> 4036<td class="description">Port number</td></tr> 4037<tr><th>resourcef</th> 4038<td class="description">Printf-style resource</td></tr> 4039<tr><th>...</th> 4040<td class="description">Additional arguments as needed</td></tr> 4041</tbody></table> 4042<h4 class="returnvalue">Return Value</h4> 4043<p class="description">URI status</p> 4044<h4 class="discussion">Discussion</h4> 4045<p class="discussion">This function creates a formatted version of the resource string 4046argument "resourcef" and escapes reserved characters in the URI 4047depending on the value of the "encoding" argument. You should use 4048this function in place of traditional string functions whenever 4049you need to create a URI string. 4050 4051</p> 4052<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAssembleUUID">httpAssembleUUID</a></h3> 4053<p class="description">Assemble a name-based UUID URN conforming to RFC 4122.</p> 4054<p class="code"> 4055char *httpAssembleUUID(const char *server, int port, const char *name, int number, char *buffer, size_t bufsize);</p> 4056<h4 class="parameters">Parameters</h4> 4057<table class="list"><tbody> 4058<tr><th>server</th> 4059<td class="description">Server name</td></tr> 4060<tr><th>port</th> 4061<td class="description">Port number</td></tr> 4062<tr><th>name</th> 4063<td class="description">Object name or NULL</td></tr> 4064<tr><th>number</th> 4065<td class="description">Object number or 0</td></tr> 4066<tr><th>buffer</th> 4067<td class="description">String buffer</td></tr> 4068<tr><th>bufsize</th> 4069<td class="description">Size of buffer</td></tr> 4070</tbody></table> 4071<h4 class="returnvalue">Return Value</h4> 4072<p class="description">UUID string</p> 4073<h4 class="discussion">Discussion</h4> 4074<p class="discussion">This function creates a unique 128-bit identifying number using the server 4075name, port number, random data, and optionally an object name and/or object 4076number. The result is formatted as a UUID URN as defined in RFC 4122.<br> 4077<br> 4078The buffer needs to be at least 46 bytes in size. 4079 4080</p> 4081<h3 class="function"><a id="httpBlocking">httpBlocking</a></h3> 4082<p class="description">Set blocking/non-blocking behavior on a connection.</p> 4083<p class="code"> 4084void httpBlocking(<a href="#http_t">http_t</a> *http, int b);</p> 4085<h4 class="parameters">Parameters</h4> 4086<table class="list"><tbody> 4087<tr><th>http</th> 4088<td class="description">HTTP connection</td></tr> 4089<tr><th>b</th> 4090<td class="description">1 = blocking, 0 = non-blocking</td></tr> 4091</tbody></table> 4092<h3 class="function"><a id="httpCheck">httpCheck</a></h3> 4093<p class="description">Check to see if there is a pending response from the server.</p> 4094<p class="code"> 4095int httpCheck(<a href="#http_t">http_t</a> *http);</p> 4096<h4 class="parameters">Parameters</h4> 4097<table class="list"><tbody> 4098<tr><th>http</th> 4099<td class="description">HTTP connection</td></tr> 4100</tbody></table> 4101<h4 class="returnvalue">Return Value</h4> 4102<p class="description">0 = no data, 1 = data available</p> 4103<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="httpClearCookie">httpClearCookie</a></h3> 4104<p class="description">Clear the cookie value(s).</p> 4105<p class="code"> 4106void httpClearCookie(<a href="#http_t">http_t</a> *http);</p> 4107<h4 class="parameters">Parameters</h4> 4108<table class="list"><tbody> 4109<tr><th>http</th> 4110<td class="description">HTTP connection</td></tr> 4111</tbody></table> 4112<h3 class="function"><a id="httpClearFields">httpClearFields</a></h3> 4113<p class="description">Clear HTTP request fields.</p> 4114<p class="code"> 4115void httpClearFields(<a href="#http_t">http_t</a> *http);</p> 4116<h4 class="parameters">Parameters</h4> 4117<table class="list"><tbody> 4118<tr><th>http</th> 4119<td class="description">HTTP connection</td></tr> 4120</tbody></table> 4121<h3 class="function"><a id="httpClose">httpClose</a></h3> 4122<p class="description">Close an HTTP connection.</p> 4123<p class="code"> 4124void httpClose(<a href="#http_t">http_t</a> *http);</p> 4125<h4 class="parameters">Parameters</h4> 4126<table class="list"><tbody> 4127<tr><th>http</th> 4128<td class="description">HTTP connection</td></tr> 4129</tbody></table> 4130<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpCompareCredentials">httpCompareCredentials</a></h3> 4131<p class="description">Compare two sets of X.509 credentials.</p> 4132<p class="code"> 4133int httpCompareCredentials(<a href="#cups_array_t">cups_array_t</a> *cred1, <a href="#cups_array_t">cups_array_t</a> *cred2);</p> 4134<h4 class="parameters">Parameters</h4> 4135<table class="list"><tbody> 4136<tr><th>cred1</th> 4137<td class="description">First set of X.509 credentials</td></tr> 4138<tr><th>cred2</th> 4139<td class="description">Second set of X.509 credentials</td></tr> 4140</tbody></table> 4141<h4 class="returnvalue">Return Value</h4> 4142<p class="description">1 if they match, 0 if they do not</p> 4143<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpConnect2">httpConnect2</a></h3> 4144<p class="description">Connect to a HTTP server.</p> 4145<p class="code"> 4146<a href="#http_t">http_t</a> *httpConnect2(const char *host, int port, <a href="#http_addrlist_t">http_addrlist_t</a> *addrlist, int family, <a href="#http_encryption_t">http_encryption_t</a> encryption, int blocking, int msec, int *cancel);</p> 4147<h4 class="parameters">Parameters</h4> 4148<table class="list"><tbody> 4149<tr><th>host</th> 4150<td class="description">Host to connect to</td></tr> 4151<tr><th>port</th> 4152<td class="description">Port number</td></tr> 4153<tr><th>addrlist</th> 4154<td class="description">List of addresses or <code>NULL</code> to lookup</td></tr> 4155<tr><th>family</th> 4156<td class="description">Address family to use or <code>AF_UNSPEC</code> for any</td></tr> 4157<tr><th>encryption</th> 4158<td class="description">Type of encryption to use</td></tr> 4159<tr><th>blocking</th> 4160<td class="description">1 for blocking connection, 0 for non-blocking</td></tr> 4161<tr><th>msec</th> 4162<td class="description">Connection timeout in milliseconds, 0 means don't connect</td></tr> 4163<tr><th>cancel</th> 4164<td class="description">Pointer to "cancel" variable</td></tr> 4165</tbody></table> 4166<h4 class="returnvalue">Return Value</h4> 4167<p class="description">New HTTP connection</p> 4168<h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="httpCopyCredentials">httpCopyCredentials</a></h3> 4169<p class="description">Copy the credentials associated with the peer in 4170an encrypted connection.</p> 4171<p class="code"> 4172int httpCopyCredentials(<a href="#http_t">http_t</a> *http, <a href="#cups_array_t">cups_array_t</a> **credentials);</p> 4173<h4 class="parameters">Parameters</h4> 4174<table class="list"><tbody> 4175<tr><th>http</th> 4176<td class="description">Connection to server</td></tr> 4177<tr><th>credentials</th> 4178<td class="description">Array of credentials</td></tr> 4179</tbody></table> 4180<h4 class="returnvalue">Return Value</h4> 4181<p class="description">Status of call (0 = success)</p> 4182<h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></h3> 4183<p class="description">Return whether the credentials are valid for the given name.</p> 4184<p class="code"> 4185int httpCredentialsAreValidForName(<a href="#cups_array_t">cups_array_t</a> *credentials, const char *common_name);</p> 4186<h4 class="parameters">Parameters</h4> 4187<table class="list"><tbody> 4188<tr><th>credentials</th> 4189<td class="description">Credentials</td></tr> 4190<tr><th>common_name</th> 4191<td class="description">Name to check</td></tr> 4192</tbody></table> 4193<h4 class="returnvalue">Return Value</h4> 4194<p class="description">1 if valid, 0 otherwise</p> 4195<h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></h3> 4196<p class="description">Return the expiration date of the credentials.</p> 4197<p class="code"> 4198time_t httpCredentialsGetExpiration(<a href="#cups_array_t">cups_array_t</a> *credentials);</p> 4199<h4 class="parameters">Parameters</h4> 4200<table class="list"><tbody> 4201<tr><th>credentials</th> 4202<td class="description">Credentials</td></tr> 4203</tbody></table> 4204<h4 class="returnvalue">Return Value</h4> 4205<p class="description">Expiration date of credentials</p> 4206<h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="httpCredentialsGetTrust">httpCredentialsGetTrust</a></h3> 4207<p class="description">Return the trust of credentials.</p> 4208<p class="code"> 4209<a href="#http_trust_t">http_trust_t</a> httpCredentialsGetTrust(<a href="#cups_array_t">cups_array_t</a> *credentials, const char *common_name);</p> 4210<h4 class="parameters">Parameters</h4> 4211<table class="list"><tbody> 4212<tr><th>credentials</th> 4213<td class="description">Credentials</td></tr> 4214<tr><th>common_name</th> 4215<td class="description">Common name for trust lookup</td></tr> 4216</tbody></table> 4217<h4 class="returnvalue">Return Value</h4> 4218<p class="description">Level of trust</p> 4219<h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="httpCredentialsString">httpCredentialsString</a></h3> 4220<p class="description">Return a string representing the credentials.</p> 4221<p class="code"> 4222size_t httpCredentialsString(<a href="#cups_array_t">cups_array_t</a> *credentials, char *buffer, size_t bufsize);</p> 4223<h4 class="parameters">Parameters</h4> 4224<table class="list"><tbody> 4225<tr><th>credentials</th> 4226<td class="description">Credentials</td></tr> 4227<tr><th>buffer</th> 4228<td class="description">Buffer or <code>NULL</code></td></tr> 4229<tr><th>bufsize</th> 4230<td class="description">Size of buffer</td></tr> 4231</tbody></table> 4232<h4 class="returnvalue">Return Value</h4> 4233<p class="description">Total size of credentials string</p> 4234<h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="httpDecode64_2">httpDecode64_2</a></h3> 4235<p class="description">Base64-decode a string.</p> 4236<p class="code"> 4237char *httpDecode64_2(char *out, int *outlen, const char *in);</p> 4238<h4 class="parameters">Parameters</h4> 4239<table class="list"><tbody> 4240<tr><th>out</th> 4241<td class="description">String to write to</td></tr> 4242<tr><th>outlen</th> 4243<td class="description">Size of output string</td></tr> 4244<tr><th>in</th> 4245<td class="description">String to read from</td></tr> 4246</tbody></table> 4247<h4 class="returnvalue">Return Value</h4> 4248<p class="description">Decoded string</p> 4249<h4 class="discussion">Discussion</h4> 4250<p class="discussion">The caller must initialize "outlen" to the maximum size of the decoded 4251string before calling <code>httpDecode64_2</code>. On return "outlen" contains the 4252decoded length of the string. 4253 4254</p> 4255<h3 class="function"><a id="httpDelete">httpDelete</a></h3> 4256<p class="description">Send a DELETE request to the server.</p> 4257<p class="code"> 4258int httpDelete(<a href="#http_t">http_t</a> *http, const char *uri);</p> 4259<h4 class="parameters">Parameters</h4> 4260<table class="list"><tbody> 4261<tr><th>http</th> 4262<td class="description">HTTP connection</td></tr> 4263<tr><th>uri</th> 4264<td class="description">URI to delete</td></tr> 4265</tbody></table> 4266<h4 class="returnvalue">Return Value</h4> 4267<p class="description">Status of call (0 = success)</p> 4268<h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="httpEncode64_2">httpEncode64_2</a></h3> 4269<p class="description">Base64-encode a string.</p> 4270<p class="code"> 4271char *httpEncode64_2(char *out, int outlen, const char *in, int inlen);</p> 4272<h4 class="parameters">Parameters</h4> 4273<table class="list"><tbody> 4274<tr><th>out</th> 4275<td class="description">String to write to</td></tr> 4276<tr><th>outlen</th> 4277<td class="description">Maximum size of output string</td></tr> 4278<tr><th>in</th> 4279<td class="description">String to read from</td></tr> 4280<tr><th>inlen</th> 4281<td class="description">Size of input string</td></tr> 4282</tbody></table> 4283<h4 class="returnvalue">Return Value</h4> 4284<p class="description">Encoded string</p> 4285<h3 class="function"><a id="httpEncryption">httpEncryption</a></h3> 4286<p class="description">Set the required encryption on the link.</p> 4287<p class="code"> 4288int httpEncryption(<a href="#http_t">http_t</a> *http, <a href="#http_encryption_t">http_encryption_t</a> e);</p> 4289<h4 class="parameters">Parameters</h4> 4290<table class="list"><tbody> 4291<tr><th>http</th> 4292<td class="description">HTTP connection</td></tr> 4293<tr><th>e</th> 4294<td class="description">New encryption preference</td></tr> 4295</tbody></table> 4296<h4 class="returnvalue">Return Value</h4> 4297<p class="description">-1 on error, 0 on success</p> 4298<h3 class="function"><a id="httpError">httpError</a></h3> 4299<p class="description">Get the last error on a connection.</p> 4300<p class="code"> 4301int httpError(<a href="#http_t">http_t</a> *http);</p> 4302<h4 class="parameters">Parameters</h4> 4303<table class="list"><tbody> 4304<tr><th>http</th> 4305<td class="description">HTTP connection</td></tr> 4306</tbody></table> 4307<h4 class="returnvalue">Return Value</h4> 4308<p class="description">Error code (errno) value</p> 4309<h3 class="function"><a id="httpFieldValue">httpFieldValue</a></h3> 4310<p class="description">Return the HTTP field enumeration value for a field 4311name.</p> 4312<p class="code"> 4313<a href="#http_field_t">http_field_t</a> httpFieldValue(const char *name);</p> 4314<h4 class="parameters">Parameters</h4> 4315<table class="list"><tbody> 4316<tr><th>name</th> 4317<td class="description">String name</td></tr> 4318</tbody></table> 4319<h4 class="returnvalue">Return Value</h4> 4320<p class="description">Field index</p> 4321<h3 class="function"><a id="httpFlush">httpFlush</a></h3> 4322<p class="description">Flush data read from a HTTP connection.</p> 4323<p class="code"> 4324void httpFlush(<a href="#http_t">http_t</a> *http);</p> 4325<h4 class="parameters">Parameters</h4> 4326<table class="list"><tbody> 4327<tr><th>http</th> 4328<td class="description">HTTP connection</td></tr> 4329</tbody></table> 4330<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpFlushWrite">httpFlushWrite</a></h3> 4331<p class="description">Flush data written to a HTTP connection.</p> 4332<p class="code"> 4333int httpFlushWrite(<a href="#http_t">http_t</a> *http);</p> 4334<h4 class="parameters">Parameters</h4> 4335<table class="list"><tbody> 4336<tr><th>http</th> 4337<td class="description">HTTP connection</td></tr> 4338</tbody></table> 4339<h4 class="returnvalue">Return Value</h4> 4340<p class="description">Bytes written or -1 on error</p> 4341<h3 class="function"><a id="httpFreeCredentials">httpFreeCredentials</a></h3> 4342<p class="description">Free an array of credentials.</p> 4343<p class="code"> 4344void httpFreeCredentials(<a href="#cups_array_t">cups_array_t</a> *credentials);</p> 4345<h4 class="parameters">Parameters</h4> 4346<table class="list"><tbody> 4347<tr><th>credentials</th> 4348<td class="description">Array of credentials</td></tr> 4349</tbody></table> 4350<h3 class="function"><a id="httpGet">httpGet</a></h3> 4351<p class="description">Send a GET request to the server.</p> 4352<p class="code"> 4353int httpGet(<a href="#http_t">http_t</a> *http, const char *uri);</p> 4354<h4 class="parameters">Parameters</h4> 4355<table class="list"><tbody> 4356<tr><th>http</th> 4357<td class="description">HTTP connection</td></tr> 4358<tr><th>uri</th> 4359<td class="description">URI to get</td></tr> 4360</tbody></table> 4361<h4 class="returnvalue">Return Value</h4> 4362<p class="description">Status of call (0 = success)</p> 4363<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetActivity">httpGetActivity</a></h3> 4364<p class="description">Get the most recent activity for a connection.</p> 4365<p class="code"> 4366time_t httpGetActivity(<a href="#http_t">http_t</a> *http);</p> 4367<h4 class="parameters">Parameters</h4> 4368<table class="list"><tbody> 4369<tr><th>http</th> 4370<td class="description">HTTP connection</td></tr> 4371</tbody></table> 4372<h4 class="returnvalue">Return Value</h4> 4373<p class="description">Time of last read or write</p> 4374<h4 class="discussion">Discussion</h4> 4375<p class="discussion">The return value is the time in seconds of the last read or write. 4376 4377</p> 4378<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetAddress">httpGetAddress</a></h3> 4379<p class="description">Get the address of the connected peer of a connection.</p> 4380<p class="code"> 4381<a href="#http_addr_t">http_addr_t</a> *httpGetAddress(<a href="#http_t">http_t</a> *http);</p> 4382<h4 class="parameters">Parameters</h4> 4383<table class="list"><tbody> 4384<tr><th>http</th> 4385<td class="description">HTTP connection</td></tr> 4386</tbody></table> 4387<h4 class="returnvalue">Return Value</h4> 4388<p class="description">Connected address or <code>NULL</code></p> 4389<h4 class="discussion">Discussion</h4> 4390<p class="discussion">For connections created with <a href="#httpConnect2"><code>httpConnect2</code></a>, the address is for the 4391server. For connections created with <a href="#httpAccept"><code>httpAccept</code></a>, the address is for 4392the client.<br> 4393<br> 4394Returns <code>NULL</code> if the socket is currently unconnected. 4395 4396</p> 4397<h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="httpGetAuthString">httpGetAuthString</a></h3> 4398<p class="description">Get the current authorization string.</p> 4399<p class="code"> 4400char *httpGetAuthString(<a href="#http_t">http_t</a> *http);</p> 4401<h4 class="parameters">Parameters</h4> 4402<table class="list"><tbody> 4403<tr><th>http</th> 4404<td class="description">HTTP connection</td></tr> 4405</tbody></table> 4406<h4 class="returnvalue">Return Value</h4> 4407<p class="description">Authorization string</p> 4408<h4 class="discussion">Discussion</h4> 4409<p class="discussion">The authorization string is set by <a href="#cupsDoAuthentication"><code>cupsDoAuthentication</code></a> and 4410<a href="#httpSetAuthString"><code>httpSetAuthString</code></a>. Use <a href="#httpGetAuthString"><code>httpGetAuthString</code></a> to retrieve the 4411string to use with <a href="#httpSetField"><code>httpSetField</code></a> for the 4412<code>HTTP_FIELD_AUTHORIZATION</code> value. 4413 4414</p> 4415<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetBlocking">httpGetBlocking</a></h3> 4416<p class="description">Get the blocking/non-block state of a connection.</p> 4417<p class="code"> 4418int httpGetBlocking(<a href="#http_t">http_t</a> *http);</p> 4419<h4 class="parameters">Parameters</h4> 4420<table class="list"><tbody> 4421<tr><th>http</th> 4422<td class="description">HTTP connection</td></tr> 4423</tbody></table> 4424<h4 class="returnvalue">Return Value</h4> 4425<p class="description">1 if blocking, 0 if non-blocking</p> 4426<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpGetContentEncoding">httpGetContentEncoding</a></h3> 4427<p class="description">Get a common content encoding, if any, between 4428the client and server.</p> 4429<p class="code"> 4430const char *httpGetContentEncoding(<a href="#http_t">http_t</a> *http);</p> 4431<h4 class="parameters">Parameters</h4> 4432<table class="list"><tbody> 4433<tr><th>http</th> 4434<td class="description">HTTP connection</td></tr> 4435</tbody></table> 4436<h4 class="returnvalue">Return Value</h4> 4437<p class="description">Content-Coding value or 4438<code>NULL</code> for the identity 4439coding.</p> 4440<h4 class="discussion">Discussion</h4> 4441<p class="discussion">This function uses the value of the Accepts-Encoding HTTP header and must be 4442called after receiving a response from the server or a request from the 4443client. The value returned can be use in subsequent requests (for clients) 4444or in the response (for servers) in order to compress the content stream. 4445 4446</p> 4447<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="httpGetCookie">httpGetCookie</a></h3> 4448<p class="description">Get any cookie data from the response.</p> 4449<p class="code"> 4450const char *httpGetCookie(<a href="#http_t">http_t</a> *http);</p> 4451<h4 class="parameters">Parameters</h4> 4452<table class="list"><tbody> 4453<tr><th>http</th> 4454<td class="description">HTTP connection</td></tr> 4455</tbody></table> 4456<h4 class="returnvalue">Return Value</h4> 4457<p class="description">Cookie data or <code>NULL</code></p> 4458<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetDateString2">httpGetDateString2</a></h3> 4459<p class="description">Get a formatted date/time string from a time value.</p> 4460<p class="code"> 4461const char *httpGetDateString2(time_t t, char *s, int slen);</p> 4462<h4 class="parameters">Parameters</h4> 4463<table class="list"><tbody> 4464<tr><th>t</th> 4465<td class="description">Time in seconds</td></tr> 4466<tr><th>s</th> 4467<td class="description">String buffer</td></tr> 4468<tr><th>slen</th> 4469<td class="description">Size of string buffer</td></tr> 4470</tbody></table> 4471<h4 class="returnvalue">Return Value</h4> 4472<p class="description">Date/time string</p> 4473<h3 class="function"><a id="httpGetDateTime">httpGetDateTime</a></h3> 4474<p class="description">Get a time value from a formatted date/time string.</p> 4475<p class="code"> 4476time_t httpGetDateTime(const char *s);</p> 4477<h4 class="parameters">Parameters</h4> 4478<table class="list"><tbody> 4479<tr><th>s</th> 4480<td class="description">Date/time string</td></tr> 4481</tbody></table> 4482<h4 class="returnvalue">Return Value</h4> 4483<p class="description">Time in seconds</p> 4484<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetEncryption">httpGetEncryption</a></h3> 4485<p class="description">Get the current encryption mode of a connection.</p> 4486<p class="code"> 4487<a href="#http_encryption_t">http_encryption_t</a> httpGetEncryption(<a href="#http_t">http_t</a> *http);</p> 4488<h4 class="parameters">Parameters</h4> 4489<table class="list"><tbody> 4490<tr><th>http</th> 4491<td class="description">HTTP connection</td></tr> 4492</tbody></table> 4493<h4 class="returnvalue">Return Value</h4> 4494<p class="description">Current encryption mode</p> 4495<h4 class="discussion">Discussion</h4> 4496<p class="discussion">This function returns the encryption mode for the connection. Use the 4497<a href="#httpIsEncrypted"><code>httpIsEncrypted</code></a> function to determine whether a TLS session has 4498been established. 4499 4500</p> 4501<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpGetExpect">httpGetExpect</a></h3> 4502<p class="description">Get the value of the Expect header, if any.</p> 4503<p class="code"> 4504http_status_t httpGetExpect(<a href="#http_t">http_t</a> *http);</p> 4505<h4 class="parameters">Parameters</h4> 4506<table class="list"><tbody> 4507<tr><th>http</th> 4508<td class="description">HTTP connection</td></tr> 4509</tbody></table> 4510<h4 class="returnvalue">Return Value</h4> 4511<p class="description">Expect: status, if any</p> 4512<h4 class="discussion">Discussion</h4> 4513<p class="discussion">Returns <code>HTTP_STATUS_NONE</code> if there is no Expect header, otherwise 4514returns the expected HTTP status code, typically <code>HTTP_STATUS_CONTINUE</code>. 4515 4516</p> 4517<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetFd">httpGetFd</a></h3> 4518<p class="description">Get the file descriptor associated with a connection.</p> 4519<p class="code"> 4520int httpGetFd(<a href="#http_t">http_t</a> *http);</p> 4521<h4 class="parameters">Parameters</h4> 4522<table class="list"><tbody> 4523<tr><th>http</th> 4524<td class="description">HTTP connection</td></tr> 4525</tbody></table> 4526<h4 class="returnvalue">Return Value</h4> 4527<p class="description">File descriptor or -1 if none</p> 4528<h3 class="function"><a id="httpGetField">httpGetField</a></h3> 4529<p class="description">Get a field value from a request/response.</p> 4530<p class="code"> 4531const char *httpGetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field);</p> 4532<h4 class="parameters">Parameters</h4> 4533<table class="list"><tbody> 4534<tr><th>http</th> 4535<td class="description">HTTP connection</td></tr> 4536<tr><th>field</th> 4537<td class="description">Field to get</td></tr> 4538</tbody></table> 4539<h4 class="returnvalue">Return Value</h4> 4540<p class="description">Field value</p> 4541<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetHostname">httpGetHostname</a></h3> 4542<p class="description">Get the FQDN for the connection or local system.</p> 4543<p class="code"> 4544const char *httpGetHostname(<a href="#http_t">http_t</a> *http, char *s, int slen);</p> 4545<h4 class="parameters">Parameters</h4> 4546<table class="list"><tbody> 4547<tr><th>http</th> 4548<td class="description">HTTP connection or NULL</td></tr> 4549<tr><th>s</th> 4550<td class="description">String buffer for name</td></tr> 4551<tr><th>slen</th> 4552<td class="description">Size of buffer</td></tr> 4553</tbody></table> 4554<h4 class="returnvalue">Return Value</h4> 4555<p class="description">FQDN for connection or system</p> 4556<h4 class="discussion">Discussion</h4> 4557<p class="discussion">When "http" points to a connected socket, return the hostname or 4558address that was used in the call to httpConnect() or httpConnectEncrypt(), 4559or the address of the client for the connection from httpAcceptConnection(). 4560Otherwise, return the FQDN for the local system using both gethostname() 4561and gethostbyname() to get the local hostname with domain. 4562 4563</p> 4564<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetKeepAlive">httpGetKeepAlive</a></h3> 4565<p class="description">Get the current Keep-Alive state of the connection.</p> 4566<p class="code"> 4567<a href="#http_keepalive_t">http_keepalive_t</a> httpGetKeepAlive(<a href="#http_t">http_t</a> *http);</p> 4568<h4 class="parameters">Parameters</h4> 4569<table class="list"><tbody> 4570<tr><th>http</th> 4571<td class="description">HTTP connection</td></tr> 4572</tbody></table> 4573<h4 class="returnvalue">Return Value</h4> 4574<p class="description">Keep-Alive state</p> 4575<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetLength2">httpGetLength2</a></h3> 4576<p class="description">Get the amount of data remaining from the 4577content-length or transfer-encoding fields.</p> 4578<p class="code"> 4579off_t httpGetLength2(<a href="#http_t">http_t</a> *http);</p> 4580<h4 class="parameters">Parameters</h4> 4581<table class="list"><tbody> 4582<tr><th>http</th> 4583<td class="description">HTTP connection</td></tr> 4584</tbody></table> 4585<h4 class="returnvalue">Return Value</h4> 4586<p class="description">Content length</p> 4587<h4 class="discussion">Discussion</h4> 4588<p class="discussion">This function returns the complete content length, even for 4589content larger than 2^31 - 1. 4590 4591</p> 4592<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetPending">httpGetPending</a></h3> 4593<p class="description">Get the number of bytes that are buffered for writing.</p> 4594<p class="code"> 4595size_t httpGetPending(<a href="#http_t">http_t</a> *http);</p> 4596<h4 class="parameters">Parameters</h4> 4597<table class="list"><tbody> 4598<tr><th>http</th> 4599<td class="description">HTTP connection</td></tr> 4600</tbody></table> 4601<h4 class="returnvalue">Return Value</h4> 4602<p class="description">Number of bytes buffered</p> 4603<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetReady">httpGetReady</a></h3> 4604<p class="description">Get the number of bytes that can be read without blocking.</p> 4605<p class="code"> 4606size_t httpGetReady(<a href="#http_t">http_t</a> *http);</p> 4607<h4 class="parameters">Parameters</h4> 4608<table class="list"><tbody> 4609<tr><th>http</th> 4610<td class="description">HTTP connection</td></tr> 4611</tbody></table> 4612<h4 class="returnvalue">Return Value</h4> 4613<p class="description">Number of bytes available</p> 4614<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetRemaining">httpGetRemaining</a></h3> 4615<p class="description">Get the number of remaining bytes in the message 4616body or current chunk.</p> 4617<p class="code"> 4618size_t httpGetRemaining(<a href="#http_t">http_t</a> *http);</p> 4619<h4 class="parameters">Parameters</h4> 4620<table class="list"><tbody> 4621<tr><th>http</th> 4622<td class="description">HTTP connection</td></tr> 4623</tbody></table> 4624<h4 class="returnvalue">Return Value</h4> 4625<p class="description">Remaining bytes</p> 4626<h4 class="discussion">Discussion</h4> 4627<p class="discussion">The <a href="#httpIsChunked"><code>httpIsChunked</code></a> function can be used to determine whether the 4628message body is chunked or fixed-length. 4629 4630</p> 4631<h3 class="function"><a id="httpGetState">httpGetState</a></h3> 4632<p class="description">Get the current state of the HTTP request.</p> 4633<p class="code"> 4634<a href="#http_state_t">http_state_t</a> httpGetState(<a href="#http_t">http_t</a> *http);</p> 4635<h4 class="parameters">Parameters</h4> 4636<table class="list"><tbody> 4637<tr><th>http</th> 4638<td class="description">HTTP connection</td></tr> 4639</tbody></table> 4640<h4 class="returnvalue">Return Value</h4> 4641<p class="description">HTTP state</p> 4642<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetStatus">httpGetStatus</a></h3> 4643<p class="description">Get the status of the last HTTP request.</p> 4644<p class="code"> 4645http_status_t httpGetStatus(<a href="#http_t">http_t</a> *http);</p> 4646<h4 class="parameters">Parameters</h4> 4647<table class="list"><tbody> 4648<tr><th>http</th> 4649<td class="description">HTTP connection</td></tr> 4650</tbody></table> 4651<h4 class="returnvalue">Return Value</h4> 4652<p class="description">HTTP status</p> 4653<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetSubField2">httpGetSubField2</a></h3> 4654<p class="description">Get a sub-field value.</p> 4655<p class="code"> 4656char *httpGetSubField2(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *name, char *value, int valuelen);</p> 4657<h4 class="parameters">Parameters</h4> 4658<table class="list"><tbody> 4659<tr><th>http</th> 4660<td class="description">HTTP connection</td></tr> 4661<tr><th>field</th> 4662<td class="description">Field index</td></tr> 4663<tr><th>name</th> 4664<td class="description">Name of sub-field</td></tr> 4665<tr><th>value</th> 4666<td class="description">Value string</td></tr> 4667<tr><th>valuelen</th> 4668<td class="description">Size of value buffer</td></tr> 4669</tbody></table> 4670<h4 class="returnvalue">Return Value</h4> 4671<p class="description">Value or <code>NULL</code></p> 4672<h3 class="function"><a id="httpGetVersion">httpGetVersion</a></h3> 4673<p class="description">Get the HTTP version at the other end.</p> 4674<p class="code"> 4675<a href="#http_version_t">http_version_t</a> httpGetVersion(<a href="#http_t">http_t</a> *http);</p> 4676<h4 class="parameters">Parameters</h4> 4677<table class="list"><tbody> 4678<tr><th>http</th> 4679<td class="description">HTTP connection</td></tr> 4680</tbody></table> 4681<h4 class="returnvalue">Return Value</h4> 4682<p class="description">Version number</p> 4683<h3 class="function"><a id="httpGets">httpGets</a></h3> 4684<p class="description">Get a line of text from a HTTP connection.</p> 4685<p class="code"> 4686char *httpGets(char *line, int length, <a href="#http_t">http_t</a> *http);</p> 4687<h4 class="parameters">Parameters</h4> 4688<table class="list"><tbody> 4689<tr><th>line</th> 4690<td class="description">Line to read into</td></tr> 4691<tr><th>length</th> 4692<td class="description">Max length of buffer</td></tr> 4693<tr><th>http</th> 4694<td class="description">HTTP connection</td></tr> 4695</tbody></table> 4696<h4 class="returnvalue">Return Value</h4> 4697<p class="description">Line or <code>NULL</code></p> 4698<h3 class="function"><a id="httpHead">httpHead</a></h3> 4699<p class="description">Send a HEAD request to the server.</p> 4700<p class="code"> 4701int httpHead(<a href="#http_t">http_t</a> *http, const char *uri);</p> 4702<h4 class="parameters">Parameters</h4> 4703<table class="list"><tbody> 4704<tr><th>http</th> 4705<td class="description">HTTP connection</td></tr> 4706<tr><th>uri</th> 4707<td class="description">URI for head</td></tr> 4708</tbody></table> 4709<h4 class="returnvalue">Return Value</h4> 4710<p class="description">Status of call (0 = success)</p> 4711<h3 class="function"><a id="httpInitialize">httpInitialize</a></h3> 4712<p class="description">Initialize the HTTP interface library and set the 4713default HTTP proxy (if any).</p> 4714<p class="code"> 4715void httpInitialize(void);</p> 4716<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpIsChunked">httpIsChunked</a></h3> 4717<p class="description">Report whether a message body is chunked.</p> 4718<p class="code"> 4719int httpIsChunked(<a href="#http_t">http_t</a> *http);</p> 4720<h4 class="parameters">Parameters</h4> 4721<table class="list"><tbody> 4722<tr><th>http</th> 4723<td class="description">HTTP connection</td></tr> 4724</tbody></table> 4725<h4 class="returnvalue">Return Value</h4> 4726<p class="description">1 if chunked, 0 if not</p> 4727<h4 class="discussion">Discussion</h4> 4728<p class="discussion">This function returns non-zero if the message body is composed of 4729variable-length chunks. 4730 4731</p> 4732<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpIsEncrypted">httpIsEncrypted</a></h3> 4733<p class="description">Report whether a connection is encrypted.</p> 4734<p class="code"> 4735int httpIsEncrypted(<a href="#http_t">http_t</a> *http);</p> 4736<h4 class="parameters">Parameters</h4> 4737<table class="list"><tbody> 4738<tr><th>http</th> 4739<td class="description">HTTP connection</td></tr> 4740</tbody></table> 4741<h4 class="returnvalue">Return Value</h4> 4742<p class="description">1 if encrypted, 0 if not</p> 4743<h4 class="discussion">Discussion</h4> 4744<p class="discussion">This function returns non-zero if the connection is currently encrypted. 4745 4746</p> 4747<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpLoadCredentials">httpLoadCredentials</a></h3> 4748<p class="description">Load X.509 credentials from a keychain file.</p> 4749<p class="code"> 4750int httpLoadCredentials(const char *path, <a href="#cups_array_t">cups_array_t</a> **credentials, const char *common_name);</p> 4751<h4 class="parameters">Parameters</h4> 4752<table class="list"><tbody> 4753<tr><th>path</th> 4754<td class="description">Keychain path or <code>NULL</code> for default</td></tr> 4755<tr><th>credentials</th> 4756<td class="description">Credentials</td></tr> 4757<tr><th>common_name</th> 4758<td class="description">Common name for credentials</td></tr> 4759</tbody></table> 4760<h4 class="returnvalue">Return Value</h4> 4761<p class="description">0 on success, -1 on error</p> 4762<h3 class="function"><a id="httpOptions">httpOptions</a></h3> 4763<p class="description">Send an OPTIONS request to the server.</p> 4764<p class="code"> 4765int httpOptions(<a href="#http_t">http_t</a> *http, const char *uri);</p> 4766<h4 class="parameters">Parameters</h4> 4767<table class="list"><tbody> 4768<tr><th>http</th> 4769<td class="description">HTTP connection</td></tr> 4770<tr><th>uri</th> 4771<td class="description">URI for options</td></tr> 4772</tbody></table> 4773<h4 class="returnvalue">Return Value</h4> 4774<p class="description">Status of call (0 = success)</p> 4775<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpPeek">httpPeek</a></h3> 4776<p class="description">Peek at data from a HTTP connection.</p> 4777<p class="code"> 4778ssize_t httpPeek(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p> 4779<h4 class="parameters">Parameters</h4> 4780<table class="list"><tbody> 4781<tr><th>http</th> 4782<td class="description">HTTP connection</td></tr> 4783<tr><th>buffer</th> 4784<td class="description">Buffer for data</td></tr> 4785<tr><th>length</th> 4786<td class="description">Maximum number of bytes</td></tr> 4787</tbody></table> 4788<h4 class="returnvalue">Return Value</h4> 4789<p class="description">Number of bytes copied</p> 4790<h4 class="discussion">Discussion</h4> 4791<p class="discussion">This function copies available data from the given HTTP connection, reading 4792a buffer as needed. The data is still available for reading using 4793<a href="#httpRead2"><code>httpRead2</code></a>.<br> 4794<br> 4795For non-blocking connections the usual timeouts apply. 4796 4797</p> 4798<h3 class="function"><a id="httpPost">httpPost</a></h3> 4799<p class="description">Send a POST request to the server.</p> 4800<p class="code"> 4801int httpPost(<a href="#http_t">http_t</a> *http, const char *uri);</p> 4802<h4 class="parameters">Parameters</h4> 4803<table class="list"><tbody> 4804<tr><th>http</th> 4805<td class="description">HTTP connection</td></tr> 4806<tr><th>uri</th> 4807<td class="description">URI for post</td></tr> 4808</tbody></table> 4809<h4 class="returnvalue">Return Value</h4> 4810<p class="description">Status of call (0 = success)</p> 4811<h3 class="function"><a id="httpPut">httpPut</a></h3> 4812<p class="description">Send a PUT request to the server.</p> 4813<p class="code"> 4814int httpPut(<a href="#http_t">http_t</a> *http, const char *uri);</p> 4815<h4 class="parameters">Parameters</h4> 4816<table class="list"><tbody> 4817<tr><th>http</th> 4818<td class="description">HTTP connection</td></tr> 4819<tr><th>uri</th> 4820<td class="description">URI to put</td></tr> 4821</tbody></table> 4822<h4 class="returnvalue">Return Value</h4> 4823<p class="description">Status of call (0 = success)</p> 4824<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpRead2">httpRead2</a></h3> 4825<p class="description">Read data from a HTTP connection.</p> 4826<p class="code"> 4827ssize_t httpRead2(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p> 4828<h4 class="parameters">Parameters</h4> 4829<table class="list"><tbody> 4830<tr><th>http</th> 4831<td class="description">HTTP connection</td></tr> 4832<tr><th>buffer</th> 4833<td class="description">Buffer for data</td></tr> 4834<tr><th>length</th> 4835<td class="description">Maximum number of bytes</td></tr> 4836</tbody></table> 4837<h4 class="returnvalue">Return Value</h4> 4838<p class="description">Number of bytes read</p> 4839<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpReadRequest">httpReadRequest</a></h3> 4840<p class="description">Read a HTTP request from a connection.</p> 4841<p class="code"> 4842<a href="#http_state_t">http_state_t</a> httpReadRequest(<a href="#http_t">http_t</a> *http, char *uri, size_t urilen);</p> 4843<h4 class="parameters">Parameters</h4> 4844<table class="list"><tbody> 4845<tr><th>http</th> 4846<td class="description">HTTP connection</td></tr> 4847<tr><th>uri</th> 4848<td class="description">URI buffer</td></tr> 4849<tr><th>urilen</th> 4850<td class="description">Size of URI buffer</td></tr> 4851</tbody></table> 4852<h4 class="returnvalue">Return Value</h4> 4853<p class="description">New state of connection</p> 4854<h3 class="function"><a id="httpReconnect2">httpReconnect2</a></h3> 4855<p class="description">Reconnect to a HTTP server with timeout and optional 4856cancel.</p> 4857<p class="code"> 4858int httpReconnect2(<a href="#http_t">http_t</a> *http, int msec, int *cancel);</p> 4859<h4 class="parameters">Parameters</h4> 4860<table class="list"><tbody> 4861<tr><th>http</th> 4862<td class="description">HTTP connection</td></tr> 4863<tr><th>msec</th> 4864<td class="description">Timeout in milliseconds</td></tr> 4865<tr><th>cancel</th> 4866<td class="description">Pointer to "cancel" variable</td></tr> 4867</tbody></table> 4868<h4 class="returnvalue">Return Value</h4> 4869<p class="description">0 on success, non-zero on failure</p> 4870<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpResolveHostname">httpResolveHostname</a></h3> 4871<p class="description">Resolve the hostname of the HTTP connection 4872address.</p> 4873<p class="code"> 4874const char *httpResolveHostname(<a href="#http_t">http_t</a> *http, char *buffer, size_t bufsize);</p> 4875<h4 class="parameters">Parameters</h4> 4876<table class="list"><tbody> 4877<tr><th>http</th> 4878<td class="description">HTTP connection</td></tr> 4879<tr><th>buffer</th> 4880<td class="description">Hostname buffer</td></tr> 4881<tr><th>bufsize</th> 4882<td class="description">Size of buffer</td></tr> 4883</tbody></table> 4884<h4 class="returnvalue">Return Value</h4> 4885<p class="description">Resolved hostname or <code>NULL</code></p> 4886<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpSaveCredentials">httpSaveCredentials</a></h3> 4887<p class="description">Save X.509 credentials to a keychain file.</p> 4888<p class="code"> 4889int httpSaveCredentials(const char *path, <a href="#cups_array_t">cups_array_t</a> *credentials, const char *common_name);</p> 4890<h4 class="parameters">Parameters</h4> 4891<table class="list"><tbody> 4892<tr><th>path</th> 4893<td class="description">Keychain path or <code>NULL</code> for default</td></tr> 4894<tr><th>credentials</th> 4895<td class="description">Credentials</td></tr> 4896<tr><th>common_name</th> 4897<td class="description">Common name for credentials</td></tr> 4898</tbody></table> 4899<h4 class="returnvalue">Return Value</h4> 4900<p class="description">-1 on error, 0 on success</p> 4901<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpSeparateURI">httpSeparateURI</a></h3> 4902<p class="description">Separate a Universal Resource Identifier into its 4903components.</p> 4904<p class="code"> 4905<a href="#http_uri_status_t">http_uri_status_t</a> httpSeparateURI(<a href="#http_uri_coding_t">http_uri_coding_t</a> decoding, const char *uri, char *scheme, int schemelen, char *username, int usernamelen, char *host, int hostlen, int *port, char *resource, int resourcelen);</p> 4906<h4 class="parameters">Parameters</h4> 4907<table class="list"><tbody> 4908<tr><th>decoding</th> 4909<td class="description">Decoding flags</td></tr> 4910<tr><th>uri</th> 4911<td class="description">Universal Resource Identifier</td></tr> 4912<tr><th>scheme</th> 4913<td class="description">Scheme (http, https, etc.)</td></tr> 4914<tr><th>schemelen</th> 4915<td class="description">Size of scheme buffer</td></tr> 4916<tr><th>username</th> 4917<td class="description">Username</td></tr> 4918<tr><th>usernamelen</th> 4919<td class="description">Size of username buffer</td></tr> 4920<tr><th>host</th> 4921<td class="description">Hostname</td></tr> 4922<tr><th>hostlen</th> 4923<td class="description">Size of hostname buffer</td></tr> 4924<tr><th>port</th> 4925<td class="description">Port number to use</td></tr> 4926<tr><th>resource</th> 4927<td class="description">Resource/filename</td></tr> 4928<tr><th>resourcelen</th> 4929<td class="description">Size of resource buffer</td></tr> 4930</tbody></table> 4931<h4 class="returnvalue">Return Value</h4> 4932<p class="description">Result of separation</p> 4933<h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="httpSetAuthString">httpSetAuthString</a></h3> 4934<p class="description">Set the current authorization string.</p> 4935<p class="code"> 4936void httpSetAuthString(<a href="#http_t">http_t</a> *http, const char *scheme, const char *data);</p> 4937<h4 class="parameters">Parameters</h4> 4938<table class="list"><tbody> 4939<tr><th>http</th> 4940<td class="description">HTTP connection</td></tr> 4941<tr><th>scheme</th> 4942<td class="description">Auth scheme (NULL to clear it)</td></tr> 4943<tr><th>data</th> 4944<td class="description">Auth data (NULL for none)</td></tr> 4945</tbody></table> 4946<h4 class="discussion">Discussion</h4> 4947<p class="discussion">This function just stores a copy of the current authorization string in 4948the HTTP connection object. You must still call <a href="#httpSetField"><code>httpSetField</code></a> to set 4949<code>HTTP_FIELD_AUTHORIZATION</code> prior to issuing a HTTP request using 4950<a href="#httpGet"><code>httpGet</code></a>, <a href="#httpHead"><code>httpHead</code></a>, <a href="#httpOptions"><code>httpOptions</code></a>, <a href="#httpPost"><code>httpPost</code></a>, or 4951<a href="#httpPut"><code>httpPut</code></a>. 4952 4953</p> 4954<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="httpSetCookie">httpSetCookie</a></h3> 4955<p class="description">Set the cookie value(s).</p> 4956<p class="code"> 4957void httpSetCookie(<a href="#http_t">http_t</a> *http, const char *cookie);</p> 4958<h4 class="parameters">Parameters</h4> 4959<table class="list"><tbody> 4960<tr><th>http</th> 4961<td class="description">Connection</td></tr> 4962<tr><th>cookie</th> 4963<td class="description">Cookie string</td></tr> 4964</tbody></table> 4965<h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="httpSetCredentials">httpSetCredentials</a></h3> 4966<p class="description">Set the credentials associated with an encrypted 4967connection.</p> 4968<p class="code"> 4969int httpSetCredentials(<a href="#http_t">http_t</a> *http, <a href="#cups_array_t">cups_array_t</a> *credentials);</p> 4970<h4 class="parameters">Parameters</h4> 4971<table class="list"><tbody> 4972<tr><th>http</th> 4973<td class="description">HTTP connection</td></tr> 4974<tr><th>credentials</th> 4975<td class="description">Array of credentials</td></tr> 4976</tbody></table> 4977<h4 class="returnvalue">Return Value</h4> 4978<p class="description">Status of call (0 = success)</p> 4979<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpSetDefaultField">httpSetDefaultField</a></h3> 4980<p class="description">Set the default value of an HTTP header.</p> 4981<p class="code"> 4982void httpSetDefaultField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p> 4983<h4 class="parameters">Parameters</h4> 4984<table class="list"><tbody> 4985<tr><th>http</th> 4986<td class="description">HTTP connection</td></tr> 4987<tr><th>field</th> 4988<td class="description">Field index</td></tr> 4989<tr><th>value</th> 4990<td class="description">Value</td></tr> 4991</tbody></table> 4992<h4 class="discussion">Discussion</h4> 4993<p class="discussion">Currently only <code>HTTP_FIELD_ACCEPT_ENCODING</code>, <code>HTTP_FIELD_SERVER</code>, 4994and <code>HTTP_FIELD_USER_AGENT</code> can be set. 4995 4996</p> 4997<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpSetExpect">httpSetExpect</a></h3> 4998<p class="description">Set the Expect: header in a request.</p> 4999<p class="code"> 5000void httpSetExpect(<a href="#http_t">http_t</a> *http, http_status_t expect);</p> 5001<h4 class="parameters">Parameters</h4> 5002<table class="list"><tbody> 5003<tr><th>http</th> 5004<td class="description">HTTP connection</td></tr> 5005<tr><th>expect</th> 5006<td class="description">HTTP status to expect 5007(<code>HTTP_STATUS_CONTINUE</code>)</td></tr> 5008</tbody></table> 5009<h4 class="discussion">Discussion</h4> 5010<p class="discussion">Currently only <code>HTTP_STATUS_CONTINUE</code> is supported for the "expect" 5011argument. 5012 5013</p> 5014<h3 class="function"><a id="httpSetField">httpSetField</a></h3> 5015<p class="description">Set the value of an HTTP header.</p> 5016<p class="code"> 5017void httpSetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p> 5018<h4 class="parameters">Parameters</h4> 5019<table class="list"><tbody> 5020<tr><th>http</th> 5021<td class="description">HTTP connection</td></tr> 5022<tr><th>field</th> 5023<td class="description">Field index</td></tr> 5024<tr><th>value</th> 5025<td class="description">Value</td></tr> 5026</tbody></table> 5027<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpSetKeepAlive">httpSetKeepAlive</a></h3> 5028<p class="description">Set the current Keep-Alive state of a connection.</p> 5029<p class="code"> 5030void httpSetKeepAlive(<a href="#http_t">http_t</a> *http, <a href="#http_keepalive_t">http_keepalive_t</a> keep_alive);</p> 5031<h4 class="parameters">Parameters</h4> 5032<table class="list"><tbody> 5033<tr><th>http</th> 5034<td class="description">HTTP connection</td></tr> 5035<tr><th>keep_alive</th> 5036<td class="description">New Keep-Alive value</td></tr> 5037</tbody></table> 5038<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpSetLength">httpSetLength</a></h3> 5039<p class="description">Set the content-length and content-encoding.</p> 5040<p class="code"> 5041void httpSetLength(<a href="#http_t">http_t</a> *http, size_t length);</p> 5042<h4 class="parameters">Parameters</h4> 5043<table class="list"><tbody> 5044<tr><th>http</th> 5045<td class="description">HTTP connection</td></tr> 5046<tr><th>length</th> 5047<td class="description">Length (0 for chunked)</td></tr> 5048</tbody></table> 5049<h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="httpSetTimeout">httpSetTimeout</a></h3> 5050<p class="description">Set read/write timeouts and an optional callback.</p> 5051<p class="code"> 5052void httpSetTimeout(<a href="#http_t">http_t</a> *http, double timeout, <a href="#http_timeout_cb_t">http_timeout_cb_t</a> cb, void *user_data);</p> 5053<h4 class="parameters">Parameters</h4> 5054<table class="list"><tbody> 5055<tr><th>http</th> 5056<td class="description">HTTP connection</td></tr> 5057<tr><th>timeout</th> 5058<td class="description">Number of seconds for timeout, 5059must be greater than 0</td></tr> 5060<tr><th>cb</th> 5061<td class="description">Callback function or <code>NULL</code></td></tr> 5062<tr><th>user_data</th> 5063<td class="description">User data pointer</td></tr> 5064</tbody></table> 5065<h4 class="discussion">Discussion</h4> 5066<p class="discussion">The optional timeout callback receives both the HTTP connection and a user 5067data pointer and must return 1 to continue or 0 to error (time) out. 5068 5069</p> 5070<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpShutdown">httpShutdown</a></h3> 5071<p class="description">Shutdown one side of an HTTP connection.</p> 5072<p class="code"> 5073void httpShutdown(<a href="#http_t">http_t</a> *http);</p> 5074<h4 class="parameters">Parameters</h4> 5075<table class="list"><tbody> 5076<tr><th>http</th> 5077<td class="description">HTTP connection</td></tr> 5078</tbody></table> 5079<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpStateString">httpStateString</a></h3> 5080<p class="description">Return the string describing a HTTP state value.</p> 5081<p class="code"> 5082const char *httpStateString(<a href="#http_state_t">http_state_t</a> state);</p> 5083<h4 class="parameters">Parameters</h4> 5084<table class="list"><tbody> 5085<tr><th>state</th> 5086<td class="description">HTTP state value</td></tr> 5087</tbody></table> 5088<h4 class="returnvalue">Return Value</h4> 5089<p class="description">State string</p> 5090<h3 class="function"><a id="httpStatus">httpStatus</a></h3> 5091<p class="description">Return a short string describing a HTTP status code.</p> 5092<p class="code"> 5093const char *httpStatus(http_status_t status);</p> 5094<h4 class="parameters">Parameters</h4> 5095<table class="list"><tbody> 5096<tr><th>status</th> 5097<td class="description">HTTP status code</td></tr> 5098</tbody></table> 5099<h4 class="returnvalue">Return Value</h4> 5100<p class="description">Localized status string</p> 5101<h4 class="discussion">Discussion</h4> 5102<p class="discussion">The returned string is localized to the current POSIX locale and is based 5103on the status strings defined in RFC 7231.</p> 5104<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpURIStatusString">httpURIStatusString</a></h3> 5105<p class="description">Return a string describing a URI status code.</p> 5106<p class="code"> 5107const char *httpURIStatusString(<a href="#http_uri_status_t">http_uri_status_t</a> status);</p> 5108<h4 class="parameters">Parameters</h4> 5109<table class="list"><tbody> 5110<tr><th>status</th> 5111<td class="description">URI status code</td></tr> 5112</tbody></table> 5113<h4 class="returnvalue">Return Value</h4> 5114<p class="description">Localized status string</p> 5115<h3 class="function"><a id="httpUpdate">httpUpdate</a></h3> 5116<p class="description">Update the current HTTP state for incoming data.</p> 5117<p class="code"> 5118http_status_t httpUpdate(<a href="#http_t">http_t</a> *http);</p> 5119<h4 class="parameters">Parameters</h4> 5120<table class="list"><tbody> 5121<tr><th>http</th> 5122<td class="description">HTTP connection</td></tr> 5123</tbody></table> 5124<h4 class="returnvalue">Return Value</h4> 5125<p class="description">HTTP status</p> 5126<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="httpWait">httpWait</a></h3> 5127<p class="description">Wait for data available on a connection.</p> 5128<p class="code"> 5129int httpWait(<a href="#http_t">http_t</a> *http, int msec);</p> 5130<h4 class="parameters">Parameters</h4> 5131<table class="list"><tbody> 5132<tr><th>http</th> 5133<td class="description">HTTP connection</td></tr> 5134<tr><th>msec</th> 5135<td class="description">Milliseconds to wait</td></tr> 5136</tbody></table> 5137<h4 class="returnvalue">Return Value</h4> 5138<p class="description">1 if data is available, 0 otherwise</p> 5139<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpWrite2">httpWrite2</a></h3> 5140<p class="description">Write data to a HTTP connection.</p> 5141<p class="code"> 5142ssize_t httpWrite2(<a href="#http_t">http_t</a> *http, const char *buffer, size_t length);</p> 5143<h4 class="parameters">Parameters</h4> 5144<table class="list"><tbody> 5145<tr><th>http</th> 5146<td class="description">HTTP connection</td></tr> 5147<tr><th>buffer</th> 5148<td class="description">Buffer for data</td></tr> 5149<tr><th>length</th> 5150<td class="description">Number of bytes to write</td></tr> 5151</tbody></table> 5152<h4 class="returnvalue">Return Value</h4> 5153<p class="description">Number of bytes written</p> 5154<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpWriteResponse">httpWriteResponse</a></h3> 5155<p class="description">Write a HTTP response to a client connection.</p> 5156<p class="code"> 5157int httpWriteResponse(<a href="#http_t">http_t</a> *http, http_status_t status);</p> 5158<h4 class="parameters">Parameters</h4> 5159<table class="list"><tbody> 5160<tr><th>http</th> 5161<td class="description">HTTP connection</td></tr> 5162<tr><th>status</th> 5163<td class="description">Status code</td></tr> 5164</tbody></table> 5165<h4 class="returnvalue">Return Value</h4> 5166<p class="description">0 on success, -1 on error</p> 5167<h3 class="function"><a id="ippAddBoolean">ippAddBoolean</a></h3> 5168<p class="description">Add a boolean attribute to an IPP message.</p> 5169<p class="code"> 5170<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBoolean(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, char value);</p> 5171<h4 class="parameters">Parameters</h4> 5172<table class="list"><tbody> 5173<tr><th>ipp</th> 5174<td class="description">IPP message</td></tr> 5175<tr><th>group</th> 5176<td class="description">IPP group</td></tr> 5177<tr><th>name</th> 5178<td class="description">Name of attribute</td></tr> 5179<tr><th>value</th> 5180<td class="description">Value of attribute</td></tr> 5181</tbody></table> 5182<h4 class="returnvalue">Return Value</h4> 5183<p class="description">New attribute</p> 5184<h4 class="discussion">Discussion</h4> 5185<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5186the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5187<br> 5188The <code>group</code> parameter specifies the IPP attribute group tag: none 5189(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), 5190event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation 5191(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription 5192(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p> 5193<h3 class="function"><a id="ippAddBooleans">ippAddBooleans</a></h3> 5194<p class="description">Add an array of boolean values.</p> 5195<p class="code"> 5196<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddBooleans(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int num_values, const char *values);</p> 5197<h4 class="parameters">Parameters</h4> 5198<table class="list"><tbody> 5199<tr><th>ipp</th> 5200<td class="description">IPP message</td></tr> 5201<tr><th>group</th> 5202<td class="description">IPP group</td></tr> 5203<tr><th>name</th> 5204<td class="description">Name of attribute</td></tr> 5205<tr><th>num_values</th> 5206<td class="description">Number of values</td></tr> 5207<tr><th>values</th> 5208<td class="description">Values</td></tr> 5209</tbody></table> 5210<h4 class="returnvalue">Return Value</h4> 5211<p class="description">New attribute</p> 5212<h4 class="discussion">Discussion</h4> 5213<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5214the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5215<br> 5216The <code>group</code> parameter specifies the IPP attribute group tag: none 5217(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), 5218event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation 5219(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription 5220(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p> 5221<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippAddCollection">ippAddCollection</a></h3> 5222<p class="description">Add a collection value.</p> 5223<p class="code"> 5224<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollection(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, <a href="#ipp_t">ipp_t</a> *value);</p> 5225<h4 class="parameters">Parameters</h4> 5226<table class="list"><tbody> 5227<tr><th>ipp</th> 5228<td class="description">IPP message</td></tr> 5229<tr><th>group</th> 5230<td class="description">IPP group</td></tr> 5231<tr><th>name</th> 5232<td class="description">Name of attribute</td></tr> 5233<tr><th>value</th> 5234<td class="description">Value</td></tr> 5235</tbody></table> 5236<h4 class="returnvalue">Return Value</h4> 5237<p class="description">New attribute</p> 5238<h4 class="discussion">Discussion</h4> 5239<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5240the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5241<br> 5242The <code>group</code> parameter specifies the IPP attribute group tag: none 5243(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), 5244event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation 5245(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription 5246(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>). 5247 5248</p> 5249<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippAddCollections">ippAddCollections</a></h3> 5250<p class="description">Add an array of collection values.</p> 5251<p class="code"> 5252<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddCollections(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int num_values, const <a href="#ipp_t">ipp_t</a> **values);</p> 5253<h4 class="parameters">Parameters</h4> 5254<table class="list"><tbody> 5255<tr><th>ipp</th> 5256<td class="description">IPP message</td></tr> 5257<tr><th>group</th> 5258<td class="description">IPP group</td></tr> 5259<tr><th>name</th> 5260<td class="description">Name of attribute</td></tr> 5261<tr><th>num_values</th> 5262<td class="description">Number of values</td></tr> 5263<tr><th>values</th> 5264<td class="description">Values</td></tr> 5265</tbody></table> 5266<h4 class="returnvalue">Return Value</h4> 5267<p class="description">New attribute</p> 5268<h4 class="discussion">Discussion</h4> 5269<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5270the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5271<br> 5272The <code>group</code> parameter specifies the IPP attribute group tag: none 5273(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), 5274event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation 5275(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription 5276(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>). 5277 5278</p> 5279<h3 class="function"><a id="ippAddDate">ippAddDate</a></h3> 5280<p class="description">Add a dateTime attribute to an IPP message.</p> 5281<p class="code"> 5282<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddDate(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, const <a href="#ipp_uchar_t">ipp_uchar_t</a> *value);</p> 5283<h4 class="parameters">Parameters</h4> 5284<table class="list"><tbody> 5285<tr><th>ipp</th> 5286<td class="description">IPP message</td></tr> 5287<tr><th>group</th> 5288<td class="description">IPP group</td></tr> 5289<tr><th>name</th> 5290<td class="description">Name of attribute</td></tr> 5291<tr><th>value</th> 5292<td class="description">Value</td></tr> 5293</tbody></table> 5294<h4 class="returnvalue">Return Value</h4> 5295<p class="description">New attribute</p> 5296<h4 class="discussion">Discussion</h4> 5297<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5298the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5299<br> 5300The <code>group</code> parameter specifies the IPP attribute group tag: none 5301(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), 5302event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation 5303(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription 5304(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p> 5305<h3 class="function"><a id="ippAddInteger">ippAddInteger</a></h3> 5306<p class="description">Add a integer attribute to an IPP message.</p> 5307<p class="code"> 5308<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddInteger(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, int value);</p> 5309<h4 class="parameters">Parameters</h4> 5310<table class="list"><tbody> 5311<tr><th>ipp</th> 5312<td class="description">IPP message</td></tr> 5313<tr><th>group</th> 5314<td class="description">IPP group</td></tr> 5315<tr><th>value_tag</th> 5316<td class="description">Type of attribute</td></tr> 5317<tr><th>name</th> 5318<td class="description">Name of attribute</td></tr> 5319<tr><th>value</th> 5320<td class="description">Value of attribute</td></tr> 5321</tbody></table> 5322<h4 class="returnvalue">Return Value</h4> 5323<p class="description">New attribute</p> 5324<h4 class="discussion">Discussion</h4> 5325<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5326the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5327<br> 5328The <code>group</code> parameter specifies the IPP attribute group tag: none 5329(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), 5330event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation 5331(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription 5332(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> 5333<br> 5334Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer 5335(<code>IPP_TAG_INTEGER</code>).</p> 5336<h3 class="function"><a id="ippAddIntegers">ippAddIntegers</a></h3> 5337<p class="description">Add an array of integer values.</p> 5338<p class="code"> 5339<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddIntegers(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, int num_values, const int *values);</p> 5340<h4 class="parameters">Parameters</h4> 5341<table class="list"><tbody> 5342<tr><th>ipp</th> 5343<td class="description">IPP message</td></tr> 5344<tr><th>group</th> 5345<td class="description">IPP group</td></tr> 5346<tr><th>value_tag</th> 5347<td class="description">Type of attribute</td></tr> 5348<tr><th>name</th> 5349<td class="description">Name of attribute</td></tr> 5350<tr><th>num_values</th> 5351<td class="description">Number of values</td></tr> 5352<tr><th>values</th> 5353<td class="description">Values</td></tr> 5354</tbody></table> 5355<h4 class="returnvalue">Return Value</h4> 5356<p class="description">New attribute</p> 5357<h4 class="discussion">Discussion</h4> 5358<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5359the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5360<br> 5361The <code>group</code> parameter specifies the IPP attribute group tag: none 5362(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), 5363event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation 5364(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription 5365(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> 5366<br> 5367Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer 5368(<code>IPP_TAG_INTEGER</code>).</p> 5369<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippAddOctetString">ippAddOctetString</a></h3> 5370<p class="description">Add an octetString value to an IPP message.</p> 5371<p class="code"> 5372<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOctetString(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, const void *data, int datalen);</p> 5373<h4 class="parameters">Parameters</h4> 5374<table class="list"><tbody> 5375<tr><th>ipp</th> 5376<td class="description">IPP message</td></tr> 5377<tr><th>group</th> 5378<td class="description">IPP group</td></tr> 5379<tr><th>name</th> 5380<td class="description">Name of attribute</td></tr> 5381<tr><th>data</th> 5382<td class="description">octetString data</td></tr> 5383<tr><th>datalen</th> 5384<td class="description">Length of data in bytes</td></tr> 5385</tbody></table> 5386<h4 class="returnvalue">Return Value</h4> 5387<p class="description">New attribute</p> 5388<h4 class="discussion">Discussion</h4> 5389<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5390the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5391<br> 5392The <code>group</code> parameter specifies the IPP attribute group tag: none 5393(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), 5394event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation 5395(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription 5396(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>). 5397 5398</p> 5399<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippAddOutOfBand">ippAddOutOfBand</a></h3> 5400<p class="description">Add an out-of-band value to an IPP message.</p> 5401<p class="code"> 5402<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddOutOfBand(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name);</p> 5403<h4 class="parameters">Parameters</h4> 5404<table class="list"><tbody> 5405<tr><th>ipp</th> 5406<td class="description">IPP message</td></tr> 5407<tr><th>group</th> 5408<td class="description">IPP group</td></tr> 5409<tr><th>value_tag</th> 5410<td class="description">Type of attribute</td></tr> 5411<tr><th>name</th> 5412<td class="description">Name of attribute</td></tr> 5413</tbody></table> 5414<h4 class="returnvalue">Return Value</h4> 5415<p class="description">New attribute</p> 5416<h4 class="discussion">Discussion</h4> 5417<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5418the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5419<br> 5420The <code>group</code> parameter specifies the IPP attribute group tag: none 5421(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), 5422event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation 5423(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription 5424(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> 5425<br> 5426Supported out-of-band values include unsupported-value 5427(<code>IPP_TAG_UNSUPPORTED_VALUE</code>), default (<code>IPP_TAG_DEFAULT</code>), unknown 5428(<code>IPP_TAG_UNKNOWN</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable 5429(<code>IPP_TAG_NOTSETTABLE</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), and 5430admin-define (<code>IPP_TAG_ADMINDEFINE</code>). 5431 5432</p> 5433<h3 class="function"><a id="ippAddRange">ippAddRange</a></h3> 5434<p class="description">Add a range of values to an IPP message.</p> 5435<p class="code"> 5436<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRange(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int lower, int upper);</p> 5437<h4 class="parameters">Parameters</h4> 5438<table class="list"><tbody> 5439<tr><th>ipp</th> 5440<td class="description">IPP message</td></tr> 5441<tr><th>group</th> 5442<td class="description">IPP group</td></tr> 5443<tr><th>name</th> 5444<td class="description">Name of attribute</td></tr> 5445<tr><th>lower</th> 5446<td class="description">Lower value</td></tr> 5447<tr><th>upper</th> 5448<td class="description">Upper value</td></tr> 5449</tbody></table> 5450<h4 class="returnvalue">Return Value</h4> 5451<p class="description">New attribute</p> 5452<h4 class="discussion">Discussion</h4> 5453<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5454the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5455<br> 5456The <code>group</code> parameter specifies the IPP attribute group tag: none 5457(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), 5458event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation 5459(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription 5460(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> 5461<br> 5462The <code>lower</code> parameter must be less than or equal to the <code>upper</code> parameter.</p> 5463<h3 class="function"><a id="ippAddRanges">ippAddRanges</a></h3> 5464<p class="description">Add ranges of values to an IPP message.</p> 5465<p class="code"> 5466<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddRanges(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int num_values, const int *lower, const int *upper);</p> 5467<h4 class="parameters">Parameters</h4> 5468<table class="list"><tbody> 5469<tr><th>ipp</th> 5470<td class="description">IPP message</td></tr> 5471<tr><th>group</th> 5472<td class="description">IPP group</td></tr> 5473<tr><th>name</th> 5474<td class="description">Name of attribute</td></tr> 5475<tr><th>num_values</th> 5476<td class="description">Number of values</td></tr> 5477<tr><th>lower</th> 5478<td class="description">Lower values</td></tr> 5479<tr><th>upper</th> 5480<td class="description">Upper values</td></tr> 5481</tbody></table> 5482<h4 class="returnvalue">Return Value</h4> 5483<p class="description">New attribute</p> 5484<h4 class="discussion">Discussion</h4> 5485<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5486the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5487<br> 5488The <code>group</code> parameter specifies the IPP attribute group tag: none 5489(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), 5490event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation 5491(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription 5492(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p> 5493<h3 class="function"><a id="ippAddResolution">ippAddResolution</a></h3> 5494<p class="description">Add a resolution value to an IPP message.</p> 5495<p class="code"> 5496<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolution(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, <a href="#ipp_res_t">ipp_res_t</a> units, int xres, int yres);</p> 5497<h4 class="parameters">Parameters</h4> 5498<table class="list"><tbody> 5499<tr><th>ipp</th> 5500<td class="description">IPP message</td></tr> 5501<tr><th>group</th> 5502<td class="description">IPP group</td></tr> 5503<tr><th>name</th> 5504<td class="description">Name of attribute</td></tr> 5505<tr><th>units</th> 5506<td class="description">Units for resolution</td></tr> 5507<tr><th>xres</th> 5508<td class="description">X resolution</td></tr> 5509<tr><th>yres</th> 5510<td class="description">Y resolution</td></tr> 5511</tbody></table> 5512<h4 class="returnvalue">Return Value</h4> 5513<p class="description">New attribute</p> 5514<h4 class="discussion">Discussion</h4> 5515<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5516the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5517<br> 5518The <code>group</code> parameter specifies the IPP attribute group tag: none 5519(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), 5520event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation 5521(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription 5522(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p> 5523<h3 class="function"><a id="ippAddResolutions">ippAddResolutions</a></h3> 5524<p class="description">Add resolution values to an IPP message.</p> 5525<p class="code"> 5526<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddResolutions(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, const char *name, int num_values, <a href="#ipp_res_t">ipp_res_t</a> units, const int *xres, const int *yres);</p> 5527<h4 class="parameters">Parameters</h4> 5528<table class="list"><tbody> 5529<tr><th>ipp</th> 5530<td class="description">IPP message</td></tr> 5531<tr><th>group</th> 5532<td class="description">IPP group</td></tr> 5533<tr><th>name</th> 5534<td class="description">Name of attribute</td></tr> 5535<tr><th>num_values</th> 5536<td class="description">Number of values</td></tr> 5537<tr><th>units</th> 5538<td class="description">Units for resolution</td></tr> 5539<tr><th>xres</th> 5540<td class="description">X resolutions</td></tr> 5541<tr><th>yres</th> 5542<td class="description">Y resolutions</td></tr> 5543</tbody></table> 5544<h4 class="returnvalue">Return Value</h4> 5545<p class="description">New attribute</p> 5546<h4 class="discussion">Discussion</h4> 5547<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5548the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5549<br> 5550The <code>group</code> parameter specifies the IPP attribute group tag: none 5551(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), 5552event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation 5553(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription 5554(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p> 5555<h3 class="function"><a id="ippAddSeparator">ippAddSeparator</a></h3> 5556<p class="description">Add a group separator to an IPP message.</p> 5557<p class="code"> 5558<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddSeparator(<a href="#ipp_t">ipp_t</a> *ipp);</p> 5559<h4 class="parameters">Parameters</h4> 5560<table class="list"><tbody> 5561<tr><th>ipp</th> 5562<td class="description">IPP message</td></tr> 5563</tbody></table> 5564<h4 class="returnvalue">Return Value</h4> 5565<p class="description">New attribute</p> 5566<h4 class="discussion">Discussion</h4> 5567<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5568the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.</p> 5569<h3 class="function"><a id="ippAddString">ippAddString</a></h3> 5570<p class="description">Add a language-encoded string to an IPP message.</p> 5571<p class="code"> 5572<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddString(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, const char *language, const char *value);</p> 5573<h4 class="parameters">Parameters</h4> 5574<table class="list"><tbody> 5575<tr><th>ipp</th> 5576<td class="description">IPP message</td></tr> 5577<tr><th>group</th> 5578<td class="description">IPP group</td></tr> 5579<tr><th>value_tag</th> 5580<td class="description">Type of attribute</td></tr> 5581<tr><th>name</th> 5582<td class="description">Name of attribute</td></tr> 5583<tr><th>language</th> 5584<td class="description">Language code</td></tr> 5585<tr><th>value</th> 5586<td class="description">Value</td></tr> 5587</tbody></table> 5588<h4 class="returnvalue">Return Value</h4> 5589<p class="description">New attribute</p> 5590<h4 class="discussion">Discussion</h4> 5591<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5592the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5593<br> 5594The <code>group</code> parameter specifies the IPP attribute group tag: none 5595(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), 5596event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation 5597(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription 5598(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> 5599<br> 5600Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword 5601(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType 5602(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage 5603(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage 5604(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme 5605(<code>IPP_TAG_URISCHEME</code>).<br> 5606<br> 5607The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and 5608textWithLanguage string values and must be <code>NULL</code> for all other string values.</p> 5609<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippAddStringf">ippAddStringf</a></h3> 5610<p class="description">Add a formatted string to an IPP message.</p> 5611<p class="code"> 5612<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStringf(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, const char *language, const char *format, ...);</p> 5613<h4 class="parameters">Parameters</h4> 5614<table class="list"><tbody> 5615<tr><th>ipp</th> 5616<td class="description">IPP message</td></tr> 5617<tr><th>group</th> 5618<td class="description">IPP group</td></tr> 5619<tr><th>value_tag</th> 5620<td class="description">Type of attribute</td></tr> 5621<tr><th>name</th> 5622<td class="description">Name of attribute</td></tr> 5623<tr><th>language</th> 5624<td class="description">Language code (<code>NULL</code> for default)</td></tr> 5625<tr><th>format</th> 5626<td class="description">Printf-style format string</td></tr> 5627<tr><th>...</th> 5628<td class="description">Additional arguments as needed</td></tr> 5629</tbody></table> 5630<h4 class="returnvalue">Return Value</h4> 5631<p class="description">New attribute</p> 5632<h4 class="discussion">Discussion</h4> 5633<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5634the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5635<br> 5636The <code>group</code> parameter specifies the IPP attribute group tag: none 5637(<code>IPP_TAG_ZERO</code>, for member attributes), document 5638(<code>IPP_TAG_DOCUMENT</code>), event notification 5639(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>), 5640printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>), 5641or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> 5642<br> 5643Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword 5644(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType 5645(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage 5646(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage 5647(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme 5648(<code>IPP_TAG_URISCHEME</code>).<br> 5649<br> 5650The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage 5651and textWithLanguage string values and must be <code>NULL</code> for all other 5652string values.<br> 5653<br> 5654The <code>format</code> parameter uses formatting characters compatible with the 5655printf family of standard functions. Additional arguments follow it as 5656needed. The formatted string is truncated as needed to the maximum length of 5657the corresponding value type. 5658 5659</p> 5660<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippAddStringfv">ippAddStringfv</a></h3> 5661<p class="description">Add a formatted string to an IPP message.</p> 5662<p class="code"> 5663<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStringfv(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, const char *language, const char *format, va_list ap);</p> 5664<h4 class="parameters">Parameters</h4> 5665<table class="list"><tbody> 5666<tr><th>ipp</th> 5667<td class="description">IPP message</td></tr> 5668<tr><th>group</th> 5669<td class="description">IPP group</td></tr> 5670<tr><th>value_tag</th> 5671<td class="description">Type of attribute</td></tr> 5672<tr><th>name</th> 5673<td class="description">Name of attribute</td></tr> 5674<tr><th>language</th> 5675<td class="description">Language code (<code>NULL</code> for default)</td></tr> 5676<tr><th>format</th> 5677<td class="description">Printf-style format string</td></tr> 5678<tr><th>ap</th> 5679<td class="description">Additional arguments</td></tr> 5680</tbody></table> 5681<h4 class="returnvalue">Return Value</h4> 5682<p class="description">New attribute</p> 5683<h4 class="discussion">Discussion</h4> 5684<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5685the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5686<br> 5687The <code>group</code> parameter specifies the IPP attribute group tag: none 5688(<code>IPP_TAG_ZERO</code>, for member attributes), document 5689(<code>IPP_TAG_DOCUMENT</code>), event notification 5690(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>), 5691printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>), 5692or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> 5693<br> 5694Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword 5695(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType 5696(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage 5697(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage 5698(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme 5699(<code>IPP_TAG_URISCHEME</code>).<br> 5700<br> 5701The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage 5702and textWithLanguage string values and must be <code>NULL</code> for all other 5703string values.<br> 5704<br> 5705The <code>format</code> parameter uses formatting characters compatible with the 5706printf family of standard functions. Additional arguments are passed in the 5707stdarg pointer <code>ap</code>. The formatted string is truncated as needed to the 5708maximum length of the corresponding value type. 5709 5710</p> 5711<h3 class="function"><a id="ippAddStrings">ippAddStrings</a></h3> 5712<p class="description">Add language-encoded strings to an IPP message.</p> 5713<p class="code"> 5714<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddStrings(<a href="#ipp_t">ipp_t</a> *ipp, ipp_tag_t group, ipp_tag_t value_tag, const char *name, int num_values, const char *language, const char *const *values);</p> 5715<h4 class="parameters">Parameters</h4> 5716<table class="list"><tbody> 5717<tr><th>ipp</th> 5718<td class="description">IPP message</td></tr> 5719<tr><th>group</th> 5720<td class="description">IPP group</td></tr> 5721<tr><th>value_tag</th> 5722<td class="description">Type of attribute</td></tr> 5723<tr><th>name</th> 5724<td class="description">Name of attribute</td></tr> 5725<tr><th>num_values</th> 5726<td class="description">Number of values</td></tr> 5727<tr><th>language</th> 5728<td class="description">Language code (<code>NULL</code> for default)</td></tr> 5729<tr><th>values</th> 5730<td class="description">Values</td></tr> 5731</tbody></table> 5732<h4 class="returnvalue">Return Value</h4> 5733<p class="description">New attribute</p> 5734<h4 class="discussion">Discussion</h4> 5735<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 5736the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 5737<br> 5738The <code>group</code> parameter specifies the IPP attribute group tag: none 5739(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), 5740event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation 5741(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription 5742(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br> 5743<br> 5744Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword 5745(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType 5746(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage 5747(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage 5748(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme 5749(<code>IPP_TAG_URISCHEME</code>).<br> 5750<br> 5751The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and 5752textWithLanguage string values and must be <code>NULL</code> for all other string values.</p> 5753<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippAttributeString">ippAttributeString</a></h3> 5754<p class="description">Convert the attribute's value to a string.</p> 5755<p class="code"> 5756size_t ippAttributeString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, char *buffer, size_t bufsize);</p> 5757<h4 class="parameters">Parameters</h4> 5758<table class="list"><tbody> 5759<tr><th>attr</th> 5760<td class="description">Attribute</td></tr> 5761<tr><th>buffer</th> 5762<td class="description">String buffer or NULL</td></tr> 5763<tr><th>bufsize</th> 5764<td class="description">Size of string buffer</td></tr> 5765</tbody></table> 5766<h4 class="returnvalue">Return Value</h4> 5767<p class="description">Number of bytes less nul</p> 5768<h4 class="discussion">Discussion</h4> 5769<p class="discussion">Returns the number of bytes that would be written, not including the 5770trailing nul. The buffer pointer can be NULL to get the required length, 5771just like (v)snprintf. 5772 5773</p> 5774<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippContainsInteger">ippContainsInteger</a></h3> 5775<p class="description">Determine whether an attribute contains the 5776specified value or is within the list of ranges.</p> 5777<p class="code"> 5778int ippContainsInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int value);</p> 5779<h4 class="parameters">Parameters</h4> 5780<table class="list"><tbody> 5781<tr><th>attr</th> 5782<td class="description">Attribute</td></tr> 5783<tr><th>value</th> 5784<td class="description">Integer/enum value</td></tr> 5785</tbody></table> 5786<h4 class="returnvalue">Return Value</h4> 5787<p class="description">1 on a match, 0 on no match</p> 5788<h4 class="discussion">Discussion</h4> 5789<p class="discussion">Returns non-zero when the attribute contains either a matching integer or 5790enum value, or the value falls within one of the rangeOfInteger values for 5791the attribute. 5792 5793</p> 5794<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippContainsString">ippContainsString</a></h3> 5795<p class="description">Determine whether an attribute contains the 5796specified string value.</p> 5797<p class="code"> 5798int ippContainsString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, const char *value);</p> 5799<h4 class="parameters">Parameters</h4> 5800<table class="list"><tbody> 5801<tr><th>attr</th> 5802<td class="description">Attribute</td></tr> 5803<tr><th>value</th> 5804<td class="description">String value</td></tr> 5805</tbody></table> 5806<h4 class="returnvalue">Return Value</h4> 5807<p class="description">1 on a match, 0 on no match</p> 5808<h4 class="discussion">Discussion</h4> 5809<p class="discussion">Returns non-zero when the attribute contains a matching charset, keyword, 5810naturalLanguage, mimeMediaType, name, text, uri, or uriScheme value. 5811 5812</p> 5813<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippCopyAttribute">ippCopyAttribute</a></h3> 5814<p class="description">Copy an attribute.</p> 5815<p class="code"> 5816<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippCopyAttribute(<a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_attribute_t">ipp_attribute_t</a> *srcattr, int quickcopy);</p> 5817<h4 class="parameters">Parameters</h4> 5818<table class="list"><tbody> 5819<tr><th>dst</th> 5820<td class="description">Destination IPP message</td></tr> 5821<tr><th>srcattr</th> 5822<td class="description">Attribute to copy</td></tr> 5823<tr><th>quickcopy</th> 5824<td class="description">1 for a referenced copy, 0 for normal</td></tr> 5825</tbody></table> 5826<h4 class="returnvalue">Return Value</h4> 5827<p class="description">New attribute</p> 5828<h4 class="discussion">Discussion</h4> 5829<p class="discussion">The specified attribute, <code>attr</code>, is copied to the destination IPP message. 5830When <code>quickcopy</code> is non-zero, a "shallow" reference copy of the attribute is 5831created - this should only be done as long as the original source IPP message will 5832not be freed for the life of the destination. 5833 5834</p> 5835<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippCopyAttributes">ippCopyAttributes</a></h3> 5836<p class="description">Copy attributes from one IPP message to another.</p> 5837<p class="code"> 5838int ippCopyAttributes(<a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_t">ipp_t</a> *src, int quickcopy, <a href="#ipp_copycb_t">ipp_copycb_t</a> cb, void *context);</p> 5839<h4 class="parameters">Parameters</h4> 5840<table class="list"><tbody> 5841<tr><th>dst</th> 5842<td class="description">Destination IPP message</td></tr> 5843<tr><th>src</th> 5844<td class="description">Source IPP message</td></tr> 5845<tr><th>quickcopy</th> 5846<td class="description">1 for a referenced copy, 0 for normal</td></tr> 5847<tr><th>cb</th> 5848<td class="description">Copy callback or <code>NULL</code> for none</td></tr> 5849<tr><th>context</th> 5850<td class="description">Context pointer</td></tr> 5851</tbody></table> 5852<h4 class="returnvalue">Return Value</h4> 5853<p class="description">1 on success, 0 on error</p> 5854<h4 class="discussion">Discussion</h4> 5855<p class="discussion">Zero or more attributes are copied from the source IPP message, <code>src</code>, to the 5856destination IPP message, <code>dst</code>. When <code>quickcopy</code> is non-zero, a "shallow" 5857reference copy of the attribute is created - this should only be done as long as the 5858original source IPP message will not be freed for the life of the destination.<br> 5859<br> 5860The <code>cb</code> and <code>context</code> parameters provide a generic way to "filter" the 5861attributes that are copied - the function must return 1 to copy the attribute or 58620 to skip it. The function may also choose to do a partial copy of the source attribute 5863itself. 5864 5865</p> 5866<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippCreateRequestedArray">ippCreateRequestedArray</a></h3> 5867<p class="description">Create a CUPS array of attribute names from the 5868given requested-attributes attribute.</p> 5869<p class="code"> 5870<a href="#cups_array_t">cups_array_t</a> *ippCreateRequestedArray(<a href="#ipp_t">ipp_t</a> *request);</p> 5871<h4 class="parameters">Parameters</h4> 5872<table class="list"><tbody> 5873<tr><th>request</th> 5874<td class="description">IPP request</td></tr> 5875</tbody></table> 5876<h4 class="returnvalue">Return Value</h4> 5877<p class="description">CUPS array or <code>NULL</code> if all</p> 5878<h4 class="discussion">Discussion</h4> 5879<p class="discussion">This function creates a (sorted) CUPS array of attribute names matching the 5880list of "requested-attribute" values supplied in an IPP request. All IANA- 5881registered values are supported in addition to the CUPS IPP extension 5882attributes.<br> 5883<br> 5884The <code>request</code> parameter specifies the request message that was read from 5885the client. 5886 5887<code>NULL</code> is returned if all attributes should be returned. Otherwise, the 5888result is a sorted array of attribute names, where <code>cupsArrayFind(array, 5889"attribute-name")</code> will return a non-NULL pointer. The array must be freed 5890using the <code>cupsArrayDelete</code> function. 5891 5892</p> 5893<h3 class="function"><a id="ippDateToTime">ippDateToTime</a></h3> 5894<p class="description">Convert from RFC 2579 Date/Time format to time in 5895seconds.</p> 5896<p class="code"> 5897time_t ippDateToTime(const <a href="#ipp_uchar_t">ipp_uchar_t</a> *date);</p> 5898<h4 class="parameters">Parameters</h4> 5899<table class="list"><tbody> 5900<tr><th>date</th> 5901<td class="description">RFC 2579 date info</td></tr> 5902</tbody></table> 5903<h4 class="returnvalue">Return Value</h4> 5904<p class="description">UNIX time value</p> 5905<h3 class="function"><a id="ippDelete">ippDelete</a></h3> 5906<p class="description">Delete an IPP message.</p> 5907<p class="code"> 5908void ippDelete(<a href="#ipp_t">ipp_t</a> *ipp);</p> 5909<h4 class="parameters">Parameters</h4> 5910<table class="list"><tbody> 5911<tr><th>ipp</th> 5912<td class="description">IPP message</td></tr> 5913</tbody></table> 5914<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippDeleteAttribute">ippDeleteAttribute</a></h3> 5915<p class="description">Delete a single attribute in an IPP message.</p> 5916<p class="code"> 5917void ippDeleteAttribute(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> 5918<h4 class="parameters">Parameters</h4> 5919<table class="list"><tbody> 5920<tr><th>ipp</th> 5921<td class="description">IPP message</td></tr> 5922<tr><th>attr</th> 5923<td class="description">Attribute to delete</td></tr> 5924</tbody></table> 5925<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippDeleteValues">ippDeleteValues</a></h3> 5926<p class="description">Delete values in an attribute.</p> 5927<p class="code"> 5928int ippDeleteValues(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int count);</p> 5929<h4 class="parameters">Parameters</h4> 5930<table class="list"><tbody> 5931<tr><th>ipp</th> 5932<td class="description">IPP message</td></tr> 5933<tr><th>attr</th> 5934<td class="description">Attribute</td></tr> 5935<tr><th>element</th> 5936<td class="description">Index of first value to delete (0-based)</td></tr> 5937<tr><th>count</th> 5938<td class="description">Number of values to delete</td></tr> 5939</tbody></table> 5940<h4 class="returnvalue">Return Value</h4> 5941<p class="description">1 on success, 0 on failure</p> 5942<h4 class="discussion">Discussion</h4> 5943<p class="discussion">The <code>element</code> parameter specifies the first value to delete, starting at 59440. It must be less than the number of values returned by <a href="#ippGetCount"><code>ippGetCount</code></a>.<br> 5945<br> 5946The <code>attr</code> parameter may be modified as a result of setting the value.<br> 5947<br> 5948Deleting all values in an attribute deletes the attribute. 5949 5950</p> 5951<h3 class="function"><a id="ippEnumString">ippEnumString</a></h3> 5952<p class="description">Return a string corresponding to the enum value.</p> 5953<p class="code"> 5954const char *ippEnumString(const char *attrname, int enumvalue);</p> 5955<h4 class="parameters">Parameters</h4> 5956<table class="list"><tbody> 5957<tr><th>attrname</th> 5958<td class="description">Attribute name</td></tr> 5959<tr><th>enumvalue</th> 5960<td class="description">Enum value</td></tr> 5961</tbody></table> 5962<h4 class="returnvalue">Return Value</h4> 5963<p class="description">Enum string</p> 5964<h3 class="function"><a id="ippEnumValue">ippEnumValue</a></h3> 5965<p class="description">Return the value associated with a given enum string.</p> 5966<p class="code"> 5967int ippEnumValue(const char *attrname, const char *enumstring);</p> 5968<h4 class="parameters">Parameters</h4> 5969<table class="list"><tbody> 5970<tr><th>attrname</th> 5971<td class="description">Attribute name</td></tr> 5972<tr><th>enumstring</th> 5973<td class="description">Enum string</td></tr> 5974</tbody></table> 5975<h4 class="returnvalue">Return Value</h4> 5976<p class="description">Enum value or -1 if unknown</p> 5977<h3 class="function"><a id="ippErrorString">ippErrorString</a></h3> 5978<p class="description">Return a name for the given status code.</p> 5979<p class="code"> 5980const char *ippErrorString(ipp_status_t error);</p> 5981<h4 class="parameters">Parameters</h4> 5982<table class="list"><tbody> 5983<tr><th>error</th> 5984<td class="description">Error status</td></tr> 5985</tbody></table> 5986<h4 class="returnvalue">Return Value</h4> 5987<p class="description">Text string</p> 5988<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippErrorValue">ippErrorValue</a></h3> 5989<p class="description">Return a status code for the given name.</p> 5990<p class="code"> 5991ipp_status_t ippErrorValue(const char *name);</p> 5992<h4 class="parameters">Parameters</h4> 5993<table class="list"><tbody> 5994<tr><th>name</th> 5995<td class="description">Name</td></tr> 5996</tbody></table> 5997<h4 class="returnvalue">Return Value</h4> 5998<p class="description">IPP status code</p> 5999<h3 class="function"><a id="ippFindAttribute">ippFindAttribute</a></h3> 6000<p class="description">Find a named attribute in a request.</p> 6001<p class="code"> 6002<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindAttribute(<a href="#ipp_t">ipp_t</a> *ipp, const char *name, ipp_tag_t type);</p> 6003<h4 class="parameters">Parameters</h4> 6004<table class="list"><tbody> 6005<tr><th>ipp</th> 6006<td class="description">IPP message</td></tr> 6007<tr><th>name</th> 6008<td class="description">Name of attribute</td></tr> 6009<tr><th>type</th> 6010<td class="description">Type of attribute</td></tr> 6011</tbody></table> 6012<h4 class="returnvalue">Return Value</h4> 6013<p class="description">Matching attribute</p> 6014<h4 class="discussion">Discussion</h4> 6015<p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list 6016of attribute and member names separated by slashes, for example 6017"media-col/media-size".</p> 6018<h3 class="function"><a id="ippFindNextAttribute">ippFindNextAttribute</a></h3> 6019<p class="description">Find the next named attribute in a request.</p> 6020<p class="code"> 6021<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFindNextAttribute(<a href="#ipp_t">ipp_t</a> *ipp, const char *name, ipp_tag_t type);</p> 6022<h4 class="parameters">Parameters</h4> 6023<table class="list"><tbody> 6024<tr><th>ipp</th> 6025<td class="description">IPP message</td></tr> 6026<tr><th>name</th> 6027<td class="description">Name of attribute</td></tr> 6028<tr><th>type</th> 6029<td class="description">Type of attribute</td></tr> 6030</tbody></table> 6031<h4 class="returnvalue">Return Value</h4> 6032<p class="description">Matching attribute</p> 6033<h4 class="discussion">Discussion</h4> 6034<p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list 6035of attribute and member names separated by slashes, for example 6036"media-col/media-size".</p> 6037<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippFirstAttribute">ippFirstAttribute</a></h3> 6038<p class="description">Return the first attribute in the message.</p> 6039<p class="code"> 6040<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFirstAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p> 6041<h4 class="parameters">Parameters</h4> 6042<table class="list"><tbody> 6043<tr><th>ipp</th> 6044<td class="description">IPP message</td></tr> 6045</tbody></table> 6046<h4 class="returnvalue">Return Value</h4> 6047<p class="description">First attribute or <code>NULL</code> if none</p> 6048<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetBoolean">ippGetBoolean</a></h3> 6049<p class="description">Get a boolean value for an attribute.</p> 6050<p class="code"> 6051int ippGetBoolean(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p> 6052<h4 class="parameters">Parameters</h4> 6053<table class="list"><tbody> 6054<tr><th>attr</th> 6055<td class="description">IPP attribute</td></tr> 6056<tr><th>element</th> 6057<td class="description">Value number (0-based)</td></tr> 6058</tbody></table> 6059<h4 class="returnvalue">Return Value</h4> 6060<p class="description">Boolean value or 0 on error</p> 6061<h4 class="discussion">Discussion</h4> 6062<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to 6063<code>ippGetCount(attr)</code> - 1. 6064 6065</p> 6066<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetCollection">ippGetCollection</a></h3> 6067<p class="description">Get a collection value for an attribute.</p> 6068<p class="code"> 6069<a href="#ipp_t">ipp_t</a> *ippGetCollection(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p> 6070<h4 class="parameters">Parameters</h4> 6071<table class="list"><tbody> 6072<tr><th>attr</th> 6073<td class="description">IPP attribute</td></tr> 6074<tr><th>element</th> 6075<td class="description">Value number (0-based)</td></tr> 6076</tbody></table> 6077<h4 class="returnvalue">Return Value</h4> 6078<p class="description">Collection value or <code>NULL</code> on error</p> 6079<h4 class="discussion">Discussion</h4> 6080<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to 6081<code>ippGetCount(attr)</code> - 1. 6082 6083</p> 6084<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetCount">ippGetCount</a></h3> 6085<p class="description">Get the number of values in an attribute.</p> 6086<p class="code"> 6087int ippGetCount(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> 6088<h4 class="parameters">Parameters</h4> 6089<table class="list"><tbody> 6090<tr><th>attr</th> 6091<td class="description">IPP attribute</td></tr> 6092</tbody></table> 6093<h4 class="returnvalue">Return Value</h4> 6094<p class="description">Number of values or 0 on error</p> 6095<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetDate">ippGetDate</a></h3> 6096<p class="description">Get a dateTime value for an attribute.</p> 6097<p class="code"> 6098const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippGetDate(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p> 6099<h4 class="parameters">Parameters</h4> 6100<table class="list"><tbody> 6101<tr><th>attr</th> 6102<td class="description">IPP attribute</td></tr> 6103<tr><th>element</th> 6104<td class="description">Value number (0-based)</td></tr> 6105</tbody></table> 6106<h4 class="returnvalue">Return Value</h4> 6107<p class="description">dateTime value or <code>NULL</code></p> 6108<h4 class="discussion">Discussion</h4> 6109<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to 6110<code>ippGetCount(attr)</code> - 1. 6111 6112</p> 6113<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetGroupTag">ippGetGroupTag</a></h3> 6114<p class="description">Get the group associated with an attribute.</p> 6115<p class="code"> 6116ipp_tag_t ippGetGroupTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> 6117<h4 class="parameters">Parameters</h4> 6118<table class="list"><tbody> 6119<tr><th>attr</th> 6120<td class="description">IPP attribute</td></tr> 6121</tbody></table> 6122<h4 class="returnvalue">Return Value</h4> 6123<p class="description">Group tag or <code>IPP_TAG_ZERO</code> on error</p> 6124<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetInteger">ippGetInteger</a></h3> 6125<p class="description">Get the integer/enum value for an attribute.</p> 6126<p class="code"> 6127int ippGetInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p> 6128<h4 class="parameters">Parameters</h4> 6129<table class="list"><tbody> 6130<tr><th>attr</th> 6131<td class="description">IPP attribute</td></tr> 6132<tr><th>element</th> 6133<td class="description">Value number (0-based)</td></tr> 6134</tbody></table> 6135<h4 class="returnvalue">Return Value</h4> 6136<p class="description">Value or 0 on error</p> 6137<h4 class="discussion">Discussion</h4> 6138<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to 6139<code>ippGetCount(attr)</code> - 1. 6140 6141</p> 6142<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetName">ippGetName</a></h3> 6143<p class="description">Get the attribute name.</p> 6144<p class="code"> 6145const char *ippGetName(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> 6146<h4 class="parameters">Parameters</h4> 6147<table class="list"><tbody> 6148<tr><th>attr</th> 6149<td class="description">IPP attribute</td></tr> 6150</tbody></table> 6151<h4 class="returnvalue">Return Value</h4> 6152<p class="description">Attribute name or <code>NULL</code> for separators</p> 6153<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippGetOctetString">ippGetOctetString</a></h3> 6154<p class="description">Get an octetString value from an IPP attribute.</p> 6155<p class="code"> 6156void *ippGetOctetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *datalen);</p> 6157<h4 class="parameters">Parameters</h4> 6158<table class="list"><tbody> 6159<tr><th>attr</th> 6160<td class="description">IPP attribute</td></tr> 6161<tr><th>element</th> 6162<td class="description">Value number (0-based)</td></tr> 6163<tr><th>datalen</th> 6164<td class="description">Length of octetString data</td></tr> 6165</tbody></table> 6166<h4 class="returnvalue">Return Value</h4> 6167<p class="description">Pointer to octetString data</p> 6168<h4 class="discussion">Discussion</h4> 6169<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to 6170<code>ippGetCount(attr)</code> - 1. 6171 6172</p> 6173<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetOperation">ippGetOperation</a></h3> 6174<p class="description">Get the operation ID in an IPP message.</p> 6175<p class="code"> 6176ipp_op_t ippGetOperation(<a href="#ipp_t">ipp_t</a> *ipp);</p> 6177<h4 class="parameters">Parameters</h4> 6178<table class="list"><tbody> 6179<tr><th>ipp</th> 6180<td class="description">IPP request message</td></tr> 6181</tbody></table> 6182<h4 class="returnvalue">Return Value</h4> 6183<p class="description">Operation ID or 0 on error</p> 6184<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetRange">ippGetRange</a></h3> 6185<p class="description">Get a rangeOfInteger value from an attribute.</p> 6186<p class="code"> 6187int ippGetRange(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *uppervalue);</p> 6188<h4 class="parameters">Parameters</h4> 6189<table class="list"><tbody> 6190<tr><th>attr</th> 6191<td class="description">IPP attribute</td></tr> 6192<tr><th>element</th> 6193<td class="description">Value number (0-based)</td></tr> 6194<tr><th>uppervalue</th> 6195<td class="description">Upper value of range</td></tr> 6196</tbody></table> 6197<h4 class="returnvalue">Return Value</h4> 6198<p class="description">Lower value of range or 0</p> 6199<h4 class="discussion">Discussion</h4> 6200<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to 6201<code>ippGetCount(attr)</code> - 1. 6202 6203</p> 6204<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetRequestId">ippGetRequestId</a></h3> 6205<p class="description">Get the request ID from an IPP message.</p> 6206<p class="code"> 6207int ippGetRequestId(<a href="#ipp_t">ipp_t</a> *ipp);</p> 6208<h4 class="parameters">Parameters</h4> 6209<table class="list"><tbody> 6210<tr><th>ipp</th> 6211<td class="description">IPP message</td></tr> 6212</tbody></table> 6213<h4 class="returnvalue">Return Value</h4> 6214<p class="description">Request ID or 0 on error</p> 6215<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetResolution">ippGetResolution</a></h3> 6216<p class="description">Get a resolution value for an attribute.</p> 6217<p class="code"> 6218int ippGetResolution(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *yres, <a href="#ipp_res_t">ipp_res_t</a> *units);</p> 6219<h4 class="parameters">Parameters</h4> 6220<table class="list"><tbody> 6221<tr><th>attr</th> 6222<td class="description">IPP attribute</td></tr> 6223<tr><th>element</th> 6224<td class="description">Value number (0-based)</td></tr> 6225<tr><th>yres</th> 6226<td class="description">Vertical/feed resolution</td></tr> 6227<tr><th>units</th> 6228<td class="description">Units for resolution</td></tr> 6229</tbody></table> 6230<h4 class="returnvalue">Return Value</h4> 6231<p class="description">Horizontal/cross feed resolution or 0</p> 6232<h4 class="discussion">Discussion</h4> 6233<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to 6234<code>ippGetCount(attr)</code> - 1. 6235 6236</p> 6237<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetState">ippGetState</a></h3> 6238<p class="description">Get the IPP message state.</p> 6239<p class="code"> 6240<a href="#ipp_state_t">ipp_state_t</a> ippGetState(<a href="#ipp_t">ipp_t</a> *ipp);</p> 6241<h4 class="parameters">Parameters</h4> 6242<table class="list"><tbody> 6243<tr><th>ipp</th> 6244<td class="description">IPP message</td></tr> 6245</tbody></table> 6246<h4 class="returnvalue">Return Value</h4> 6247<p class="description">IPP message state value</p> 6248<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetStatusCode">ippGetStatusCode</a></h3> 6249<p class="description">Get the status code from an IPP response or event message.</p> 6250<p class="code"> 6251ipp_status_t ippGetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp);</p> 6252<h4 class="parameters">Parameters</h4> 6253<table class="list"><tbody> 6254<tr><th>ipp</th> 6255<td class="description">IPP response or event message</td></tr> 6256</tbody></table> 6257<h4 class="returnvalue">Return Value</h4> 6258<p class="description">Status code in IPP message</p> 6259<h3 class="function"><a id="ippGetString">ippGetString</a></h3> 6260<p class="description"></p> 6261<p class="code"> 6262const char *ippGetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, const char **language);</p> 6263<h4 class="parameters">Parameters</h4> 6264<table class="list"><tbody> 6265<tr><th>attr</th> 6266<td class="description">IPP attribute</td></tr> 6267<tr><th>element</th> 6268<td class="description">Value number (0-based)</td></tr> 6269<tr><th>language</th> 6270<td class="description">Language code (<code>NULL</code> for don't care)</td></tr> 6271</tbody></table> 6272<h4 class="returnvalue">Return Value</h4> 6273<p class="description">Get the string and optionally the language code for an attribute.</p> 6274<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to 6275<code>ippGetCount(attr)</code> - 1. 6276 6277</p> 6278<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetValueTag">ippGetValueTag</a></h3> 6279<p class="description">Get the value tag for an attribute.</p> 6280<p class="code"> 6281ipp_tag_t ippGetValueTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> 6282<h4 class="parameters">Parameters</h4> 6283<table class="list"><tbody> 6284<tr><th>attr</th> 6285<td class="description">IPP attribute</td></tr> 6286</tbody></table> 6287<h4 class="returnvalue">Return Value</h4> 6288<p class="description">Value tag or <code>IPP_TAG_ZERO</code> on error</p> 6289<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetVersion">ippGetVersion</a></h3> 6290<p class="description">Get the major and minor version number from an IPP message.</p> 6291<p class="code"> 6292int ippGetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int *minor);</p> 6293<h4 class="parameters">Parameters</h4> 6294<table class="list"><tbody> 6295<tr><th>ipp</th> 6296<td class="description">IPP message</td></tr> 6297<tr><th>minor</th> 6298<td class="description">Minor version number or <code>NULL</code> for don't care</td></tr> 6299</tbody></table> 6300<h4 class="returnvalue">Return Value</h4> 6301<p class="description">Major version number or 0 on error</p> 6302<h3 class="function"><a id="ippLength">ippLength</a></h3> 6303<p class="description">Compute the length of an IPP message.</p> 6304<p class="code"> 6305size_t ippLength(<a href="#ipp_t">ipp_t</a> *ipp);</p> 6306<h4 class="parameters">Parameters</h4> 6307<table class="list"><tbody> 6308<tr><th>ipp</th> 6309<td class="description">IPP message</td></tr> 6310</tbody></table> 6311<h4 class="returnvalue">Return Value</h4> 6312<p class="description">Size of IPP message</p> 6313<h3 class="function"><a id="ippNew">ippNew</a></h3> 6314<p class="description">Allocate a new IPP message.</p> 6315<p class="code"> 6316<a href="#ipp_t">ipp_t</a> *ippNew(void);</p> 6317<h4 class="returnvalue">Return Value</h4> 6318<p class="description">New IPP message</p> 6319<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippNewRequest">ippNewRequest</a></h3> 6320<p class="description">Allocate a new IPP request message.</p> 6321<p class="code"> 6322<a href="#ipp_t">ipp_t</a> *ippNewRequest(ipp_op_t op);</p> 6323<h4 class="parameters">Parameters</h4> 6324<table class="list"><tbody> 6325<tr><th>op</th> 6326<td class="description">Operation code</td></tr> 6327</tbody></table> 6328<h4 class="returnvalue">Return Value</h4> 6329<p class="description">IPP request message</p> 6330<h4 class="discussion">Discussion</h4> 6331<p class="discussion">The new request message is initialized with the "attributes-charset" and 6332"attributes-natural-language" attributes added. The 6333"attributes-natural-language" value is derived from the current locale. 6334 6335</p> 6336<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippNewResponse">ippNewResponse</a></h3> 6337<p class="description">Allocate a new IPP response message.</p> 6338<p class="code"> 6339<a href="#ipp_t">ipp_t</a> *ippNewResponse(<a href="#ipp_t">ipp_t</a> *request);</p> 6340<h4 class="parameters">Parameters</h4> 6341<table class="list"><tbody> 6342<tr><th>request</th> 6343<td class="description">IPP request message</td></tr> 6344</tbody></table> 6345<h4 class="returnvalue">Return Value</h4> 6346<p class="description">IPP response message</p> 6347<h4 class="discussion">Discussion</h4> 6348<p class="discussion">The new response message is initialized with the same "version-number", 6349"request-id", "attributes-charset", and "attributes-natural-language" as the 6350provided request message. If the "attributes-charset" or 6351"attributes-natural-language" attributes are missing from the request, 6352'utf-8' and a value derived from the current locale are substituted, 6353respectively. 6354 6355</p> 6356<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippNextAttribute">ippNextAttribute</a></h3> 6357<p class="description">Return the next attribute in the message.</p> 6358<p class="code"> 6359<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippNextAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p> 6360<h4 class="parameters">Parameters</h4> 6361<table class="list"><tbody> 6362<tr><th>ipp</th> 6363<td class="description">IPP message</td></tr> 6364</tbody></table> 6365<h4 class="returnvalue">Return Value</h4> 6366<p class="description">Next attribute or <code>NULL</code> if none</p> 6367<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippOpString">ippOpString</a></h3> 6368<p class="description">Return a name for the given operation id.</p> 6369<p class="code"> 6370const char *ippOpString(ipp_op_t op);</p> 6371<h4 class="parameters">Parameters</h4> 6372<table class="list"><tbody> 6373<tr><th>op</th> 6374<td class="description">Operation ID</td></tr> 6375</tbody></table> 6376<h4 class="returnvalue">Return Value</h4> 6377<p class="description">Name</p> 6378<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippOpValue">ippOpValue</a></h3> 6379<p class="description">Return an operation id for the given name.</p> 6380<p class="code"> 6381ipp_op_t ippOpValue(const char *name);</p> 6382<h4 class="parameters">Parameters</h4> 6383<table class="list"><tbody> 6384<tr><th>name</th> 6385<td class="description">Textual name</td></tr> 6386</tbody></table> 6387<h4 class="returnvalue">Return Value</h4> 6388<p class="description">Operation ID</p> 6389<h3 class="function"><a id="ippPort">ippPort</a></h3> 6390<p class="description">Return the default IPP port number.</p> 6391<p class="code"> 6392int ippPort(void);</p> 6393<h4 class="returnvalue">Return Value</h4> 6394<p class="description">Port number</p> 6395<h3 class="function"><a id="ippRead">ippRead</a></h3> 6396<p class="description">Read data for an IPP message from a HTTP connection.</p> 6397<p class="code"> 6398<a href="#ipp_state_t">ipp_state_t</a> ippRead(<a href="#http_t">http_t</a> *http, <a href="#ipp_t">ipp_t</a> *ipp);</p> 6399<h4 class="parameters">Parameters</h4> 6400<table class="list"><tbody> 6401<tr><th>http</th> 6402<td class="description">HTTP connection</td></tr> 6403<tr><th>ipp</th> 6404<td class="description">IPP data</td></tr> 6405</tbody></table> 6406<h4 class="returnvalue">Return Value</h4> 6407<p class="description">Current state</p> 6408<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippReadFile">ippReadFile</a></h3> 6409<p class="description">Read data for an IPP message from a file.</p> 6410<p class="code"> 6411<a href="#ipp_state_t">ipp_state_t</a> ippReadFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p> 6412<h4 class="parameters">Parameters</h4> 6413<table class="list"><tbody> 6414<tr><th>fd</th> 6415<td class="description">HTTP data</td></tr> 6416<tr><th>ipp</th> 6417<td class="description">IPP data</td></tr> 6418</tbody></table> 6419<h4 class="returnvalue">Return Value</h4> 6420<p class="description">Current state</p> 6421<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippReadIO">ippReadIO</a></h3> 6422<p class="description">Read data for an IPP message.</p> 6423<p class="code"> 6424<a href="#ipp_state_t">ipp_state_t</a> ippReadIO(void *src, <a href="#ipp_iocb_t">ipp_iocb_t</a> cb, int blocking, <a href="#ipp_t">ipp_t</a> *parent, <a href="#ipp_t">ipp_t</a> *ipp);</p> 6425<h4 class="parameters">Parameters</h4> 6426<table class="list"><tbody> 6427<tr><th>src</th> 6428<td class="description">Data source</td></tr> 6429<tr><th>cb</th> 6430<td class="description">Read callback function</td></tr> 6431<tr><th>blocking</th> 6432<td class="description">Use blocking IO?</td></tr> 6433<tr><th>parent</th> 6434<td class="description">Parent request, if any</td></tr> 6435<tr><th>ipp</th> 6436<td class="description">IPP data</td></tr> 6437</tbody></table> 6438<h4 class="returnvalue">Return Value</h4> 6439<p class="description">Current state</p> 6440<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetBoolean">ippSetBoolean</a></h3> 6441<p class="description">Set a boolean value in an attribute.</p> 6442<p class="code"> 6443int ippSetBoolean(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int boolvalue);</p> 6444<h4 class="parameters">Parameters</h4> 6445<table class="list"><tbody> 6446<tr><th>ipp</th> 6447<td class="description">IPP message</td></tr> 6448<tr><th>attr</th> 6449<td class="description">IPP attribute</td></tr> 6450<tr><th>element</th> 6451<td class="description">Value number (0-based)</td></tr> 6452<tr><th>boolvalue</th> 6453<td class="description">Boolean value</td></tr> 6454</tbody></table> 6455<h4 class="returnvalue">Return Value</h4> 6456<p class="description">1 on success, 0 on failure</p> 6457<h4 class="discussion">Discussion</h4> 6458<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6459the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 6460<br> 6461The <code>attr</code> parameter may be modified as a result of setting the value.<br> 6462<br> 6463The <code>element</code> parameter specifies which value to set from 0 to 6464<code>ippGetCount(attr)</code>. 6465 6466</p> 6467<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetCollection">ippSetCollection</a></h3> 6468<p class="description">Set a collection value in an attribute.</p> 6469<p class="code"> 6470int ippSetCollection(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, <a href="#ipp_t">ipp_t</a> *colvalue);</p> 6471<h4 class="parameters">Parameters</h4> 6472<table class="list"><tbody> 6473<tr><th>ipp</th> 6474<td class="description">IPP message</td></tr> 6475<tr><th>attr</th> 6476<td class="description">IPP attribute</td></tr> 6477<tr><th>element</th> 6478<td class="description">Value number (0-based)</td></tr> 6479<tr><th>colvalue</th> 6480<td class="description">Collection value</td></tr> 6481</tbody></table> 6482<h4 class="returnvalue">Return Value</h4> 6483<p class="description">1 on success, 0 on failure</p> 6484<h4 class="discussion">Discussion</h4> 6485<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6486the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 6487<br> 6488The <code>attr</code> parameter may be modified as a result of setting the value.<br> 6489<br> 6490The <code>element</code> parameter specifies which value to set from 0 to 6491<code>ippGetCount(attr)</code>. 6492 6493</p> 6494<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetDate">ippSetDate</a></h3> 6495<p class="description">Set a dateTime value in an attribute.</p> 6496<p class="code"> 6497int ippSetDate(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const <a href="#ipp_uchar_t">ipp_uchar_t</a> *datevalue);</p> 6498<h4 class="parameters">Parameters</h4> 6499<table class="list"><tbody> 6500<tr><th>ipp</th> 6501<td class="description">IPP message</td></tr> 6502<tr><th>attr</th> 6503<td class="description">IPP attribute</td></tr> 6504<tr><th>element</th> 6505<td class="description">Value number (0-based)</td></tr> 6506<tr><th>datevalue</th> 6507<td class="description">dateTime value</td></tr> 6508</tbody></table> 6509<h4 class="returnvalue">Return Value</h4> 6510<p class="description">1 on success, 0 on failure</p> 6511<h4 class="discussion">Discussion</h4> 6512<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6513the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 6514<br> 6515The <code>attr</code> parameter may be modified as a result of setting the value.<br> 6516<br> 6517The <code>element</code> parameter specifies which value to set from 0 to 6518<code>ippGetCount(attr)</code>. 6519 6520</p> 6521<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetGroupTag">ippSetGroupTag</a></h3> 6522<p class="description">Set the group tag of an attribute.</p> 6523<p class="code"> 6524int ippSetGroupTag(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, ipp_tag_t group_tag);</p> 6525<h4 class="parameters">Parameters</h4> 6526<table class="list"><tbody> 6527<tr><th>ipp</th> 6528<td class="description">IPP message</td></tr> 6529<tr><th>attr</th> 6530<td class="description">Attribute</td></tr> 6531<tr><th>group_tag</th> 6532<td class="description">Group tag</td></tr> 6533</tbody></table> 6534<h4 class="returnvalue">Return Value</h4> 6535<p class="description">1 on success, 0 on failure</p> 6536<h4 class="discussion">Discussion</h4> 6537<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6538the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 6539<br> 6540The <code>attr</code> parameter may be modified as a result of setting the value.<br> 6541<br> 6542The <code>group</code> parameter specifies the IPP attribute group tag: none 6543(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>), 6544event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation 6545(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription 6546(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>). 6547 6548</p> 6549<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetInteger">ippSetInteger</a></h3> 6550<p class="description">Set an integer or enum value in an attribute.</p> 6551<p class="code"> 6552int ippSetInteger(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int intvalue);</p> 6553<h4 class="parameters">Parameters</h4> 6554<table class="list"><tbody> 6555<tr><th>ipp</th> 6556<td class="description">IPP message</td></tr> 6557<tr><th>attr</th> 6558<td class="description">IPP attribute</td></tr> 6559<tr><th>element</th> 6560<td class="description">Value number (0-based)</td></tr> 6561<tr><th>intvalue</th> 6562<td class="description">Integer/enum value</td></tr> 6563</tbody></table> 6564<h4 class="returnvalue">Return Value</h4> 6565<p class="description">1 on success, 0 on failure</p> 6566<h4 class="discussion">Discussion</h4> 6567<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6568the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 6569<br> 6570The <code>attr</code> parameter may be modified as a result of setting the value.<br> 6571<br> 6572The <code>element</code> parameter specifies which value to set from 0 to 6573<code>ippGetCount(attr)</code>. 6574 6575</p> 6576<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetName">ippSetName</a></h3> 6577<p class="description">Set the name of an attribute.</p> 6578<p class="code"> 6579int ippSetName(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, const char *name);</p> 6580<h4 class="parameters">Parameters</h4> 6581<table class="list"><tbody> 6582<tr><th>ipp</th> 6583<td class="description">IPP message</td></tr> 6584<tr><th>attr</th> 6585<td class="description">IPP attribute</td></tr> 6586<tr><th>name</th> 6587<td class="description">Attribute name</td></tr> 6588</tbody></table> 6589<h4 class="returnvalue">Return Value</h4> 6590<p class="description">1 on success, 0 on failure</p> 6591<h4 class="discussion">Discussion</h4> 6592<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6593the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 6594<br> 6595The <code>attr</code> parameter may be modified as a result of setting the value. 6596 6597</p> 6598<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippSetOctetString">ippSetOctetString</a></h3> 6599<p class="description">Set an octetString value in an IPP attribute.</p> 6600<p class="code"> 6601int ippSetOctetString(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const void *data, int datalen);</p> 6602<h4 class="parameters">Parameters</h4> 6603<table class="list"><tbody> 6604<tr><th>ipp</th> 6605<td class="description">IPP message</td></tr> 6606<tr><th>attr</th> 6607<td class="description">IPP attribute</td></tr> 6608<tr><th>element</th> 6609<td class="description">Value number (0-based)</td></tr> 6610<tr><th>data</th> 6611<td class="description">Pointer to octetString data</td></tr> 6612<tr><th>datalen</th> 6613<td class="description">Length of octetString data</td></tr> 6614</tbody></table> 6615<h4 class="returnvalue">Return Value</h4> 6616<p class="description">1 on success, 0 on failure</p> 6617<h4 class="discussion">Discussion</h4> 6618<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6619the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 6620<br> 6621The <code>attr</code> parameter may be modified as a result of setting the value.<br> 6622<br> 6623The <code>element</code> parameter specifies which value to set from 0 to 6624<code>ippGetCount(attr)</code>. 6625 6626</p> 6627<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetOperation">ippSetOperation</a></h3> 6628<p class="description">Set the operation ID in an IPP request message.</p> 6629<p class="code"> 6630int ippSetOperation(<a href="#ipp_t">ipp_t</a> *ipp, ipp_op_t op);</p> 6631<h4 class="parameters">Parameters</h4> 6632<table class="list"><tbody> 6633<tr><th>ipp</th> 6634<td class="description">IPP request message</td></tr> 6635<tr><th>op</th> 6636<td class="description">Operation ID</td></tr> 6637</tbody></table> 6638<h4 class="returnvalue">Return Value</h4> 6639<p class="description">1 on success, 0 on failure</p> 6640<h4 class="discussion">Discussion</h4> 6641<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6642the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions. 6643 6644</p> 6645<h3 class="function"><a id="ippSetPort">ippSetPort</a></h3> 6646<p class="description">Set the default port number.</p> 6647<p class="code"> 6648void ippSetPort(int p);</p> 6649<h4 class="parameters">Parameters</h4> 6650<table class="list"><tbody> 6651<tr><th>p</th> 6652<td class="description">Port number to use</td></tr> 6653</tbody></table> 6654<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetRange">ippSetRange</a></h3> 6655<p class="description">Set a rangeOfInteger value in an attribute.</p> 6656<p class="code"> 6657int ippSetRange(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int lowervalue, int uppervalue);</p> 6658<h4 class="parameters">Parameters</h4> 6659<table class="list"><tbody> 6660<tr><th>ipp</th> 6661<td class="description">IPP message</td></tr> 6662<tr><th>attr</th> 6663<td class="description">IPP attribute</td></tr> 6664<tr><th>element</th> 6665<td class="description">Value number (0-based)</td></tr> 6666<tr><th>lowervalue</th> 6667<td class="description">Lower bound for range</td></tr> 6668<tr><th>uppervalue</th> 6669<td class="description">Upper bound for range</td></tr> 6670</tbody></table> 6671<h4 class="returnvalue">Return Value</h4> 6672<p class="description">1 on success, 0 on failure</p> 6673<h4 class="discussion">Discussion</h4> 6674<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6675the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 6676<br> 6677The <code>attr</code> parameter may be modified as a result of setting the value.<br> 6678<br> 6679The <code>element</code> parameter specifies which value to set from 0 to 6680<code>ippGetCount(attr)</code>. 6681 6682</p> 6683<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetRequestId">ippSetRequestId</a></h3> 6684<p class="description">Set the request ID in an IPP message.</p> 6685<p class="code"> 6686int ippSetRequestId(<a href="#ipp_t">ipp_t</a> *ipp, int request_id);</p> 6687<h4 class="parameters">Parameters</h4> 6688<table class="list"><tbody> 6689<tr><th>ipp</th> 6690<td class="description">IPP message</td></tr> 6691<tr><th>request_id</th> 6692<td class="description">Request ID</td></tr> 6693</tbody></table> 6694<h4 class="returnvalue">Return Value</h4> 6695<p class="description">1 on success, 0 on failure</p> 6696<h4 class="discussion">Discussion</h4> 6697<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6698the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 6699<br> 6700The <code>request_id</code> parameter must be greater than 0. 6701 6702</p> 6703<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetResolution">ippSetResolution</a></h3> 6704<p class="description">Set a resolution value in an attribute.</p> 6705<p class="code"> 6706int ippSetResolution(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, <a href="#ipp_res_t">ipp_res_t</a> unitsvalue, int xresvalue, int yresvalue);</p> 6707<h4 class="parameters">Parameters</h4> 6708<table class="list"><tbody> 6709<tr><th>ipp</th> 6710<td class="description">IPP message</td></tr> 6711<tr><th>attr</th> 6712<td class="description">IPP attribute</td></tr> 6713<tr><th>element</th> 6714<td class="description">Value number (0-based)</td></tr> 6715<tr><th>unitsvalue</th> 6716<td class="description">Resolution units</td></tr> 6717<tr><th>xresvalue</th> 6718<td class="description">Horizontal/cross feed resolution</td></tr> 6719<tr><th>yresvalue</th> 6720<td class="description">Vertical/feed resolution</td></tr> 6721</tbody></table> 6722<h4 class="returnvalue">Return Value</h4> 6723<p class="description">1 on success, 0 on failure</p> 6724<h4 class="discussion">Discussion</h4> 6725<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6726the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 6727<br> 6728The <code>attr</code> parameter may be modified as a result of setting the value.<br> 6729<br> 6730The <code>element</code> parameter specifies which value to set from 0 to 6731<code>ippGetCount(attr)</code>. 6732 6733</p> 6734<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetState">ippSetState</a></h3> 6735<p class="description">Set the current state of the IPP message.</p> 6736<p class="code"> 6737int ippSetState(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_state_t">ipp_state_t</a> state);</p> 6738<h4 class="parameters">Parameters</h4> 6739<table class="list"><tbody> 6740<tr><th>ipp</th> 6741<td class="description">IPP message</td></tr> 6742<tr><th>state</th> 6743<td class="description">IPP state value</td></tr> 6744</tbody></table> 6745<h4 class="returnvalue">Return Value</h4> 6746<p class="description">1 on success, 0 on failure</p> 6747<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetStatusCode">ippSetStatusCode</a></h3> 6748<p class="description">Set the status code in an IPP response or event message.</p> 6749<p class="code"> 6750int ippSetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp, ipp_status_t status);</p> 6751<h4 class="parameters">Parameters</h4> 6752<table class="list"><tbody> 6753<tr><th>ipp</th> 6754<td class="description">IPP response or event message</td></tr> 6755<tr><th>status</th> 6756<td class="description">Status code</td></tr> 6757</tbody></table> 6758<h4 class="returnvalue">Return Value</h4> 6759<p class="description">1 on success, 0 on failure</p> 6760<h4 class="discussion">Discussion</h4> 6761<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6762the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions. 6763 6764</p> 6765<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetString">ippSetString</a></h3> 6766<p class="description">Set a string value in an attribute.</p> 6767<p class="code"> 6768int ippSetString(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const char *strvalue);</p> 6769<h4 class="parameters">Parameters</h4> 6770<table class="list"><tbody> 6771<tr><th>ipp</th> 6772<td class="description">IPP message</td></tr> 6773<tr><th>attr</th> 6774<td class="description">IPP attribute</td></tr> 6775<tr><th>element</th> 6776<td class="description">Value number (0-based)</td></tr> 6777<tr><th>strvalue</th> 6778<td class="description">String value</td></tr> 6779</tbody></table> 6780<h4 class="returnvalue">Return Value</h4> 6781<p class="description">1 on success, 0 on failure</p> 6782<h4 class="discussion">Discussion</h4> 6783<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6784the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 6785<br> 6786The <code>attr</code> parameter may be modified as a result of setting the value.<br> 6787<br> 6788The <code>element</code> parameter specifies which value to set from 0 to 6789<code>ippGetCount(attr)</code>. 6790 6791</p> 6792<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippSetStringf">ippSetStringf</a></h3> 6793<p class="description">Set a formatted string value of an attribute.</p> 6794<p class="code"> 6795int ippSetStringf(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const char *format, ...);</p> 6796<h4 class="parameters">Parameters</h4> 6797<table class="list"><tbody> 6798<tr><th>ipp</th> 6799<td class="description">IPP message</td></tr> 6800<tr><th>attr</th> 6801<td class="description">IPP attribute</td></tr> 6802<tr><th>element</th> 6803<td class="description">Value number (0-based)</td></tr> 6804<tr><th>format</th> 6805<td class="description">Printf-style format string</td></tr> 6806<tr><th>...</th> 6807<td class="description">Additional arguments as needed</td></tr> 6808</tbody></table> 6809<h4 class="returnvalue">Return Value</h4> 6810<p class="description">1 on success, 0 on failure</p> 6811<h4 class="discussion">Discussion</h4> 6812<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6813the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 6814<br> 6815The <code>attr</code> parameter may be modified as a result of setting the value.<br> 6816<br> 6817The <code>element</code> parameter specifies which value to set from 0 to 6818<code>ippGetCount(attr)</code>.<br> 6819<br> 6820The <code>format</code> parameter uses formatting characters compatible with the 6821printf family of standard functions. Additional arguments follow it as 6822needed. The formatted string is truncated as needed to the maximum length of 6823the corresponding value type. 6824 6825</p> 6826<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippSetStringfv">ippSetStringfv</a></h3> 6827<p class="description">Set a formatted string value of an attribute.</p> 6828<p class="code"> 6829int ippSetStringfv(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, const char *format, va_list ap);</p> 6830<h4 class="parameters">Parameters</h4> 6831<table class="list"><tbody> 6832<tr><th>ipp</th> 6833<td class="description">IPP message</td></tr> 6834<tr><th>attr</th> 6835<td class="description">IPP attribute</td></tr> 6836<tr><th>element</th> 6837<td class="description">Value number (0-based)</td></tr> 6838<tr><th>format</th> 6839<td class="description">Printf-style format string</td></tr> 6840<tr><th>ap</th> 6841<td class="description">Pointer to additional arguments</td></tr> 6842</tbody></table> 6843<h4 class="returnvalue">Return Value</h4> 6844<p class="description">1 on success, 0 on failure</p> 6845<h4 class="discussion">Discussion</h4> 6846<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6847the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 6848<br> 6849The <code>attr</code> parameter may be modified as a result of setting the value.<br> 6850<br> 6851The <code>element</code> parameter specifies which value to set from 0 to 6852<code>ippGetCount(attr)</code>.<br> 6853<br> 6854The <code>format</code> parameter uses formatting characters compatible with the 6855printf family of standard functions. Additional arguments follow it as 6856needed. The formatted string is truncated as needed to the maximum length of 6857the corresponding value type. 6858 6859</p> 6860<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetValueTag">ippSetValueTag</a></h3> 6861<p class="description">Set the value tag of an attribute.</p> 6862<p class="code"> 6863int ippSetValueTag(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, ipp_tag_t value_tag);</p> 6864<h4 class="parameters">Parameters</h4> 6865<table class="list"><tbody> 6866<tr><th>ipp</th> 6867<td class="description">IPP message</td></tr> 6868<tr><th>attr</th> 6869<td class="description">IPP attribute</td></tr> 6870<tr><th>value_tag</th> 6871<td class="description">Value tag</td></tr> 6872</tbody></table> 6873<h4 class="returnvalue">Return Value</h4> 6874<p class="description">1 on success, 0 on failure</p> 6875<h4 class="discussion">Discussion</h4> 6876<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6877the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 6878<br> 6879The <code>attr</code> parameter may be modified as a result of setting the value.<br> 6880<br> 6881Integer (<code>IPP_TAG_INTEGER</code>) values can be promoted to rangeOfInteger 6882(<code>IPP_TAG_RANGE</code>) values, the various string tags can be promoted to name 6883(<code>IPP_TAG_NAME</code>) or nameWithLanguage (<code>IPP_TAG_NAMELANG</code>) values, text 6884(<code>IPP_TAG_TEXT</code>) values can be promoted to textWithLanguage 6885(<code>IPP_TAG_TEXTLANG</code>) values, and all values can be demoted to the various 6886out-of-band value tags such as no-value (<code>IPP_TAG_NOVALUE</code>). All other changes 6887will be rejected.<br> 6888<br> 6889Promoting a string attribute to nameWithLanguage or textWithLanguage adds the language 6890code in the "attributes-natural-language" attribute or, if not present, the language 6891code for the current locale. 6892 6893</p> 6894<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetVersion">ippSetVersion</a></h3> 6895<p class="description">Set the version number in an IPP message.</p> 6896<p class="code"> 6897int ippSetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int major, int minor);</p> 6898<h4 class="parameters">Parameters</h4> 6899<table class="list"><tbody> 6900<tr><th>ipp</th> 6901<td class="description">IPP message</td></tr> 6902<tr><th>major</th> 6903<td class="description">Major version number (major.minor)</td></tr> 6904<tr><th>minor</th> 6905<td class="description">Minor version number (major.minor)</td></tr> 6906</tbody></table> 6907<h4 class="returnvalue">Return Value</h4> 6908<p class="description">1 on success, 0 on failure</p> 6909<h4 class="discussion">Discussion</h4> 6910<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using 6911the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br> 6912<br> 6913The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2. 6914 6915</p> 6916<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="ippStateString">ippStateString</a></h3> 6917<p class="description">Return the name corresponding to a state value.</p> 6918<p class="code"> 6919const char *ippStateString(<a href="#ipp_state_t">ipp_state_t</a> state);</p> 6920<h4 class="parameters">Parameters</h4> 6921<table class="list"><tbody> 6922<tr><th>state</th> 6923<td class="description">State value</td></tr> 6924</tbody></table> 6925<h4 class="returnvalue">Return Value</h4> 6926<p class="description">State name</p> 6927<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="ippTagString">ippTagString</a></h3> 6928<p class="description">Return the tag name corresponding to a tag value.</p> 6929<p class="code"> 6930const char *ippTagString(ipp_tag_t tag);</p> 6931<h4 class="parameters">Parameters</h4> 6932<table class="list"><tbody> 6933<tr><th>tag</th> 6934<td class="description">Tag value</td></tr> 6935</tbody></table> 6936<h4 class="returnvalue">Return Value</h4> 6937<p class="description">Tag name</p> 6938<h4 class="discussion">Discussion</h4> 6939<p class="discussion">The returned names are defined in RFC 8011 and the IANA IPP Registry. 6940 6941</p> 6942<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="ippTagValue">ippTagValue</a></h3> 6943<p class="description">Return the tag value corresponding to a tag name.</p> 6944<p class="code"> 6945ipp_tag_t ippTagValue(const char *name);</p> 6946<h4 class="parameters">Parameters</h4> 6947<table class="list"><tbody> 6948<tr><th>name</th> 6949<td class="description">Tag name</td></tr> 6950</tbody></table> 6951<h4 class="returnvalue">Return Value</h4> 6952<p class="description">Tag value</p> 6953<h4 class="discussion">Discussion</h4> 6954<p class="discussion">The tag names are defined in RFC 8011 and the IANA IPP Registry. 6955 6956</p> 6957<h3 class="function"><a id="ippTimeToDate">ippTimeToDate</a></h3> 6958<p class="description">Convert from time in seconds to RFC 2579 format.</p> 6959<p class="code"> 6960const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippTimeToDate(time_t t);</p> 6961<h4 class="parameters">Parameters</h4> 6962<table class="list"><tbody> 6963<tr><th>t</th> 6964<td class="description">Time in seconds</td></tr> 6965</tbody></table> 6966<h4 class="returnvalue">Return Value</h4> 6967<p class="description">RFC-2579 date/time data</p> 6968<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippValidateAttribute">ippValidateAttribute</a></h3> 6969<p class="description">Validate the contents of an attribute.</p> 6970<p class="code"> 6971int ippValidateAttribute(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p> 6972<h4 class="parameters">Parameters</h4> 6973<table class="list"><tbody> 6974<tr><th>attr</th> 6975<td class="description">Attribute</td></tr> 6976</tbody></table> 6977<h4 class="returnvalue">Return Value</h4> 6978<p class="description">1 if valid, 0 otherwise</p> 6979<h4 class="discussion">Discussion</h4> 6980<p class="discussion">This function validates the contents of an attribute based on the name and 6981value tag. 1 is returned if the attribute is valid, 0 otherwise. On 6982failure, <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> is set to a human-readable message. 6983 6984</p> 6985<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippValidateAttributes">ippValidateAttributes</a></h3> 6986<p class="description">Validate all attributes in an IPP message.</p> 6987<p class="code"> 6988int ippValidateAttributes(<a href="#ipp_t">ipp_t</a> *ipp);</p> 6989<h4 class="parameters">Parameters</h4> 6990<table class="list"><tbody> 6991<tr><th>ipp</th> 6992<td class="description">IPP message</td></tr> 6993</tbody></table> 6994<h4 class="returnvalue">Return Value</h4> 6995<p class="description">1 if valid, 0 otherwise</p> 6996<h4 class="discussion">Discussion</h4> 6997<p class="discussion">This function validates the contents of the IPP message, including each 6998attribute. Like <a href="#ippValidateAttribute"><code>ippValidateAttribute</code></a>, <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> is 6999set to a human-readable message on failure. 7000 7001</p> 7002<h3 class="function"><a id="ippWrite">ippWrite</a></h3> 7003<p class="description">Write data for an IPP message to a HTTP connection.</p> 7004<p class="code"> 7005<a href="#ipp_state_t">ipp_state_t</a> ippWrite(<a href="#http_t">http_t</a> *http, <a href="#ipp_t">ipp_t</a> *ipp);</p> 7006<h4 class="parameters">Parameters</h4> 7007<table class="list"><tbody> 7008<tr><th>http</th> 7009<td class="description">HTTP connection</td></tr> 7010<tr><th>ipp</th> 7011<td class="description">IPP data</td></tr> 7012</tbody></table> 7013<h4 class="returnvalue">Return Value</h4> 7014<p class="description">Current state</p> 7015<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippWriteFile">ippWriteFile</a></h3> 7016<p class="description">Write data for an IPP message to a file.</p> 7017<p class="code"> 7018<a href="#ipp_state_t">ipp_state_t</a> ippWriteFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p> 7019<h4 class="parameters">Parameters</h4> 7020<table class="list"><tbody> 7021<tr><th>fd</th> 7022<td class="description">HTTP data</td></tr> 7023<tr><th>ipp</th> 7024<td class="description">IPP data</td></tr> 7025</tbody></table> 7026<h4 class="returnvalue">Return Value</h4> 7027<p class="description">Current state</p> 7028<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippWriteIO">ippWriteIO</a></h3> 7029<p class="description">Write data for an IPP message.</p> 7030<p class="code"> 7031<a href="#ipp_state_t">ipp_state_t</a> ippWriteIO(void *dst, <a href="#ipp_iocb_t">ipp_iocb_t</a> cb, int blocking, <a href="#ipp_t">ipp_t</a> *parent, <a href="#ipp_t">ipp_t</a> *ipp);</p> 7032<h4 class="parameters">Parameters</h4> 7033<table class="list"><tbody> 7034<tr><th>dst</th> 7035<td class="description">Destination</td></tr> 7036<tr><th>cb</th> 7037<td class="description">Write callback function</td></tr> 7038<tr><th>blocking</th> 7039<td class="description">Use blocking IO?</td></tr> 7040<tr><th>parent</th> 7041<td class="description">Parent IPP message</td></tr> 7042<tr><th>ipp</th> 7043<td class="description">IPP data</td></tr> 7044</tbody></table> 7045<h4 class="returnvalue">Return Value</h4> 7046<p class="description">Current state</p> 7047<h2 class="title"><a id="TYPES">Data Types</a></h2> 7048<h3 class="typedef"><a id="cups_acopy_func_t">cups_acopy_func_t</a></h3> 7049<p class="description">Array element copy function</p> 7050<p class="code"> 7051typedef void *(*)(void *element, void *data)cups_acopy_func_t; 7052</p> 7053<h3 class="typedef"><a id="cups_adv_t">cups_adv_t</a></h3> 7054<p class="description">AdvanceMedia attribute values</p> 7055<p class="code"> 7056typedef enum <a href="#cups_adv_e">cups_adv_e</a> cups_adv_t; 7057</p> 7058<h3 class="typedef"><a id="cups_afree_func_t">cups_afree_func_t</a></h3> 7059<p class="description">Array element free function</p> 7060<p class="code"> 7061typedef void(*)(void *element, void *data)cups_afree_func_t; 7062</p> 7063<h3 class="typedef"><a id="cups_ahash_func_t">cups_ahash_func_t</a></h3> 7064<p class="description">Array hash function</p> 7065<p class="code"> 7066typedef int(*)(void *element, void *data)cups_ahash_func_t; 7067</p> 7068<h3 class="typedef"><a id="cups_array_func_t">cups_array_func_t</a></h3> 7069<p class="description">Array comparison function</p> 7070<p class="code"> 7071typedef int(*)(void *first, void *second, void *data)cups_array_func_t; 7072</p> 7073<h3 class="typedef"><a id="cups_array_t">cups_array_t</a></h3> 7074<p class="description">CUPS array type</p> 7075<p class="code"> 7076typedef struct _cups_array_s cups_array_t; 7077</p> 7078<h3 class="typedef"><a id="cups_bool_t">cups_bool_t</a></h3> 7079<p class="description">Boolean type</p> 7080<p class="code"> 7081typedef enum <a href="#cups_bool_e">cups_bool_e</a> cups_bool_t; 7082</p> 7083<h3 class="typedef"><a id="cups_client_cert_cb_t"><span class="info"> CUPS 1.5/macOS 10.7 </span>cups_client_cert_cb_t</a></h3> 7084<p class="description">Client credentials callback 7085</p> 7086<p class="code"> 7087typedef int(*)(http_t *http, void *tls, <a href="#cups_array_t">cups_array_t</a> *distinguished_names, void *user_data)cups_client_cert_cb_t; 7088</p> 7089<h3 class="typedef"><a id="cups_cspace_t">cups_cspace_t</a></h3> 7090<p class="description">cupsColorSpace attribute values</p> 7091<p class="code"> 7092typedef enum <a href="#cups_cspace_e">cups_cspace_e</a> cups_cspace_t; 7093</p> 7094<h3 class="typedef"><a id="cups_cut_t">cups_cut_t</a></h3> 7095<p class="description">CutMedia attribute values</p> 7096<p class="code"> 7097typedef enum <a href="#cups_cut_e">cups_cut_e</a> cups_cut_t; 7098</p> 7099<h3 class="typedef"><a id="cups_dentry_t">cups_dentry_t</a></h3> 7100<p class="description">Directory entry type</p> 7101<p class="code"> 7102typedef struct <a href="#cups_dentry_s">cups_dentry_s</a> cups_dentry_t; 7103</p> 7104<h3 class="typedef"><a id="cups_dest_cb_t"><span class="info"> CUPS 1.6/macOS 10.8 </span>cups_dest_cb_t</a></h3> 7105<p class="description">Destination enumeration callback 7106</p> 7107<p class="code"> 7108typedef int(*)(void *user_data, unsigned flags, <a href="#cups_dest_t">cups_dest_t</a> *dest)cups_dest_cb_t; 7109</p> 7110<h3 class="typedef"><a id="cups_dest_t">cups_dest_t</a></h3> 7111<p class="description">Destination</p> 7112<p class="code"> 7113typedef struct <a href="#cups_dest_s">cups_dest_s</a> cups_dest_t; 7114</p> 7115<h3 class="typedef"><a id="cups_dinfo_t"><span class="info"> CUPS 1.6/macOS 10.8 </span>cups_dinfo_t</a></h3> 7116<p class="description">Destination capability and status 7117information </p> 7118<p class="code"> 7119typedef struct _cups_dinfo_s cups_dinfo_t; 7120</p> 7121<h3 class="typedef"><a id="cups_dir_t">cups_dir_t</a></h3> 7122<p class="description">Directory type</p> 7123<p class="code"> 7124typedef struct _cups_dir_s cups_dir_t; 7125</p> 7126<h3 class="typedef"><a id="cups_edge_t">cups_edge_t</a></h3> 7127<p class="description">LeadingEdge attribute values</p> 7128<p class="code"> 7129typedef enum <a href="#cups_edge_e">cups_edge_e</a> cups_edge_t; 7130</p> 7131<h3 class="typedef"><a id="cups_file_t">cups_file_t</a></h3> 7132<p class="description">CUPS file type</p> 7133<p class="code"> 7134typedef struct _cups_file_s cups_file_t; 7135</p> 7136<h3 class="typedef"><a id="cups_job_t">cups_job_t</a></h3> 7137<p class="description">Job</p> 7138<p class="code"> 7139typedef struct <a href="#cups_job_s">cups_job_s</a> cups_job_t; 7140</p> 7141<h3 class="typedef"><a id="cups_jog_t">cups_jog_t</a></h3> 7142<p class="description">Jog attribute values</p> 7143<p class="code"> 7144typedef enum <a href="#cups_jog_e">cups_jog_e</a> cups_jog_t; 7145</p> 7146<h3 class="typedef"><a id="cups_mode_t">cups_mode_t</a></h3> 7147<p class="description">cupsRasterOpen modes</p> 7148<p class="code"> 7149typedef enum <a href="#cups_mode_e">cups_mode_e</a> cups_mode_t; 7150</p> 7151<h3 class="typedef"><a id="cups_option_t">cups_option_t</a></h3> 7152<p class="description">Printer Options</p> 7153<p class="code"> 7154typedef struct <a href="#cups_option_s">cups_option_s</a> cups_option_t; 7155</p> 7156<h3 class="typedef"><a id="cups_order_t">cups_order_t</a></h3> 7157<p class="description">cupsColorOrder attribute values</p> 7158<p class="code"> 7159typedef enum <a href="#cups_order_e">cups_order_e</a> cups_order_t; 7160</p> 7161<h3 class="typedef"><a id="cups_orient_t">cups_orient_t</a></h3> 7162<p class="description">Orientation attribute values</p> 7163<p class="code"> 7164typedef enum <a href="#cups_orient_e">cups_orient_e</a> cups_orient_t; 7165</p> 7166<h3 class="typedef"><a id="cups_page_header2_t"><span class="info"> CUPS 1.2/macOS 10.5 </span>cups_page_header2_t</a></h3> 7167<p class="description">Version 2 page header </p> 7168<p class="code"> 7169typedef struct <a href="#cups_page_header2_s">cups_page_header2_s</a> cups_page_header2_t; 7170</p> 7171<h3 class="typedef"><a id="cups_page_header_t"><span class="info"> DEPRECATED </span>cups_page_header_t</a></h3> 7172<p class="description">Version 1 page header </p> 7173<p class="code"> 7174typedef struct <a href="#cups_page_header_s">cups_page_header_s</a> cups_page_header_t; 7175</p> 7176<h3 class="typedef"><a id="cups_password_cb2_t"><span class="info"> CUPS 1.4/macOS 10.6 </span>cups_password_cb2_t</a></h3> 7177<p class="description">New password callback 7178</p> 7179<p class="code"> 7180typedef const char *(*)(const char *prompt, <a href="#http_t">http_t</a> *http, const char *method, const char *resource, void *user_data)cups_password_cb2_t; 7181</p> 7182<h3 class="typedef"><a id="cups_ptype_t">cups_ptype_t</a></h3> 7183<p class="description">Printer type/capability bits</p> 7184<p class="code"> 7185typedef unsigned cups_ptype_t; 7186</p> 7187<h3 class="typedef"><a id="cups_raster_iocb_t">cups_raster_iocb_t</a></h3> 7188<p class="description">cupsRasterOpenIO callback function</p> 7189<p class="code"> 7190typedef ssize_t(*)(void *ctx, unsigned char *buffer, size_t length) cups_raster_iocb_t; 7191</p> 7192<h3 class="typedef"><a id="cups_raster_t">cups_raster_t</a></h3> 7193<p class="description">Raster stream data</p> 7194<p class="code"> 7195typedef struct _cups_raster_s cups_raster_t; 7196</p> 7197<h3 class="typedef"><a id="cups_server_cert_cb_t"><span class="info"> CUPS 1.5/macOS 10.7 </span>cups_server_cert_cb_t</a></h3> 7198<p class="description">Server credentials callback 7199</p> 7200<p class="code"> 7201typedef int(*)(http_t *http, void *tls, <a href="#cups_array_t">cups_array_t</a> *certs, void *user_data)cups_server_cert_cb_t; 7202</p> 7203<h3 class="typedef"><a id="cups_size_t"><span class="info"> CUPS 1.6/macOS 10.8 </span>cups_size_t</a></h3> 7204<p class="description">Media Size </p> 7205<p class="code"> 7206typedef struct <a href="#cups_size_s">cups_size_s</a> cups_size_t; 7207</p> 7208<h3 class="typedef"><a id="http_addr_t"><span class="info"> CUPS 1.2/macOS 10.5 </span>http_addr_t</a></h3> 7209<p class="description">Socket address union, which 7210makes using IPv6 and other 7211address types easier and 7212more portable. </p> 7213<p class="code"> 7214typedef union _http_addr_u / http_addr_t; 7215</p> 7216<h3 class="typedef"><a id="http_encoding_t">http_encoding_t</a></h3> 7217<p class="description">HTTP transfer encoding values</p> 7218<p class="code"> 7219typedef enum <a href="#http_encoding_e">http_encoding_e</a> http_encoding_t; 7220</p> 7221<h3 class="typedef"><a id="http_encryption_t">http_encryption_t</a></h3> 7222<p class="description">HTTP encryption values</p> 7223<p class="code"> 7224typedef enum <a href="#http_encryption_e">http_encryption_e</a> http_encryption_t; 7225</p> 7226<h3 class="typedef"><a id="http_field_t">http_field_t</a></h3> 7227<p class="description">HTTP field names</p> 7228<p class="code"> 7229typedef enum <a href="#http_field_e">http_field_e</a> http_field_t; 7230</p> 7231<h3 class="typedef"><a id="http_keepalive_t">http_keepalive_t</a></h3> 7232<p class="description">HTTP keep-alive values</p> 7233<p class="code"> 7234typedef enum <a href="#http_keepalive_e">http_keepalive_e</a> http_keepalive_t; 7235</p> 7236<h3 class="typedef"><a id="http_state_t">http_state_t</a></h3> 7237<p class="description">HTTP state values; states 7238are server-oriented...</p> 7239<p class="code"> 7240typedef enum <a href="#http_state_e">http_state_e</a> http_state_t; 7241</p> 7242<h3 class="typedef"><a id="http_t">http_t</a></h3> 7243<p class="description">HTTP connection type</p> 7244<p class="code"> 7245typedef struct _http_s http_t; 7246</p> 7247<h3 class="typedef"><a id="http_timeout_cb_t"><span class="info"> CUPS 1.5/macOS 10.7 </span>http_timeout_cb_t</a></h3> 7248<p class="description">HTTP timeout callback </p> 7249<p class="code"> 7250typedef int(*)(http_t *http, void *user_data)http_timeout_cb_t; 7251</p> 7252<h3 class="typedef"><a id="http_trust_t"><span class="info"> CUPS 2.0/OS 10.10 </span>http_trust_t</a></h3> 7253<p class="description">Level of trust for credentials </p> 7254<p class="code"> 7255typedef enum <a href="#http_trust_e">http_trust_e</a> http_trust_t; 7256</p> 7257<h3 class="typedef"><a id="http_uri_coding_t">http_uri_coding_t</a></h3> 7258<p class="description">URI en/decode flags</p> 7259<p class="code"> 7260typedef enum <a href="#http_uri_coding_e">http_uri_coding_e</a> http_uri_coding_t; 7261</p> 7262<h3 class="typedef"><a id="http_uri_status_t"><span class="info"> CUPS 1.2 </span>http_uri_status_t</a></h3> 7263<p class="description">URI separation status </p> 7264<p class="code"> 7265typedef enum <a href="#http_uri_status_e">http_uri_status_e</a> http_uri_status_t; 7266</p> 7267<h3 class="typedef"><a id="ipp_attribute_t">ipp_attribute_t</a></h3> 7268<p class="description">IPP attribute</p> 7269<p class="code"> 7270typedef struct _ipp_attribute_s ipp_attribute_t; 7271</p> 7272<h3 class="typedef"><a id="ipp_copycb_t"><span class="info"> CUPS 1.6/macOS 10.8 </span>ipp_copycb_t</a></h3> 7273<p class="description">ippCopyAttributes callback function </p> 7274<p class="code"> 7275typedef int(*)(void *context, <a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr)ipp_copycb_t; 7276</p> 7277<h3 class="typedef"><a id="ipp_iocb_t"><span class="info"> CUPS 1.2/macOS 10.5 </span>ipp_iocb_t</a></h3> 7278<p class="description">ippReadIO/ippWriteIO callback function </p> 7279<p class="code"> 7280typedef ssize_t(*)(void *context, ipp_uchar_t *buffer, size_t bytes) ipp_iocb_t; 7281</p> 7282<h3 class="typedef"><a id="ipp_orient_t">ipp_orient_t</a></h3> 7283<p class="description">Orientation values</p> 7284<p class="code"> 7285typedef enum <a href="#ipp_orient_e">ipp_orient_e</a> ipp_orient_t; 7286</p> 7287<h3 class="typedef"><a id="ipp_pstate_t">ipp_pstate_t</a></h3> 7288<p class="description">Printer state values</p> 7289<p class="code"> 7290typedef enum <a href="#ipp_pstate_e">ipp_pstate_e</a> ipp_pstate_t; 7291</p> 7292<h3 class="typedef"><a id="ipp_quality_t">ipp_quality_t</a></h3> 7293<p class="description">Print quality values</p> 7294<p class="code"> 7295typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t; 7296</p> 7297<h3 class="typedef"><a id="ipp_res_t">ipp_res_t</a></h3> 7298<p class="description">Resolution units</p> 7299<p class="code"> 7300typedef enum <a href="#ipp_res_e">ipp_res_e</a> ipp_res_t; 7301</p> 7302<h3 class="typedef"><a id="ipp_rstate_t">ipp_rstate_t</a></h3> 7303<p class="description">resource-state values</p> 7304<p class="code"> 7305typedef enum <a href="#ipp_rstate_e">ipp_rstate_e</a> ipp_rstate_t; 7306</p> 7307<h3 class="typedef"><a id="ipp_sstate_t">ipp_sstate_t</a></h3> 7308<p class="description">system-state values</p> 7309<p class="code"> 7310typedef enum <a href="#ipp_sstate_e">ipp_sstate_e</a> ipp_sstate_t; 7311</p> 7312<h3 class="typedef"><a id="ipp_state_t">ipp_state_t</a></h3> 7313<p class="description">ipp_t state values</p> 7314<p class="code"> 7315typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t; 7316</p> 7317<h3 class="typedef"><a id="ipp_t">ipp_t</a></h3> 7318<p class="description">IPP request/response data</p> 7319<p class="code"> 7320typedef struct _ipp_s ipp_t; 7321</p> 7322<h3 class="typedef"><a id="pwg_media_t">pwg_media_t</a></h3> 7323<p class="description">Common media size data</p> 7324<p class="code"> 7325typedef struct <a href="#pwg_media_s">pwg_media_s</a> pwg_media_t; 7326</p> 7327<h2 class="title"><a id="STRUCTURES">Structures</a></h2> 7328<h3 class="struct"><a id="cups_dentry_s">cups_dentry_s</a></h3> 7329<p class="description">Directory entry type</p> 7330<p class="code">struct cups_dentry_s {<br> 7331    struct stat fileinfo;<br> 7332    char filename[260];<br> 7333};</p> 7334<h4 class="members">Members</h4> 7335<table class="list"><tbody> 7336<tr><th>fileinfo </th> 7337<td class="description">File information</td></tr> 7338<tr><th>filename[260] </th> 7339<td class="description">File name</td></tr> 7340</tbody></table> 7341<h3 class="struct"><a id="cups_dest_s">cups_dest_s</a></h3> 7342<p class="description">Destination</p> 7343<p class="code">struct cups_dest_s {<br> 7344    char *name, *instance;<br> 7345    int is_default;<br> 7346    int num_options;<br> 7347    <a href="#cups_option_t">cups_option_t</a> *options;<br> 7348};</p> 7349<h4 class="members">Members</h4> 7350<table class="list"><tbody> 7351<tr><th>instance </th> 7352<td class="description">Local instance name or NULL</td></tr> 7353<tr><th>is_default </th> 7354<td class="description">Is this printer the default?</td></tr> 7355<tr><th>num_options </th> 7356<td class="description">Number of options</td></tr> 7357<tr><th>options </th> 7358<td class="description">Options</td></tr> 7359</tbody></table> 7360<h3 class="struct"><a id="cups_job_s">cups_job_s</a></h3> 7361<p class="description">Job</p> 7362<p class="code">struct cups_job_s {<br> 7363    time_t completed_time;<br> 7364    time_t creation_time;<br> 7365    char *dest;<br> 7366    char *format;<br> 7367    int id;<br> 7368    int priority;<br> 7369    time_t processing_time;<br> 7370    int size;<br> 7371    ipp_jstate_t state;<br> 7372    char *title;<br> 7373    char *user;<br> 7374};</p> 7375<h4 class="members">Members</h4> 7376<table class="list"><tbody> 7377<tr><th>completed_time </th> 7378<td class="description">Time the job was completed</td></tr> 7379<tr><th>creation_time </th> 7380<td class="description">Time the job was created</td></tr> 7381<tr><th>dest </th> 7382<td class="description">Printer or class name</td></tr> 7383<tr><th>format </th> 7384<td class="description">Document format</td></tr> 7385<tr><th>id </th> 7386<td class="description">The job ID</td></tr> 7387<tr><th>priority </th> 7388<td class="description">Priority (1-100)</td></tr> 7389<tr><th>processing_time </th> 7390<td class="description">Time the job was processed</td></tr> 7391<tr><th>size </th> 7392<td class="description">Size in kilobytes</td></tr> 7393<tr><th>state </th> 7394<td class="description">Job state</td></tr> 7395<tr><th>title </th> 7396<td class="description">Title/job name</td></tr> 7397<tr><th>user </th> 7398<td class="description">User that submitted the job</td></tr> 7399</tbody></table> 7400<h3 class="struct"><a id="cups_option_s">cups_option_s</a></h3> 7401<p class="description">Printer Options</p> 7402<p class="code">struct cups_option_s {<br> 7403    char *name;<br> 7404    char *value;<br> 7405};</p> 7406<h4 class="members">Members</h4> 7407<table class="list"><tbody> 7408<tr><th>name </th> 7409<td class="description">Name of option</td></tr> 7410<tr><th>value </th> 7411<td class="description">Value of option</td></tr> 7412</tbody></table> 7413<h3 class="struct"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cups_page_header2_s">cups_page_header2_s</a></h3> 7414<p class="description">Version 2 page header </p> 7415<p class="code">struct cups_page_header2_s {<br> 7416    unsigned AdvanceDistance;<br> 7417    <a href="#cups_adv_t">cups_adv_t</a> AdvanceMedia;<br> 7418    <a href="#cups_bool_t">cups_bool_t</a> Collate;<br> 7419    <a href="#cups_cut_t">cups_cut_t</a> CutMedia;<br> 7420    <a href="#cups_bool_t">cups_bool_t</a> Duplex;<br> 7421    unsigned HWResolution[2];<br> 7422    unsigned ImagingBoundingBox[4];<br> 7423    <a href="#cups_bool_t">cups_bool_t</a> InsertSheet;<br> 7424    <a href="#cups_jog_t">cups_jog_t</a> Jog;<br> 7425    <a href="#cups_edge_t">cups_edge_t</a> LeadingEdge;<br> 7426    <a href="#cups_bool_t">cups_bool_t</a> ManualFeed;<br> 7427    unsigned Margins[2];<br> 7428    char MediaClass[64];<br> 7429    char MediaColor[64];<br> 7430    unsigned MediaPosition;<br> 7431    char MediaType[64];<br> 7432    unsigned MediaWeight;<br> 7433    <a href="#cups_bool_t">cups_bool_t</a> MirrorPrint;<br> 7434    <a href="#cups_bool_t">cups_bool_t</a> NegativePrint;<br> 7435    unsigned NumCopies;<br> 7436    <a href="#cups_orient_t">cups_orient_t</a> Orientation;<br> 7437    <a href="#cups_bool_t">cups_bool_t</a> OutputFaceUp;<br> 7438    char OutputType[64];<br> 7439    unsigned PageSize[2];<br> 7440    <a href="#cups_bool_t">cups_bool_t</a> Separations;<br> 7441    <a href="#cups_bool_t">cups_bool_t</a> TraySwitch;<br> 7442    <a href="#cups_bool_t">cups_bool_t</a> Tumble;<br> 7443    unsigned cupsBitsPerColor;<br> 7444    unsigned cupsBitsPerPixel;<br> 7445    float cupsBorderlessScalingFactor;<br> 7446    unsigned cupsBytesPerLine;<br> 7447    <a href="#cups_order_t">cups_order_t</a> cupsColorOrder;<br> 7448    <a href="#cups_cspace_t">cups_cspace_t</a> cupsColorSpace;<br> 7449    unsigned cupsCompression;<br> 7450    unsigned cupsHeight;<br> 7451    float cupsImagingBBox[4];<br> 7452    unsigned cupsInteger[16];<br> 7453    char cupsMarkerType[64];<br> 7454    unsigned cupsMediaType;<br> 7455    unsigned cupsNumColors;<br> 7456    char cupsPageSizeName[64];<br> 7457    float cupsPageSize[2];<br> 7458    float cupsReal[16];<br> 7459    char cupsRenderingIntent[64];<br> 7460    unsigned cupsRowCount;<br> 7461    unsigned cupsRowFeed;<br> 7462    unsigned cupsRowStep;<br> 7463    char cupsString[16][64];<br> 7464    unsigned cupsWidth;<br> 7465};</p> 7466<h4 class="members">Members</h4> 7467<table class="list"><tbody> 7468<tr><th>AdvanceDistance </th> 7469<td class="description">AdvanceDistance value in points</td></tr> 7470<tr><th>AdvanceMedia </th> 7471<td class="description">AdvanceMedia value (<a href="#cups_adv_t"><code>cups_adv_t</code></a>)</td></tr> 7472<tr><th>Collate </th> 7473<td class="description">Collated copies value</td></tr> 7474<tr><th>CutMedia </th> 7475<td class="description">CutMedia value (<a href="#cups_cut_t"><code>cups_cut_t</code></a>)</td></tr> 7476<tr><th>Duplex </th> 7477<td class="description">Duplexed (double-sided) value</td></tr> 7478<tr><th>HWResolution[2] </th> 7479<td class="description">Resolution in dots-per-inch</td></tr> 7480<tr><th>ImagingBoundingBox[4] </th> 7481<td class="description">Pixel region that is painted (points, left, bottom, right, top)</td></tr> 7482<tr><th>InsertSheet </th> 7483<td class="description">InsertSheet value</td></tr> 7484<tr><th>Jog </th> 7485<td class="description">Jog value (<a href="#cups_jog_t"><code>cups_jog_t</code></a>)</td></tr> 7486<tr><th>LeadingEdge </th> 7487<td class="description">LeadingEdge value (<a href="#cups_edge_t"><code>cups_edge_t</code></a>)</td></tr> 7488<tr><th>ManualFeed </th> 7489<td class="description">ManualFeed value</td></tr> 7490<tr><th>Margins[2] </th> 7491<td class="description">Lower-lefthand margins in points</td></tr> 7492<tr><th>MediaClass[64] </th> 7493<td class="description">MediaClass string</td></tr> 7494<tr><th>MediaColor[64] </th> 7495<td class="description">MediaColor string</td></tr> 7496<tr><th>MediaPosition </th> 7497<td class="description">MediaPosition value</td></tr> 7498<tr><th>MediaType[64] </th> 7499<td class="description">MediaType string</td></tr> 7500<tr><th>MediaWeight </th> 7501<td class="description">MediaWeight value in grams/m^2</td></tr> 7502<tr><th>MirrorPrint </th> 7503<td class="description">MirrorPrint value</td></tr> 7504<tr><th>NegativePrint </th> 7505<td class="description">NegativePrint value</td></tr> 7506<tr><th>NumCopies </th> 7507<td class="description">Number of copies to produce</td></tr> 7508<tr><th>Orientation </th> 7509<td class="description">Orientation value (<a href="#cups_orient_t"><code>cups_orient_t</code></a>)</td></tr> 7510<tr><th>OutputFaceUp </th> 7511<td class="description">OutputFaceUp value</td></tr> 7512<tr><th>OutputType[64] </th> 7513<td class="description">OutputType string</td></tr> 7514<tr><th>PageSize[2] </th> 7515<td class="description">Width and length of page in points</td></tr> 7516<tr><th>Separations </th> 7517<td class="description">Separations value</td></tr> 7518<tr><th>TraySwitch </th> 7519<td class="description">TraySwitch value</td></tr> 7520<tr><th>Tumble </th> 7521<td class="description">Tumble value</td></tr> 7522<tr><th>cupsBitsPerColor </th> 7523<td class="description">Number of bits for each color</td></tr> 7524<tr><th>cupsBitsPerPixel </th> 7525<td class="description">Number of bits for each pixel</td></tr> 7526<tr><th>cupsBorderlessScalingFactor <span class="info"> CUPS 1.2/macOS 10.5 </span></th> 7527<td class="description">Scaling that was applied to page data </td></tr> 7528<tr><th>cupsBytesPerLine </th> 7529<td class="description">Number of bytes per line</td></tr> 7530<tr><th>cupsColorOrder </th> 7531<td class="description">Order of colors</td></tr> 7532<tr><th>cupsColorSpace </th> 7533<td class="description">True colorspace</td></tr> 7534<tr><th>cupsCompression </th> 7535<td class="description">Device compression to use</td></tr> 7536<tr><th>cupsHeight </th> 7537<td class="description">Height of page image in pixels</td></tr> 7538<tr><th>cupsImagingBBox[4] <span class="info"> CUPS 1.2/macOS 10.5 </span></th> 7539<td class="description">Floating point ImagingBoundingBox 7540(scaling factor not applied, left, 7541bottom, right, top) </td></tr> 7542<tr><th>cupsInteger[16] <span class="info"> CUPS 1.2/macOS 10.5 </span></th> 7543<td class="description">User-defined integer values </td></tr> 7544<tr><th>cupsMarkerType[64] <span class="info"> CUPS 1.2/macOS 10.5 </span></th> 7545<td class="description">Ink/toner type </td></tr> 7546<tr><th>cupsMediaType </th> 7547<td class="description">Media type code</td></tr> 7548<tr><th>cupsNumColors <span class="info"> CUPS 1.2/macOS 10.5 </span></th> 7549<td class="description">Number of color components </td></tr> 7550<tr><th>cupsPageSizeName[64] <span class="info"> CUPS 1.2/macOS 10.5 </span></th> 7551<td class="description">PageSize name </td></tr> 7552<tr><th>cupsPageSize[2] <span class="info"> CUPS 1.2/macOS 10.5 </span></th> 7553<td class="description">Floating point PageSize (scaling * 7554factor not applied) </td></tr> 7555<tr><th>cupsReal[16] <span class="info"> CUPS 1.2/macOS 10.5 </span></th> 7556<td class="description">User-defined floating-point values </td></tr> 7557<tr><th>cupsRenderingIntent[64] <span class="info"> CUPS 1.2/macOS 10.5 </span></th> 7558<td class="description">Color rendering intent </td></tr> 7559<tr><th>cupsRowCount </th> 7560<td class="description">Rows per band</td></tr> 7561<tr><th>cupsRowFeed </th> 7562<td class="description">Feed between bands</td></tr> 7563<tr><th>cupsRowStep </th> 7564<td class="description">Spacing between lines</td></tr> 7565<tr><th>cupsString[16][64] <span class="info"> CUPS 1.2/macOS 10.5 </span></th> 7566<td class="description">User-defined string values </td></tr> 7567<tr><th>cupsWidth </th> 7568<td class="description">Width of page image in pixels</td></tr> 7569</tbody></table> 7570<h3 class="struct"><span class="info"> DEPRECATED </span><a id="cups_page_header_s">cups_page_header_s</a></h3> 7571<p class="description">Version 1 page header </p> 7572<p class="code">struct cups_page_header_s {<br> 7573    unsigned AdvanceDistance;<br> 7574    <a href="#cups_adv_t">cups_adv_t</a> AdvanceMedia;<br> 7575    <a href="#cups_bool_t">cups_bool_t</a> Collate;<br> 7576    <a href="#cups_cut_t">cups_cut_t</a> CutMedia;<br> 7577    <a href="#cups_bool_t">cups_bool_t</a> Duplex;<br> 7578    unsigned HWResolution[2];<br> 7579    unsigned ImagingBoundingBox[4];<br> 7580    <a href="#cups_bool_t">cups_bool_t</a> InsertSheet;<br> 7581    <a href="#cups_jog_t">cups_jog_t</a> Jog;<br> 7582    <a href="#cups_edge_t">cups_edge_t</a> LeadingEdge;<br> 7583    <a href="#cups_bool_t">cups_bool_t</a> ManualFeed;<br> 7584    unsigned Margins[2];<br> 7585    char MediaClass[64];<br> 7586    char MediaColor[64];<br> 7587    unsigned MediaPosition;<br> 7588    char MediaType[64];<br> 7589    unsigned MediaWeight;<br> 7590    <a href="#cups_bool_t">cups_bool_t</a> MirrorPrint;<br> 7591    <a href="#cups_bool_t">cups_bool_t</a> NegativePrint;<br> 7592    unsigned NumCopies;<br> 7593    <a href="#cups_orient_t">cups_orient_t</a> Orientation;<br> 7594    <a href="#cups_bool_t">cups_bool_t</a> OutputFaceUp;<br> 7595    char OutputType[64];<br> 7596    unsigned PageSize[2];<br> 7597    <a href="#cups_bool_t">cups_bool_t</a> Separations;<br> 7598    <a href="#cups_bool_t">cups_bool_t</a> TraySwitch;<br> 7599    <a href="#cups_bool_t">cups_bool_t</a> Tumble;<br> 7600    unsigned cupsBitsPerColor;<br> 7601    unsigned cupsBitsPerPixel;<br> 7602    unsigned cupsBytesPerLine;<br> 7603    <a href="#cups_order_t">cups_order_t</a> cupsColorOrder;<br> 7604    <a href="#cups_cspace_t">cups_cspace_t</a> cupsColorSpace;<br> 7605    unsigned cupsCompression;<br> 7606    unsigned cupsHeight;<br> 7607    unsigned cupsMediaType;<br> 7608    unsigned cupsRowCount;<br> 7609    unsigned cupsRowFeed;<br> 7610    unsigned cupsRowStep;<br> 7611    unsigned cupsWidth;<br> 7612};</p> 7613<h4 class="members">Members</h4> 7614<table class="list"><tbody> 7615<tr><th>AdvanceDistance </th> 7616<td class="description">AdvanceDistance value in points</td></tr> 7617<tr><th>AdvanceMedia </th> 7618<td class="description">AdvanceMedia value (<a href="#cups_adv_t"><code>cups_adv_t</code></a>)</td></tr> 7619<tr><th>Collate </th> 7620<td class="description">Collated copies value</td></tr> 7621<tr><th>CutMedia </th> 7622<td class="description">CutMedia value (<a href="#cups_cut_t"><code>cups_cut_t</code></a>)</td></tr> 7623<tr><th>Duplex </th> 7624<td class="description">Duplexed (double-sided) value</td></tr> 7625<tr><th>HWResolution[2] </th> 7626<td class="description">Resolution in dots-per-inch</td></tr> 7627<tr><th>ImagingBoundingBox[4] </th> 7628<td class="description">Pixel region that is painted (points, left, bottom, right, top)</td></tr> 7629<tr><th>InsertSheet </th> 7630<td class="description">InsertSheet value</td></tr> 7631<tr><th>Jog </th> 7632<td class="description">Jog value (<a href="#cups_jog_t"><code>cups_jog_t</code></a>)</td></tr> 7633<tr><th>LeadingEdge </th> 7634<td class="description">LeadingEdge value (<a href="#cups_edge_t"><code>cups_edge_t</code></a>)</td></tr> 7635<tr><th>ManualFeed </th> 7636<td class="description">ManualFeed value</td></tr> 7637<tr><th>Margins[2] </th> 7638<td class="description">Lower-lefthand margins in points</td></tr> 7639<tr><th>MediaClass[64] </th> 7640<td class="description">MediaClass string</td></tr> 7641<tr><th>MediaColor[64] </th> 7642<td class="description">MediaColor string</td></tr> 7643<tr><th>MediaPosition </th> 7644<td class="description">MediaPosition value</td></tr> 7645<tr><th>MediaType[64] </th> 7646<td class="description">MediaType string</td></tr> 7647<tr><th>MediaWeight </th> 7648<td class="description">MediaWeight value in grams/m^2</td></tr> 7649<tr><th>MirrorPrint </th> 7650<td class="description">MirrorPrint value</td></tr> 7651<tr><th>NegativePrint </th> 7652<td class="description">NegativePrint value</td></tr> 7653<tr><th>NumCopies </th> 7654<td class="description">Number of copies to produce</td></tr> 7655<tr><th>Orientation </th> 7656<td class="description">Orientation value (<a href="#cups_orient_t"><code>cups_orient_t</code></a>)</td></tr> 7657<tr><th>OutputFaceUp </th> 7658<td class="description">OutputFaceUp value</td></tr> 7659<tr><th>OutputType[64] </th> 7660<td class="description">OutputType string</td></tr> 7661<tr><th>PageSize[2] </th> 7662<td class="description">Width and length of page in points</td></tr> 7663<tr><th>Separations </th> 7664<td class="description">Separations value</td></tr> 7665<tr><th>TraySwitch </th> 7666<td class="description">TraySwitch value</td></tr> 7667<tr><th>Tumble </th> 7668<td class="description">Tumble value</td></tr> 7669<tr><th>cupsBitsPerColor </th> 7670<td class="description">Number of bits for each color</td></tr> 7671<tr><th>cupsBitsPerPixel </th> 7672<td class="description">Number of bits for each pixel</td></tr> 7673<tr><th>cupsBytesPerLine </th> 7674<td class="description">Number of bytes per line</td></tr> 7675<tr><th>cupsColorOrder </th> 7676<td class="description">Order of colors</td></tr> 7677<tr><th>cupsColorSpace </th> 7678<td class="description">True colorspace</td></tr> 7679<tr><th>cupsCompression </th> 7680<td class="description">Device compression to use</td></tr> 7681<tr><th>cupsHeight </th> 7682<td class="description">Height of page image in pixels</td></tr> 7683<tr><th>cupsMediaType </th> 7684<td class="description">Media type code</td></tr> 7685<tr><th>cupsRowCount </th> 7686<td class="description">Rows per band</td></tr> 7687<tr><th>cupsRowFeed </th> 7688<td class="description">Feed between bands</td></tr> 7689<tr><th>cupsRowStep </th> 7690<td class="description">Spacing between lines</td></tr> 7691<tr><th>cupsWidth </th> 7692<td class="description">Width of page image in pixels</td></tr> 7693</tbody></table> 7694<h3 class="struct"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cups_size_s">cups_size_s</a></h3> 7695<p class="description">Media Size </p> 7696<p class="code">struct cups_size_s {<br> 7697    char media[128];<br> 7698    int width, length, bottom, left, right, top;<br> 7699};</p> 7700<h4 class="members">Members</h4> 7701<table class="list"><tbody> 7702<tr><th>media[128] </th> 7703<td class="description">Media name to use</td></tr> 7704<tr><th>top </th> 7705<td class="description">Top margin in hundredths of 7706millimeters</td></tr> 7707</tbody></table> 7708<h3 class="struct"><a id="pwg_media_s">pwg_media_s</a></h3> 7709<p class="description">Common media size data</p> 7710<p class="code">struct pwg_media_s {<br> 7711    int width, length;<br> 7712    const char *pwg, *legacy, *ppd;<br> 7713};</p> 7714<h4 class="members">Members</h4> 7715<table class="list"><tbody> 7716<tr><th>length </th> 7717<td class="description">Length in 2540ths</td></tr> 7718<tr><th>ppd </th> 7719<td class="description">Standard Adobe PPD name</td></tr> 7720</tbody></table> 7721<h2 class="title"><a id="ENUMERATIONS">Constants</a></h2> 7722<h3 class="enumeration"><a id="cups_adv_e">cups_adv_e</a></h3> 7723<p class="description">AdvanceMedia attribute values</p> 7724<h4 class="constants">Constants</h4> 7725<table class="list"><tbody> 7726<tr><th>CUPS_ADVANCE_FILE </th><td class="description">Advance the roll after this file</td></tr> 7727<tr><th>CUPS_ADVANCE_JOB </th><td class="description">Advance the roll after this job</td></tr> 7728<tr><th>CUPS_ADVANCE_NONE </th><td class="description">Never advance the roll</td></tr> 7729<tr><th>CUPS_ADVANCE_PAGE </th><td class="description">Advance the roll after this page</td></tr> 7730<tr><th>CUPS_ADVANCE_SET </th><td class="description">Advance the roll after this set</td></tr> 7731</tbody></table> 7732<h3 class="enumeration"><a id="cups_bool_e">cups_bool_e</a></h3> 7733<p class="description">Boolean type</p> 7734<h4 class="constants">Constants</h4> 7735<table class="list"><tbody> 7736<tr><th>CUPS_FALSE </th><td class="description">Logical false</td></tr> 7737<tr><th>CUPS_TRUE </th><td class="description">Logical true</td></tr> 7738</tbody></table> 7739<h3 class="enumeration"><a id="cups_cspace_e">cups_cspace_e</a></h3> 7740<p class="description">cupsColorSpace attribute values</p> 7741<h4 class="constants">Constants</h4> 7742<table class="list"><tbody> 7743<tr><th>CUPS_CSPACE_ADOBERGB <span class="info"> CUPS 1.4.5 </span></th><td class="description">Red, green, blue (Adobe RGB) </td></tr> 7744<tr><th>CUPS_CSPACE_CIELab <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">CIE Lab </td></tr> 7745<tr><th>CUPS_CSPACE_CIEXYZ <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">CIE XYZ </td></tr> 7746<tr><th>CUPS_CSPACE_CMY </th><td class="description">Cyan, magenta, yellow (DeviceCMY)</td></tr> 7747<tr><th>CUPS_CSPACE_CMYK </th><td class="description">Cyan, magenta, yellow, black (DeviceCMYK)</td></tr> 7748<tr><th>CUPS_CSPACE_DEVICE1 <span class="info"> CUPS 1.4.5 </span></th><td class="description">DeviceN, 1 color </td></tr> 7749<tr><th>CUPS_CSPACE_DEVICE2 <span class="info"> CUPS 1.4.5 </span></th><td class="description">DeviceN, 2 colors </td></tr> 7750<tr><th>CUPS_CSPACE_DEVICE3 <span class="info"> CUPS 1.4.5 </span></th><td class="description">DeviceN, 3 colors </td></tr> 7751<tr><th>CUPS_CSPACE_DEVICE4 <span class="info"> CUPS 1.4.5 </span></th><td class="description">DeviceN, 4 colors </td></tr> 7752<tr><th>CUPS_CSPACE_DEVICE5 <span class="info"> CUPS 1.4.5 </span></th><td class="description">DeviceN, 5 colors </td></tr> 7753<tr><th>CUPS_CSPACE_DEVICE6 <span class="info"> CUPS 1.4.5 </span></th><td class="description">DeviceN, 6 colors </td></tr> 7754<tr><th>CUPS_CSPACE_DEVICE7 <span class="info"> CUPS 1.4.5 </span></th><td class="description">DeviceN, 7 colors </td></tr> 7755<tr><th>CUPS_CSPACE_DEVICE8 <span class="info"> CUPS 1.4.5 </span></th><td class="description">DeviceN, 8 colors </td></tr> 7756<tr><th>CUPS_CSPACE_DEVICE9 <span class="info"> CUPS 1.4.5 </span></th><td class="description">DeviceN, 9 colors </td></tr> 7757<tr><th>CUPS_CSPACE_DEVICEA <span class="info"> CUPS 1.4.5 </span></th><td class="description">DeviceN, 10 colors </td></tr> 7758<tr><th>CUPS_CSPACE_DEVICEB <span class="info"> CUPS 1.4.5 </span></th><td class="description">DeviceN, 11 colors </td></tr> 7759<tr><th>CUPS_CSPACE_DEVICEC <span class="info"> CUPS 1.4.5 </span></th><td class="description">DeviceN, 12 colors </td></tr> 7760<tr><th>CUPS_CSPACE_DEVICED <span class="info"> CUPS 1.4.5 </span></th><td class="description">DeviceN, 13 colors </td></tr> 7761<tr><th>CUPS_CSPACE_DEVICEE <span class="info"> CUPS 1.4.5 </span></th><td class="description">DeviceN, 14 colors </td></tr> 7762<tr><th>CUPS_CSPACE_DEVICEF <span class="info"> CUPS 1.4.5 </span></th><td class="description">DeviceN, 15 colors </td></tr> 7763<tr><th>CUPS_CSPACE_GMCK <span class="info"> DEPRECATED </span></th><td class="description">Gold, magenta, yellow, black </td></tr> 7764<tr><th>CUPS_CSPACE_GMCS <span class="info"> DEPRECATED </span></th><td class="description">Gold, magenta, yellow, silver </td></tr> 7765<tr><th>CUPS_CSPACE_GOLD <span class="info"> DEPRECATED </span></th><td class="description">Gold foil </td></tr> 7766<tr><th>CUPS_CSPACE_ICC1 <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">ICC-based, 1 color </td></tr> 7767<tr><th>CUPS_CSPACE_ICC2 <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">ICC-based, 2 colors </td></tr> 7768<tr><th>CUPS_CSPACE_ICC3 <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">ICC-based, 3 colors </td></tr> 7769<tr><th>CUPS_CSPACE_ICC4 <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">ICC-based, 4 colors </td></tr> 7770<tr><th>CUPS_CSPACE_ICC5 <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">ICC-based, 5 colors </td></tr> 7771<tr><th>CUPS_CSPACE_ICC6 <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">ICC-based, 6 colors </td></tr> 7772<tr><th>CUPS_CSPACE_ICC7 <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">ICC-based, 7 colors </td></tr> 7773<tr><th>CUPS_CSPACE_ICC8 <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">ICC-based, 8 colors </td></tr> 7774<tr><th>CUPS_CSPACE_ICC9 <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">ICC-based, 9 colors </td></tr> 7775<tr><th>CUPS_CSPACE_ICCA <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">ICC-based, 10 colors </td></tr> 7776<tr><th>CUPS_CSPACE_ICCB <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">ICC-based, 11 colors </td></tr> 7777<tr><th>CUPS_CSPACE_ICCC <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">ICC-based, 12 colors </td></tr> 7778<tr><th>CUPS_CSPACE_ICCD <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">ICC-based, 13 colors </td></tr> 7779<tr><th>CUPS_CSPACE_ICCE <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">ICC-based, 14 colors </td></tr> 7780<tr><th>CUPS_CSPACE_ICCF <span class="info"> CUPS 1.1.19/macOS 10.3 </span></th><td class="description">ICC-based, 15 colors </td></tr> 7781<tr><th>CUPS_CSPACE_K </th><td class="description">Black (DeviceK)</td></tr> 7782<tr><th>CUPS_CSPACE_KCMY <span class="info"> DEPRECATED </span></th><td class="description">Black, cyan, magenta, yellow </td></tr> 7783<tr><th>CUPS_CSPACE_KCMYcm <span class="info"> DEPRECATED </span></th><td class="description">Black, cyan, magenta, yellow, light-cyan, light-magenta </td></tr> 7784<tr><th>CUPS_CSPACE_RGB </th><td class="description">Red, green, blue (DeviceRGB, sRGB by default)</td></tr> 7785<tr><th>CUPS_CSPACE_RGBA </th><td class="description">Red, green, blue, alpha (DeviceRGB, sRGB by default)</td></tr> 7786<tr><th>CUPS_CSPACE_RGBW <span class="info"> CUPS 1.2/macOS 10.5 </span></th><td class="description">Red, green, blue, white (DeviceRGB, sRGB by default) </td></tr> 7787<tr><th>CUPS_CSPACE_SILVER <span class="info"> DEPRECATED </span></th><td class="description">Silver foil </td></tr> 7788<tr><th>CUPS_CSPACE_SRGB <span class="info"> CUPS 1.4.5 </span></th><td class="description">Red, green, blue (sRGB) </td></tr> 7789<tr><th>CUPS_CSPACE_SW <span class="info"> CUPS 1.4.5 </span></th><td class="description">Luminance (gamma 2.2) </td></tr> 7790<tr><th>CUPS_CSPACE_W </th><td class="description">Luminance (DeviceGray, gamma 2.2 by default)</td></tr> 7791<tr><th>CUPS_CSPACE_WHITE <span class="info"> DEPRECATED </span></th><td class="description">White ink (as black) </td></tr> 7792<tr><th>CUPS_CSPACE_YMC <span class="info"> DEPRECATED </span></th><td class="description">Yellow, magenta, cyan </td></tr> 7793<tr><th>CUPS_CSPACE_YMCK <span class="info"> DEPRECATED </span></th><td class="description">Yellow, magenta, cyan, black </td></tr> 7794</tbody></table> 7795<h3 class="enumeration"><a id="cups_cut_e">cups_cut_e</a></h3> 7796<p class="description">CutMedia attribute values</p> 7797<h4 class="constants">Constants</h4> 7798<table class="list"><tbody> 7799<tr><th>CUPS_CUT_FILE </th><td class="description">Cut the roll after this file</td></tr> 7800<tr><th>CUPS_CUT_JOB </th><td class="description">Cut the roll after this job</td></tr> 7801<tr><th>CUPS_CUT_NONE </th><td class="description">Never cut the roll</td></tr> 7802<tr><th>CUPS_CUT_PAGE </th><td class="description">Cut the roll after this page</td></tr> 7803<tr><th>CUPS_CUT_SET </th><td class="description">Cut the roll after this set</td></tr> 7804</tbody></table> 7805<h3 class="enumeration"><a id="cups_edge_e">cups_edge_e</a></h3> 7806<p class="description">LeadingEdge attribute values</p> 7807<h4 class="constants">Constants</h4> 7808<table class="list"><tbody> 7809<tr><th>CUPS_EDGE_BOTTOM </th><td class="description">Leading edge is the bottom of the page</td></tr> 7810<tr><th>CUPS_EDGE_LEFT </th><td class="description">Leading edge is the left of the page</td></tr> 7811<tr><th>CUPS_EDGE_RIGHT </th><td class="description">Leading edge is the right of the page</td></tr> 7812<tr><th>CUPS_EDGE_TOP </th><td class="description">Leading edge is the top of the page</td></tr> 7813</tbody></table> 7814<h3 class="enumeration"><a id="cups_jog_e">cups_jog_e</a></h3> 7815<p class="description">Jog attribute values</p> 7816<h4 class="constants">Constants</h4> 7817<table class="list"><tbody> 7818<tr><th>CUPS_JOG_FILE </th><td class="description">Move pages after this file</td></tr> 7819<tr><th>CUPS_JOG_JOB </th><td class="description">Move pages after this job</td></tr> 7820<tr><th>CUPS_JOG_NONE </th><td class="description">Never move pages</td></tr> 7821<tr><th>CUPS_JOG_SET </th><td class="description">Move pages after this set</td></tr> 7822</tbody></table> 7823<h3 class="enumeration"><a id="cups_mode_e">cups_mode_e</a></h3> 7824<p class="description">cupsRasterOpen modes</p> 7825<h4 class="constants">Constants</h4> 7826<table class="list"><tbody> 7827<tr><th>CUPS_RASTER_READ </th><td class="description">Open stream for reading</td></tr> 7828<tr><th>CUPS_RASTER_WRITE </th><td class="description">Open stream for writing</td></tr> 7829<tr><th>CUPS_RASTER_WRITE_COMPRESSED <span class="info"> CUPS 1.3/macOS 10.5 </span></th><td class="description">Open stream for compressed writing </td></tr> 7830<tr><th>CUPS_RASTER_WRITE_PWG <span class="info"> CUPS 1.5/macOS 10.7 </span></th><td class="description">Open stream for compressed writing in PWG Raster mode </td></tr> 7831</tbody></table> 7832<h3 class="enumeration"><a id="cups_order_e">cups_order_e</a></h3> 7833<p class="description">cupsColorOrder attribute values</p> 7834<h4 class="constants">Constants</h4> 7835<table class="list"><tbody> 7836<tr><th>CUPS_ORDER_BANDED </th><td class="description">CCC MMM YYY KKK ...</td></tr> 7837<tr><th>CUPS_ORDER_CHUNKED </th><td class="description">CMYK CMYK CMYK ...</td></tr> 7838<tr><th>CUPS_ORDER_PLANAR </th><td class="description">CCC ... MMM ... YYY ... KKK ...</td></tr> 7839</tbody></table> 7840<h3 class="enumeration"><a id="cups_orient_e">cups_orient_e</a></h3> 7841<p class="description">Orientation attribute values</p> 7842<h4 class="constants">Constants</h4> 7843<table class="list"><tbody> 7844<tr><th>CUPS_ORIENT_0 </th><td class="description">Don't rotate the page</td></tr> 7845<tr><th>CUPS_ORIENT_180 </th><td class="description">Turn the page upside down</td></tr> 7846<tr><th>CUPS_ORIENT_270 </th><td class="description">Rotate the page clockwise</td></tr> 7847<tr><th>CUPS_ORIENT_90 </th><td class="description">Rotate the page counter-clockwise</td></tr> 7848</tbody></table> 7849<h3 class="enumeration"><a id="cups_ptype_e">cups_ptype_e</a></h3> 7850<p class="description">Printer type/capability bit 7851constants</p> 7852<h4 class="constants">Constants</h4> 7853<table class="list"><tbody> 7854<tr><th>CUPS_PRINTER_AUTHENTICATED <span class="info"> CUPS 1.2/macOS 10.5 </span></th><td class="description">Printer requires authentication 7855</td></tr> 7856<tr><th>CUPS_PRINTER_BIND </th><td class="description">Can bind output</td></tr> 7857<tr><th>CUPS_PRINTER_BW </th><td class="description">Can do B&W printing</td></tr> 7858<tr><th>CUPS_PRINTER_CLASS </th><td class="description">Printer class</td></tr> 7859<tr><th>CUPS_PRINTER_COLLATE </th><td class="description">Can quickly collate copies</td></tr> 7860<tr><th>CUPS_PRINTER_COLOR </th><td class="description">Can do color printing</td></tr> 7861<tr><th>CUPS_PRINTER_COMMANDS <span class="info"> CUPS 1.2/macOS 10.5 </span></th><td class="description">Printer supports maintenance commands 7862</td></tr> 7863<tr><th>CUPS_PRINTER_COPIES </th><td class="description">Can do copies in hardware</td></tr> 7864<tr><th>CUPS_PRINTER_COVER </th><td class="description">Can cover output</td></tr> 7865<tr><th>CUPS_PRINTER_DEFAULT </th><td class="description">Default printer on network</td></tr> 7866<tr><th>CUPS_PRINTER_DISCOVERED <span class="info"> CUPS 1.2/macOS 10.5 </span></th><td class="description">Printer was discovered </td></tr> 7867<tr><th>CUPS_PRINTER_DUPLEX </th><td class="description">Can do two-sided printing</td></tr> 7868<tr><th>CUPS_PRINTER_FAX </th><td class="description">Fax queue</td></tr> 7869<tr><th>CUPS_PRINTER_LARGE </th><td class="description">Can print on D/E/A1/A0-size media</td></tr> 7870<tr><th>CUPS_PRINTER_LOCAL </th><td class="description">Local printer or class</td></tr> 7871<tr><th>CUPS_PRINTER_MEDIUM </th><td class="description">Can print on Tabloid/B/C/A3/A2-size media</td></tr> 7872<tr><th>CUPS_PRINTER_NOT_SHARED <span class="info"> CUPS 1.2/macOS 10.5 </span></th><td class="description">Printer is not shared 7873</td></tr> 7874<tr><th>CUPS_PRINTER_PUNCH </th><td class="description">Can punch output</td></tr> 7875<tr><th>CUPS_PRINTER_REJECTING </th><td class="description">Printer is rejecting jobs</td></tr> 7876<tr><th>CUPS_PRINTER_REMOTE </th><td class="description">Remote printer or class</td></tr> 7877<tr><th>CUPS_PRINTER_SMALL </th><td class="description">Can print on Letter/Legal/A4-size media</td></tr> 7878<tr><th>CUPS_PRINTER_SORT </th><td class="description">Can sort output</td></tr> 7879<tr><th>CUPS_PRINTER_STAPLE </th><td class="description">Can staple output</td></tr> 7880<tr><th>CUPS_PRINTER_VARIABLE </th><td class="description">Can print on rolls and custom-size media</td></tr> 7881</tbody></table> 7882<h3 class="enumeration"><a id="http_encoding_e">http_encoding_e</a></h3> 7883<p class="description">HTTP transfer encoding values</p> 7884<h4 class="constants">Constants</h4> 7885<table class="list"><tbody> 7886<tr><th>HTTP_ENCODING_CHUNKED </th><td class="description">Data is chunked</td></tr> 7887<tr><th>HTTP_ENCODING_FIELDS </th><td class="description">Sending HTTP fields</td></tr> 7888<tr><th>HTTP_ENCODING_LENGTH </th><td class="description">Data is sent with Content-Length</td></tr> 7889</tbody></table> 7890<h3 class="enumeration"><a id="http_encryption_e">http_encryption_e</a></h3> 7891<p class="description">HTTP encryption values</p> 7892<h4 class="constants">Constants</h4> 7893<table class="list"><tbody> 7894<tr><th>HTTP_ENCRYPTION_ALWAYS </th><td class="description">Always encrypt (SSL)</td></tr> 7895<tr><th>HTTP_ENCRYPTION_IF_REQUESTED </th><td class="description">Encrypt if requested (TLS upgrade)</td></tr> 7896<tr><th>HTTP_ENCRYPTION_NEVER </th><td class="description">Never encrypt</td></tr> 7897<tr><th>HTTP_ENCRYPTION_REQUIRED </th><td class="description">Encryption is required (TLS upgrade)</td></tr> 7898</tbody></table> 7899<h3 class="enumeration"><a id="http_field_e">http_field_e</a></h3> 7900<p class="description">HTTP field names</p> 7901<h4 class="constants">Constants</h4> 7902<table class="list"><tbody> 7903<tr><th>HTTP_FIELD_ACCEPT_ENCODING <span class="info"> CUPS 1.7/macOS 10.9 </span></th><td class="description">Accepting-Encoding field </td></tr> 7904<tr><th>HTTP_FIELD_ACCEPT_LANGUAGE </th><td class="description">Accept-Language field</td></tr> 7905<tr><th>HTTP_FIELD_ACCEPT_RANGES </th><td class="description">Accept-Ranges field</td></tr> 7906<tr><th>HTTP_FIELD_ALLOW <span class="info"> CUPS 1.7/macOS 10.9 </span></th><td class="description">Allow field </td></tr> 7907<tr><th>HTTP_FIELD_AUTHENTICATION_INFO <span class="info"> CUPS 2.2.9) </span></th><td class="description">Authentication-Info field (</td></tr> 7908<tr><th>HTTP_FIELD_AUTHORIZATION </th><td class="description">Authorization field</td></tr> 7909<tr><th>HTTP_FIELD_CONNECTION </th><td class="description">Connection field</td></tr> 7910<tr><th>HTTP_FIELD_CONTENT_ENCODING </th><td class="description">Content-Encoding field</td></tr> 7911<tr><th>HTTP_FIELD_CONTENT_LANGUAGE </th><td class="description">Content-Language field</td></tr> 7912<tr><th>HTTP_FIELD_CONTENT_LENGTH </th><td class="description">Content-Length field</td></tr> 7913<tr><th>HTTP_FIELD_CONTENT_LOCATION </th><td class="description">Content-Location field</td></tr> 7914<tr><th>HTTP_FIELD_CONTENT_MD5 </th><td class="description">Content-MD5 field</td></tr> 7915<tr><th>HTTP_FIELD_CONTENT_RANGE </th><td class="description">Content-Range field</td></tr> 7916<tr><th>HTTP_FIELD_CONTENT_TYPE </th><td class="description">Content-Type field</td></tr> 7917<tr><th>HTTP_FIELD_CONTENT_VERSION </th><td class="description">Content-Version field</td></tr> 7918<tr><th>HTTP_FIELD_DATE </th><td class="description">Date field</td></tr> 7919<tr><th>HTTP_FIELD_HOST </th><td class="description">Host field</td></tr> 7920<tr><th>HTTP_FIELD_IF_MODIFIED_SINCE </th><td class="description">If-Modified-Since field</td></tr> 7921<tr><th>HTTP_FIELD_IF_UNMODIFIED_SINCE </th><td class="description">If-Unmodified-Since field</td></tr> 7922<tr><th>HTTP_FIELD_KEEP_ALIVE </th><td class="description">Keep-Alive field</td></tr> 7923<tr><th>HTTP_FIELD_LAST_MODIFIED </th><td class="description">Last-Modified field</td></tr> 7924<tr><th>HTTP_FIELD_LINK </th><td class="description">Link field</td></tr> 7925<tr><th>HTTP_FIELD_LOCATION </th><td class="description">Location field</td></tr> 7926<tr><th>HTTP_FIELD_MAX </th><td class="description">Maximum field index</td></tr> 7927<tr><th>HTTP_FIELD_RANGE </th><td class="description">Range field</td></tr> 7928<tr><th>HTTP_FIELD_REFERER </th><td class="description">Referer field</td></tr> 7929<tr><th>HTTP_FIELD_RETRY_AFTER </th><td class="description">Retry-After field</td></tr> 7930<tr><th>HTTP_FIELD_SERVER <span class="info"> CUPS 1.7/macOS 10.9 </span></th><td class="description">Server field </td></tr> 7931<tr><th>HTTP_FIELD_TRANSFER_ENCODING </th><td class="description">Transfer-Encoding field</td></tr> 7932<tr><th>HTTP_FIELD_UNKNOWN </th><td class="description">Unknown field</td></tr> 7933<tr><th>HTTP_FIELD_UPGRADE </th><td class="description">Upgrade field</td></tr> 7934<tr><th>HTTP_FIELD_USER_AGENT </th><td class="description">User-Agent field</td></tr> 7935<tr><th>HTTP_FIELD_WWW_AUTHENTICATE </th><td class="description">WWW-Authenticate field</td></tr> 7936</tbody></table> 7937<h3 class="enumeration"><a id="http_keepalive_e">http_keepalive_e</a></h3> 7938<p class="description">HTTP keep-alive values</p> 7939<h4 class="constants">Constants</h4> 7940<table class="list"><tbody> 7941<tr><th>HTTP_KEEPALIVE_OFF </th><td class="description">No keep alive support</td></tr> 7942<tr><th>HTTP_KEEPALIVE_ON </th><td class="description">Use keep alive</td></tr> 7943</tbody></table> 7944<h3 class="enumeration"><a id="http_state_e">http_state_e</a></h3> 7945<p class="description">HTTP state values; states 7946are server-oriented...</p> 7947<h4 class="constants">Constants</h4> 7948<table class="list"><tbody> 7949<tr><th>HTTP_STATE_CONNECT </th><td class="description">CONNECT command, waiting for blank line</td></tr> 7950<tr><th>HTTP_STATE_DELETE </th><td class="description">DELETE command, waiting for blank line</td></tr> 7951<tr><th>HTTP_STATE_ERROR </th><td class="description">Error on socket</td></tr> 7952<tr><th>HTTP_STATE_GET </th><td class="description">GET command, waiting for blank line</td></tr> 7953<tr><th>HTTP_STATE_GET_SEND </th><td class="description">GET command, sending data</td></tr> 7954<tr><th>HTTP_STATE_HEAD </th><td class="description">HEAD command, waiting for blank line</td></tr> 7955<tr><th>HTTP_STATE_OPTIONS </th><td class="description">OPTIONS command, waiting for blank line</td></tr> 7956<tr><th>HTTP_STATE_POST </th><td class="description">POST command, waiting for blank line</td></tr> 7957<tr><th>HTTP_STATE_POST_RECV </th><td class="description">POST command, receiving data</td></tr> 7958<tr><th>HTTP_STATE_POST_SEND </th><td class="description">POST command, sending data</td></tr> 7959<tr><th>HTTP_STATE_PUT </th><td class="description">PUT command, waiting for blank line</td></tr> 7960<tr><th>HTTP_STATE_PUT_RECV </th><td class="description">PUT command, receiving data</td></tr> 7961<tr><th>HTTP_STATE_STATUS </th><td class="description">Command complete, sending status</td></tr> 7962<tr><th>HTTP_STATE_TRACE </th><td class="description">TRACE command, waiting for blank line</td></tr> 7963<tr><th>HTTP_STATE_UNKNOWN_METHOD <span class="info"> CUPS 1.7/macOS 10.9 </span></th><td class="description">Unknown request method, waiting for blank line </td></tr> 7964<tr><th>HTTP_STATE_UNKNOWN_VERSION <span class="info"> CUPS 1.7/macOS 10.9 </span></th><td class="description">Unknown request method, waiting for blank line </td></tr> 7965<tr><th>HTTP_STATE_WAITING </th><td class="description">Waiting for command</td></tr> 7966</tbody></table> 7967<h3 class="enumeration"><a id="http_status_e">http_status_e</a></h3> 7968<p class="description">HTTP status codes</p> 7969<h4 class="constants">Constants</h4> 7970<table class="list"><tbody> 7971<tr><th>HTTP_STATUS_ACCEPTED </th><td class="description">DELETE command was successful</td></tr> 7972<tr><th>HTTP_STATUS_BAD_GATEWAY </th><td class="description">Bad gateway</td></tr> 7973<tr><th>HTTP_STATUS_BAD_REQUEST </th><td class="description">Bad request</td></tr> 7974<tr><th>HTTP_STATUS_CONFLICT </th><td class="description">Request is self-conflicting</td></tr> 7975<tr><th>HTTP_STATUS_CONTINUE </th><td class="description">Everything OK, keep going...</td></tr> 7976<tr><th>HTTP_STATUS_CREATED </th><td class="description">PUT command was successful</td></tr> 7977<tr><th>HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED <span class="info"> CUPS 1.4 </span></th><td class="description">User canceled authorization </td></tr> 7978<tr><th>HTTP_STATUS_CUPS_PKI_ERROR <span class="info"> CUPS 1.5/macOS 10.7 </span></th><td class="description">Error negotiating a secure connection </td></tr> 7979<tr><th>HTTP_STATUS_ERROR </th><td class="description">An error response from httpXxxx()</td></tr> 7980<tr><th>HTTP_STATUS_EXPECTATION_FAILED </th><td class="description">The expectation given in an Expect header field was not met</td></tr> 7981<tr><th>HTTP_STATUS_FORBIDDEN </th><td class="description">Forbidden to access this URI</td></tr> 7982<tr><th>HTTP_STATUS_FOUND </th><td class="description">Document was found at a different URI</td></tr> 7983<tr><th>HTTP_STATUS_GATEWAY_TIMEOUT </th><td class="description">Gateway connection timed out</td></tr> 7984<tr><th>HTTP_STATUS_GONE </th><td class="description">Server has gone away</td></tr> 7985<tr><th>HTTP_STATUS_LENGTH_REQUIRED </th><td class="description">A content length or encoding is required</td></tr> 7986<tr><th>HTTP_STATUS_METHOD_NOT_ALLOWED </th><td class="description">Method is not allowed</td></tr> 7987<tr><th>HTTP_STATUS_MOVED_PERMANENTLY </th><td class="description">Document has moved permanently</td></tr> 7988<tr><th>HTTP_STATUS_MULTIPLE_CHOICES </th><td class="description">Multiple files match request</td></tr> 7989<tr><th>HTTP_STATUS_NONE <span class="info"> CUPS 1.7/macOS 10.9 </span></th><td class="description">No Expect value </td></tr> 7990<tr><th>HTTP_STATUS_NOT_ACCEPTABLE </th><td class="description">Not Acceptable</td></tr> 7991<tr><th>HTTP_STATUS_NOT_AUTHORITATIVE </th><td class="description">Information isn't authoritative</td></tr> 7992<tr><th>HTTP_STATUS_NOT_FOUND </th><td class="description">URI was not found</td></tr> 7993<tr><th>HTTP_STATUS_NOT_IMPLEMENTED </th><td class="description">Feature not implemented</td></tr> 7994<tr><th>HTTP_STATUS_NOT_MODIFIED </th><td class="description">File not modified</td></tr> 7995<tr><th>HTTP_STATUS_NOT_SUPPORTED </th><td class="description">HTTP version not supported</td></tr> 7996<tr><th>HTTP_STATUS_NO_CONTENT </th><td class="description">Successful command, no new data</td></tr> 7997<tr><th>HTTP_STATUS_OK </th><td class="description">OPTIONS/GET/HEAD/POST/TRACE command was successful</td></tr> 7998<tr><th>HTTP_STATUS_PARTIAL_CONTENT </th><td class="description">Only a partial file was received/sent</td></tr> 7999<tr><th>HTTP_STATUS_PAYMENT_REQUIRED </th><td class="description">Payment required</td></tr> 8000<tr><th>HTTP_STATUS_PRECONDITION </th><td class="description">Precondition failed</td></tr> 8001<tr><th>HTTP_STATUS_PROXY_AUTHENTICATION </th><td class="description">Proxy Authentication is Required</td></tr> 8002<tr><th>HTTP_STATUS_REQUESTED_RANGE </th><td class="description">The requested range is not satisfiable</td></tr> 8003<tr><th>HTTP_STATUS_REQUEST_TIMEOUT </th><td class="description">Request timed out</td></tr> 8004<tr><th>HTTP_STATUS_REQUEST_TOO_LARGE </th><td class="description">Request entity too large</td></tr> 8005<tr><th>HTTP_STATUS_RESET_CONTENT </th><td class="description">Content was reset/recreated</td></tr> 8006<tr><th>HTTP_STATUS_SEE_OTHER </th><td class="description">See this other link</td></tr> 8007<tr><th>HTTP_STATUS_SERVER_ERROR </th><td class="description">Internal server error</td></tr> 8008<tr><th>HTTP_STATUS_SERVICE_UNAVAILABLE </th><td class="description">Service is unavailable</td></tr> 8009<tr><th>HTTP_STATUS_SWITCHING_PROTOCOLS </th><td class="description">HTTP upgrade to TLS/SSL</td></tr> 8010<tr><th>HTTP_STATUS_TEMPORARY_REDIRECT </th><td class="description">Temporary redirection</td></tr> 8011<tr><th>HTTP_STATUS_UNAUTHORIZED </th><td class="description">Unauthorized to access host</td></tr> 8012<tr><th>HTTP_STATUS_UNSUPPORTED_MEDIATYPE </th><td class="description">The requested media type is unsupported</td></tr> 8013<tr><th>HTTP_STATUS_UPGRADE_REQUIRED </th><td class="description">Upgrade to SSL/TLS required</td></tr> 8014<tr><th>HTTP_STATUS_URI_TOO_LONG </th><td class="description">URI too long</td></tr> 8015<tr><th>HTTP_STATUS_USE_PROXY </th><td class="description">Must use a proxy to access this URI</td></tr> 8016</tbody></table> 8017<h3 class="enumeration"><a id="http_trust_e"><span class="info"> CUPS 2.0/OS 10.10 </span>http_trust_e</a></h3> 8018<p class="description">Level of trust for credentials </p> 8019<h4 class="constants">Constants</h4> 8020<table class="list"><tbody> 8021<tr><th>HTTP_TRUST_CHANGED </th><td class="description">Credentials have changed</td></tr> 8022<tr><th>HTTP_TRUST_EXPIRED </th><td class="description">Credentials are expired</td></tr> 8023<tr><th>HTTP_TRUST_INVALID </th><td class="description">Credentials are invalid</td></tr> 8024<tr><th>HTTP_TRUST_OK </th><td class="description">Credentials are OK/trusted</td></tr> 8025<tr><th>HTTP_TRUST_RENEWED </th><td class="description">Credentials have been renewed</td></tr> 8026<tr><th>HTTP_TRUST_UNKNOWN </th><td class="description">Credentials are unknown/new</td></tr> 8027</tbody></table> 8028<h3 class="enumeration"><a id="http_uri_coding_e">http_uri_coding_e</a></h3> 8029<p class="description">URI en/decode flags</p> 8030<h4 class="constants">Constants</h4> 8031<table class="list"><tbody> 8032<tr><th>HTTP_URI_CODING_ALL </th><td class="description">En/decode everything</td></tr> 8033<tr><th>HTTP_URI_CODING_HOSTNAME </th><td class="description">En/decode the hostname portion</td></tr> 8034<tr><th>HTTP_URI_CODING_MOST </th><td class="description">En/decode all but the query</td></tr> 8035<tr><th>HTTP_URI_CODING_NONE </th><td class="description">Don't en/decode anything</td></tr> 8036<tr><th>HTTP_URI_CODING_QUERY </th><td class="description">En/decode the query portion</td></tr> 8037<tr><th>HTTP_URI_CODING_RESOURCE </th><td class="description">En/decode the resource portion</td></tr> 8038<tr><th>HTTP_URI_CODING_RFC6874 </th><td class="description">Use RFC 6874 address format</td></tr> 8039<tr><th>HTTP_URI_CODING_USERNAME </th><td class="description">En/decode the username portion</td></tr> 8040</tbody></table> 8041<h3 class="enumeration"><a id="http_uri_status_e"><span class="info"> CUPS 1.2 </span>http_uri_status_e</a></h3> 8042<p class="description">URI separation status </p> 8043<h4 class="constants">Constants</h4> 8044<table class="list"><tbody> 8045<tr><th>HTTP_URI_STATUS_BAD_ARGUMENTS </th><td class="description">Bad arguments to function (error)</td></tr> 8046<tr><th>HTTP_URI_STATUS_BAD_HOSTNAME </th><td class="description">Bad hostname in URI (error)</td></tr> 8047<tr><th>HTTP_URI_STATUS_BAD_PORT </th><td class="description">Bad port number in URI (error)</td></tr> 8048<tr><th>HTTP_URI_STATUS_BAD_RESOURCE </th><td class="description">Bad resource in URI (error)</td></tr> 8049<tr><th>HTTP_URI_STATUS_BAD_SCHEME </th><td class="description">Bad scheme in URI (error)</td></tr> 8050<tr><th>HTTP_URI_STATUS_BAD_URI </th><td class="description">Bad/empty URI (error)</td></tr> 8051<tr><th>HTTP_URI_STATUS_BAD_USERNAME </th><td class="description">Bad username in URI (error)</td></tr> 8052<tr><th>HTTP_URI_STATUS_MISSING_RESOURCE </th><td class="description">Missing resource in URI (warning)</td></tr> 8053<tr><th>HTTP_URI_STATUS_MISSING_SCHEME </th><td class="description">Missing scheme in URI (warning)</td></tr> 8054<tr><th>HTTP_URI_STATUS_OK </th><td class="description">URI decoded OK</td></tr> 8055<tr><th>HTTP_URI_STATUS_OVERFLOW </th><td class="description">URI buffer for httpAssembleURI is too small</td></tr> 8056<tr><th>HTTP_URI_STATUS_UNKNOWN_SCHEME </th><td class="description">Unknown scheme in URI (warning)</td></tr> 8057</tbody></table> 8058<h3 class="enumeration"><a id="ipp_finishings_e">ipp_finishings_e</a></h3> 8059<p class="description">Finishings values</p> 8060<h4 class="constants">Constants</h4> 8061<table class="list"><tbody> 8062<tr><th>IPP_FINISHINGS_BALE </th><td class="description">Bale (any type)</td></tr> 8063<tr><th>IPP_FINISHINGS_BIND </th><td class="description">Bind</td></tr> 8064<tr><th>IPP_FINISHINGS_BIND_BOTTOM </th><td class="description">Bind on bottom</td></tr> 8065<tr><th>IPP_FINISHINGS_BIND_LEFT </th><td class="description">Bind on left</td></tr> 8066<tr><th>IPP_FINISHINGS_BIND_RIGHT </th><td class="description">Bind on right</td></tr> 8067<tr><th>IPP_FINISHINGS_BIND_TOP </th><td class="description">Bind on top</td></tr> 8068<tr><th>IPP_FINISHINGS_BOOKLET_MAKER </th><td class="description">Fold to make booklet</td></tr> 8069<tr><th>IPP_FINISHINGS_COAT </th><td class="description">Apply protective liquid or powder coating</td></tr> 8070<tr><th>IPP_FINISHINGS_COVER </th><td class="description">Add cover</td></tr> 8071<tr><th>IPP_FINISHINGS_EDGE_STITCH </th><td class="description">Stitch along any side</td></tr> 8072<tr><th>IPP_FINISHINGS_EDGE_STITCH_BOTTOM </th><td class="description">Stitch along bottom edge</td></tr> 8073<tr><th>IPP_FINISHINGS_EDGE_STITCH_LEFT </th><td class="description">Stitch along left side</td></tr> 8074<tr><th>IPP_FINISHINGS_EDGE_STITCH_RIGHT </th><td class="description">Stitch along right side</td></tr> 8075<tr><th>IPP_FINISHINGS_EDGE_STITCH_TOP </th><td class="description">Stitch along top edge</td></tr> 8076<tr><th>IPP_FINISHINGS_FOLD </th><td class="description">Fold (any type)</td></tr> 8077<tr><th>IPP_FINISHINGS_FOLD_ACCORDION </th><td class="description">Accordion-fold the paper vertically into four sections</td></tr> 8078<tr><th>IPP_FINISHINGS_FOLD_DOUBLE_GATE </th><td class="description">Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically</td></tr> 8079<tr><th>IPP_FINISHINGS_FOLD_ENGINEERING_Z </th><td class="description">Fold the paper vertically into two small sections and one larger, forming an elongated Z</td></tr> 8080<tr><th>IPP_FINISHINGS_FOLD_GATE </th><td class="description">Fold the top and bottom quarters of the paper towards the midline</td></tr> 8081<tr><th>IPP_FINISHINGS_FOLD_HALF </th><td class="description">Fold the paper in half vertically</td></tr> 8082<tr><th>IPP_FINISHINGS_FOLD_HALF_Z </th><td class="description">Fold the paper in half horizontally, then Z-fold the paper vertically</td></tr> 8083<tr><th>IPP_FINISHINGS_FOLD_LEFT_GATE </th><td class="description">Fold the top quarter of the paper towards the midline</td></tr> 8084<tr><th>IPP_FINISHINGS_FOLD_LETTER </th><td class="description">Fold the paper into three sections vertically; sometimes also known as a C fold</td></tr> 8085<tr><th>IPP_FINISHINGS_FOLD_PARALLEL </th><td class="description">Fold the paper in half vertically two times, yielding four sections</td></tr> 8086<tr><th>IPP_FINISHINGS_FOLD_POSTER </th><td class="description">Fold the paper in half horizontally and vertically; sometimes also called a cross fold</td></tr> 8087<tr><th>IPP_FINISHINGS_FOLD_RIGHT_GATE </th><td class="description">Fold the bottom quarter of the paper towards the midline</td></tr> 8088<tr><th>IPP_FINISHINGS_FOLD_Z </th><td class="description">Fold the paper vertically into three sections, forming a Z</td></tr> 8089<tr><th>IPP_FINISHINGS_JOG_OFFSET </th><td class="description">Offset for binding (any type)</td></tr> 8090<tr><th>IPP_FINISHINGS_LAMINATE </th><td class="description">Apply protective (solid) material</td></tr> 8091<tr><th>IPP_FINISHINGS_NONE </th><td class="description">No finishing</td></tr> 8092<tr><th>IPP_FINISHINGS_PUNCH </th><td class="description">Punch (any location/count)</td></tr> 8093<tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_LEFT </th><td class="description">Punch 1 hole bottom left</td></tr> 8094<tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT </th><td class="description">Punch 1 hole bottom right</td></tr> 8095<tr><th>IPP_FINISHINGS_PUNCH_DUAL_BOTTOM </th><td class="description">Punch 2 holes bottom edge</td></tr> 8096<tr><th>IPP_FINISHINGS_PUNCH_DUAL_LEFT </th><td class="description">Punch 2 holes left side</td></tr> 8097<tr><th>IPP_FINISHINGS_PUNCH_DUAL_RIGHT </th><td class="description">Punch 2 holes right side</td></tr> 8098<tr><th>IPP_FINISHINGS_PUNCH_DUAL_TOP </th><td class="description">Punch 2 holes top edge</td></tr> 8099<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM </th><td class="description">Punch multiple holes bottom edge</td></tr> 8100<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT </th><td class="description">Punch multiple holes left side</td></tr> 8101<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT </th><td class="description">Punch multiple holes right side</td></tr> 8102<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_TOP </th><td class="description">Punch multiple holes top edge</td></tr> 8103<tr><th>IPP_FINISHINGS_PUNCH_QUAD_BOTTOM </th><td class="description">Punch 4 holes bottom edge</td></tr> 8104<tr><th>IPP_FINISHINGS_PUNCH_QUAD_LEFT </th><td class="description">Punch 4 holes left side</td></tr> 8105<tr><th>IPP_FINISHINGS_PUNCH_QUAD_RIGHT </th><td class="description">Punch 4 holes right side</td></tr> 8106<tr><th>IPP_FINISHINGS_PUNCH_QUAD_TOP </th><td class="description">Punch 4 holes top edge</td></tr> 8107<tr><th>IPP_FINISHINGS_PUNCH_TOP_LEFT </th><td class="description">Punch 1 hole top left</td></tr> 8108<tr><th>IPP_FINISHINGS_PUNCH_TOP_RIGHT </th><td class="description">Punch 1 hole top right</td></tr> 8109<tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM </th><td class="description">Punch 3 holes bottom edge</td></tr> 8110<tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_LEFT </th><td class="description">Punch 3 holes left side</td></tr> 8111<tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT </th><td class="description">Punch 3 holes right side</td></tr> 8112<tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_TOP </th><td class="description">Punch 3 holes top edge</td></tr> 8113<tr><th>IPP_FINISHINGS_SADDLE_STITCH </th><td class="description">Staple interior</td></tr> 8114<tr><th>IPP_FINISHINGS_STAPLE </th><td class="description">Staple (any location/method)</td></tr> 8115<tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_LEFT </th><td class="description">Staple bottom left corner</td></tr> 8116<tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT </th><td class="description">Staple bottom right corner</td></tr> 8117<tr><th>IPP_FINISHINGS_STAPLE_DUAL_BOTTOM </th><td class="description">Two staples on bottom</td></tr> 8118<tr><th>IPP_FINISHINGS_STAPLE_DUAL_LEFT </th><td class="description">Two staples on left</td></tr> 8119<tr><th>IPP_FINISHINGS_STAPLE_DUAL_RIGHT </th><td class="description">Two staples on right</td></tr> 8120<tr><th>IPP_FINISHINGS_STAPLE_DUAL_TOP </th><td class="description">Two staples on top</td></tr> 8121<tr><th>IPP_FINISHINGS_STAPLE_TOP_LEFT </th><td class="description">Staple top left corner</td></tr> 8122<tr><th>IPP_FINISHINGS_STAPLE_TOP_RIGHT </th><td class="description">Staple top right corner</td></tr> 8123<tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM </th><td class="description">Three staples on bottom</td></tr> 8124<tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_LEFT </th><td class="description">Three staples on left</td></tr> 8125<tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT </th><td class="description">Three staples on right</td></tr> 8126<tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_TOP </th><td class="description">Three staples on top</td></tr> 8127<tr><th>IPP_FINISHINGS_TRIM </th><td class="description">Trim (any type)</td></tr> 8128<tr><th>IPP_FINISHINGS_TRIM_AFTER_COPIES </th><td class="description">Trim output after each copy</td></tr> 8129<tr><th>IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS </th><td class="description">Trim output after each document</td></tr> 8130<tr><th>IPP_FINISHINGS_TRIM_AFTER_JOB </th><td class="description">Trim output after job</td></tr> 8131<tr><th>IPP_FINISHINGS_TRIM_AFTER_PAGES </th><td class="description">Trim output after each page</td></tr> 8132</tbody></table> 8133<h3 class="enumeration"><a id="ipp_jstate_e">ipp_jstate_e</a></h3> 8134<p class="description">Job states</p> 8135<h4 class="constants">Constants</h4> 8136<table class="list"><tbody> 8137<tr><th>IPP_JSTATE_ABORTED </th><td class="description">Job has aborted due to error</td></tr> 8138<tr><th>IPP_JSTATE_CANCELED </th><td class="description">Job has been canceled</td></tr> 8139<tr><th>IPP_JSTATE_COMPLETED </th><td class="description">Job has completed successfully</td></tr> 8140<tr><th>IPP_JSTATE_HELD </th><td class="description">Job is held for printing</td></tr> 8141<tr><th>IPP_JSTATE_PENDING </th><td class="description">Job is waiting to be printed</td></tr> 8142<tr><th>IPP_JSTATE_PROCESSING </th><td class="description">Job is currently printing</td></tr> 8143<tr><th>IPP_JSTATE_STOPPED </th><td class="description">Job has been stopped</td></tr> 8144</tbody></table> 8145<h3 class="enumeration"><a id="ipp_op_e">ipp_op_e</a></h3> 8146<p class="description">IPP operations</p> 8147<h4 class="constants">Constants</h4> 8148<table class="list"><tbody> 8149<tr><th>IPP_OP_ALLOCATE_PRINTER_RESOURCES </th><td class="description">Allocate-Printer-Resources: Use resources for a printer.</td></tr> 8150<tr><th>IPP_OP_CANCEL_CURRENT_JOB </th><td class="description">Cancel-Current-Job: Cancel the current job</td></tr> 8151<tr><th>IPP_OP_CANCEL_JOB </th><td class="description">Cancel-Job: Cancel a job</td></tr> 8152<tr><th>IPP_OP_CANCEL_JOBS </th><td class="description">Cancel-Jobs: Cancel all jobs (administrative)</td></tr> 8153<tr><th>IPP_OP_CANCEL_MY_JOBS </th><td class="description">Cancel-My-Jobs: Cancel a user's jobs</td></tr> 8154<tr><th>IPP_OP_CANCEL_RESOURCE </th><td class="description">Cancel-Resource: Uninstall a resource.</td></tr> 8155<tr><th>IPP_OP_CANCEL_SUBSCRIPTION <span class="info"> CUPS 1.2/macOS 10.5 </span></th><td class="description">Cancel-Subscription: Cancel a subscription </td></tr> 8156<tr><th>IPP_OP_CLOSE_JOB </th><td class="description">Close-Job: Close a job and start printing</td></tr> 8157<tr><th>IPP_OP_CREATE_JOB </th><td class="description">Create-Job: Create an empty print job</td></tr> 8158<tr><th>IPP_OP_CREATE_JOB_SUBSCRIPTIONS <span class="info"> CUPS 1.2/macOS 10.5 </span></th><td class="description">Create-Job-Subscriptions: Create one of more job subscriptions </td></tr> 8159<tr><th>IPP_OP_CREATE_PRINTER </th><td class="description">Create-Printer: Create a new service.</td></tr> 8160<tr><th>IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS <span class="info"> CUPS 1.2/macOS 10.5 </span></th><td class="description">Create-Printer-Subscriptions: Create one or more printer subscriptions </td></tr> 8161<tr><th>IPP_OP_CREATE_RESOURCE </th><td class="description">Create-Resource: Create a new (empty) resource.</td></tr> 8162<tr><th>IPP_OP_CREATE_RESOURCE_SUBSCRIPTIONS </th><td class="description">Create-Resource-Subscriptions: Create event subscriptions for a resource.</td></tr> 8163<tr><th>IPP_OP_CREATE_SYSTEM_SUBSCRIPTIONS </th><td class="description">Create-System-Subscriptions: Create event subscriptions for a system.</td></tr> 8164<tr><th>IPP_OP_CUPS_ADD_MODIFY_CLASS </th><td class="description">CUPS-Add-Modify-Class: Add or modify a class</td></tr> 8165<tr><th>IPP_OP_CUPS_ADD_MODIFY_PRINTER </th><td class="description">CUPS-Add-Modify-Printer: Add or modify a printer</td></tr> 8166<tr><th>IPP_OP_CUPS_AUTHENTICATE_JOB <span class="info"> CUPS 1.2/macOS 10.5 </span></th><td class="description">CUPS-Authenticate-Job: Authenticate a job </td></tr> 8167<tr><th>IPP_OP_CUPS_CREATE_LOCAL_PRINTER <span class="info"> CUPS 2.2 </span></th><td class="description">CUPS-Create-Local-Printer: Create a local (temporary) printer </td></tr> 8168<tr><th>IPP_OP_CUPS_DELETE_CLASS </th><td class="description">CUPS-Delete-Class: Delete a class</td></tr> 8169<tr><th>IPP_OP_CUPS_DELETE_PRINTER </th><td class="description">CUPS-Delete-Printer: Delete a printer</td></tr> 8170<tr><th>IPP_OP_CUPS_GET_DEFAULT </th><td class="description">CUPS-Get-Default: Get the default printer</td></tr> 8171<tr><th>IPP_OP_CUPS_GET_DEVICES <span class="info"> DEPRECATED </span></th><td class="description">CUPS-Get-Devices: Get a list of supported devices </td></tr> 8172<tr><th>IPP_OP_CUPS_GET_DOCUMENT <span class="info"> CUPS 1.4/macOS 10.6 </span></th><td class="description">CUPS-Get-Document: Get a document file </td></tr> 8173<tr><th>IPP_OP_CUPS_GET_PPD <span class="info"> DEPRECATED </span></th><td class="description">CUPS-Get-PPD: Get a PPD file </td></tr> 8174<tr><th>IPP_OP_CUPS_GET_PPDS <span class="info"> DEPRECATED </span></th><td class="description">CUPS-Get-PPDs: Get a list of supported drivers </td></tr> 8175<tr><th>IPP_OP_CUPS_GET_PRINTERS </th><td class="description">CUPS-Get-Printers: Get a list of printers and/or classes</td></tr> 8176<tr><th>IPP_OP_CUPS_INVALID </th><td class="description">Invalid operation name for <a href="#ippOpValue"><code>ippOpValue</code></a></td></tr> 8177<tr><th>IPP_OP_CUPS_MOVE_JOB </th><td class="description">CUPS-Move-Job: Move a job to a different printer</td></tr> 8178<tr><th>IPP_OP_CUPS_SET_DEFAULT </th><td class="description">CUPS-Set-Default: Set the default printer</td></tr> 8179<tr><th>IPP_OP_DEALLOCATE_PRINTER_RESOURCES </th><td class="description">Deallocate-Printer-Resources: Stop using resources for a printer.</td></tr> 8180<tr><th>IPP_OP_DELETE_PRINTER </th><td class="description">Delete-Printer: Delete an existing service.</td></tr> 8181<tr><th>IPP_OP_DISABLE_ALL_PRINTERS </th><td class="description">Disable-All-Printers: Stop accepting new jobs on all services.</td></tr> 8182<tr><th>IPP_OP_DISABLE_PRINTER </th><td class="description">Disable-Printer: Reject new jobs for a printer</td></tr> 8183<tr><th>IPP_OP_ENABLE_ALL_PRINTERS </th><td class="description">Enable-All-Printers: Start accepting new jobs on all services.</td></tr> 8184<tr><th>IPP_OP_ENABLE_PRINTER </th><td class="description">Enable-Printer: Accept new jobs for a printer</td></tr> 8185<tr><th>IPP_OP_GET_JOBS </th><td class="description">Get-Jobs: Get a list of jobs</td></tr> 8186<tr><th>IPP_OP_GET_JOB_ATTRIBUTES </th><td class="description">Get-Job-Attribute: Get information about a job</td></tr> 8187<tr><th>IPP_OP_GET_NOTIFICATIONS <span class="info"> CUPS 1.2/macOS 10.5 </span></th><td class="description">Get-Notifications: Get notification events </td></tr> 8188<tr><th>IPP_OP_GET_PRINTERS </th><td class="description">Get-Printers: Get a list of services.</td></tr> 8189<tr><th>IPP_OP_GET_PRINTER_ATTRIBUTES </th><td class="description">Get-Printer-Attributes: Get information about a printer</td></tr> 8190<tr><th>IPP_OP_GET_PRINTER_SUPPORTED_VALUES </th><td class="description">Get-Printer-Supported-Values: Get supported values</td></tr> 8191<tr><th>IPP_OP_GET_SUBSCRIPTIONS <span class="info"> CUPS 1.2/macOS 10.5 </span></th><td class="description">Get-Subscriptions: Get list of subscriptions </td></tr> 8192<tr><th>IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES <span class="info"> CUPS 1.2/macOS 10.5 </span></th><td class="description">Get-Subscription-Attributes: Get subscription information </td></tr> 8193<tr><th>IPP_OP_GET_SYSTEM_ATTRIBUTES </th><td class="description">Get-System-Attributes: Get system object attributes.</td></tr> 8194<tr><th>IPP_OP_GET_SYSTEM_SUPPORTED_VALUES </th><td class="description">Get-System-Supported-Values: Get supported values for system object attributes.</td></tr> 8195<tr><th>IPP_OP_HOLD_JOB </th><td class="description">Hold-Job: Hold a job for printing</td></tr> 8196<tr><th>IPP_OP_HOLD_NEW_JOBS </th><td class="description">Hold-New-Jobs: Hold new jobs</td></tr> 8197<tr><th>IPP_OP_IDENTIFY_PRINTER </th><td class="description">Identify-Printer: Make the printer beep, flash, or display a message for identification</td></tr> 8198<tr><th>IPP_OP_INSTALL_RESOURCE </th><td class="description">Install-Resource: Install a resource.</td></tr> 8199<tr><th>IPP_OP_PAUSE_ALL_PRINTERS </th><td class="description">Pause-All-Printers: Stop all services immediately.</td></tr> 8200<tr><th>IPP_OP_PAUSE_ALL_PRINTERS_AFTER_CURRENT_JOB </th><td class="description">Pause-All-Printers-After-Current-Job: Stop all services after processing the current jobs.</td></tr> 8201<tr><th>IPP_OP_PAUSE_PRINTER </th><td class="description">Pause-Printer: Stop a printer</td></tr> 8202<tr><th>IPP_OP_PAUSE_PRINTER_AFTER_CURRENT_JOB </th><td class="description">Pause-Printer-After-Current-Job: Stop printer after the current job</td></tr> 8203<tr><th>IPP_OP_PRINT_JOB </th><td class="description">Print-Job: Print a single file</td></tr> 8204<tr><th>IPP_OP_PROMOTE_JOB </th><td class="description">Promote-Job: Promote a job to print sooner</td></tr> 8205<tr><th>IPP_OP_REGISTER_OUTPUT_DEVICE </th><td class="description">Register-Output-Device: Register a remote service.</td></tr> 8206<tr><th>IPP_OP_RELEASE_HELD_NEW_JOBS </th><td class="description">Release-Held-New-Jobs: Release new jobs that were previously held</td></tr> 8207<tr><th>IPP_OP_RELEASE_JOB </th><td class="description">Release-Job: Release a job for printing</td></tr> 8208<tr><th>IPP_OP_RENEW_SUBSCRIPTION <span class="info"> CUPS 1.2/macOS 10.5 </span></th><td class="description">Renew-Subscription: Renew a printer subscription </td></tr> 8209<tr><th>IPP_OP_RESTART_JOB <span class="info"> DEPRECATED </span></th><td class="description">Restart-Job: Reprint a job </td></tr> 8210<tr><th>IPP_OP_RESTART_SYSTEM </th><td class="description">Restart-System: Restart all services.</td></tr> 8211<tr><th>IPP_OP_RESUME_ALL_PRINTERS </th><td class="description">Resume-All-Printers: Start job processing on all services.</td></tr> 8212<tr><th>IPP_OP_RESUME_JOB </th><td class="description">Resume-Job: Resume the current job</td></tr> 8213<tr><th>IPP_OP_RESUME_PRINTER </th><td class="description">Resume-Printer: Start a printer</td></tr> 8214<tr><th>IPP_OP_SCHEDULE_JOB_AFTER </th><td class="description">Schedule-Job-After: Schedule a job to print after another</td></tr> 8215<tr><th>IPP_OP_SEND_DOCUMENT </th><td class="description">Send-Document: Add a file to a job</td></tr> 8216<tr><th>IPP_OP_SEND_RESOURCE_DATA </th><td class="description">Send-Resource-Data: Upload the data for a resource.</td></tr> 8217<tr><th>IPP_OP_SET_JOB_ATTRIBUTES </th><td class="description">Set-Job-Attributes: Set job values</td></tr> 8218<tr><th>IPP_OP_SET_PRINTER_ATTRIBUTES </th><td class="description">Set-Printer-Attributes: Set printer values</td></tr> 8219<tr><th>IPP_OP_SET_RESOURCE_ATTRIBUTES </th><td class="description">Set-Resource-Attributes: Set resource object attributes.</td></tr> 8220<tr><th>IPP_OP_SET_SYSTEM_ATTRIBUTES </th><td class="description">Set-System-Attributes: Set system object attributes.</td></tr> 8221<tr><th>IPP_OP_SHUTDOWN_ALL_PRINTERS </th><td class="description">Shutdown-All-Printers: Shutdown all services.</td></tr> 8222<tr><th>IPP_OP_SHUTDOWN_ONE_PRINTER </th><td class="description">Shutdown-One-Printer: Shutdown a service.</td></tr> 8223<tr><th>IPP_OP_STARTUP_ALL_PRINTERS </th><td class="description">Startup-All-Printers: Startup all services.</td></tr> 8224<tr><th>IPP_OP_STARTUP_ONE_PRINTER </th><td class="description">Startup-One-Printer: Start a service.</td></tr> 8225<tr><th>IPP_OP_SUSPEND_CURRENT_JOB </th><td class="description">Suspend-Current-Job: Suspend the current job</td></tr> 8226<tr><th>IPP_OP_VALIDATE_JOB </th><td class="description">Validate-Job: Validate job values prior to submission</td></tr> 8227</tbody></table> 8228<h3 class="enumeration"><a id="ipp_orient_e">ipp_orient_e</a></h3> 8229<p class="description">Orientation values</p> 8230<h4 class="constants">Constants</h4> 8231<table class="list"><tbody> 8232<tr><th>IPP_ORIENT_LANDSCAPE </th><td class="description">90 degrees counter-clockwise</td></tr> 8233<tr><th>IPP_ORIENT_NONE </th><td class="description">No rotation</td></tr> 8234<tr><th>IPP_ORIENT_PORTRAIT </th><td class="description">No rotation</td></tr> 8235<tr><th>IPP_ORIENT_REVERSE_LANDSCAPE </th><td class="description">90 degrees clockwise</td></tr> 8236<tr><th>IPP_ORIENT_REVERSE_PORTRAIT </th><td class="description">180 degrees</td></tr> 8237</tbody></table> 8238<h3 class="enumeration"><a id="ipp_pstate_e">ipp_pstate_e</a></h3> 8239<p class="description">Printer state values</p> 8240<h4 class="constants">Constants</h4> 8241<table class="list"><tbody> 8242<tr><th>IPP_PSTATE_IDLE </th><td class="description">Printer is idle</td></tr> 8243<tr><th>IPP_PSTATE_PROCESSING </th><td class="description">Printer is working</td></tr> 8244<tr><th>IPP_PSTATE_STOPPED </th><td class="description">Printer is stopped</td></tr> 8245</tbody></table> 8246<h3 class="enumeration"><a id="ipp_quality_e">ipp_quality_e</a></h3> 8247<p class="description">Print quality values</p> 8248<h4 class="constants">Constants</h4> 8249<table class="list"><tbody> 8250<tr><th>IPP_QUALITY_DRAFT </th><td class="description">Draft quality</td></tr> 8251<tr><th>IPP_QUALITY_HIGH </th><td class="description">High quality</td></tr> 8252<tr><th>IPP_QUALITY_NORMAL </th><td class="description">Normal quality</td></tr> 8253</tbody></table> 8254<h3 class="enumeration"><a id="ipp_res_e">ipp_res_e</a></h3> 8255<p class="description">Resolution units</p> 8256<h4 class="constants">Constants</h4> 8257<table class="list"><tbody> 8258<tr><th>IPP_RES_PER_CM </th><td class="description">Pixels per centimeter</td></tr> 8259<tr><th>IPP_RES_PER_INCH </th><td class="description">Pixels per inch</td></tr> 8260</tbody></table> 8261<h3 class="enumeration"><a id="ipp_rstate_e">ipp_rstate_e</a></h3> 8262<p class="description">resource-state values</p> 8263<h4 class="constants">Constants</h4> 8264<table class="list"><tbody> 8265<tr><th>IPP_RSTATE_ABORTED </th><td class="description">Resource has been aborted and is pending deletion.</td></tr> 8266<tr><th>IPP_RSTATE_AVAILABLE </th><td class="description">Resource is available for installation.</td></tr> 8267<tr><th>IPP_RSTATE_CANCELED </th><td class="description">Resource has been canceled and is pending deletion.</td></tr> 8268<tr><th>IPP_RSTATE_INSTALLED </th><td class="description">Resource is installed.</td></tr> 8269<tr><th>IPP_RSTATE_PENDING </th><td class="description">Resource is created but has no data yet.</td></tr> 8270</tbody></table> 8271<h3 class="enumeration"><a id="ipp_sstate_e">ipp_sstate_e</a></h3> 8272<p class="description">system-state values</p> 8273<h4 class="constants">Constants</h4> 8274<table class="list"><tbody> 8275<tr><th>IPP_SSTATE_IDLE </th><td class="description">At least one printer is idle and none are processing a job.</td></tr> 8276<tr><th>IPP_SSTATE_PROCESSING </th><td class="description">At least one printer is processing a job.</td></tr> 8277<tr><th>IPP_SSTATE_STOPPED </th><td class="description">All printers are stopped.</td></tr> 8278</tbody></table> 8279<h3 class="enumeration"><a id="ipp_state_e">ipp_state_e</a></h3> 8280<p class="description">ipp_t state values</p> 8281<h4 class="constants">Constants</h4> 8282<table class="list"><tbody> 8283<tr><th>IPP_STATE_ATTRIBUTE </th><td class="description">One or more attributes need to be sent/received</td></tr> 8284<tr><th>IPP_STATE_DATA </th><td class="description">IPP request data needs to be sent/received</td></tr> 8285<tr><th>IPP_STATE_ERROR </th><td class="description">An error occurred</td></tr> 8286<tr><th>IPP_STATE_HEADER </th><td class="description">The request header needs to be sent/received</td></tr> 8287<tr><th>IPP_STATE_IDLE </th><td class="description">Nothing is happening/request completed</td></tr> 8288</tbody></table> 8289<h3 class="enumeration"><a id="ipp_status_e">ipp_status_e</a></h3> 8290<p class="description">IPP status code values</p> 8291<h4 class="constants">Constants</h4> 8292<table class="list"><tbody> 8293<tr><th>IPP_STATUS_CUPS_INVALID </th><td class="description">Invalid status name for <a href="#ippErrorValue"><code>ippErrorValue</code></a></td></tr> 8294<tr><th>IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED </th><td class="description">client-error-account-authorization-failed</td></tr> 8295<tr><th>IPP_STATUS_ERROR_ACCOUNT_CLOSED </th><td class="description">client-error-account-closed</td></tr> 8296<tr><th>IPP_STATUS_ERROR_ACCOUNT_INFO_NEEDED </th><td class="description">client-error-account-info-needed</td></tr> 8297<tr><th>IPP_STATUS_ERROR_ACCOUNT_LIMIT_REACHED </th><td class="description">client-error-account-limit-reached</td></tr> 8298<tr><th>IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE </th><td class="description">client-error-attributes-not-settable</td></tr> 8299<tr><th>IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES </th><td class="description">client-error-attributes-or-values-not-supported</td></tr> 8300<tr><th>IPP_STATUS_ERROR_BAD_REQUEST </th><td class="description">client-error-bad-request</td></tr> 8301<tr><th>IPP_STATUS_ERROR_BUSY </th><td class="description">server-error-busy</td></tr> 8302<tr><th>IPP_STATUS_ERROR_CHARSET </th><td class="description">client-error-charset-not-supported</td></tr> 8303<tr><th>IPP_STATUS_ERROR_COMPRESSION_ERROR </th><td class="description">client-error-compression-error</td></tr> 8304<tr><th>IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED </th><td class="description">client-error-compression-not-supported</td></tr> 8305<tr><th>IPP_STATUS_ERROR_CONFLICTING </th><td class="description">client-error-conflicting-attributes</td></tr> 8306<tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED <span class="info"> DEPRECATED </span></th><td class="description">cups-error-account-authorization-failed </td></tr> 8307<tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED </th><td class="description">cups-error-account-closed @deprecate@</td></tr> 8308<tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED <span class="info"> DEPRECATED </span></th><td class="description">cups-error-account-info-needed </td></tr> 8309<tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED <span class="info"> DEPRECATED </span></th><td class="description">cups-error-account-limit-reached </td></tr> 8310<tr><th>IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED <span class="info"> CUPS 1.5/macOS 10.7 </span></th><td class="description">cups-authentication-canceled - Authentication canceled by user </td></tr> 8311<tr><th>IPP_STATUS_ERROR_CUPS_PKI <span class="info"> CUPS 1.5/macOS 10.7 </span></th><td class="description">cups-pki-error - Error negotiating a secure connection </td></tr> 8312<tr><th>IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED <span class="info"> CUPS 1.5/macOS 10.7 </span></th><td class="description">cups-upgrade-required - TLS upgrade required </td></tr> 8313<tr><th>IPP_STATUS_ERROR_DEVICE </th><td class="description">server-error-device-error</td></tr> 8314<tr><th>IPP_STATUS_ERROR_DOCUMENT_ACCESS </th><td class="description">client-error-document-access-error</td></tr> 8315<tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR </th><td class="description">client-error-document-format-error</td></tr> 8316<tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED </th><td class="description">client-error-document-format-not-supported</td></tr> 8317<tr><th>IPP_STATUS_ERROR_DOCUMENT_PASSWORD </th><td class="description">client-error-document-password-error</td></tr> 8318<tr><th>IPP_STATUS_ERROR_DOCUMENT_PERMISSION </th><td class="description">client-error-document-permission-error</td></tr> 8319<tr><th>IPP_STATUS_ERROR_DOCUMENT_SECURITY </th><td class="description">client-error-document-security-error</td></tr> 8320<tr><th>IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE </th><td class="description">client-error-document-unprintable-error</td></tr> 8321<tr><th>IPP_STATUS_ERROR_FORBIDDEN </th><td class="description">client-error-forbidden</td></tr> 8322<tr><th>IPP_STATUS_ERROR_GONE </th><td class="description">client-error-gone</td></tr> 8323<tr><th>IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS </th><td class="description">client-error-ignored-all-subscriptions</td></tr> 8324<tr><th>IPP_STATUS_ERROR_INTERNAL </th><td class="description">server-error-internal-error</td></tr> 8325<tr><th>IPP_STATUS_ERROR_JOB_CANCELED </th><td class="description">server-error-job-canceled</td></tr> 8326<tr><th>IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED </th><td class="description">server-error-multiple-document-jobs-not-supported</td></tr> 8327<tr><th>IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS </th><td class="description">server-error-not-accepting-jobs</td></tr> 8328<tr><th>IPP_STATUS_ERROR_NOT_AUTHENTICATED </th><td class="description">client-error-not-authenticated</td></tr> 8329<tr><th>IPP_STATUS_ERROR_NOT_AUTHORIZED </th><td class="description">client-error-not-authorized</td></tr> 8330<tr><th>IPP_STATUS_ERROR_NOT_FETCHABLE </th><td class="description">client-error-not-fetchable</td></tr> 8331<tr><th>IPP_STATUS_ERROR_NOT_FOUND </th><td class="description">client-error-not-found</td></tr> 8332<tr><th>IPP_STATUS_ERROR_NOT_POSSIBLE </th><td class="description">client-error-not-possible</td></tr> 8333<tr><th>IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED </th><td class="description">server-error-operation-not-supported</td></tr> 8334<tr><th>IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED </th><td class="description">server-error-printer-is-deactivated</td></tr> 8335<tr><th>IPP_STATUS_ERROR_REQUEST_ENTITY </th><td class="description">client-error-request-entity-too-large</td></tr> 8336<tr><th>IPP_STATUS_ERROR_REQUEST_VALUE </th><td class="description">client-error-request-value-too-long</td></tr> 8337<tr><th>IPP_STATUS_ERROR_SERVICE_UNAVAILABLE </th><td class="description">server-error-service-unavailable</td></tr> 8338<tr><th>IPP_STATUS_ERROR_TEMPORARY </th><td class="description">server-error-temporary-error</td></tr> 8339<tr><th>IPP_STATUS_ERROR_TIMEOUT </th><td class="description">client-error-timeout</td></tr> 8340<tr><th>IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS </th><td class="description">server-error-too-many-documents</td></tr> 8341<tr><th>IPP_STATUS_ERROR_TOO_MANY_JOBS </th><td class="description">server-error-too-many-jobs</td></tr> 8342<tr><th>IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS </th><td class="description">client-error-too-many-subscriptions</td></tr> 8343<tr><th>IPP_STATUS_ERROR_URI_SCHEME </th><td class="description">client-error-uri-scheme-not-supported</td></tr> 8344<tr><th>IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED </th><td class="description">server-error-version-not-supported</td></tr> 8345<tr><th>IPP_STATUS_OK </th><td class="description">successful-ok</td></tr> 8346<tr><th>IPP_STATUS_OK_CONFLICTING </th><td class="description">successful-ok-conflicting-attributes</td></tr> 8347<tr><th>IPP_STATUS_OK_EVENTS_COMPLETE </th><td class="description">successful-ok-events-complete</td></tr> 8348<tr><th>IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED </th><td class="description">successful-ok-ignored-or-substituted-attributes</td></tr> 8349<tr><th>IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS </th><td class="description">successful-ok-ignored-subscriptions</td></tr> 8350<tr><th>IPP_STATUS_OK_TOO_MANY_EVENTS </th><td class="description">successful-ok-too-many-events</td></tr> 8351</tbody></table> 8352<h3 class="enumeration"><a id="ipp_tag_e">ipp_tag_e</a></h3> 8353<p class="description">Value and group tag values for attributes</p> 8354<h4 class="constants">Constants</h4> 8355<table class="list"><tbody> 8356<tr><th>IPP_TAG_ADMINDEFINE </th><td class="description">Admin-defined value</td></tr> 8357<tr><th>IPP_TAG_BOOLEAN </th><td class="description">Boolean value</td></tr> 8358<tr><th>IPP_TAG_CHARSET </th><td class="description">Character set value</td></tr> 8359<tr><th>IPP_TAG_CUPS_INVALID </th><td class="description">Invalid tag name for <a href="#ippTagValue"><code>ippTagValue</code></a></td></tr> 8360<tr><th>IPP_TAG_DATE </th><td class="description">Date/time value</td></tr> 8361<tr><th>IPP_TAG_DEFAULT </th><td class="description">Default value</td></tr> 8362<tr><th>IPP_TAG_DELETEATTR </th><td class="description">Delete-attribute value</td></tr> 8363<tr><th>IPP_TAG_DOCUMENT </th><td class="description">Document group</td></tr> 8364<tr><th>IPP_TAG_END </th><td class="description">End-of-attributes</td></tr> 8365<tr><th>IPP_TAG_ENUM </th><td class="description">Enumeration value</td></tr> 8366<tr><th>IPP_TAG_EVENT_NOTIFICATION </th><td class="description">Event group</td></tr> 8367<tr><th>IPP_TAG_INTEGER </th><td class="description">Integer value</td></tr> 8368<tr><th>IPP_TAG_JOB </th><td class="description">Job group</td></tr> 8369<tr><th>IPP_TAG_KEYWORD </th><td class="description">Keyword value</td></tr> 8370<tr><th>IPP_TAG_LANGUAGE </th><td class="description">Language value</td></tr> 8371<tr><th>IPP_TAG_MIMETYPE </th><td class="description">MIME media type value</td></tr> 8372<tr><th>IPP_TAG_NAME </th><td class="description">Name value</td></tr> 8373<tr><th>IPP_TAG_NAMELANG </th><td class="description">Name-with-language value</td></tr> 8374<tr><th>IPP_TAG_NOTSETTABLE </th><td class="description">Not-settable value</td></tr> 8375<tr><th>IPP_TAG_NOVALUE </th><td class="description">No-value value</td></tr> 8376<tr><th>IPP_TAG_OPERATION </th><td class="description">Operation group</td></tr> 8377<tr><th>IPP_TAG_PRINTER </th><td class="description">Printer group</td></tr> 8378<tr><th>IPP_TAG_RANGE </th><td class="description">Range value</td></tr> 8379<tr><th>IPP_TAG_RESOLUTION </th><td class="description">Resolution value</td></tr> 8380<tr><th>IPP_TAG_RESOURCE </th><td class="description">Resource group</td></tr> 8381<tr><th>IPP_TAG_STRING </th><td class="description">Octet string value</td></tr> 8382<tr><th>IPP_TAG_SUBSCRIPTION </th><td class="description">Subscription group</td></tr> 8383<tr><th>IPP_TAG_SYSTEM </th><td class="description">System group</td></tr> 8384<tr><th>IPP_TAG_TEXT </th><td class="description">Text value</td></tr> 8385<tr><th>IPP_TAG_TEXTLANG </th><td class="description">Text-with-language value</td></tr> 8386<tr><th>IPP_TAG_UNKNOWN </th><td class="description">Unknown value</td></tr> 8387<tr><th>IPP_TAG_UNSUPPORTED_GROUP </th><td class="description">Unsupported attributes group</td></tr> 8388<tr><th>IPP_TAG_UNSUPPORTED_VALUE </th><td class="description">Unsupported value</td></tr> 8389<tr><th>IPP_TAG_URI </th><td class="description">URI value</td></tr> 8390<tr><th>IPP_TAG_URISCHEME </th><td class="description">URI scheme value</td></tr> 8391<tr><th>IPP_TAG_ZERO </th><td class="description">Zero tag - used for separators</td></tr> 8392</tbody></table> 8393</div> 8394</body> 8395</html> 8396