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