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