• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * API definitions for CUPS.
3  *
4  * Copyright © 2021-2025 by OpenPrinting.
5  * Copyright © 2007-2020 by Apple Inc.
6  * Copyright © 1997-2007 by Easy Software Products.
7  *
8  * Licensed under Apache License v2.0.  See the file "LICENSE" for more
9  * information.
10  */
11 
12 #ifndef _CUPS_CUPS_H_
13 #  define _CUPS_CUPS_H_
14 
15 /*
16  * Include necessary headers...
17  */
18 
19 #  include <sys/types.h>
20 #  if defined(_WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
21 #    define __CUPS_SSIZE_T_DEFINED
22 #    include <stddef.h>
23 /* Windows does not support the ssize_t type, so map it to __int64... */
24 typedef __int64 ssize_t;			/* @private@ */
25 #  endif /* _WIN32 && !__CUPS_SSIZE_T_DEFINED */
26 
27 #  include "file.h"
28 #  include "ipp.h"
29 #  include "language.h"
30 #  include "pwg.h"
31 
32 
33 /*
34  * C++ magic...
35  */
36 
37 #  ifdef __cplusplus
38 extern "C" {
39 #  endif /* __cplusplus */
40 
41 
42 /*
43  * Constants...
44  */
45 
46 #  define CUPS_VERSION			2.0412
47 #  define CUPS_VERSION_MAJOR		2
48 #  define CUPS_VERSION_MINOR		4
49 #  define CUPS_VERSION_PATCH		12
50 
51 #  define CUPS_BC_FD			3
52 					/* Back-channel file descriptor for
53 					 * select/poll */
54 #  define CUPS_DATE_ANY			(time_t)-1
55 #  define CUPS_EXCLUDE_NONE		(const char *)0
56 #  define CUPS_FORMAT_AUTO		"application/octet-stream"
57 #  define CUPS_FORMAT_COMMAND		"application/vnd.cups-command"
58 #  define CUPS_FORMAT_JPEG		"image/jpeg"
59 #  define CUPS_FORMAT_PDF		"application/pdf"
60 #  define CUPS_FORMAT_POSTSCRIPT	"application/postscript"
61 #  define CUPS_FORMAT_RAW		"application/vnd.cups-raw"
62 #  define CUPS_FORMAT_TEXT		"text/plain"
63 #  define CUPS_HTTP_DEFAULT		(http_t *)0
64 #  define CUPS_INCLUDE_ALL		(const char *)0
65 #  define CUPS_JOBID_ALL		-1
66 #  define CUPS_JOBID_CURRENT		0
67 #  define CUPS_LENGTH_VARIABLE		(ssize_t)0
68 #  define CUPS_TIMEOUT_DEFAULT		0
69 #  define CUPS_WHICHJOBS_ALL		-1
70 #  define CUPS_WHICHJOBS_ACTIVE		0
71 #  define CUPS_WHICHJOBS_COMPLETED	1
72 
73 /* Flags for cupsConnectDest and cupsEnumDests */
74 #  define CUPS_DEST_FLAGS_NONE		0x00
75 					/* No flags are set */
76 #  define CUPS_DEST_FLAGS_UNCONNECTED	0x01
77 					/* There is no connection */
78 #  define CUPS_DEST_FLAGS_MORE		0x02
79 					/* There are more destinations */
80 #  define CUPS_DEST_FLAGS_REMOVED	0x04
81 					/* The destination has gone away */
82 #  define CUPS_DEST_FLAGS_ERROR		0x08
83 					/* An error occurred */
84 #  define CUPS_DEST_FLAGS_RESOLVING	0x10
85 					/* The destination address is being
86 					 * resolved */
87 #  define CUPS_DEST_FLAGS_CONNECTING	0x20
88 					/* A connection is being established */
89 #  define CUPS_DEST_FLAGS_CANCELED	0x40
90 					/* Operation was canceled */
91 #  define CUPS_DEST_FLAGS_DEVICE        0x80
92                                         /* For @link cupsConnectDest@: Connect to device */
93 
94 /* Flags for cupsGetDestMediaByName/Size */
95 #  define CUPS_MEDIA_FLAGS_DEFAULT 	0x00
96 					/* Find the closest size supported by
97 					 * the printer */
98 #  define CUPS_MEDIA_FLAGS_BORDERLESS	0x01
99 					/* Find a borderless size */
100 #  define CUPS_MEDIA_FLAGS_DUPLEX	0x02
101 					/* Find a size compatible with 2-sided
102 					 * printing */
103 #  define CUPS_MEDIA_FLAGS_EXACT	0x04
104 					/* Find an exact match for the size */
105 #  define CUPS_MEDIA_FLAGS_READY	0x08
106 					/* If the printer supports media
107 					 * sensing, find the size amongst the
108 					 * "ready" media. */
109 
110 /* Options and values */
111 #  define CUPS_COPIES			"copies"
112 #  define CUPS_COPIES_SUPPORTED		"copies-supported"
113 
114 #  define CUPS_FINISHINGS		"finishings"
115 #  define CUPS_FINISHINGS_SUPPORTED	"finishings-supported"
116 
117 #  define CUPS_FINISHINGS_BIND		"7"
118 #  define CUPS_FINISHINGS_COVER		"6"
119 #  define CUPS_FINISHINGS_FOLD		"10"
120 #  define CUPS_FINISHINGS_NONE		"3"
121 #  define CUPS_FINISHINGS_PUNCH		"5"
122 #  define CUPS_FINISHINGS_STAPLE	"4"
123 #  define CUPS_FINISHINGS_TRIM		"11"
124 
125 #  define CUPS_MEDIA			"media"
126 #  define CUPS_MEDIA_READY		"media-ready"
127 #  define CUPS_MEDIA_SUPPORTED		"media-supported"
128 
129 #  define CUPS_MEDIA_3X5		"na_index-3x5_3x5in"
130 #  define CUPS_MEDIA_4X6		"na_index-4x6_4x6in"
131 #  define CUPS_MEDIA_5X7		"na_5x7_5x7in"
132 #  define CUPS_MEDIA_8X10		"na_govt-letter_8x10in"
133 #  define CUPS_MEDIA_A3			"iso_a3_297x420mm"
134 #  define CUPS_MEDIA_A4			"iso_a4_210x297mm"
135 #  define CUPS_MEDIA_A5			"iso_a5_148x210mm"
136 #  define CUPS_MEDIA_A6			"iso_a6_105x148mm"
137 #  define CUPS_MEDIA_ENV10		"na_number-10_4.125x9.5in"
138 #  define CUPS_MEDIA_ENVDL		"iso_dl_110x220mm"
139 #  define CUPS_MEDIA_LEGAL		"na_legal_8.5x14in"
140 #  define CUPS_MEDIA_LETTER		"na_letter_8.5x11in"
141 #  define CUPS_MEDIA_PHOTO_L		"oe_photo-l_3.5x5in"
142 #  define CUPS_MEDIA_SUPERBA3		"na_super-b_13x19in"
143 #  define CUPS_MEDIA_TABLOID		"na_ledger_11x17in"
144 
145 #  define CUPS_MEDIA_SOURCE		"media-source"
146 #  define CUPS_MEDIA_SOURCE_SUPPORTED	"media-source-supported"
147 
148 #  define CUPS_MEDIA_SOURCE_AUTO	"auto"
149 #  define CUPS_MEDIA_SOURCE_MANUAL	"manual"
150 
151 #  define CUPS_MEDIA_TYPE		"media-type"
152 #  define CUPS_MEDIA_TYPE_SUPPORTED	"media-type-supported"
153 
154 #  define CUPS_MEDIA_TYPE_AUTO		"auto"
155 #  define CUPS_MEDIA_TYPE_ENVELOPE	"envelope"
156 #  define CUPS_MEDIA_TYPE_LABELS	"labels"
157 #  define CUPS_MEDIA_TYPE_LETTERHEAD	"stationery-letterhead"
158 #  define CUPS_MEDIA_TYPE_PHOTO		"photographic"
159 #  define CUPS_MEDIA_TYPE_PHOTO_GLOSSY	"photographic-glossy"
160 #  define CUPS_MEDIA_TYPE_PHOTO_MATTE	"photographic-matte"
161 #  define CUPS_MEDIA_TYPE_PLAIN		"stationery"
162 #  define CUPS_MEDIA_TYPE_TRANSPARENCY	"transparency"
163 
164 #  define CUPS_NUMBER_UP		"number-up"
165 #  define CUPS_NUMBER_UP_SUPPORTED	"number-up-supported"
166 
167 #  define CUPS_ORIENTATION		"orientation-requested"
168 #  define CUPS_ORIENTATION_SUPPORTED	"orientation-requested-supported"
169 
170 #  define CUPS_ORIENTATION_PORTRAIT	"3"
171 #  define CUPS_ORIENTATION_LANDSCAPE	"4"
172 
173 #  define CUPS_PRINT_COLOR_MODE		"print-color-mode"
174 #  define CUPS_PRINT_COLOR_MODE_SUPPORTED "print-color-mode-supported"
175 
176 #  define CUPS_PRINT_COLOR_MODE_AUTO	"auto"
177 #  define CUPS_PRINT_COLOR_MODE_MONOCHROME "monochrome"
178 #  define CUPS_PRINT_COLOR_MODE_COLOR	"color"
179 
180 #  define CUPS_PRINT_QUALITY		"print-quality"
181 #  define CUPS_PRINT_QUALITY_SUPPORTED	"print-quality-supported"
182 
183 #  define CUPS_PRINT_QUALITY_DRAFT	"3"
184 #  define CUPS_PRINT_QUALITY_NORMAL	"4"
185 #  define CUPS_PRINT_QUALITY_HIGH	"5"
186 
187 #  define CUPS_SIDES			"sides"
188 #  define CUPS_SIDES_SUPPORTED		"sides-supported"
189 
190 #  define CUPS_SIDES_ONE_SIDED		"one-sided"
191 #  define CUPS_SIDES_TWO_SIDED_PORTRAIT	"two-sided-long-edge"
192 #  define CUPS_SIDES_TWO_SIDED_LANDSCAPE "two-sided-short-edge"
193 
194 
195 /*
196  * Types and structures...
197  */
198 
199 typedef unsigned cups_ptype_t;		/* Printer type/capability bits */
200 enum cups_ptype_e			/* Printer type/capability bit
201 					 * constants */
202 {					/* Not a typedef'd enum so we can OR */
203   CUPS_PRINTER_LOCAL = 0x0000,		/* Local printer or class */
204   CUPS_PRINTER_CLASS = 0x0001,		/* Printer class */
205   CUPS_PRINTER_REMOTE = 0x0002,		/* Remote printer or class */
206   CUPS_PRINTER_BW = 0x0004,		/* Can do B&W printing */
207   CUPS_PRINTER_COLOR = 0x0008,		/* Can do color printing */
208   CUPS_PRINTER_DUPLEX = 0x0010,		/* Can do two-sided printing */
209   CUPS_PRINTER_STAPLE = 0x0020,		/* Can staple output */
210   CUPS_PRINTER_COPIES = 0x0040,		/* Can do copies in hardware */
211   CUPS_PRINTER_COLLATE = 0x0080,	/* Can quickly collate copies */
212   CUPS_PRINTER_PUNCH = 0x0100,		/* Can punch output */
213   CUPS_PRINTER_COVER = 0x0200,		/* Can cover output */
214   CUPS_PRINTER_BIND = 0x0400,		/* Can bind output */
215   CUPS_PRINTER_SORT = 0x0800,		/* Can sort output */
216   CUPS_PRINTER_SMALL = 0x1000,		/* Can print on Letter/Legal/A4-size media */
217   CUPS_PRINTER_MEDIUM = 0x2000,		/* Can print on Tabloid/B/C/A3/A2-size media */
218   CUPS_PRINTER_LARGE = 0x4000,		/* Can print on D/E/A1/A0-size media */
219   CUPS_PRINTER_VARIABLE = 0x8000,	/* Can print on rolls and custom-size media */
220   CUPS_PRINTER_IMPLICIT = 0x10000,	/* Implicit class @private@
221 					 * @since Deprecated@ */
222   CUPS_PRINTER_DEFAULT = 0x20000,	/* Default printer on network */
223   CUPS_PRINTER_FAX = 0x40000,		/* Fax queue */
224   CUPS_PRINTER_REJECTING = 0x80000,	/* Printer is rejecting jobs */
225   CUPS_PRINTER_DELETE = 0x100000,	/* Delete printer
226 					 * @deprecated@ @exclude all@ */
227   CUPS_PRINTER_NOT_SHARED = 0x200000,	/* Printer is not shared
228 					 * @since CUPS 1.2/macOS 10.5@ */
229   CUPS_PRINTER_AUTHENTICATED = 0x400000,/* Printer requires authentication
230 					 * @since CUPS 1.2/macOS 10.5@ */
231   CUPS_PRINTER_COMMANDS = 0x800000,	/* Printer supports maintenance commands
232 					 * @since CUPS 1.2/macOS 10.5@ */
233   CUPS_PRINTER_DISCOVERED = 0x1000000,	/* Printer was discovered @since CUPS 1.2/macOS 10.5@ */
234   CUPS_PRINTER_SCANNER = 0x2000000,	/* Scanner-only device
235 					 * @since CUPS 1.4/macOS 10.6@ @private@ */
236   CUPS_PRINTER_MFP = 0x4000000,		/* Printer with scanning capabilities
237 					 * @since CUPS 1.4/macOS 10.6@ @private@ */
238   CUPS_PRINTER_3D = 0x8000000,		/* Printer with 3D capabilities @exclude all@ @private@ */
239   CUPS_PRINTER_OPTIONS = 0x6fffc	/* ~(CLASS | REMOTE | IMPLICIT |
240 					 * DEFAULT | FAX | REJECTING | DELETE |
241 					 * NOT_SHARED | AUTHENTICATED |
242 					 * COMMANDS | DISCOVERED) @private@ */
243 };
244 
245 typedef struct cups_option_s		/**** Printer Options ****/
246 {
247   char		*name;			/* Name of option */
248   char		*value;			/* Value of option */
249 } cups_option_t;
250 
251 typedef struct cups_dest_s		/**** Destination ****/
252 {
253   char		*name,			/* Printer or class name */
254 		*instance;		/* Local instance name or NULL */
255   int		is_default;		/* Is this printer the default? */
256   int		num_options;		/* Number of options */
257   cups_option_t	*options;		/* Options */
258 } cups_dest_t;
259 
260 typedef struct _cups_dinfo_s cups_dinfo_t;
261 					/* Destination capability and status
262 					 * information @since CUPS 1.6/macOS 10.8@ */
263 
264 typedef struct cups_job_s		/**** Job ****/
265 {
266   int		id;			/* The job ID */
267   char		*dest;			/* Printer or class name */
268   char		*title;			/* Title/job name */
269   char		*user;			/* User that submitted the job */
270   char		*format;		/* Document format */
271   ipp_jstate_t	state;			/* Job state */
272   int		size;			/* Size in kilobytes */
273   int		priority;		/* Priority (1-100) */
274   time_t	completed_time;		/* Time the job was completed */
275   time_t	creation_time;		/* Time the job was created */
276   time_t	processing_time;	/* Time the job was processed */
277 } cups_job_t;
278 
279 typedef struct cups_size_s		/**** Media Size @since CUPS 1.6/macOS 10.8@ ****/
280 {
281   char		media[128];		/* Media name to use */
282   int		width,			/* Width in hundredths of millimeters */
283 		length,			/* Length in hundredths of
284 					 * millimeters */
285 		bottom,			/* Bottom margin in hundredths of
286 					 * millimeters */
287 		left,			/* Left margin in hundredths of
288 					 * millimeters */
289 		right,			/* Right margin in hundredths of
290 					 * millimeters */
291 		top;			/* Top margin in hundredths of
292 					 * millimeters */
293 } cups_size_t;
294 
295 typedef int (*cups_client_cert_cb_t)(http_t *http, void *tls,
296 				     cups_array_t *distinguished_names,
297 				     void *user_data);
298 					/* Client credentials callback
299 					 * @since CUPS 1.5/macOS 10.7@ */
300 
301 typedef int (*cups_dest_cb_t)(void *user_data, unsigned flags,
302 			      cups_dest_t *dest);
303 			      		/* Destination enumeration callback
304 					 * @since CUPS 1.6/macOS 10.8@ */
305 
306 #  ifdef __BLOCKS__
307 typedef int (^cups_dest_block_t)(unsigned flags, cups_dest_t *dest);
308 			      		/* Destination enumeration block
309 					 * @since CUPS 1.6/macOS 10.8@
310                                          * @exclude all@ */
311 #  endif /* __BLOCKS__ */
312 
313 typedef const char *(*cups_oauth_cb_t)(http_t *http, const char *realm, const char *scope, const char *resource, void *user_data);
314 					/* OAuth callback @since CUPS 2.4@ */
315 
316 typedef const char *(*cups_password_cb_t)(const char *prompt);
317 					/* Password callback @exclude all@ */
318 
319 typedef const char *(*cups_password_cb2_t)(const char *prompt, http_t *http,
320 					   const char *method,
321 					   const char *resource,
322 					   void *user_data);
323 					/* New password callback
324 					 * @since CUPS 1.4/macOS 10.6@ */
325 
326 typedef int (*cups_server_cert_cb_t)(http_t *http, void *tls,
327 				     cups_array_t *certs, void *user_data);
328 					/* Server credentials callback
329 					 * @since CUPS 1.5/macOS 10.7@ */
330 
331 
332 /*
333  * Functions...
334  */
335 
336 extern int		cupsCancelJob(const char *name, int job_id) _CUPS_PUBLIC;
337 extern ipp_t		*cupsDoFileRequest(http_t *http, ipp_t *request,
338 			                   const char *resource,
339 					   const char *filename) _CUPS_PUBLIC;
340 extern ipp_t		*cupsDoRequest(http_t *http, ipp_t *request,
341 			               const char *resource) _CUPS_PUBLIC;
342 extern http_encryption_t cupsEncryption(void);
343 extern void		cupsFreeJobs(int num_jobs, cups_job_t *jobs) _CUPS_PUBLIC;
344 extern int		cupsGetClasses(char ***classes) _CUPS_DEPRECATED_MSG("Use cupsEnumDests instead.");
345 extern const char	*cupsGetDefault(void) _CUPS_PUBLIC;
346 extern int		cupsGetJobs(cups_job_t **jobs, const char *name,
347 			            int myjobs, int whichjobs) _CUPS_PUBLIC;
348 extern int		cupsGetPrinters(char ***printers) _CUPS_DEPRECATED_MSG("Use cupsEnumDests instead.");
349 extern ipp_status_t	cupsLastError(void) _CUPS_PUBLIC;
350 extern int		cupsPrintFile(const char *name, const char *filename,
351 			              const char *title, int num_options,
352 				      cups_option_t *options) _CUPS_PUBLIC;
353 extern int		cupsPrintFiles(const char *name, int num_files,
354 			               const char **files, const char *title,
355 				       int num_options, cups_option_t *options) _CUPS_PUBLIC;
356 extern char		*cupsTempFile(char *filename, int len) _CUPS_DEPRECATED_MSG("Use cupsTempFd or cupsTempFile2 instead.");
357 extern int		cupsTempFd(char *filename, int len) _CUPS_PUBLIC;
358 
359 extern int		cupsAddDest(const char *name, const char *instance,
360 			            int num_dests, cups_dest_t **dests) _CUPS_PUBLIC;
361 extern void		cupsFreeDests(int num_dests, cups_dest_t *dests) _CUPS_PUBLIC;
362 extern cups_dest_t	*cupsGetDest(const char *name, const char *instance,
363 			             int num_dests, cups_dest_t *dests) _CUPS_PUBLIC;
364 extern int		cupsGetDests(cups_dest_t **dests) _CUPS_PUBLIC;
365 extern void		cupsSetDests(int num_dests, cups_dest_t *dests) _CUPS_PUBLIC;
366 
367 extern int		cupsAddOption(const char *name, const char *value,
368 			              int num_options, cups_option_t **options) _CUPS_PUBLIC;
369 extern void		cupsEncodeOptions(ipp_t *ipp, int num_options,
370 					  cups_option_t *options) _CUPS_PUBLIC;
371 extern void		cupsFreeOptions(int num_options,
372 			                cups_option_t *options) _CUPS_PUBLIC;
373 extern const char	*cupsGetOption(const char *name, int num_options,
374 			               cups_option_t *options) _CUPS_PUBLIC;
375 extern int		cupsParseOptions(const char *arg, int num_options,
376 			                 cups_option_t **options) _CUPS_PUBLIC;
377 
378 extern const char	*cupsGetPassword(const char *prompt) _CUPS_PUBLIC;
379 extern const char	*cupsServer(void) _CUPS_PUBLIC;
380 extern void		cupsSetEncryption(http_encryption_t e) _CUPS_PUBLIC;
381 extern void		cupsSetPasswordCB(cups_password_cb_t cb) _CUPS_PUBLIC;
382 extern void		cupsSetServer(const char *server) _CUPS_PUBLIC;
383 extern void		cupsSetUser(const char *user) _CUPS_PUBLIC;
384 extern const char	*cupsUser(void) _CUPS_PUBLIC;
385 
386 /**** New in CUPS 1.1.20 ****/
387 extern int		cupsDoAuthentication(http_t *http, const char *method,
388 			                     const char *resource)
389 			                     _CUPS_API_1_1_20;
390 extern http_status_t	cupsGetFile(http_t *http, const char *resource,
391 			            const char *filename) _CUPS_API_1_1_20;
392 extern http_status_t	cupsGetFd(http_t *http, const char *resource, int fd) _CUPS_API_1_1_20;
393 extern http_status_t	cupsPutFile(http_t *http, const char *resource,
394 			            const char *filename) _CUPS_API_1_1_20;
395 extern http_status_t	cupsPutFd(http_t *http, const char *resource, int fd)
396 			          _CUPS_API_1_1_20;
397 
398 /**** New in CUPS 1.1.21 ****/
399 extern const char	*cupsGetDefault2(http_t *http) _CUPS_API_1_1_21;
400 extern int		cupsGetDests2(http_t *http, cups_dest_t **dests)
401 			              _CUPS_API_1_1_21;
402 extern int		cupsGetJobs2(http_t *http, cups_job_t **jobs,
403 			             const char *name, int myjobs,
404 				     int whichjobs) _CUPS_API_1_1_21;
405 extern int		cupsPrintFile2(http_t *http, const char *name,
406 			               const char *filename,
407 				       const char *title, int num_options,
408 				       cups_option_t *options) _CUPS_API_1_1_21;
409 extern int		cupsPrintFiles2(http_t *http, const char *name,
410 			                int num_files, const char **files,
411 					const char *title, int num_options,
412 					cups_option_t *options)
413 					_CUPS_API_1_1_21;
414 extern int		cupsSetDests2(http_t *http, int num_dests,
415 			              cups_dest_t *dests) _CUPS_API_1_1_21;
416 
417 /**** New in CUPS 1.2/macOS 10.5 ****/
418 extern void		cupsEncodeOptions2(ipp_t *ipp, int num_options,
419 					   cups_option_t *options,
420 					   ipp_tag_t group_tag) _CUPS_API_1_2;
421 extern const char	*cupsLastErrorString(void) _CUPS_API_1_2;
422 extern char		*cupsNotifySubject(cups_lang_t *lang, ipp_t *event)
423 			                   _CUPS_API_1_2;
424 extern char		*cupsNotifyText(cups_lang_t *lang, ipp_t *event)
425 			                _CUPS_API_1_2;
426 extern int		cupsRemoveOption(const char *name, int num_options,
427 			                 cups_option_t **options) _CUPS_API_1_2;
428 extern cups_file_t	*cupsTempFile2(char *filename, int len) _CUPS_API_1_2;
429 
430 /**** New in CUPS 1.3/macOS 10.5 ****/
431 extern ipp_t		*cupsDoIORequest(http_t *http, ipp_t *request,
432 			                 const char *resource, int infile,
433 					 int outfile) _CUPS_API_1_3;
434 extern int		cupsRemoveDest(const char *name,
435 			               const char *instance,
436 				       int num_dests, cups_dest_t **dests)
437 				       _CUPS_API_1_3;
438 extern void		cupsSetDefaultDest(const char *name,
439 			                   const char *instance,
440 					   int num_dests,
441 					   cups_dest_t *dests) _CUPS_API_1_3;
442 
443 /**** New in CUPS 1.4/macOS 10.6 ****/
444 extern ipp_status_t	cupsCancelJob2(http_t *http, const char *name,
445 			               int job_id, int purge) _CUPS_API_1_4;
446 extern int		cupsCreateJob(http_t *http, const char *name,
447 				      const char *title, int num_options,
448 				      cups_option_t *options) _CUPS_API_1_4;
449 extern ipp_status_t	cupsFinishDocument(http_t *http,
450 			                   const char *name) _CUPS_API_1_4;
451 extern cups_dest_t	*cupsGetNamedDest(http_t *http, const char *name,
452 			                  const char *instance) _CUPS_API_1_4;
453 extern const char	*cupsGetPassword2(const char *prompt, http_t *http,
454 					  const char *method,
455 					  const char *resource) _CUPS_API_1_4;
456 extern ipp_t		*cupsGetResponse(http_t *http,
457 			                 const char *resource) _CUPS_API_1_4;
458 extern ssize_t		cupsReadResponseData(http_t *http, char *buffer,
459 			                     size_t length) _CUPS_API_1_4;
460 extern http_status_t	cupsSendRequest(http_t *http, ipp_t *request,
461 			                const char *resource,
462 					size_t length) _CUPS_API_1_4;
463 extern void		cupsSetPasswordCB2(cups_password_cb2_t cb,
464 			                   void *user_data) _CUPS_API_1_4;
465 extern http_status_t	cupsStartDocument(http_t *http, const char *name,
466 			                  int job_id, const char *docname,
467 					  const char *format,
468 					  int last_document) _CUPS_API_1_4;
469 extern http_status_t	cupsWriteRequestData(http_t *http, const char *buffer,
470 			                     size_t length) _CUPS_API_1_4;
471 
472 /**** New in CUPS 1.5/macOS 10.7 ****/
473 extern void		cupsSetClientCertCB(cups_client_cert_cb_t cb,
474 					    void *user_data) _CUPS_API_1_5;
475 extern int		cupsSetCredentials(cups_array_t *certs) _CUPS_API_1_5;
476 extern void		cupsSetServerCertCB(cups_server_cert_cb_t cb,
477 					    void *user_data) _CUPS_API_1_5;
478 
479 /**** New in CUPS 1.6/macOS 10.8 ****/
480 extern ipp_status_t	cupsCancelDestJob(http_t *http, cups_dest_t *dest,
481 			                  int job_id) _CUPS_API_1_6;
482 extern int		cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
483 					       cups_dinfo_t *info,
484 			                       const char *option,
485 					       const char *value) _CUPS_API_1_6;
486 extern ipp_status_t	cupsCloseDestJob(http_t *http, cups_dest_t *dest,
487 			                 cups_dinfo_t *info, int job_id)
488 			                 _CUPS_API_1_6;
489 extern http_t		*cupsConnectDest(cups_dest_t *dest, unsigned flags,
490 			                 int msec, int *cancel,
491 					 char *resource, size_t resourcesize,
492 					 cups_dest_cb_t cb, void *user_data)
493 					 _CUPS_API_1_6;
494 #  ifdef __BLOCKS__
495 extern http_t		*cupsConnectDestBlock(cups_dest_t *dest,
496 					      unsigned flags, int msec,
497 					      int *cancel, char *resource,
498 					      size_t resourcesize,
499 					      cups_dest_block_t block)
500 					      _CUPS_API_1_6;
501 #  endif /* __BLOCKS__ */
502 extern int		cupsCopyDest(cups_dest_t *dest, int num_dests,
503 			             cups_dest_t **dests) _CUPS_API_1_6;
504 extern cups_dinfo_t	*cupsCopyDestInfo(http_t *http, cups_dest_t *dest)
505 					  _CUPS_API_1_6;
506 extern int		cupsCopyDestConflicts(http_t *http, cups_dest_t *dest,
507 					      cups_dinfo_t *info,
508 					      int num_options,
509 					      cups_option_t *options,
510 					      const char *new_option,
511 					      const char *new_value,
512 					      int *num_conflicts,
513 					      cups_option_t **conflicts,
514 					      int *num_resolved,
515 					      cups_option_t **resolved)
516 					      _CUPS_API_1_6;
517 extern ipp_status_t	cupsCreateDestJob(http_t *http, cups_dest_t *dest,
518 					  cups_dinfo_t *info, int *job_id,
519 					  const char *title, int num_options,
520 			                  cups_option_t *options) _CUPS_API_1_6;
521 extern int		cupsEnumDests(unsigned flags, int msec, int *cancel,
522 				      cups_ptype_t type, cups_ptype_t mask,
523 				      cups_dest_cb_t cb, void *user_data)
524 				      _CUPS_API_1_6;
525 #  ifdef __BLOCKS__
526 extern int		cupsEnumDestsBlock(unsigned flags, int msec,
527 					   int *cancel, cups_ptype_t type,
528 					   cups_ptype_t mask,
529 					   cups_dest_block_t block)
530 					   _CUPS_API_1_6;
531 #  endif /* __BLOCKS__ */
532 extern ipp_status_t	cupsFinishDestDocument(http_t *http,
533 			                       cups_dest_t *dest,
534 			                       cups_dinfo_t *info)
535 			                       _CUPS_API_1_6;
536 extern void		cupsFreeDestInfo(cups_dinfo_t *dinfo) _CUPS_API_1_6;
537 extern int		cupsGetDestMediaByName(http_t *http, cups_dest_t *dest,
538 			                       cups_dinfo_t *dinfo,
539 					       const char *media,
540 					       unsigned flags,
541 					       cups_size_t *size) _CUPS_API_1_6;
542 extern int		cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest,
543 			                       cups_dinfo_t *dinfo,
544 					       int width, int length,
545 					       unsigned flags,
546 					       cups_size_t *size) _CUPS_API_1_6;
547 extern const char	*cupsLocalizeDestOption(http_t *http, cups_dest_t *dest,
548 			                        cups_dinfo_t *info,
549 			                        const char *option)
550 			                        _CUPS_API_1_6;
551 extern const char	*cupsLocalizeDestValue(http_t *http, cups_dest_t *dest,
552 					       cups_dinfo_t *info,
553 					       const char *option,
554 					       const char *value)
555 					       _CUPS_API_1_6;
556 extern http_status_t	cupsStartDestDocument(http_t *http, cups_dest_t *dest,
557 					      cups_dinfo_t *info, int job_id,
558 					      const char *docname,
559 					      const char *format,
560 					      int num_options,
561 					      cups_option_t *options,
562 					      int last_document) _CUPS_API_1_6;
563 
564 /* New in CUPS 1.7 */
565 extern ipp_attribute_t	*cupsFindDestDefault(http_t *http, cups_dest_t *dest,
566 			                     cups_dinfo_t *dinfo,
567 			                     const char *option) _CUPS_API_1_7;
568 extern ipp_attribute_t	*cupsFindDestReady(http_t *http, cups_dest_t *dest,
569 					   cups_dinfo_t *dinfo,
570 					   const char *option) _CUPS_API_1_7;
571 extern ipp_attribute_t	*cupsFindDestSupported(http_t *http, cups_dest_t *dest,
572 			                       cups_dinfo_t *dinfo,
573 			                       const char *option)
574 			                       _CUPS_API_1_7;
575 extern int		cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest,
576 			                        cups_dinfo_t *dinfo, int n,
577 			                        unsigned flags,
578 			                        cups_size_t *size)
579 			                        _CUPS_API_1_7;
580 extern int		cupsGetDestMediaCount(http_t *http, cups_dest_t *dest,
581 			                      cups_dinfo_t *dinfo,
582 			                      unsigned flags) _CUPS_API_1_7;
583 extern int		cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
584 			                        cups_dinfo_t *dinfo,
585 			                        unsigned flags,
586 			                        cups_size_t *size)
587 			                        _CUPS_API_1_7;
588 extern void		cupsSetUserAgent(const char *user_agent) _CUPS_API_1_7;
589 extern const char	*cupsUserAgent(void) _CUPS_API_1_7;
590 
591 /* New in CUPS 2.0/macOS 10.10 */
592 extern cups_dest_t	*cupsGetDestWithURI(const char *name, const char *uri) _CUPS_API_2_0;
593 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;
594 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;
595 extern int		cupsSetServerCredentials(const char *path, const char *common_name, int auto_create) _CUPS_API_2_0;
596 
597 /* New in CUPS 2.2/macOS 10.12 */
598 extern ssize_t		cupsHashData(const char *algorithm, const void *data, size_t datalen, unsigned char *hash, size_t hashsize) _CUPS_API_2_2;
599 
600 /* New in CUPS 2.2.4 */
601 extern int		cupsAddIntegerOption(const char *name, int value, int num_options, cups_option_t **options) _CUPS_API_2_2_4;
602 extern int		cupsGetIntegerOption(const char *name, int num_options, cups_option_t *options) _CUPS_API_2_2_4;
603 
604 /* New in CUPS 2.2.7 */
605 extern const char	*cupsHashString(const unsigned char *hash, size_t hashsize, char *buffer, size_t bufsize) _CUPS_API_2_2_7;
606 
607 /* New in CUPS 2.3 */
608 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;
609 extern ipp_attribute_t	*cupsEncodeOption(ipp_t *ipp, ipp_tag_t group_tag, const char *name, const char *value) _CUPS_API_2_3;
610 
611 /* New in CUPS 2.4 */
612 extern void		cupsSetOAuthCB(cups_oauth_cb_t cb, void *data) _CUPS_API_2_4;
613 
614 
615 #  ifdef __cplusplus
616 }
617 #  endif /* __cplusplus */
618 
619 #endif /* !_CUPS_CUPS_H_ */
620