]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/cups.h
Prepare for 2.2rc1 release.
[thirdparty/cups.git] / cups / cups.h
CommitLineData
ef416fc2 1/*
b4f46ff5 2 * API definitions for CUPS.
ef416fc2 3 *
7ae00c35 4 * Copyright 2007-2016 by Apple Inc.
b4f46ff5 5 * Copyright 1997-2007 by Easy Software Products.
ef416fc2 6 *
b4f46ff5
MS
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 * file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 12 *
b4f46ff5 13 * This file is subject to the Apple OS-Developed Software exception.
ef416fc2 14 */
15
16#ifndef _CUPS_CUPS_H_
17# define _CUPS_CUPS_H_
18
19/*
20 * Include necessary headers...
21 */
22
b86bc4cf 23# include <sys/types.h>
24# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
25# define __CUPS_SSIZE_T_DEFINED
6d2f911b 26# include <stddef.h>
b86bc4cf 27/* Windows does not support the ssize_t type, so map it to off_t... */
28typedef off_t ssize_t; /* @private@ */
29# endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
30
aaf19ab0 31# include "file.h"
ef416fc2 32# include "ipp.h"
fa73b229 33# include "language.h"
6961465f 34# include "pwg.h"
fa73b229 35
ef416fc2 36
ef416fc2 37/*
38 * C++ magic...
39 */
40
41# ifdef __cplusplus
42extern "C" {
43# endif /* __cplusplus */
44
45
46/*
47 * Constants...
48 */
49
d0e96b4a 50# define CUPS_VERSION 2.0200
621ca63a 51# define CUPS_VERSION_MAJOR 2
d0e96b4a
MS
52# define CUPS_VERSION_MINOR 2
53# define CUPS_VERSION_PATCH 0
dcb445bc
MS
54
55# define CUPS_BC_FD 3
56 /* Back-channel file descriptor for
57 * select/poll */
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
76
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 not 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
90 * resolved */
91# define CUPS_DEST_FLAGS_CONNECTING 0x20
92 /* A connection is being established */
93# define CUPS_DEST_FLAGS_CANCELED 0x40
94 /* Operation was canceled */
95
96/* Flags for cupsGetDestMediaByName/Size */
97# define CUPS_MEDIA_FLAGS_DEFAULT 0x00
98 /* Find the closest size supported by
99 * the printer */
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
104 * printing */
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
110 * "ready" media. */
111
112/* Options and values */
113# define CUPS_COPIES "copies"
114# define CUPS_COPIES_SUPPORTED "copies-supported"
115
116# define CUPS_FINISHINGS "finishings"
117# define CUPS_FINISHINGS_SUPPORTED "finishings-supported"
118
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"
126
127# define CUPS_MEDIA "media"
128# define CUPS_MEDIA_READY "media-ready"
129# define CUPS_MEDIA_SUPPORTED "media-supported"
130
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"
146
147# define CUPS_MEDIA_SOURCE "media-source"
148# define CUPS_MEDIA_SOURCE_SUPPORTED "media-source-supported"
149
150# define CUPS_MEDIA_SOURCE_AUTO "auto"
151# define CUPS_MEDIA_SOURCE_MANUAL "manual"
152
153# define CUPS_MEDIA_TYPE "media-type"
154# define CUPS_MEDIA_TYPE_SUPPORTED "media-type-supported"
155
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"
165
166# define CUPS_NUMBER_UP "number-up"
167# define CUPS_NUMBER_UP_SUPPORTED "number-up-supported"
168
169# define CUPS_ORIENTATION "orientation-requested"
170# define CUPS_ORIENTATION_SUPPORTED "orientation-requested-supported"
171
172# define CUPS_ORIENTATION_PORTRAIT "3"
173# define CUPS_ORIENTATION_LANDSCAPE "4"
174
175# define CUPS_PRINT_COLOR_MODE "print-color-mode"
176# define CUPS_PRINT_COLOR_MODE_SUPPORTED "print-color-mode-supported"
177
178# define CUPS_PRINT_COLOR_MODE_AUTO "auto"
179# define CUPS_PRINT_COLOR_MODE_MONOCHROME "monochrome"
180# define CUPS_PRINT_COLOR_MODE_COLOR "color"
181
182# define CUPS_PRINT_QUALITY "print-quality"
183# define CUPS_PRINT_QUALITY_SUPPORTED "print-quality-supported"
184
185# define CUPS_PRINT_QUALITY_DRAFT "3"
186# define CUPS_PRINT_QUALITY_NORMAL "4"
187# define CUPS_PRINT_QUALITY_HIGH "5"
188
189# define CUPS_SIDES "sides"
190# define CUPS_SIDES_SUPPORTED "sides-supported"
191
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"
ef416fc2 195
196
197/*
198 * Types and structures...
199 */
200
dcb445bc
MS
201typedef unsigned cups_ptype_t; /* Printer type/capability bits */
202enum cups_ptype_e /* Printer type/capability bit
203 * constants */
5a738aea 204{ /* Not a typedef'd enum so we can OR */
ef416fc2 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 duplexing */
211 CUPS_PRINTER_STAPLE = 0x0020, /* Can staple output */
212 CUPS_PRINTER_COPIES = 0x0040, /* Can do copies */
213 CUPS_PRINTER_COLLATE = 0x0080, /* Can collage 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 do Letter/Legal/A4 */
219 CUPS_PRINTER_MEDIUM = 0x2000, /* Can do Tabloid/B/C/A3/A2 */
220 CUPS_PRINTER_LARGE = 0x4000, /* Can do D/E/A1/A0 */
221 CUPS_PRINTER_VARIABLE = 0x8000, /* Can do variable sizes */
dcb445bc
MS
222 CUPS_PRINTER_IMPLICIT = 0x10000, /* Implicit class @private@
223 * @since Deprecated@ */
ef416fc2 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 */
dcb445bc 227 CUPS_PRINTER_DELETE = 0x100000, /* Delete printer
8072030b 228 * @since CUPS 1.2/macOS 10.5@ */
dcb445bc 229 CUPS_PRINTER_NOT_SHARED = 0x200000, /* Printer is not shared
8072030b 230 * @since CUPS 1.2/macOS 10.5@ */
dcb445bc 231 CUPS_PRINTER_AUTHENTICATED = 0x400000,/* Printer requires authentication
8072030b 232 * @since CUPS 1.2/macOS 10.5@ */
dcb445bc 233 CUPS_PRINTER_COMMANDS = 0x800000, /* Printer supports maintenance commands
8072030b 234 * @since CUPS 1.2/macOS 10.5@ */
dcb445bc
MS
235 CUPS_PRINTER_DISCOVERED = 0x1000000, /* Printer was automatically discovered
236 * and added @private@
237 * @since Deprecated@ */
238 CUPS_PRINTER_SCANNER = 0x2000000, /* Scanner-only device
8072030b 239 * @since CUPS 1.4/macOS 10.6@ */
dcb445bc 240 CUPS_PRINTER_MFP = 0x4000000, /* Printer with scanning capabilities
8072030b 241 * @since CUPS 1.4/macOS 10.6@ */
7ae00c35 242 CUPS_PRINTER_3D = 0x8000000, /* Printer with 3D capabilities @since CUPS 2.1@ */
dcb445bc
MS
243 CUPS_PRINTER_OPTIONS = 0x6fffc /* ~(CLASS | REMOTE | IMPLICIT |
244 * DEFAULT | FAX | REJECTING | DELETE |
245 * NOT_SHARED | AUTHENTICATED |
246 * COMMANDS | DISCOVERED) @private@ */
ef416fc2 247};
248
ef416fc2 249typedef struct cups_option_s /**** Printer Options ****/
250{
251 char *name; /* Name of option */
252 char *value; /* Value of option */
253} cups_option_t;
254
255typedef struct cups_dest_s /**** Destination ****/
256{
257 char *name, /* Printer or class name */
258 *instance; /* Local instance name or NULL */
259 int is_default; /* Is this printer the default? */
260 int num_options; /* Number of options */
261 cups_option_t *options; /* Options */
262} cups_dest_t;
263
dcb445bc
MS
264typedef struct _cups_dinfo_s cups_dinfo_t;
265 /* Destination capability and status
8072030b 266 * information @since CUPS 1.6/macOS 10.8@ */
dcb445bc 267
ef416fc2 268typedef struct cups_job_s /**** Job ****/
269{
270 int id; /* The job ID */
ecdc0628 271 char *dest; /* Printer or class name */
272 char *title; /* Title/job name */
273 char *user; /* User the submitted the job */
274 char *format; /* Document format */
ef416fc2 275 ipp_jstate_t state; /* Job state */
ecdc0628 276 int size; /* Size in kilobytes */
277 int priority; /* Priority (1-100) */
278 time_t completed_time; /* Time the job was completed */
279 time_t creation_time; /* Time the job was created */
280 time_t processing_time; /* Time the job was processed */
ef416fc2 281} cups_job_t;
282
8072030b 283typedef struct cups_size_s /**** Media Size @since CUPS 1.6/macOS 10.8@ ****/
dcb445bc
MS
284{
285 char media[128]; /* Media name to use */
286 int width, /* Width in hundredths of millimeters */
287 length, /* Length in hundredths of
288 * millimeters */
289 bottom, /* Bottom margin in hundredths of
290 * millimeters */
291 left, /* Left margin in hundredths of
292 * millimeters */
293 right, /* Right margin in hundredths of
294 * millimeters */
295 top; /* Top margin in hundredths of
296 * millimeters */
297} cups_size_t;
298
7cf5915e 299typedef int (*cups_client_cert_cb_t)(http_t *http, void *tls,
321d8d57 300 cups_array_t *distinguished_names,
7cf5915e 301 void *user_data);
dcb445bc 302 /* Client credentials callback
8072030b 303 * @since CUPS 1.5/macOS 10.7@ */
7cf5915e 304
dcb445bc
MS
305typedef int (*cups_dest_cb_t)(void *user_data, unsigned flags,
306 cups_dest_t *dest);
307 /* Destination enumeration callback
8072030b 308 * @since CUPS 1.6/macOS 10.8@ */
9c80ffa2
MS
309
310# ifdef __BLOCKS__
dcb445bc
MS
311typedef int (^cups_dest_block_t)(unsigned flags, cups_dest_t *dest);
312 /* Destination enumeration block
8072030b 313 * @since CUPS 1.6/macOS 10.8@ */
9c80ffa2
MS
314# endif /* __BLOCKS__ */
315
9c80ffa2 316typedef const char *(*cups_password_cb_t)(const char *prompt);
dcb445bc 317 /* Password callback */
9c80ffa2
MS
318
319typedef const char *(*cups_password_cb2_t)(const char *prompt, http_t *http,
320 const char *method,
321 const char *resource,
322 void *user_data);
dcb445bc 323 /* New password callback
8072030b 324 * @since CUPS 1.4/macOS 10.6@ */
9c80ffa2 325
7cf5915e
MS
326typedef int (*cups_server_cert_cb_t)(http_t *http, void *tls,
327 cups_array_t *certs, void *user_data);
dcb445bc 328 /* Server credentials callback
8072030b 329 * @since CUPS 1.5/macOS 10.7@ */
7cf5915e 330
ef416fc2 331
332/*
333 * Functions...
334 */
335
3d052e43 336extern int cupsCancelJob(const char *name, int job_id);
ef416fc2 337extern ipp_t *cupsDoFileRequest(http_t *http, ipp_t *request,
ecdc0628 338 const char *resource,
339 const char *filename);
340extern ipp_t *cupsDoRequest(http_t *http, ipp_t *request,
341 const char *resource);
ef416fc2 342extern http_encryption_t cupsEncryption(void);
343extern void cupsFreeJobs(int num_jobs, cups_job_t *jobs);
a469f8a5 344extern int cupsGetClasses(char ***classes) _CUPS_DEPRECATED_MSG("Use cupsGetDests instead.");
ef416fc2 345extern const char *cupsGetDefault(void);
5a738aea
MS
346extern int cupsGetJobs(cups_job_t **jobs, const char *name,
347 int myjobs, int whichjobs);
a469f8a5 348extern int cupsGetPrinters(char ***printers) _CUPS_DEPRECATED_MSG("Use cupsGetDests instead.");
ef416fc2 349extern ipp_status_t cupsLastError(void);
3d052e43 350extern int cupsPrintFile(const char *name, const char *filename,
ef416fc2 351 const char *title, int num_options,
352 cups_option_t *options);
3d052e43 353extern int cupsPrintFiles(const char *name, int num_files,
ef416fc2 354 const char **files, const char *title,
355 int num_options, cups_option_t *options);
a469f8a5 356extern char *cupsTempFile(char *filename, int len) _CUPS_DEPRECATED_MSG("Use cupsTempFd or cupsTempFile2 instead.");
ef416fc2 357extern int cupsTempFd(char *filename, int len);
358
359extern int cupsAddDest(const char *name, const char *instance,
360 int num_dests, cups_dest_t **dests);
361extern void cupsFreeDests(int num_dests, cups_dest_t *dests);
362extern cups_dest_t *cupsGetDest(const char *name, const char *instance,
363 int num_dests, cups_dest_t *dests);
364extern int cupsGetDests(cups_dest_t **dests);
365extern void cupsSetDests(int num_dests, cups_dest_t *dests);
366
367extern int cupsAddOption(const char *name, const char *value,
368 int num_options, cups_option_t **options);
369extern void cupsEncodeOptions(ipp_t *ipp, int num_options,
370 cups_option_t *options);
dcb445bc
MS
371extern void cupsFreeOptions(int num_options,
372 cups_option_t *options);
ef416fc2 373extern const char *cupsGetOption(const char *name, int num_options,
374 cups_option_t *options);
b423cd4c 375extern int cupsParseOptions(const char *arg, int num_options,
376 cups_option_t **options);
ef416fc2 377
378extern const char *cupsGetPassword(const char *prompt);
379extern const char *cupsServer(void);
380extern void cupsSetEncryption(http_encryption_t e);
381extern void cupsSetPasswordCB(cups_password_cb_t cb);
382extern void cupsSetServer(const char *server);
383extern void cupsSetUser(const char *user);
384extern const char *cupsUser(void);
385
386/**** New in CUPS 1.1.20 ****/
387extern int cupsDoAuthentication(http_t *http, const char *method,
dcb445bc
MS
388 const char *resource)
389 _CUPS_API_1_1_20;
ef416fc2 390extern http_status_t cupsGetFile(http_t *http, const char *resource,
2fb76298 391 const char *filename) _CUPS_API_1_1_20;
ef416fc2 392extern http_status_t cupsGetFd(http_t *http, const char *resource, int fd);
393extern http_status_t cupsPutFile(http_t *http, const char *resource,
2fb76298 394 const char *filename) _CUPS_API_1_1_20;
dcb445bc
MS
395extern http_status_t cupsPutFd(http_t *http, const char *resource, int fd)
396 _CUPS_API_1_1_20;
ef416fc2 397
398/**** New in CUPS 1.1.21 ****/
2fb76298 399extern const char *cupsGetDefault2(http_t *http) _CUPS_API_1_1_21;
dcb445bc
MS
400extern int cupsGetDests2(http_t *http, cups_dest_t **dests)
401 _CUPS_API_1_1_21;
ef416fc2 402extern int cupsGetJobs2(http_t *http, cups_job_t **jobs,
3d052e43 403 const char *name, int myjobs,
5a738aea 404 int whichjobs) _CUPS_API_1_1_21;
3d052e43 405extern int cupsPrintFile2(http_t *http, const char *name,
ef416fc2 406 const char *filename,
407 const char *title, int num_options,
2fb76298 408 cups_option_t *options) _CUPS_API_1_1_21;
3d052e43 409extern int cupsPrintFiles2(http_t *http, const char *name,
ef416fc2 410 int num_files, const char **files,
411 const char *title, int num_options,
dcb445bc
MS
412 cups_option_t *options)
413 _CUPS_API_1_1_21;
ef416fc2 414extern int cupsSetDests2(http_t *http, int num_dests,
2fb76298 415 cups_dest_t *dests) _CUPS_API_1_1_21;
ef416fc2 416
8072030b 417/**** New in CUPS 1.2/macOS 10.5 ****/
ecdc0628 418extern ssize_t cupsBackChannelRead(char *buffer, size_t bytes,
2fb76298 419 double timeout) _CUPS_API_1_2;
ecdc0628 420extern ssize_t cupsBackChannelWrite(const char *buffer, size_t bytes,
2fb76298 421 double timeout) _CUPS_API_1_2;
ef416fc2 422extern void cupsEncodeOptions2(ipp_t *ipp, int num_options,
423 cups_option_t *options,
2fb76298
MS
424 ipp_tag_t group_tag) _CUPS_API_1_2;
425extern const char *cupsLastErrorString(void) _CUPS_API_1_2;
dcb445bc
MS
426extern char *cupsNotifySubject(cups_lang_t *lang, ipp_t *event)
427 _CUPS_API_1_2;
428extern char *cupsNotifyText(cups_lang_t *lang, ipp_t *event)
429 _CUPS_API_1_2;
b423cd4c 430extern int cupsRemoveOption(const char *name, int num_options,
2fb76298
MS
431 cups_option_t **options) _CUPS_API_1_2;
432extern cups_file_t *cupsTempFile2(char *filename, int len) _CUPS_API_1_2;
ef416fc2 433
8072030b 434/**** New in CUPS 1.3/macOS 10.5 ****/
b94498cf 435extern ipp_t *cupsDoIORequest(http_t *http, ipp_t *request,
436 const char *resource, int infile,
2fb76298 437 int outfile) _CUPS_API_1_3;
f7deaa1a 438extern int cupsRemoveDest(const char *name,
439 const char *instance,
dcb445bc
MS
440 int num_dests, cups_dest_t **dests)
441 _CUPS_API_1_3;
f7deaa1a 442extern void cupsSetDefaultDest(const char *name,
443 const char *instance,
444 int num_dests,
2fb76298 445 cups_dest_t *dests) _CUPS_API_1_3;
f7deaa1a 446
8072030b 447/**** New in CUPS 1.4/macOS 10.6 ****/
5a738aea
MS
448extern ipp_status_t cupsCancelJob2(http_t *http, const char *name,
449 int job_id, int purge) _CUPS_API_1_4;
3d052e43
MS
450extern int cupsCreateJob(http_t *http, const char *name,
451 const char *title, int num_options,
452 cups_option_t *options) _CUPS_API_1_4;
453extern ipp_status_t cupsFinishDocument(http_t *http,
454 const char *name) _CUPS_API_1_4;
a4924f6c
MS
455extern cups_dest_t *cupsGetNamedDest(http_t *http, const char *name,
456 const char *instance) _CUPS_API_1_4;
f11a948a
MS
457extern const char *cupsGetPassword2(const char *prompt, http_t *http,
458 const char *method,
459 const char *resource) _CUPS_API_1_4;
3d052e43
MS
460extern ipp_t *cupsGetResponse(http_t *http,
461 const char *resource) _CUPS_API_1_4;
462extern ssize_t cupsReadResponseData(http_t *http, char *buffer,
463 size_t length) _CUPS_API_1_4;
464extern http_status_t cupsSendRequest(http_t *http, ipp_t *request,
465 const char *resource,
466 size_t length) _CUPS_API_1_4;
f11a948a
MS
467extern void cupsSetPasswordCB2(cups_password_cb2_t cb,
468 void *user_data) _CUPS_API_1_4;
3d052e43
MS
469extern http_status_t cupsStartDocument(http_t *http, const char *name,
470 int job_id, const char *docname,
471 const char *format,
472 int last_document) _CUPS_API_1_4;
473extern http_status_t cupsWriteRequestData(http_t *http, const char *buffer,
474 size_t length) _CUPS_API_1_4;
ef416fc2 475
8072030b 476/**** New in CUPS 1.5/macOS 10.7 ****/
7cf5915e
MS
477extern void cupsSetClientCertCB(cups_client_cert_cb_t cb,
478 void *user_data) _CUPS_API_1_5;
479extern int cupsSetCredentials(cups_array_t *certs) _CUPS_API_1_5;
480extern void cupsSetServerCertCB(cups_server_cert_cb_t cb,
481 void *user_data) _CUPS_API_1_5;
482
8072030b 483/**** New in CUPS 1.6/macOS 10.8 ****/
dcb445bc
MS
484extern ipp_status_t cupsCancelDestJob(http_t *http, cups_dest_t *dest,
485 int job_id) _CUPS_API_1_6;
486extern int cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
487 cups_dinfo_t *info,
488 const char *option,
489 const char *value) _CUPS_API_1_6;
490extern ipp_status_t cupsCloseDestJob(http_t *http, cups_dest_t *dest,
82cc1f9a
MS
491 cups_dinfo_t *info, int job_id)
492 _CUPS_API_1_6;
dcb445bc
MS
493extern http_t *cupsConnectDest(cups_dest_t *dest, unsigned flags,
494 int msec, int *cancel,
495 char *resource, size_t resourcesize,
496 cups_dest_cb_t cb, void *user_data)
497 _CUPS_API_1_6;
498# ifdef __BLOCKS__
499extern http_t *cupsConnectDestBlock(cups_dest_t *dest,
500 unsigned flags, int msec,
501 int *cancel, char *resource,
502 size_t resourcesize,
503 cups_dest_block_t block)
504 _CUPS_API_1_6;
505# endif /* __BLOCKS__ */
506extern int cupsCopyDest(cups_dest_t *dest, int num_dests,
507 cups_dest_t **dests) _CUPS_API_1_6;
508extern cups_dinfo_t *cupsCopyDestInfo(http_t *http, cups_dest_t *dest)
509 _CUPS_API_1_6;
510extern int cupsCopyDestConflicts(http_t *http, cups_dest_t *dest,
511 cups_dinfo_t *info,
512 int num_options,
513 cups_option_t *options,
514 const char *new_option,
515 const char *new_value,
516 int *num_conflicts,
517 cups_option_t **conflicts,
518 int *num_resolved,
519 cups_option_t **resolved)
520 _CUPS_API_1_6;
521extern ipp_status_t cupsCreateDestJob(http_t *http, cups_dest_t *dest,
522 cups_dinfo_t *info, int *job_id,
523 const char *title, int num_options,
524 cups_option_t *options) _CUPS_API_1_6;
525extern int cupsEnumDests(unsigned flags, int msec, int *cancel,
526 cups_ptype_t type, cups_ptype_t mask,
527 cups_dest_cb_t cb, void *user_data)
528 _CUPS_API_1_6;
9c80ffa2 529# ifdef __BLOCKS__
dcb445bc
MS
530extern int cupsEnumDestsBlock(unsigned flags, int msec,
531 int *cancel, cups_ptype_t type,
532 cups_ptype_t mask,
533 cups_dest_block_t block)
534 _CUPS_API_1_6;
9c80ffa2 535# endif /* __BLOCKS__ */
dcb445bc 536extern ipp_status_t cupsFinishDestDocument(http_t *http,
82cc1f9a
MS
537 cups_dest_t *dest,
538 cups_dinfo_t *info)
539 _CUPS_API_1_6;
dcb445bc
MS
540extern void cupsFreeDestInfo(cups_dinfo_t *dinfo) _CUPS_API_1_6;
541extern int cupsGetDestMediaByName(http_t *http, cups_dest_t *dest,
542 cups_dinfo_t *dinfo,
543 const char *media,
544 unsigned flags,
545 cups_size_t *size) _CUPS_API_1_6;
546extern int cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest,
547 cups_dinfo_t *dinfo,
548 int width, int length,
549 unsigned flags,
550 cups_size_t *size) _CUPS_API_1_6;
551extern const char *cupsLocalizeDestOption(http_t *http, cups_dest_t *dest,
552 cups_dinfo_t *info,
553 const char *option)
554 _CUPS_API_1_6;
555extern const char *cupsLocalizeDestValue(http_t *http, cups_dest_t *dest,
556 cups_dinfo_t *info,
557 const char *option,
558 const char *value)
559 _CUPS_API_1_6;
560extern http_status_t cupsStartDestDocument(http_t *http, cups_dest_t *dest,
561 cups_dinfo_t *info, int job_id,
562 const char *docname,
563 const char *format,
564 int num_options,
565 cups_option_t *options,
566 int last_document) _CUPS_API_1_6;
7cf5915e 567
db8b865d 568/* New in CUPS 1.7 */
6961465f
MS
569extern ipp_attribute_t *cupsFindDestDefault(http_t *http, cups_dest_t *dest,
570 cups_dinfo_t *dinfo,
571 const char *option) _CUPS_API_1_7;
572extern ipp_attribute_t *cupsFindDestReady(http_t *http, cups_dest_t *dest,
573 cups_dinfo_t *dinfo,
574 const char *option) _CUPS_API_1_7;
575extern ipp_attribute_t *cupsFindDestSupported(http_t *http, cups_dest_t *dest,
576 cups_dinfo_t *dinfo,
577 const char *option)
578 _CUPS_API_1_7;
579extern int cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest,
580 cups_dinfo_t *dinfo, int n,
581 unsigned flags,
582 cups_size_t *size)
583 _CUPS_API_1_7;
7ae00c35 584extern int cupsGetDestMediaCount(http_t *http, cups_dest_t *dest,
6961465f
MS
585 cups_dinfo_t *dinfo,
586 unsigned flags) _CUPS_API_1_7;
587extern int cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
588 cups_dinfo_t *dinfo,
589 unsigned flags,
590 cups_size_t *size)
591 _CUPS_API_1_7;
db8b865d
MS
592extern void cupsSetUserAgent(const char *user_agent) _CUPS_API_1_7;
593extern const char *cupsUserAgent(void) _CUPS_API_1_7;
594
8072030b 595/* New in CUPS 2.0/macOS 10.10 */
104fd4ae
MS
596extern cups_dest_t *cupsGetDestWithURI(const char *name, const char *uri) _CUPS_API_2_0;
597extern 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
598extern 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;
599extern int cupsSetServerCredentials(const char *path, const char *common_name, int auto_create) _CUPS_API_2_0;
db8b865d 600
b2e6c325 601/* New in CUPS 2.2/macOS 10.12 */
5ae9fbb3
MS
602extern ssize_t cupsHashData(const char *algorithm, const void *data, size_t datalen, unsigned char *hash, size_t hashsize) _CUPS_API_2_2;
603
ef416fc2 604# ifdef __cplusplus
605}
606# endif /* __cplusplus */
607
608#endif /* !_CUPS_CUPS_H_ */