diff options
Diffstat (limited to 'third_party/cups')
-rw-r--r-- | third_party/cups/LICENSE | 202 | ||||
-rw-r--r-- | third_party/cups/include/cups/array.h | 80 | ||||
-rw-r--r-- | third_party/cups/include/cups/cups.h | 611 | ||||
-rw-r--r-- | third_party/cups/include/cups/file.h | 94 | ||||
-rw-r--r-- | third_party/cups/include/cups/http.h | 593 | ||||
-rw-r--r-- | third_party/cups/include/cups/ipp.h | 947 | ||||
-rw-r--r-- | third_party/cups/include/cups/language.h | 103 | ||||
-rw-r--r-- | third_party/cups/include/cups/pwg.h | 82 | ||||
-rw-r--r-- | third_party/cups/include/cups/versioning.h | 267 | ||||
-rw-r--r-- | third_party/cups/moz.yaml | 40 |
10 files changed, 3019 insertions, 0 deletions
diff --git a/third_party/cups/LICENSE b/third_party/cups/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/third_party/cups/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/third_party/cups/include/cups/array.h b/third_party/cups/include/cups/array.h new file mode 100644 index 0000000000..e5468a3020 --- /dev/null +++ b/third_party/cups/include/cups/array.h @@ -0,0 +1,80 @@ +/* + * Sorted array definitions for CUPS. + * + * Copyright 2007-2010 by Apple Inc. + * Copyright 1997-2007 by Easy Software Products. + * + * Licensed under Apache License v2.0. See the file "LICENSE" for more information. + */ + +#ifndef _CUPS_ARRAY_H_ +# define _CUPS_ARRAY_H_ + +/* + * Include necessary headers... + */ + +# include "versioning.h" +# include <stdlib.h> + + +/* + * C++ magic... + */ + +# ifdef __cplusplus +extern "C" { +# endif /* __cplusplus */ + + +/* + * Types and structures... + */ + +typedef struct _cups_array_s cups_array_t; + /**** CUPS array type ****/ +typedef int (*cups_array_func_t)(void *first, void *second, void *data); + /**** Array comparison function ****/ +typedef int (*cups_ahash_func_t)(void *element, void *data); + /**** Array hash function ****/ +typedef void *(*cups_acopy_func_t)(void *element, void *data); + /**** Array element copy function ****/ +typedef void (*cups_afree_func_t)(void *element, void *data); + /**** Array element free function ****/ + + +/* + * Functions... + */ + +extern int cupsArrayAdd(cups_array_t *a, void *e) _CUPS_API_1_2; +extern void cupsArrayClear(cups_array_t *a) _CUPS_API_1_2; +extern int cupsArrayCount(cups_array_t *a) _CUPS_API_1_2; +extern void *cupsArrayCurrent(cups_array_t *a) _CUPS_API_1_2; +extern void cupsArrayDelete(cups_array_t *a) _CUPS_API_1_2; +extern cups_array_t *cupsArrayDup(cups_array_t *a) _CUPS_API_1_2; +extern void *cupsArrayFind(cups_array_t *a, void *e) _CUPS_API_1_2; +extern void *cupsArrayFirst(cups_array_t *a) _CUPS_API_1_2; +extern int cupsArrayGetIndex(cups_array_t *a) _CUPS_API_1_3; +extern int cupsArrayGetInsert(cups_array_t *a) _CUPS_API_1_3; +extern void *cupsArrayIndex(cups_array_t *a, int n) _CUPS_API_1_2; +extern int cupsArrayInsert(cups_array_t *a, void *e) _CUPS_API_1_2; +extern void *cupsArrayLast(cups_array_t *a) _CUPS_API_1_2; +extern cups_array_t *cupsArrayNew(cups_array_func_t f, void *d) _CUPS_API_1_2; +extern cups_array_t *cupsArrayNew2(cups_array_func_t f, void *d, + cups_ahash_func_t h, int hsize) _CUPS_API_1_3; +extern cups_array_t *cupsArrayNew3(cups_array_func_t f, void *d, + cups_ahash_func_t h, int hsize, + cups_acopy_func_t cf, + cups_afree_func_t ff) _CUPS_API_1_5; +extern void *cupsArrayNext(cups_array_t *a) _CUPS_API_1_2; +extern void *cupsArrayPrev(cups_array_t *a) _CUPS_API_1_2; +extern int cupsArrayRemove(cups_array_t *a, void *e) _CUPS_API_1_2; +extern void *cupsArrayRestore(cups_array_t *a) _CUPS_API_1_2; +extern int cupsArraySave(cups_array_t *a) _CUPS_API_1_2; +extern void *cupsArrayUserData(cups_array_t *a) _CUPS_API_1_2; + +# ifdef __cplusplus +} +# endif /* __cplusplus */ +#endif /* !_CUPS_ARRAY_H_ */ diff --git a/third_party/cups/include/cups/cups.h b/third_party/cups/include/cups/cups.h new file mode 100644 index 0000000000..74955ebd6f --- /dev/null +++ b/third_party/cups/include/cups/cups.h @@ -0,0 +1,611 @@ +/* + * API definitions for CUPS. + * + * Copyright © 2007-2019 by Apple Inc. + * Copyright © 1997-2007 by Easy Software Products. + * + * Licensed under Apache License v2.0. See the file "LICENSE" for more + * information. + */ + +#ifndef _CUPS_CUPS_H_ +# define _CUPS_CUPS_H_ + +/* + * Include necessary headers... + */ + +# include <sys/types.h> +# if defined(_WIN32) && !defined(__CUPS_SSIZE_T_DEFINED) +# define __CUPS_SSIZE_T_DEFINED +# include <stddef.h> +/* Windows does not support the ssize_t type, so map it to long... */ +typedef long ssize_t; /* @private@ */ +# endif /* _WIN32 && !__CUPS_SSIZE_T_DEFINED */ + +# include "file.h" +# include "ipp.h" +# include "language.h" +# include "pwg.h" + + +/* + * C++ magic... + */ + +# ifdef __cplusplus +extern "C" { +# endif /* __cplusplus */ + + +/* + * Constants... + */ + +# define CUPS_VERSION 2.0303 +# define CUPS_VERSION_MAJOR 2 +# define CUPS_VERSION_MINOR 3 +# define CUPS_VERSION_PATCH 3 + +# define CUPS_BC_FD 3 + /* Back-channel file descriptor for + * select/poll */ +# define CUPS_DATE_ANY (time_t)-1 +# define CUPS_EXCLUDE_NONE (const char *)0 +# define CUPS_FORMAT_AUTO "application/octet-stream" +# define CUPS_FORMAT_COMMAND "application/vnd.cups-command" +# define CUPS_FORMAT_JPEG "image/jpeg" +# define CUPS_FORMAT_PDF "application/pdf" +# define CUPS_FORMAT_POSTSCRIPT "application/postscript" +# define CUPS_FORMAT_RAW "application/vnd.cups-raw" +# define CUPS_FORMAT_TEXT "text/plain" +# define CUPS_HTTP_DEFAULT (http_t *)0 +# define CUPS_INCLUDE_ALL (const char *)0 +# define CUPS_JOBID_ALL -1 +# define CUPS_JOBID_CURRENT 0 +# define CUPS_LENGTH_VARIABLE (ssize_t)0 +# define CUPS_TIMEOUT_DEFAULT 0 +# define CUPS_WHICHJOBS_ALL -1 +# define CUPS_WHICHJOBS_ACTIVE 0 +# define CUPS_WHICHJOBS_COMPLETED 1 + +/* Flags for cupsConnectDest and cupsEnumDests */ +# define CUPS_DEST_FLAGS_NONE 0x00 + /* No flags are set */ +# define CUPS_DEST_FLAGS_UNCONNECTED 0x01 + /* There is no connection */ +# define CUPS_DEST_FLAGS_MORE 0x02 + /* There are more destinations */ +# define CUPS_DEST_FLAGS_REMOVED 0x04 + /* The destination has gone away */ +# define CUPS_DEST_FLAGS_ERROR 0x08 + /* An error occurred */ +# define CUPS_DEST_FLAGS_RESOLVING 0x10 + /* The destination address is being + * resolved */ +# define CUPS_DEST_FLAGS_CONNECTING 0x20 + /* A connection is being established */ +# define CUPS_DEST_FLAGS_CANCELED 0x40 + /* Operation was canceled */ +# define CUPS_DEST_FLAGS_DEVICE 0x80 + /* For @link cupsConnectDest@: Connect to device */ + +/* Flags for cupsGetDestMediaByName/Size */ +# define CUPS_MEDIA_FLAGS_DEFAULT 0x00 + /* Find the closest size supported by + * the printer */ +# define CUPS_MEDIA_FLAGS_BORDERLESS 0x01 + /* Find a borderless size */ +# define CUPS_MEDIA_FLAGS_DUPLEX 0x02 + /* Find a size compatible with 2-sided + * printing */ +# define CUPS_MEDIA_FLAGS_EXACT 0x04 + /* Find an exact match for the size */ +# define CUPS_MEDIA_FLAGS_READY 0x08 + /* If the printer supports media + * sensing, find the size amongst the + * "ready" media. */ + +/* Options and values */ +# define CUPS_COPIES "copies" +# define CUPS_COPIES_SUPPORTED "copies-supported" + +# define CUPS_FINISHINGS "finishings" +# define CUPS_FINISHINGS_SUPPORTED "finishings-supported" + +# define CUPS_FINISHINGS_BIND "7" +# define CUPS_FINISHINGS_COVER "6" +# define CUPS_FINISHINGS_FOLD "10" +# define CUPS_FINISHINGS_NONE "3" +# define CUPS_FINISHINGS_PUNCH "5" +# define CUPS_FINISHINGS_STAPLE "4" +# define CUPS_FINISHINGS_TRIM "11" + +# define CUPS_MEDIA "media" +# define CUPS_MEDIA_READY "media-ready" +# define CUPS_MEDIA_SUPPORTED "media-supported" + +# define CUPS_MEDIA_3X5 "na_index-3x5_3x5in" +# define CUPS_MEDIA_4X6 "na_index-4x6_4x6in" +# define CUPS_MEDIA_5X7 "na_5x7_5x7in" +# define CUPS_MEDIA_8X10 "na_govt-letter_8x10in" +# define CUPS_MEDIA_A3 "iso_a3_297x420mm" +# define CUPS_MEDIA_A4 "iso_a4_210x297mm" +# define CUPS_MEDIA_A5 "iso_a5_148x210mm" +# define CUPS_MEDIA_A6 "iso_a6_105x148mm" +# define CUPS_MEDIA_ENV10 "na_number-10_4.125x9.5in" +# define CUPS_MEDIA_ENVDL "iso_dl_110x220mm" +# define CUPS_MEDIA_LEGAL "na_legal_8.5x14in" +# define CUPS_MEDIA_LETTER "na_letter_8.5x11in" +# define CUPS_MEDIA_PHOTO_L "oe_photo-l_3.5x5in" +# define CUPS_MEDIA_SUPERBA3 "na_super-b_13x19in" +# define CUPS_MEDIA_TABLOID "na_ledger_11x17in" + +# define CUPS_MEDIA_SOURCE "media-source" +# define CUPS_MEDIA_SOURCE_SUPPORTED "media-source-supported" + +# define CUPS_MEDIA_SOURCE_AUTO "auto" +# define CUPS_MEDIA_SOURCE_MANUAL "manual" + +# define CUPS_MEDIA_TYPE "media-type" +# define CUPS_MEDIA_TYPE_SUPPORTED "media-type-supported" + +# define CUPS_MEDIA_TYPE_AUTO "auto" +# define CUPS_MEDIA_TYPE_ENVELOPE "envelope" +# define CUPS_MEDIA_TYPE_LABELS "labels" +# define CUPS_MEDIA_TYPE_LETTERHEAD "stationery-letterhead" +# define CUPS_MEDIA_TYPE_PHOTO "photographic" +# define CUPS_MEDIA_TYPE_PHOTO_GLOSSY "photographic-glossy" +# define CUPS_MEDIA_TYPE_PHOTO_MATTE "photographic-matte" +# define CUPS_MEDIA_TYPE_PLAIN "stationery" +# define CUPS_MEDIA_TYPE_TRANSPARENCY "transparency" + +# define CUPS_NUMBER_UP "number-up" +# define CUPS_NUMBER_UP_SUPPORTED "number-up-supported" + +# define CUPS_ORIENTATION "orientation-requested" +# define CUPS_ORIENTATION_SUPPORTED "orientation-requested-supported" + +# define CUPS_ORIENTATION_PORTRAIT "3" +# define CUPS_ORIENTATION_LANDSCAPE "4" + +# define CUPS_PRINT_COLOR_MODE "print-color-mode" +# define CUPS_PRINT_COLOR_MODE_SUPPORTED "print-color-mode-supported" + +# define CUPS_PRINT_COLOR_MODE_AUTO "auto" +# define CUPS_PRINT_COLOR_MODE_MONOCHROME "monochrome" +# define CUPS_PRINT_COLOR_MODE_COLOR "color" + +# define CUPS_PRINT_QUALITY "print-quality" +# define CUPS_PRINT_QUALITY_SUPPORTED "print-quality-supported" + +# define CUPS_PRINT_QUALITY_DRAFT "3" +# define CUPS_PRINT_QUALITY_NORMAL "4" +# define CUPS_PRINT_QUALITY_HIGH "5" + +# define CUPS_SIDES "sides" +# define CUPS_SIDES_SUPPORTED "sides-supported" + +# define CUPS_SIDES_ONE_SIDED "one-sided" +# define CUPS_SIDES_TWO_SIDED_PORTRAIT "two-sided-long-edge" +# define CUPS_SIDES_TWO_SIDED_LANDSCAPE "two-sided-short-edge" + + +/* + * Types and structures... + */ + +typedef unsigned cups_ptype_t; /* Printer type/capability bits */ +enum cups_ptype_e /* Printer type/capability bit + * constants */ +{ /* Not a typedef'd enum so we can OR */ + CUPS_PRINTER_LOCAL = 0x0000, /* Local printer or class */ + CUPS_PRINTER_CLASS = 0x0001, /* Printer class */ + CUPS_PRINTER_REMOTE = 0x0002, /* Remote printer or class */ + CUPS_PRINTER_BW = 0x0004, /* Can do B&W printing */ + CUPS_PRINTER_COLOR = 0x0008, /* Can do color printing */ + CUPS_PRINTER_DUPLEX = 0x0010, /* Can do two-sided printing */ + CUPS_PRINTER_STAPLE = 0x0020, /* Can staple output */ + CUPS_PRINTER_COPIES = 0x0040, /* Can do copies in hardware */ + CUPS_PRINTER_COLLATE = 0x0080, /* Can quickly collate copies */ + CUPS_PRINTER_PUNCH = 0x0100, /* Can punch output */ + CUPS_PRINTER_COVER = 0x0200, /* Can cover output */ + CUPS_PRINTER_BIND = 0x0400, /* Can bind output */ + CUPS_PRINTER_SORT = 0x0800, /* Can sort output */ + CUPS_PRINTER_SMALL = 0x1000, /* Can print on Letter/Legal/A4-size media */ + CUPS_PRINTER_MEDIUM = 0x2000, /* Can print on Tabloid/B/C/A3/A2-size media */ + CUPS_PRINTER_LARGE = 0x4000, /* Can print on D/E/A1/A0-size media */ + CUPS_PRINTER_VARIABLE = 0x8000, /* Can print on rolls and custom-size media */ + CUPS_PRINTER_IMPLICIT = 0x10000, /* Implicit class @private@ + * @since Deprecated@ */ + CUPS_PRINTER_DEFAULT = 0x20000, /* Default printer on network */ + CUPS_PRINTER_FAX = 0x40000, /* Fax queue */ + CUPS_PRINTER_REJECTING = 0x80000, /* Printer is rejecting jobs */ + CUPS_PRINTER_DELETE = 0x100000, /* Delete printer + * @deprecated@ @exclude all@ */ + CUPS_PRINTER_NOT_SHARED = 0x200000, /* Printer is not shared + * @since CUPS 1.2/macOS 10.5@ */ + CUPS_PRINTER_AUTHENTICATED = 0x400000,/* Printer requires authentication + * @since CUPS 1.2/macOS 10.5@ */ + CUPS_PRINTER_COMMANDS = 0x800000, /* Printer supports maintenance commands + * @since CUPS 1.2/macOS 10.5@ */ + CUPS_PRINTER_DISCOVERED = 0x1000000, /* Printer was discovered @since CUPS 1.2/macOS 10.5@ */ + CUPS_PRINTER_SCANNER = 0x2000000, /* Scanner-only device + * @since CUPS 1.4/macOS 10.6@ @private@ */ + CUPS_PRINTER_MFP = 0x4000000, /* Printer with scanning capabilities + * @since CUPS 1.4/macOS 10.6@ @private@ */ + CUPS_PRINTER_3D = 0x8000000, /* Printer with 3D capabilities @exclude all@ @private@ */ + CUPS_PRINTER_OPTIONS = 0x6fffc /* ~(CLASS | REMOTE | IMPLICIT | + * DEFAULT | FAX | REJECTING | DELETE | + * NOT_SHARED | AUTHENTICATED | + * COMMANDS | DISCOVERED) @private@ */ +}; + +typedef struct cups_option_s /**** Printer Options ****/ +{ + char *name; /* Name of option */ + char *value; /* Value of option */ +} cups_option_t; + +typedef struct cups_dest_s /**** Destination ****/ +{ + char *name, /* Printer or class name */ + *instance; /* Local instance name or NULL */ + int is_default; /* Is this printer the default? */ + int num_options; /* Number of options */ + cups_option_t *options; /* Options */ +} cups_dest_t; + +typedef struct _cups_dinfo_s cups_dinfo_t; + /* Destination capability and status + * information @since CUPS 1.6/macOS 10.8@ */ + +typedef struct cups_job_s /**** Job ****/ +{ + int id; /* The job ID */ + char *dest; /* Printer or class name */ + char *title; /* Title/job name */ + char *user; /* User that submitted the job */ + char *format; /* Document format */ + ipp_jstate_t state; /* Job state */ + int size; /* Size in kilobytes */ + int priority; /* Priority (1-100) */ + time_t completed_time; /* Time the job was completed */ + time_t creation_time; /* Time the job was created */ + time_t processing_time; /* Time the job was processed */ +} cups_job_t; + +typedef struct cups_size_s /**** Media Size @since CUPS 1.6/macOS 10.8@ ****/ +{ + char media[128]; /* Media name to use */ + int width, /* Width in hundredths of millimeters */ + length, /* Length in hundredths of + * millimeters */ + bottom, /* Bottom margin in hundredths of + * millimeters */ + left, /* Left margin in hundredths of + * millimeters */ + right, /* Right margin in hundredths of + * millimeters */ + top; /* Top margin in hundredths of + * millimeters */ +} cups_size_t; + +typedef int (*cups_client_cert_cb_t)(http_t *http, void *tls, + cups_array_t *distinguished_names, + void *user_data); + /* Client credentials callback + * @since CUPS 1.5/macOS 10.7@ */ + +typedef int (*cups_dest_cb_t)(void *user_data, unsigned flags, + cups_dest_t *dest); + /* Destination enumeration callback + * @since CUPS 1.6/macOS 10.8@ */ + +# ifdef __BLOCKS__ +typedef int (^cups_dest_block_t)(unsigned flags, cups_dest_t *dest); + /* Destination enumeration block + * @since CUPS 1.6/macOS 10.8@ + * @exclude all@ */ +# endif /* __BLOCKS__ */ + +typedef const char *(*cups_password_cb_t)(const char *prompt); + /* Password callback @exclude all@ */ + +typedef const char *(*cups_password_cb2_t)(const char *prompt, http_t *http, + const char *method, + const char *resource, + void *user_data); + /* New password callback + * @since CUPS 1.4/macOS 10.6@ */ + +typedef int (*cups_server_cert_cb_t)(http_t *http, void *tls, + cups_array_t *certs, void *user_data); + /* Server credentials callback + * @since CUPS 1.5/macOS 10.7@ */ + + +/* + * Functions... + */ + +extern int cupsCancelJob(const char *name, int job_id) _CUPS_PUBLIC; +extern ipp_t *cupsDoFileRequest(http_t *http, ipp_t *request, + const char *resource, + const char *filename) _CUPS_PUBLIC; +extern ipp_t *cupsDoRequest(http_t *http, ipp_t *request, + const char *resource) _CUPS_PUBLIC; +extern http_encryption_t cupsEncryption(void); +extern void cupsFreeJobs(int num_jobs, cups_job_t *jobs) _CUPS_PUBLIC; +extern int cupsGetClasses(char ***classes) _CUPS_DEPRECATED_MSG("Use cupsEnumDests instead."); +extern const char *cupsGetDefault(void) _CUPS_PUBLIC; +extern int cupsGetJobs(cups_job_t **jobs, const char *name, + int myjobs, int whichjobs) _CUPS_PUBLIC; +extern int cupsGetPrinters(char ***printers) _CUPS_DEPRECATED_MSG("Use cupsEnumDests instead."); +extern ipp_status_t cupsLastError(void) _CUPS_PUBLIC; +extern int cupsPrintFile(const char *name, const char *filename, + const char *title, int num_options, + cups_option_t *options) _CUPS_PUBLIC; +extern int cupsPrintFiles(const char *name, int num_files, + const char **files, const char *title, + int num_options, cups_option_t *options) _CUPS_PUBLIC; +extern char *cupsTempFile(char *filename, int len) _CUPS_DEPRECATED_MSG("Use cupsTempFd or cupsTempFile2 instead."); +extern int cupsTempFd(char *filename, int len) _CUPS_PUBLIC; + +extern int cupsAddDest(const char *name, const char *instance, + int num_dests, cups_dest_t **dests) _CUPS_PUBLIC; +extern void cupsFreeDests(int num_dests, cups_dest_t *dests) _CUPS_PUBLIC; +extern cups_dest_t *cupsGetDest(const char *name, const char *instance, + int num_dests, cups_dest_t *dests) _CUPS_PUBLIC; +extern int cupsGetDests(cups_dest_t **dests) _CUPS_PUBLIC; +extern void cupsSetDests(int num_dests, cups_dest_t *dests) _CUPS_PUBLIC; + +extern int cupsAddOption(const char *name, const char *value, + int num_options, cups_option_t **options) _CUPS_PUBLIC; +extern void cupsEncodeOptions(ipp_t *ipp, int num_options, + cups_option_t *options) _CUPS_PUBLIC; +extern void cupsFreeOptions(int num_options, + cups_option_t *options) _CUPS_PUBLIC; +extern const char *cupsGetOption(const char *name, int num_options, + cups_option_t *options) _CUPS_PUBLIC; +extern int cupsParseOptions(const char *arg, int num_options, + cups_option_t **options) _CUPS_PUBLIC; + +extern const char *cupsGetPassword(const char *prompt) _CUPS_PUBLIC; +extern const char *cupsServer(void) _CUPS_PUBLIC; +extern void cupsSetEncryption(http_encryption_t e) _CUPS_PUBLIC; +extern void cupsSetPasswordCB(cups_password_cb_t cb) _CUPS_PUBLIC; +extern void cupsSetServer(const char *server) _CUPS_PUBLIC; +extern void cupsSetUser(const char *user) _CUPS_PUBLIC; +extern const char *cupsUser(void) _CUPS_PUBLIC; + +/**** New in CUPS 1.1.20 ****/ +extern int cupsDoAuthentication(http_t *http, const char *method, + const char *resource) + _CUPS_API_1_1_20; +extern http_status_t cupsGetFile(http_t *http, const char *resource, + const char *filename) _CUPS_API_1_1_20; +extern http_status_t cupsGetFd(http_t *http, const char *resource, int fd) _CUPS_API_1_1_20; +extern http_status_t cupsPutFile(http_t *http, const char *resource, + const char *filename) _CUPS_API_1_1_20; +extern http_status_t cupsPutFd(http_t *http, const char *resource, int fd) + _CUPS_API_1_1_20; + +/**** New in CUPS 1.1.21 ****/ +extern const char *cupsGetDefault2(http_t *http) _CUPS_API_1_1_21; +extern int cupsGetDests2(http_t *http, cups_dest_t **dests) + _CUPS_API_1_1_21; +extern int cupsGetJobs2(http_t *http, cups_job_t **jobs, + const char *name, int myjobs, + int whichjobs) _CUPS_API_1_1_21; +extern int cupsPrintFile2(http_t *http, const char *name, + const char *filename, + const char *title, int num_options, + cups_option_t *options) _CUPS_API_1_1_21; +extern int cupsPrintFiles2(http_t *http, const char *name, + int num_files, const char **files, + const char *title, int num_options, + cups_option_t *options) + _CUPS_API_1_1_21; +extern int cupsSetDests2(http_t *http, int num_dests, + cups_dest_t *dests) _CUPS_API_1_1_21; + +/**** New in CUPS 1.2/macOS 10.5 ****/ +extern void cupsEncodeOptions2(ipp_t *ipp, int num_options, + cups_option_t *options, + ipp_tag_t group_tag) _CUPS_API_1_2; +extern const char *cupsLastErrorString(void) _CUPS_API_1_2; +extern char *cupsNotifySubject(cups_lang_t *lang, ipp_t *event) + _CUPS_API_1_2; +extern char *cupsNotifyText(cups_lang_t *lang, ipp_t *event) + _CUPS_API_1_2; +extern int cupsRemoveOption(const char *name, int num_options, + cups_option_t **options) _CUPS_API_1_2; +extern cups_file_t *cupsTempFile2(char *filename, int len) _CUPS_API_1_2; + +/**** New in CUPS 1.3/macOS 10.5 ****/ +extern ipp_t *cupsDoIORequest(http_t *http, ipp_t *request, + const char *resource, int infile, + int outfile) _CUPS_API_1_3; +extern int cupsRemoveDest(const char *name, + const char *instance, + int num_dests, cups_dest_t **dests) + _CUPS_API_1_3; +extern void cupsSetDefaultDest(const char *name, + const char *instance, + int num_dests, + cups_dest_t *dests) _CUPS_API_1_3; + +/**** New in CUPS 1.4/macOS 10.6 ****/ +extern ipp_status_t cupsCancelJob2(http_t *http, const char *name, + int job_id, int purge) _CUPS_API_1_4; +extern int cupsCreateJob(http_t *http, const char *name, + const char *title, int num_options, + cups_option_t *options) _CUPS_API_1_4; +extern ipp_status_t cupsFinishDocument(http_t *http, + const char *name) _CUPS_API_1_4; +extern cups_dest_t *cupsGetNamedDest(http_t *http, const char *name, + const char *instance) _CUPS_API_1_4; +extern const char *cupsGetPassword2(const char *prompt, http_t *http, + const char *method, + const char *resource) _CUPS_API_1_4; +extern ipp_t *cupsGetResponse(http_t *http, + const char *resource) _CUPS_API_1_4; +extern ssize_t cupsReadResponseData(http_t *http, char *buffer, + size_t length) _CUPS_API_1_4; +extern http_status_t cupsSendRequest(http_t *http, ipp_t *request, + const char *resource, + size_t length) _CUPS_API_1_4; +extern void cupsSetPasswordCB2(cups_password_cb2_t cb, + void *user_data) _CUPS_API_1_4; +extern http_status_t cupsStartDocument(http_t *http, const char *name, + int job_id, const char *docname, + const char *format, + int last_document) _CUPS_API_1_4; +extern http_status_t cupsWriteRequestData(http_t *http, const char *buffer, + size_t length) _CUPS_API_1_4; + +/**** New in CUPS 1.5/macOS 10.7 ****/ +extern void cupsSetClientCertCB(cups_client_cert_cb_t cb, + void *user_data) _CUPS_API_1_5; +extern int cupsSetCredentials(cups_array_t *certs) _CUPS_API_1_5; +extern void cupsSetServerCertCB(cups_server_cert_cb_t cb, + void *user_data) _CUPS_API_1_5; + +/**** New in CUPS 1.6/macOS 10.8 ****/ +extern ipp_status_t cupsCancelDestJob(http_t *http, cups_dest_t *dest, + int job_id) _CUPS_API_1_6; +extern int cupsCheckDestSupported(http_t *http, cups_dest_t *dest, + cups_dinfo_t *info, + const char *option, + const char *value) _CUPS_API_1_6; +extern ipp_status_t cupsCloseDestJob(http_t *http, cups_dest_t *dest, + cups_dinfo_t *info, int job_id) + _CUPS_API_1_6; +extern 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) + _CUPS_API_1_6; +# ifdef __BLOCKS__ +extern http_t *cupsConnectDestBlock(cups_dest_t *dest, + unsigned flags, int msec, + int *cancel, char *resource, + size_t resourcesize, + cups_dest_block_t block) + _CUPS_API_1_6; +# endif /* __BLOCKS__ */ +extern int cupsCopyDest(cups_dest_t *dest, int num_dests, + cups_dest_t **dests) _CUPS_API_1_6; +extern cups_dinfo_t *cupsCopyDestInfo(http_t *http, cups_dest_t *dest) + _CUPS_API_1_6; +extern int cupsCopyDestConflicts(http_t *http, cups_dest_t *dest, + cups_dinfo_t *info, + int num_options, + cups_option_t *options, + const char *new_option, + const char *new_value, + int *num_conflicts, + cups_option_t **conflicts, + int *num_resolved, + cups_option_t **resolved) + _CUPS_API_1_6; +extern 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) _CUPS_API_1_6; +extern int cupsEnumDests(unsigned flags, int msec, int *cancel, + cups_ptype_t type, cups_ptype_t mask, + cups_dest_cb_t cb, void *user_data) + _CUPS_API_1_6; +# ifdef __BLOCKS__ +extern int cupsEnumDestsBlock(unsigned flags, int msec, + int *cancel, cups_ptype_t type, + cups_ptype_t mask, + cups_dest_block_t block) + _CUPS_API_1_6; +# endif /* __BLOCKS__ */ +extern ipp_status_t cupsFinishDestDocument(http_t *http, + cups_dest_t *dest, + cups_dinfo_t *info) + _CUPS_API_1_6; +extern void cupsFreeDestInfo(cups_dinfo_t *dinfo) _CUPS_API_1_6; +extern int cupsGetDestMediaByName(http_t *http, cups_dest_t *dest, + cups_dinfo_t *dinfo, + const char *media, + unsigned flags, + cups_size_t *size) _CUPS_API_1_6; +extern int cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest, + cups_dinfo_t *dinfo, + int width, int length, + unsigned flags, + cups_size_t *size) _CUPS_API_1_6; +extern const char *cupsLocalizeDestOption(http_t *http, cups_dest_t *dest, + cups_dinfo_t *info, + const char *option) + _CUPS_API_1_6; +extern const char *cupsLocalizeDestValue(http_t *http, cups_dest_t *dest, + cups_dinfo_t *info, + const char *option, + const char *value) + _CUPS_API_1_6; +extern 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) _CUPS_API_1_6; + +/* New in CUPS 1.7 */ +extern ipp_attribute_t *cupsFindDestDefault(http_t *http, cups_dest_t *dest, + cups_dinfo_t *dinfo, + const char *option) _CUPS_API_1_7; +extern ipp_attribute_t *cupsFindDestReady(http_t *http, cups_dest_t *dest, + cups_dinfo_t *dinfo, + const char *option) _CUPS_API_1_7; +extern ipp_attribute_t *cupsFindDestSupported(http_t *http, cups_dest_t *dest, + cups_dinfo_t *dinfo, + const char *option) + _CUPS_API_1_7; +extern int cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest, + cups_dinfo_t *dinfo, int n, + unsigned flags, + cups_size_t *size) + _CUPS_API_1_7; +extern int cupsGetDestMediaCount(http_t *http, cups_dest_t *dest, + cups_dinfo_t *dinfo, + unsigned flags) _CUPS_API_1_7; +extern int cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest, + cups_dinfo_t *dinfo, + unsigned flags, + cups_size_t *size) + _CUPS_API_1_7; +extern void cupsSetUserAgent(const char *user_agent) _CUPS_API_1_7; +extern const char *cupsUserAgent(void) _CUPS_API_1_7; + +/* New in CUPS 2.0/macOS 10.10 */ +extern cups_dest_t *cupsGetDestWithURI(const char *name, const char *uri) _CUPS_API_2_0; +extern const char *cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest, cups_dinfo_t *info, unsigned flags, cups_size_t *size) _CUPS_API_2_0; +extern int cupsMakeServerCredentials(const char *path, const char *common_name, int num_alt_names, const char **alt_names, time_t expiration_date) _CUPS_API_2_0; +extern int cupsSetServerCredentials(const char *path, const char *common_name, int auto_create) _CUPS_API_2_0; + +/* New in CUPS 2.2/macOS 10.12 */ +extern ssize_t cupsHashData(const char *algorithm, const void *data, size_t datalen, unsigned char *hash, size_t hashsize) _CUPS_API_2_2; + +/* New in CUPS 2.2.4 */ +extern int cupsAddIntegerOption(const char *name, int value, int num_options, cups_option_t **options) _CUPS_API_2_2_4; +extern int cupsGetIntegerOption(const char *name, int num_options, cups_option_t *options) _CUPS_API_2_2_4; + +/* New in CUPS 2.2.7 */ +extern const char *cupsHashString(const unsigned char *hash, size_t hashsize, char *buffer, size_t bufsize) _CUPS_API_2_2_7; + +/* New in CUPS 2.3 */ +extern int cupsAddDestMediaOptions(http_t *http, cups_dest_t *dest, cups_dinfo_t *dinfo, unsigned flags, cups_size_t *size, int num_options, cups_option_t **options) _CUPS_API_2_3; +extern ipp_attribute_t *cupsEncodeOption(ipp_t *ipp, ipp_tag_t group_tag, const char *name, const char *value) _CUPS_API_2_3; + +# ifdef __cplusplus +} +# endif /* __cplusplus */ + +#endif /* !_CUPS_CUPS_H_ */ diff --git a/third_party/cups/include/cups/file.h b/third_party/cups/include/cups/file.h new file mode 100644 index 0000000000..49ca58a0c4 --- /dev/null +++ b/third_party/cups/include/cups/file.h @@ -0,0 +1,94 @@ +/* + * Public file definitions for CUPS. + * + * Since stdio files max out at 256 files on many systems, we have to + * write similar functions without this limit. At the same time, using + * our own file functions allows us to provide transparent support of + * different line endings, gzip'd print files, PPD files, etc. + * + * Copyright © 2007-2018 by Apple Inc. + * Copyright © 1997-2007 by Easy Software Products, all rights reserved. + * + * Licensed under Apache License v2.0. See the file "LICENSE" for more + * information. + */ + +#ifndef _CUPS_FILE_H_ +# define _CUPS_FILE_H_ + + +/* + * Include necessary headers... + */ + +# include "versioning.h" +# include <stddef.h> +# include <sys/types.h> +# if defined(_WIN32) && !defined(__CUPS_SSIZE_T_DEFINED) +# define __CUPS_SSIZE_T_DEFINED +/* Windows does not support the ssize_t type, so map it to off_t... */ +typedef off_t ssize_t; /* @private@ */ +# endif /* _WIN32 && !__CUPS_SSIZE_T_DEFINED */ + + +/* + * C++ magic... + */ + +# ifdef __cplusplus +extern "C" { +# endif /* __cplusplus */ + + +/* + * CUPS file definitions... + */ + +# define CUPS_FILE_NONE 0 /* No compression */ +# define CUPS_FILE_GZIP 1 /* GZIP compression */ + + +/* + * Types and structures... + */ + +typedef struct _cups_file_s cups_file_t;/**** CUPS file type ****/ + + +/* + * Prototypes... + */ + +extern int cupsFileClose(cups_file_t *fp) _CUPS_API_1_2; +extern int cupsFileCompression(cups_file_t *fp) _CUPS_API_1_2; +extern int cupsFileEOF(cups_file_t *fp) _CUPS_API_1_2; +extern const char *cupsFileFind(const char *filename, const char *path, int executable, char *buffer, int bufsize) _CUPS_API_1_2; +extern int cupsFileFlush(cups_file_t *fp) _CUPS_API_1_2; +extern int cupsFileGetChar(cups_file_t *fp) _CUPS_API_1_2; +extern char *cupsFileGetConf(cups_file_t *fp, char *buf, size_t buflen, char **value, int *linenum) _CUPS_API_1_2; +extern size_t cupsFileGetLine(cups_file_t *fp, char *buf, size_t buflen) _CUPS_API_1_2; +extern char *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen) _CUPS_API_1_2; +extern int cupsFileLock(cups_file_t *fp, int block) _CUPS_API_1_2; +extern int cupsFileNumber(cups_file_t *fp) _CUPS_API_1_2; +extern cups_file_t *cupsFileOpen(const char *filename, const char *mode) _CUPS_API_1_2; +extern cups_file_t *cupsFileOpenFd(int fd, const char *mode) _CUPS_API_1_2; +extern int cupsFilePeekChar(cups_file_t *fp) _CUPS_API_1_2; +extern int cupsFilePrintf(cups_file_t *fp, const char *format, ...) _CUPS_FORMAT(2, 3) _CUPS_API_1_2; +extern int cupsFilePutChar(cups_file_t *fp, int c) _CUPS_API_1_2; +extern ssize_t cupsFilePutConf(cups_file_t *fp, const char *directive, const char *value) _CUPS_API_1_4; +extern int cupsFilePuts(cups_file_t *fp, const char *s) _CUPS_API_1_2; +extern ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes) _CUPS_API_1_2; +extern off_t cupsFileRewind(cups_file_t *fp) _CUPS_API_1_2; +extern off_t cupsFileSeek(cups_file_t *fp, off_t pos) _CUPS_API_1_2; +extern cups_file_t *cupsFileStderr(void) _CUPS_API_1_2; +extern cups_file_t *cupsFileStdin(void) _CUPS_API_1_2; +extern cups_file_t *cupsFileStdout(void) _CUPS_API_1_2; +extern off_t cupsFileTell(cups_file_t *fp) _CUPS_API_1_2; +extern int cupsFileUnlock(cups_file_t *fp) _CUPS_API_1_2; +extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes) _CUPS_API_1_2; + + +# ifdef __cplusplus +} +# endif /* __cplusplus */ +#endif /* !_CUPS_FILE_H_ */ diff --git a/third_party/cups/include/cups/http.h b/third_party/cups/include/cups/http.h new file mode 100644 index 0000000000..01a0321dfa --- /dev/null +++ b/third_party/cups/include/cups/http.h @@ -0,0 +1,593 @@ +/* + * Hyper-Text Transport Protocol definitions for CUPS. + * + * Copyright © 2007-2018 by Apple Inc. + * Copyright © 1997-2007 by Easy Software Products, all rights reserved. + * + * Licensed under Apache License v2.0. See the file "LICENSE" for more + * information. + */ + +#ifndef _CUPS_HTTP_H_ +# define _CUPS_HTTP_H_ + +/* + * Include necessary headers... + */ + +# include "versioning.h" +# include "array.h" +# include <string.h> +# include <time.h> +# include <sys/types.h> +# ifdef _WIN32 +# ifndef __CUPS_SSIZE_T_DEFINED +# define __CUPS_SSIZE_T_DEFINED +/* Windows does not support the ssize_t type, so map it to off_t... */ +typedef off_t ssize_t; /* @private@ */ +# endif /* !__CUPS_SSIZE_T_DEFINED */ +# include <winsock2.h> +# include <ws2tcpip.h> +# else +# include <unistd.h> +# include <sys/time.h> +# include <sys/socket.h> +# include <netdb.h> +# include <netinet/in.h> +# include <arpa/inet.h> +# include <netinet/in_systm.h> +# include <netinet/ip.h> +# if !defined(__APPLE__) || !defined(TCP_NODELAY) +# include <netinet/tcp.h> +# endif /* !__APPLE__ || !TCP_NODELAY */ +# if defined(AF_UNIX) && !defined(AF_LOCAL) +# define AF_LOCAL AF_UNIX /* Older UNIX's have old names... */ +# endif /* AF_UNIX && !AF_LOCAL */ +# ifdef AF_LOCAL +# include <sys/un.h> +# endif /* AF_LOCAL */ +# if defined(LOCAL_PEERCRED) && !defined(SO_PEERCRED) +# define SO_PEERCRED LOCAL_PEERCRED +# endif /* LOCAL_PEERCRED && !SO_PEERCRED */ +# endif /* _WIN32 */ + + +/* + * C++ magic... + */ + +# ifdef __cplusplus +extern "C" { +# endif /* __cplusplus */ + + +/* + * Oh, the wonderful world of IPv6 compatibility. Apparently some + * implementations expose the (more logical) 32-bit address parts + * to everyone, while others only expose it to kernel code... To + * make supporting IPv6 even easier, each vendor chose different + * core structure and union names, so the same defines or code + * can't be used on all platforms. + * + * The following will likely need tweaking on new platforms that + * support IPv6 - the "s6_addr32" define maps to the 32-bit integer + * array in the in6_addr union, which is named differently on various + * platforms. + */ + +#if defined(AF_INET6) && !defined(s6_addr32) +# if defined(__sun) +# define s6_addr32 _S6_un._S6_u32 +# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)|| defined(__DragonFly__) +# define s6_addr32 __u6_addr.__u6_addr32 +# elif defined(_WIN32) +/* + * Windows only defines byte and 16-bit word members of the union and + * requires special casing of all raw address code... + */ +# define s6_addr32 error_need_win32_specific_code +# endif /* __sun */ +#endif /* AF_INET6 && !s6_addr32 */ + + +/* + * Limits... + */ + +# define HTTP_MAX_URI 1024 /* Max length of URI string */ +# define HTTP_MAX_HOST 256 /* Max length of hostname string */ +# define HTTP_MAX_BUFFER 2048 /* Max length of data buffer */ +# define HTTP_MAX_VALUE 256 /* Max header field value length */ + + +/* + * Types and structures... + */ + +typedef enum http_auth_e /**** HTTP authentication types @exclude all@ ****/ +{ + HTTP_AUTH_NONE, /* No authentication in use */ + HTTP_AUTH_BASIC, /* Basic authentication in use */ + HTTP_AUTH_MD5, /* Digest authentication in use */ + HTTP_AUTH_MD5_SESS, /* MD5-session authentication in use */ + HTTP_AUTH_MD5_INT, /* Digest authentication in use for body */ + HTTP_AUTH_MD5_SESS_INT, /* MD5-session authentication in use for body */ + HTTP_AUTH_NEGOTIATE /* GSSAPI authentication in use @since CUPS 1.3/macOS 10.5@ */ +} http_auth_t; + +typedef enum http_encoding_e /**** HTTP transfer encoding values ****/ +{ + HTTP_ENCODING_LENGTH, /* Data is sent with Content-Length */ + HTTP_ENCODING_CHUNKED, /* Data is chunked */ + HTTP_ENCODING_FIELDS /* Sending HTTP fields */ + +# ifndef _CUPS_NO_DEPRECATED +# define HTTP_ENCODE_LENGTH HTTP_ENCODING_LENGTH +# define HTTP_ENCODE_CHUNKED HTTP_ENCODING_CHUNKED +# define HTTP_ENCODE_FIELDS HTTP_ENCODING_FIELDS +# endif /* !_CUPS_NO_DEPRECATED */ +} http_encoding_t; + +typedef enum http_encryption_e /**** HTTP encryption values ****/ +{ + HTTP_ENCRYPTION_IF_REQUESTED, /* Encrypt if requested (TLS upgrade) */ + HTTP_ENCRYPTION_NEVER, /* Never encrypt */ + HTTP_ENCRYPTION_REQUIRED, /* Encryption is required (TLS upgrade) */ + HTTP_ENCRYPTION_ALWAYS /* Always encrypt (SSL) */ + +# ifndef _CUPS_NO_DEPRECATED +# define HTTP_ENCRYPT_IF_REQUESTED HTTP_ENCRYPTION_IF_REQUESTED +# define HTTP_ENCRYPT_NEVER HTTP_ENCRYPTION_NEVER +# define HTTP_ENCRYPT_REQUIRED HTTP_ENCRYPTION_REQUIRED +# define HTTP_ENCRYPT_ALWAYS HTTP_ENCRYPTION_ALWAYS +# endif /* !_CUPS_NO_DEPRECATED */ +} http_encryption_t; + +typedef enum http_field_e /**** HTTP field names ****/ +{ + HTTP_FIELD_UNKNOWN = -1, /* Unknown field */ + HTTP_FIELD_ACCEPT_LANGUAGE, /* Accept-Language field */ + HTTP_FIELD_ACCEPT_RANGES, /* Accept-Ranges field */ + HTTP_FIELD_AUTHORIZATION, /* Authorization field */ + HTTP_FIELD_CONNECTION, /* Connection field */ + HTTP_FIELD_CONTENT_ENCODING, /* Content-Encoding field */ + HTTP_FIELD_CONTENT_LANGUAGE, /* Content-Language field */ + HTTP_FIELD_CONTENT_LENGTH, /* Content-Length field */ + HTTP_FIELD_CONTENT_LOCATION, /* Content-Location field */ + HTTP_FIELD_CONTENT_MD5, /* Content-MD5 field */ + HTTP_FIELD_CONTENT_RANGE, /* Content-Range field */ + HTTP_FIELD_CONTENT_TYPE, /* Content-Type field */ + HTTP_FIELD_CONTENT_VERSION, /* Content-Version field */ + HTTP_FIELD_DATE, /* Date field */ + HTTP_FIELD_HOST, /* Host field */ + HTTP_FIELD_IF_MODIFIED_SINCE, /* If-Modified-Since field */ + HTTP_FIELD_IF_UNMODIFIED_SINCE, /* If-Unmodified-Since field */ + HTTP_FIELD_KEEP_ALIVE, /* Keep-Alive field */ + HTTP_FIELD_LAST_MODIFIED, /* Last-Modified field */ + HTTP_FIELD_LINK, /* Link field */ + HTTP_FIELD_LOCATION, /* Location field */ + HTTP_FIELD_RANGE, /* Range field */ + HTTP_FIELD_REFERER, /* Referer field */ + HTTP_FIELD_RETRY_AFTER, /* Retry-After field */ + HTTP_FIELD_TRANSFER_ENCODING, /* Transfer-Encoding field */ + HTTP_FIELD_UPGRADE, /* Upgrade field */ + HTTP_FIELD_USER_AGENT, /* User-Agent field */ + HTTP_FIELD_WWW_AUTHENTICATE, /* WWW-Authenticate field */ + HTTP_FIELD_ACCEPT_ENCODING, /* Accepting-Encoding field @since CUPS 1.7/macOS 10.9@ */ + HTTP_FIELD_ALLOW, /* Allow field @since CUPS 1.7/macOS 10.9@ */ + HTTP_FIELD_SERVER, /* Server field @since CUPS 1.7/macOS 10.9@ */ + HTTP_FIELD_AUTHENTICATION_INFO, /* Authentication-Info field (@since CUPS 2.2.9) */ + HTTP_FIELD_MAX /* Maximum field index */ +} http_field_t; + +typedef enum http_keepalive_e /**** HTTP keep-alive values ****/ +{ + HTTP_KEEPALIVE_OFF = 0, /* No keep alive support */ + HTTP_KEEPALIVE_ON /* Use keep alive */ +} http_keepalive_t; + +typedef enum http_state_e /**** HTTP state values; states + **** are server-oriented... + ****/ +{ + HTTP_STATE_ERROR = -1, /* Error on socket */ + HTTP_STATE_WAITING, /* Waiting for command */ + HTTP_STATE_OPTIONS, /* OPTIONS command, waiting for blank line */ + HTTP_STATE_GET, /* GET command, waiting for blank line */ + HTTP_STATE_GET_SEND, /* GET command, sending data */ + HTTP_STATE_HEAD, /* HEAD command, waiting for blank line */ + HTTP_STATE_POST, /* POST command, waiting for blank line */ + HTTP_STATE_POST_RECV, /* POST command, receiving data */ + HTTP_STATE_POST_SEND, /* POST command, sending data */ + HTTP_STATE_PUT, /* PUT command, waiting for blank line */ + HTTP_STATE_PUT_RECV, /* PUT command, receiving data */ + HTTP_STATE_DELETE, /* DELETE command, waiting for blank line */ + HTTP_STATE_TRACE, /* TRACE command, waiting for blank line */ + HTTP_STATE_CONNECT, /* CONNECT command, waiting for blank line */ + HTTP_STATE_STATUS, /* Command complete, sending status */ + HTTP_STATE_UNKNOWN_METHOD, /* Unknown request method, waiting for blank line @since CUPS 1.7/macOS 10.9@ */ + HTTP_STATE_UNKNOWN_VERSION /* Unknown request method, waiting for blank line @since CUPS 1.7/macOS 10.9@ */ + +# ifndef _CUPS_NO_DEPRECATED +# define HTTP_WAITING HTTP_STATE_WAITING +# define HTTP_OPTIONS HTTP_STATE_OPTIONS +# define HTTP_GET HTTP_STATE_GET +# define HTTP_GET_SEND HTTP_STATE_GET_SEND +# define HTTP_HEAD HTTP_STATE_HEAD +# define HTTP_POST HTTP_STATE_POST +# define HTTP_POST_RECV HTTP_STATE_POST_RECV +# define HTTP_POST_SEND HTTP_STATE_POST_SEND +# define HTTP_PUT HTTP_STATE_PUT +# define HTTP_PUT_RECV HTTP_STATE_PUT_RECV +# define HTTP_DELETE HTTP_STATE_DELETE +# define HTTP_TRACE HTTP_STATE_TRACE +# define HTTP_CLOSE HTTP_STATE_CONNECT +# define HTTP_STATUS HTTP_STATE_STATUS +# endif /* !_CUPS_NO_DEPRECATED */ +} http_state_t; + +typedef enum http_status_e /**** HTTP status codes ****/ +{ + HTTP_STATUS_ERROR = -1, /* An error response from httpXxxx() */ + HTTP_STATUS_NONE = 0, /* No Expect value @since CUPS 1.7/macOS 10.9@ */ + + HTTP_STATUS_CONTINUE = 100, /* Everything OK, keep going... */ + HTTP_STATUS_SWITCHING_PROTOCOLS, /* HTTP upgrade to TLS/SSL */ + + HTTP_STATUS_OK = 200, /* OPTIONS/GET/HEAD/POST/TRACE command was successful */ + HTTP_STATUS_CREATED, /* PUT command was successful */ + HTTP_STATUS_ACCEPTED, /* DELETE command was successful */ + HTTP_STATUS_NOT_AUTHORITATIVE, /* Information isn't authoritative */ + HTTP_STATUS_NO_CONTENT, /* Successful command, no new data */ + HTTP_STATUS_RESET_CONTENT, /* Content was reset/recreated */ + HTTP_STATUS_PARTIAL_CONTENT, /* Only a partial file was received/sent */ + + HTTP_STATUS_MULTIPLE_CHOICES = 300, /* Multiple files match request */ + HTTP_STATUS_MOVED_PERMANENTLY, /* Document has moved permanently */ + HTTP_STATUS_FOUND, /* Document was found at a different URI */ + HTTP_STATUS_SEE_OTHER, /* See this other link */ + HTTP_STATUS_NOT_MODIFIED, /* File not modified */ + HTTP_STATUS_USE_PROXY, /* Must use a proxy to access this URI */ + HTTP_STATUS_TEMPORARY_REDIRECT = 307, /* Temporary redirection */ + + HTTP_STATUS_BAD_REQUEST = 400, /* Bad request */ + HTTP_STATUS_UNAUTHORIZED, /* Unauthorized to access host */ + HTTP_STATUS_PAYMENT_REQUIRED, /* Payment required */ + HTTP_STATUS_FORBIDDEN, /* Forbidden to access this URI */ + HTTP_STATUS_NOT_FOUND, /* URI was not found */ + HTTP_STATUS_METHOD_NOT_ALLOWED, /* Method is not allowed */ + HTTP_STATUS_NOT_ACCEPTABLE, /* Not Acceptable */ + HTTP_STATUS_PROXY_AUTHENTICATION, /* Proxy Authentication is Required */ + HTTP_STATUS_REQUEST_TIMEOUT, /* Request timed out */ + HTTP_STATUS_CONFLICT, /* Request is self-conflicting */ + HTTP_STATUS_GONE, /* Server has gone away */ + HTTP_STATUS_LENGTH_REQUIRED, /* A content length or encoding is required */ + HTTP_STATUS_PRECONDITION, /* Precondition failed */ + HTTP_STATUS_REQUEST_TOO_LARGE, /* Request entity too large */ + HTTP_STATUS_URI_TOO_LONG, /* URI too long */ + HTTP_STATUS_UNSUPPORTED_MEDIATYPE, /* The requested media type is unsupported */ + HTTP_STATUS_REQUESTED_RANGE, /* The requested range is not satisfiable */ + HTTP_STATUS_EXPECTATION_FAILED, /* The expectation given in an Expect header field was not met */ + HTTP_STATUS_UPGRADE_REQUIRED = 426, /* Upgrade to SSL/TLS required */ + + HTTP_STATUS_SERVER_ERROR = 500, /* Internal server error */ + HTTP_STATUS_NOT_IMPLEMENTED, /* Feature not implemented */ + HTTP_STATUS_BAD_GATEWAY, /* Bad gateway */ + HTTP_STATUS_SERVICE_UNAVAILABLE, /* Service is unavailable */ + HTTP_STATUS_GATEWAY_TIMEOUT, /* Gateway connection timed out */ + HTTP_STATUS_NOT_SUPPORTED, /* HTTP version not supported */ + + HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED = 1000, + /* User canceled authorization @since CUPS 1.4@ */ + HTTP_STATUS_CUPS_PKI_ERROR, /* Error negotiating a secure connection @since CUPS 1.5/macOS 10.7@ */ + HTTP_STATUS_CUPS_WEBIF_DISABLED /* Web interface is disabled @private@ */ + +# define HTTP_STATUS_MOVED_TEMPORARILY HTTP_STATUS_FOUND /* Renamed in RFC 7231 */ + +# ifndef _CUPS_NO_DEPRECATED +/* Old names for this enumeration */ +# define HTTP_ERROR HTTP_STATUS_ERROR + +# define HTTP_CONTINUE HTTP_STATUS_CONTINUE +# define HTTP_SWITCHING_PROTOCOLS HTTP_STATUS_SWITCHING_PROTOCOLS + +# define HTTP_OK HTTP_STATUS_OK +# define HTTP_CREATED HTTP_STATUS_CREATED +# define HTTP_ACCEPTED HTTP_STATUS_ACCEPTED +# define HTTP_NOT_AUTHORITATIVE HTTP_STATUS_NOT_AUTHORITATIVE +# define HTTP_NO_CONTENT HTTP_STATUS_NO_CONTENT +# define HTTP_RESET_CONTENT HTTP_STATUS_RESET_CONTENT +# define HTTP_PARTIAL_CONTENT HTTP_STATUS_PARTIAL_CONTENT + +# define HTTP_MULTIPLE_CHOICES HTTP_STATUS_MULTIPLE_CHOICES +# define HTTP_MOVED_PERMANENTLY HTTP_STATUS_MOVED_PERMANENTLY +# define HTTP_MOVED_TEMPORARILY HTTP_STATUS_MOVED_TEMPORARILY +# define HTTP_SEE_OTHER HTTP_STATUS_SEE_OTHER +# define HTTP_NOT_MODIFIED HTTP_STATUS_NOT_MODIFIED +# define HTTP_USE_PROXY HTTP_STATUS_USE_PROXY + +# define HTTP_BAD_REQUEST HTTP_STATUS_BAD_REQUEST +# define HTTP_UNAUTHORIZED HTTP_STATUS_UNAUTHORIZED +# define HTTP_PAYMENT_REQUIRED HTTP_STATUS_PAYMENT_REQUIRED +# define HTTP_FORBIDDEN HTTP_STATUS_FORBIDDEN +# define HTTP_NOT_FOUND HTTP_STATUS_NOT_FOUND +# define HTTP_METHOD_NOT_ALLOWED HTTP_STATUS_METHOD_NOT_ALLOWED +# define HTTP_NOT_ACCEPTABLE HTTP_STATUS_NOT_ACCEPTABLE +# define HTTP_PROXY_AUTHENTICATION HTTP_STATUS_PROXY_AUTHENTICATION +# define HTTP_REQUEST_TIMEOUT HTTP_STATUS_REQUEST_TIMEOUT +# define HTTP_CONFLICT HTTP_STATUS_CONFLICT +# define HTTP_GONE HTTP_STATUS_GONE +# define HTTP_LENGTH_REQUIRED HTTP_STATUS_LENGTH_REQUIRED +# define HTTP_PRECONDITION HTTP_STATUS_PRECONDITION +# define HTTP_REQUEST_TOO_LARGE HTTP_STATUS_REQUEST_TOO_LARGE +# define HTTP_URI_TOO_LONG HTTP_STATUS_URI_TOO_LONG +# define HTTP_UNSUPPORTED_MEDIATYPE HTTP_STATUS_UNSUPPORTED_MEDIATYPE +# define HTTP_REQUESTED_RANGE HTTP_STATUS_REQUESTED_RANGE +# define HTTP_EXPECTATION_FAILED HTTP_STATUS_EXPECTATION_FAILED +# define HTTP_UPGRADE_REQUIRED HTTP_STATUS_UPGRADE_REQUIRED + +# define HTTP_SERVER_ERROR HTTP_STATUS_SERVER_ERROR +# define HTTP_NOT_IMPLEMENTED HTTP_STATUS_NOT_IMPLEMENTED +# define HTTP_BAD_GATEWAY HTTP_STATUS_BAD_GATEWAY +# define HTTP_SERVICE_UNAVAILABLE HTTP_STATUS_SERVICE_UNAVAILABLE +# define HTTP_GATEWAY_TIMEOUT HTTP_STATUS_GATEWAY_TIMEOUT +# define HTTP_NOT_SUPPORTED HTTP_STATUS_NOT_SUPPORTED + +# define HTTP_AUTHORIZATION_CANCELED HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED +# define HTTP_PKI_ERROR HTTP_STATUS_CUPS_PKI_ERROR +# define HTTP_WEBIF_DISABLED HTTP_STATUS_CUPS_WEBIF_DISABLED +# endif /* !_CUPS_NO_DEPRECATED */ +} http_status_t; + +typedef enum http_trust_e /**** Level of trust for credentials @since CUPS 2.0/OS 10.10@ */ +{ + HTTP_TRUST_OK = 0, /* Credentials are OK/trusted */ + HTTP_TRUST_INVALID, /* Credentials are invalid */ + HTTP_TRUST_CHANGED, /* Credentials have changed */ + HTTP_TRUST_EXPIRED, /* Credentials are expired */ + HTTP_TRUST_RENEWED, /* Credentials have been renewed */ + HTTP_TRUST_UNKNOWN, /* Credentials are unknown/new */ +} http_trust_t; + +typedef enum http_uri_status_e /**** URI separation status @since CUPS 1.2@ ****/ +{ + HTTP_URI_STATUS_OVERFLOW = -8, /* URI buffer for httpAssembleURI is too small */ + HTTP_URI_STATUS_BAD_ARGUMENTS = -7, /* Bad arguments to function (error) */ + HTTP_URI_STATUS_BAD_RESOURCE = -6, /* Bad resource in URI (error) */ + HTTP_URI_STATUS_BAD_PORT = -5, /* Bad port number in URI (error) */ + HTTP_URI_STATUS_BAD_HOSTNAME = -4, /* Bad hostname in URI (error) */ + HTTP_URI_STATUS_BAD_USERNAME = -3, /* Bad username in URI (error) */ + HTTP_URI_STATUS_BAD_SCHEME = -2, /* Bad scheme in URI (error) */ + HTTP_URI_STATUS_BAD_URI = -1, /* Bad/empty URI (error) */ + HTTP_URI_STATUS_OK = 0, /* URI decoded OK */ + HTTP_URI_STATUS_MISSING_SCHEME, /* Missing scheme in URI (warning) */ + HTTP_URI_STATUS_UNKNOWN_SCHEME, /* Unknown scheme in URI (warning) */ + HTTP_URI_STATUS_MISSING_RESOURCE /* Missing resource in URI (warning) */ + +# ifndef _CUPS_NO_DEPRECATED +# define HTTP_URI_OVERFLOW HTTP_URI_STATUS_OVERFLOW +# define HTTP_URI_BAD_ARGUMENTS HTTP_URI_STATUS_BAD_ARGUMENTS +# define HTTP_URI_BAD_RESOURCE HTTP_URI_STATUS_BAD_RESOURCE +# define HTTP_URI_BAD_PORT HTTP_URI_STATUS_BAD_PORT +# define HTTP_URI_BAD_HOSTNAME HTTP_URI_STATUS_BAD_HOSTNAME +# define HTTP_URI_BAD_USERNAME HTTP_URI_STATUS_BAD_USERNAME +# define HTTP_URI_BAD_SCHEME HTTP_URI_STATUS_BAD_SCHEME +# define HTTP_URI_BAD_URI HTTP_URI_STATUS_BAD_URI +# define HTTP_URI_OK HTTP_URI_STATUS_OK +# define HTTP_URI_MISSING_SCHEME HTTP_URI_STATUS_MISSING_SCHEME +# define HTTP_URI_UNKNOWN_SCHEME HTTP_URI_STATUS_UNKNOWN_SCHEME +# define HTTP_URI_MISSING_RESOURCE HTTP_URI_STATUS_MISSING_RESOURCE +# endif /* !_CUPS_NO_DEPRECATED */ +} http_uri_status_t; + +typedef enum http_uri_coding_e /**** URI en/decode flags ****/ +{ + HTTP_URI_CODING_NONE = 0, /* Don't en/decode anything */ + HTTP_URI_CODING_USERNAME = 1, /* En/decode the username portion */ + HTTP_URI_CODING_HOSTNAME = 2, /* En/decode the hostname portion */ + HTTP_URI_CODING_RESOURCE = 4, /* En/decode the resource portion */ + HTTP_URI_CODING_MOST = 7, /* En/decode all but the query */ + HTTP_URI_CODING_QUERY = 8, /* En/decode the query portion */ + HTTP_URI_CODING_ALL = 15, /* En/decode everything */ + HTTP_URI_CODING_RFC6874 = 16 /* Use RFC 6874 address format */ +} http_uri_coding_t; + +typedef enum http_version_e /**** HTTP version numbers @exclude all@ ****/ +{ + HTTP_VERSION_0_9 = 9, /* HTTP/0.9 */ + HTTP_VERSION_1_0 = 100, /* HTTP/1.0 */ + HTTP_VERSION_1_1 = 101 /* HTTP/1.1 */ + +# ifndef _CUPS_NO_DEPRECATED +# define HTTP_0_9 HTTP_VERSION_0_9 +# define HTTP_1_0 HTTP_VERSION_1_0 +# define HTTP_1_1 HTTP_VERSION_1_1 +# endif /* !_CUPS_NO_DEPRECATED */ +} http_version_t; + +typedef union _http_addr_u /**** Socket address union, which + **** makes using IPv6 and other + **** address types easier and + **** more portable. @since CUPS 1.2/macOS 10.5@ + ****/ +{ + struct sockaddr addr; /* Base structure for family value */ + struct sockaddr_in ipv4; /* IPv4 address */ +#ifdef AF_INET6 + struct sockaddr_in6 ipv6; /* IPv6 address */ +#endif /* AF_INET6 */ +#ifdef AF_LOCAL + struct sockaddr_un un; /* Domain socket file */ +#endif /* AF_LOCAL */ + char pad[256]; /* Padding to ensure binary compatibility */ +} http_addr_t; + +typedef struct http_addrlist_s /**** Socket address list, which is + **** used to enumerate all of the + **** addresses that are associated + **** with a hostname. @since CUPS 1.2/macOS 10.5@ + **** @exclude all@ + ****/ +{ + struct http_addrlist_s *next; /* Pointer to next address in list */ + http_addr_t addr; /* Address */ +} http_addrlist_t; + +typedef struct _http_s http_t; /**** HTTP connection type ****/ + +typedef struct http_credential_s /**** HTTP credential data @since CUPS 1.5/macOS 10.7@ @exclude all@ ****/ +{ + void *data; /* Pointer to credential data */ + size_t datalen; /* Credential length */ +} http_credential_t; + +typedef int (*http_timeout_cb_t)(http_t *http, void *user_data); + /**** HTTP timeout callback @since CUPS 1.5/macOS 10.7@ ****/ + + + +/* + * Prototypes... + */ + +extern void httpBlocking(http_t *http, int b) _CUPS_PUBLIC; +extern int httpCheck(http_t *http) _CUPS_PUBLIC; +extern void httpClearFields(http_t *http) _CUPS_PUBLIC; +extern void httpClose(http_t *http) _CUPS_PUBLIC; +extern http_t *httpConnect(const char *host, int port) _CUPS_DEPRECATED_1_7_MSG("Use httpConnect2 instead."); +extern http_t *httpConnectEncrypt(const char *host, int port, http_encryption_t encryption) _CUPS_DEPRECATED_1_7_MSG("Use httpConnect2 instead."); +extern int httpDelete(http_t *http, const char *uri) _CUPS_PUBLIC; +extern int httpEncryption(http_t *http, http_encryption_t e) _CUPS_PUBLIC; +extern int httpError(http_t *http) _CUPS_PUBLIC; +extern void httpFlush(http_t *http) _CUPS_PUBLIC; +extern int httpGet(http_t *http, const char *uri) _CUPS_PUBLIC; +extern char *httpGets(char *line, int length, http_t *http) _CUPS_PUBLIC; +extern const char *httpGetDateString(time_t t) _CUPS_PUBLIC; +extern time_t httpGetDateTime(const char *s) _CUPS_PUBLIC; +extern const char *httpGetField(http_t *http, http_field_t field) _CUPS_PUBLIC; +extern struct hostent *httpGetHostByName(const char *name) _CUPS_PUBLIC; +extern char *httpGetSubField(http_t *http, http_field_t field, const char *name, char *value) _CUPS_PUBLIC; +extern int httpHead(http_t *http, const char *uri) _CUPS_PUBLIC; +extern void httpInitialize(void) _CUPS_PUBLIC; +extern int httpOptions(http_t *http, const char *uri) _CUPS_PUBLIC; +extern int httpPost(http_t *http, const char *uri) _CUPS_PUBLIC; +extern int httpPrintf(http_t *http, const char *format, ...) _CUPS_FORMAT(2, 3) _CUPS_PUBLIC; +extern int httpPut(http_t *http, const char *uri) _CUPS_PUBLIC; +extern int httpRead(http_t *http, char *buffer, int length) _CUPS_DEPRECATED_MSG("Use httpRead2 instead."); +extern int httpReconnect(http_t *http) _CUPS_DEPRECATED_1_6_MSG("Use httpReconnect2 instead."); +extern void httpSeparate(const char *uri, char *method, char *username, char *host, int *port, char *resource) _CUPS_DEPRECATED_1_2_MSG("Use httpSeparateURI instead."); +extern void httpSetField(http_t *http, http_field_t field, const char *value) _CUPS_PUBLIC; +extern const char *httpStatus(http_status_t status) _CUPS_PUBLIC; +extern int httpTrace(http_t *http, const char *uri) _CUPS_PUBLIC; +extern http_status_t httpUpdate(http_t *http) _CUPS_PUBLIC; +extern int httpWrite(http_t *http, const char *buffer, int length) _CUPS_DEPRECATED_MSG("Use httpWrite2 instead."); +extern char *httpEncode64(char *out, const char *in) _CUPS_DEPRECATED_MSG("Use httpEncode64_2 instead."); +extern char *httpDecode64(char *out, const char *in) _CUPS_DEPRECATED_MSG("Use httpDecode64_2 instead."); +extern int httpGetLength(http_t *http) _CUPS_DEPRECATED_1_2_MSG("Use httpGetLength2 instead."); +extern char *httpMD5(const char *, const char *, const char *, char [33]) _CUPS_DEPRECATED_MSG("Use cupsDoAuth or cupsHashData instead."); +extern char *httpMD5Final(const char *, const char *, const char *, char [33]) _CUPS_DEPRECATED_2_2_MSG("Use cupsDoAuth or cupsHashData instead."); +extern char *httpMD5String(const unsigned char *, char [33]) _CUPS_DEPRECATED_2_2_MSG("Use cupsHashString instead."); + +/**** New in CUPS 1.1.19 ****/ +extern void httpClearCookie(http_t *http) _CUPS_API_1_1_19; +extern const char *httpGetCookie(http_t *http) _CUPS_API_1_1_19; +extern void httpSetCookie(http_t *http, const char *cookie) _CUPS_API_1_1_19; +extern int httpWait(http_t *http, int msec) _CUPS_API_1_1_19; + +/**** New in CUPS 1.1.21 ****/ +extern char *httpDecode64_2(char *out, int *outlen, const char *in) _CUPS_API_1_1_21; +extern char *httpEncode64_2(char *out, int outlen, const char *in, int inlen) _CUPS_API_1_1_21; +extern void httpSeparate2(const char *uri, char *method, int methodlen, char *username, int usernamelen, char *host, int hostlen, int *port, char *resource, int resourcelen) _CUPS_DEPRECATED_1_2_MSG("Use httpSeparateURI instead."); + +/**** New in CUPS 1.2/macOS 10.5 ****/ +extern int httpAddrAny(const http_addr_t *addr) _CUPS_API_1_2; +extern http_addrlist_t *httpAddrConnect(http_addrlist_t *addrlist, int *sock) _CUPS_API_1_2; +extern int httpAddrEqual(const http_addr_t *addr1, const http_addr_t *addr2) _CUPS_API_1_2; +extern void httpAddrFreeList(http_addrlist_t *addrlist) _CUPS_API_1_2; +extern http_addrlist_t *httpAddrGetList(const char *hostname, int family, const char *service) _CUPS_API_1_2; +extern int httpAddrLength(const http_addr_t *addr) _CUPS_API_1_2; +extern int httpAddrLocalhost(const http_addr_t *addr) _CUPS_API_1_2; +extern char *httpAddrLookup(const http_addr_t *addr, char *name, int namelen) _CUPS_API_1_2; +extern char *httpAddrString(const http_addr_t *addr, char *s, int slen) _CUPS_API_1_2; +extern http_uri_status_t httpAssembleURI(http_uri_coding_t encoding, char *uri, int urilen, const char *scheme, const char *username, const char *host, int port, const char *resource) _CUPS_API_1_2; +extern http_uri_status_t httpAssembleURIf(http_uri_coding_t encoding, char *uri, int urilen, const char *scheme, const char *username, const char *host, int port, const char *resourcef, ...) _CUPS_FORMAT(8, 9) _CUPS_API_1_2; +extern int httpFlushWrite(http_t *http) _CUPS_API_1_2; +extern int httpGetBlocking(http_t *http) _CUPS_API_1_2; +extern const char *httpGetDateString2(time_t t, char *s, int slen) _CUPS_API_1_2; +extern int httpGetFd(http_t *http) _CUPS_API_1_2; +extern const char *httpGetHostname(http_t *http, char *s, int slen) _CUPS_API_1_2; +extern off_t httpGetLength2(http_t *http) _CUPS_API_1_2; +extern http_status_t httpGetStatus(http_t *http) _CUPS_API_1_2; +extern char *httpGetSubField2(http_t *http, http_field_t field, const char *name, char *value, int valuelen) _CUPS_API_1_2; +extern ssize_t httpRead2(http_t *http, char *buffer, size_t length) _CUPS_API_1_2; +extern http_uri_status_t httpSeparateURI(http_uri_coding_t decoding, const char *uri, char *scheme, int schemelen, char *username, int usernamelen, char *host, int hostlen, int *port, char *resource, int resourcelen) _CUPS_API_1_2; +extern void httpSetExpect(http_t *http, http_status_t expect) _CUPS_API_1_2; +extern void httpSetLength(http_t *http, size_t length) _CUPS_API_1_2; +extern ssize_t httpWrite2(http_t *http, const char *buffer, size_t length) _CUPS_API_1_2; + +/**** New in CUPS 1.3/macOS 10.5 ****/ +extern char *httpGetAuthString(http_t *http) _CUPS_API_1_3; +extern void httpSetAuthString(http_t *http, const char *scheme, const char *data) _CUPS_API_1_3; + +/**** New in CUPS 1.5/macOS 10.7 ****/ +extern int httpAddCredential(cups_array_t *credentials, const void *data, size_t datalen) _CUPS_API_1_5; +extern int httpCopyCredentials(http_t *http, cups_array_t **credentials) _CUPS_API_1_5; +extern void httpFreeCredentials(cups_array_t *certs) _CUPS_API_1_5; +extern int httpSetCredentials(http_t *http, cups_array_t *certs) _CUPS_API_1_5; +extern void httpSetTimeout(http_t *http, double timeout, http_timeout_cb_t cb, void *user_data) _CUPS_API_1_5; + +/**** New in CUPS 1.6/macOS 10.8 ****/ +extern http_addrlist_t *httpAddrConnect2(http_addrlist_t *addrlist, int *sock, int msec, int *cancel) _CUPS_API_1_6; +extern http_state_t httpGetState(http_t *http) _CUPS_API_1_6; +extern http_version_t httpGetVersion(http_t *http) _CUPS_API_1_6; +extern int httpReconnect2(http_t *http, int msec, int *cancel) _CUPS_API_1_6; + + +/**** New in CUPS 1.7/macOS 10.9 ****/ +extern http_t *httpAcceptConnection(int fd, int blocking) _CUPS_API_1_7; +extern http_addrlist_t *httpAddrCopyList(http_addrlist_t *src) _CUPS_API_1_7; +extern int httpAddrListen(http_addr_t *addr, int port) _CUPS_API_1_7; +extern int httpAddrPort(http_addr_t *addr) _CUPS_API_1_7; +extern char *httpAssembleUUID(const char *server, int port, const char *name, int number, char *buffer, size_t bufsize) _CUPS_API_1_7; +extern http_t *httpConnect2(const char *host, int port, http_addrlist_t *addrlist, int family, http_encryption_t encryption, int blocking, int msec, int *cancel) _CUPS_API_1_7; +extern const char *httpGetContentEncoding(http_t *http) _CUPS_API_1_7; +extern http_status_t httpGetExpect(http_t *http) _CUPS_API_1_7; +extern ssize_t httpPeek(http_t *http, char *buffer, size_t length) _CUPS_API_1_7; +extern http_state_t httpReadRequest(http_t *http, char *resource, size_t resourcelen) _CUPS_API_1_7; +extern void httpSetDefaultField(http_t *http, http_field_t field, const char *value) _CUPS_API_1_7; +extern http_state_t httpWriteResponse(http_t *http, http_status_t status) _CUPS_API_1_7; + +/* New in CUPS 2.0/macOS 10.10 */ +extern int httpAddrClose(http_addr_t *addr, int fd) _CUPS_API_2_0; +extern int httpAddrFamily(http_addr_t *addr) _CUPS_API_2_0; +extern int httpCompareCredentials(cups_array_t *cred1, cups_array_t *cred2) _CUPS_API_2_0; +extern int httpCredentialsAreValidForName(cups_array_t *credentials, const char *common_name); +extern time_t httpCredentialsGetExpiration(cups_array_t *credentials) _CUPS_API_2_0; +extern http_trust_t httpCredentialsGetTrust(cups_array_t *credentials, const char *common_name) _CUPS_API_2_0; +extern size_t httpCredentialsString(cups_array_t *credentials, char *buffer, size_t bufsize) _CUPS_API_2_0; +extern http_field_t httpFieldValue(const char *name) _CUPS_API_2_0; +extern time_t httpGetActivity(http_t *http) _CUPS_API_2_0; +extern http_addr_t *httpGetAddress(http_t *http) _CUPS_API_2_0; +extern http_encryption_t httpGetEncryption(http_t *http) _CUPS_API_2_0; +extern http_keepalive_t httpGetKeepAlive(http_t *http) _CUPS_API_2_0; +extern size_t httpGetPending(http_t *http) _CUPS_API_2_0; +extern size_t httpGetReady(http_t *http) _CUPS_API_2_0; +extern size_t httpGetRemaining(http_t *http) _CUPS_API_2_0; +extern int httpIsChunked(http_t *http) _CUPS_API_2_0; +extern int httpIsEncrypted(http_t *http) _CUPS_API_2_0; +extern int httpLoadCredentials(const char *path, cups_array_t **credentials, const char *common_name) _CUPS_API_2_0; +extern const char *httpResolveHostname(http_t *http, char *buffer, size_t bufsize) _CUPS_API_2_0; +extern int httpSaveCredentials(const char *path, cups_array_t *credentials, const char *common_name) _CUPS_API_2_0; +extern void httpSetKeepAlive(http_t *http, http_keepalive_t keep_alive) _CUPS_API_2_0; +extern void httpShutdown(http_t *http) _CUPS_API_2_0; +extern const char *httpStateString(http_state_t state) _CUPS_API_2_0; +extern const char *httpURIStatusString(http_uri_status_t status) _CUPS_API_2_0; + +/* + * C++ magic... + */ + +# ifdef __cplusplus +} +# endif /* __cplusplus */ +#endif /* !_CUPS_HTTP_H_ */ diff --git a/third_party/cups/include/cups/ipp.h b/third_party/cups/include/cups/ipp.h new file mode 100644 index 0000000000..b7412a40c4 --- /dev/null +++ b/third_party/cups/include/cups/ipp.h @@ -0,0 +1,947 @@ +/* + * Internet Printing Protocol definitions for CUPS. + * + * Copyright © 2007-2018 by Apple Inc. + * Copyright © 1997-2006 by Easy Software Products. + * + * Licensed under Apache License v2.0. See the file "LICENSE" for more + * information. + */ + +#ifndef _CUPS_IPP_H_ +# define _CUPS_IPP_H_ + +/* + * Include necessary headers... + */ + +# include "http.h" +# include <stdarg.h> + + +/* + * C++ magic... + */ + +# ifdef __cplusplus +extern "C" { +# endif /* __cplusplus */ + + +/* + * IPP version string... + */ + +# define IPP_VERSION "\002\001" + +/* + * IPP registered port number... + * + * Note: Applications should never use IPP_PORT, but instead use the + * ippPort() function to allow overrides via the IPP_PORT environment + * variable and services file if needed! + */ + +# define IPP_PORT 631 + +/* + * Common limits... + */ + +# define IPP_MAX_CHARSET 64 /* Maximum length of charset values w/nul */ +# define IPP_MAX_KEYWORD 256 /* Maximum length of keyword values w/nul */ +# define IPP_MAX_LANGUAGE 64 /* Maximum length of naturalLanguage values w/nul */ +# define IPP_MAX_LENGTH 32767 /* Maximum size of any single value */ +# define IPP_MAX_MIMETYPE 256 /* Maximum length of mimeMediaType values w/nul */ +# define IPP_MAX_NAME 256 /* Maximum length of common name values w/nul */ +# define IPP_MAX_OCTETSTRING 1023 /* Maximum length of octetString values w/o nul */ +# define IPP_MAX_TEXT 1024 /* Maximum length of text values w/nul */ +# define IPP_MAX_URI 1024 /* Maximum length of uri values w/nul */ +# define IPP_MAX_URISCHEME 64 /* Maximum length of uriScheme values w/nul */ +# define IPP_MAX_VALUES 8 /* Power-of-2 allocation increment */ + +/* + * Macro to flag a text string attribute as "const" (static storage) vs. + * allocated. + */ + +# define IPP_CONST_TAG(x) (ipp_tag_t)(IPP_TAG_CUPS_CONST | (x)) + + +/* + * Types and structures... + */ + +typedef enum ipp_dstate_e /**** Document states @exclude all@ ****/ +{ + IPP_DSTATE_PENDING = 3, /* Document is pending */ + IPP_DSTATE_PROCESSING = 5, /* Document is processing */ + IPP_DSTATE_CANCELED = 7, /* Document is canceled */ + IPP_DSTATE_ABORTED, /* Document is aborted */ + IPP_DSTATE_COMPLETED /* Document is completed */ + +# ifndef _CUPS_NO_DEPRECATED +# define IPP_DOCUMENT_PENDING IPP_DSTATE_PENDING +# define IPP_DOCUMENT_PROCESSING IPP_DSTATE_PROCESSING +# define IPP_DOCUMENT_CANCELED IPP_DSTATE_CANCELED +# define IPP_DOCUMENT_ABORTED IPP_DSTATE_ABORTED +# define IPP_DOCUMENT_COMPLETED IPP_DSTATE_COMPLETED +# endif /* !_CUPS_NO_DEPRECATED */ +} ipp_dstate_t; + +typedef enum ipp_finishings_e /**** Finishings values ****/ +{ + IPP_FINISHINGS_NONE = 3, /* No finishing */ + IPP_FINISHINGS_STAPLE, /* Staple (any location/method) */ + IPP_FINISHINGS_PUNCH, /* Punch (any location/count) */ + IPP_FINISHINGS_COVER, /* Add cover */ + IPP_FINISHINGS_BIND, /* Bind */ + IPP_FINISHINGS_SADDLE_STITCH, /* Staple interior */ + IPP_FINISHINGS_EDGE_STITCH, /* Stitch along any side */ + IPP_FINISHINGS_FOLD, /* Fold (any type) */ + IPP_FINISHINGS_TRIM, /* Trim (any type) */ + IPP_FINISHINGS_BALE, /* Bale (any type) */ + IPP_FINISHINGS_BOOKLET_MAKER, /* Fold to make booklet */ + IPP_FINISHINGS_JOG_OFFSET, /* Offset for binding (any type) */ + IPP_FINISHINGS_COAT, /* Apply protective liquid or powder coating */ + IPP_FINISHINGS_LAMINATE, /* Apply protective (solid) material */ + IPP_FINISHINGS_STAPLE_TOP_LEFT = 20, /* Staple top left corner */ + IPP_FINISHINGS_STAPLE_BOTTOM_LEFT, /* Staple bottom left corner */ + IPP_FINISHINGS_STAPLE_TOP_RIGHT, /* Staple top right corner */ + IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT, /* Staple bottom right corner */ + IPP_FINISHINGS_EDGE_STITCH_LEFT, /* Stitch along left side */ + IPP_FINISHINGS_EDGE_STITCH_TOP, /* Stitch along top edge */ + IPP_FINISHINGS_EDGE_STITCH_RIGHT, /* Stitch along right side */ + IPP_FINISHINGS_EDGE_STITCH_BOTTOM, /* Stitch along bottom edge */ + IPP_FINISHINGS_STAPLE_DUAL_LEFT, /* Two staples on left */ + IPP_FINISHINGS_STAPLE_DUAL_TOP, /* Two staples on top */ + IPP_FINISHINGS_STAPLE_DUAL_RIGHT, /* Two staples on right */ + IPP_FINISHINGS_STAPLE_DUAL_BOTTOM, /* Two staples on bottom */ + IPP_FINISHINGS_STAPLE_TRIPLE_LEFT, /* Three staples on left */ + IPP_FINISHINGS_STAPLE_TRIPLE_TOP, /* Three staples on top */ + IPP_FINISHINGS_STAPLE_TRIPLE_RIGHT, /* Three staples on right */ + IPP_FINISHINGS_STAPLE_TRIPLE_BOTTOM, /* Three staples on bottom */ + IPP_FINISHINGS_BIND_LEFT = 50, /* Bind on left */ + IPP_FINISHINGS_BIND_TOP, /* Bind on top */ + IPP_FINISHINGS_BIND_RIGHT, /* Bind on right */ + IPP_FINISHINGS_BIND_BOTTOM, /* Bind on bottom */ + IPP_FINISHINGS_TRIM_AFTER_PAGES = 60, /* Trim output after each page */ + IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS, /* Trim output after each document */ + IPP_FINISHINGS_TRIM_AFTER_COPIES, /* Trim output after each copy */ + IPP_FINISHINGS_TRIM_AFTER_JOB, /* Trim output after job */ + IPP_FINISHINGS_PUNCH_TOP_LEFT = 70, /* Punch 1 hole top left */ + IPP_FINISHINGS_PUNCH_BOTTOM_LEFT, /* Punch 1 hole bottom left */ + IPP_FINISHINGS_PUNCH_TOP_RIGHT, /* Punch 1 hole top right */ + IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT, /* Punch 1 hole bottom right */ + IPP_FINISHINGS_PUNCH_DUAL_LEFT, /* Punch 2 holes left side */ + IPP_FINISHINGS_PUNCH_DUAL_TOP, /* Punch 2 holes top edge */ + IPP_FINISHINGS_PUNCH_DUAL_RIGHT, /* Punch 2 holes right side */ + IPP_FINISHINGS_PUNCH_DUAL_BOTTOM, /* Punch 2 holes bottom edge */ + IPP_FINISHINGS_PUNCH_TRIPLE_LEFT, /* Punch 3 holes left side */ + IPP_FINISHINGS_PUNCH_TRIPLE_TOP, /* Punch 3 holes top edge */ + IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT, /* Punch 3 holes right side */ + IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM, /* Punch 3 holes bottom edge */ + IPP_FINISHINGS_PUNCH_QUAD_LEFT, /* Punch 4 holes left side */ + IPP_FINISHINGS_PUNCH_QUAD_TOP, /* Punch 4 holes top edge */ + IPP_FINISHINGS_PUNCH_QUAD_RIGHT, /* Punch 4 holes right side */ + IPP_FINISHINGS_PUNCH_QUAD_BOTTOM, /* Punch 4 holes bottom edge */ + IPP_FINISHINGS_PUNCH_MULTIPLE_LEFT, /* Punch multiple holes left side */ + IPP_FINISHINGS_PUNCH_MULTIPLE_TOP, /* Punch multiple holes top edge */ + IPP_FINISHINGS_PUNCH_MULTIPLE_RIGHT, /* Punch multiple holes right side */ + IPP_FINISHINGS_PUNCH_MULTIPLE_BOTTOM, /* Punch multiple holes bottom edge */ + IPP_FINISHINGS_FOLD_ACCORDION = 90, /* Accordion-fold the paper vertically into four sections */ + IPP_FINISHINGS_FOLD_DOUBLE_GATE, /* Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically */ + IPP_FINISHINGS_FOLD_GATE, /* Fold the top and bottom quarters of the paper towards the midline */ + IPP_FINISHINGS_FOLD_HALF, /* Fold the paper in half vertically */ + IPP_FINISHINGS_FOLD_HALF_Z, /* Fold the paper in half horizontally, then Z-fold the paper vertically */ + IPP_FINISHINGS_FOLD_LEFT_GATE, /* Fold the top quarter of the paper towards the midline */ + IPP_FINISHINGS_FOLD_LETTER, /* Fold the paper into three sections vertically; sometimes also known as a C fold*/ + IPP_FINISHINGS_FOLD_PARALLEL, /* Fold the paper in half vertically two times, yielding four sections */ + IPP_FINISHINGS_FOLD_POSTER, /* Fold the paper in half horizontally and vertically; sometimes also called a cross fold */ + IPP_FINISHINGS_FOLD_RIGHT_GATE, /* Fold the bottom quarter of the paper towards the midline */ + IPP_FINISHINGS_FOLD_Z, /* Fold the paper vertically into three sections, forming a Z */ + IPP_FINISHINGS_FOLD_ENGINEERING_Z, /* Fold the paper vertically into two small sections and one larger, forming an elongated Z */ + + /* CUPS extensions for finishings (pre-standard versions of values above) */ + IPP_FINISHINGS_CUPS_PUNCH_TOP_LEFT = 0x40000046, + /* Punch 1 hole top left @exclude all@ */ + IPP_FINISHINGS_CUPS_PUNCH_BOTTOM_LEFT,/* Punch 1 hole bottom left @exclude all@ */ + IPP_FINISHINGS_CUPS_PUNCH_TOP_RIGHT, /* Punch 1 hole top right @exclude all@ */ + IPP_FINISHINGS_CUPS_PUNCH_BOTTOM_RIGHT, + /* Punch 1 hole bottom right @exclude all@ */ + IPP_FINISHINGS_CUPS_PUNCH_DUAL_LEFT, /* Punch 2 holes left side @exclude all@ */ + IPP_FINISHINGS_CUPS_PUNCH_DUAL_TOP, /* Punch 2 holes top edge @exclude all@ */ + IPP_FINISHINGS_CUPS_PUNCH_DUAL_RIGHT, /* Punch 2 holes right side @exclude all@ */ + IPP_FINISHINGS_CUPS_PUNCH_DUAL_BOTTOM,/* Punch 2 holes bottom edge @exclude all@ */ + IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_LEFT,/* Punch 3 holes left side @exclude all@ */ + IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_TOP, /* Punch 3 holes top edge @exclude all@ */ + IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_RIGHT, + /* Punch 3 holes right side @exclude all@ */ + IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_BOTTOM, + /* Punch 3 holes bottom edge @exclude all@ */ + IPP_FINISHINGS_CUPS_PUNCH_QUAD_LEFT, /* Punch 4 holes left side @exclude all@ */ + IPP_FINISHINGS_CUPS_PUNCH_QUAD_TOP, /* Punch 4 holes top edge @exclude all@ */ + IPP_FINISHINGS_CUPS_PUNCH_QUAD_RIGHT, /* Punch 4 holes right side @exclude all@ */ + IPP_FINISHINGS_CUPS_PUNCH_QUAD_BOTTOM,/* Punch 4 holes bottom edge @exclude all@ */ + + IPP_FINISHINGS_CUPS_FOLD_ACCORDION = 0x4000005A, + /* Accordion-fold the paper vertically into four sections @exclude all@ */ + IPP_FINISHINGS_CUPS_FOLD_DOUBLE_GATE, /* Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically @exclude all@ */ + IPP_FINISHINGS_CUPS_FOLD_GATE, /* Fold the top and bottom quarters of the paper towards the midline @exclude all@ */ + IPP_FINISHINGS_CUPS_FOLD_HALF, /* Fold the paper in half vertically @exclude all@ */ + IPP_FINISHINGS_CUPS_FOLD_HALF_Z, /* Fold the paper in half horizontally, then Z-fold the paper vertically @exclude all@ */ + IPP_FINISHINGS_CUPS_FOLD_LEFT_GATE, /* Fold the top quarter of the paper towards the midline @exclude all@ */ + IPP_FINISHINGS_CUPS_FOLD_LETTER, /* Fold the paper into three sections vertically; sometimes also known as a C fold @exclude all@ */ + IPP_FINISHINGS_CUPS_FOLD_PARALLEL, /* Fold the paper in half vertically two times, yielding four sections @exclude all@ */ + IPP_FINISHINGS_CUPS_FOLD_POSTER, /* Fold the paper in half horizontally and vertically; sometimes also called a cross fold @exclude all@ */ + IPP_FINISHINGS_CUPS_FOLD_RIGHT_GATE, /* Fold the bottom quarter of the paper towards the midline @exclude all@ */ + IPP_FINISHINGS_CUPS_FOLD_Z /* Fold the paper vertically into three sections, forming a Z @exclude all@ */ +} ipp_finishings_t; +# ifndef _CUPS_NO_DEPRECATED +# define IPP_FINISHINGS_CUPS_FOLD_ACCORDIAN IPP_FINISHINGS_CUPS_FOLD_ACCORDION +# define IPP_FINISHINGS_FOLD_ACCORDIAN IPP_FINISHINGS_FOLD_ACCORDION +# define IPP_FINISHINGS_JOB_OFFSET IPP_FINISHINGS_JOG_OFFSET + /* Long-time misspellings... */ +typedef enum ipp_finishings_e ipp_finish_t; +# endif /* !_CUPS_NO_DEPRECATED */ + +typedef enum ipp_jcollate_e /**** Job collation types @deprecated@ @exclude all@ ****/ +{ + IPP_JCOLLATE_UNCOLLATED_SHEETS = 3, + IPP_JCOLLATE_COLLATED_DOCUMENTS, + IPP_JCOLLATE_UNCOLLATED_DOCUMENTS + +# ifndef _CUPS_NO_DEPRECATED +# define IPP_JOB_UNCOLLATED_SHEETS IPP_JCOLLATE_UNCOLLATED_SHEETS +# define IPP_JOB_COLLATED_DOCUMENTS IPP_JCOLLATE_COLLATED_DOCUMENTS +# define IPP_JOB_UNCOLLATED_DOCUMENTS IPP_JCOLLATE_UNCOLLATED_DOCUMENTS +# endif /* !_CUPS_NO_DEPRECATED */ +} ipp_jcollate_t; + +typedef enum ipp_jstate_e /**** Job states ****/ +{ + IPP_JSTATE_PENDING = 3, /* Job is waiting to be printed */ + IPP_JSTATE_HELD, /* Job is held for printing */ + IPP_JSTATE_PROCESSING, /* Job is currently printing */ + IPP_JSTATE_STOPPED, /* Job has been stopped */ + IPP_JSTATE_CANCELED, /* Job has been canceled */ + IPP_JSTATE_ABORTED, /* Job has aborted due to error */ + IPP_JSTATE_COMPLETED /* Job has completed successfully */ + +# ifndef _CUPS_NO_DEPRECATED +# define IPP_JOB_PENDING IPP_JSTATE_PENDING +# define IPP_JOB_HELD IPP_JSTATE_HELD +# define IPP_JOB_PROCESSING IPP_JSTATE_PROCESSING +# define IPP_JOB_STOPPED IPP_JSTATE_STOPPED +# define IPP_JOB_CANCELED IPP_JSTATE_CANCELED +# define IPP_JOB_ABORTED IPP_JSTATE_ABORTED +# define IPP_JOB_COMPLETED IPP_JSTATE_COMPLETED + /* Legacy name for canceled state */ +# define IPP_JOB_CANCELLED IPP_JSTATE_CANCELED +# endif /* !_CUPS_NO_DEPRECATED */ +} ipp_jstate_t; + +typedef enum ipp_op_e /**** IPP operations ****/ +{ + IPP_OP_CUPS_INVALID = -1, /* Invalid operation name for @link ippOpValue@ */ + IPP_OP_CUPS_NONE = 0, /* No operation @private@ */ + IPP_OP_PRINT_JOB = 0x0002, /* Print-Job: Print a single file */ + IPP_OP_PRINT_URI, /* Print-URI: Print a single URL @exclude all@ */ + IPP_OP_VALIDATE_JOB, /* Validate-Job: Validate job values prior to submission */ + IPP_OP_CREATE_JOB, /* Create-Job: Create an empty print job */ + IPP_OP_SEND_DOCUMENT, /* Send-Document: Add a file to a job */ + IPP_OP_SEND_URI, /* Send-URI: Add a URL to a job @exclude all@ */ + IPP_OP_CANCEL_JOB, /* Cancel-Job: Cancel a job */ + IPP_OP_GET_JOB_ATTRIBUTES, /* Get-Job-Attribute: Get information about a job */ + IPP_OP_GET_JOBS, /* Get-Jobs: Get a list of jobs */ + IPP_OP_GET_PRINTER_ATTRIBUTES, /* Get-Printer-Attributes: Get information about a printer */ + IPP_OP_HOLD_JOB, /* Hold-Job: Hold a job for printing */ + IPP_OP_RELEASE_JOB, /* Release-Job: Release a job for printing */ + IPP_OP_RESTART_JOB, /* Restart-Job: Reprint a job @deprecated@ */ + IPP_OP_PAUSE_PRINTER = 0x0010, /* Pause-Printer: Stop a printer */ + IPP_OP_RESUME_PRINTER, /* Resume-Printer: Start a printer */ + IPP_OP_PURGE_JOBS, /* Purge-Jobs: Delete all jobs @deprecated@ @exclude all@ */ + IPP_OP_SET_PRINTER_ATTRIBUTES, /* Set-Printer-Attributes: Set printer values */ + IPP_OP_SET_JOB_ATTRIBUTES, /* Set-Job-Attributes: Set job values */ + IPP_OP_GET_PRINTER_SUPPORTED_VALUES, /* Get-Printer-Supported-Values: Get supported values */ + IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS, /* Create-Printer-Subscriptions: Create one or more printer subscriptions @since CUPS 1.2/macOS 10.5@ */ + IPP_OP_CREATE_JOB_SUBSCRIPTIONS, /* Create-Job-Subscriptions: Create one of more job subscriptions @since CUPS 1.2/macOS 10.5@ */ + IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES, /* Get-Subscription-Attributes: Get subscription information @since CUPS 1.2/macOS 10.5@ */ + IPP_OP_GET_SUBSCRIPTIONS, /* Get-Subscriptions: Get list of subscriptions @since CUPS 1.2/macOS 10.5@ */ + IPP_OP_RENEW_SUBSCRIPTION, /* Renew-Subscription: Renew a printer subscription @since CUPS 1.2/macOS 10.5@ */ + IPP_OP_CANCEL_SUBSCRIPTION, /* Cancel-Subscription: Cancel a subscription @since CUPS 1.2/macOS 10.5@ */ + IPP_OP_GET_NOTIFICATIONS, /* Get-Notifications: Get notification events @since CUPS 1.2/macOS 10.5@ */ + IPP_OP_SEND_NOTIFICATIONS, /* Send-Notifications: Send notification events @private@ */ + IPP_OP_GET_RESOURCE_ATTRIBUTES, /* Get-Resource-Attributes: Get resource information @private@ */ + IPP_OP_GET_RESOURCE_DATA, /* Get-Resource-Data: Get resource data @private@ @deprecated@ */ + IPP_OP_GET_RESOURCES, /* Get-Resources: Get list of resources @private@ */ + IPP_OP_GET_PRINT_SUPPORT_FILES, /* Get-Printer-Support-Files: Get printer support files @private@ */ + IPP_OP_ENABLE_PRINTER, /* Enable-Printer: Accept new jobs for a printer */ + IPP_OP_DISABLE_PRINTER, /* Disable-Printer: Reject new jobs for a printer */ + IPP_OP_PAUSE_PRINTER_AFTER_CURRENT_JOB, + /* Pause-Printer-After-Current-Job: Stop printer after the current job */ + IPP_OP_HOLD_NEW_JOBS, /* Hold-New-Jobs: Hold new jobs */ + IPP_OP_RELEASE_HELD_NEW_JOBS, /* Release-Held-New-Jobs: Release new jobs that were previously held */ + IPP_OP_DEACTIVATE_PRINTER, /* Deactivate-Printer: Stop a printer and do not accept jobs @deprecated@ @exclude all@ */ + IPP_OP_ACTIVATE_PRINTER, /* Activate-Printer: Start a printer and accept jobs @deprecated@ @exclude all@ */ + IPP_OP_RESTART_PRINTER, /* Restart-Printer: Restart a printer @exclude all@ */ + IPP_OP_SHUTDOWN_PRINTER, /* Shutdown-Printer: Turn a printer off @exclude all@ */ + IPP_OP_STARTUP_PRINTER, /* Startup-Printer: Turn a printer on @exclude all@ */ + IPP_OP_REPROCESS_JOB, /* Reprocess-Job: Reprint a job @deprecated@ @exclude all@*/ + IPP_OP_CANCEL_CURRENT_JOB, /* Cancel-Current-Job: Cancel the current job */ + IPP_OP_SUSPEND_CURRENT_JOB, /* Suspend-Current-Job: Suspend the current job */ + IPP_OP_RESUME_JOB, /* Resume-Job: Resume the current job */ + IPP_OP_PROMOTE_JOB, /* Promote-Job: Promote a job to print sooner */ + IPP_OP_SCHEDULE_JOB_AFTER, /* Schedule-Job-After: Schedule a job to print after another */ + IPP_OP_CANCEL_DOCUMENT = 0x0033, /* Cancel-Document: Cancel a document @exclude all@ */ + IPP_OP_GET_DOCUMENT_ATTRIBUTES, /* Get-Document-Attributes: Get document information @exclude all@ */ + IPP_OP_GET_DOCUMENTS, /* Get-Documents: Get a list of documents in a job @exclude all@ */ + IPP_OP_DELETE_DOCUMENT, /* Delete-Document: Delete a document @deprecated@ @exclude all@ */ + IPP_OP_SET_DOCUMENT_ATTRIBUTES, /* Set-Document-Attributes: Set document values @exclude all@ */ + IPP_OP_CANCEL_JOBS, /* Cancel-Jobs: Cancel all jobs (administrative) */ + IPP_OP_CANCEL_MY_JOBS, /* Cancel-My-Jobs: Cancel a user's jobs */ + IPP_OP_RESUBMIT_JOB, /* Resubmit-Job: Copy and reprint a job @exclude all@ */ + IPP_OP_CLOSE_JOB, /* Close-Job: Close a job and start printing */ + IPP_OP_IDENTIFY_PRINTER, /* Identify-Printer: Make the printer beep, flash, or display a message for identification */ + IPP_OP_VALIDATE_DOCUMENT, /* Validate-Document: Validate document values prior to submission @exclude all@ */ + IPP_OP_ADD_DOCUMENT_IMAGES, /* Add-Document-Images: Add image(s) from the specified scanner source @exclude all@ */ + IPP_OP_ACKNOWLEDGE_DOCUMENT, /* Acknowledge-Document: Acknowledge processing of a document @exclude all@ */ + IPP_OP_ACKNOWLEDGE_IDENTIFY_PRINTER, /* Acknowledge-Identify-Printer: Acknowledge action on an Identify-Printer request @exclude all@ */ + IPP_OP_ACKNOWLEDGE_JOB, /* Acknowledge-Job: Acknowledge processing of a job @exclude all@ */ + IPP_OP_FETCH_DOCUMENT, /* Fetch-Document: Fetch a document for processing @exclude all@ */ + IPP_OP_FETCH_JOB, /* Fetch-Job: Fetch a job for processing @exclude all@ */ + IPP_OP_GET_OUTPUT_DEVICE_ATTRIBUTES, /* Get-Output-Device-Attributes: Get printer information for a specific output device @exclude all@ */ + IPP_OP_UPDATE_ACTIVE_JOBS, /* Update-Active-Jobs: Update the list of active jobs that a proxy has processed @exclude all@ */ + IPP_OP_DEREGISTER_OUTPUT_DEVICE, /* Deregister-Output-Device: Remove an output device @exclude all@ */ + IPP_OP_UPDATE_DOCUMENT_STATUS, /* Update-Document-Status: Update document values @exclude all@ */ + IPP_OP_UPDATE_JOB_STATUS, /* Update-Job-Status: Update job values @exclude all@ */ + IPP_OP_UPDATE_OUTPUT_DEVICE_ATTRIBUTES, + /* Update-Output-Device-Attributes: Update output device values @exclude all@ */ + IPP_OP_GET_NEXT_DOCUMENT_DATA, /* Get-Next-Document-Data: Scan more document data @exclude all@ */ + IPP_OP_ALLOCATE_PRINTER_RESOURCES, /* Allocate-Printer-Resources: Use resources for a printer. */ + IPP_OP_CREATE_PRINTER, /* Create-Printer: Create a new service. */ + IPP_OP_DEALLOCATE_PRINTER_RESOURCES, /* Deallocate-Printer-Resources: Stop using resources for a printer. */ + IPP_OP_DELETE_PRINTER, /* Delete-Printer: Delete an existing service. */ + IPP_OP_GET_PRINTERS, /* Get-Printers: Get a list of services. */ + IPP_OP_SHUTDOWN_ONE_PRINTER, /* Shutdown-One-Printer: Shutdown a service. */ + IPP_OP_STARTUP_ONE_PRINTER, /* Startup-One-Printer: Start a service. */ + IPP_OP_CANCEL_RESOURCE, /* Cancel-Resource: Uninstall a resource. */ + IPP_OP_CREATE_RESOURCE, /* Create-Resource: Create a new (empty) resource. */ + IPP_OP_INSTALL_RESOURCE, /* Install-Resource: Install a resource. */ + IPP_OP_SEND_RESOURCE_DATA, /* Send-Resource-Data: Upload the data for a resource. */ + IPP_OP_SET_RESOURCE_ATTRIBUTES, /* Set-Resource-Attributes: Set resource object attributes. */ + IPP_OP_CREATE_RESOURCE_SUBSCRIPTIONS, /* Create-Resource-Subscriptions: Create event subscriptions for a resource. */ + IPP_OP_CREATE_SYSTEM_SUBSCRIPTIONS, /* Create-System-Subscriptions: Create event subscriptions for a system. */ + IPP_OP_DISABLE_ALL_PRINTERS, /* Disable-All-Printers: Stop accepting new jobs on all services. */ + IPP_OP_ENABLE_ALL_PRINTERS, /* Enable-All-Printers: Start accepting new jobs on all services. */ + IPP_OP_GET_SYSTEM_ATTRIBUTES, /* Get-System-Attributes: Get system object attributes. */ + IPP_OP_GET_SYSTEM_SUPPORTED_VALUES, /* Get-System-Supported-Values: Get supported values for system object attributes. */ + IPP_OP_PAUSE_ALL_PRINTERS, /* Pause-All-Printers: Stop all services immediately. */ + IPP_OP_PAUSE_ALL_PRINTERS_AFTER_CURRENT_JOB, + /* Pause-All-Printers-After-Current-Job: Stop all services after processing the current jobs. */ + IPP_OP_REGISTER_OUTPUT_DEVICE, /* Register-Output-Device: Register a remote service. */ + IPP_OP_RESTART_SYSTEM, /* Restart-System: Restart all services. */ + IPP_OP_RESUME_ALL_PRINTERS, /* Resume-All-Printers: Start job processing on all services. */ + IPP_OP_SET_SYSTEM_ATTRIBUTES, /* Set-System-Attributes: Set system object attributes. */ + IPP_OP_SHUTDOWN_ALL_PRINTERS, /* Shutdown-All-Printers: Shutdown all services. */ + IPP_OP_STARTUP_ALL_PRINTERS, /* Startup-All-Printers: Startup all services. */ + + IPP_OP_PRIVATE = 0x4000, /* Reserved @private@ */ + IPP_OP_CUPS_GET_DEFAULT, /* CUPS-Get-Default: Get the default printer */ + IPP_OP_CUPS_GET_PRINTERS, /* CUPS-Get-Printers: Get a list of printers and/or classes */ + IPP_OP_CUPS_ADD_MODIFY_PRINTER, /* CUPS-Add-Modify-Printer: Add or modify a printer */ + IPP_OP_CUPS_DELETE_PRINTER, /* CUPS-Delete-Printer: Delete a printer */ + IPP_OP_CUPS_GET_CLASSES, /* CUPS-Get-Classes: Get a list of classes @deprecated@ @exclude all@ */ + IPP_OP_CUPS_ADD_MODIFY_CLASS, /* CUPS-Add-Modify-Class: Add or modify a class */ + IPP_OP_CUPS_DELETE_CLASS, /* CUPS-Delete-Class: Delete a class */ + IPP_OP_CUPS_ACCEPT_JOBS, /* CUPS-Accept-Jobs: Accept new jobs on a printer @exclude all@ */ + IPP_OP_CUPS_REJECT_JOBS, /* CUPS-Reject-Jobs: Reject new jobs on a printer @exclude all@ */ + IPP_OP_CUPS_SET_DEFAULT, /* CUPS-Set-Default: Set the default printer */ + IPP_OP_CUPS_GET_DEVICES, /* CUPS-Get-Devices: Get a list of supported devices @deprecated@ */ + IPP_OP_CUPS_GET_PPDS, /* CUPS-Get-PPDs: Get a list of supported drivers @deprecated@ */ + IPP_OP_CUPS_MOVE_JOB, /* CUPS-Move-Job: Move a job to a different printer */ + IPP_OP_CUPS_AUTHENTICATE_JOB, /* CUPS-Authenticate-Job: Authenticate a job @since CUPS 1.2/macOS 10.5@ */ + IPP_OP_CUPS_GET_PPD, /* CUPS-Get-PPD: Get a PPD file @deprecated@ */ + IPP_OP_CUPS_GET_DOCUMENT = 0x4027, /* CUPS-Get-Document: Get a document file @since CUPS 1.4/macOS 10.6@ */ + IPP_OP_CUPS_CREATE_LOCAL_PRINTER /* CUPS-Create-Local-Printer: Create a local (temporary) printer @since CUPS 2.2@ */ + +# ifndef _CUPS_NO_DEPRECATED +# define IPP_PRINT_JOB IPP_OP_PRINT_JOB +# define IPP_PRINT_URI IPP_OP_PRINT_URI +# define IPP_VALIDATE_JOB IPP_OP_VALIDATE_JOB +# define IPP_CREATE_JOB IPP_OP_CREATE_JOB +# define IPP_SEND_DOCUMENT IPP_OP_SEND_DOCUMENT +# define IPP_SEND_URI IPP_OP_SEND_URI +# define IPP_CANCEL_JOB IPP_OP_CANCEL_JOB +# define IPP_GET_JOB_ATTRIBUTES IPP_OP_GET_JOB_ATTRIBUTES +# define IPP_GET_JOBS IPP_OP_GET_JOBS +# define IPP_GET_PRINTER_ATTRIBUTES IPP_OP_GET_PRINTER_ATTRIBUTES +# define IPP_HOLD_JOB IPP_OP_HOLD_JOB +# define IPP_RELEASE_JOB IPP_OP_RELEASE_JOB +# define IPP_RESTART_JOB IPP_OP_RESTART_JOB +# define IPP_PAUSE_PRINTER IPP_OP_PAUSE_PRINTER +# define IPP_RESUME_PRINTER IPP_OP_RESUME_PRINTER +# define IPP_PURGE_JOBS IPP_OP_PURGE_JOBS +# define IPP_SET_PRINTER_ATTRIBUTES IPP_OP_SET_PRINTER_ATTRIBUTES +# define IPP_SET_JOB_ATTRIBUTES IPP_OP_SET_JOB_ATTRIBUTES +# define IPP_GET_PRINTER_SUPPORTED_VALUES IPP_OP_GET_PRINTER_SUPPORTED_VALUES +# define IPP_CREATE_PRINTER_SUBSCRIPTION IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS +# define IPP_CREATE_JOB_SUBSCRIPTION IPP_OP_CREATE_JOB_SUBSCRIPTIONS +# define IPP_OP_CREATE_PRINTER_SUBSCRIPTION IPP_OP_CREATE_PRINTER_SUBSCRIPTIONS +# define IPP_OP_CREATE_JOB_SUBSCRIPTION IPP_OP_CREATE_JOB_SUBSCRIPTIONS +# define IPP_GET_SUBSCRIPTION_ATTRIBUTES IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES +# define IPP_GET_SUBSCRIPTIONS IPP_OP_GET_SUBSCRIPTIONS +# define IPP_RENEW_SUBSCRIPTION IPP_OP_RENEW_SUBSCRIPTION +# define IPP_CANCEL_SUBSCRIPTION IPP_OP_CANCEL_SUBSCRIPTION +# define IPP_GET_NOTIFICATIONS IPP_OP_GET_NOTIFICATIONS +# define IPP_SEND_NOTIFICATIONS IPP_OP_SEND_NOTIFICATIONS +# define IPP_GET_RESOURCE_ATTRIBUTES IPP_OP_GET_RESOURCE_ATTRIBUTES +# define IPP_GET_RESOURCE_DATA IPP_OP_GET_RESOURCE_DATA +# define IPP_GET_RESOURCES IPP_OP_GET_RESOURCES +# define IPP_GET_PRINT_SUPPORT_FILES IPP_OP_GET_PRINT_SUPPORT_FILES +# define IPP_ENABLE_PRINTER IPP_OP_ENABLE_PRINTER +# define IPP_DISABLE_PRINTER IPP_OP_DISABLE_PRINTER +# define IPP_PAUSE_PRINTER_AFTER_CURRENT_JOB IPP_OP_PAUSE_PRINTER_AFTER_CURRENT_JOB +# define IPP_HOLD_NEW_JOBS IPP_OP_HOLD_NEW_JOBS +# define IPP_RELEASE_HELD_NEW_JOBS IPP_OP_RELEASE_HELD_NEW_JOBS +# define IPP_DEACTIVATE_PRINTER IPP_OP_DEACTIVATE_PRINTER +# define IPP_ACTIVATE_PRINTER IPP_OP_ACTIVATE_PRINTER +# define IPP_RESTART_PRINTER IPP_OP_RESTART_PRINTER +# define IPP_SHUTDOWN_PRINTER IPP_OP_SHUTDOWN_PRINTER +# define IPP_STARTUP_PRINTER IPP_OP_STARTUP_PRINTER +# define IPP_REPROCESS_JOB IPP_OP_REPROCESS_JOB +# define IPP_CANCEL_CURRENT_JOB IPP_OP_CANCEL_CURRENT_JOB +# define IPP_SUSPEND_CURRENT_JOB IPP_OP_SUSPEND_CURRENT_JOB +# define IPP_RESUME_JOB IPP_OP_RESUME_JOB +# define IPP_PROMOTE_JOB IPP_OP_PROMOTE_JOB +# define IPP_SCHEDULE_JOB_AFTER IPP_OP_SCHEDULE_JOB_AFTER +# define IPP_CANCEL_DOCUMENT IPP_OP_CANCEL_DOCUMENT +# define IPP_GET_DOCUMENT_ATTRIBUTES IPP_OP_GET_DOCUMENT_ATTRIBUTES +# define IPP_GET_DOCUMENTS IPP_OP_GET_DOCUMENTS +# define IPP_DELETE_DOCUMENT IPP_OP_DELETE_DOCUMENT +# define IPP_SET_DOCUMENT_ATTRIBUTES IPP_OP_SET_DOCUMENT_ATTRIBUTES +# define IPP_CANCEL_JOBS IPP_OP_CANCEL_JOBS +# define IPP_CANCEL_MY_JOBS IPP_OP_CANCEL_MY_JOBS +# define IPP_RESUBMIT_JOB IPP_OP_RESUBMIT_JOB +# define IPP_CLOSE_JOB IPP_OP_CLOSE_JOB +# define IPP_IDENTIFY_PRINTER IPP_OP_IDENTIFY_PRINTER +# define IPP_VALIDATE_DOCUMENT IPP_OP_VALIDATE_DOCUMENT +# define IPP_OP_SEND_HARDCOPY_DOCUMENT IPP_OP_ADD_DOCUMENT_IMAGES +# define IPP_PRIVATE IPP_OP_PRIVATE +# define CUPS_GET_DEFAULT IPP_OP_CUPS_GET_DEFAULT +# define CUPS_GET_PRINTERS IPP_OP_CUPS_GET_PRINTERS +# define CUPS_ADD_MODIFY_PRINTER IPP_OP_CUPS_ADD_MODIFY_PRINTER +# define CUPS_DELETE_PRINTER IPP_OP_CUPS_DELETE_PRINTER +# define CUPS_GET_CLASSES IPP_OP_CUPS_GET_CLASSES +# define CUPS_ADD_MODIFY_CLASS IPP_OP_CUPS_ADD_MODIFY_CLASS +# define CUPS_DELETE_CLASS IPP_OP_CUPS_DELETE_CLASS +# define CUPS_ACCEPT_JOBS IPP_OP_CUPS_ACCEPT_JOBS +# define CUPS_REJECT_JOBS IPP_OP_CUPS_REJECT_JOBS +# define CUPS_SET_DEFAULT IPP_OP_CUPS_SET_DEFAULT +# define CUPS_GET_DEVICES IPP_OP_CUPS_GET_DEVICES +# define CUPS_GET_PPDS IPP_OP_CUPS_GET_PPDS +# define CUPS_MOVE_JOB IPP_OP_CUPS_MOVE_JOB +# define CUPS_AUTHENTICATE_JOB IPP_OP_CUPS_AUTHENTICATE_JOB +# define CUPS_GET_PPD IPP_OP_CUPS_GET_PPD +# define CUPS_GET_DOCUMENT IPP_OP_CUPS_GET_DOCUMENT + /* Legacy names */ +# define CUPS_ADD_PRINTER IPP_OP_CUPS_ADD_MODIFY_PRINTER +# define CUPS_ADD_CLASS IPP_OP_CUPS_ADD_MODIFY_CLASS +# endif /* !_CUPS_NO_DEPRECATED */ +} ipp_op_t; + +typedef enum ipp_orient_e /**** Orientation values ****/ +{ + IPP_ORIENT_PORTRAIT = 3, /* No rotation */ + IPP_ORIENT_LANDSCAPE, /* 90 degrees counter-clockwise */ + IPP_ORIENT_REVERSE_LANDSCAPE, /* 90 degrees clockwise */ + IPP_ORIENT_REVERSE_PORTRAIT, /* 180 degrees */ + IPP_ORIENT_NONE /* No rotation */ + +# ifndef _CUPS_NO_DEPRECATED +# define IPP_PORTRAIT IPP_ORIENT_PORTRAIT +# define IPP_LANDSCAPE IPP_ORIENT_LANDSCAPE +# define IPP_REVERSE_LANDSCAPE IPP_ORIENT_REVERSE_LANDSCAPE +# define IPP_REVERSE_PORTRAIT IPP_ORIENT_REVERSE_PORTRAIT +# endif /* !_CUPS_NO_DEPRECATED */ +} ipp_orient_t; + +typedef enum ipp_pstate_e /**** Printer state values ****/ +{ + IPP_PSTATE_IDLE = 3, /* Printer is idle */ + IPP_PSTATE_PROCESSING, /* Printer is working */ + IPP_PSTATE_STOPPED /* Printer is stopped */ + +# ifndef _CUPS_NO_DEPRECATED +# define IPP_PRINTER_IDLE IPP_PSTATE_IDLE +# define IPP_PRINTER_PROCESSING IPP_PSTATE_PROCESSING +# define IPP_PRINTER_STOPPED IPP_PSTATE_STOPPED +# endif /* _CUPS_NO_DEPRECATED */ +} ipp_pstate_t; + +typedef enum ipp_quality_e /**** Print quality values ****/ +{ + IPP_QUALITY_DRAFT = 3, /* Draft quality */ + IPP_QUALITY_NORMAL, /* Normal quality */ + IPP_QUALITY_HIGH /* High quality */ +} ipp_quality_t; + +typedef enum ipp_res_e /**** Resolution units ****/ +{ + IPP_RES_PER_INCH = 3, /* Pixels per inch */ + IPP_RES_PER_CM /* Pixels per centimeter */ +} ipp_res_t; + +typedef enum ipp_rstate_e /**** resource-state values ****/ +{ + IPP_RSTATE_PENDING = 3, /* Resource is created but has no data yet. */ + IPP_RSTATE_AVAILABLE, /* Resource is available for installation. */ + IPP_RSTATE_INSTALLED, /* Resource is installed. */ + IPP_RSTATE_CANCELED, /* Resource has been canceled and is pending deletion. */ + IPP_RSTATE_ABORTED /* Resource has been aborted and is pending deletion. */ +} ipp_rstate_t; + +typedef enum ipp_sstate_e /**** system-state values ****/ +{ + IPP_SSTATE_IDLE = 3, /* At least one printer is idle and none are processing a job. */ + IPP_SSTATE_PROCESSING, /* At least one printer is processing a job. */ + IPP_SSTATE_STOPPED /* All printers are stopped. */ +} ipp_sstate_t; + +typedef enum ipp_state_e /**** ipp_t state values ****/ +{ + IPP_STATE_ERROR = -1, /* An error occurred */ + IPP_STATE_IDLE, /* Nothing is happening/request completed */ + IPP_STATE_HEADER, /* The request header needs to be sent/received */ + IPP_STATE_ATTRIBUTE, /* One or more attributes need to be sent/received */ + IPP_STATE_DATA /* IPP request data needs to be sent/received */ + +# ifndef _CUPS_NO_DEPRECATED +# define IPP_ERROR IPP_STATE_ERROR +# define IPP_IDLE IPP_STATE_IDLE +# define IPP_HEADER IPP_STATE_HEADER +# define IPP_ATTRIBUTE IPP_STATE_ATTRIBUTE +# define IPP_DATA IPP_STATE_DATA +# endif /* !_CUPS_NO_DEPRECATED */ +} ipp_state_t; + +typedef enum ipp_status_e /**** IPP status code values ****/ +{ + IPP_STATUS_CUPS_INVALID = -1, /* Invalid status name for @link ippErrorValue@ */ + IPP_STATUS_OK = 0x0000, /* successful-ok */ + IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED, /* successful-ok-ignored-or-substituted-attributes */ + IPP_STATUS_OK_CONFLICTING, /* successful-ok-conflicting-attributes */ + IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS, /* successful-ok-ignored-subscriptions */ + IPP_STATUS_OK_IGNORED_NOTIFICATIONS, /* successful-ok-ignored-notifications @private@ */ + IPP_STATUS_OK_TOO_MANY_EVENTS, /* successful-ok-too-many-events */ + IPP_STATUS_OK_BUT_CANCEL_SUBSCRIPTION,/* successful-ok-but-cancel-subscription @private@ */ + IPP_STATUS_OK_EVENTS_COMPLETE, /* successful-ok-events-complete */ + IPP_STATUS_REDIRECTION_OTHER_SITE = 0x0200, + /* redirection-other-site @private@ */ + IPP_STATUS_CUPS_SEE_OTHER = 0x0280, /* cups-see-other @private@ */ + IPP_STATUS_ERROR_BAD_REQUEST = 0x0400,/* client-error-bad-request */ + IPP_STATUS_ERROR_FORBIDDEN, /* client-error-forbidden */ + IPP_STATUS_ERROR_NOT_AUTHENTICATED, /* client-error-not-authenticated */ + IPP_STATUS_ERROR_NOT_AUTHORIZED, /* client-error-not-authorized */ + IPP_STATUS_ERROR_NOT_POSSIBLE, /* client-error-not-possible */ + IPP_STATUS_ERROR_TIMEOUT, /* client-error-timeout */ + IPP_STATUS_ERROR_NOT_FOUND, /* client-error-not-found */ + IPP_STATUS_ERROR_GONE, /* client-error-gone */ + IPP_STATUS_ERROR_REQUEST_ENTITY, /* client-error-request-entity-too-large */ + IPP_STATUS_ERROR_REQUEST_VALUE, /* client-error-request-value-too-long */ + IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED, + /* client-error-document-format-not-supported */ + IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES,/* client-error-attributes-or-values-not-supported */ + IPP_STATUS_ERROR_URI_SCHEME, /* client-error-uri-scheme-not-supported */ + IPP_STATUS_ERROR_CHARSET, /* client-error-charset-not-supported */ + IPP_STATUS_ERROR_CONFLICTING, /* client-error-conflicting-attributes */ + IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED, + /* client-error-compression-not-supported */ + IPP_STATUS_ERROR_COMPRESSION_ERROR, /* client-error-compression-error */ + IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR, + /* client-error-document-format-error */ + IPP_STATUS_ERROR_DOCUMENT_ACCESS, /* client-error-document-access-error */ + IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE, + /* client-error-attributes-not-settable */ + IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS, + /* client-error-ignored-all-subscriptions */ + IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS, + /* client-error-too-many-subscriptions */ + IPP_STATUS_ERROR_IGNORED_ALL_NOTIFICATIONS, + /* client-error-ignored-all-notifications @private@ */ + IPP_STATUS_ERROR_PRINT_SUPPORT_FILE_NOT_FOUND, + /* client-error-print-support-file-not-found @private@ */ + IPP_STATUS_ERROR_DOCUMENT_PASSWORD, /* client-error-document-password-error */ + IPP_STATUS_ERROR_DOCUMENT_PERMISSION, /* client-error-document-permission-error */ + IPP_STATUS_ERROR_DOCUMENT_SECURITY, /* client-error-document-security-error */ + IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE,/* client-error-document-unprintable-error */ + IPP_STATUS_ERROR_ACCOUNT_INFO_NEEDED, /* client-error-account-info-needed */ + IPP_STATUS_ERROR_ACCOUNT_CLOSED, /* client-error-account-closed */ + IPP_STATUS_ERROR_ACCOUNT_LIMIT_REACHED, + /* client-error-account-limit-reached */ + IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED, + /* client-error-account-authorization-failed */ + IPP_STATUS_ERROR_NOT_FETCHABLE, /* client-error-not-fetchable */ + + /* Legacy status codes for paid printing */ + IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED = 0x049C, + /* cups-error-account-info-needed @deprecated@ */ + IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED, /* cups-error-account-closed @deprecate@ */ + IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED, + /* cups-error-account-limit-reached @deprecated@ */ + IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED, + /* cups-error-account-authorization-failed @deprecated@ */ + + IPP_STATUS_ERROR_INTERNAL = 0x0500, /* server-error-internal-error */ + IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED, + /* server-error-operation-not-supported */ + IPP_STATUS_ERROR_SERVICE_UNAVAILABLE, /* server-error-service-unavailable */ + IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED, + /* server-error-version-not-supported */ + IPP_STATUS_ERROR_DEVICE, /* server-error-device-error */ + IPP_STATUS_ERROR_TEMPORARY, /* server-error-temporary-error */ + IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS, /* server-error-not-accepting-jobs */ + IPP_STATUS_ERROR_BUSY, /* server-error-busy */ + IPP_STATUS_ERROR_JOB_CANCELED, /* server-error-job-canceled */ + IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED, + /* server-error-multiple-document-jobs-not-supported */ + IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED, + /* server-error-printer-is-deactivated */ + IPP_STATUS_ERROR_TOO_MANY_JOBS, /* server-error-too-many-jobs */ + IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS, /* server-error-too-many-documents */ + + /* These are internal and never sent over the wire... */ + IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED = 0x1000, + /* cups-authentication-canceled - Authentication canceled by user @since CUPS 1.5/macOS 10.7@ */ + IPP_STATUS_ERROR_CUPS_PKI, /* cups-pki-error - Error negotiating a secure connection @since CUPS 1.5/macOS 10.7@ */ + IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED/* cups-upgrade-required - TLS upgrade required @since CUPS 1.5/macOS 10.7@ */ + +# ifndef _CUPS_NO_DEPRECATED +# define IPP_OK IPP_STATUS_OK +# define IPP_OK_SUBST IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED +# define IPP_OK_CONFLICT IPP_STATUS_OK_CONFLICTING +# define IPP_OK_IGNORED_SUBSCRIPTIONS IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS +# define IPP_OK_IGNORED_NOTIFICATIONS IPP_STATUS_OK_IGNORED_NOTIFICATIONS +# define IPP_OK_TOO_MANY_EVENTS IPP_STATUS_OK_TOO_MANY_EVENTS +# define IPP_OK_BUT_CANCEL_SUBSCRIPTION IPP_STATUS_OK_BUT_CANCEL_SUBSCRIPTION +# define IPP_OK_EVENTS_COMPLETE IPP_STATUS_OK_EVENTS_COMPLETE +# define IPP_REDIRECTION_OTHER_SITE IPP_STATUS_REDIRECTION_OTHER_SITE +# define CUPS_SEE_OTHER IPP_STATUS_CUPS_SEE_OTHER +# define IPP_BAD_REQUEST IPP_STATUS_ERROR_BAD_REQUEST +# define IPP_FORBIDDEN IPP_STATUS_ERROR_FORBIDDEN +# define IPP_NOT_AUTHENTICATED IPP_STATUS_ERROR_NOT_AUTHENTICATED +# define IPP_NOT_AUTHORIZED IPP_STATUS_ERROR_NOT_AUTHORIZED +# define IPP_NOT_POSSIBLE IPP_STATUS_ERROR_NOT_POSSIBLE +# define IPP_TIMEOUT IPP_STATUS_ERROR_TIMEOUT +# define IPP_NOT_FOUND IPP_STATUS_ERROR_NOT_FOUND +# define IPP_GONE IPP_STATUS_ERROR_GONE +# define IPP_REQUEST_ENTITY IPP_STATUS_ERROR_REQUEST_ENTITY +# define IPP_REQUEST_VALUE IPP_STATUS_ERROR_REQUEST_VALUE +# define IPP_DOCUMENT_FORMAT IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED +# define IPP_ATTRIBUTES IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES +# define IPP_URI_SCHEME IPP_STATUS_ERROR_URI_SCHEME +# define IPP_CHARSET IPP_STATUS_ERROR_CHARSET +# define IPP_CONFLICT IPP_STATUS_ERROR_CONFLICTING +# define IPP_COMPRESSION_NOT_SUPPORTED IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED +# define IPP_COMPRESSION_ERROR IPP_STATUS_ERROR_COMPRESSION_ERROR +# define IPP_DOCUMENT_FORMAT_ERROR IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR +# define IPP_DOCUMENT_ACCESS_ERROR IPP_STATUS_ERROR_DOCUMENT_ACCESS +# define IPP_ATTRIBUTES_NOT_SETTABLE IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE +# define IPP_IGNORED_ALL_SUBSCRIPTIONS IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS +# define IPP_TOO_MANY_SUBSCRIPTIONS IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS +# define IPP_IGNORED_ALL_NOTIFICATIONS IPP_STATUS_ERROR_IGNORED_ALL_NOTIFICATIONS +# define IPP_PRINT_SUPPORT_FILE_NOT_FOUND IPP_STATUS_ERROR_PRINT_SUPPORT_FILE_NOT_FOUND +# define IPP_DOCUMENT_PASSWORD_ERROR IPP_STATUS_ERROR_DOCUMENT_PASSWORD +# define IPP_DOCUMENT_PERMISSION_ERROR IPP_STATUS_ERROR_DOCUMENT_PERMISSION +# define IPP_DOCUMENT_SECURITY_ERROR IPP_STATUS_ERROR_DOCUMENT_SECURITY +# define IPP_DOCUMENT_UNPRINTABLE_ERROR IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE +# define IPP_INTERNAL_ERROR IPP_STATUS_ERROR_INTERNAL +# define IPP_OPERATION_NOT_SUPPORTED IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED +# define IPP_SERVICE_UNAVAILABLE IPP_STATUS_ERROR_SERVICE_UNAVAILABLE +# define IPP_VERSION_NOT_SUPPORTED IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED +# define IPP_DEVICE_ERROR IPP_STATUS_ERROR_DEVICE +# define IPP_TEMPORARY_ERROR IPP_STATUS_ERROR_TEMPORARY +# define IPP_NOT_ACCEPTING IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS +# define IPP_PRINTER_BUSY IPP_STATUS_ERROR_BUSY +# define IPP_ERROR_JOB_CANCELED IPP_STATUS_ERROR_JOB_CANCELED +# define IPP_MULTIPLE_JOBS_NOT_SUPPORTED IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED +# define IPP_PRINTER_IS_DEACTIVATED IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED +# define IPP_TOO_MANY_JOBS IPP_STATUS_ERROR_TOO_MANY_JOBS +# define IPP_TOO_MANY_DOCUMENTS IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS +# define IPP_AUTHENTICATION_CANCELED IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED +# define IPP_PKI_ERROR IPP_STATUS_ERROR_CUPS_PKI +# define IPP_UPGRADE_REQUIRED IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED + /* Legacy name for canceled status */ +# define IPP_ERROR_JOB_CANCELLED IPP_STATUS_ERROR_JOB_CANCELED +# endif /* _CUPS_NO_DEPRECATED */ +} ipp_status_t; + +typedef enum ipp_tag_e /**** Value and group tag values for attributes ****/ +{ + IPP_TAG_CUPS_INVALID = -1, /* Invalid tag name for @link ippTagValue@ */ + IPP_TAG_ZERO = 0x00, /* Zero tag - used for separators */ + IPP_TAG_OPERATION, /* Operation group */ + IPP_TAG_JOB, /* Job group */ + IPP_TAG_END, /* End-of-attributes */ + IPP_TAG_PRINTER, /* Printer group */ + IPP_TAG_UNSUPPORTED_GROUP, /* Unsupported attributes group */ + IPP_TAG_SUBSCRIPTION, /* Subscription group */ + IPP_TAG_EVENT_NOTIFICATION, /* Event group */ + IPP_TAG_RESOURCE, /* Resource group */ + IPP_TAG_DOCUMENT, /* Document group */ + IPP_TAG_SYSTEM, /* System group */ + IPP_TAG_UNSUPPORTED_VALUE = 0x10, /* Unsupported value */ + IPP_TAG_DEFAULT, /* Default value */ + IPP_TAG_UNKNOWN, /* Unknown value */ + IPP_TAG_NOVALUE, /* No-value value */ + IPP_TAG_NOTSETTABLE = 0x15, /* Not-settable value */ + IPP_TAG_DELETEATTR, /* Delete-attribute value */ + IPP_TAG_ADMINDEFINE, /* Admin-defined value */ + IPP_TAG_INTEGER = 0x21, /* Integer value */ + IPP_TAG_BOOLEAN, /* Boolean value */ + IPP_TAG_ENUM, /* Enumeration value */ + IPP_TAG_STRING = 0x30, /* Octet string value */ + IPP_TAG_DATE, /* Date/time value */ + IPP_TAG_RESOLUTION, /* Resolution value */ + IPP_TAG_RANGE, /* Range value */ + IPP_TAG_BEGIN_COLLECTION, /* Beginning of collection value @exclude all@ */ + IPP_TAG_TEXTLANG, /* Text-with-language value */ + IPP_TAG_NAMELANG, /* Name-with-language value */ + IPP_TAG_END_COLLECTION, /* End of collection value @exclude all@ */ + IPP_TAG_TEXT = 0x41, /* Text value */ + IPP_TAG_NAME, /* Name value */ + IPP_TAG_RESERVED_STRING, /* Reserved for future string value @private@ */ + IPP_TAG_KEYWORD, /* Keyword value */ + IPP_TAG_URI, /* URI value */ + IPP_TAG_URISCHEME, /* URI scheme value */ + IPP_TAG_CHARSET, /* Character set value */ + IPP_TAG_LANGUAGE, /* Language value */ + IPP_TAG_MIMETYPE, /* MIME media type value */ + IPP_TAG_MEMBERNAME, /* Collection member name value @exclude all@ */ + IPP_TAG_EXTENSION = 0x7f, /* Extension point for 32-bit tags @exclude all@ */ + IPP_TAG_CUPS_MASK = 0x7fffffff, /* Mask for copied attribute values @private@ */ + /* The following expression is used to avoid compiler warnings with +/-0x80000000 */ + IPP_TAG_CUPS_CONST = -0x7fffffff-1 /* Bitflag for copied/const attribute values @private@ */ + +# ifndef _CUPS_NO_DEPRECATED +# define IPP_TAG_MASK IPP_TAG_CUPS_MASK +# define IPP_TAG_COPY IPP_TAG_CUPS_CONST +# endif /* !_CUPS_NO_DEPRECATED */ +} ipp_tag_t; + +typedef unsigned char ipp_uchar_t; /**** Unsigned 8-bit integer/character @exclude all@ ****/ +typedef struct _ipp_s ipp_t; /**** IPP request/response data ****/ +typedef struct _ipp_attribute_s ipp_attribute_t; + /**** IPP attribute ****/ + +/**** New in CUPS 1.2/macOS 10.5 ****/ +typedef ssize_t (*ipp_iocb_t)(void *context, ipp_uchar_t *buffer, size_t bytes); + /**** ippReadIO/ippWriteIO callback function @since CUPS 1.2/macOS 10.5@ ****/ + +/**** New in CUPS 1.6/macOS 10.8 ****/ +typedef int (*ipp_copycb_t)(void *context, ipp_t *dst, ipp_attribute_t *attr); + /**** ippCopyAttributes callback function @since CUPS 1.6/macOS 10.8 ****/ + + +/* + * Prototypes... + */ + +extern ipp_attribute_t *ippAddBoolean(ipp_t *ipp, ipp_tag_t group, + const char *name, char value) _CUPS_PUBLIC; +extern ipp_attribute_t *ippAddBooleans(ipp_t *ipp, ipp_tag_t group, + const char *name, int num_values, + const char *values) _CUPS_PUBLIC; +extern ipp_attribute_t *ippAddDate(ipp_t *ipp, ipp_tag_t group, + const char *name, const ipp_uchar_t *value) _CUPS_PUBLIC; +extern ipp_attribute_t *ippAddInteger(ipp_t *ipp, ipp_tag_t group, + ipp_tag_t value_tag, const char *name, + int value) _CUPS_PUBLIC; +extern ipp_attribute_t *ippAddIntegers(ipp_t *ipp, ipp_tag_t group, + ipp_tag_t value_tag, const char *name, + int num_values, const int *values) _CUPS_PUBLIC; +extern ipp_attribute_t *ippAddRange(ipp_t *ipp, ipp_tag_t group, + const char *name, int lower, int upper) _CUPS_PUBLIC; +extern ipp_attribute_t *ippAddRanges(ipp_t *ipp, ipp_tag_t group, + const char *name, int num_values, + const int *lower, const int *upper) _CUPS_PUBLIC; +extern ipp_attribute_t *ippAddResolution(ipp_t *ipp, ipp_tag_t group, + const char *name, ipp_res_t units, + int xres, int yres) _CUPS_PUBLIC; +extern ipp_attribute_t *ippAddResolutions(ipp_t *ipp, ipp_tag_t group, + const char *name, int num_values, + ipp_res_t units, const int *xres, + const int *yres) _CUPS_PUBLIC; +extern ipp_attribute_t *ippAddSeparator(ipp_t *ipp) _CUPS_PUBLIC; +extern ipp_attribute_t *ippAddString(ipp_t *ipp, ipp_tag_t group, + ipp_tag_t value_tag, const char *name, + const char *language, const char *value) _CUPS_PUBLIC; +extern ipp_attribute_t *ippAddStrings(ipp_t *ipp, ipp_tag_t group, + ipp_tag_t value_tag, const char *name, + int num_values, const char *language, + const char * const *values) _CUPS_PUBLIC; +extern time_t ippDateToTime(const ipp_uchar_t *date) _CUPS_PUBLIC; +extern void ippDelete(ipp_t *ipp) _CUPS_PUBLIC; +extern const char *ippErrorString(ipp_status_t error) _CUPS_PUBLIC; +extern ipp_attribute_t *ippFindAttribute(ipp_t *ipp, const char *name, + ipp_tag_t value_tag) _CUPS_PUBLIC; +extern ipp_attribute_t *ippFindNextAttribute(ipp_t *ipp, const char *name, + ipp_tag_t value_tag) _CUPS_PUBLIC; +extern size_t ippLength(ipp_t *ipp) _CUPS_PUBLIC; +extern ipp_t *ippNew(void) _CUPS_PUBLIC; +extern ipp_state_t ippRead(http_t *http, ipp_t *ipp) _CUPS_PUBLIC; +extern const ipp_uchar_t *ippTimeToDate(time_t t) _CUPS_PUBLIC; +extern ipp_state_t ippWrite(http_t *http, ipp_t *ipp) _CUPS_PUBLIC; +extern int ippPort(void) _CUPS_PUBLIC; +extern void ippSetPort(int p) _CUPS_PUBLIC; + +/**** New in CUPS 1.1.19 ****/ +extern ipp_attribute_t *ippAddCollection(ipp_t *ipp, ipp_tag_t group, + const char *name, ipp_t *value) _CUPS_API_1_1_19; +extern ipp_attribute_t *ippAddCollections(ipp_t *ipp, ipp_tag_t group, + const char *name, int num_values, + const ipp_t **values) _CUPS_API_1_1_19; +extern void ippDeleteAttribute(ipp_t *ipp, ipp_attribute_t *attr) _CUPS_API_1_1_19; +extern ipp_state_t ippReadFile(int fd, ipp_t *ipp) _CUPS_API_1_1_19; +extern ipp_state_t ippWriteFile(int fd, ipp_t *ipp) _CUPS_API_1_1_19; + +/**** New in CUPS 1.2/macOS 10.5 ****/ +extern ipp_attribute_t *ippAddOctetString(ipp_t *ipp, ipp_tag_t group, + const char *name, + const void *data, int datalen) _CUPS_API_1_2; +extern ipp_status_t ippErrorValue(const char *name) _CUPS_API_1_2; +extern ipp_t *ippNewRequest(ipp_op_t op) _CUPS_API_1_2; +extern const char *ippOpString(ipp_op_t op) _CUPS_API_1_2; +extern ipp_op_t ippOpValue(const char *name) _CUPS_API_1_2; +extern ipp_state_t ippReadIO(void *src, ipp_iocb_t cb, int blocking, + ipp_t *parent, ipp_t *ipp) _CUPS_API_1_2; +extern ipp_state_t ippWriteIO(void *dst, ipp_iocb_t cb, int blocking, + ipp_t *parent, ipp_t *ipp) _CUPS_API_1_2; + +/**** New in CUPS 1.4/macOS 10.6 ****/ +extern const char *ippTagString(ipp_tag_t tag) _CUPS_API_1_4; +extern ipp_tag_t ippTagValue(const char *name) _CUPS_API_1_4; + +/**** New in CUPS 1.6/macOS 10.8 ****/ +extern ipp_attribute_t *ippAddOutOfBand(ipp_t *ipp, ipp_tag_t group, + ipp_tag_t value_tag, const char *name) + _CUPS_API_1_6; +extern size_t ippAttributeString(ipp_attribute_t *attr, char *buffer, + size_t bufsize) _CUPS_API_1_6; +extern ipp_attribute_t *ippCopyAttribute(ipp_t *dst, ipp_attribute_t *attr, + int quickcopy) _CUPS_API_1_6; +extern int ippCopyAttributes(ipp_t *dst, ipp_t *src, + int quickcopy, ipp_copycb_t cb, + void *context) _CUPS_API_1_6; +extern int ippDeleteValues(ipp_t *ipp, ipp_attribute_t **attr, + int element, int count) _CUPS_API_1_6; +extern const char *ippEnumString(const char *attrname, int enumvalue) + _CUPS_API_1_6; +extern int ippEnumValue(const char *attrname, + const char *enumstring) _CUPS_API_1_6; +extern ipp_attribute_t *ippFirstAttribute(ipp_t *ipp) _CUPS_API_1_6; +extern int ippGetBoolean(ipp_attribute_t *attr, int element) + _CUPS_API_1_6; +extern ipp_t *ippGetCollection(ipp_attribute_t *attr, + int element) _CUPS_API_1_6; +extern int ippGetCount(ipp_attribute_t *attr) _CUPS_API_1_6; +extern const ipp_uchar_t *ippGetDate(ipp_attribute_t *attr, int element) + _CUPS_API_1_6; +extern ipp_tag_t ippGetGroupTag(ipp_attribute_t *attr) _CUPS_API_1_6; +extern int ippGetInteger(ipp_attribute_t *attr, int element) + _CUPS_API_1_6; +extern const char *ippGetName(ipp_attribute_t *attr) _CUPS_API_1_6; +extern ipp_op_t ippGetOperation(ipp_t *ipp) _CUPS_API_1_6; +extern int ippGetRange(ipp_attribute_t *attr, int element, + int *upper) _CUPS_API_1_6; +extern int ippGetRequestId(ipp_t *ipp) _CUPS_API_1_6; +extern int ippGetResolution(ipp_attribute_t *attr, int element, + int *yres, ipp_res_t *units) + _CUPS_API_1_6; +extern ipp_state_t ippGetState(ipp_t *ipp) _CUPS_API_1_6; +extern ipp_status_t ippGetStatusCode(ipp_t *ipp) _CUPS_API_1_6; +extern const char *ippGetString(ipp_attribute_t *attr, int element, + const char **language) _CUPS_API_1_6; +extern ipp_tag_t ippGetValueTag(ipp_attribute_t *attr) _CUPS_API_1_6; +extern int ippGetVersion(ipp_t *ipp, int *minor) _CUPS_API_1_6; +extern ipp_attribute_t *ippNextAttribute(ipp_t *ipp) _CUPS_API_1_6; +extern int ippSetBoolean(ipp_t *ipp, ipp_attribute_t **attr, + int element, int boolvalue) _CUPS_API_1_6; +extern int ippSetCollection(ipp_t *ipp, ipp_attribute_t **attr, + int element, ipp_t *colvalue) + _CUPS_API_1_6; +extern int ippSetDate(ipp_t *ipp, ipp_attribute_t **attr, + int element, const ipp_uchar_t *datevalue) + _CUPS_API_1_6; +extern int ippSetGroupTag(ipp_t *ipp, ipp_attribute_t **attr, + ipp_tag_t group_tag) _CUPS_API_1_6; +extern int ippSetInteger(ipp_t *ipp, ipp_attribute_t **attr, + int element, int intvalue) _CUPS_API_1_6; +extern int ippSetName(ipp_t *ipp, ipp_attribute_t **attr, + const char *name) _CUPS_API_1_6; +extern int ippSetOperation(ipp_t *ipp, ipp_op_t op) _CUPS_API_1_6; +extern int ippSetRange(ipp_t *ipp, ipp_attribute_t **attr, + int element, int lowervalue, int uppervalue) + _CUPS_API_1_6; +extern int ippSetRequestId(ipp_t *ipp, int request_id) + _CUPS_API_1_6; +extern int ippSetResolution(ipp_t *ipp, ipp_attribute_t **attr, + int element, ipp_res_t unitsvalue, + int xresvalue, int yresvalue) + _CUPS_API_1_6; +extern int ippSetState(ipp_t *ipp, ipp_state_t state) + _CUPS_API_1_6; +extern int ippSetStatusCode(ipp_t *ipp, ipp_status_t status) + _CUPS_API_1_6; +extern int ippSetString(ipp_t *ipp, ipp_attribute_t **attr, + int element, const char *strvalue) + _CUPS_API_1_6; +extern int ippSetValueTag(ipp_t *ipp, ipp_attribute_t **attr, + ipp_tag_t value_tag) _CUPS_API_1_6; +extern int ippSetVersion(ipp_t *ipp, int major, int minor) + _CUPS_API_1_6; + +/**** New in CUPS 1.7 ****/ +extern ipp_attribute_t *ippAddStringf(ipp_t *ipp, ipp_tag_t group, + ipp_tag_t value_tag, const char *name, + const char *language, const char *format, + ...) _CUPS_API_1_7; +extern ipp_attribute_t *ippAddStringfv(ipp_t *ipp, ipp_tag_t group, + ipp_tag_t value_tag, const char *name, + const char *language, + const char *format, va_list ap) + _CUPS_API_1_7; +extern int ippContainsInteger(ipp_attribute_t *attr, int value) + _CUPS_API_1_7; +extern int ippContainsString(ipp_attribute_t *attr, + const char *value) _CUPS_API_1_7; +extern cups_array_t *ippCreateRequestedArray(ipp_t *request) _CUPS_API_1_7; +extern void *ippGetOctetString(ipp_attribute_t *attr, int element, + int *datalen) _CUPS_API_1_7; +extern ipp_t *ippNewResponse(ipp_t *request) _CUPS_API_1_7; +extern int ippSetOctetString(ipp_t *ipp, ipp_attribute_t **attr, + int element, const void *data, + int datalen) _CUPS_API_1_7; +extern int ippSetStringf(ipp_t *ipp, ipp_attribute_t **attr, + int element, const char *format, + ...) _CUPS_API_1_7; +extern int ippSetStringfv(ipp_t *ipp, ipp_attribute_t **attr, + int element, const char *format, + va_list ap) _CUPS_API_1_7; +extern int ippValidateAttribute(ipp_attribute_t *attr) + _CUPS_API_1_7; +extern int ippValidateAttributes(ipp_t *ipp) _CUPS_API_1_7; + + +/**** New in CUPS 2.0 ****/ +extern const char *ippStateString(ipp_state_t state) _CUPS_API_2_0; + + +/* + * C++ magic... + */ + +# ifdef __cplusplus +} +# endif /* __cplusplus */ +#endif /* !_CUPS_IPP_H_ */ diff --git a/third_party/cups/include/cups/language.h b/third_party/cups/include/cups/language.h new file mode 100644 index 0000000000..b5ec7e1803 --- /dev/null +++ b/third_party/cups/include/cups/language.h @@ -0,0 +1,103 @@ +/* + * Multi-language support for CUPS. + * + * Copyright 2007-2011 by Apple Inc. + * Copyright 1997-2006 by Easy Software Products. + * + * Licensed under Apache License v2.0. See the file "LICENSE" for more information. + */ + +#ifndef _CUPS_LANGUAGE_H_ +# define _CUPS_LANGUAGE_H_ + +/* + * Include necessary headers... + */ + +# include <locale.h> +# include "array.h" + +# ifdef __cplusplus +extern "C" { +# endif /* __cplusplus */ + + +/* + * Types... + */ + +typedef enum cups_encoding_e /**** Language Encodings @exclude all@ ****/ +{ + CUPS_AUTO_ENCODING = -1, /* Auto-detect the encoding @private@ */ + CUPS_US_ASCII, /* US ASCII */ + CUPS_ISO8859_1, /* ISO-8859-1 */ + CUPS_ISO8859_2, /* ISO-8859-2 */ + CUPS_ISO8859_3, /* ISO-8859-3 */ + CUPS_ISO8859_4, /* ISO-8859-4 */ + CUPS_ISO8859_5, /* ISO-8859-5 */ + CUPS_ISO8859_6, /* ISO-8859-6 */ + CUPS_ISO8859_7, /* ISO-8859-7 */ + CUPS_ISO8859_8, /* ISO-8859-8 */ + CUPS_ISO8859_9, /* ISO-8859-9 */ + CUPS_ISO8859_10, /* ISO-8859-10 */ + CUPS_UTF8, /* UTF-8 */ + CUPS_ISO8859_13, /* ISO-8859-13 */ + CUPS_ISO8859_14, /* ISO-8859-14 */ + CUPS_ISO8859_15, /* ISO-8859-15 */ + CUPS_WINDOWS_874, /* CP-874 */ + CUPS_WINDOWS_1250, /* CP-1250 */ + CUPS_WINDOWS_1251, /* CP-1251 */ + CUPS_WINDOWS_1252, /* CP-1252 */ + CUPS_WINDOWS_1253, /* CP-1253 */ + CUPS_WINDOWS_1254, /* CP-1254 */ + CUPS_WINDOWS_1255, /* CP-1255 */ + CUPS_WINDOWS_1256, /* CP-1256 */ + CUPS_WINDOWS_1257, /* CP-1257 */ + CUPS_WINDOWS_1258, /* CP-1258 */ + CUPS_KOI8_R, /* KOI-8-R */ + CUPS_KOI8_U, /* KOI-8-U */ + CUPS_ISO8859_11, /* ISO-8859-11 */ + CUPS_ISO8859_16, /* ISO-8859-16 */ + CUPS_MAC_ROMAN, /* MacRoman */ + CUPS_ENCODING_SBCS_END = 63, /* End of single-byte encodings @private@ */ + + CUPS_WINDOWS_932, /* Japanese JIS X0208-1990 */ + CUPS_WINDOWS_936, /* Simplified Chinese GB 2312-80 */ + CUPS_WINDOWS_949, /* Korean KS C5601-1992 */ + CUPS_WINDOWS_950, /* Traditional Chinese Big Five */ + CUPS_WINDOWS_1361, /* Korean Johab */ + CUPS_ENCODING_DBCS_END = 127, /* End of double-byte encodings @private@ */ + + CUPS_EUC_CN, /* EUC Simplified Chinese */ + CUPS_EUC_JP, /* EUC Japanese */ + CUPS_EUC_KR, /* EUC Korean */ + CUPS_EUC_TW, /* EUC Traditional Chinese */ + CUPS_JIS_X0213, /* JIS X0213 aka Shift JIS */ + CUPS_ENCODING_VBCS_END = 191 /* End of variable-length encodings @private@ */ +} cups_encoding_t; + +typedef struct cups_lang_s /**** Language Cache Structure ****/ +{ + struct cups_lang_s *next; /* Next language in cache */ + int used; /* Number of times this entry has been used. */ + cups_encoding_t encoding; /* Text encoding */ + char language[16]; /* Language/locale name */ + cups_array_t *strings; /* Message strings @private@ */ +} cups_lang_t; + + +/* + * Prototypes... + */ + +extern cups_lang_t *cupsLangDefault(void) _CUPS_PUBLIC; +extern const char *cupsLangEncoding(cups_lang_t *lang) _CUPS_PUBLIC; +extern void cupsLangFlush(void) _CUPS_PUBLIC; +extern void cupsLangFree(cups_lang_t *lang) _CUPS_PUBLIC; +extern cups_lang_t *cupsLangGet(const char *language) _CUPS_PUBLIC; + +# ifdef __cplusplus +} +# endif /* __cplusplus */ + +#endif /* !_CUPS_LANGUAGE_H_ */ diff --git a/third_party/cups/include/cups/pwg.h b/third_party/cups/include/cups/pwg.h new file mode 100644 index 0000000000..2d30847635 --- /dev/null +++ b/third_party/cups/include/cups/pwg.h @@ -0,0 +1,82 @@ +/* + * PWG media API definitions for CUPS. + * + * Copyright 2009-2017 by Apple Inc. + * + * Licensed under Apache License v2.0. See the file "LICENSE" for more information. + */ + +#ifndef _CUPS_PWG_H_ +# define _CUPS_PWG_H_ + + +/* + * C++ magic... + */ + +# ifdef __cplusplus +extern "C" { +# endif /* __cplusplus */ + + +/* + * Macros... + */ + +/* Convert from points to hundredths of millimeters */ +# define PWG_FROM_POINTS(n) (int)(((n) * 2540 + 36) / 72) +/* Convert from hundredths of millimeters to points */ +# define PWG_TO_POINTS(n) ((n) * 72.0 / 2540.0) + + +/* + * Types and structures... + */ + +typedef struct pwg_map_s /**** Map element - PPD to/from PWG @exclude all@ */ +{ + char *pwg, /* PWG media keyword */ + *ppd; /* PPD option keyword */ +} pwg_map_t; + +typedef struct pwg_media_s /**** Common media size data ****/ +{ + const char *pwg, /* PWG 5101.1 "self describing" name */ + *legacy, /* IPP/ISO legacy name */ + *ppd; /* Standard Adobe PPD name */ + int width, /* Width in 2540ths */ + length; /* Length in 2540ths */ +} pwg_media_t; + +typedef struct pwg_size_s /**** Size element - PPD to/from PWG @exclude all@ */ +{ + pwg_map_t map; /* Map element */ + int width, /* Width in 2540ths */ + length, /* Length in 2540ths */ + left, /* Left margin in 2540ths */ + bottom, /* Bottom margin in 2540ths */ + right, /* Right margin in 2540ths */ + top; /* Top margin in 2540ths */ +} pwg_size_t; + + +/* + * Functions... + */ + +extern int pwgFormatSizeName(char *keyword, size_t keysize, + const char *prefix, const char *name, + int width, int length, + const char *units) _CUPS_API_1_7; +extern int pwgInitSize(pwg_size_t *size, ipp_t *job, + int *margins_set) _CUPS_API_1_7; +extern pwg_media_t *pwgMediaForLegacy(const char *legacy) _CUPS_API_1_7; +extern pwg_media_t *pwgMediaForPPD(const char *ppd) _CUPS_API_1_7; +extern pwg_media_t *pwgMediaForPWG(const char *pwg) _CUPS_API_1_7; +extern pwg_media_t *pwgMediaForSize(int width, int length) _CUPS_API_1_7; + +# ifdef __cplusplus +} +# endif /* __cplusplus */ + +#endif /* !_CUPS_PWG_H_ */ diff --git a/third_party/cups/include/cups/versioning.h b/third_party/cups/include/cups/versioning.h new file mode 100644 index 0000000000..14c218fee0 --- /dev/null +++ b/third_party/cups/include/cups/versioning.h @@ -0,0 +1,267 @@ +/* + * API versioning definitions for CUPS. + * + * Copyright © 2007-2019 by Apple Inc. + * + * Licensed under Apache License v2.0. See the file "LICENSE" for more + * information. + */ + +#ifndef _CUPS_VERSIONING_H_ +# define _CUPS_VERSIONING_H_ + +/* + * This header defines several macros that add compiler-specific attributes for + * functions: + * + * - _CUPS_API_major_minor[_patch]: Specifies when an API became available by + * CUPS version. + * - _CUPS_DEPRECATED: Function is deprecated with no replacement. + * - _CUPS_DEPRECATED_MSG("message"): Function is deprecated and has a + * replacement. + * - _CUPS_FORMAT(format-index, additional-args-index): Function has a + * printf-style format argument followed by zero or more additional + * arguments. Indices start at 1. + * - _CUPS_INTERNAL: Function is internal with no replacement API. + * - _CUPS_INTERNAL_MSG("msg"): Function is internal - use specified API + * instead. + * - _CUPS_NONNULL((arg list)): Specifies the comma-separated argument indices + * are assumed non-NULL. Indices start at 1. + * - _CUPS_NORETURN: Specifies the function does not return. + * - _CUPS_PRIVATE: Specifies the function is private to CUPS. + * - _CUPS_PUBLIC: Specifies the function is public API. + */ + +/* + * Determine which compiler is being used and what annotation features are + * available... + */ + +# ifdef __APPLE__ +# include <os/availability.h> +# endif /* __APPLE__ */ + +# ifdef __has_extension /* Clang */ +# define _CUPS_HAS_DEPRECATED +# define _CUPS_HAS_FORMAT +# define _CUPS_HAS_NORETURN +# define _CUPS_HAS_VISIBILITY +# if __has_extension(attribute_deprecated_with_message) +# define _CUPS_HAS_DEPRECATED_WITH_MESSAGE +# endif +# if __has_extension(attribute_unavailable_with_message) +# define _CUPS_HAS_UNAVAILABLE_WITH_MESSAGE +# endif +# elif defined(__GNUC__) /* GCC and compatible */ +# if __GNUC__ >= 3 /* GCC 3.0 or higher */ +# define _CUPS_HAS_DEPRECATED +# define _CUPS_HAS_FORMAT +# define _CUPS_HAS_NORETURN +# define _CUPS_HAS_VISIBILITY +# endif /* __GNUC__ >= 3 */ +# if __GNUC__ >= 5 /* GCC 5.x */ +# define _CUPS_HAS_DEPRECATED_WITH_MESSAGE +# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 5 + /* GCC 4.5 or higher */ +# define _CUPS_HAS_DEPRECATED_WITH_MESSAGE +# endif /* __GNUC__ >= 5 */ +# elif defined(_WIN32) +# define __attribute__(...) +# endif /* __has_extension */ + + +/* + * Define _CUPS_INTERNAL, _CUPS_PRIVATE, and _CUPS_PUBLIC visibilty macros for + * internal/private/public functions... + */ + +# ifdef _CUPS_HAS_VISIBILITY +# define _CUPS_INTERNAL __attribute__ ((visibility("hidden"))) +# define _CUPS_PRIVATE __attribute__ ((visibility("default"))) +# define _CUPS_PUBLIC __attribute__ ((visibility("default"))) +# elif defined(_WIN32) && defined(LIBCUPS2_EXPORTS) && 0 +# define _CUPS_INTERNAL +# define _CUPS_PRIVATE __declspec(dllexport) +# define _CUPS_PUBLIC __declspec(dllexport) +# else +# define _CUPS_INTERNAL +# define _CUPS_PRIVATE +# define _CUPS_PUBLIC +# endif /* _CUPS_HAS_VISIBILITY */ + + +/* + * Define _CUPS_API_major_minor[_patch] availability macros for CUPS. + * + * Note: Using any of the _CUPS_API macros automatically adds _CUPS_PUBLIC. + */ + +# if defined(__APPLE__) && !defined(_CUPS_SOURCE) && TARGET_OS_OSX +/* + * On Apple operating systems, the _CUPS_API_* constants are defined using the + * API_ macros in <os/availability.h>. + * + * On iOS, we don't actually have libcups available directly, but the supplied + * libcups_static target in the Xcode project supports building on iOS 11.0 and + * later. + */ +# define _CUPS_API_1_1_19 API_AVAILABLE(macos(10.3), ios(11.0)) _CUPS_PUBLIC +# define _CUPS_API_1_1_20 API_AVAILABLE(macos(10.4), ios(11.0)) _CUPS_PUBLIC +# define _CUPS_API_1_1_21 API_AVAILABLE(macos(10.4), ios(11.0)) _CUPS_PUBLIC +# define _CUPS_API_1_2 API_AVAILABLE(macos(10.5), ios(11.0)) _CUPS_PUBLIC +# define _CUPS_API_1_3 API_AVAILABLE(macos(10.5), ios(11.0)) _CUPS_PUBLIC +# define _CUPS_API_1_4 API_AVAILABLE(macos(10.6), ios(11.0)) _CUPS_PUBLIC +# define _CUPS_API_1_5 API_AVAILABLE(macos(10.7), ios(11.0)) _CUPS_PUBLIC +# define _CUPS_API_1_6 API_AVAILABLE(macos(10.8), ios(11.0)) _CUPS_PUBLIC +# define _CUPS_API_1_7 API_AVAILABLE(macos(10.9), ios(11.0)) _CUPS_PUBLIC +# define _CUPS_API_2_0 API_AVAILABLE(macos(10.10), ios(11.0)) _CUPS_PUBLIC +# define _CUPS_API_2_2 API_AVAILABLE(macos(10.12), ios(11.0)) _CUPS_PUBLIC +# define _CUPS_API_2_2_4 API_AVAILABLE(macos(10.13), ios(12.0)) _CUPS_PUBLIC +# define _CUPS_API_2_2_7 API_AVAILABLE(macos(10.14), ios(13.0)) _CUPS_PUBLIC +# define _CUPS_API_2_3 API_AVAILABLE(macos(10.14), ios(13.0)) _CUPS_PUBLIC +# else +# define _CUPS_API_1_1_19 _CUPS_PUBLIC +# define _CUPS_API_1_1_20 _CUPS_PUBLIC +# define _CUPS_API_1_1_21 _CUPS_PUBLIC +# define _CUPS_API_1_2 _CUPS_PUBLIC +# define _CUPS_API_1_3 _CUPS_PUBLIC +# define _CUPS_API_1_4 _CUPS_PUBLIC +# define _CUPS_API_1_5 _CUPS_PUBLIC +# define _CUPS_API_1_6 _CUPS_PUBLIC +# define _CUPS_API_1_7 _CUPS_PUBLIC +# define _CUPS_API_2_0 _CUPS_PUBLIC +# define _CUPS_API_2_2 _CUPS_PUBLIC +# define _CUPS_API_2_2_4 _CUPS_PUBLIC +# define _CUPS_API_2_2_7 _CUPS_PUBLIC +# define _CUPS_API_2_3 _CUPS_PUBLIC +# endif /* __APPLE__ && !_CUPS_SOURCE */ + + +/* + * Define _CUPS_DEPRECATED and _CUPS_INTERNAL macros to mark old APIs as + * "deprecated" or "unavailable" with messages so you get warnings/errors are + * compile-time... + * + * Note: Using any of the _CUPS_DEPRECATED macros automatically adds + * _CUPS_PUBLIC. + */ + +# if !defined(_CUPS_HAS_DEPRECATED) || (defined(_CUPS_SOURCE) && !defined(_CUPS_NO_DEPRECATED)) + /* + * Don't mark functions deprecated if the compiler doesn't support it + * or we are building CUPS source that doesn't care. + */ +# define _CUPS_DEPRECATED _CUPS_PUBLIC +# define _CUPS_DEPRECATED_MSG(m) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_2_MSG(m) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_6_MSG(m) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_7_MSG(m) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_2_2_MSG(m) _CUPS_PUBLIC +# elif defined(__APPLE__) && defined(_CUPS_NO_DEPRECATED) + /* + * Compiler supports the unavailable attribute, so use it when the code + * wants to exclude the use of deprecated API. + */ +# define _CUPS_DEPRECATED __attribute__ ((unavailable)) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_MSG(m) __attribute__ ((unavailable(m))) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_2_MSG(m) API_DEPRECATED(m, macos(10.2,10.5), ios(11.0,11.0)) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_6_MSG(m) API_DEPRECATED(m, macos(10.2,10.8), ios(11.0,11.0)) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_7_MSG(m) API_DEPRECATED(m, macos(10.2,10.9), ios(11.0,11.0)) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_2_2_MSG(m) API_DEPRECATED(m, macos(10.2,10.12), ios(11.0,11.0)) _CUPS_PUBLIC + +# elif defined(__APPLE__) + /* + * Just mark things as deprecated... + */ +# define _CUPS_DEPRECATED __attribute__ ((deprecated)) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_MSG(m) __attribute__ ((deprecated(m))) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_2_MSG(m) API_DEPRECATED(m, macos(10.2,10.5), ios(11.0,11.0)) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_6_MSG(m) API_DEPRECATED(m, macos(10.2,10.8), ios(11.0,11.0)) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_7_MSG(m) API_DEPRECATED(m, macos(10.2,10.9), ios(11.0,11.0)) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_2_2_MSG(m) API_DEPRECATED(m, macos(10.2,10.12), ios(11.0,11.0)) _CUPS_PUBLIC + +# elif defined(_CUPS_HAS_UNAVAILABLE_WITH_MESSAGE) && defined(_CUPS_NO_DEPRECATED) + /* + * Compiler supports the unavailable attribute, so use it when the code + * wants to exclude the use of deprecated API. + */ +# define _CUPS_DEPRECATED __attribute__ ((unavailable)) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_MSG(m) __attribute__ ((unavailable(m))) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_2_MSG(m) __attribute__ ((unavailable(m))) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_6_MSG(m) __attribute__ ((unavailable(m))) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_7_MSG(m) __attribute__ ((unavailable(m))) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_2_2_MSG(m) __attribute__ ((unavailable(m))) _CUPS_PUBLIC +# else + /* + * Compiler supports the deprecated attribute, so use it. + */ +# define _CUPS_DEPRECATED __attribute__ ((deprecated)) _CUPS_PUBLIC +# ifdef _CUPS_HAS_DEPRECATED_WITH_MESSAGE +# define _CUPS_DEPRECATED_MSG(m) __attribute__ ((deprecated(m))) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_2_MSG(m) __attribute__ ((deprecated(m))) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_6_MSG(m) __attribute__ ((deprecated(m))) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_7_MSG(m) __attribute__ ((deprecated(m))) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_2_2_MSG(m) __attribute__ ((deprecated(m))) _CUPS_PUBLIC +# else +# define _CUPS_DEPRECATED_MSG(m) __attribute__ ((deprecated)) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_2_MSG(m) __attribute__ ((deprecated)) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_6_MSG(m) __attribute__ ((deprecated)) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_1_7_MSG(m) __attribute__ ((deprecated)) _CUPS_PUBLIC +# define _CUPS_DEPRECATED_2_2_MSG(m) __attribute__ ((deprecated)) _CUPS_PUBLIC +# endif /* _CUPS_HAS_DEPRECATED_WITH_MESSAGE */ +# endif /* !_CUPS_HAS_DEPRECATED || (_CUPS_SOURCE && !_CUPS_NO_DEPRECATED) */ + + +/* + * Define _CUPS_FORMAT macro for printf-style functions... + */ + +# ifdef _CUPS_HAS_FORMAT +# define _CUPS_FORMAT(a,b) __attribute__ ((__format__(__printf__, a,b))) +# else +# define _CUPS_FORMAT(a,b) +# endif /* _CUPS_HAS_FORMAT */ + + +/* + * Define _CUPS_INTERNAL_MSG macro for private APIs that have (historical) + * public visibility. + * + * Note: Using the _CUPS_INTERNAL_MSG macro automatically adds _CUPS_PUBLIC. + */ + +# ifdef _CUPS_SOURCE +# define _CUPS_INTERNAL_MSG(m) _CUPS_PUBLIC +# elif defined(_CUPS_HAS_UNAVAILABLE_WITH_MESSAGE) +# define _CUPS_INTERNAL_MSG(m) __attribute__ ((unavailable(m))) _CUPS_PUBLIC +# elif defined(_CUPS_HAS_DEPRECATED_WITH_MESSAGE) +# define _CUPS_INTERNAL_MSG(m) __attribute__ ((deprecated(m))) _CUPS_PUBLIC +# else +# define _CUPS_INTERNAL_MSG(m) __attribute__ ((deprecated)) _CUPS_PUBLIC +# endif /* _CUPS_SOURCE */ + + +/* + * Define _CUPS_NONNULL macro for functions that don't expect non-null + * arguments... + */ + +# ifdef _CUPS_HAS_NONNULL +# define _CUPS_NONNULL(...) __attribute__ ((nonnull(__VA_ARGS__))) +# else +# define _CUPS_NONNULL(...) +# endif /* _CUPS_HAS_FORMAT */ + + +/* + * Define _CUPS_NORETURN macro for functions that don't return. + */ + +# ifdef _CUPS_HAS_NORETURN +# define _CUPS_NORETURN __attribute__ ((noreturn)) +# else +# define _CUPS_NORETURN +# endif /* _CUPS_HAS_NORETURN */ + + +#endif /* !_CUPS_VERSIONING_H_ */ diff --git a/third_party/cups/moz.yaml b/third_party/cups/moz.yaml new file mode 100644 index 0000000000..2b4ce6407e --- /dev/null +++ b/third_party/cups/moz.yaml @@ -0,0 +1,40 @@ +schema: 1 + +bugzilla: + product: Core + component: "Printing: Setup" + +origin: + name: cups + description: standards-based, open source printing system + + url: https://github.com/apple/cups + + release: 82e3ee0e3230287b76a76fb8f16b92ca6e50b444 (2020-04-27T18:04:29Z). + revision: 82e3ee0e3230287b76a76fb8f16b92ca6e50b444 + + license: Apache-2.0 + +vendoring: + url: https://github.com/apple/cups + source-hosting: github + tracking: commit + + exclude: + - "**" + + include: + - LICENSE + - cups/array.h + - cups/cups.h + - cups/file.h + - cups/http.h + - cups/ipp.h + - cups/language.h + - cups/pwg.h + - cups/versioning.h + + update-actions: + - action: move-dir + from: "{yaml_dir}/cups" + to: "{yaml_dir}/include/cups" |