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