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