]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/cups.h
Remove all of the Subversion keywords from various source files.
[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
f3c17241 228 * @since CUPS 1.2/OS X 10.5@ */
dcb445bc 229 CUPS_PRINTER_NOT_SHARED = 0x200000, /* Printer is not shared
f3c17241 230 * @since CUPS 1.2/OS X 10.5@ */
dcb445bc 231 CUPS_PRINTER_AUTHENTICATED = 0x400000,/* Printer requires authentication
f3c17241 232 * @since CUPS 1.2/OS X 10.5@ */
dcb445bc 233 CUPS_PRINTER_COMMANDS = 0x800000, /* Printer supports maintenance commands
f3c17241 234 * @since CUPS 1.2/OS X 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
f3c17241 239 * @since CUPS 1.4/OS X 10.6@ */
dcb445bc 240 CUPS_PRINTER_MFP = 0x4000000, /* Printer with scanning capabilities
f3c17241 241 * @since CUPS 1.4/OS X 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
f3c17241 266 * information @since CUPS 1.6/OS X 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
f3c17241 283typedef struct cups_size_s /**** Media Size @since CUPS 1.6/OS X 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
f3c17241 303 * @since CUPS 1.5/OS X 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
f3c17241 308 * @since CUPS 1.6/OS X 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
f3c17241 313 * @since CUPS 1.6/OS X 10.8@ */
9c80ffa2
MS
314# endif /* __BLOCKS__ */
315
316typedef void (*cups_device_cb_t)(const char *device_class,
317 const char *device_id, const char *device_info,
318 const char *device_make_and_model,
319 const char *device_uri,
320 const char *device_location, void *user_data);
dcb445bc 321 /* Device callback
f3c17241 322 * @since CUPS 1.4/OS X 10.6@ */
9c80ffa2
MS
323
324typedef const char *(*cups_password_cb_t)(const char *prompt);
dcb445bc 325 /* Password callback */
9c80ffa2
MS
326
327typedef const char *(*cups_password_cb2_t)(const char *prompt, http_t *http,
328 const char *method,
329 const char *resource,
330 void *user_data);
dcb445bc 331 /* New password callback
f3c17241 332 * @since CUPS 1.4/OS X 10.6@ */
9c80ffa2 333
7cf5915e
MS
334typedef int (*cups_server_cert_cb_t)(http_t *http, void *tls,
335 cups_array_t *certs, void *user_data);
dcb445bc 336 /* Server credentials callback
f3c17241 337 * @since CUPS 1.5/OS X 10.7@ */
7cf5915e 338
ef416fc2 339
340/*
341 * Functions...
342 */
343
3d052e43 344extern int cupsCancelJob(const char *name, int job_id);
ef416fc2 345extern ipp_t *cupsDoFileRequest(http_t *http, ipp_t *request,
ecdc0628 346 const char *resource,
347 const char *filename);
348extern ipp_t *cupsDoRequest(http_t *http, ipp_t *request,
349 const char *resource);
ef416fc2 350extern http_encryption_t cupsEncryption(void);
351extern void cupsFreeJobs(int num_jobs, cups_job_t *jobs);
a469f8a5 352extern int cupsGetClasses(char ***classes) _CUPS_DEPRECATED_MSG("Use cupsGetDests instead.");
ef416fc2 353extern const char *cupsGetDefault(void);
5a738aea
MS
354extern int cupsGetJobs(cups_job_t **jobs, const char *name,
355 int myjobs, int whichjobs);
a469f8a5 356extern int cupsGetPrinters(char ***printers) _CUPS_DEPRECATED_MSG("Use cupsGetDests instead.");
ef416fc2 357extern ipp_status_t cupsLastError(void);
3d052e43 358extern int cupsPrintFile(const char *name, const char *filename,
ef416fc2 359 const char *title, int num_options,
360 cups_option_t *options);
3d052e43 361extern int cupsPrintFiles(const char *name, int num_files,
ef416fc2 362 const char **files, const char *title,
363 int num_options, cups_option_t *options);
a469f8a5 364extern char *cupsTempFile(char *filename, int len) _CUPS_DEPRECATED_MSG("Use cupsTempFd or cupsTempFile2 instead.");
ef416fc2 365extern int cupsTempFd(char *filename, int len);
366
367extern int cupsAddDest(const char *name, const char *instance,
368 int num_dests, cups_dest_t **dests);
369extern void cupsFreeDests(int num_dests, cups_dest_t *dests);
370extern cups_dest_t *cupsGetDest(const char *name, const char *instance,
371 int num_dests, cups_dest_t *dests);
372extern int cupsGetDests(cups_dest_t **dests);
373extern void cupsSetDests(int num_dests, cups_dest_t *dests);
374
375extern int cupsAddOption(const char *name, const char *value,
376 int num_options, cups_option_t **options);
377extern void cupsEncodeOptions(ipp_t *ipp, int num_options,
378 cups_option_t *options);
dcb445bc
MS
379extern void cupsFreeOptions(int num_options,
380 cups_option_t *options);
ef416fc2 381extern const char *cupsGetOption(const char *name, int num_options,
382 cups_option_t *options);
b423cd4c 383extern int cupsParseOptions(const char *arg, int num_options,
384 cups_option_t **options);
ef416fc2 385
386extern const char *cupsGetPassword(const char *prompt);
387extern const char *cupsServer(void);
388extern void cupsSetEncryption(http_encryption_t e);
389extern void cupsSetPasswordCB(cups_password_cb_t cb);
390extern void cupsSetServer(const char *server);
391extern void cupsSetUser(const char *user);
392extern const char *cupsUser(void);
393
394/**** New in CUPS 1.1.20 ****/
395extern int cupsDoAuthentication(http_t *http, const char *method,
dcb445bc
MS
396 const char *resource)
397 _CUPS_API_1_1_20;
ef416fc2 398extern http_status_t cupsGetFile(http_t *http, const char *resource,
2fb76298 399 const char *filename) _CUPS_API_1_1_20;
ef416fc2 400extern http_status_t cupsGetFd(http_t *http, const char *resource, int fd);
401extern http_status_t cupsPutFile(http_t *http, const char *resource,
2fb76298 402 const char *filename) _CUPS_API_1_1_20;
dcb445bc
MS
403extern http_status_t cupsPutFd(http_t *http, const char *resource, int fd)
404 _CUPS_API_1_1_20;
ef416fc2 405
406/**** New in CUPS 1.1.21 ****/
2fb76298 407extern const char *cupsGetDefault2(http_t *http) _CUPS_API_1_1_21;
dcb445bc
MS
408extern int cupsGetDests2(http_t *http, cups_dest_t **dests)
409 _CUPS_API_1_1_21;
ef416fc2 410extern int cupsGetJobs2(http_t *http, cups_job_t **jobs,
3d052e43 411 const char *name, int myjobs,
5a738aea 412 int whichjobs) _CUPS_API_1_1_21;
3d052e43 413extern int cupsPrintFile2(http_t *http, const char *name,
ef416fc2 414 const char *filename,
415 const char *title, int num_options,
2fb76298 416 cups_option_t *options) _CUPS_API_1_1_21;
3d052e43 417extern int cupsPrintFiles2(http_t *http, const char *name,
ef416fc2 418 int num_files, const char **files,
419 const char *title, int num_options,
dcb445bc
MS
420 cups_option_t *options)
421 _CUPS_API_1_1_21;
ef416fc2 422extern int cupsSetDests2(http_t *http, int num_dests,
2fb76298 423 cups_dest_t *dests) _CUPS_API_1_1_21;
ef416fc2 424
f3c17241 425/**** New in CUPS 1.2/OS X 10.5 ****/
ecdc0628 426extern ssize_t cupsBackChannelRead(char *buffer, size_t bytes,
2fb76298 427 double timeout) _CUPS_API_1_2;
ecdc0628 428extern ssize_t cupsBackChannelWrite(const char *buffer, size_t bytes,
2fb76298 429 double timeout) _CUPS_API_1_2;
ef416fc2 430extern void cupsEncodeOptions2(ipp_t *ipp, int num_options,
431 cups_option_t *options,
2fb76298
MS
432 ipp_tag_t group_tag) _CUPS_API_1_2;
433extern const char *cupsLastErrorString(void) _CUPS_API_1_2;
dcb445bc
MS
434extern char *cupsNotifySubject(cups_lang_t *lang, ipp_t *event)
435 _CUPS_API_1_2;
436extern char *cupsNotifyText(cups_lang_t *lang, ipp_t *event)
437 _CUPS_API_1_2;
b423cd4c 438extern int cupsRemoveOption(const char *name, int num_options,
2fb76298
MS
439 cups_option_t **options) _CUPS_API_1_2;
440extern cups_file_t *cupsTempFile2(char *filename, int len) _CUPS_API_1_2;
ef416fc2 441
f3c17241 442/**** New in CUPS 1.3/OS X 10.5 ****/
b94498cf 443extern ipp_t *cupsDoIORequest(http_t *http, ipp_t *request,
444 const char *resource, int infile,
2fb76298 445 int outfile) _CUPS_API_1_3;
f7deaa1a 446extern int cupsRemoveDest(const char *name,
447 const char *instance,
dcb445bc
MS
448 int num_dests, cups_dest_t **dests)
449 _CUPS_API_1_3;
f7deaa1a 450extern void cupsSetDefaultDest(const char *name,
451 const char *instance,
452 int num_dests,
2fb76298 453 cups_dest_t *dests) _CUPS_API_1_3;
f7deaa1a 454
f3c17241 455/**** New in CUPS 1.4/OS X 10.6 ****/
5a738aea
MS
456extern ipp_status_t cupsCancelJob2(http_t *http, const char *name,
457 int job_id, int purge) _CUPS_API_1_4;
3d052e43
MS
458extern int cupsCreateJob(http_t *http, const char *name,
459 const char *title, int num_options,
460 cups_option_t *options) _CUPS_API_1_4;
461extern ipp_status_t cupsFinishDocument(http_t *http,
462 const char *name) _CUPS_API_1_4;
ae71f5de 463extern ipp_status_t cupsGetDevices(http_t *http, int timeout,
ed6e7faf 464 const char *include_schemes,
38e73f87 465 const char *exclude_schemes,
ae71f5de
MS
466 cups_device_cb_t callback,
467 void *user_data) _CUPS_API_1_4;
a4924f6c
MS
468extern cups_dest_t *cupsGetNamedDest(http_t *http, const char *name,
469 const char *instance) _CUPS_API_1_4;
f11a948a
MS
470extern const char *cupsGetPassword2(const char *prompt, http_t *http,
471 const char *method,
472 const char *resource) _CUPS_API_1_4;
3d052e43
MS
473extern ipp_t *cupsGetResponse(http_t *http,
474 const char *resource) _CUPS_API_1_4;
475extern ssize_t cupsReadResponseData(http_t *http, char *buffer,
476 size_t length) _CUPS_API_1_4;
477extern http_status_t cupsSendRequest(http_t *http, ipp_t *request,
478 const char *resource,
479 size_t length) _CUPS_API_1_4;
f11a948a
MS
480extern void cupsSetPasswordCB2(cups_password_cb2_t cb,
481 void *user_data) _CUPS_API_1_4;
3d052e43
MS
482extern http_status_t cupsStartDocument(http_t *http, const char *name,
483 int job_id, const char *docname,
484 const char *format,
485 int last_document) _CUPS_API_1_4;
486extern http_status_t cupsWriteRequestData(http_t *http, const char *buffer,
487 size_t length) _CUPS_API_1_4;
ef416fc2 488
f3c17241 489/**** New in CUPS 1.5/OS X 10.7 ****/
7cf5915e
MS
490extern void cupsSetClientCertCB(cups_client_cert_cb_t cb,
491 void *user_data) _CUPS_API_1_5;
492extern int cupsSetCredentials(cups_array_t *certs) _CUPS_API_1_5;
493extern void cupsSetServerCertCB(cups_server_cert_cb_t cb,
494 void *user_data) _CUPS_API_1_5;
495
f3c17241 496/**** New in CUPS 1.6/OS X 10.8 ****/
dcb445bc
MS
497extern ipp_status_t cupsCancelDestJob(http_t *http, cups_dest_t *dest,
498 int job_id) _CUPS_API_1_6;
499extern int cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
500 cups_dinfo_t *info,
501 const char *option,
502 const char *value) _CUPS_API_1_6;
503extern ipp_status_t cupsCloseDestJob(http_t *http, cups_dest_t *dest,
82cc1f9a
MS
504 cups_dinfo_t *info, int job_id)
505 _CUPS_API_1_6;
dcb445bc
MS
506extern http_t *cupsConnectDest(cups_dest_t *dest, unsigned flags,
507 int msec, int *cancel,
508 char *resource, size_t resourcesize,
509 cups_dest_cb_t cb, void *user_data)
510 _CUPS_API_1_6;
511# ifdef __BLOCKS__
512extern http_t *cupsConnectDestBlock(cups_dest_t *dest,
513 unsigned flags, int msec,
514 int *cancel, char *resource,
515 size_t resourcesize,
516 cups_dest_block_t block)
517 _CUPS_API_1_6;
518# endif /* __BLOCKS__ */
519extern int cupsCopyDest(cups_dest_t *dest, int num_dests,
520 cups_dest_t **dests) _CUPS_API_1_6;
521extern cups_dinfo_t *cupsCopyDestInfo(http_t *http, cups_dest_t *dest)
522 _CUPS_API_1_6;
523extern int cupsCopyDestConflicts(http_t *http, cups_dest_t *dest,
524 cups_dinfo_t *info,
525 int num_options,
526 cups_option_t *options,
527 const char *new_option,
528 const char *new_value,
529 int *num_conflicts,
530 cups_option_t **conflicts,
531 int *num_resolved,
532 cups_option_t **resolved)
533 _CUPS_API_1_6;
534extern ipp_status_t cupsCreateDestJob(http_t *http, cups_dest_t *dest,
535 cups_dinfo_t *info, int *job_id,
536 const char *title, int num_options,
537 cups_option_t *options) _CUPS_API_1_6;
538extern int cupsEnumDests(unsigned flags, int msec, int *cancel,
539 cups_ptype_t type, cups_ptype_t mask,
540 cups_dest_cb_t cb, void *user_data)
541 _CUPS_API_1_6;
9c80ffa2 542# ifdef __BLOCKS__
dcb445bc
MS
543extern int cupsEnumDestsBlock(unsigned flags, int msec,
544 int *cancel, cups_ptype_t type,
545 cups_ptype_t mask,
546 cups_dest_block_t block)
547 _CUPS_API_1_6;
9c80ffa2 548# endif /* __BLOCKS__ */
dcb445bc 549extern ipp_status_t cupsFinishDestDocument(http_t *http,
82cc1f9a
MS
550 cups_dest_t *dest,
551 cups_dinfo_t *info)
552 _CUPS_API_1_6;
dcb445bc
MS
553extern void cupsFreeDestInfo(cups_dinfo_t *dinfo) _CUPS_API_1_6;
554extern int cupsGetDestMediaByName(http_t *http, cups_dest_t *dest,
555 cups_dinfo_t *dinfo,
556 const char *media,
557 unsigned flags,
558 cups_size_t *size) _CUPS_API_1_6;
559extern int cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest,
560 cups_dinfo_t *dinfo,
561 int width, int length,
562 unsigned flags,
563 cups_size_t *size) _CUPS_API_1_6;
564extern const char *cupsLocalizeDestOption(http_t *http, cups_dest_t *dest,
565 cups_dinfo_t *info,
566 const char *option)
567 _CUPS_API_1_6;
568extern const char *cupsLocalizeDestValue(http_t *http, cups_dest_t *dest,
569 cups_dinfo_t *info,
570 const char *option,
571 const char *value)
572 _CUPS_API_1_6;
573extern http_status_t cupsStartDestDocument(http_t *http, cups_dest_t *dest,
574 cups_dinfo_t *info, int job_id,
575 const char *docname,
576 const char *format,
577 int num_options,
578 cups_option_t *options,
579 int last_document) _CUPS_API_1_6;
7cf5915e 580
db8b865d 581/* New in CUPS 1.7 */
6961465f
MS
582extern ipp_attribute_t *cupsFindDestDefault(http_t *http, cups_dest_t *dest,
583 cups_dinfo_t *dinfo,
584 const char *option) _CUPS_API_1_7;
585extern ipp_attribute_t *cupsFindDestReady(http_t *http, cups_dest_t *dest,
586 cups_dinfo_t *dinfo,
587 const char *option) _CUPS_API_1_7;
588extern ipp_attribute_t *cupsFindDestSupported(http_t *http, cups_dest_t *dest,
589 cups_dinfo_t *dinfo,
590 const char *option)
591 _CUPS_API_1_7;
592extern int cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest,
593 cups_dinfo_t *dinfo, int n,
594 unsigned flags,
595 cups_size_t *size)
596 _CUPS_API_1_7;
7ae00c35 597extern int cupsGetDestMediaCount(http_t *http, cups_dest_t *dest,
6961465f
MS
598 cups_dinfo_t *dinfo,
599 unsigned flags) _CUPS_API_1_7;
600extern int cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
601 cups_dinfo_t *dinfo,
602 unsigned flags,
603 cups_size_t *size)
604 _CUPS_API_1_7;
db8b865d
MS
605extern void cupsSetUserAgent(const char *user_agent) _CUPS_API_1_7;
606extern const char *cupsUserAgent(void) _CUPS_API_1_7;
607
e1f19878 608/* New in CUPS 2.0/OS X 10.10 */
104fd4ae
MS
609extern cups_dest_t *cupsGetDestWithURI(const char *name, const char *uri) _CUPS_API_2_0;
610extern 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
611extern 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;
612extern int cupsSetServerCredentials(const char *path, const char *common_name, int auto_create) _CUPS_API_2_0;
db8b865d 613
5ae9fbb3
MS
614/* New in CUPS 2.2 */
615extern ssize_t cupsHashData(const char *algorithm, const void *data, size_t datalen, unsigned char *hash, size_t hashsize) _CUPS_API_2_2;
616
ef416fc2 617# ifdef __cplusplus
618}
619# endif /* __cplusplus */
620
621#endif /* !_CUPS_CUPS_H_ */