/usr/share/cups/doc-root/help/cupspm.html is in cups-server-common 2.2.7-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 | <!doctype html>
<html>
<!-- SECTION: Programming -->
<head>
<title>CUPS Programming Manual</title>
<meta name="keywords" content="Programming">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="creator" content="Mini-XML v2.11">
<meta name="author" content="Michael R Sweet">
<meta name="copyright" content="Copyright © 2007-2017 by Apple Inc. All Rights Reserved.">
<meta name="version" content="2.2.5">
<style type="text/css"><!--
body, p, h1, h2, h3, h4 {
font-family: sans-serif;
}
div.body h1 {
font-size: 250%;
font-weight: bold;
margin: 0;
}
div.body h2 {
font-size: 250%;
margin-top: 1.5em;
}
div.body h3 {
font-size: 150%;
margin-bottom: 0.5em;
margin-top: 1.5em;
}
div.body h4 {
font-size: 110%;
margin-bottom: 0.5em;
margin-top: 1.5em;
}
div.body h5 {
font-size: 100%;
margin-bottom: 0.5em;
margin-top: 1.5em;
}
div.contents {
background: #e8e8e8;
border: solid thin black;
padding: 10px;
}
div.contents h1 {
font-size: 110%;
}
div.contents h2 {
font-size: 100%;
}
div.contents ul.contents {
font-size: 80%;
}
.class {
border-bottom: solid 2px gray;
}
.constants {
}
.description {
margin-top: 0.5em;
}
.discussion {
}
.enumeration {
border-bottom: solid 2px gray;
}
.function {
border-bottom: solid 2px gray;
margin-bottom: 0;
}
.members {
}
.method {
}
.parameters {
}
.returnvalue {
}
.struct {
border-bottom: solid 2px gray;
}
.typedef {
border-bottom: solid 2px gray;
}
.union {
border-bottom: solid 2px gray;
}
.variable {
}
h1, h2, h3, h4, h5, h6 {
page-break-inside: avoid;
}
blockquote {
border: solid thin gray;
box-shadow: 3px 3px 5px rgba(0,0,0,0.5);
padding: 0px 10px;
page-break-inside: avoid;
}
p code, li code, p.code, pre, ul.code li {
background: rgba(127,127,127,0.1);
border: thin dotted gray;
font-family: monospace;
font-size: 90%;
hyphens: manual;
-webkit-hyphens: manual;
page-break-inside: avoid;
}
p.code, pre, ul.code li {
padding: 10px;
}
p code, li code {
padding: 2px 5px;
}
a:link, a:visited {
text-decoration: none;
}
span.info {
background: black;
border: solid thin black;
color: white;
font-size: 80%;
font-style: italic;
font-weight: bold;
white-space: nowrap;
}
h3 span.info, h4 span.info {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
float: right;
padding: 3px 6px;
}
ul.code, ul.contents, ul.subcontents {
list-style-type: none;
margin: 0;
padding-left: 0;
}
ul.code li {
margin: 0;
}
ul.contents > li {
margin-top: 1em;
}
ul.contents li ul.code, ul.contents li ul.subcontents {
padding-left: 2em;
}
table.list {
border-collapse: collapse;
width: 100%;
}
table.list tr:nth-child(even) {
background: rgba(127,127,127,0.1);]n}
table.list th {
border-right: 2px solid gray;
font-family: monospace;
padding: 5px 10px 5px 2px;
text-align: right;
vertical-align: top;
}
table.list td {
padding: 5px 2px 5px 10px;
text-align: left;
vertical-align: top;
}
h1.title {
}
h2.title {
border-bottom: solid 2px black;
}
h3.title {
border-bottom: solid 2px black;
}
--></style>
</head>
<body>
<h1 class="title">CUPS Programming Manual</h1>
<p>Michael R Sweet</p>
<p>Copyright © 2007-2017 by Apple Inc. All Rights Reserved.</p>
<div class="contents">
<h2 class="title">Contents</h2>
<ul class="contents">
<li><a href="#introduction">Introduction</a><ul class="subcontents">
<li><a href="#guidelines">Guidelines</a></li>
<li><a href="#terms-used-in-this-document">Terms Used in This Document</a></li>
<li><a href="#compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></li>
</ul></li>
<li><a href="#working-with-destinations">Working with Destinations</a><ul class="subcontents">
<li><a href="#finding-available-destinations">Finding Available Destinations</a></li>
<li><a href="#basic-destination-information">Basic Destination Information</a></li>
<li><a href="#detailed-destination-information">Detailed Destination Information</a></li>
<li><a href="#submitting-a-print-job">Submitting a Print Job</a></li>
</ul></li>
<li><a href="#sending-ipp-requests">Sending IPP Requests</a><ul class="subcontents">
<li><a href="#connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</a></li>
<li><a href="#creating-an-ipp-request">Creating an IPP Request</a></li>
<li><a href="#sending-the-ipp-request">Sending the IPP Request</a></li>
<li><a href="#processing-the-ipp-response">Processing the IPP Response</a></li>
<li><a href="#authentication">Authentication</a></li>
</ul></li>
<li><a href="#FUNCTIONS">Functions</a><ul class="subcontents">
<li><a href="#cupsAddDest">cupsAddDest</a></li>
<li><a href="#cupsAddIntegerOption">cupsAddIntegerOption</a></li>
<li><a href="#cupsAddOption">cupsAddOption</a></li>
<li><a href="#cupsCancelDestJob">cupsCancelDestJob</a></li>
<li><a href="#cupsCheckDestSupported">cupsCheckDestSupported</a></li>
<li><a href="#cupsCloseDestJob">cupsCloseDestJob</a></li>
<li><a href="#cupsConnectDest">cupsConnectDest</a></li>
<li><a href="#cupsCopyDest">cupsCopyDest</a></li>
<li><a href="#cupsCopyDestConflicts">cupsCopyDestConflicts</a></li>
<li><a href="#cupsCopyDestInfo">cupsCopyDestInfo</a></li>
<li><a href="#cupsCreateDestJob">cupsCreateDestJob</a></li>
<li><a href="#cupsDoAuthentication">cupsDoAuthentication</a></li>
<li><a href="#cupsEncodeOptions">cupsEncodeOptions</a></li>
<li><a href="#cupsEncodeOptions2">cupsEncodeOptions2</a></li>
<li><a href="#cupsEncryption">cupsEncryption</a></li>
<li><a href="#cupsEnumDests">cupsEnumDests</a></li>
<li><a href="#cupsFindDestDefault">cupsFindDestDefault</a></li>
<li><a href="#cupsFindDestReady">cupsFindDestReady</a></li>
<li><a href="#cupsFindDestSupported">cupsFindDestSupported</a></li>
<li><a href="#cupsFinishDestDocument">cupsFinishDestDocument</a></li>
<li><a href="#cupsFreeDestInfo">cupsFreeDestInfo</a></li>
<li><a href="#cupsFreeDests">cupsFreeDests</a></li>
<li><a href="#cupsFreeJobs">cupsFreeJobs</a></li>
<li><a href="#cupsFreeOptions">cupsFreeOptions</a></li>
<li><a href="#cupsGetDest">cupsGetDest</a></li>
<li><a href="#cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></li>
<li><a href="#cupsGetDestMediaByName">cupsGetDestMediaByName</a></li>
<li><a href="#cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></li>
<li><a href="#cupsGetDestMediaCount">cupsGetDestMediaCount</a></li>
<li><a href="#cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></li>
<li><a href="#cupsGetDestWithURI">cupsGetDestWithURI</a></li>
<li><a href="#cupsGetDests2">cupsGetDests2</a></li>
<li><a href="#cupsGetIntegerOption">cupsGetIntegerOption</a></li>
<li><a href="#cupsGetJobs2">cupsGetJobs2</a></li>
<li><a href="#cupsGetNamedDest">cupsGetNamedDest</a></li>
<li><a href="#cupsGetOption">cupsGetOption</a></li>
<li><a href="#cupsGetPassword2">cupsGetPassword2</a></li>
<li><a href="#cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></li>
<li><a href="#cupsLocalizeDestOption">cupsLocalizeDestOption</a></li>
<li><a href="#cupsLocalizeDestValue">cupsLocalizeDestValue</a></li>
<li><a href="#cupsMakeServerCredentials">cupsMakeServerCredentials</a></li>
<li><a href="#cupsParseOptions">cupsParseOptions</a></li>
<li><a href="#cupsRemoveDest">cupsRemoveDest</a></li>
<li><a href="#cupsRemoveOption">cupsRemoveOption</a></li>
<li><a href="#cupsServer">cupsServer</a></li>
<li><a href="#cupsSetClientCertCB">cupsSetClientCertCB</a></li>
<li><a href="#cupsSetCredentials">cupsSetCredentials</a></li>
<li><a href="#cupsSetDefaultDest">cupsSetDefaultDest</a></li>
<li><a href="#cupsSetDests2">cupsSetDests2</a></li>
<li><a href="#cupsSetEncryption">cupsSetEncryption</a></li>
<li><a href="#cupsSetPasswordCB2">cupsSetPasswordCB2</a></li>
<li><a href="#cupsSetServer">cupsSetServer</a></li>
<li><a href="#cupsSetServerCertCB">cupsSetServerCertCB</a></li>
<li><a href="#cupsSetServerCredentials">cupsSetServerCredentials</a></li>
<li><a href="#cupsSetUser">cupsSetUser</a></li>
<li><a href="#cupsSetUserAgent">cupsSetUserAgent</a></li>
<li><a href="#cupsStartDestDocument">cupsStartDestDocument</a></li>
<li><a href="#cupsUser">cupsUser</a></li>
<li><a href="#cupsUserAgent">cupsUserAgent</a></li>
<li><a href="#httpAcceptConnection">httpAcceptConnection</a></li>
<li><a href="#httpAddCredential">httpAddCredential</a></li>
<li><a href="#httpAddrAny">httpAddrAny</a></li>
<li><a href="#httpAddrClose">httpAddrClose</a></li>
<li><a href="#httpAddrConnect2">httpAddrConnect2</a></li>
<li><a href="#httpAddrCopyList">httpAddrCopyList</a></li>
<li><a href="#httpAddrEqual">httpAddrEqual</a></li>
<li><a href="#httpAddrFamily">httpAddrFamily</a></li>
<li><a href="#httpAddrFreeList">httpAddrFreeList</a></li>
<li><a href="#httpAddrGetList">httpAddrGetList</a></li>
<li><a href="#httpAddrLength">httpAddrLength</a></li>
<li><a href="#httpAddrListen">httpAddrListen</a></li>
<li><a href="#httpAddrLocalhost">httpAddrLocalhost</a></li>
<li><a href="#httpAddrLookup">httpAddrLookup</a></li>
<li><a href="#httpAddrPort">httpAddrPort</a></li>
<li><a href="#httpAddrString">httpAddrString</a></li>
<li><a href="#httpAssembleURI">httpAssembleURI</a></li>
<li><a href="#httpAssembleURIf">httpAssembleURIf</a></li>
<li><a href="#httpAssembleUUID">httpAssembleUUID</a></li>
<li><a href="#httpBlocking">httpBlocking</a></li>
<li><a href="#httpCheck">httpCheck</a></li>
<li><a href="#httpClearCookie">httpClearCookie</a></li>
<li><a href="#httpClearFields">httpClearFields</a></li>
<li><a href="#httpClose">httpClose</a></li>
<li><a href="#httpCompareCredentials">httpCompareCredentials</a></li>
<li><a href="#httpConnect2">httpConnect2</a></li>
<li><a href="#httpCopyCredentials">httpCopyCredentials</a></li>
<li><a href="#httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></li>
<li><a href="#httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></li>
<li><a href="#httpCredentialsGetTrust">httpCredentialsGetTrust</a></li>
<li><a href="#httpCredentialsString">httpCredentialsString</a></li>
<li><a href="#httpDecode64_2">httpDecode64_2</a></li>
<li><a href="#httpDelete">httpDelete</a></li>
<li><a href="#httpEncode64_2">httpEncode64_2</a></li>
<li><a href="#httpEncryption">httpEncryption</a></li>
<li><a href="#httpError">httpError</a></li>
<li><a href="#httpFieldValue">httpFieldValue</a></li>
<li><a href="#httpFlush">httpFlush</a></li>
<li><a href="#httpFlushWrite">httpFlushWrite</a></li>
<li><a href="#httpFreeCredentials">httpFreeCredentials</a></li>
<li><a href="#httpGet">httpGet</a></li>
<li><a href="#httpGetActivity">httpGetActivity</a></li>
<li><a href="#httpGetAddress">httpGetAddress</a></li>
<li><a href="#httpGetAuthString">httpGetAuthString</a></li>
<li><a href="#httpGetBlocking">httpGetBlocking</a></li>
<li><a href="#httpGetContentEncoding">httpGetContentEncoding</a></li>
<li><a href="#httpGetCookie">httpGetCookie</a></li>
<li><a href="#httpGetDateString2">httpGetDateString2</a></li>
<li><a href="#httpGetDateTime">httpGetDateTime</a></li>
<li><a href="#httpGetEncryption">httpGetEncryption</a></li>
<li><a href="#httpGetExpect">httpGetExpect</a></li>
<li><a href="#httpGetFd">httpGetFd</a></li>
<li><a href="#httpGetField">httpGetField</a></li>
<li><a href="#httpGetHostname">httpGetHostname</a></li>
<li><a href="#httpGetKeepAlive">httpGetKeepAlive</a></li>
<li><a href="#httpGetLength2">httpGetLength2</a></li>
<li><a href="#httpGetPending">httpGetPending</a></li>
<li><a href="#httpGetReady">httpGetReady</a></li>
<li><a href="#httpGetRemaining">httpGetRemaining</a></li>
<li><a href="#httpGetState">httpGetState</a></li>
<li><a href="#httpGetStatus">httpGetStatus</a></li>
<li><a href="#httpGetSubField2">httpGetSubField2</a></li>
<li><a href="#httpGetVersion">httpGetVersion</a></li>
<li><a href="#httpGets">httpGets</a></li>
<li><a href="#httpHead">httpHead</a></li>
<li><a href="#httpInitialize">httpInitialize</a></li>
<li><a href="#httpIsChunked">httpIsChunked</a></li>
<li><a href="#httpIsEncrypted">httpIsEncrypted</a></li>
<li><a href="#httpLoadCredentials">httpLoadCredentials</a></li>
<li><a href="#httpOptions">httpOptions</a></li>
<li><a href="#httpPeek">httpPeek</a></li>
<li><a href="#httpPost">httpPost</a></li>
<li><a href="#httpPut">httpPut</a></li>
<li><a href="#httpRead2">httpRead2</a></li>
<li><a href="#httpReadRequest">httpReadRequest</a></li>
<li><a href="#httpReconnect2">httpReconnect2</a></li>
<li><a href="#httpResolveHostname">httpResolveHostname</a></li>
<li><a href="#httpSaveCredentials">httpSaveCredentials</a></li>
<li><a href="#httpSeparateURI">httpSeparateURI</a></li>
<li><a href="#httpSetAuthString">httpSetAuthString</a></li>
<li><a href="#httpSetCookie">httpSetCookie</a></li>
<li><a href="#httpSetCredentials">httpSetCredentials</a></li>
<li><a href="#httpSetDefaultField">httpSetDefaultField</a></li>
<li><a href="#httpSetExpect">httpSetExpect</a></li>
<li><a href="#httpSetField">httpSetField</a></li>
<li><a href="#httpSetKeepAlive">httpSetKeepAlive</a></li>
<li><a href="#httpSetLength">httpSetLength</a></li>
<li><a href="#httpSetTimeout">httpSetTimeout</a></li>
<li><a href="#httpShutdown">httpShutdown</a></li>
<li><a href="#httpStateString">httpStateString</a></li>
<li><a href="#httpStatus">httpStatus</a></li>
<li><a href="#httpURIStatusString">httpURIStatusString</a></li>
<li><a href="#httpUpdate">httpUpdate</a></li>
<li><a href="#httpWait">httpWait</a></li>
<li><a href="#httpWrite2">httpWrite2</a></li>
<li><a href="#httpWriteResponse">httpWriteResponse</a></li>
<li><a href="#ippAddBoolean">ippAddBoolean</a></li>
<li><a href="#ippAddBooleans">ippAddBooleans</a></li>
<li><a href="#ippAddCollection">ippAddCollection</a></li>
<li><a href="#ippAddCollections">ippAddCollections</a></li>
<li><a href="#ippAddDate">ippAddDate</a></li>
<li><a href="#ippAddInteger">ippAddInteger</a></li>
<li><a href="#ippAddIntegers">ippAddIntegers</a></li>
<li><a href="#ippAddOctetString">ippAddOctetString</a></li>
<li><a href="#ippAddOutOfBand">ippAddOutOfBand</a></li>
<li><a href="#ippAddRange">ippAddRange</a></li>
<li><a href="#ippAddRanges">ippAddRanges</a></li>
<li><a href="#ippAddResolution">ippAddResolution</a></li>
<li><a href="#ippAddResolutions">ippAddResolutions</a></li>
<li><a href="#ippAddSeparator">ippAddSeparator</a></li>
<li><a href="#ippAddString">ippAddString</a></li>
<li><a href="#ippAddStringf">ippAddStringf</a></li>
<li><a href="#ippAddStringfv">ippAddStringfv</a></li>
<li><a href="#ippAddStrings">ippAddStrings</a></li>
<li><a href="#ippAttributeString">ippAttributeString</a></li>
<li><a href="#ippContainsInteger">ippContainsInteger</a></li>
<li><a href="#ippContainsString">ippContainsString</a></li>
<li><a href="#ippCopyAttribute">ippCopyAttribute</a></li>
<li><a href="#ippCopyAttributes">ippCopyAttributes</a></li>
<li><a href="#ippCreateRequestedArray">ippCreateRequestedArray</a></li>
<li><a href="#ippDateToTime">ippDateToTime</a></li>
<li><a href="#ippDelete">ippDelete</a></li>
<li><a href="#ippDeleteAttribute">ippDeleteAttribute</a></li>
<li><a href="#ippDeleteValues">ippDeleteValues</a></li>
<li><a href="#ippEnumString">ippEnumString</a></li>
<li><a href="#ippEnumValue">ippEnumValue</a></li>
<li><a href="#ippErrorString">ippErrorString</a></li>
<li><a href="#ippErrorValue">ippErrorValue</a></li>
<li><a href="#ippFindAttribute">ippFindAttribute</a></li>
<li><a href="#ippFindNextAttribute">ippFindNextAttribute</a></li>
<li><a href="#ippFirstAttribute">ippFirstAttribute</a></li>
<li><a href="#ippGetBoolean">ippGetBoolean</a></li>
<li><a href="#ippGetCollection">ippGetCollection</a></li>
<li><a href="#ippGetCount">ippGetCount</a></li>
<li><a href="#ippGetDate">ippGetDate</a></li>
<li><a href="#ippGetGroupTag">ippGetGroupTag</a></li>
<li><a href="#ippGetInteger">ippGetInteger</a></li>
<li><a href="#ippGetName">ippGetName</a></li>
<li><a href="#ippGetOctetString">ippGetOctetString</a></li>
<li><a href="#ippGetOperation">ippGetOperation</a></li>
<li><a href="#ippGetRange">ippGetRange</a></li>
<li><a href="#ippGetRequestId">ippGetRequestId</a></li>
<li><a href="#ippGetResolution">ippGetResolution</a></li>
<li><a href="#ippGetState">ippGetState</a></li>
<li><a href="#ippGetStatusCode">ippGetStatusCode</a></li>
<li><a href="#ippGetString">ippGetString</a></li>
<li><a href="#ippGetValueTag">ippGetValueTag</a></li>
<li><a href="#ippGetVersion">ippGetVersion</a></li>
<li><a href="#ippLength">ippLength</a></li>
<li><a href="#ippNew">ippNew</a></li>
<li><a href="#ippNewRequest">ippNewRequest</a></li>
<li><a href="#ippNewResponse">ippNewResponse</a></li>
<li><a href="#ippNextAttribute">ippNextAttribute</a></li>
<li><a href="#ippOpString">ippOpString</a></li>
<li><a href="#ippOpValue">ippOpValue</a></li>
<li><a href="#ippPort">ippPort</a></li>
<li><a href="#ippRead">ippRead</a></li>
<li><a href="#ippReadFile">ippReadFile</a></li>
<li><a href="#ippReadIO">ippReadIO</a></li>
<li><a href="#ippSetBoolean">ippSetBoolean</a></li>
<li><a href="#ippSetCollection">ippSetCollection</a></li>
<li><a href="#ippSetDate">ippSetDate</a></li>
<li><a href="#ippSetGroupTag">ippSetGroupTag</a></li>
<li><a href="#ippSetInteger">ippSetInteger</a></li>
<li><a href="#ippSetName">ippSetName</a></li>
<li><a href="#ippSetOctetString">ippSetOctetString</a></li>
<li><a href="#ippSetOperation">ippSetOperation</a></li>
<li><a href="#ippSetPort">ippSetPort</a></li>
<li><a href="#ippSetRange">ippSetRange</a></li>
<li><a href="#ippSetRequestId">ippSetRequestId</a></li>
<li><a href="#ippSetResolution">ippSetResolution</a></li>
<li><a href="#ippSetState">ippSetState</a></li>
<li><a href="#ippSetStatusCode">ippSetStatusCode</a></li>
<li><a href="#ippSetString">ippSetString</a></li>
<li><a href="#ippSetStringf">ippSetStringf</a></li>
<li><a href="#ippSetStringfv">ippSetStringfv</a></li>
<li><a href="#ippSetValueTag">ippSetValueTag</a></li>
<li><a href="#ippSetVersion">ippSetVersion</a></li>
<li><a href="#ippStateString">ippStateString</a></li>
<li><a href="#ippTagString">ippTagString</a></li>
<li><a href="#ippTagValue">ippTagValue</a></li>
<li><a href="#ippTimeToDate">ippTimeToDate</a></li>
<li><a href="#ippValidateAttribute">ippValidateAttribute</a></li>
<li><a href="#ippValidateAttributes">ippValidateAttributes</a></li>
<li><a href="#ippWrite">ippWrite</a></li>
<li><a href="#ippWriteFile">ippWriteFile</a></li>
<li><a href="#ippWriteIO">ippWriteIO</a></li>
</ul></li>
<li><a href="#TYPES">Data Types</a><ul class="subcontents">
<li><a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a></li>
<li><a href="#cups_dest_cb_t">cups_dest_cb_t</a></li>
<li><a href="#cups_dest_t">cups_dest_t</a></li>
<li><a href="#cups_dinfo_t">cups_dinfo_t</a></li>
<li><a href="#cups_job_t">cups_job_t</a></li>
<li><a href="#cups_option_t">cups_option_t</a></li>
<li><a href="#cups_password_cb2_t">cups_password_cb2_t</a></li>
<li><a href="#cups_ptype_t">cups_ptype_t</a></li>
<li><a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a></li>
<li><a href="#cups_size_t">cups_size_t</a></li>
<li><a href="#http_addr_t">http_addr_t</a></li>
<li><a href="#http_encoding_t">http_encoding_t</a></li>
<li><a href="#http_encryption_t">http_encryption_t</a></li>
<li><a href="#http_field_t">http_field_t</a></li>
<li><a href="#http_keepalive_t">http_keepalive_t</a></li>
<li><a href="#http_state_t">http_state_t</a></li>
<li><a href="#http_t">http_t</a></li>
<li><a href="#http_timeout_cb_t">http_timeout_cb_t</a></li>
<li><a href="#http_trust_t">http_trust_t</a></li>
<li><a href="#http_uri_coding_t">http_uri_coding_t</a></li>
<li><a href="#http_uri_status_t">http_uri_status_t</a></li>
<li><a href="#ipp_attribute_t">ipp_attribute_t</a></li>
<li><a href="#ipp_copycb_t">ipp_copycb_t</a></li>
<li><a href="#ipp_iocb_t">ipp_iocb_t</a></li>
<li><a href="#ipp_orient_t">ipp_orient_t</a></li>
<li><a href="#ipp_pstate_t">ipp_pstate_t</a></li>
<li><a href="#ipp_quality_t">ipp_quality_t</a></li>
<li><a href="#ipp_res_t">ipp_res_t</a></li>
<li><a href="#ipp_state_t">ipp_state_t</a></li>
<li><a href="#ipp_t">ipp_t</a></li>
</ul></li>
<li><a href="#STRUCTURES">Structures</a><ul class="subcontents">
<li><a href="#cups_dest_s">cups_dest_s</a></li>
<li><a href="#cups_job_s">cups_job_s</a></li>
<li><a href="#cups_option_s">cups_option_s</a></li>
<li><a href="#cups_size_s">cups_size_s</a></li>
</ul></li>
<li><a href="#ENUMERATIONS">Enumerations</a><ul class="subcontents">
<li><a href="#cups_ptype_e">cups_ptype_e</a></li>
<li><a href="#http_encoding_e">http_encoding_e</a></li>
<li><a href="#http_encryption_e">http_encryption_e</a></li>
<li><a href="#http_field_e">http_field_e</a></li>
<li><a href="#http_keepalive_e">http_keepalive_e</a></li>
<li><a href="#http_state_e">http_state_e</a></li>
<li><a href="#http_status_e">http_status_e</a></li>
<li><a href="#http_trust_e">http_trust_e</a></li>
<li><a href="#http_uri_coding_e">http_uri_coding_e</a></li>
<li><a href="#http_uri_status_e">http_uri_status_e</a></li>
<li><a href="#ipp_finishings_e">ipp_finishings_e</a></li>
<li><a href="#ipp_jstate_e">ipp_jstate_e</a></li>
<li><a href="#ipp_op_e">ipp_op_e</a></li>
<li><a href="#ipp_orient_e">ipp_orient_e</a></li>
<li><a href="#ipp_pstate_e">ipp_pstate_e</a></li>
<li><a href="#ipp_quality_e">ipp_quality_e</a></li>
<li><a href="#ipp_res_e">ipp_res_e</a></li>
<li><a href="#ipp_state_e">ipp_state_e</a></li>
<li><a href="#ipp_status_e">ipp_status_e</a></li>
<li><a href="#ipp_tag_e">ipp_tag_e</a></li>
</ul></li>
</ul>
</div>
<div class="body">
<blockquote>
<p>Please <a href="https://github.com/apple/cups/issues">file issues on Github</a> to provide feedback on this document.</p>
</blockquote>
<h2><a id="introduction">Introduction</a></h2>
<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>
<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>
<h3><a id="guidelines">Guidelines</a></h3>
<p>When writing software that uses the "cups" library:</p>
<ul>
<li>Do not use undocumented or deprecated APIs,</li>
<li>Do not rely on pre-configured printers,</li>
<li>Do not assume that printers support specific features or formats, and</li>
<li>Do not rely on implementation details (PPDs, etc.)</li>
</ul>
<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>
<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>
<h3><a id="terms-used-in-this-document">Terms Used in This Document</a></h3>
<p>A <em>Destination</em> is a printer or print queue that accepts print jobs. A <em>Print</em> <em>Job</em> is 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>
<h3><a id="compiling-programs-that-use-the-cups-api">Compiling Programs That Use the CUPS API</a></h3>
<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>
<p>The following simple program lists the available destinations:</p>
<pre><code>#include <stdio.h>
#include <cups/cups.h>
int print_dest(void *user_data, unsigned flags, cups_dest_t *dest)
{
if (dest->instance)
printf("%s/%s\n", dest->name, dest->instance);
else
puts(dest->name);
return (1);
}
int main(void)
{
cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, 0, 0, print_dest, NULL);
return (0);
}
</code></pre>
<h4><a id="compiling-with-xcode">Compiling with Xcode</a></h4>
<p>In Xcode, choose <em>New</em> <em>Project...</em> from the <em>File</em> menu (or press SHIFT+CMD+N), then select the <em>Command</em> <em>Line</em> <em>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>
<p>In the project window, click on the <em>Build</em> <em>Phases</em> group and expand the <em>Link</em> <em>Binary</em> <em>with</em> <em>Libraries</em> section. Click <em>+</em>, type "libcups" to show the library, and then double-click on <code>libcups.tbd</code>.</p>
<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>
<h4><a id="compiling-with-gcc">Compiling with GCC</a></h4>
<p>From the command-line, create a file called <code>sample.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>
<pre><code>gcc -o simple `cups-config --cflags` simple.c `cups-config --libs`
./simple
</code></pre>
<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>
<h2><a id="working-with-destinations">Working with Destinations</a></h2>
<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>
<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>
<h3><a id="finding-available-destinations">Finding Available Destinations</a></h3>
<p>The <code>cupsEnumDests</code> function finds all of the available destinations:</p>
<pre><code> int
cupsEnumDests(unsigned flags, int msec, int *cancel,
cups_ptype_t type, cups_ptype_t mask,
cups_dest_cb_t cb, void *user_data)
</code></pre>
<p>The <code>flags</code> argument specifies enumeration options, which at present must be <code>CUPS_DEST_FLAGS_NONE</code>.</p>
<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>
<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>
<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>
<ul>
<li><code>CUPS_PRINTER_CLASS</code>: A collection of destinations.</li>
<li><code>CUPS_PRINTER_FAX</code>: A facsimile device.</li>
<li><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.</li>
<li><code>CUPS_PRINTER_REMOTE</code>: A remote (shared) printer or class.</li>
<li><code>CUPS_PRINTER_DISCOVERED</code>: An available network printer or class.</li>
<li><code>CUPS_PRINTER_BW</code>: Can do B&W printing.</li>
<li><code>CUPS_PRINTER_COLOR</code>: Can do color printing.</li>
<li><code>CUPS_PRINTER_DUPLEX</code>: Can do two-sided printing.</li>
<li><code>CUPS_PRINTER_STAPLE</code>: Can staple output.</li>
<li><code>CUPS_PRINTER_COLLATE</code>: Can quickly collate copies.</li>
<li><code>CUPS_PRINTER_PUNCH</code>: Can punch output.</li>
<li><code>CUPS_PRINTER_COVER</code>: Can cover output.</li>
<li><code>CUPS_PRINTER_BIND</code>: Can bind output.</li>
<li><code>CUPS_PRINTER_SORT</code>: Can sort output (mailboxes, etc.)</li>
<li><code>CUPS_PRINTER_SMALL</code>: Can print on Letter/Legal/A4-size media.</li>
<li><code>CUPS_PRINTER_MEDIUM</code>: Can print on Tabloid/B/C/A3/A2-size media.</li>
<li><code>CUPS_PRINTER_LARGE</code>: Can print on D/E/A1/A0-size media.</li>
<li><code>CUPS_PRINTER_VARIABLE</code>: Can print on rolls and custom-size media.</li>
</ul>
<p>The <code>cb</code> argument specifies a function to call for every destination that is found:</p>
<pre><code>typedef int (*cups_dest_cb_t)(void *user_data,
unsigned flags,
cups_dest_t *dest);
</code></pre>
<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>
<ul>
<li><code>CUPS_DEST_FLAGS_MORE</code>: There are more destinations coming.</li>
<li><code>CUPS_DEST_FLAGS_REMOVED</code>: The destination has gone away and should be removed from the list of destinations a user can select.</li>
<li><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.</li>
</ul>
<p>The callback function returns 0 to stop enumeration or 1 to continue.</p>
<blockquote>
<p>Note that 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>
</blockquote>
<p>The following example shows how to use <code>cupsEnumDests</code> to get a filtered array of destinations:</p>
<pre><code>typedef struct
{
int num_dests;
cups_dest_t *dests;
} my_user_data_t;
int
my_dest_cb(my_user_data_t *user_data, unsigned flags,
cups_dest_t *dest)
{
if (flags & CUPS_DEST_FLAGS_REMOVED)
{
/*
* Remove destination from array...
*/
user_data->num_dests =
cupsRemoveDest(dest->name, dest->instance,
user_data->num_dests,
&(user_data->dests));
}
else
{
/*
* Add destination to array...
*/
user_data->num_dests =
cupsCopyDest(dest, user_data->num_dests,
&(user_data->dests));
}
return (1);
}
int
my_get_dests(cups_ptype_t type, cups_ptype_t mask,
cups_dest_t **dests)
{
my_user_data_t user_data = { 0, NULL };
if (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, type,
mask, (cups_dest_cb_t)my_dest_cb,
&user_data))
{
/*
* An error occurred, free all of the destinations and
* return...
*/
cupsFreeDests(user_data.num_dests, user_dasta.dests);
*dests = NULL;
return (0);
}
/*
* Return the destination array...
*/
*dests = user_data.dests;
return (user_data.num_dests);
}
</code></pre>
<h3><a id="basic-destination-information">Basic Destination Information</a></h3>
<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>
<ul>
<li>"auth-info-required": The type of authentication required for printing to this destination: "none", "username,password", "domain,username,password", or "negotiate" (Kerberos).</li>
<li>"printer-info": The human-readable description of the destination such as "My Laser Printer".</li>
<li>"printer-is-accepting-jobs": "true" if the destination is accepting new jobs, "false" otherwise.</li>
<li>"printer-is-shared": "true" if the destination is being shared with other computers, "false" otherwise.</li>
<li>"printer-location": The human-readable location of the destination such as "Lab 4".</li>
<li>"printer-make-and-model": The human-readable make and model of the destination such as "ExampleCorp LaserPrinter 4000 Series".</li>
<li>"printer-state": "3" if the destination is idle, "4" if the destination is printing a job, and "5" if the destination is stopped.</li>
<li>"printer-state-change-time": The UNIX time when the destination entered the current state.</li>
<li>"printer-state-reasons": Additional comma-delimited state keywords for the destination such as "media-tray-empty-error" and "toner-low-warning".</li>
<li>"printer-type": The <code>cups_ptype_t</code> value associated with the destination.</li>
<li>"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.</li>
</ul>
<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>
<pre><code>const char *model = cupsGetOption("printer-make-and-model",
dest->num_options,
dest->options);
</code></pre>
<h3><a id="detailed-destination-information">Detailed Destination Information</a></h3>
<p>Once a destination has been chosen, the <code>cupsCopyDestInfo</code> function can be used to gather detailed information about the destination:</p>
<pre><code>cups_dinfo_t *
cupsCopyDestInfo(http_t *http, cups_dest_t *dest);
</code></pre>
<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>
<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>
<h4><a id="getting-supported-options-and-values">Getting Supported Options and Values</a></h4>
<p>The <code>cupsCheckDestSupported</code> function can be used to test whether a particular option or option and value is supported:</p>
<pre><code>int
cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
cups_dinfo_t *info,
const char *option,
const char *value);
</code></pre>
<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>
<ul>
<li><code>CUPS_COPIES</code>: Controls the number of copies that are produced.</li>
<li><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.</li>
<li><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>.</li>
<li><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>.</li>
<li><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>.</li>
<li><code>CUPS_NUMBER_UP</code>: Controls the number of document pages that are placed on each media side.</li>
<li><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>.</li>
<li><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>).</li>
<li><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>.</li>
<li><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>.</li>
</ul>
<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>
<p>The <code>cupsFindDestSupported</code> function returns the IPP attribute containing the supported values for a given option:</p>
<pre><code> ipp_attribute_t *
cupsFindDestSupported(http_t *http, cups_dest_t *dest,
cups_dinfo_t *dinfo,
const char *option);
</code></pre>
<p>For example, the following code prints the supported finishing processes for a destination, if any, to the standard output:</p>
<pre><code>cups_dinfo_t *info = cupsCopyDestInfo(CUPS_HTTP_DEFAULT,
dest);
if (cupsCheckDestSupported(CUPS_HTTP_DEFAULT, dest, info,
CUPS_FINISHINGS, NULL))
{
ipp_attribute_t *finishings =
cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
CUPS_FINISHINGS);
int i, count = ippGetCount(finishings);
puts("finishings supported:");
for (i = 0; i < count; i ++)
printf(" %d\n", ippGetInteger(finishings, i));
}
else
puts("finishings not supported.");
</code></pre>
<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>
<pre><code>ipp_attribute_t *attrs =
cupsFindDestSupported(CUPS_HTTP_DEFAULT, dest, info,
"job-creation-attributes");
int i, count = ippGetCount(attrs);
for (i = 0; i < count; i ++)
puts(ippGetString(attrs, i, NULL));
</code></pre>
<h4><a id="getting-default-values">Getting Default Values</a></h4>
<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>
<pre><code>ipp_attribute_t *
cupsFindDestDefault(http_t *http, cups_dest_t *dest,
cups_dinfo_t *dinfo,
const char *option);
</code></pre>
<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>
<pre><code>const char *def_value =
cupsGetOption(CUPS_FINISHINGS, dest->num_options,
dest->options);
ipp_attribute_t *def_attr =
cupsFindDestDefault(CUPS_HTTP_DEFAULT, dest, info,
CUPS_FINISHINGS);
if (def_value != NULL)
{
printf("Default finishings: %s\n", def_value);
}
else
{
int i, count = ippGetCount(def_attr);
printf("Default finishings: %d",
ippGetInteger(def_attr, 0));
for (i = 1; i < count; i ++)
printf(",%d", ippGetInteger(def_attr, i));
putchar('\n');
}
</code></pre>
<h4><a id="getting-ready-loaded-values">Getting Ready (Loaded) Values</a></h4>
<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>
<p>The <code>cupsFindDestReady</code> function finds the IPP attribute containing the ready values for a given option:</p>
<pre><code>ipp_attribute_t *
cupsFindDestReady(http_t *http, cups_dest_t *dest,
cups_dinfo_t *dinfo, const char *option);
</code></pre>
<p>For example, the following code lists the ready finishing processes:</p>
<pre><code>ipp_attribute_t *ready_finishings =
cupsFindDestReady(CUPS_HTTP_DEFAULT, dest, info,
CUPS_FINISHINGS);
if (ready_finishings != NULL)
{
int i, count = ippGetCount(ready_finishings);
puts("finishings ready:");
for (i = 0; i < count; i ++)
printf(" %d\n", ippGetInteger(ready_finishings, i));
}
else
puts("no finishings are ready.");
</code></pre>
<h4><a id="media-size-options">Media Size Options</a></h4>
<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>
<pre><code>typedef struct cups_size_s
{
char media[128];
int width, length;
int bottom, left, right, top;
} cups_size_t;
</code></pre>
<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>
<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>
<pre><code>int
cupsGetDestMediaByName(http_t *http, cups_dest_t *dest,
cups_dinfo_t *dinfo,
const char *media,
unsigned flags, cups_size_t *size);
int
cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest,
cups_dinfo_t *dinfo,
int width, int length,
unsigned flags, cups_size_t *size);
</code></pre>
<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>
<ul>
<li><code>CUPS_MEDIA_FLAGS_DEFAULT</code>: Find the closest size supported by the printer.</li>
<li><code>CUPS_MEDIA_FLAGS_BORDERLESS</code>: Find a borderless size.</li>
<li><code>CUPS_MEDIA_FLAGS_DUPLEX</code>: Find a size compatible with two-sided printing.</li>
<li><code>CUPS_MEDIA_FLAGS_EXACT</code>: Find an exact match for the size.</li>
<li><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.</li>
</ul>
<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>
<p>For example, the following code prints the margins for two-sided printing on US Letter media:</p>
<pre><code>cups_size_t size;
if (cupsGetDestMediaByName(CUPS_HTTP_DEFAULT, dest, info,
CUPS_MEDIA_LETTER,
CUPS_MEDIA_FLAGS_DUPLEX, &size))
{
puts("Margins for duplex US Letter:");
printf(" Bottom: %.2fin\n", size.bottom / 2540.0);
printf(" Left: %.2fin\n", size.left / 2540.0);
printf(" Right: %.2fin\n", size.right / 2540.0);
printf(" Top: %.2fin\n", size.top / 2540.0);
}
else
puts("Margins for duplex US Letter are not available.");
</code></pre>
<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>
<pre><code>int
cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest,
cups_dinfo_t *dinfo, int n,
unsigned flags, cups_size_t *size);
int
cupsGetDestMediaCount(http_t *http, cups_dest_t *dest,
cups_dinfo_t *dinfo, unsigned flags);
</code></pre>
<p>For example, the following code prints the list of ready media and corresponding margins:</p>
<pre><code>cups_size_t size;
int i;
int count = cupsGetDestMediaCount(CUPS_HTTP_DEFAULT,
dest, info,
CUPS_MEDIA_FLAGS_READY);
for (i = 0; i < count; i ++)
{
if (cupsGetDestMediaByIndex(CUPS_HTTP_DEFAULT, dest, info,
i, CUPS_MEDIA_FLAGS_READY,
&size))
{
printf("%s:\n", size.name);
printf(" Width: %.2fin\n", size.width / 2540.0);
printf(" Length: %.2fin\n", size.length / 2540.0);
printf(" Bottom: %.2fin\n", size.bottom / 2540.0);
printf(" Left: %.2fin\n", size.left / 2540.0);
printf(" Right: %.2fin\n", size.right / 2540.0);
printf(" Top: %.2fin\n", size.top / 2540.0);
}
}
</code></pre>
<p>Finally, the <code>cupsGetDestMediaDefault</code> function returns the default media size:</p>
<pre><code>int
cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
cups_dinfo_t *dinfo, unsigned flags,
cups_size_t *size);
</code></pre>
<h4><a id="localizing-options-and-values">Localizing Options and Values</a></h4>
<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>
<pre><code>const char *
cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest,
cups_dinfo_t *info, unsigned flags,
cups_size_t *size);
const char *
cupsLocalizeDestOption(http_t *http, cups_dest_t *dest,
cups_dinfo_t *info,
const char *option);
const char *
cupsLocalizeDestValue(http_t *http, cups_dest_t *dest,
cups_dinfo_t *info,
const char *option, const char *value);
</code></pre>
<h3><a id="submitting-a-print-job">Submitting a Print Job</a></h3>
<p>Once you are ready to submit a print job, you create a job using the <code>cupsCreateDestJob</code> function:</p>
<pre><code>ipp_status_t
cupsCreateDestJob(http_t *http, cups_dest_t *dest,
cups_dinfo_t *info, int *job_id,
const char *title, int num_options,
cups_option_t *options);
</code></pre>
<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>
<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>
<p>For example, the following code creates a new job that will print 42 copies of a two-sided US Letter document:</p>
<pre><code>int job_id = 0;
int num_options = 0;
cups_option_t *options = NULL;
num_options = cupsAddOption(CUPS_COPIES, "42",
num_options, &options);
num_options = cupsAddOption(CUPS_MEDIA, CUPS_MEDIA_LETTER,
num_options, &options);
num_options = cupsAddOption(CUPS_SIDES,
CUPS_SIDES_TWO_SIDED_PORTRAIT,
num_options, &options);
if (cupsCreateDestJob(CUPS_HTTP_DEFAULT, dest, info,
&job_id, "My Document", num_options,
options) == IPP_STATUS_OK)
printf("Created job: %d\n", job_id);
else
printf("Unable to create job: %s\n",
cupsLastErrorString());
</code></pre>
<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>
<pre><code>http_status_t
cupsStartDestDocument(http_t *http, cups_dest_t *dest,
cups_dinfo_t *info, int job_id,
const char *docname,
const char *format,
int num_options,
cups_option_t *options,
int last_document);
http_status_t
cupsWriteRequestData(http_t *http, const char *buffer,
size_t length);
ipp_status_t
cupsFinishDestDocument(http_t *http, cups_dest_t *dest,
cups_dinfo_t *info);
</code></pre>
<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>
<ul>
<li><code>CUPS_FORMAT_JPEG</code>: "image/jpeg"</li>
<li><code>CUPS_FORMAT_PDF</code>: "application/pdf"</li>
<li><code>CUPS_FORMAT_POSTSCRIPT</code>: "application/postscript"</li>
<li><code>CUPS_FORMAT_TEXT</code>: "text/plain"</li>
</ul>
<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>
<p>For example, the following code submits a PDF file to the job that was just created:</p>
<pre><code>FILE *fp = fopen("filename.pdf", "rb");
size_t bytes;
char buffer[65536];
if (cupsStartDestDocument(CUPS_HTTP_DEFAULT, dest, info,
job_id, "filename.pdf", 0, NULL,
1) == HTTP_STATUS_CONTINUE)
{
while ((bytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
if (cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer,
bytes) != HTTP_STATUS_CONTINUE)
break;
if (cupsFinishDestDocument(CUPS_HTTP_DEFAULT, dest,
info) == IPP_STATUS_OK)
puts("Document send succeeded.");
else
printf("Document send failed: %s\n",
cupsLastErrorString());
}
fclose(fp);
</code></pre>
<h2><a id="sending-ipp-requests">Sending IPP Requests</a></h2>
<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>
<h3><a id="connecting-to-the-scheduler-or-printer">Connecting to the Scheduler or Printer</a></h3>
<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>
<pre><code>http_t *
cupsConnectDest(cups_dest_t *dest, unsigned flags, int msec,
int *cancel, char *resource,
size_t resourcesize, cups_dest_cb_t cb,
void *user_data);
</code></pre>
<p>The <code>dest</code> argument specifies the destination to connect to.</p>
<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>
<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>
<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>
<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>
<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>
<p>On success, a HTTP connection is returned that can be used to send IPP requests and get IPP responses.</p>
<p>For example, the following code connects to the printer associated with a destination with a 30 second timeout:</p>
<pre><code>char resource[256];
http_t *http = cupsConnectDest(dest, CUPS_DEST_FLAGS_DEVICE,
30000, NULL, resource,
sizeof(resource), NULL, NULL);
</code></pre>
<h3><a id="creating-an-ipp-request">Creating an IPP Request</a></h3>
<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>
<p>The <code>ippNewRequest</code> function creates a new IPP request:</p>
<pre><code>ipp_t *
ippNewRequest(ipp_op_t op);
</code></pre>
<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>
<pre><code>ipp_t *request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
</code></pre>
<p>The request identifier is automatically set to a unique value for the current process.</p>
<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>
<pre><code>const char *printer_uri = cupsGetOption("device-uri",
dest->num_options,
dest->options);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, printer_uri);
</code></pre>
<blockquote>
<p>Note: 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>
</blockquote>
<p>The <code>ippAddString</code> function adds the "printer-uri" attribute the 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>
<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>
<pre><code>static const char * const requested_attributes[] =
{
"printer-state",
"printer-state-message",
"printer-state-reasons"
};
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes", 3, NULL,
requested_attributes);
</code></pre>
<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>
<p>CUPS provides many functions to adding attributes of different types:</p>
<ul>
<li><code>ippAddBoolean</code> adds a boolean (<code>IPP_TAG_BOOLEAN</code>) attribute with one value.</li>
<li><code>ippAddInteger</code> adds an enum (<code>IPP_TAG_ENUM</code>) or integer (<code>IPP_TAG_INTEGER</code>) attribute with one value.</li>
<li><code>ippAddIntegers</code> adds an enum or integer attribute with one or more values.</li>
<li><code>ippAddOctetString</code> adds an octetString attribute with one value.</li>
<li><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.</li>
<li><code>ippAddRange</code> adds a rangeOfInteger attribute with one range.</li>
<li><code>ippAddRanges</code> adds a rangeOfInteger attribute with one or more ranges.</li>
<li><code>ippAddResolution</code> adds a resolution attribute with one resolution.</li>
<li><code>ippAddResolutions</code> adds a resolution attribute with one or more resolutions.</li>
<li><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.</li>
<li><code>ippAddStrings</code> adds a charset, keyword, mimeMediaType, name, naturalLanguage, text, uri, or uriScheme attribute with one or more values.</li>
</ul>
<h3><a id="sending-the-ipp-request">Sending the IPP Request</a></h3>
<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>
<pre><code>ipp_t *response = cupsDoRequest(http, request, resource);
</code></pre>
<p>For requests like Send-Document that include a file, the <code>cupsDoFileRequest</code> function should be used:</p>
<pre><code>ipp_t *response = cupsDoFileRequest(http, request, resource,
filename);
</code></pre>
<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>
<p>The status from the most recent request can be queried using the <code>cupsLastError</code> function, for example:</p>
<pre><code>if (cupsLastError() >= IPP_STATUS_ERROR_BAD_REQUEST)
{
/* request failed */
}
</code></pre>
<p>A human-readable error message is also available using the <code>cupsLastErrorString</code> function:</p>
<pre><code>if (cupsLastError() >= IPP_STATUS_ERROR_BAD_REQUEST)
{
/* request failed */
printf("Request failed: %s\n", cupsLastErrorString());
}
</code></pre>
<h3><a id="processing-the-ipp-response">Processing the IPP Response</a></h3>
<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>
<p>For example, the following code finds the printer state attributes and prints their values:</p>
<pre><code>ipp_attribute_t *attr;
if ((attr = ippFindAttribute(response, "printer-state",
IPP_TAG_ENUM)) != NULL)
{
printf("printer-state=%s\n",
ippEnumString("printer-state", ippGetInteger(attr, 0)));
}
else
puts("printer-state=unknown");
if ((attr = ippFindAttribute(response, "printer-state-message",
IPP_TAG_TEXT)) != NULL)
{
printf("printer-state-message=\"%s\"\n",
ippGetString(attr, 0, NULL)));
}
if ((attr = ippFindAttribute(response, "printer-state-reasons",
IPP_TAG_KEYWORD)) != NULL)
{
int i, count = ippGetCount(attr);
puts("printer-state-reasons=");
for (i = 0; i < count; i ++)
printf(" %s\n", ippGetString(attr, i, NULL)));
}
</code></pre>
<p>The <code>ippGetCount</code> function returns the number of values in an attribute.</p>
<p>The <code>ippGetInteger</code> and <code>ippGetString</code> functions return a single integer or string value from an attribute.</p>
<p>The <code>ippEnumString</code> function converts a enum value to its keyword (string) equivalent.</p>
<p>Once you are done using the IPP response message, free it using the <code>ippDelete</code> function:</p>
<pre><code>ippDelete(response);
</code></pre>
<h3><a id="authentication">Authentication</a></h3>
<p>CUPS normally handles authentication through the console. GUI applications should set a password callback using the <code>cupsSetPasswordCB2</code> function:</p>
<pre><code>void
cupsSetPasswordCB2(cups_password_cb2_t cb, void *user_data);
</code></pre>
<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>
<pre><code>const char *
cups_password_cb2(const char *prompt, http_t *http,
const char *method, const char *resource,
void *user_data);
</code></pre>
<p>The <code>prompt</code> argument is a string from CUPS that should be displayed to the user.</p>
<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>
<p>The <code>method</code> argument specifies the HTTP method used for the request and is typically "POST".</p>
<p>The <code>resource</code> argument specifies the path used for the request.</p>
<p>The <code>user_data</code> argument provides the user data pointer from the <code>cupsSetPasswordCB2</code> call.</p>
<h2 class="title"><a id="FUNCTIONS">Functions</a></h2>
<h3 class="function"><a id="cupsAddDest">cupsAddDest</a></h3>
<p class="description">Add a destination to the list of destinations.</p>
<p class="code">
int cupsAddDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Destination name</td></tr>
<tr><th>instance</th>
<td class="description">Instance name or <code>NULL</code> for none/primary</td></tr>
<tr><th>num_dests</th>
<td class="description">Number of destinations</td></tr>
<tr><th>dests</th>
<td class="description">Destinations</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New number of destinations</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function cannot be used to add a new class or printer queue,
it only adds a new container of saved options for the named
destination or instance.<br>
<br>
If the named destination already exists, the destination list is
returned unchanged. Adding a new instance of a destination creates
a copy of that destination's options.<br>
<br>
Use the <a href="#cupsSaveDests"><code>cupsSaveDests</code></a> function to save the updated list of
destinations to the user's lpoptions file.</p>
<h3 class="function"><span class="info"> CUPS 2.2.4/macOS 10.13 </span><a id="cupsAddIntegerOption">cupsAddIntegerOption</a></h3>
<p class="description">Add an integer option to an option array.</p>
<p class="code">
int cupsAddIntegerOption(const char *name, int value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Name of option</td></tr>
<tr><th>value</th>
<td class="description">Value of option</td></tr>
<tr><th>num_options</th>
<td class="description">Number of options</td></tr>
<tr><th>options</th>
<td class="description">Pointer to options</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of options</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">New option arrays can be initialized simply by passing 0 for the
"num_options" parameter.
</p>
<h3 class="function"><a id="cupsAddOption">cupsAddOption</a></h3>
<p class="description">Add an option to an option array.</p>
<p class="code">
int cupsAddOption(const char *name, const char *value, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Name of option</td></tr>
<tr><th>value</th>
<td class="description">Value of option</td></tr>
<tr><th>num_options</th>
<td class="description">Number of options</td></tr>
<tr><th>options</th>
<td class="description">Pointer to options</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of options</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">New option arrays can be initialized simply by passing 0 for the
"num_options" parameter.</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCancelDestJob">cupsCancelDestJob</a></h3>
<p class="description">Cancel a job on a destination.</p>
<p class="code">
ipp_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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>job_id</th>
<td class="description">Job ID</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of cancel operation</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The "job_id" is the number returned by cupsCreateDestJob.<br>
<br>
Returns <code>IPP_STATUS_OK</code> on success and
<code>IPP_STATUS_ERROR_NOT_AUTHORIZED</code> or
<code>IPP_STATUS_ERROR_FORBIDDEN</code> on failure.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCheckDestSupported">cupsCheckDestSupported</a></h3>
<p class="description">Check that the option and value are supported
by the destination.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>option</th>
<td class="description">Option</td></tr>
<tr><th>value</th>
<td class="description">Value or <code>NULL</code></td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 if supported, 0 otherwise</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Returns 1 if supported, 0 otherwise.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCloseDestJob">cupsCloseDestJob</a></h3>
<p class="description">Close a job and start printing.</p>
<p class="code">
ipp_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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>info</th>
<td class="description">Destination information</td></tr>
<tr><th>job_id</th>
<td class="description">Job ID</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP status code</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Use when the last call to cupsStartDocument passed 0 for "last_document".
"job_id" is the job ID returned by cupsCreateDestJob. Returns <code>IPP_STATUS_OK</code>
on success.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsConnectDest">cupsConnectDest</a></h3>
<p class="description">Open a conection to the destination.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>flags</th>
<td class="description">Connection flags</td></tr>
<tr><th>msec</th>
<td class="description">Timeout in milliseconds</td></tr>
<tr><th>cancel</th>
<td class="description">Pointer to "cancel" variable</td></tr>
<tr><th>resource</th>
<td class="description">Resource buffer</td></tr>
<tr><th>resourcesize</th>
<td class="description">Size of resource buffer</td></tr>
<tr><th>cb</th>
<td class="description">Callback function</td></tr>
<tr><th>user_data</th>
<td class="description">User data pointer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Connection to destination or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Connect to the destination, returning a new <code>http_t</code> connection object
and optionally the resource path to use for the destination. These calls
will block until a connection is made, the timeout expires, the integer
pointed to by "cancel" is non-zero, or the callback function (or block)
returns 0. The caller is responsible for calling <a href="#httpClose"><code>httpClose</code></a> on the
returned connection.<br>
<br>
Starting with CUPS 2.2.4, the caller can pass <code>CUPS_DEST_FLAGS_DEVICE</code>
for the "flags" argument to connect directly to the device associated with
the destination. Otherwise, the connection is made to the CUPS scheduler
associated with the destination.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCopyDest">cupsCopyDest</a></h3>
<p class="description">Copy a destination.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dest</th>
<td class="description">Destination to copy</td></tr>
<tr><th>num_dests</th>
<td class="description">Number of destinations</td></tr>
<tr><th>dests</th>
<td class="description">Destination array</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New number of destinations</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Make a copy of the destination to an array of destinations (or just a single
copy) - for use with the cupsEnumDests* functions. The caller is responsible
for calling cupsFreeDests() on the returned object(s).
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCopyDestConflicts">cupsCopyDestConflicts</a></h3>
<p class="description">Get conflicts and resolutions for a new
option/value pair.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>num_options</th>
<td class="description">Number of current options</td></tr>
<tr><th>options</th>
<td class="description">Current options</td></tr>
<tr><th>new_option</th>
<td class="description">New option</td></tr>
<tr><th>new_value</th>
<td class="description">New value</td></tr>
<tr><th>num_conflicts</th>
<td class="description">Number of conflicting options</td></tr>
<tr><th>conflicts</th>
<td class="description">Conflicting options</td></tr>
<tr><th>num_resolved</th>
<td class="description">Number of options to resolve</td></tr>
<tr><th>resolved</th>
<td class="description">Resolved options</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 if there is a conflict, 0 if none, -1 on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">"num_options" and "options" represent the currently selected options by the
user. "new_option" and "new_value" are the setting the user has just
changed.<br>
<br>
Returns 1 if there is a conflict, 0 if there are no conflicts, and -1 if
there was an unrecoverable error such as a resolver loop.<br>
<br>
If "num_conflicts" and "conflicts" are not <code>NULL</code>, they are set to
contain the list of conflicting option/value pairs. Similarly, if
"num_resolved" and "resolved" are not <code>NULL</code> they will be set to the
list of changes needed to resolve the conflict.<br>
<br>
If cupsCopyDestConflicts returns 1 but "num_resolved" and "resolved" are set
to 0 and <code>NULL</code>, respectively, then the conflict cannot be resolved.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCopyDestInfo">cupsCopyDestInfo</a></h3>
<p class="description">Get the supported values/capabilities for the
destination.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Destination information</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The caller is responsible for calling <a href="#cupsFreeDestInfo"><code>cupsFreeDestInfo</code></a> on the return
value. <code>NULL</code> is returned on error.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsCreateDestJob">cupsCreateDestJob</a></h3>
<p class="description">Create a job on a destination.</p>
<p class="code">
ipp_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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>info</th>
<td class="description">Destination information</td></tr>
<tr><th>job_id</th>
<td class="description">Job ID or 0 on error</td></tr>
<tr><th>title</th>
<td class="description">Job name</td></tr>
<tr><th>num_options</th>
<td class="description">Number of job options</td></tr>
<tr><th>options</th>
<td class="description">Job options</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP status code</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success, saving the job ID
in the variable pointed to by "job_id".
</p>
<h3 class="function"><span class="info"> CUPS 1.1.20/macOS 10.4 </span><a id="cupsDoAuthentication">cupsDoAuthentication</a></h3>
<p class="description">Authenticate a request.</p>
<p class="code">
int cupsDoAuthentication(<a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>method</th>
<td class="description">Request method ("GET", "POST", "PUT")</td></tr>
<tr><th>resource</th>
<td class="description">Resource path</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">0 on success, -1 on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function should be called in response to a <code>HTTP_STATUS_UNAUTHORIZED</code>
status, prior to resubmitting your request.
</p>
<h3 class="function"><a id="cupsEncodeOptions">cupsEncodeOptions</a></h3>
<p class="description">Encode printer options into IPP attributes.</p>
<p class="code">
void cupsEncodeOptions(<a href="#ipp_t">ipp_t</a> *ipp, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">Request to add to</td></tr>
<tr><th>num_options</th>
<td class="description">Number of options</td></tr>
<tr><th>options</th>
<td class="description">Options</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function adds operation, job, and then subscription attributes,
in that order. Use the <a href="#cupsEncodeOptions2"><code>cupsEncodeOptions2</code></a> function to add attributes
for a single group.</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsEncodeOptions2">cupsEncodeOptions2</a></h3>
<p class="description">Encode printer options into IPP attributes for a group.</p>
<p class="code">
void 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">Request to add to</td></tr>
<tr><th>num_options</th>
<td class="description">Number of options</td></tr>
<tr><th>options</th>
<td class="description">Options</td></tr>
<tr><th>group_tag</th>
<td class="description">Group to encode</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function only adds attributes for a single group. Call this
function multiple times for each group, or use <a href="#cupsEncodeOptions"><code>cupsEncodeOptions</code></a>
to add the standard groups.
</p>
<h3 class="function"><a id="cupsEncryption">cupsEncryption</a></h3>
<p class="description">Get the current encryption settings.</p>
<p class="code">
<a href="#http_encryption_t">http_encryption_t</a> cupsEncryption(void);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Encryption settings</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
environment variable, then the ~/.cups/client.conf file, and finally the
/etc/cups/client.conf file. If not set, the default is
<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
<br>
Note: The current encryption setting is tracked separately for each thread
in a program. Multi-threaded programs that override the setting via the
<a href="#cupsSetEncryption"><code>cupsSetEncryption</code></a> function need to do so in each thread for the same
setting to be used.</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsEnumDests">cupsEnumDests</a></h3>
<p class="description">Enumerate available destinations with a callback function.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>flags</th>
<td class="description">Enumeration flags</td></tr>
<tr><th>msec</th>
<td class="description">Timeout in milliseconds, -1 for indefinite</td></tr>
<tr><th>cancel</th>
<td class="description">Pointer to "cancel" variable</td></tr>
<tr><th>type</th>
<td class="description">Printer type bits</td></tr>
<tr><th>mask</th>
<td class="description">Mask for printer type bits</td></tr>
<tr><th>cb</th>
<td class="description">Callback function</td></tr>
<tr><th>user_data</th>
<td class="description">User data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Destinations are enumerated from one or more sources. The callback function
receives the <code>user_data</code> pointer and the destination pointer which can
be used as input to the <a href="#cupsCopyDest"><code>cupsCopyDest</code></a> function. The function must
return 1 to continue enumeration or 0 to stop.<br>
<br>
The <code>type</code> and <code>mask</code> arguments allow the caller to filter the
destinations that are enumerated. Passing 0 for both will enumerate all
printers. The constant <code>CUPS_PRINTER_DISCOVERED</code> is used to filter on
destinations that are available but have not yet been added locally.<br>
<br>
Enumeration happens on the current thread and does not return until all
destinations have been enumerated or the callback function returns 0.<br>
<br>
Note: The callback function will likely receive multiple updates for the same
destinations - it is up to the caller to suppress any duplicate destinations.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsFindDestDefault">cupsFindDestDefault</a></h3>
<p class="description">Find the default value(s) for the given option.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>option</th>
<td class="description">Option/attribute name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Default attribute or <code>NULL</code> for none</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
functions to inspect the default value(s) as needed.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsFindDestReady">cupsFindDestReady</a></h3>
<p class="description">Find the default value(s) for the given option.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>option</th>
<td class="description">Option/attribute name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Default attribute or <code>NULL</code> for none</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
functions to inspect the default value(s) as needed.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsFindDestSupported">cupsFindDestSupported</a></h3>
<p class="description">Find the default value(s) for the given option.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>option</th>
<td class="description">Option/attribute name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Default attribute or <code>NULL</code> for none</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned value is an IPP attribute. Use the <code>ippGetBoolean</code>,
<code>ippGetCollection</code>, <code>ippGetCount</code>, <code>ippGetDate</code>,
<code>ippGetInteger</code>, <code>ippGetOctetString</code>, <code>ippGetRange</code>,
<code>ippGetResolution</code>, <code>ippGetString</code>, and <code>ippGetValueTag</code>
functions to inspect the default value(s) as needed.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsFinishDestDocument">cupsFinishDestDocument</a></h3>
<p class="description">Finish the current document.</p>
<p class="code">
ipp_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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>info</th>
<td class="description">Destination information</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of document submission</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Returns <code>IPP_STATUS_OK</code> or <code>IPP_STATUS_OK_SUBST</code> on success.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsFreeDestInfo">cupsFreeDestInfo</a></h3>
<p class="description">Free destination information obtained using
<a href="#cupsCopyDestInfo"><code>cupsCopyDestInfo</code></a>.</p>
<p class="code">
void cupsFreeDestInfo(<a href="#cups_dinfo_t">cups_dinfo_t</a> *dinfo);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsFreeDests">cupsFreeDests</a></h3>
<p class="description">Free the memory used by the list of destinations.</p>
<p class="code">
void cupsFreeDests(int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>num_dests</th>
<td class="description">Number of destinations</td></tr>
<tr><th>dests</th>
<td class="description">Destinations</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsFreeJobs">cupsFreeJobs</a></h3>
<p class="description">Free memory used by job data.</p>
<p class="code">
void cupsFreeJobs(int num_jobs, <a href="#cups_job_t">cups_job_t</a> *jobs);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>num_jobs</th>
<td class="description">Number of jobs</td></tr>
<tr><th>jobs</th>
<td class="description">Jobs</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsFreeOptions">cupsFreeOptions</a></h3>
<p class="description">Free all memory used by options.</p>
<p class="code">
void cupsFreeOptions(int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>num_options</th>
<td class="description">Number of options</td></tr>
<tr><th>options</th>
<td class="description">Pointer to options</td></tr>
</tbody></table>
<h3 class="function"><a id="cupsGetDest">cupsGetDest</a></h3>
<p class="description">Get the named destination from the list.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Destination name or <code>NULL</code> for the default destination</td></tr>
<tr><th>instance</th>
<td class="description">Instance name or <code>NULL</code></td></tr>
<tr><th>num_dests</th>
<td class="description">Number of destinations</td></tr>
<tr><th>dests</th>
<td class="description">Destinations</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Destination pointer or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Use the <a href="#cupsEnumDests"><code>cupsEnumDests</code></a> or <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> functions to get a
list of supported destinations for the current user.</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsGetDestMediaByIndex">cupsGetDestMediaByIndex</a></h3>
<p class="description">Get a media name, dimension, and margins for a
specific size.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>n</th>
<td class="description">Media size number (0-based)</td></tr>
<tr><th>flags</th>
<td class="description">Media flags</td></tr>
<tr><th>size</th>
<td class="description">Media size information</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>flags</code> parameter determines which set of media are indexed. For
example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will get the Nth
borderless size supported by the printer.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsGetDestMediaByName">cupsGetDestMediaByName</a></h3>
<p class="description">Get media names, dimensions, and margins.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>media</th>
<td class="description">Media name</td></tr>
<tr><th>flags</th>
<td class="description">Media matching flags</td></tr>
<tr><th>size</th>
<td class="description">Media size information</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on match, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The "media" string is a PWG media name. "Flags" provides some matching
guidance (multiple flags can be combined):<br>
<br>
CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
size amongst the "ready" media.<br>
<br>
The matching result (if any) is returned in the "cups_size_t" structure.<br>
<br>
Returns 1 when there is a match and 0 if there is not a match.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsGetDestMediaBySize">cupsGetDestMediaBySize</a></h3>
<p class="description">Get media names, dimensions, and margins.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>width</th>
<td class="description">Media width in hundredths of
of millimeters</td></tr>
<tr><th>length</th>
<td class="description">Media length in hundredths of
of millimeters</td></tr>
<tr><th>flags</th>
<td class="description">Media matching flags</td></tr>
<tr><th>size</th>
<td class="description">Media size information</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on match, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">"Width" and "length" are the dimensions in hundredths of millimeters.
"Flags" provides some matching guidance (multiple flags can be combined):<br>
<br>
CUPS_MEDIA_FLAGS_DEFAULT = find the closest size supported by the printer,
CUPS_MEDIA_FLAGS_BORDERLESS = find a borderless size,
CUPS_MEDIA_FLAGS_DUPLEX = find a size compatible with 2-sided printing,
CUPS_MEDIA_FLAGS_EXACT = find an exact match for the size, and
CUPS_MEDIA_FLAGS_READY = if the printer supports media sensing, find the
size amongst the "ready" media.<br>
<br>
The matching result (if any) is returned in the "cups_size_t" structure.<br>
<br>
Returns 1 when there is a match and 0 if there is not a match.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsGetDestMediaCount">cupsGetDestMediaCount</a></h3>
<p class="description">Get the number of sizes supported by a
destination.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>flags</th>
<td class="description">Media flags</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of sizes</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>flags</code> parameter determines the set of media sizes that are
counted. For example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return
the number of borderless sizes.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsGetDestMediaDefault">cupsGetDestMediaDefault</a></h3>
<p class="description">Get the default size for a destination.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>flags</th>
<td class="description">Media flags</td></tr>
<tr><th>size</th>
<td class="description">Media size information</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>flags</code> parameter determines which default size is returned. For
example, passing <code>CUPS_MEDIA_FLAGS_BORDERLESS</code> will return the default
borderless size, typically US Letter or A4, but sometimes 4x6 photo media.
</p>
<h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="cupsGetDestWithURI">cupsGetDestWithURI</a></h3>
<p class="description">Get a destination associated with a URI.</p>
<p class="code">
<a href="#cups_dest_t">cups_dest_t</a> *cupsGetDestWithURI(const char *name, const char *uri);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Desired printer name or <code>NULL</code></td></tr>
<tr><th>uri</th>
<td class="description">URI for the printer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Destination or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">"name" is the desired name for the printer. If <code>NULL</code>, a name will be
created using the URI.<br>
<br>
"uri" is the "ipp" or "ipps" URI for the printer.
</p>
<h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsGetDests2">cupsGetDests2</a></h3>
<p class="description">Get the list of destinations from the specified server.</p>
<p class="code">
int cupsGetDests2(<a href="#http_t">http_t</a> *http, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>dests</th>
<td class="description">Destinations</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of destinations</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Starting with CUPS 1.2, the returned list of destinations include the
"printer-info", "printer-is-accepting-jobs", "printer-is-shared",
"printer-make-and-model", "printer-state", "printer-state-change-time",
"printer-state-reasons", "printer-type", and "printer-uri-supported"
attributes as options.<br>
<br>
CUPS 1.4 adds the "marker-change-time", "marker-colors",
"marker-high-levels", "marker-levels", "marker-low-levels", "marker-message",
"marker-names", "marker-types", and "printer-commands" attributes as options.<br>
<br>
CUPS 2.2 adds accessible IPP printers to the list of destinations that can
be used. The "printer-uri-supported" option will be present for those IPP
printers that have been recently used.<br>
<br>
Use the <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> function to free the destination list and
the <a href="#cupsGetDest"><code>cupsGetDest</code></a> function to find a particular destination.
</p>
<h3 class="function"><span class="info"> CUPS 2.2.4/macOS 10.13 </span><a id="cupsGetIntegerOption">cupsGetIntegerOption</a></h3>
<p class="description">Get an integer option value.</p>
<p class="code">
int cupsGetIntegerOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Name of option</td></tr>
<tr><th>num_options</th>
<td class="description">Number of options</td></tr>
<tr><th>options</th>
<td class="description">Options</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Option value or <code>INT_MIN</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">INT_MIN is returned when the option does not exist, is not an integer, or
exceeds the range of values for the "int" type.
</p>
<h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsGetJobs2">cupsGetJobs2</a></h3>
<p class="description">Get the jobs from the specified server.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>jobs</th>
<td class="description">Job data</td></tr>
<tr><th>name</th>
<td class="description"><code>NULL</code> = all destinations, otherwise show jobs for named destination</td></tr>
<tr><th>myjobs</th>
<td class="description">0 = all users, 1 = mine</td></tr>
<tr><th>whichjobs</th>
<td class="description"><code>CUPS_WHICHJOBS_ALL</code>, <code>CUPS_WHICHJOBS_ACTIVE</code>, or <code>CUPS_WHICHJOBS_COMPLETED</code></td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of jobs</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">A "whichjobs" value of <code>CUPS_WHICHJOBS_ALL</code> returns all jobs regardless
of state, while <code>CUPS_WHICHJOBS_ACTIVE</code> returns jobs that are
pending, processing, or held and <code>CUPS_WHICHJOBS_COMPLETED</code> returns
jobs that are stopped, canceled, aborted, or completed.
</p>
<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsGetNamedDest">cupsGetNamedDest</a></h3>
<p class="description">Get options for the named destination.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>name</th>
<td class="description">Destination name or <code>NULL</code> for the default destination</td></tr>
<tr><th>instance</th>
<td class="description">Instance name or <code>NULL</code></td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Destination or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function is optimized for retrieving a single destination and should
be used instead of <a href="#cupsGetDests2"><code>cupsGetDests2</code></a> and <a href="#cupsGetDest"><code>cupsGetDest</code></a> when you
either know the name of the destination or want to print to the default
destination. If <code>NULL</code> is returned, the destination does not exist or
there is no default destination.<br>
<br>
If "http" is <code>CUPS_HTTP_DEFAULT</code>, the connection to the default print
server will be used.<br>
<br>
If "name" is <code>NULL</code>, the default printer for the current user will be
returned.<br>
<br>
The returned destination must be freed using <a href="#cupsFreeDests"><code>cupsFreeDests</code></a> with a
"num_dests" value of 1.
</p>
<h3 class="function"><a id="cupsGetOption">cupsGetOption</a></h3>
<p class="description">Get an option value.</p>
<p class="code">
const char *cupsGetOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> *options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Name of option</td></tr>
<tr><th>num_options</th>
<td class="description">Number of options</td></tr>
<tr><th>options</th>
<td class="description">Options</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Option value or <code>NULL</code></p>
<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsGetPassword2">cupsGetPassword2</a></h3>
<p class="description">Get a password from the user using the current
password callback.</p>
<p class="code">
const char *cupsGetPassword2(const char *prompt, <a href="#http_t">http_t</a> *http, const char *method, const char *resource);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>prompt</th>
<td class="description">Prompt string</td></tr>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>method</th>
<td class="description">Request method ("GET", "POST", "PUT")</td></tr>
<tr><th>resource</th>
<td class="description">Resource path</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Password</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Uses the current password callback function. Returns <code>NULL</code> if the
user does not provide a password.<br>
<br>
Note: The current password callback function is tracked separately for each
thread in a program. Multi-threaded programs that override the setting via
the <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a> function need to do so in each thread for the
same function to be used.
</p>
<h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="cupsLocalizeDestMedia">cupsLocalizeDestMedia</a></h3>
<p class="description">Get the localized string for a destination media
size.</p>
<p class="code">
const 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>flags</th>
<td class="description">Media flags</td></tr>
<tr><th>size</th>
<td class="description">Media size</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Localized string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned string is stored in the destination information and will become
invalid if the destination information is deleted.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsLocalizeDestOption">cupsLocalizeDestOption</a></h3>
<p class="description">Get the localized string for a destination
option.</p>
<p class="code">
const 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>option</th>
<td class="description">Option to localize</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Localized string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned string is stored in the destination information and will become
invalid if the destination information is deleted.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsLocalizeDestValue">cupsLocalizeDestValue</a></h3>
<p class="description">Get the localized string for a destination
option+value pair.</p>
<p class="code">
const 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>dinfo</th>
<td class="description">Destination information</td></tr>
<tr><th>option</th>
<td class="description">Option to localize</td></tr>
<tr><th>value</th>
<td class="description">Value to localize</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Localized string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned string is stored in the destination information and will become
invalid if the destination information is deleted.
</p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="cupsMakeServerCredentials">cupsMakeServerCredentials</a></h3>
<p class="description">Make a self-signed certificate and private key pair.</p>
<p class="code">
int cupsMakeServerCredentials(const char *path, const char *common_name, int num_alt_names, const char **alt_names, time_t expiration_date);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>path</th>
<td class="description">Keychain path or <code>NULL</code> for default</td></tr>
<tr><th>common_name</th>
<td class="description">Common name</td></tr>
<tr><th>num_alt_names</th>
<td class="description">Number of subject alternate names</td></tr>
<tr><th>alt_names</th>
<td class="description">Subject Alternate Names</td></tr>
<tr><th>expiration_date</th>
<td class="description">Expiration date</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h3 class="function"><a id="cupsParseOptions">cupsParseOptions</a></h3>
<p class="description">Parse options from a command-line argument.</p>
<p class="code">
int cupsParseOptions(const char *arg, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>arg</th>
<td class="description">Argument to parse</td></tr>
<tr><th>num_options</th>
<td class="description">Number of options</td></tr>
<tr><th>options</th>
<td class="description">Options found</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of options found</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function converts space-delimited name/value pairs according
to the PAPI text option ABNF specification. Collection values
("name={a=... b=... c=...}") are stored with the curley brackets
intact - use <code>cupsParseOptions</code> on the value to extract the
collection attributes.</p>
<h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="cupsRemoveDest">cupsRemoveDest</a></h3>
<p class="description">Remove a destination from the destination list.</p>
<p class="code">
int cupsRemoveDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> **dests);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Destination name</td></tr>
<tr><th>instance</th>
<td class="description">Instance name or <code>NULL</code></td></tr>
<tr><th>num_dests</th>
<td class="description">Number of destinations</td></tr>
<tr><th>dests</th>
<td class="description">Destinations</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New number of destinations</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Removing a destination/instance does not delete the class or printer
queue, merely the lpoptions for that destination/instance. Use the
<a href="#cupsSetDests"><code>cupsSetDests</code></a> or <a href="#cupsSetDests2"><code>cupsSetDests2</code></a> functions to save the new
options for the user.
</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="cupsRemoveOption">cupsRemoveOption</a></h3>
<p class="description">Remove an option from an option array.</p>
<p class="code">
int cupsRemoveOption(const char *name, int num_options, <a href="#cups_option_t">cups_option_t</a> **options);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Option name</td></tr>
<tr><th>num_options</th>
<td class="description">Current number of options</td></tr>
<tr><th>options</th>
<td class="description">Options</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New number of options</p>
<h3 class="function"><a id="cupsServer">cupsServer</a></h3>
<p class="description">Return the hostname/address of the current server.</p>
<p class="code">
const char *cupsServer(void);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Server name</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The default server comes from the CUPS_SERVER environment variable, then the
~/.cups/client.conf file, and finally the /etc/cups/client.conf file. If not
set, the default is the local system - either "localhost" or a domain socket
path.<br>
<br>
The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6
address, or a domain socket pathname.<br>
<br>
Note: The current server is tracked separately for each thread in a program.
Multi-threaded programs that override the server via the
<a href="#cupsSetServer"><code>cupsSetServer</code></a> function need to do so in each thread for the same
server to be used.</p>
<h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="cupsSetClientCertCB">cupsSetClientCertCB</a></h3>
<p class="description">Set the client certificate callback.</p>
<p class="code">
void cupsSetClientCertCB(<a href="#cups_client_cert_cb_t">cups_client_cert_cb_t</a> cb, void *user_data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>cb</th>
<td class="description">Callback function</td></tr>
<tr><th>user_data</th>
<td class="description">User data pointer</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
<br>
Note: The current certificate callback is tracked separately for each thread
in a program. Multi-threaded programs that override the callback need to do
so in each thread for the same callback to be used.
</p>
<h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="cupsSetCredentials">cupsSetCredentials</a></h3>
<p class="description">Set the default credentials to be used for SSL/TLS
connections.</p>
<p class="code">
int cupsSetCredentials(cups_array_t *credentials);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>credentials</th>
<td class="description">Array of credentials</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of call (0 = success)</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Note: The default credentials are tracked separately for each thread in a
program. Multi-threaded programs that override the setting need to do so in
each thread for the same setting to be used.
</p>
<h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="cupsSetDefaultDest">cupsSetDefaultDest</a></h3>
<p class="description">Set the default destination.</p>
<p class="code">
void cupsSetDefaultDest(const char *name, const char *instance, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Destination name</td></tr>
<tr><th>instance</th>
<td class="description">Instance name or <code>NULL</code></td></tr>
<tr><th>num_dests</th>
<td class="description">Number of destinations</td></tr>
<tr><th>dests</th>
<td class="description">Destinations</td></tr>
</tbody></table>
<h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="cupsSetDests2">cupsSetDests2</a></h3>
<p class="description">Save the list of destinations for the specified server.</p>
<p class="code">
int cupsSetDests2(<a href="#http_t">http_t</a> *http, int num_dests, <a href="#cups_dest_t">cups_dest_t</a> *dests);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server or <code>CUPS_HTTP_DEFAULT</code></td></tr>
<tr><th>num_dests</th>
<td class="description">Number of destinations</td></tr>
<tr><th>dests</th>
<td class="description">Destinations</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">0 on success, -1 on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function saves the destinations to /etc/cups/lpoptions when run
as root and ~/.cups/lpoptions when run as a normal user.
</p>
<h3 class="function"><a id="cupsSetEncryption">cupsSetEncryption</a></h3>
<p class="description">Set the encryption preference.</p>
<p class="code">
void cupsSetEncryption(<a href="#http_encryption_t">http_encryption_t</a> e);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>e</th>
<td class="description">New encryption preference</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The default encryption setting comes from the CUPS_ENCRYPTION
environment variable, then the ~/.cups/client.conf file, and finally the
/etc/cups/client.conf file. If not set, the default is
<code>HTTP_ENCRYPTION_IF_REQUESTED</code>.<br>
<br>
Note: The current encryption setting is tracked separately for each thread
in a program. Multi-threaded programs that override the setting need to do
so in each thread for the same setting to be used.</p>
<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="cupsSetPasswordCB2">cupsSetPasswordCB2</a></h3>
<p class="description">Set the advanced password callback for CUPS.</p>
<p class="code">
void cupsSetPasswordCB2(<a href="#cups_password_cb2_t">cups_password_cb2_t</a> cb, void *user_data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>cb</th>
<td class="description">Callback function</td></tr>
<tr><th>user_data</th>
<td class="description">User data pointer</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Pass <code>NULL</code> to restore the default (console) password callback, which
reads the password from the console. Programs should call either this
function or <a href="#cupsSetPasswordCB2"><code>cupsSetPasswordCB2</code></a>, as only one callback can be registered
by a program per thread.<br>
<br>
Note: The current password callback is tracked separately for each thread
in a program. Multi-threaded programs that override the callback need to do
so in each thread for the same callback to be used.
</p>
<h3 class="function"><a id="cupsSetServer">cupsSetServer</a></h3>
<p class="description">Set the default server name and port.</p>
<p class="code">
void cupsSetServer(const char *server);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>server</th>
<td class="description">Server name</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The "server" string can be a fully-qualified hostname, a numeric
IPv4 or IPv6 address, or a domain socket pathname. Hostnames and numeric IP
addresses can be optionally followed by a colon and port number to override
the default port 631, e.g. "hostname:8631". Pass <code>NULL</code> to restore the
default server name and port.<br>
<br>
Note: The current server is tracked separately for each thread in a program.
Multi-threaded programs that override the server need to do so in each
thread for the same server to be used.</p>
<h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="cupsSetServerCertCB">cupsSetServerCertCB</a></h3>
<p class="description">Set the server certificate callback.</p>
<p class="code">
void cupsSetServerCertCB(<a href="#cups_server_cert_cb_t">cups_server_cert_cb_t</a> cb, void *user_data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>cb</th>
<td class="description">Callback function</td></tr>
<tr><th>user_data</th>
<td class="description">User data pointer</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Pass <code>NULL</code> to restore the default callback.<br>
<br>
Note: The current credentials callback is tracked separately for each thread
in a program. Multi-threaded programs that override the callback need to do
so in each thread for the same callback to be used.
</p>
<h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="cupsSetServerCredentials">cupsSetServerCredentials</a></h3>
<p class="description">Set the default server credentials.</p>
<p class="code">
int cupsSetServerCredentials(const char *path, const char *common_name, int auto_create);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>path</th>
<td class="description">Keychain path or <code>NULL</code> for default</td></tr>
<tr><th>common_name</th>
<td class="description">Default common name for server</td></tr>
<tr><th>auto_create</th>
<td class="description">1 = automatically create self-signed certificates</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Note: The server credentials are used by all threads in the running process.
This function is threadsafe.
</p>
<h3 class="function"><a id="cupsSetUser">cupsSetUser</a></h3>
<p class="description">Set the default user name.</p>
<p class="code">
void cupsSetUser(const char *user);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>user</th>
<td class="description">User name</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Pass <code>NULL</code> to restore the default user name.<br>
<br>
Note: The current user name is tracked separately for each thread in a
program. Multi-threaded programs that override the user name need to do so
in each thread for the same user name to be used.</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsSetUserAgent">cupsSetUserAgent</a></h3>
<p class="description">Set the default HTTP User-Agent string.</p>
<p class="code">
void cupsSetUserAgent(const char *user_agent);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>user_agent</th>
<td class="description">User-Agent string or <code>NULL</code></td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Setting the string to NULL forces the default value containing the CUPS
version, IPP version, and operating system version and architecture.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cupsStartDestDocument">cupsStartDestDocument</a></h3>
<p class="description">Start a new document.</p>
<p class="code">
http_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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to destination</td></tr>
<tr><th>dest</th>
<td class="description">Destination</td></tr>
<tr><th>info</th>
<td class="description">Destination information</td></tr>
<tr><th>job_id</th>
<td class="description">Job ID</td></tr>
<tr><th>docname</th>
<td class="description">Document name</td></tr>
<tr><th>format</th>
<td class="description">Document format</td></tr>
<tr><th>num_options</th>
<td class="description">Number of document options</td></tr>
<tr><th>options</th>
<td class="description">Document options</td></tr>
<tr><th>last_document</th>
<td class="description">1 if this is the last document</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of document creation</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">"job_id" is the job ID returned by cupsCreateDestJob. "docname" is the name
of the document/file being printed, "format" is the MIME media type for the
document (see CUPS_FORMAT_xxx constants), and "num_options" and "options"
are the options do be applied to the document. "last_document" should be 1
if this is the last document to be submitted in the job. Returns
<code>HTTP_CONTINUE</code> on success.
</p>
<h3 class="function"><a id="cupsUser">cupsUser</a></h3>
<p class="description">Return the current user's name.</p>
<p class="code">
const char *cupsUser(void);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">User name</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Note: The current user name is tracked separately for each thread in a
program. Multi-threaded programs that override the user name with the
<a href="#cupsSetUser"><code>cupsSetUser</code></a> function need to do so in each thread for the same user
name to be used.</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="cupsUserAgent">cupsUserAgent</a></h3>
<p class="description">Return the default HTTP User-Agent string.</p>
<p class="code">
const char *cupsUserAgent(void);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">User-Agent string</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAcceptConnection">httpAcceptConnection</a></h3>
<p class="description">Accept a new HTTP client connection from the
specified listening socket.</p>
<p class="code">
<a href="#http_t">http_t</a> *httpAcceptConnection(int fd, int blocking);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fd</th>
<td class="description">Listen socket file descriptor</td></tr>
<tr><th>blocking</th>
<td class="description">1 if the connection should be
blocking, 0 otherwise</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">HTTP connection or <code>NULL</code></p>
<h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="httpAddCredential">httpAddCredential</a></h3>
<p class="description">Allocates and adds a single credential to an array.</p>
<p class="code">
int httpAddCredential(cups_array_t *credentials, const void *data, size_t datalen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>credentials</th>
<td class="description">Credentials array</td></tr>
<tr><th>data</th>
<td class="description">PEM-encoded X.509 data</td></tr>
<tr><th>datalen</th>
<td class="description">Length of data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">0 on success, -1 on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Use <code>cupsArrayNew(NULL, NULL)</code> to create a credentials array.
</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrAny">httpAddrAny</a></h3>
<p class="description">Check for the "any" address.</p>
<p class="code">
int httpAddrAny(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address to check</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 if "any", 0 otherwise</p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpAddrClose">httpAddrClose</a></h3>
<p class="description">Close a socket created by <a href="#httpAddrConnect"><code>httpAddrConnect</code></a> or
<a href="#httpAddrListen"><code>httpAddrListen</code></a>.</p>
<p class="code">
int httpAddrClose(<a href="#http_addr_t">http_addr_t</a> *addr, int fd);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Listen address or <code>NULL</code></td></tr>
<tr><th>fd</th>
<td class="description">Socket file descriptor</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">0 on success, -1 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Pass <code>NULL</code> for sockets created with <a href="#httpAddrConnect2"><code>httpAddrConnect2</code></a> and the
listen address for sockets created with <a href="#httpAddrListen"><code>httpAddrListen</code></a>. This function
ensures that domain sockets are removed when closed.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAddrConnect2">httpAddrConnect2</a></h3>
<p class="description">Connect to any of the addresses in the list with a
timeout and optional cancel.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addrlist</th>
<td class="description">List of potential addresses</td></tr>
<tr><th>sock</th>
<td class="description">Socket</td></tr>
<tr><th>msec</th>
<td class="description">Timeout in milliseconds</td></tr>
<tr><th>cancel</th>
<td class="description">Pointer to "cancel" variable</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Connected address or NULL on failure</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAddrCopyList">httpAddrCopyList</a></h3>
<p class="description">Copy an address list.</p>
<p class="code">
<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrCopyList(<a href="#http_addrlist_t">http_addrlist_t</a> *src);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>src</th>
<td class="description">Source address list</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New address list or <code>NULL</code> on error</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrEqual">httpAddrEqual</a></h3>
<p class="description">Compare two addresses.</p>
<p class="code">
int httpAddrEqual(const <a href="#http_addr_t">http_addr_t</a> *addr1, const <a href="#http_addr_t">http_addr_t</a> *addr2);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr1</th>
<td class="description">First address</td></tr>
<tr><th>addr2</th>
<td class="description">Second address</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 if equal, 0 if not</p>
<h3 class="function"><a id="httpAddrFamily">httpAddrFamily</a></h3>
<p class="description">Get the address family of an address.</p>
<p class="code">
int httpAddrFamily(<a href="#http_addr_t">http_addr_t</a> *addr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Address family</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrFreeList">httpAddrFreeList</a></h3>
<p class="description">Free an address list.</p>
<p class="code">
void httpAddrFreeList(<a href="#http_addrlist_t">http_addrlist_t</a> *addrlist);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addrlist</th>
<td class="description">Address list to free</td></tr>
</tbody></table>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrGetList">httpAddrGetList</a></h3>
<p class="description">Get a list of addresses for a hostname.</p>
<p class="code">
<a href="#http_addrlist_t">http_addrlist_t</a> *httpAddrGetList(const char *hostname, int family, const char *service);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>hostname</th>
<td class="description">Hostname, IP address, or NULL for passive listen address</td></tr>
<tr><th>family</th>
<td class="description">Address family or AF_UNSPEC</td></tr>
<tr><th>service</th>
<td class="description">Service name or port number</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">List of addresses or NULL</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrLength">httpAddrLength</a></h3>
<p class="description">Return the length of the address in bytes.</p>
<p class="code">
int httpAddrLength(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Length in bytes</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAddrListen">httpAddrListen</a></h3>
<p class="description">Create a listening socket bound to the specified
address and port.</p>
<p class="code">
int httpAddrListen(<a href="#http_addr_t">http_addr_t</a> *addr, int port);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address to bind to</td></tr>
<tr><th>port</th>
<td class="description">Port number to bind to</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Socket or -1 on error</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrLocalhost">httpAddrLocalhost</a></h3>
<p class="description">Check for the local loopback address.</p>
<p class="code">
int httpAddrLocalhost(const <a href="#http_addr_t">http_addr_t</a> *addr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address to check</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 if local host, 0 otherwise</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrLookup">httpAddrLookup</a></h3>
<p class="description">Lookup the hostname associated with the address.</p>
<p class="code">
char *httpAddrLookup(const <a href="#http_addr_t">http_addr_t</a> *addr, char *name, int namelen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address to lookup</td></tr>
<tr><th>name</th>
<td class="description">Host name buffer</td></tr>
<tr><th>namelen</th>
<td class="description">Size of name buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Host name</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAddrPort">httpAddrPort</a></h3>
<p class="description">Get the port number associated with an address.</p>
<p class="code">
int httpAddrPort(<a href="#http_addr_t">http_addr_t</a> *addr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Port number</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAddrString">httpAddrString</a></h3>
<p class="description">Convert an address to a numeric string.</p>
<p class="code">
char *httpAddrString(const <a href="#http_addr_t">http_addr_t</a> *addr, char *s, int slen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>addr</th>
<td class="description">Address to convert</td></tr>
<tr><th>s</th>
<td class="description">String buffer</td></tr>
<tr><th>slen</th>
<td class="description">Length of string</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Numeric address string</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAssembleURI">httpAssembleURI</a></h3>
<p class="description">Assemble a uniform resource identifier from its
components.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>encoding</th>
<td class="description">Encoding flags</td></tr>
<tr><th>uri</th>
<td class="description">URI buffer</td></tr>
<tr><th>urilen</th>
<td class="description">Size of URI buffer</td></tr>
<tr><th>scheme</th>
<td class="description">Scheme name</td></tr>
<tr><th>username</th>
<td class="description">Username</td></tr>
<tr><th>host</th>
<td class="description">Hostname or address</td></tr>
<tr><th>port</th>
<td class="description">Port number</td></tr>
<tr><th>resource</th>
<td class="description">Resource</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">URI status</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function escapes reserved characters in the URI depending on the
value of the "encoding" argument. You should use this function in
place of traditional string functions whenever you need to create a
URI string.
</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpAssembleURIf">httpAssembleURIf</a></h3>
<p class="description">Assemble a uniform resource identifier from its
components with a formatted resource.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>encoding</th>
<td class="description">Encoding flags</td></tr>
<tr><th>uri</th>
<td class="description">URI buffer</td></tr>
<tr><th>urilen</th>
<td class="description">Size of URI buffer</td></tr>
<tr><th>scheme</th>
<td class="description">Scheme name</td></tr>
<tr><th>username</th>
<td class="description">Username</td></tr>
<tr><th>host</th>
<td class="description">Hostname or address</td></tr>
<tr><th>port</th>
<td class="description">Port number</td></tr>
<tr><th>resourcef</th>
<td class="description">Printf-style resource</td></tr>
<tr><th>...</th>
<td class="description">Additional arguments as needed</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">URI status</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates a formatted version of the resource string
argument "resourcef" and escapes reserved characters in the URI
depending on the value of the "encoding" argument. You should use
this function in place of traditional string functions whenever
you need to create a URI string.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpAssembleUUID">httpAssembleUUID</a></h3>
<p class="description">Assemble a name-based UUID URN conforming to RFC 4122.</p>
<p class="code">
char *httpAssembleUUID(const char *server, int port, const char *name, int number, char *buffer, size_t bufsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>server</th>
<td class="description">Server name</td></tr>
<tr><th>port</th>
<td class="description">Port number</td></tr>
<tr><th>name</th>
<td class="description">Object name or NULL</td></tr>
<tr><th>number</th>
<td class="description">Object number or 0</td></tr>
<tr><th>buffer</th>
<td class="description">String buffer</td></tr>
<tr><th>bufsize</th>
<td class="description">Size of buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">UUID string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates a unique 128-bit identifying number using the server
name, port number, random data, and optionally an object name and/or object
number. The result is formatted as a UUID URN as defined in RFC 4122.<br>
<br>
The buffer needs to be at least 46 bytes in size.
</p>
<h3 class="function"><a id="httpBlocking">httpBlocking</a></h3>
<p class="description">Set blocking/non-blocking behavior on a connection.</p>
<p class="code">
void httpBlocking(<a href="#http_t">http_t</a> *http, int b);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>b</th>
<td class="description">1 = blocking, 0 = non-blocking</td></tr>
</tbody></table>
<h3 class="function"><a id="httpCheck">httpCheck</a></h3>
<p class="description">Check to see if there is a pending response from the server.</p>
<p class="code">
int httpCheck(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">0 = no data, 1 = data available</p>
<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="httpClearCookie">httpClearCookie</a></h3>
<p class="description">Clear the cookie value(s).</p>
<p class="code">
void httpClearCookie(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h3 class="function"><a id="httpClearFields">httpClearFields</a></h3>
<p class="description">Clear HTTP request fields.</p>
<p class="code">
void httpClearFields(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h3 class="function"><a id="httpClose">httpClose</a></h3>
<p class="description">Close an HTTP connection.</p>
<p class="code">
void httpClose(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpCompareCredentials">httpCompareCredentials</a></h3>
<p class="description">Compare two sets of X.509 credentials.</p>
<p class="code">
int httpCompareCredentials(cups_array_t *cred1, cups_array_t *cred2);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>cred1</th>
<td class="description">First set of X.509 credentials</td></tr>
<tr><th>cred2</th>
<td class="description">Second set of X.509 credentials</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 if they match, 0 if they do not</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpConnect2">httpConnect2</a></h3>
<p class="description">Connect to a HTTP server.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>host</th>
<td class="description">Host to connect to</td></tr>
<tr><th>port</th>
<td class="description">Port number</td></tr>
<tr><th>addrlist</th>
<td class="description">List of addresses or <code>NULL</code> to lookup</td></tr>
<tr><th>family</th>
<td class="description">Address family to use or <code>AF_UNSPEC</code> for any</td></tr>
<tr><th>encryption</th>
<td class="description">Type of encryption to use</td></tr>
<tr><th>blocking</th>
<td class="description">1 for blocking connection, 0 for non-blocking</td></tr>
<tr><th>msec</th>
<td class="description">Connection timeout in milliseconds, 0 means don't connect</td></tr>
<tr><th>cancel</th>
<td class="description">Pointer to "cancel" variable</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New HTTP connection</p>
<h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="httpCopyCredentials">httpCopyCredentials</a></h3>
<p class="description">Copy the credentials associated with the peer in
an encrypted connection.</p>
<p class="code">
int httpCopyCredentials(<a href="#http_t">http_t</a> *http, cups_array_t **credentials);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection to server</td></tr>
<tr><th>credentials</th>
<td class="description">Array of credentials</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of call (0 = success)</p>
<h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="httpCredentialsAreValidForName">httpCredentialsAreValidForName</a></h3>
<p class="description">Return whether the credentials are valid for the given name.</p>
<p class="code">
int httpCredentialsAreValidForName(cups_array_t *credentials, const char *common_name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>credentials</th>
<td class="description">Credentials</td></tr>
<tr><th>common_name</th>
<td class="description">Name to check</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 if valid, 0 otherwise</p>
<h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="httpCredentialsGetExpiration">httpCredentialsGetExpiration</a></h3>
<p class="description">Return the expiration date of the credentials.</p>
<p class="code">
time_t httpCredentialsGetExpiration(cups_array_t *credentials);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>credentials</th>
<td class="description">Credentials</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Expiration date of credentials</p>
<h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="httpCredentialsGetTrust">httpCredentialsGetTrust</a></h3>
<p class="description">Return the trust of credentials.</p>
<p class="code">
<a href="#http_trust_t">http_trust_t</a> httpCredentialsGetTrust(cups_array_t *credentials, const char *common_name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>credentials</th>
<td class="description">Credentials</td></tr>
<tr><th>common_name</th>
<td class="description">Common name for trust lookup</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Level of trust</p>
<h3 class="function"><span class="info"> CUPS 2.0/macOS 10.10 </span><a id="httpCredentialsString">httpCredentialsString</a></h3>
<p class="description">Return a string representing the credentials.</p>
<p class="code">
size_t httpCredentialsString(cups_array_t *credentials, char *buffer, size_t bufsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>credentials</th>
<td class="description">Credentials</td></tr>
<tr><th>buffer</th>
<td class="description">Buffer or <code>NULL</code></td></tr>
<tr><th>bufsize</th>
<td class="description">Size of buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Total size of credentials string</p>
<h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="httpDecode64_2">httpDecode64_2</a></h3>
<p class="description">Base64-decode a string.</p>
<p class="code">
char *httpDecode64_2(char *out, int *outlen, const char *in);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>out</th>
<td class="description">String to write to</td></tr>
<tr><th>outlen</th>
<td class="description">Size of output string</td></tr>
<tr><th>in</th>
<td class="description">String to read from</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Decoded string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The caller must initialize "outlen" to the maximum size of the decoded
string before calling <code>httpDecode64_2</code>. On return "outlen" contains the
decoded length of the string.
</p>
<h3 class="function"><a id="httpDelete">httpDelete</a></h3>
<p class="description">Send a DELETE request to the server.</p>
<p class="code">
int httpDelete(<a href="#http_t">http_t</a> *http, const char *uri);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>uri</th>
<td class="description">URI to delete</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of call (0 = success)</p>
<h3 class="function"><span class="info"> CUPS 1.1.21/macOS 10.4 </span><a id="httpEncode64_2">httpEncode64_2</a></h3>
<p class="description">Base64-encode a string.</p>
<p class="code">
char *httpEncode64_2(char *out, int outlen, const char *in, int inlen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>out</th>
<td class="description">String to write to</td></tr>
<tr><th>outlen</th>
<td class="description">Maximum size of output string</td></tr>
<tr><th>in</th>
<td class="description">String to read from</td></tr>
<tr><th>inlen</th>
<td class="description">Size of input string</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Encoded string</p>
<h3 class="function"><a id="httpEncryption">httpEncryption</a></h3>
<p class="description">Set the required encryption on the link.</p>
<p class="code">
int httpEncryption(<a href="#http_t">http_t</a> *http, <a href="#http_encryption_t">http_encryption_t</a> e);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>e</th>
<td class="description">New encryption preference</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">-1 on error, 0 on success</p>
<h3 class="function"><a id="httpError">httpError</a></h3>
<p class="description">Get the last error on a connection.</p>
<p class="code">
int httpError(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Error code (errno) value</p>
<h3 class="function"><a id="httpFieldValue">httpFieldValue</a></h3>
<p class="description">Return the HTTP field enumeration value for a field
name.</p>
<p class="code">
<a href="#http_field_t">http_field_t</a> httpFieldValue(const char *name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">String name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Field index</p>
<h3 class="function"><a id="httpFlush">httpFlush</a></h3>
<p class="description">Flush data read from a HTTP connection.</p>
<p class="code">
void httpFlush(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpFlushWrite">httpFlushWrite</a></h3>
<p class="description">Flush data written to a HTTP connection.</p>
<p class="code">
int httpFlushWrite(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Bytes written or -1 on error</p>
<h3 class="function"><a id="httpFreeCredentials">httpFreeCredentials</a></h3>
<p class="description">Free an array of credentials.</p>
<p class="code">
void httpFreeCredentials(cups_array_t *credentials);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>credentials</th>
<td class="description">Array of credentials</td></tr>
</tbody></table>
<h3 class="function"><a id="httpGet">httpGet</a></h3>
<p class="description">Send a GET request to the server.</p>
<p class="code">
int httpGet(<a href="#http_t">http_t</a> *http, const char *uri);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>uri</th>
<td class="description">URI to get</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of call (0 = success)</p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetActivity">httpGetActivity</a></h3>
<p class="description">Get the most recent activity for a connection.</p>
<p class="code">
time_t httpGetActivity(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Time of last read or write</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The return value is the time in seconds of the last read or write.
</p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetAddress">httpGetAddress</a></h3>
<p class="description">Get the address of the connected peer of a connection.</p>
<p class="code">
<a href="#http_addr_t">http_addr_t</a> *httpGetAddress(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Connected address or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">For connections created with <a href="#httpConnect2"><code>httpConnect2</code></a>, the address is for the
server. For connections created with <a href="#httpAccept"><code>httpAccept</code></a>, the address is for
the client.<br>
<br>
Returns <code>NULL</code> if the socket is currently unconnected.
</p>
<h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="httpGetAuthString">httpGetAuthString</a></h3>
<p class="description">Get the current authorization string.</p>
<p class="code">
char *httpGetAuthString(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Authorization string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The authorization string is set by <a href="#cupsDoAuthentication"><code>cupsDoAuthentication</code></a> and
<a href="#httpSetAuthString"><code>httpSetAuthString</code></a>. Use <a href="#httpGetAuthString"><code>httpGetAuthString</code></a> to retrieve the
string to use with <a href="#httpSetField"><code>httpSetField</code></a> for the
<code>HTTP_FIELD_AUTHORIZATION</code> value.
</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetBlocking">httpGetBlocking</a></h3>
<p class="description">Get the blocking/non-block state of a connection.</p>
<p class="code">
int httpGetBlocking(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 if blocking, 0 if non-blocking</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpGetContentEncoding">httpGetContentEncoding</a></h3>
<p class="description">Get a common content encoding, if any, between
the client and server.</p>
<p class="code">
const char *httpGetContentEncoding(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Content-Coding value or
<code>NULL</code> for the identity
coding.</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function uses the value of the Accepts-Encoding HTTP header and must be
called after receiving a response from the server or a request from the
client. The value returned can be use in subsequent requests (for clients)
or in the response (for servers) in order to compress the content stream.
</p>
<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="httpGetCookie">httpGetCookie</a></h3>
<p class="description">Get any cookie data from the response.</p>
<p class="code">
const char *httpGetCookie(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Cookie data or <code>NULL</code></p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetDateString2">httpGetDateString2</a></h3>
<p class="description">Get a formatted date/time string from a time value.</p>
<p class="code">
const char *httpGetDateString2(time_t t, char *s, int slen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>t</th>
<td class="description">Time in seconds</td></tr>
<tr><th>s</th>
<td class="description">String buffer</td></tr>
<tr><th>slen</th>
<td class="description">Size of string buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Date/time string</p>
<h3 class="function"><a id="httpGetDateTime">httpGetDateTime</a></h3>
<p class="description">Get a time value from a formatted date/time string.</p>
<p class="code">
time_t httpGetDateTime(const char *s);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>s</th>
<td class="description">Date/time string</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Time in seconds</p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetEncryption">httpGetEncryption</a></h3>
<p class="description">Get the current encryption mode of a connection.</p>
<p class="code">
<a href="#http_encryption_t">http_encryption_t</a> httpGetEncryption(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Current encryption mode</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the encryption mode for the connection. Use the
<a href="#httpIsEncrypted"><code>httpIsEncrypted</code></a> function to determine whether a TLS session has
been established.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpGetExpect">httpGetExpect</a></h3>
<p class="description">Get the value of the Expect header, if any.</p>
<p class="code">
http_status_t httpGetExpect(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Expect: status, if any</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Returns <code>HTTP_STATUS_NONE</code> if there is no Expect header, otherwise
returns the expected HTTP status code, typically <code>HTTP_STATUS_CONTINUE</code>.
</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetFd">httpGetFd</a></h3>
<p class="description">Get the file descriptor associated with a connection.</p>
<p class="code">
int httpGetFd(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">File descriptor or -1 if none</p>
<h3 class="function"><a id="httpGetField">httpGetField</a></h3>
<p class="description">Get a field value from a request/response.</p>
<p class="code">
const char *httpGetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>field</th>
<td class="description">Field to get</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Field value</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetHostname">httpGetHostname</a></h3>
<p class="description">Get the FQDN for the connection or local system.</p>
<p class="code">
const char *httpGetHostname(<a href="#http_t">http_t</a> *http, char *s, int slen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection or NULL</td></tr>
<tr><th>s</th>
<td class="description">String buffer for name</td></tr>
<tr><th>slen</th>
<td class="description">Size of buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">FQDN for connection or system</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">When "http" points to a connected socket, return the hostname or
address that was used in the call to httpConnect() or httpConnectEncrypt(),
or the address of the client for the connection from httpAcceptConnection().
Otherwise, return the FQDN for the local system using both gethostname()
and gethostbyname() to get the local hostname with domain.
</p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetKeepAlive">httpGetKeepAlive</a></h3>
<p class="description">Get the current Keep-Alive state of the connection.</p>
<p class="code">
<a href="#http_keepalive_t">http_keepalive_t</a> httpGetKeepAlive(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Keep-Alive state</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetLength2">httpGetLength2</a></h3>
<p class="description">Get the amount of data remaining from the
content-length or transfer-encoding fields.</p>
<p class="code">
off_t httpGetLength2(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Content length</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns the complete content length, even for
content larger than 2^31 - 1.
</p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetPending">httpGetPending</a></h3>
<p class="description">Get the number of bytes that are buffered for writing.</p>
<p class="code">
size_t httpGetPending(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes buffered</p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetReady">httpGetReady</a></h3>
<p class="description">Get the number of bytes that can be read without blocking.</p>
<p class="code">
size_t httpGetReady(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes available</p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpGetRemaining">httpGetRemaining</a></h3>
<p class="description">Get the number of remaining bytes in the message
body or current chunk.</p>
<p class="code">
size_t httpGetRemaining(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Remaining bytes</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <a href="#httpIsChunked"><code>httpIsChunked</code></a> function can be used to determine whether the
message body is chunked or fixed-length.
</p>
<h3 class="function"><a id="httpGetState">httpGetState</a></h3>
<p class="description">Get the current state of the HTTP request.</p>
<p class="code">
<a href="#http_state_t">http_state_t</a> httpGetState(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">HTTP state</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetStatus">httpGetStatus</a></h3>
<p class="description">Get the status of the last HTTP request.</p>
<p class="code">
http_status_t httpGetStatus(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">HTTP status</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpGetSubField2">httpGetSubField2</a></h3>
<p class="description">Get a sub-field value.</p>
<p class="code">
char *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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>field</th>
<td class="description">Field index</td></tr>
<tr><th>name</th>
<td class="description">Name of sub-field</td></tr>
<tr><th>value</th>
<td class="description">Value string</td></tr>
<tr><th>valuelen</th>
<td class="description">Size of value buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Value or <code>NULL</code></p>
<h3 class="function"><a id="httpGetVersion">httpGetVersion</a></h3>
<p class="description">Get the HTTP version at the other end.</p>
<p class="code">
<a href="#http_version_t">http_version_t</a> httpGetVersion(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Version number</p>
<h3 class="function"><a id="httpGets">httpGets</a></h3>
<p class="description">Get a line of text from a HTTP connection.</p>
<p class="code">
char *httpGets(char *line, int length, <a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>line</th>
<td class="description">Line to read into</td></tr>
<tr><th>length</th>
<td class="description">Max length of buffer</td></tr>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Line or <code>NULL</code></p>
<h3 class="function"><a id="httpHead">httpHead</a></h3>
<p class="description">Send a HEAD request to the server.</p>
<p class="code">
int httpHead(<a href="#http_t">http_t</a> *http, const char *uri);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>uri</th>
<td class="description">URI for head</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of call (0 = success)</p>
<h3 class="function"><a id="httpInitialize">httpInitialize</a></h3>
<p class="description">Initialize the HTTP interface library and set the
default HTTP proxy (if any).</p>
<p class="code">
void httpInitialize(void);</p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpIsChunked">httpIsChunked</a></h3>
<p class="description">Report whether a message body is chunked.</p>
<p class="code">
int httpIsChunked(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 if chunked, 0 if not</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns non-zero if the message body is composed of
variable-length chunks.
</p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpIsEncrypted">httpIsEncrypted</a></h3>
<p class="description">Report whether a connection is encrypted.</p>
<p class="code">
int httpIsEncrypted(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 if encrypted, 0 if not</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function returns non-zero if the connection is currently encrypted.
</p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpLoadCredentials">httpLoadCredentials</a></h3>
<p class="description">Load X.509 credentials from a keychain file.</p>
<p class="code">
int httpLoadCredentials(const char *path, cups_array_t **credentials, const char *common_name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>path</th>
<td class="description">Keychain path or <code>NULL</code> for default</td></tr>
<tr><th>credentials</th>
<td class="description">Credentials</td></tr>
<tr><th>common_name</th>
<td class="description">Common name for credentials</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">0 on success, -1 on error</p>
<h3 class="function"><a id="httpOptions">httpOptions</a></h3>
<p class="description">Send an OPTIONS request to the server.</p>
<p class="code">
int httpOptions(<a href="#http_t">http_t</a> *http, const char *uri);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>uri</th>
<td class="description">URI for options</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of call (0 = success)</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpPeek">httpPeek</a></h3>
<p class="description">Peek at data from a HTTP connection.</p>
<p class="code">
ssize_t httpPeek(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>buffer</th>
<td class="description">Buffer for data</td></tr>
<tr><th>length</th>
<td class="description">Maximum number of bytes</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes copied</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function copies available data from the given HTTP connection, reading
a buffer as needed. The data is still available for reading using
<a href="#httpRead2"><code>httpRead2</code></a>.<br>
<br>
For non-blocking connections the usual timeouts apply.
</p>
<h3 class="function"><a id="httpPost">httpPost</a></h3>
<p class="description">Send a POST request to the server.</p>
<p class="code">
int httpPost(<a href="#http_t">http_t</a> *http, const char *uri);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>uri</th>
<td class="description">URI for post</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of call (0 = success)</p>
<h3 class="function"><a id="httpPut">httpPut</a></h3>
<p class="description">Send a PUT request to the server.</p>
<p class="code">
int httpPut(<a href="#http_t">http_t</a> *http, const char *uri);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>uri</th>
<td class="description">URI to put</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of call (0 = success)</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpRead2">httpRead2</a></h3>
<p class="description">Read data from a HTTP connection.</p>
<p class="code">
ssize_t httpRead2(<a href="#http_t">http_t</a> *http, char *buffer, size_t length);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>buffer</th>
<td class="description">Buffer for data</td></tr>
<tr><th>length</th>
<td class="description">Maximum number of bytes</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes read</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpReadRequest">httpReadRequest</a></h3>
<p class="description">Read a HTTP request from a connection.</p>
<p class="code">
<a href="#http_state_t">http_state_t</a> httpReadRequest(<a href="#http_t">http_t</a> *http, char *uri, size_t urilen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>uri</th>
<td class="description">URI buffer</td></tr>
<tr><th>urilen</th>
<td class="description">Size of URI buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New state of connection</p>
<h3 class="function"><a id="httpReconnect2">httpReconnect2</a></h3>
<p class="description">Reconnect to a HTTP server with timeout and optional
cancel.</p>
<p class="code">
int httpReconnect2(<a href="#http_t">http_t</a> *http, int msec, int *cancel);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>msec</th>
<td class="description">Timeout in milliseconds</td></tr>
<tr><th>cancel</th>
<td class="description">Pointer to "cancel" variable</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">0 on success, non-zero on failure</p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpResolveHostname">httpResolveHostname</a></h3>
<p class="description">Resolve the hostname of the HTTP connection
address.</p>
<p class="code">
const char *httpResolveHostname(<a href="#http_t">http_t</a> *http, char *buffer, size_t bufsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>buffer</th>
<td class="description">Hostname buffer</td></tr>
<tr><th>bufsize</th>
<td class="description">Size of buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Resolved hostname or <code>NULL</code></p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpSaveCredentials">httpSaveCredentials</a></h3>
<p class="description">Save X.509 credentials to a keychain file.</p>
<p class="code">
int httpSaveCredentials(const char *path, cups_array_t *credentials, const char *common_name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>path</th>
<td class="description">Keychain path or <code>NULL</code> for default</td></tr>
<tr><th>credentials</th>
<td class="description">Credentials</td></tr>
<tr><th>common_name</th>
<td class="description">Common name for credentials</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">-1 on error, 0 on success</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpSeparateURI">httpSeparateURI</a></h3>
<p class="description">Separate a Universal Resource Identifier into its
components.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>decoding</th>
<td class="description">Decoding flags</td></tr>
<tr><th>uri</th>
<td class="description">Universal Resource Identifier</td></tr>
<tr><th>scheme</th>
<td class="description">Scheme (http, https, etc.)</td></tr>
<tr><th>schemelen</th>
<td class="description">Size of scheme buffer</td></tr>
<tr><th>username</th>
<td class="description">Username</td></tr>
<tr><th>usernamelen</th>
<td class="description">Size of username buffer</td></tr>
<tr><th>host</th>
<td class="description">Hostname</td></tr>
<tr><th>hostlen</th>
<td class="description">Size of hostname buffer</td></tr>
<tr><th>port</th>
<td class="description">Port number to use</td></tr>
<tr><th>resource</th>
<td class="description">Resource/filename</td></tr>
<tr><th>resourcelen</th>
<td class="description">Size of resource buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Result of separation</p>
<h3 class="function"><span class="info"> CUPS 1.3/macOS 10.5 </span><a id="httpSetAuthString">httpSetAuthString</a></h3>
<p class="description">Set the current authorization string.</p>
<p class="code">
void httpSetAuthString(<a href="#http_t">http_t</a> *http, const char *scheme, const char *data);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>scheme</th>
<td class="description">Auth scheme (NULL to clear it)</td></tr>
<tr><th>data</th>
<td class="description">Auth data (NULL for none)</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function just stores a copy of the current authorization string in
the HTTP connection object. You must still call <a href="#httpSetField"><code>httpSetField</code></a> to set
<code>HTTP_FIELD_AUTHORIZATION</code> prior to issuing a HTTP request using
<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
<a href="#httpPut"><code>httpPut</code></a>.
</p>
<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="httpSetCookie">httpSetCookie</a></h3>
<p class="description">Set the cookie value(s).</p>
<p class="code">
void httpSetCookie(<a href="#http_t">http_t</a> *http, const char *cookie);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">Connection</td></tr>
<tr><th>cookie</th>
<td class="description">Cookie string</td></tr>
</tbody></table>
<h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="httpSetCredentials">httpSetCredentials</a></h3>
<p class="description">Set the credentials associated with an encrypted
connection.</p>
<p class="code">
int httpSetCredentials(<a href="#http_t">http_t</a> *http, cups_array_t *credentials);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>credentials</th>
<td class="description">Array of credentials</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status of call (0 = success)</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpSetDefaultField">httpSetDefaultField</a></h3>
<p class="description">Set the default value of an HTTP header.</p>
<p class="code">
void httpSetDefaultField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>field</th>
<td class="description">Field index</td></tr>
<tr><th>value</th>
<td class="description">Value</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Currently only <code>HTTP_FIELD_ACCEPT_ENCODING</code>, <code>HTTP_FIELD_SERVER</code>,
and <code>HTTP_FIELD_USER_AGENT</code> can be set.
</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpSetExpect">httpSetExpect</a></h3>
<p class="description">Set the Expect: header in a request.</p>
<p class="code">
void httpSetExpect(<a href="#http_t">http_t</a> *http, http_status_t expect);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>expect</th>
<td class="description">HTTP status to expect
(<code>HTTP_STATUS_CONTINUE</code>)</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Currently only <code>HTTP_STATUS_CONTINUE</code> is supported for the "expect"
argument.
</p>
<h3 class="function"><a id="httpSetField">httpSetField</a></h3>
<p class="description">Set the value of an HTTP header.</p>
<p class="code">
void httpSetField(<a href="#http_t">http_t</a> *http, <a href="#http_field_t">http_field_t</a> field, const char *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>field</th>
<td class="description">Field index</td></tr>
<tr><th>value</th>
<td class="description">Value</td></tr>
</tbody></table>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpSetKeepAlive">httpSetKeepAlive</a></h3>
<p class="description">Set the current Keep-Alive state of a connection.</p>
<p class="code">
void httpSetKeepAlive(<a href="#http_t">http_t</a> *http, <a href="#http_keepalive_t">http_keepalive_t</a> keep_alive);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>keep_alive</th>
<td class="description">New Keep-Alive value</td></tr>
</tbody></table>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpSetLength">httpSetLength</a></h3>
<p class="description">Set the content-length and content-encoding.</p>
<p class="code">
void httpSetLength(<a href="#http_t">http_t</a> *http, size_t length);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>length</th>
<td class="description">Length (0 for chunked)</td></tr>
</tbody></table>
<h3 class="function"><span class="info"> CUPS 1.5/macOS 10.7 </span><a id="httpSetTimeout">httpSetTimeout</a></h3>
<p class="description">Set read/write timeouts and an optional callback.</p>
<p class="code">
void 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>timeout</th>
<td class="description">Number of seconds for timeout,
must be greater than 0</td></tr>
<tr><th>cb</th>
<td class="description">Callback function or <code>NULL</code></td></tr>
<tr><th>user_data</th>
<td class="description">User data pointer</td></tr>
</tbody></table>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The optional timeout callback receives both the HTTP connection and a user
data pointer and must return 1 to continue or 0 to error (time) out.
</p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpShutdown">httpShutdown</a></h3>
<p class="description">Shutdown one side of an HTTP connection.</p>
<p class="code">
void httpShutdown(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpStateString">httpStateString</a></h3>
<p class="description">Return the string describing a HTTP state value.</p>
<p class="code">
const char *httpStateString(<a href="#http_state_t">http_state_t</a> state);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>state</th>
<td class="description">HTTP state value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">State string</p>
<h3 class="function"><a id="httpStatus">httpStatus</a></h3>
<p class="description">Return a short string describing a HTTP status code.</p>
<p class="code">
const char *httpStatus(http_status_t status);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>status</th>
<td class="description">HTTP status code</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Localized status string</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned string is localized to the current POSIX locale and is based
on the status strings defined in RFC 7231.</p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="httpURIStatusString">httpURIStatusString</a></h3>
<p class="description">Return a string describing a URI status code.</p>
<p class="code">
const char *httpURIStatusString(<a href="#http_uri_status_t">http_uri_status_t</a> status);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>status</th>
<td class="description">URI status code</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Localized status string</p>
<h3 class="function"><a id="httpUpdate">httpUpdate</a></h3>
<p class="description">Update the current HTTP state for incoming data.</p>
<p class="code">
http_status_t httpUpdate(<a href="#http_t">http_t</a> *http);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">HTTP status</p>
<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="httpWait">httpWait</a></h3>
<p class="description">Wait for data available on a connection.</p>
<p class="code">
int httpWait(<a href="#http_t">http_t</a> *http, int msec);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>msec</th>
<td class="description">Milliseconds to wait</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 if data is available, 0 otherwise</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="httpWrite2">httpWrite2</a></h3>
<p class="description">Write data to a HTTP connection.</p>
<p class="code">
ssize_t httpWrite2(<a href="#http_t">http_t</a> *http, const char *buffer, size_t length);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>buffer</th>
<td class="description">Buffer for data</td></tr>
<tr><th>length</th>
<td class="description">Number of bytes to write</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes written</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="httpWriteResponse">httpWriteResponse</a></h3>
<p class="description">Write a HTTP response to a client connection.</p>
<p class="code">
int httpWriteResponse(<a href="#http_t">http_t</a> *http, http_status_t status);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>status</th>
<td class="description">Status code</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">0 on success, -1 on error</p>
<h3 class="function"><a id="ippAddBoolean">ippAddBoolean</a></h3>
<p class="description">Add a boolean attribute to an IPP message.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>value</th>
<td class="description">Value of attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><a id="ippAddBooleans">ippAddBooleans</a></h3>
<p class="description">Add an array of boolean values.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>num_values</th>
<td class="description">Number of values</td></tr>
<tr><th>values</th>
<td class="description">Values</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippAddCollection">ippAddCollection</a></h3>
<p class="description">Add a collection value.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>value</th>
<td class="description">Value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
</p>
<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippAddCollections">ippAddCollections</a></h3>
<p class="description">Add an array of collection values.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>num_values</th>
<td class="description">Number of values</td></tr>
<tr><th>values</th>
<td class="description">Values</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
</p>
<h3 class="function"><a id="ippAddDate">ippAddDate</a></h3>
<p class="description">Add a dateTime attribute to an IPP message.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>value</th>
<td class="description">Value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><a id="ippAddInteger">ippAddInteger</a></h3>
<p class="description">Add a integer attribute to an IPP message.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>value_tag</th>
<td class="description">Type of attribute</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>value</th>
<td class="description">Value of attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
<br>
Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
(<code>IPP_TAG_INTEGER</code>).</p>
<h3 class="function"><a id="ippAddIntegers">ippAddIntegers</a></h3>
<p class="description">Add an array of integer values.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>value_tag</th>
<td class="description">Type of attribute</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>num_values</th>
<td class="description">Number of values</td></tr>
<tr><th>values</th>
<td class="description">Values</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
<br>
Supported values include enum (<code>IPP_TAG_ENUM</code>) and integer
(<code>IPP_TAG_INTEGER</code>).</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippAddOctetString">ippAddOctetString</a></h3>
<p class="description">Add an octetString value to an IPP message.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>data</th>
<td class="description">octetString data</td></tr>
<tr><th>datalen</th>
<td class="description">Length of data in bytes</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippAddOutOfBand">ippAddOutOfBand</a></h3>
<p class="description">Add an out-of-band value to an IPP message.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>value_tag</th>
<td class="description">Type of attribute</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
<br>
Supported out-of-band values include unsupported-value
(<code>IPP_TAG_UNSUPPORTED_VALUE</code>), default (<code>IPP_TAG_DEFAULT</code>), unknown
(<code>IPP_TAG_UNKNOWN</code>), no-value (<code>IPP_TAG_NOVALUE</code>), not-settable
(<code>IPP_TAG_NOTSETTABLE</code>), delete-attribute (<code>IPP_TAG_DELETEATTR</code>), and
admin-define (<code>IPP_TAG_ADMINDEFINE</code>).
</p>
<h3 class="function"><a id="ippAddRange">ippAddRange</a></h3>
<p class="description">Add a range of values to an IPP message.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>lower</th>
<td class="description">Lower value</td></tr>
<tr><th>upper</th>
<td class="description">Upper value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
<br>
The <code>lower</code> parameter must be less than or equal to the <code>upper</code> parameter.</p>
<h3 class="function"><a id="ippAddRanges">ippAddRanges</a></h3>
<p class="description">Add ranges of values to an IPP message.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>num_values</th>
<td class="description">Number of values</td></tr>
<tr><th>lower</th>
<td class="description">Lower values</td></tr>
<tr><th>upper</th>
<td class="description">Upper values</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><a id="ippAddResolution">ippAddResolution</a></h3>
<p class="description">Add a resolution value to an IPP message.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>units</th>
<td class="description">Units for resolution</td></tr>
<tr><th>xres</th>
<td class="description">X resolution</td></tr>
<tr><th>yres</th>
<td class="description">Y resolution</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><a id="ippAddResolutions">ippAddResolutions</a></h3>
<p class="description">Add resolution values to an IPP message.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>num_values</th>
<td class="description">Number of values</td></tr>
<tr><th>units</th>
<td class="description">Units for resolution</td></tr>
<tr><th>xres</th>
<td class="description">X resolutions</td></tr>
<tr><th>yres</th>
<td class="description">Y resolutions</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).</p>
<h3 class="function"><a id="ippAddSeparator">ippAddSeparator</a></h3>
<p class="description">Add a group separator to an IPP message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippAddSeparator(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.</p>
<h3 class="function"><a id="ippAddString">ippAddString</a></h3>
<p class="description">Add a language-encoded string to an IPP message.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>value_tag</th>
<td class="description">Type of attribute</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>language</th>
<td class="description">Language code</td></tr>
<tr><th>value</th>
<td class="description">Value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
<br>
Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
(<code>IPP_TAG_URISCHEME</code>).<br>
<br>
The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippAddStringf">ippAddStringf</a></h3>
<p class="description">Add a formatted string to an IPP message.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>value_tag</th>
<td class="description">Type of attribute</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>language</th>
<td class="description">Language code (<code>NULL</code> for default)</td></tr>
<tr><th>format</th>
<td class="description">Printf-style format string</td></tr>
<tr><th>...</th>
<td class="description">Additional arguments as needed</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document
(<code>IPP_TAG_DOCUMENT</code>), event notification
(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
<br>
Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
(<code>IPP_TAG_URISCHEME</code>).<br>
<br>
The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
and textWithLanguage string values and must be <code>NULL</code> for all other
string values.<br>
<br>
The <code>format</code> parameter uses formatting characters compatible with the
printf family of standard functions. Additional arguments follow it as
needed. The formatted string is truncated as needed to the maximum length of
the corresponding value type.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippAddStringfv">ippAddStringfv</a></h3>
<p class="description">Add a formatted string to an IPP message.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>value_tag</th>
<td class="description">Type of attribute</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>language</th>
<td class="description">Language code (<code>NULL</code> for default)</td></tr>
<tr><th>format</th>
<td class="description">Printf-style format string</td></tr>
<tr><th>ap</th>
<td class="description">Additional arguments</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document
(<code>IPP_TAG_DOCUMENT</code>), event notification
(<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation (<code>IPP_TAG_OPERATION</code>),
printer (<code>IPP_TAG_PRINTER</code>), subscription (<code>IPP_TAG_SUBSCRIPTION</code>),
or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
<br>
Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
(<code>IPP_TAG_URISCHEME</code>).<br>
<br>
The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage
and textWithLanguage string values and must be <code>NULL</code> for all other
string values.<br>
<br>
The <code>format</code> parameter uses formatting characters compatible with the
printf family of standard functions. Additional arguments are passed in the
stdarg pointer <code>ap</code>. The formatted string is truncated as needed to the
maximum length of the corresponding value type.
</p>
<h3 class="function"><a id="ippAddStrings">ippAddStrings</a></h3>
<p class="description">Add language-encoded strings to an IPP message.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>group</th>
<td class="description">IPP group</td></tr>
<tr><th>value_tag</th>
<td class="description">Type of attribute</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>num_values</th>
<td class="description">Number of values</td></tr>
<tr><th>language</th>
<td class="description">Language code (<code>NULL</code> for default)</td></tr>
<tr><th>values</th>
<td class="description">Values</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).<br>
<br>
Supported string values include charset (<code>IPP_TAG_CHARSET</code>), keyword
(<code>IPP_TAG_KEYWORD</code>), language (<code>IPP_TAG_LANGUAGE</code>), mimeMediaType
(<code>IPP_TAG_MIMETYPE</code>), name (<code>IPP_TAG_NAME</code>), nameWithLanguage
(<code>IPP_TAG_NAMELANG), text (</code>code IPP_TAG_TEXT@), textWithLanguage
(<code>IPP_TAG_TEXTLANG</code>), uri (<code>IPP_TAG_URI</code>), and uriScheme
(<code>IPP_TAG_URISCHEME</code>).<br>
<br>
The <code>language</code> parameter must be non-<code>NULL</code> for nameWithLanguage and
textWithLanguage string values and must be <code>NULL</code> for all other string values.</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippAttributeString">ippAttributeString</a></h3>
<p class="description">Convert the attribute's value to a string.</p>
<p class="code">
size_t ippAttributeString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, char *buffer, size_t bufsize);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">Attribute</td></tr>
<tr><th>buffer</th>
<td class="description">String buffer or NULL</td></tr>
<tr><th>bufsize</th>
<td class="description">Size of string buffer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of bytes less nul</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Returns the number of bytes that would be written, not including the
trailing nul. The buffer pointer can be NULL to get the required length,
just like (v)snprintf.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippContainsInteger">ippContainsInteger</a></h3>
<p class="description">Determine whether an attribute contains the
specified value or is within the list of ranges.</p>
<p class="code">
int ippContainsInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">Attribute</td></tr>
<tr><th>value</th>
<td class="description">Integer/enum value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on a match, 0 on no match</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Returns non-zero when the attribute contains either a matching integer or
enum value, or the value falls within one of the rangeOfInteger values for
the attribute.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippContainsString">ippContainsString</a></h3>
<p class="description">Determine whether an attribute contains the
specified string value.</p>
<p class="code">
int ippContainsString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, const char *value);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">Attribute</td></tr>
<tr><th>value</th>
<td class="description">String value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on a match, 0 on no match</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Returns non-zero when the attribute contains a matching charset, keyword,
naturalLanguage, mimeMediaType, name, text, uri, or uriScheme value.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippCopyAttribute">ippCopyAttribute</a></h3>
<p class="description">Copy an attribute.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dst</th>
<td class="description">Destination IPP message</td></tr>
<tr><th>srcattr</th>
<td class="description">Attribute to copy</td></tr>
<tr><th>quickcopy</th>
<td class="description">1 for a referenced copy, 0 for normal</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The specified attribute, <code>attr</code>, is copied to the destination IPP message.
When <code>quickcopy</code> is non-zero, a "shallow" reference copy of the attribute is
created - this should only be done as long as the original source IPP message will
not be freed for the life of the destination.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippCopyAttributes">ippCopyAttributes</a></h3>
<p class="description">Copy attributes from one IPP message to another.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dst</th>
<td class="description">Destination IPP message</td></tr>
<tr><th>src</th>
<td class="description">Source IPP message</td></tr>
<tr><th>quickcopy</th>
<td class="description">1 for a referenced copy, 0 for normal</td></tr>
<tr><th>cb</th>
<td class="description">Copy callback or <code>NULL</code> for none</td></tr>
<tr><th>context</th>
<td class="description">Context pointer</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Zero or more attributes are copied from the source IPP message, <code>src</code>, to the
destination IPP message, <code>dst</code>. When <code>quickcopy</code> is non-zero, a "shallow"
reference copy of the attribute is created - this should only be done as long as the
original source IPP message will not be freed for the life of the destination.<br>
<br>
The <code>cb</code> and <code>context</code> parameters provide a generic way to "filter" the
attributes that are copied - the function must return 1 to copy the attribute or
0 to skip it. The function may also choose to do a partial copy of the source attribute
itself.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippCreateRequestedArray">ippCreateRequestedArray</a></h3>
<p class="description">Create a CUPS array of attribute names from the
given requested-attributes attribute.</p>
<p class="code">
cups_array_t *ippCreateRequestedArray(<a href="#ipp_t">ipp_t</a> *request);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>request</th>
<td class="description">IPP request</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">CUPS array or <code>NULL</code> if all</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function creates a (sorted) CUPS array of attribute names matching the
list of "requested-attribute" values supplied in an IPP request. All IANA-
registered values are supported in addition to the CUPS IPP extension
attributes.<br>
<br>
The <code>request</code> parameter specifies the request message that was read from
the client.
<code>NULL</code> is returned if all attributes should be returned. Otherwise, the
result is a sorted array of attribute names, where <code>cupsArrayFind(array,
"attribute-name")</code> will return a non-NULL pointer. The array must be freed
using the <code>cupsArrayDelete</code> function.
</p>
<h3 class="function"><a id="ippDateToTime">ippDateToTime</a></h3>
<p class="description">Convert from RFC 2579 Date/Time format to time in
seconds.</p>
<p class="code">
time_t ippDateToTime(const <a href="#ipp_uchar_t">ipp_uchar_t</a> *date);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>date</th>
<td class="description">RFC 2579 date info</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">UNIX time value</p>
<h3 class="function"><a id="ippDelete">ippDelete</a></h3>
<p class="description">Delete an IPP message.</p>
<p class="code">
void ippDelete(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippDeleteAttribute">ippDeleteAttribute</a></h3>
<p class="description">Delete a single attribute in an IPP message.</p>
<p class="code">
void ippDeleteAttribute(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">Attribute to delete</td></tr>
</tbody></table>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippDeleteValues">ippDeleteValues</a></h3>
<p class="description">Delete values in an attribute.</p>
<p class="code">
int ippDeleteValues(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int count);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">Attribute</td></tr>
<tr><th>element</th>
<td class="description">Index of first value to delete (0-based)</td></tr>
<tr><th>count</th>
<td class="description">Number of values to delete</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>element</code> parameter specifies the first value to delete, starting at
0. It must be less than the number of values returned by <a href="#ippGetCount"><code>ippGetCount</code></a>.<br>
<br>
The <code>attr</code> parameter may be modified as a result of setting the value.<br>
<br>
Deleting all values in an attribute deletes the attribute.
</p>
<h3 class="function"><a id="ippEnumString">ippEnumString</a></h3>
<p class="description">Return a string corresponding to the enum value.</p>
<p class="code">
const char *ippEnumString(const char *attrname, int enumvalue);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attrname</th>
<td class="description">Attribute name</td></tr>
<tr><th>enumvalue</th>
<td class="description">Enum value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Enum string</p>
<h3 class="function"><a id="ippEnumValue">ippEnumValue</a></h3>
<p class="description">Return the value associated with a given enum string.</p>
<p class="code">
int ippEnumValue(const char *attrname, const char *enumstring);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attrname</th>
<td class="description">Attribute name</td></tr>
<tr><th>enumstring</th>
<td class="description">Enum string</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Enum value or -1 if unknown</p>
<h3 class="function"><a id="ippErrorString">ippErrorString</a></h3>
<p class="description">Return a name for the given status code.</p>
<p class="code">
const char *ippErrorString(ipp_status_t error);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>error</th>
<td class="description">Error status</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Text string</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippErrorValue">ippErrorValue</a></h3>
<p class="description">Return a status code for the given name.</p>
<p class="code">
ipp_status_t ippErrorValue(const char *name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP status code</p>
<h3 class="function"><a id="ippFindAttribute">ippFindAttribute</a></h3>
<p class="description">Find a named attribute in a request.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>type</th>
<td class="description">Type of attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Matching attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
of attribute and member names separated by slashes, for example
"media-col/media-size".</p>
<h3 class="function"><a id="ippFindNextAttribute">ippFindNextAttribute</a></h3>
<p class="description">Find the next named attribute in a request.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>name</th>
<td class="description">Name of attribute</td></tr>
<tr><th>type</th>
<td class="description">Type of attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Matching attribute</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">Starting with CUPS 2.0, the attribute name can contain a hierarchical list
of attribute and member names separated by slashes, for example
"media-col/media-size".</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippFirstAttribute">ippFirstAttribute</a></h3>
<p class="description">Return the first attribute in the message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippFirstAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">First attribute or <code>NULL</code> if none</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetBoolean">ippGetBoolean</a></h3>
<p class="description">Get a boolean value for an attribute.</p>
<p class="code">
int ippGetBoolean(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Boolean value or 0 on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
<code>ippGetCount(attr)</code> - 1.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetCollection">ippGetCollection</a></h3>
<p class="description">Get a collection value for an attribute.</p>
<p class="code">
<a href="#ipp_t">ipp_t</a> *ippGetCollection(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Collection value or <code>NULL</code> on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
<code>ippGetCount(attr)</code> - 1.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetCount">ippGetCount</a></h3>
<p class="description">Get the number of values in an attribute.</p>
<p class="code">
int ippGetCount(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Number of values or 0 on error</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetDate">ippGetDate</a></h3>
<p class="description">Get a dateTime value for an attribute.</p>
<p class="code">
const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippGetDate(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">dateTime value or <code>NULL</code></p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
<code>ippGetCount(attr)</code> - 1.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetGroupTag">ippGetGroupTag</a></h3>
<p class="description">Get the group associated with an attribute.</p>
<p class="code">
ipp_tag_t ippGetGroupTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Group tag or <code>IPP_TAG_ZERO</code> on error</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetInteger">ippGetInteger</a></h3>
<p class="description">Get the integer/enum value for an attribute.</p>
<p class="code">
int ippGetInteger(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Value or 0 on error</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
<code>ippGetCount(attr)</code> - 1.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetName">ippGetName</a></h3>
<p class="description">Get the attribute name.</p>
<p class="code">
const char *ippGetName(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Attribute name or <code>NULL</code> for separators</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippGetOctetString">ippGetOctetString</a></h3>
<p class="description">Get an octetString value from an IPP attribute.</p>
<p class="code">
void *ippGetOctetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *datalen);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
<tr><th>datalen</th>
<td class="description">Length of octetString data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Pointer to octetString data</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
<code>ippGetCount(attr)</code> - 1.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetOperation">ippGetOperation</a></h3>
<p class="description">Get the operation ID in an IPP message.</p>
<p class="code">
ipp_op_t ippGetOperation(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP request message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Operation ID or 0 on error</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetRange">ippGetRange</a></h3>
<p class="description">Get a rangeOfInteger value from an attribute.</p>
<p class="code">
int ippGetRange(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, int *uppervalue);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
<tr><th>uppervalue</th>
<td class="description">Upper value of range</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Lower value of range or 0</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
<code>ippGetCount(attr)</code> - 1.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetRequestId">ippGetRequestId</a></h3>
<p class="description">Get the request ID from an IPP message.</p>
<p class="code">
int ippGetRequestId(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Request ID or 0 on error</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetResolution">ippGetResolution</a></h3>
<p class="description">Get a resolution value for an attribute.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
<tr><th>yres</th>
<td class="description">Vertical/feed resolution</td></tr>
<tr><th>units</th>
<td class="description">Units for resolution</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Horizontal/cross feed resolution or 0</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
<code>ippGetCount(attr)</code> - 1.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetState">ippGetState</a></h3>
<p class="description">Get the IPP message state.</p>
<p class="code">
<a href="#ipp_state_t">ipp_state_t</a> ippGetState(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP message state value</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetStatusCode">ippGetStatusCode</a></h3>
<p class="description">Get the status code from an IPP response or event message.</p>
<p class="code">
ipp_status_t ippGetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP response or event message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Status code in IPP message</p>
<h3 class="function"><a id="ippGetString">ippGetString</a></h3>
<p class="description"></p>
<p class="code">
const char *ippGetString(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr, int element, const char **language);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
<tr><th>language</th>
<td class="description">Language code (<code>NULL</code> for don't care)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Get the string and optionally the language code for an attribute.</p>
<p class="discussion">The <code>element</code> parameter specifies which value to get from 0 to
<code>ippGetCount(attr)</code> - 1.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetValueTag">ippGetValueTag</a></h3>
<p class="description">Get the value tag for an attribute.</p>
<p class="code">
ipp_tag_t ippGetValueTag(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Value tag or <code>IPP_TAG_ZERO</code> on error</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippGetVersion">ippGetVersion</a></h3>
<p class="description">Get the major and minor version number from an IPP message.</p>
<p class="code">
int ippGetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int *minor);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>minor</th>
<td class="description">Minor version number or <code>NULL</code> for don't care</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Major version number or 0 on error</p>
<h3 class="function"><a id="ippLength">ippLength</a></h3>
<p class="description">Compute the length of an IPP message.</p>
<p class="code">
size_t ippLength(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Size of IPP message</p>
<h3 class="function"><a id="ippNew">ippNew</a></h3>
<p class="description">Allocate a new IPP message.</p>
<p class="code">
<a href="#ipp_t">ipp_t</a> *ippNew(void);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">New IPP message</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippNewRequest">ippNewRequest</a></h3>
<p class="description">Allocate a new IPP request message.</p>
<p class="code">
<a href="#ipp_t">ipp_t</a> *ippNewRequest(ipp_op_t op);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>op</th>
<td class="description">Operation code</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP request message</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The new request message is initialized with the "attributes-charset" and
"attributes-natural-language" attributes added. The
"attributes-natural-language" value is derived from the current locale.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippNewResponse">ippNewResponse</a></h3>
<p class="description">Allocate a new IPP response message.</p>
<p class="code">
<a href="#ipp_t">ipp_t</a> *ippNewResponse(<a href="#ipp_t">ipp_t</a> *request);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>request</th>
<td class="description">IPP request message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">IPP response message</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The new response message is initialized with the same "version-number",
"request-id", "attributes-charset", and "attributes-natural-language" as the
provided request message. If the "attributes-charset" or
"attributes-natural-language" attributes are missing from the request,
'utf-8' and a value derived from the current locale are substituted,
respectively.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippNextAttribute">ippNextAttribute</a></h3>
<p class="description">Return the next attribute in the message.</p>
<p class="code">
<a href="#ipp_attribute_t">ipp_attribute_t</a> *ippNextAttribute(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Next attribute or <code>NULL</code> if none</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippOpString">ippOpString</a></h3>
<p class="description">Return a name for the given operation id.</p>
<p class="code">
const char *ippOpString(ipp_op_t op);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>op</th>
<td class="description">Operation ID</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Name</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippOpValue">ippOpValue</a></h3>
<p class="description">Return an operation id for the given name.</p>
<p class="code">
ipp_op_t ippOpValue(const char *name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Textual name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Operation ID</p>
<h3 class="function"><a id="ippPort">ippPort</a></h3>
<p class="description">Return the default IPP port number.</p>
<p class="code">
int ippPort(void);</p>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Port number</p>
<h3 class="function"><a id="ippRead">ippRead</a></h3>
<p class="description">Read data for an IPP message from a HTTP connection.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>ipp</th>
<td class="description">IPP data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Current state</p>
<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippReadFile">ippReadFile</a></h3>
<p class="description">Read data for an IPP message from a file.</p>
<p class="code">
<a href="#ipp_state_t">ipp_state_t</a> ippReadFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fd</th>
<td class="description">HTTP data</td></tr>
<tr><th>ipp</th>
<td class="description">IPP data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Current state</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippReadIO">ippReadIO</a></h3>
<p class="description">Read data for an IPP message.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>src</th>
<td class="description">Data source</td></tr>
<tr><th>cb</th>
<td class="description">Read callback function</td></tr>
<tr><th>blocking</th>
<td class="description">Use blocking IO?</td></tr>
<tr><th>parent</th>
<td class="description">Parent request, if any</td></tr>
<tr><th>ipp</th>
<td class="description">IPP data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Current state</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetBoolean">ippSetBoolean</a></h3>
<p class="description">Set a boolean value in an attribute.</p>
<p class="code">
int ippSetBoolean(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int boolvalue);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
<tr><th>boolvalue</th>
<td class="description">Boolean value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>attr</code> parameter may be modified as a result of setting the value.<br>
<br>
The <code>element</code> parameter specifies which value to set from 0 to
<code>ippGetCount(attr)</code>.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetCollection">ippSetCollection</a></h3>
<p class="description">Set a collection value in an attribute.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
<tr><th>colvalue</th>
<td class="description">Collection value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>attr</code> parameter may be modified as a result of setting the value.<br>
<br>
The <code>element</code> parameter specifies which value to set from 0 to
<code>ippGetCount(attr)</code>.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetDate">ippSetDate</a></h3>
<p class="description">Set a dateTime value in an attribute.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
<tr><th>datevalue</th>
<td class="description">dateTime value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>attr</code> parameter may be modified as a result of setting the value.<br>
<br>
The <code>element</code> parameter specifies which value to set from 0 to
<code>ippGetCount(attr)</code>.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetGroupTag">ippSetGroupTag</a></h3>
<p class="description">Set the group tag of an attribute.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">Attribute</td></tr>
<tr><th>group_tag</th>
<td class="description">Group tag</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>attr</code> parameter may be modified as a result of setting the value.<br>
<br>
The <code>group</code> parameter specifies the IPP attribute group tag: none
(<code>IPP_TAG_ZERO</code>, for member attributes), document (<code>IPP_TAG_DOCUMENT</code>),
event notification (<code>IPP_TAG_EVENT_NOTIFICATION</code>), operation
(<code>IPP_TAG_OPERATION</code>), printer (<code>IPP_TAG_PRINTER</code>), subscription
(<code>IPP_TAG_SUBSCRIPTION</code>), or unsupported (<code>IPP_TAG_UNSUPPORTED_GROUP</code>).
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetInteger">ippSetInteger</a></h3>
<p class="description">Set an integer or enum value in an attribute.</p>
<p class="code">
int ippSetInteger(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, int element, int intvalue);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
<tr><th>intvalue</th>
<td class="description">Integer/enum value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>attr</code> parameter may be modified as a result of setting the value.<br>
<br>
The <code>element</code> parameter specifies which value to set from 0 to
<code>ippGetCount(attr)</code>.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetName">ippSetName</a></h3>
<p class="description">Set the name of an attribute.</p>
<p class="code">
int ippSetName(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_attribute_t">ipp_attribute_t</a> **attr, const char *name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>name</th>
<td class="description">Attribute name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>attr</code> parameter may be modified as a result of setting the value.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippSetOctetString">ippSetOctetString</a></h3>
<p class="description">Set an octetString value in an IPP attribute.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
<tr><th>data</th>
<td class="description">Pointer to octetString data</td></tr>
<tr><th>datalen</th>
<td class="description">Length of octetString data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>attr</code> parameter may be modified as a result of setting the value.<br>
<br>
The <code>element</code> parameter specifies which value to set from 0 to
<code>ippGetCount(attr)</code>.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetOperation">ippSetOperation</a></h3>
<p class="description">Set the operation ID in an IPP request message.</p>
<p class="code">
int ippSetOperation(<a href="#ipp_t">ipp_t</a> *ipp, ipp_op_t op);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP request message</td></tr>
<tr><th>op</th>
<td class="description">Operation ID</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
</p>
<h3 class="function"><a id="ippSetPort">ippSetPort</a></h3>
<p class="description">Set the default port number.</p>
<p class="code">
void ippSetPort(int p);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>p</th>
<td class="description">Port number to use</td></tr>
</tbody></table>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetRange">ippSetRange</a></h3>
<p class="description">Set a rangeOfInteger value in an attribute.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
<tr><th>lowervalue</th>
<td class="description">Lower bound for range</td></tr>
<tr><th>uppervalue</th>
<td class="description">Upper bound for range</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>attr</code> parameter may be modified as a result of setting the value.<br>
<br>
The <code>element</code> parameter specifies which value to set from 0 to
<code>ippGetCount(attr)</code>.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetRequestId">ippSetRequestId</a></h3>
<p class="description">Set the request ID in an IPP message.</p>
<p class="code">
int ippSetRequestId(<a href="#ipp_t">ipp_t</a> *ipp, int request_id);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>request_id</th>
<td class="description">Request ID</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>request_id</code> parameter must be greater than 0.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetResolution">ippSetResolution</a></h3>
<p class="description">Set a resolution value in an attribute.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
<tr><th>unitsvalue</th>
<td class="description">Resolution units</td></tr>
<tr><th>xresvalue</th>
<td class="description">Horizontal/cross feed resolution</td></tr>
<tr><th>yresvalue</th>
<td class="description">Vertical/feed resolution</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>attr</code> parameter may be modified as a result of setting the value.<br>
<br>
The <code>element</code> parameter specifies which value to set from 0 to
<code>ippGetCount(attr)</code>.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetState">ippSetState</a></h3>
<p class="description">Set the current state of the IPP message.</p>
<p class="code">
int ippSetState(<a href="#ipp_t">ipp_t</a> *ipp, <a href="#ipp_state_t">ipp_state_t</a> state);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>state</th>
<td class="description">IPP state value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetStatusCode">ippSetStatusCode</a></h3>
<p class="description">Set the status code in an IPP response or event message.</p>
<p class="code">
int ippSetStatusCode(<a href="#ipp_t">ipp_t</a> *ipp, ipp_status_t status);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP response or event message</td></tr>
<tr><th>status</th>
<td class="description">Status code</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetString">ippSetString</a></h3>
<p class="description">Set a string value in an attribute.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
<tr><th>strvalue</th>
<td class="description">String value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>attr</code> parameter may be modified as a result of setting the value.<br>
<br>
The <code>element</code> parameter specifies which value to set from 0 to
<code>ippGetCount(attr)</code>.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippSetStringf">ippSetStringf</a></h3>
<p class="description">Set a formatted string value of an attribute.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
<tr><th>format</th>
<td class="description">Printf-style format string</td></tr>
<tr><th>...</th>
<td class="description">Additional arguments as needed</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>attr</code> parameter may be modified as a result of setting the value.<br>
<br>
The <code>element</code> parameter specifies which value to set from 0 to
<code>ippGetCount(attr)</code>.<br>
<br>
The <code>format</code> parameter uses formatting characters compatible with the
printf family of standard functions. Additional arguments follow it as
needed. The formatted string is truncated as needed to the maximum length of
the corresponding value type.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippSetStringfv">ippSetStringfv</a></h3>
<p class="description">Set a formatted string value of an attribute.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>element</th>
<td class="description">Value number (0-based)</td></tr>
<tr><th>format</th>
<td class="description">Printf-style format string</td></tr>
<tr><th>ap</th>
<td class="description">Pointer to additional arguments</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>attr</code> parameter may be modified as a result of setting the value.<br>
<br>
The <code>element</code> parameter specifies which value to set from 0 to
<code>ippGetCount(attr)</code>.<br>
<br>
The <code>format</code> parameter uses formatting characters compatible with the
printf family of standard functions. Additional arguments follow it as
needed. The formatted string is truncated as needed to the maximum length of
the corresponding value type.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetValueTag">ippSetValueTag</a></h3>
<p class="description">Set the value tag of an attribute.</p>
<p class="code">
int 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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>attr</th>
<td class="description">IPP attribute</td></tr>
<tr><th>value_tag</th>
<td class="description">Value tag</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The <code>attr</code> parameter may be modified as a result of setting the value.<br>
<br>
Integer (<code>IPP_TAG_INTEGER</code>) values can be promoted to rangeOfInteger
(<code>IPP_TAG_RANGE</code>) values, the various string tags can be promoted to name
(<code>IPP_TAG_NAME</code>) or nameWithLanguage (<code>IPP_TAG_NAMELANG</code>) values, text
(<code>IPP_TAG_TEXT</code>) values can be promoted to textWithLanguage
(<code>IPP_TAG_TEXTLANG</code>) values, and all values can be demoted to the various
out-of-band value tags such as no-value (<code>IPP_TAG_NOVALUE</code>). All other changes
will be rejected.<br>
<br>
Promoting a string attribute to nameWithLanguage or textWithLanguage adds the language
code in the "attributes-natural-language" attribute or, if not present, the language
code for the current locale.
</p>
<h3 class="function"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="ippSetVersion">ippSetVersion</a></h3>
<p class="description">Set the version number in an IPP message.</p>
<p class="code">
int ippSetVersion(<a href="#ipp_t">ipp_t</a> *ipp, int major, int minor);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
<tr><th>major</th>
<td class="description">Major version number (major.minor)</td></tr>
<tr><th>minor</th>
<td class="description">Minor version number (major.minor)</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 on success, 0 on failure</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The <code>ipp</code> parameter refers to an IPP message previously created using
the <a href="#ippNew"><code>ippNew</code></a>, <a href="#ippNewRequest"><code>ippNewRequest</code></a>, or <a href="#ippNewResponse"><code>ippNewResponse</code></a> functions.<br>
<br>
The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2.
</p>
<h3 class="function"><span class="info"> CUPS 2.0/OS 10.10 </span><a id="ippStateString">ippStateString</a></h3>
<p class="description">Return the name corresponding to a state value.</p>
<p class="code">
const char *ippStateString(<a href="#ipp_state_t">ipp_state_t</a> state);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>state</th>
<td class="description">State value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">State name</p>
<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="ippTagString">ippTagString</a></h3>
<p class="description">Return the tag name corresponding to a tag value.</p>
<p class="code">
const char *ippTagString(ipp_tag_t tag);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>tag</th>
<td class="description">Tag value</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Tag name</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The returned names are defined in RFC 8011 and the IANA IPP Registry.
</p>
<h3 class="function"><span class="info"> CUPS 1.4/macOS 10.6 </span><a id="ippTagValue">ippTagValue</a></h3>
<p class="description">Return the tag value corresponding to a tag name.</p>
<p class="code">
ipp_tag_t ippTagValue(const char *name);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>name</th>
<td class="description">Tag name</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Tag value</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">The tag names are defined in RFC 8011 and the IANA IPP Registry.
</p>
<h3 class="function"><a id="ippTimeToDate">ippTimeToDate</a></h3>
<p class="description">Convert from time in seconds to RFC 2579 format.</p>
<p class="code">
const <a href="#ipp_uchar_t">ipp_uchar_t</a> *ippTimeToDate(time_t t);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>t</th>
<td class="description">Time in seconds</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">RFC-2579 date/time data</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippValidateAttribute">ippValidateAttribute</a></h3>
<p class="description">Validate the contents of an attribute.</p>
<p class="code">
int ippValidateAttribute(<a href="#ipp_attribute_t">ipp_attribute_t</a> *attr);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>attr</th>
<td class="description">Attribute</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 if valid, 0 otherwise</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function validates the contents of an attribute based on the name and
value tag. 1 is returned if the attribute is valid, 0 otherwise. On
failure, <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> is set to a human-readable message.
</p>
<h3 class="function"><span class="info"> CUPS 1.7/macOS 10.9 </span><a id="ippValidateAttributes">ippValidateAttributes</a></h3>
<p class="description">Validate all attributes in an IPP message.</p>
<p class="code">
int ippValidateAttributes(<a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>ipp</th>
<td class="description">IPP message</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">1 if valid, 0 otherwise</p>
<h4 class="discussion">Discussion</h4>
<p class="discussion">This function validates the contents of the IPP message, including each
attribute. Like <a href="#ippValidateAttribute"><code>ippValidateAttribute</code></a>, <a href="#cupsLastErrorString"><code>cupsLastErrorString</code></a> is
set to a human-readable message on failure.
</p>
<h3 class="function"><a id="ippWrite">ippWrite</a></h3>
<p class="description">Write data for an IPP message to a HTTP connection.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>http</th>
<td class="description">HTTP connection</td></tr>
<tr><th>ipp</th>
<td class="description">IPP data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Current state</p>
<h3 class="function"><span class="info"> CUPS 1.1.19/macOS 10.3 </span><a id="ippWriteFile">ippWriteFile</a></h3>
<p class="description">Write data for an IPP message to a file.</p>
<p class="code">
<a href="#ipp_state_t">ipp_state_t</a> ippWriteFile(int fd, <a href="#ipp_t">ipp_t</a> *ipp);</p>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>fd</th>
<td class="description">HTTP data</td></tr>
<tr><th>ipp</th>
<td class="description">IPP data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Current state</p>
<h3 class="function"><span class="info"> CUPS 1.2/macOS 10.5 </span><a id="ippWriteIO">ippWriteIO</a></h3>
<p class="description">Write data for an IPP message.</p>
<p class="code">
<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>
<h4 class="parameters">Parameters</h4>
<table class="list"><tbody>
<tr><th>dst</th>
<td class="description">Destination</td></tr>
<tr><th>cb</th>
<td class="description">Write callback function</td></tr>
<tr><th>blocking</th>
<td class="description">Use blocking IO?</td></tr>
<tr><th>parent</th>
<td class="description">Parent IPP message</td></tr>
<tr><th>ipp</th>
<td class="description">IPP data</td></tr>
</tbody></table>
<h4 class="returnvalue">Return Value</h4>
<p class="description">Current state</p>
<h2 class="title"><a id="TYPES">Data Types</a></h2>
<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>
<p class="description">Client credentials callback
</p>
<p class="code">
typedef int(*)(http_t *http, void *tls, cups_array_t *distinguished_names, void *user_data)cups_client_cert_cb_t;
</p>
<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>
<p class="description">Destination enumeration callback
</p>
<p class="code">
typedef int(*)(void *user_data, unsigned flags, <a href="#cups_dest_t">cups_dest_t</a> *dest)cups_dest_cb_t;
</p>
<h3 class="typedef"><a id="cups_dest_t">cups_dest_t</a></h3>
<p class="description">Destination</p>
<p class="code">
typedef struct <a href="#cups_dest_s">cups_dest_s</a> cups_dest_t;
</p>
<h3 class="typedef"><a id="cups_dinfo_t"><span class="info"> CUPS 1.6/macOS 10.8 </span>cups_dinfo_t</a></h3>
<p class="description">Destination capability and status
information </p>
<p class="code">
typedef struct _cups_dinfo_s cups_dinfo_t;
</p>
<h3 class="typedef"><a id="cups_job_t">cups_job_t</a></h3>
<p class="description">Job</p>
<p class="code">
typedef struct <a href="#cups_job_s">cups_job_s</a> cups_job_t;
</p>
<h3 class="typedef"><a id="cups_option_t">cups_option_t</a></h3>
<p class="description">Printer Options</p>
<p class="code">
typedef struct <a href="#cups_option_s">cups_option_s</a> cups_option_t;
</p>
<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>
<p class="description">New password callback
</p>
<p class="code">
typedef 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;
</p>
<h3 class="typedef"><a id="cups_ptype_t">cups_ptype_t</a></h3>
<p class="description">Printer type/capability bits</p>
<p class="code">
typedef unsigned cups_ptype_t;
</p>
<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>
<p class="description">Server credentials callback
</p>
<p class="code">
typedef int(*)(http_t *http, void *tls, cups_array_t *certs, void *user_data)cups_server_cert_cb_t;
</p>
<h3 class="typedef"><a id="cups_size_t"><span class="info"> CUPS 1.6/macOS 10.8 </span>cups_size_t</a></h3>
<p class="description">Media Size </p>
<p class="code">
typedef struct <a href="#cups_size_s">cups_size_s</a> cups_size_t;
</p>
<h3 class="typedef"><a id="http_addr_t"><span class="info"> CUPS 1.2/macOS 10.5 </span>http_addr_t</a></h3>
<p class="description">Socket address union, which
makes using IPv6 and other
address types easier and
more portable. </p>
<p class="code">
typedef union _http_addr_u / http_addr_t;
</p>
<h3 class="typedef"><a id="http_encoding_t">http_encoding_t</a></h3>
<p class="description">HTTP transfer encoding values</p>
<p class="code">
typedef enum <a href="#http_encoding_e">http_encoding_e</a> http_encoding_t;
</p>
<h3 class="typedef"><a id="http_encryption_t">http_encryption_t</a></h3>
<p class="description">HTTP encryption values</p>
<p class="code">
typedef enum <a href="#http_encryption_e">http_encryption_e</a> http_encryption_t;
</p>
<h3 class="typedef"><a id="http_field_t">http_field_t</a></h3>
<p class="description">HTTP field names</p>
<p class="code">
typedef enum <a href="#http_field_e">http_field_e</a> http_field_t;
</p>
<h3 class="typedef"><a id="http_keepalive_t">http_keepalive_t</a></h3>
<p class="description">HTTP keep-alive values</p>
<p class="code">
typedef enum <a href="#http_keepalive_e">http_keepalive_e</a> http_keepalive_t;
</p>
<h3 class="typedef"><a id="http_state_t">http_state_t</a></h3>
<p class="description">HTTP state values; states
are server-oriented...</p>
<p class="code">
typedef enum <a href="#http_state_e">http_state_e</a> http_state_t;
</p>
<h3 class="typedef"><a id="http_t">http_t</a></h3>
<p class="description">HTTP connection type</p>
<p class="code">
typedef struct _http_s http_t;
</p>
<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>
<p class="description">HTTP timeout callback </p>
<p class="code">
typedef int(*)(http_t *http, void *user_data)http_timeout_cb_t;
</p>
<h3 class="typedef"><a id="http_trust_t"><span class="info"> CUPS 2.0/OS 10.10 </span>http_trust_t</a></h3>
<p class="description">Level of trust for credentials </p>
<p class="code">
typedef enum <a href="#http_trust_e">http_trust_e</a> http_trust_t;
</p>
<h3 class="typedef"><a id="http_uri_coding_t">http_uri_coding_t</a></h3>
<p class="description">URI en/decode flags</p>
<p class="code">
typedef enum <a href="#http_uri_coding_e">http_uri_coding_e</a> http_uri_coding_t;
</p>
<h3 class="typedef"><a id="http_uri_status_t"><span class="info"> CUPS 1.2 </span>http_uri_status_t</a></h3>
<p class="description">URI separation status </p>
<p class="code">
typedef enum <a href="#http_uri_status_e">http_uri_status_e</a> http_uri_status_t;
</p>
<h3 class="typedef"><a id="ipp_attribute_t">ipp_attribute_t</a></h3>
<p class="description">IPP attribute</p>
<p class="code">
typedef struct _ipp_attribute_s ipp_attribute_t;
</p>
<h3 class="typedef"><a id="ipp_copycb_t"><span class="info"> CUPS 1.6/macOS 10.8 </span>ipp_copycb_t</a></h3>
<p class="description">ippCopyAttributes callback function </p>
<p class="code">
typedef int(*)(void *context, <a href="#ipp_t">ipp_t</a> *dst, <a href="#ipp_attribute_t">ipp_attribute_t</a> *attr)ipp_copycb_t;
</p>
<h3 class="typedef"><a id="ipp_iocb_t"><span class="info"> CUPS 1.2/macOS 10.5 </span>ipp_iocb_t</a></h3>
<p class="description">ippReadIO/ippWriteIO callback function </p>
<p class="code">
typedef ssize_t(*)(void *context, ipp_uchar_t *buffer, size_t bytes) ipp_iocb_t;
</p>
<h3 class="typedef"><a id="ipp_orient_t">ipp_orient_t</a></h3>
<p class="description">Orientation values</p>
<p class="code">
typedef enum <a href="#ipp_orient_e">ipp_orient_e</a> ipp_orient_t;
</p>
<h3 class="typedef"><a id="ipp_pstate_t">ipp_pstate_t</a></h3>
<p class="description">Printer state values</p>
<p class="code">
typedef enum <a href="#ipp_pstate_e">ipp_pstate_e</a> ipp_pstate_t;
</p>
<h3 class="typedef"><a id="ipp_quality_t">ipp_quality_t</a></h3>
<p class="description">Print quality values</p>
<p class="code">
typedef enum <a href="#ipp_quality_e">ipp_quality_e</a> ipp_quality_t;
</p>
<h3 class="typedef"><a id="ipp_res_t">ipp_res_t</a></h3>
<p class="description">Resolution units</p>
<p class="code">
typedef enum <a href="#ipp_res_e">ipp_res_e</a> ipp_res_t;
</p>
<h3 class="typedef"><a id="ipp_state_t">ipp_state_t</a></h3>
<p class="description">ipp_t state values</p>
<p class="code">
typedef enum <a href="#ipp_state_e">ipp_state_e</a> ipp_state_t;
</p>
<h3 class="typedef"><a id="ipp_t">ipp_t</a></h3>
<p class="description">IPP request/response data</p>
<p class="code">
typedef struct _ipp_s ipp_t;
</p>
<h2 class="title"><a id="STRUCTURES">Structures</a></h2>
<h3 class="struct"><a id="cups_dest_s">cups_dest_s</a></h3>
<p class="description">Destination</p>
<p class="code">struct cups_dest_s {<br>
    char *name, *instance;<br>
    int is_default;<br>
    int num_options;<br>
    <a href="#cups_option_t">cups_option_t</a> *options;<br>
};</p>
<h4 class="members">Members</h4>
<table class="list"><tbody>
<tr><th>instance </th>
<td class="description">Local instance name or NULL</td></tr>
<tr><th>is_default </th>
<td class="description">Is this printer the default?</td></tr>
<tr><th>num_options </th>
<td class="description">Number of options</td></tr>
<tr><th>options </th>
<td class="description">Options</td></tr>
</tbody></table>
<h3 class="struct"><a id="cups_job_s">cups_job_s</a></h3>
<p class="description">Job</p>
<p class="code">struct cups_job_s {<br>
    time_t completed_time;<br>
    time_t creation_time;<br>
    char *dest;<br>
    char *format;<br>
    int id;<br>
    int priority;<br>
    time_t processing_time;<br>
    int size;<br>
    ipp_jstate_t state;<br>
    char *title;<br>
    char *user;<br>
};</p>
<h4 class="members">Members</h4>
<table class="list"><tbody>
<tr><th>completed_time </th>
<td class="description">Time the job was completed</td></tr>
<tr><th>creation_time </th>
<td class="description">Time the job was created</td></tr>
<tr><th>dest </th>
<td class="description">Printer or class name</td></tr>
<tr><th>format </th>
<td class="description">Document format</td></tr>
<tr><th>id </th>
<td class="description">The job ID</td></tr>
<tr><th>priority </th>
<td class="description">Priority (1-100)</td></tr>
<tr><th>processing_time </th>
<td class="description">Time the job was processed</td></tr>
<tr><th>size </th>
<td class="description">Size in kilobytes</td></tr>
<tr><th>state </th>
<td class="description">Job state</td></tr>
<tr><th>title </th>
<td class="description">Title/job name</td></tr>
<tr><th>user </th>
<td class="description">User that submitted the job</td></tr>
</tbody></table>
<h3 class="struct"><a id="cups_option_s">cups_option_s</a></h3>
<p class="description">Printer Options</p>
<p class="code">struct cups_option_s {<br>
    char *name;<br>
    char *value;<br>
};</p>
<h4 class="members">Members</h4>
<table class="list"><tbody>
<tr><th>name </th>
<td class="description">Name of option</td></tr>
<tr><th>value </th>
<td class="description">Value of option</td></tr>
</tbody></table>
<h3 class="struct"><span class="info"> CUPS 1.6/macOS 10.8 </span><a id="cups_size_s">cups_size_s</a></h3>
<p class="description">Media Size </p>
<p class="code">struct cups_size_s {<br>
    char media[128];<br>
    int width, length, bottom, left, right, top;<br>
};</p>
<h4 class="members">Members</h4>
<table class="list"><tbody>
<tr><th>media[128] </th>
<td class="description">Media name to use</td></tr>
<tr><th>top </th>
<td class="description">Top margin in hundredths of
millimeters</td></tr>
</tbody></table>
<h2 class="title"><a id="ENUMERATIONS">Constants</a></h2>
<h3 class="enumeration"><a id="cups_ptype_e">cups_ptype_e</a></h3>
<p class="description">Printer type/capability bit
constants</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>CUPS_PRINTER_AUTHENTICATED <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Printer requires authentication
</td></tr>
<tr><th>CUPS_PRINTER_BIND </th> <td class="description">Can bind output</td></tr>
<tr><th>CUPS_PRINTER_BW </th> <td class="description">Can do B&W printing</td></tr>
<tr><th>CUPS_PRINTER_CLASS </th> <td class="description">Printer class</td></tr>
<tr><th>CUPS_PRINTER_COLLATE </th> <td class="description">Can quickly collate copies</td></tr>
<tr><th>CUPS_PRINTER_COLOR </th> <td class="description">Can do color printing</td></tr>
<tr><th>CUPS_PRINTER_COMMANDS <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Printer supports maintenance commands
</td></tr>
<tr><th>CUPS_PRINTER_COPIES </th> <td class="description">Can do copies in hardware</td></tr>
<tr><th>CUPS_PRINTER_COVER </th> <td class="description">Can cover output</td></tr>
<tr><th>CUPS_PRINTER_DEFAULT </th> <td class="description">Default printer on network</td></tr>
<tr><th>CUPS_PRINTER_DISCOVERED <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Printer was discovered </td></tr>
<tr><th>CUPS_PRINTER_DUPLEX </th> <td class="description">Can do two-sided printing</td></tr>
<tr><th>CUPS_PRINTER_FAX </th> <td class="description">Fax queue</td></tr>
<tr><th>CUPS_PRINTER_LARGE </th> <td class="description">Can print on D/E/A1/A0-size media</td></tr>
<tr><th>CUPS_PRINTER_LOCAL </th> <td class="description">Local printer or class</td></tr>
<tr><th>CUPS_PRINTER_MEDIUM </th> <td class="description">Can print on Tabloid/B/C/A3/A2-size media</td></tr>
<tr><th>CUPS_PRINTER_NOT_SHARED <span class="info"> CUPS 1.2/macOS 10.5 </span></th> <td class="description">Printer is not shared
</td></tr>
<tr><th>CUPS_PRINTER_PUNCH </th> <td class="description">Can punch output</td></tr>
<tr><th>CUPS_PRINTER_REJECTING </th> <td class="description">Printer is rejecting jobs</td></tr>
<tr><th>CUPS_PRINTER_REMOTE </th> <td class="description">Remote printer or class</td></tr>
<tr><th>CUPS_PRINTER_SMALL </th> <td class="description">Can print on Letter/Legal/A4-size media</td></tr>
<tr><th>CUPS_PRINTER_SORT </th> <td class="description">Can sort output</td></tr>
<tr><th>CUPS_PRINTER_STAPLE </th> <td class="description">Can staple output</td></tr>
<tr><th>CUPS_PRINTER_VARIABLE </th> <td class="description">Can print on rolls and custom-size media</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_encoding_e">http_encoding_e</a></h3>
<p class="description">HTTP transfer encoding values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_ENCODING_CHUNKED </th> <td class="description">Data is chunked</td></tr>
<tr><th>HTTP_ENCODING_FIELDS </th> <td class="description">Sending HTTP fields</td></tr>
<tr><th>HTTP_ENCODING_LENGTH </th> <td class="description">Data is sent with Content-Length</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_encryption_e">http_encryption_e</a></h3>
<p class="description">HTTP encryption values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_ENCRYPTION_ALWAYS </th> <td class="description">Always encrypt (SSL)</td></tr>
<tr><th>HTTP_ENCRYPTION_IF_REQUESTED </th> <td class="description">Encrypt if requested (TLS upgrade)</td></tr>
<tr><th>HTTP_ENCRYPTION_NEVER </th> <td class="description">Never encrypt</td></tr>
<tr><th>HTTP_ENCRYPTION_REQUIRED </th> <td class="description">Encryption is required (TLS upgrade)</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_field_e">http_field_e</a></h3>
<p class="description">HTTP field names</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<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>
<tr><th>HTTP_FIELD_ACCEPT_LANGUAGE </th> <td class="description">Accept-Language field</td></tr>
<tr><th>HTTP_FIELD_ACCEPT_RANGES </th> <td class="description">Accept-Ranges field</td></tr>
<tr><th>HTTP_FIELD_ALLOW <span class="info"> CUPS 1.7/macOS 10.9 </span></th> <td class="description">Allow field </td></tr>
<tr><th>HTTP_FIELD_AUTHORIZATION </th> <td class="description">Authorization field</td></tr>
<tr><th>HTTP_FIELD_CONNECTION </th> <td class="description">Connection field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_ENCODING </th> <td class="description">Content-Encoding field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_LANGUAGE </th> <td class="description">Content-Language field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_LENGTH </th> <td class="description">Content-Length field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_LOCATION </th> <td class="description">Content-Location field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_MD5 </th> <td class="description">Content-MD5 field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_RANGE </th> <td class="description">Content-Range field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_TYPE </th> <td class="description">Content-Type field</td></tr>
<tr><th>HTTP_FIELD_CONTENT_VERSION </th> <td class="description">Content-Version field</td></tr>
<tr><th>HTTP_FIELD_DATE </th> <td class="description">Date field</td></tr>
<tr><th>HTTP_FIELD_HOST </th> <td class="description">Host field</td></tr>
<tr><th>HTTP_FIELD_IF_MODIFIED_SINCE </th> <td class="description">If-Modified-Since field</td></tr>
<tr><th>HTTP_FIELD_IF_UNMODIFIED_SINCE </th> <td class="description">If-Unmodified-Since field</td></tr>
<tr><th>HTTP_FIELD_KEEP_ALIVE </th> <td class="description">Keep-Alive field</td></tr>
<tr><th>HTTP_FIELD_LAST_MODIFIED </th> <td class="description">Last-Modified field</td></tr>
<tr><th>HTTP_FIELD_LINK </th> <td class="description">Link field</td></tr>
<tr><th>HTTP_FIELD_LOCATION </th> <td class="description">Location field</td></tr>
<tr><th>HTTP_FIELD_MAX </th> <td class="description">Maximum field index</td></tr>
<tr><th>HTTP_FIELD_RANGE </th> <td class="description">Range field</td></tr>
<tr><th>HTTP_FIELD_REFERER </th> <td class="description">Referer field</td></tr>
<tr><th>HTTP_FIELD_RETRY_AFTER </th> <td class="description">Retry-After field</td></tr>
<tr><th>HTTP_FIELD_SERVER <span class="info"> CUPS 1.7/macOS 10.9 </span></th> <td class="description">Server field </td></tr>
<tr><th>HTTP_FIELD_TRANSFER_ENCODING </th> <td class="description">Transfer-Encoding field</td></tr>
<tr><th>HTTP_FIELD_UNKNOWN </th> <td class="description">Unknown field</td></tr>
<tr><th>HTTP_FIELD_UPGRADE </th> <td class="description">Upgrade field</td></tr>
<tr><th>HTTP_FIELD_USER_AGENT </th> <td class="description">User-Agent field</td></tr>
<tr><th>HTTP_FIELD_WWW_AUTHENTICATE </th> <td class="description">WWW-Authenticate field</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_keepalive_e">http_keepalive_e</a></h3>
<p class="description">HTTP keep-alive values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_KEEPALIVE_OFF </th> <td class="description">No keep alive support</td></tr>
<tr><th>HTTP_KEEPALIVE_ON </th> <td class="description">Use keep alive</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_state_e">http_state_e</a></h3>
<p class="description">HTTP state values; states
are server-oriented...</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_STATE_CONNECT </th> <td class="description">CONNECT command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_DELETE </th> <td class="description">DELETE command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_ERROR </th> <td class="description">Error on socket</td></tr>
<tr><th>HTTP_STATE_GET </th> <td class="description">GET command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_GET_SEND </th> <td class="description">GET command, sending data</td></tr>
<tr><th>HTTP_STATE_HEAD </th> <td class="description">HEAD command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_OPTIONS </th> <td class="description">OPTIONS command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_POST </th> <td class="description">POST command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_POST_RECV </th> <td class="description">POST command, receiving data</td></tr>
<tr><th>HTTP_STATE_POST_SEND </th> <td class="description">POST command, sending data</td></tr>
<tr><th>HTTP_STATE_PUT </th> <td class="description">PUT command, waiting for blank line</td></tr>
<tr><th>HTTP_STATE_PUT_RECV </th> <td class="description">PUT command, receiving data</td></tr>
<tr><th>HTTP_STATE_STATUS </th> <td class="description">Command complete, sending status</td></tr>
<tr><th>HTTP_STATE_TRACE </th> <td class="description">TRACE command, waiting for blank line</td></tr>
<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>
<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>
<tr><th>HTTP_STATE_WAITING </th> <td class="description">Waiting for command</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_status_e">http_status_e</a></h3>
<p class="description">HTTP status codes</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_STATUS_ACCEPTED </th> <td class="description">DELETE command was successful</td></tr>
<tr><th>HTTP_STATUS_BAD_GATEWAY </th> <td class="description">Bad gateway</td></tr>
<tr><th>HTTP_STATUS_BAD_REQUEST </th> <td class="description">Bad request</td></tr>
<tr><th>HTTP_STATUS_CONFLICT </th> <td class="description">Request is self-conflicting</td></tr>
<tr><th>HTTP_STATUS_CONTINUE </th> <td class="description">Everything OK, keep going...</td></tr>
<tr><th>HTTP_STATUS_CREATED </th> <td class="description">PUT command was successful</td></tr>
<tr><th>HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED <span class="info"> CUPS 1.4 </span></th> <td class="description">User canceled authorization </td></tr>
<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>
<tr><th>HTTP_STATUS_ERROR </th> <td class="description">An error response from httpXxxx()</td></tr>
<tr><th>HTTP_STATUS_EXPECTATION_FAILED </th> <td class="description">The expectation given in an Expect header field was not met</td></tr>
<tr><th>HTTP_STATUS_FORBIDDEN </th> <td class="description">Forbidden to access this URI</td></tr>
<tr><th>HTTP_STATUS_FOUND </th> <td class="description">Document was found at a different URI</td></tr>
<tr><th>HTTP_STATUS_GATEWAY_TIMEOUT </th> <td class="description">Gateway connection timed out</td></tr>
<tr><th>HTTP_STATUS_GONE </th> <td class="description">Server has gone away</td></tr>
<tr><th>HTTP_STATUS_LENGTH_REQUIRED </th> <td class="description">A content length or encoding is required</td></tr>
<tr><th>HTTP_STATUS_METHOD_NOT_ALLOWED </th> <td class="description">Method is not allowed</td></tr>
<tr><th>HTTP_STATUS_MOVED_PERMANENTLY </th> <td class="description">Document has moved permanently</td></tr>
<tr><th>HTTP_STATUS_MULTIPLE_CHOICES </th> <td class="description">Multiple files match request</td></tr>
<tr><th>HTTP_STATUS_NONE <span class="info"> CUPS 1.7/macOS 10.9 </span></th> <td class="description">No Expect value </td></tr>
<tr><th>HTTP_STATUS_NOT_ACCEPTABLE </th> <td class="description">Not Acceptable</td></tr>
<tr><th>HTTP_STATUS_NOT_AUTHORITATIVE </th> <td class="description">Information isn't authoritative</td></tr>
<tr><th>HTTP_STATUS_NOT_FOUND </th> <td class="description">URI was not found</td></tr>
<tr><th>HTTP_STATUS_NOT_IMPLEMENTED </th> <td class="description">Feature not implemented</td></tr>
<tr><th>HTTP_STATUS_NOT_MODIFIED </th> <td class="description">File not modified</td></tr>
<tr><th>HTTP_STATUS_NOT_SUPPORTED </th> <td class="description">HTTP version not supported</td></tr>
<tr><th>HTTP_STATUS_NO_CONTENT </th> <td class="description">Successful command, no new data</td></tr>
<tr><th>HTTP_STATUS_OK </th> <td class="description">OPTIONS/GET/HEAD/POST/TRACE command was successful</td></tr>
<tr><th>HTTP_STATUS_PARTIAL_CONTENT </th> <td class="description">Only a partial file was received/sent</td></tr>
<tr><th>HTTP_STATUS_PAYMENT_REQUIRED </th> <td class="description">Payment required</td></tr>
<tr><th>HTTP_STATUS_PRECONDITION </th> <td class="description">Precondition failed</td></tr>
<tr><th>HTTP_STATUS_PROXY_AUTHENTICATION </th> <td class="description">Proxy Authentication is Required</td></tr>
<tr><th>HTTP_STATUS_REQUESTED_RANGE </th> <td class="description">The requested range is not satisfiable</td></tr>
<tr><th>HTTP_STATUS_REQUEST_TIMEOUT </th> <td class="description">Request timed out</td></tr>
<tr><th>HTTP_STATUS_REQUEST_TOO_LARGE </th> <td class="description">Request entity too large</td></tr>
<tr><th>HTTP_STATUS_RESET_CONTENT </th> <td class="description">Content was reset/recreated</td></tr>
<tr><th>HTTP_STATUS_SEE_OTHER </th> <td class="description">See this other link</td></tr>
<tr><th>HTTP_STATUS_SERVER_ERROR </th> <td class="description">Internal server error</td></tr>
<tr><th>HTTP_STATUS_SERVICE_UNAVAILABLE </th> <td class="description">Service is unavailable</td></tr>
<tr><th>HTTP_STATUS_SWITCHING_PROTOCOLS </th> <td class="description">HTTP upgrade to TLS/SSL</td></tr>
<tr><th>HTTP_STATUS_TEMPORARY_REDIRECT </th> <td class="description">Temporary redirection</td></tr>
<tr><th>HTTP_STATUS_UNAUTHORIZED </th> <td class="description">Unauthorized to access host</td></tr>
<tr><th>HTTP_STATUS_UNSUPPORTED_MEDIATYPE </th> <td class="description">The requested media type is unsupported</td></tr>
<tr><th>HTTP_STATUS_UPGRADE_REQUIRED </th> <td class="description">Upgrade to SSL/TLS required</td></tr>
<tr><th>HTTP_STATUS_URI_TOO_LONG </th> <td class="description">URI too long</td></tr>
<tr><th>HTTP_STATUS_USE_PROXY </th> <td class="description">Must use a proxy to access this URI</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_trust_e"><span class="info"> CUPS 2.0/OS 10.10 </span>http_trust_e</a></h3>
<p class="description">Level of trust for credentials </p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_TRUST_CHANGED </th> <td class="description">Credentials have changed</td></tr>
<tr><th>HTTP_TRUST_EXPIRED </th> <td class="description">Credentials are expired</td></tr>
<tr><th>HTTP_TRUST_INVALID </th> <td class="description">Credentials are invalid</td></tr>
<tr><th>HTTP_TRUST_OK </th> <td class="description">Credentials are OK/trusted</td></tr>
<tr><th>HTTP_TRUST_RENEWED </th> <td class="description">Credentials have been renewed</td></tr>
<tr><th>HTTP_TRUST_UNKNOWN </th> <td class="description">Credentials are unknown/new</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_uri_coding_e">http_uri_coding_e</a></h3>
<p class="description">URI en/decode flags</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_URI_CODING_ALL </th> <td class="description">En/decode everything</td></tr>
<tr><th>HTTP_URI_CODING_HOSTNAME </th> <td class="description">En/decode the hostname portion</td></tr>
<tr><th>HTTP_URI_CODING_MOST </th> <td class="description">En/decode all but the query</td></tr>
<tr><th>HTTP_URI_CODING_NONE </th> <td class="description">Don't en/decode anything</td></tr>
<tr><th>HTTP_URI_CODING_QUERY </th> <td class="description">En/decode the query portion</td></tr>
<tr><th>HTTP_URI_CODING_RESOURCE </th> <td class="description">En/decode the resource portion</td></tr>
<tr><th>HTTP_URI_CODING_RFC6874 </th> <td class="description">Use RFC 6874 address format</td></tr>
<tr><th>HTTP_URI_CODING_USERNAME </th> <td class="description">En/decode the username portion</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="http_uri_status_e"><span class="info"> CUPS 1.2 </span>http_uri_status_e</a></h3>
<p class="description">URI separation status </p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>HTTP_URI_STATUS_BAD_ARGUMENTS </th> <td class="description">Bad arguments to function (error)</td></tr>
<tr><th>HTTP_URI_STATUS_BAD_HOSTNAME </th> <td class="description">Bad hostname in URI (error)</td></tr>
<tr><th>HTTP_URI_STATUS_BAD_PORT </th> <td class="description">Bad port number in URI (error)</td></tr>
<tr><th>HTTP_URI_STATUS_BAD_RESOURCE </th> <td class="description">Bad resource in URI (error)</td></tr>
<tr><th>HTTP_URI_STATUS_BAD_SCHEME </th> <td class="description">Bad scheme in URI (error)</td></tr>
<tr><th>HTTP_URI_STATUS_BAD_URI </th> <td class="description">Bad/empty URI (error)</td></tr>
<tr><th>HTTP_URI_STATUS_BAD_USERNAME </th> <td class="description">Bad username in URI (error)</td></tr>
<tr><th>HTTP_URI_STATUS_MISSING_RESOURCE </th> <td class="description">Missing resource in URI (warning)</td></tr>
<tr><th>HTTP_URI_STATUS_MISSING_SCHEME </th> <td class="description">Missing scheme in URI (warning)</td></tr>
<tr><th>HTTP_URI_STATUS_OK </th> <td class="description">URI decoded OK</td></tr>
<tr><th>HTTP_URI_STATUS_OVERFLOW </th> <td class="description">URI buffer for httpAssembleURI is too small</td></tr>
<tr><th>HTTP_URI_STATUS_UNKNOWN_SCHEME </th> <td class="description">Unknown scheme in URI (warning)</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_finishings_e">ipp_finishings_e</a></h3>
<p class="description">Finishings values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_FINISHINGS_BALE </th> <td class="description">Bale (any type)</td></tr>
<tr><th>IPP_FINISHINGS_BIND </th> <td class="description">Bind</td></tr>
<tr><th>IPP_FINISHINGS_BIND_BOTTOM </th> <td class="description">Bind on bottom</td></tr>
<tr><th>IPP_FINISHINGS_BIND_LEFT </th> <td class="description">Bind on left</td></tr>
<tr><th>IPP_FINISHINGS_BIND_RIGHT </th> <td class="description">Bind on right</td></tr>
<tr><th>IPP_FINISHINGS_BIND_TOP </th> <td class="description">Bind on top</td></tr>
<tr><th>IPP_FINISHINGS_BOOKLET_MAKER </th> <td class="description">Fold to make booklet</td></tr>
<tr><th>IPP_FINISHINGS_COAT </th> <td class="description">Apply protective liquid or powder coating</td></tr>
<tr><th>IPP_FINISHINGS_COVER </th> <td class="description">Add cover</td></tr>
<tr><th>IPP_FINISHINGS_EDGE_STITCH </th> <td class="description">Stitch along any side</td></tr>
<tr><th>IPP_FINISHINGS_EDGE_STITCH_BOTTOM </th> <td class="description">Stitch along bottom edge</td></tr>
<tr><th>IPP_FINISHINGS_EDGE_STITCH_LEFT </th> <td class="description">Stitch along left side</td></tr>
<tr><th>IPP_FINISHINGS_EDGE_STITCH_RIGHT </th> <td class="description">Stitch along right side</td></tr>
<tr><th>IPP_FINISHINGS_EDGE_STITCH_TOP </th> <td class="description">Stitch along top edge</td></tr>
<tr><th>IPP_FINISHINGS_FOLD </th> <td class="description">Fold (any type)</td></tr>
<tr><th>IPP_FINISHINGS_FOLD_ACCORDIAN </th> <td class="description">Accordian-fold the paper vertically into four sections</td></tr>
<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>
<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>
<tr><th>IPP_FINISHINGS_FOLD_GATE </th> <td class="description">Fold the top and bottom quarters of the paper towards the midline</td></tr>
<tr><th>IPP_FINISHINGS_FOLD_HALF </th> <td class="description">Fold the paper in half vertically</td></tr>
<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>
<tr><th>IPP_FINISHINGS_FOLD_LEFT_GATE </th> <td class="description">Fold the top quarter of the paper towards the midline</td></tr>
<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>
<tr><th>IPP_FINISHINGS_FOLD_PARALLEL </th> <td class="description">Fold the paper in half vertically two times, yielding four sections</td></tr>
<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>
<tr><th>IPP_FINISHINGS_FOLD_RIGHT_GATE </th> <td class="description">Fold the bottom quarter of the paper towards the midline</td></tr>
<tr><th>IPP_FINISHINGS_FOLD_Z </th> <td class="description">Fold the paper vertically into three sections, forming a Z</td></tr>
<tr><th>IPP_FINISHINGS_JOG_OFFSET </th> <td class="description">Offset for binding (any type)</td></tr>
<tr><th>IPP_FINISHINGS_LAMINATE </th> <td class="description">Apply protective (solid) material</td></tr>
<tr><th>IPP_FINISHINGS_NONE </th> <td class="description">No finishing</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH </th> <td class="description">Punch (any location/count)</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_LEFT </th> <td class="description">Punch 1 hole bottom left</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT </th> <td class="description">Punch 1 hole bottom right</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_DUAL_BOTTOM </th> <td class="description">Punch 2 holes bottom edge</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_DUAL_LEFT </th> <td class="description">Punch 2 holes left side</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_DUAL_RIGHT </th> <td class="description">Punch 2 holes right side</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_DUAL_TOP </th> <td class="description">Punch 2 holes top edge</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM </th> <td class="description">Pucnh multiple holes bottom edge</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT </th> <td class="description">Pucnh multiple holes left side</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT </th> <td class="description">Pucnh multiple holes right side</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_MULTIPLE_TOP </th> <td class="description">Pucnh multiple holes top edge</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_QUAD_BOTTOM </th> <td class="description">Punch 4 holes bottom edge</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_QUAD_LEFT </th> <td class="description">Punch 4 holes left side</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_QUAD_RIGHT </th> <td class="description">Punch 4 holes right side</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_QUAD_TOP </th> <td class="description">Punch 4 holes top edge</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_TOP_LEFT </th> <td class="description">Punch 1 hole top left</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_TOP_RIGHT </th> <td class="description">Punch 1 hole top right</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM </th> <td class="description">Punch 3 holes bottom edge</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_LEFT </th> <td class="description">Punch 3 holes left side</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT </th> <td class="description">Punch 3 holes right side</td></tr>
<tr><th>IPP_FINISHINGS_PUNCH_TRIPLE_TOP </th> <td class="description">Punch 3 holes top edge</td></tr>
<tr><th>IPP_FINISHINGS_SADDLE_STITCH </th> <td class="description">Staple interior</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE </th> <td class="description">Staple (any location/method)</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_LEFT </th> <td class="description">Staple bottom left corner</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT </th> <td class="description">Staple bottom right corner</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_DUAL_BOTTOM </th> <td class="description">Two staples on bottom</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_DUAL_LEFT </th> <td class="description">Two staples on left</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_DUAL_RIGHT </th> <td class="description">Two staples on right</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_DUAL_TOP </th> <td class="description">Two staples on top</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_TOP_LEFT </th> <td class="description">Staple top left corner</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_TOP_RIGHT </th> <td class="description">Staple top right corner</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM </th> <td class="description">Three staples on bottom</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_LEFT </th> <td class="description">Three staples on left</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT </th> <td class="description">Three staples on right</td></tr>
<tr><th>IPP_FINISHINGS_STAPLE_TRIPLE_TOP </th> <td class="description">Three staples on top</td></tr>
<tr><th>IPP_FINISHINGS_TRIM </th> <td class="description">Trim (any type)</td></tr>
<tr><th>IPP_FINISHINGS_TRIM_AFTER_COPIES </th> <td class="description">Trim output after each copy</td></tr>
<tr><th>IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS </th> <td class="description">Trim output after each document</td></tr>
<tr><th>IPP_FINISHINGS_TRIM_AFTER_JOB </th> <td class="description">Trim output after job</td></tr>
<tr><th>IPP_FINISHINGS_TRIM_AFTER_PAGES </th> <td class="description">Trim output after each page</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_jstate_e">ipp_jstate_e</a></h3>
<p class="description">Job states</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_JSTATE_ABORTED </th> <td class="description">Job has aborted due to error</td></tr>
<tr><th>IPP_JSTATE_CANCELED </th> <td class="description">Job has been canceled</td></tr>
<tr><th>IPP_JSTATE_COMPLETED </th> <td class="description">Job has completed successfully</td></tr>
<tr><th>IPP_JSTATE_HELD </th> <td class="description">Job is held for printing</td></tr>
<tr><th>IPP_JSTATE_PENDING </th> <td class="description">Job is waiting to be printed</td></tr>
<tr><th>IPP_JSTATE_PROCESSING </th> <td class="description">Job is currently printing</td></tr>
<tr><th>IPP_JSTATE_STOPPED </th> <td class="description">Job has been stopped</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_op_e">ipp_op_e</a></h3>
<p class="description">IPP operations</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_OP_CANCEL_CURRENT_JOB </th> <td class="description">Cancel-Current-Job: Cancel the current job</td></tr>
<tr><th>IPP_OP_CANCEL_JOB </th> <td class="description">Cancel-Job: Cancel a job</td></tr>
<tr><th>IPP_OP_CANCEL_JOBS </th> <td class="description">Cancel-Jobs: Cancel all jobs (administrative)</td></tr>
<tr><th>IPP_OP_CANCEL_MY_JOBS </th> <td class="description">Cancel-My-Jobs: Cancel a user's jobs</td></tr>
<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>
<tr><th>IPP_OP_CLOSE_JOB </th> <td class="description">Close-Job: Close a job and start printing</td></tr>
<tr><th>IPP_OP_CREATE_JOB </th> <td class="description">Create-Job: Create an empty print job</td></tr>
<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>
<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>
<tr><th>IPP_OP_CUPS_ADD_MODIFY_CLASS </th> <td class="description">CUPS-Add-Modify-Class: Add or modify a class</td></tr>
<tr><th>IPP_OP_CUPS_ADD_MODIFY_PRINTER </th> <td class="description">CUPS-Add-Modify-Printer: Add or modify a printer</td></tr>
<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>
<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>
<tr><th>IPP_OP_CUPS_DELETE_CLASS </th> <td class="description">CUPS-Delete-Class: Delete a class</td></tr>
<tr><th>IPP_OP_CUPS_DELETE_PRINTER </th> <td class="description">CUPS-Delete-Printer: Delete a printer</td></tr>
<tr><th>IPP_OP_CUPS_GET_DEFAULT </th> <td class="description">CUPS-Get-Default: Get the default printer</td></tr>
<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>
<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>
<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>
<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>
<tr><th>IPP_OP_CUPS_GET_PRINTERS </th> <td class="description">CUPS-Get-Printers: Get a list of printers and/or classes</td></tr>
<tr><th>IPP_OP_CUPS_INVALID </th> <td class="description">Invalid operation name for <a href="#ippOpValue"><code>ippOpValue</code></a></td></tr>
<tr><th>IPP_OP_CUPS_MOVE_JOB </th> <td class="description">CUPS-Move-Job: Move a job to a different printer</td></tr>
<tr><th>IPP_OP_CUPS_SET_DEFAULT </th> <td class="description">CUPS-Set-Default: Set the default printer</td></tr>
<tr><th>IPP_OP_DISABLE_PRINTER </th> <td class="description">Disable-Printer: Reject new jobs for a printer</td></tr>
<tr><th>IPP_OP_ENABLE_PRINTER </th> <td class="description">Enable-Printer: Accept new jobs for a printer</td></tr>
<tr><th>IPP_OP_GET_JOBS </th> <td class="description">Get-Jobs: Get a list of jobs</td></tr>
<tr><th>IPP_OP_GET_JOB_ATTRIBUTES </th> <td class="description">Get-Job-Attribute: Get information about a job</td></tr>
<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>
<tr><th>IPP_OP_GET_PRINTER_ATTRIBUTES </th> <td class="description">Get-Printer-Attributes: Get information about a printer</td></tr>
<tr><th>IPP_OP_GET_PRINTER_SUPPORTED_VALUES </th> <td class="description">Get-Printer-Supported-Values: Get supported values</td></tr>
<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>
<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>
<tr><th>IPP_OP_HOLD_JOB </th> <td class="description">Hold-Job: Hold a job for printing</td></tr>
<tr><th>IPP_OP_HOLD_NEW_JOBS </th> <td class="description">Hold-New-Jobs: Hold new jobs</td></tr>
<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>
<tr><th>IPP_OP_PAUSE_PRINTER </th> <td class="description">Pause-Printer: Stop a printer</td></tr>
<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>
<tr><th>IPP_OP_PRINT_JOB </th> <td class="description">Print-Job: Print a single file</td></tr>
<tr><th>IPP_OP_PROMOTE_JOB </th> <td class="description">Promote-Job: Promote a job to print sooner</td></tr>
<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>
<tr><th>IPP_OP_RELEASE_JOB </th> <td class="description">Release-Job: Release a job for printing</td></tr>
<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>
<tr><th>IPP_OP_RESTART_JOB <span class="info"> DEPRECATED </span></th> <td class="description">Restart-Job: Reprint a job </td></tr>
<tr><th>IPP_OP_RESUME_JOB </th> <td class="description">Resume-Job: Resume the current job</td></tr>
<tr><th>IPP_OP_RESUME_PRINTER </th> <td class="description">Resume-Printer: Start a printer</td></tr>
<tr><th>IPP_OP_SCHEDULE_JOB_AFTER </th> <td class="description">Schedule-Job-After: Schedule a job to print after another</td></tr>
<tr><th>IPP_OP_SEND_DOCUMENT </th> <td class="description">Send-Document: Add a file to a job</td></tr>
<tr><th>IPP_OP_SET_JOB_ATTRIBUTES </th> <td class="description">Set-Job-Attributes: Set job values</td></tr>
<tr><th>IPP_OP_SET_PRINTER_ATTRIBUTES </th> <td class="description">Set-Printer-Attributes: Set printer values</td></tr>
<tr><th>IPP_OP_SUSPEND_CURRENT_JOB </th> <td class="description">Suspend-Current-Job: Suspend the current job</td></tr>
<tr><th>IPP_OP_VALIDATE_JOB </th> <td class="description">Validate-Job: Validate job values prior to submission</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_orient_e">ipp_orient_e</a></h3>
<p class="description">Orientation values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_ORIENT_LANDSCAPE </th> <td class="description">90 degrees counter-clockwise</td></tr>
<tr><th>IPP_ORIENT_NONE </th> <td class="description">No rotation</td></tr>
<tr><th>IPP_ORIENT_PORTRAIT </th> <td class="description">No rotation</td></tr>
<tr><th>IPP_ORIENT_REVERSE_LANDSCAPE </th> <td class="description">90 degrees clockwise</td></tr>
<tr><th>IPP_ORIENT_REVERSE_PORTRAIT </th> <td class="description">180 degrees</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_pstate_e">ipp_pstate_e</a></h3>
<p class="description">Printer state values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_PSTATE_IDLE </th> <td class="description">Printer is idle</td></tr>
<tr><th>IPP_PSTATE_PROCESSING </th> <td class="description">Printer is working</td></tr>
<tr><th>IPP_PSTATE_STOPPED </th> <td class="description">Printer is stopped</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_quality_e">ipp_quality_e</a></h3>
<p class="description">Print quality values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_QUALITY_DRAFT </th> <td class="description">Draft quality</td></tr>
<tr><th>IPP_QUALITY_HIGH </th> <td class="description">High quality</td></tr>
<tr><th>IPP_QUALITY_NORMAL </th> <td class="description">Normal quality</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_res_e">ipp_res_e</a></h3>
<p class="description">Resolution units</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_RES_PER_CM </th> <td class="description">Pixels per centimeter</td></tr>
<tr><th>IPP_RES_PER_INCH </th> <td class="description">Pixels per inch</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_state_e">ipp_state_e</a></h3>
<p class="description">ipp_t state values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_STATE_ATTRIBUTE </th> <td class="description">One or more attributes need to be sent/received</td></tr>
<tr><th>IPP_STATE_DATA </th> <td class="description">IPP request data needs to be sent/received</td></tr>
<tr><th>IPP_STATE_ERROR </th> <td class="description">An error occurred</td></tr>
<tr><th>IPP_STATE_HEADER </th> <td class="description">The request header needs to be sent/received</td></tr>
<tr><th>IPP_STATE_IDLE </th> <td class="description">Nothing is happening/request completed</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_status_e">ipp_status_e</a></h3>
<p class="description">IPP status code values</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_STATUS_CUPS_INVALID </th> <td class="description">Invalid status name for <a href="#ippErrorValue"><code>ippErrorValue</code></a></td></tr>
<tr><th>IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED </th> <td class="description">client-error-account-authorization-failed</td></tr>
<tr><th>IPP_STATUS_ERROR_ACCOUNT_CLOSED </th> <td class="description">client-error-account-closed</td></tr>
<tr><th>IPP_STATUS_ERROR_ACCOUNT_INFO_NEEDED </th> <td class="description">client-error-account-info-needed</td></tr>
<tr><th>IPP_STATUS_ERROR_ACCOUNT_LIMIT_REACHED </th> <td class="description">client-error-account-limit-reached</td></tr>
<tr><th>IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE </th> <td class="description">client-error-attributes-not-settable</td></tr>
<tr><th>IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES </th> <td class="description">client-error-attributes-or-values-not-supported</td></tr>
<tr><th>IPP_STATUS_ERROR_BAD_REQUEST </th> <td class="description">client-error-bad-request</td></tr>
<tr><th>IPP_STATUS_ERROR_BUSY </th> <td class="description">server-error-busy</td></tr>
<tr><th>IPP_STATUS_ERROR_CHARSET </th> <td class="description">client-error-charset-not-supported</td></tr>
<tr><th>IPP_STATUS_ERROR_COMPRESSION_ERROR </th> <td class="description">client-error-compression-error</td></tr>
<tr><th>IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED </th> <td class="description">client-error-compression-not-supported</td></tr>
<tr><th>IPP_STATUS_ERROR_CONFLICTING </th> <td class="description">client-error-conflicting-attributes</td></tr>
<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>
<tr><th>IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED </th> <td class="description">cups-error-account-closed @deprecate@</td></tr>
<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>
<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>
<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>
<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>
<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>
<tr><th>IPP_STATUS_ERROR_DEVICE </th> <td class="description">server-error-device-error</td></tr>
<tr><th>IPP_STATUS_ERROR_DOCUMENT_ACCESS </th> <td class="description">client-error-document-access-error</td></tr>
<tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR </th> <td class="description">client-error-document-format-error</td></tr>
<tr><th>IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED </th> <td class="description">client-error-document-format-not-supported</td></tr>
<tr><th>IPP_STATUS_ERROR_DOCUMENT_PASSWORD </th> <td class="description">client-error-document-password-error</td></tr>
<tr><th>IPP_STATUS_ERROR_DOCUMENT_PERMISSION </th> <td class="description">client-error-document-permission-error</td></tr>
<tr><th>IPP_STATUS_ERROR_DOCUMENT_SECURITY </th> <td class="description">client-error-document-security-error</td></tr>
<tr><th>IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE </th> <td class="description">client-error-document-unprintable-error</td></tr>
<tr><th>IPP_STATUS_ERROR_FORBIDDEN </th> <td class="description">client-error-forbidden</td></tr>
<tr><th>IPP_STATUS_ERROR_GONE </th> <td class="description">client-error-gone</td></tr>
<tr><th>IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS </th> <td class="description">client-error-ignored-all-subscriptions</td></tr>
<tr><th>IPP_STATUS_ERROR_INTERNAL </th> <td class="description">server-error-internal-error</td></tr>
<tr><th>IPP_STATUS_ERROR_JOB_CANCELED </th> <td class="description">server-error-job-canceled</td></tr>
<tr><th>IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED </th> <td class="description">server-error-multiple-document-jobs-not-supported</td></tr>
<tr><th>IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS </th> <td class="description">server-error-not-accepting-jobs</td></tr>
<tr><th>IPP_STATUS_ERROR_NOT_AUTHENTICATED </th> <td class="description">client-error-not-authenticated</td></tr>
<tr><th>IPP_STATUS_ERROR_NOT_AUTHORIZED </th> <td class="description">client-error-not-authorized</td></tr>
<tr><th>IPP_STATUS_ERROR_NOT_FETCHABLE </th> <td class="description">client-error-not-fetchable</td></tr>
<tr><th>IPP_STATUS_ERROR_NOT_FOUND </th> <td class="description">client-error-not-found</td></tr>
<tr><th>IPP_STATUS_ERROR_NOT_POSSIBLE </th> <td class="description">client-error-not-possible</td></tr>
<tr><th>IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED </th> <td class="description">server-error-operation-not-supported</td></tr>
<tr><th>IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED </th> <td class="description">server-error-printer-is-deactivated</td></tr>
<tr><th>IPP_STATUS_ERROR_REQUEST_ENTITY </th> <td class="description">client-error-request-entity-too-large</td></tr>
<tr><th>IPP_STATUS_ERROR_REQUEST_VALUE </th> <td class="description">client-error-request-value-too-long</td></tr>
<tr><th>IPP_STATUS_ERROR_SERVICE_UNAVAILABLE </th> <td class="description">server-error-service-unavailable</td></tr>
<tr><th>IPP_STATUS_ERROR_TEMPORARY </th> <td class="description">server-error-temporary-error</td></tr>
<tr><th>IPP_STATUS_ERROR_TIMEOUT </th> <td class="description">client-error-timeout</td></tr>
<tr><th>IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS </th> <td class="description">server-error-too-many-documents</td></tr>
<tr><th>IPP_STATUS_ERROR_TOO_MANY_JOBS </th> <td class="description">server-error-too-many-jobs</td></tr>
<tr><th>IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS </th> <td class="description">client-error-too-many-subscriptions</td></tr>
<tr><th>IPP_STATUS_ERROR_URI_SCHEME </th> <td class="description">client-error-uri-scheme-not-supported</td></tr>
<tr><th>IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED </th> <td class="description">server-error-version-not-supported</td></tr>
<tr><th>IPP_STATUS_OK </th> <td class="description">successful-ok</td></tr>
<tr><th>IPP_STATUS_OK_CONFLICTING </th> <td class="description">successful-ok-conflicting-attributes</td></tr>
<tr><th>IPP_STATUS_OK_EVENTS_COMPLETE </th> <td class="description">successful-ok-events-complete</td></tr>
<tr><th>IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED </th> <td class="description">successful-ok-ignored-or-substituted-attributes</td></tr>
<tr><th>IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS </th> <td class="description">successful-ok-ignored-subscriptions</td></tr>
<tr><th>IPP_STATUS_OK_TOO_MANY_EVENTS </th> <td class="description">successful-ok-too-many-events</td></tr>
</tbody></table>
<h3 class="enumeration"><a id="ipp_tag_e">ipp_tag_e</a></h3>
<p class="description">Value and group tag values for attributes</p>
<h4 class="constants">Constants</h4>
<table class="list"><tbody>
<tr><th>IPP_TAG_ADMINDEFINE </th> <td class="description">Admin-defined value</td></tr>
<tr><th>IPP_TAG_BOOLEAN </th> <td class="description">Boolean value</td></tr>
<tr><th>IPP_TAG_CHARSET </th> <td class="description">Character set value</td></tr>
<tr><th>IPP_TAG_CUPS_INVALID </th> <td class="description">Invalid tag name for <a href="#ippTagValue"><code>ippTagValue</code></a></td></tr>
<tr><th>IPP_TAG_DATE </th> <td class="description">Date/time value</td></tr>
<tr><th>IPP_TAG_DEFAULT </th> <td class="description">Default value</td></tr>
<tr><th>IPP_TAG_DELETEATTR </th> <td class="description">Delete-attribute value</td></tr>
<tr><th>IPP_TAG_END </th> <td class="description">End-of-attributes</td></tr>
<tr><th>IPP_TAG_ENUM </th> <td class="description">Enumeration value</td></tr>
<tr><th>IPP_TAG_EVENT_NOTIFICATION </th> <td class="description">Event group</td></tr>
<tr><th>IPP_TAG_INTEGER </th> <td class="description">Integer value</td></tr>
<tr><th>IPP_TAG_JOB </th> <td class="description">Job group</td></tr>
<tr><th>IPP_TAG_KEYWORD </th> <td class="description">Keyword value</td></tr>
<tr><th>IPP_TAG_LANGUAGE </th> <td class="description">Language value</td></tr>
<tr><th>IPP_TAG_MIMETYPE </th> <td class="description">MIME media type value</td></tr>
<tr><th>IPP_TAG_NAME </th> <td class="description">Name value</td></tr>
<tr><th>IPP_TAG_NAMELANG </th> <td class="description">Name-with-language value</td></tr>
<tr><th>IPP_TAG_NOTSETTABLE </th> <td class="description">Not-settable value</td></tr>
<tr><th>IPP_TAG_NOVALUE </th> <td class="description">No-value value</td></tr>
<tr><th>IPP_TAG_OPERATION </th> <td class="description">Operation group</td></tr>
<tr><th>IPP_TAG_PRINTER </th> <td class="description">Printer group</td></tr>
<tr><th>IPP_TAG_RANGE </th> <td class="description">Range value</td></tr>
<tr><th>IPP_TAG_RESOLUTION </th> <td class="description">Resolution value</td></tr>
<tr><th>IPP_TAG_STRING </th> <td class="description">Octet string value</td></tr>
<tr><th>IPP_TAG_SUBSCRIPTION </th> <td class="description">Subscription group</td></tr>
<tr><th>IPP_TAG_TEXT </th> <td class="description">Text value</td></tr>
<tr><th>IPP_TAG_TEXTLANG </th> <td class="description">Text-with-language value</td></tr>
<tr><th>IPP_TAG_UNKNOWN </th> <td class="description">Unknown value</td></tr>
<tr><th>IPP_TAG_UNSUPPORTED_GROUP </th> <td class="description">Unsupported attributes group</td></tr>
<tr><th>IPP_TAG_UNSUPPORTED_VALUE </th> <td class="description">Unsupported value</td></tr>
<tr><th>IPP_TAG_URI </th> <td class="description">URI value</td></tr>
<tr><th>IPP_TAG_URISCHEME </th> <td class="description">URI scheme value</td></tr>
<tr><th>IPP_TAG_ZERO </th> <td class="description">Zero tag - used for separators</td></tr>
</tbody></table>
</div>
</body>
</html>
|