]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/cups.h
First half of new "local temporary printer" queues, to support on-demand IPP
[thirdparty/cups.git] / cups / cups.h
1 /*
2 * "$Id$"
3 *
4 * API definitions for CUPS.
5 *
6 * Copyright 2007-2016 by Apple Inc.
7 * Copyright 1997-2007 by Easy Software Products.
8 *
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/".
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
25 # include <sys/types.h>
26 # if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
27 # define __CUPS_SSIZE_T_DEFINED
28 # include <stddef.h>
29 /* Windows does not support the ssize_t type, so map it to off_t... */
30 typedef off_t ssize_t; /* @private@ */
31 # endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
32
33 # include "file.h"
34 # include "ipp.h"
35 # include "language.h"
36 # include "pwg.h"
37
38
39 /*
40 * C++ magic...
41 */
42
43 # ifdef __cplusplus
44 extern "C" {
45 # endif /* __cplusplus */
46
47
48 /*
49 * Constants...
50 */
51
52 # define CUPS_VERSION 2.0200
53 # define CUPS_VERSION_MAJOR 2
54 # define CUPS_VERSION_MINOR 2
55 # define CUPS_VERSION_PATCH 0
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"
197
198
199 /*
200 * Types and structures...
201 */
202
203 typedef unsigned cups_ptype_t; /* Printer type/capability bits */
204 enum cups_ptype_e /* Printer type/capability bit
205 * constants */
206 { /* Not a typedef'd enum so we can OR */
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 */
224 CUPS_PRINTER_IMPLICIT = 0x10000, /* Implicit class @private@
225 * @since Deprecated@ */
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 */
229 CUPS_PRINTER_DELETE = 0x100000, /* Delete printer
230 * @since CUPS 1.2/OS X 10.5@ */
231 CUPS_PRINTER_NOT_SHARED = 0x200000, /* Printer is not shared
232 * @since CUPS 1.2/OS X 10.5@ */
233 CUPS_PRINTER_AUTHENTICATED = 0x400000,/* Printer requires authentication
234 * @since CUPS 1.2/OS X 10.5@ */
235 CUPS_PRINTER_COMMANDS = 0x800000, /* Printer supports maintenance commands
236 * @since CUPS 1.2/OS X 10.5@ */
237 CUPS_PRINTER_DISCOVERED = 0x1000000, /* Printer was automatically discovered
238 * and added @private@
239 * @since Deprecated@ */
240 CUPS_PRINTER_SCANNER = 0x2000000, /* Scanner-only device
241 * @since CUPS 1.4/OS X 10.6@ */
242 CUPS_PRINTER_MFP = 0x4000000, /* Printer with scanning capabilities
243 * @since CUPS 1.4/OS X 10.6@ */
244 CUPS_PRINTER_3D = 0x8000000, /* Printer with 3D capabilities @since CUPS 2.1@ */
245 CUPS_PRINTER_OPTIONS = 0x6fffc /* ~(CLASS | REMOTE | IMPLICIT |
246 * DEFAULT | FAX | REJECTING | DELETE |
247 * NOT_SHARED | AUTHENTICATED |
248 * COMMANDS | DISCOVERED) @private@ */
249 };
250
251 typedef struct cups_option_s /**** Printer Options ****/
252 {
253 char *name; /* Name of option */
254 char *value; /* Value of option */
255 } cups_option_t;
256
257 typedef struct cups_dest_s /**** Destination ****/
258 {
259 char *name, /* Printer or class name */
260 *instance; /* Local instance name or NULL */
261 int is_default; /* Is this printer the default? */
262 int num_options; /* Number of options */
263 cups_option_t *options; /* Options */
264 } cups_dest_t;
265
266 typedef struct _cups_dinfo_s cups_dinfo_t;
267 /* Destination capability and status
268 * information @since CUPS 1.6/OS X 10.8@ */
269
270 typedef struct cups_job_s /**** Job ****/
271 {
272 int id; /* The job ID */
273 char *dest; /* Printer or class name */
274 char *title; /* Title/job name */
275 char *user; /* User the submitted the job */
276 char *format; /* Document format */
277 ipp_jstate_t state; /* Job state */
278 int size; /* Size in kilobytes */
279 int priority; /* Priority (1-100) */
280 time_t completed_time; /* Time the job was completed */
281 time_t creation_time; /* Time the job was created */
282 time_t processing_time; /* Time the job was processed */
283 } cups_job_t;
284
285 typedef struct cups_size_s /**** Media Size @since CUPS 1.6/OS X 10.8@ ****/
286 {
287 char media[128]; /* Media name to use */
288 int width, /* Width in hundredths of millimeters */
289 length, /* Length in hundredths of
290 * millimeters */
291 bottom, /* Bottom margin in hundredths of
292 * millimeters */
293 left, /* Left margin in hundredths of
294 * millimeters */
295 right, /* Right margin in hundredths of
296 * millimeters */
297 top; /* Top margin in hundredths of
298 * millimeters */
299 } cups_size_t;
300
301 typedef int (*cups_client_cert_cb_t)(http_t *http, void *tls,
302 cups_array_t *distinguished_names,
303 void *user_data);
304 /* Client credentials callback
305 * @since CUPS 1.5/OS X 10.7@ */
306
307 typedef int (*cups_dest_cb_t)(void *user_data, unsigned flags,
308 cups_dest_t *dest);
309 /* Destination enumeration callback
310 * @since CUPS 1.6/OS X 10.8@ */
311
312 # ifdef __BLOCKS__
313 typedef int (^cups_dest_block_t)(unsigned flags, cups_dest_t *dest);
314 /* Destination enumeration block
315 * @since CUPS 1.6/OS X 10.8@ */
316 # endif /* __BLOCKS__ */
317
318 typedef void (*cups_device_cb_t)(const char *device_class,
319 const char *device_id, const char *device_info,
320 const char *device_make_and_model,
321 const char *device_uri,
322 const char *device_location, void *user_data);
323 /* Device callback
324 * @since CUPS 1.4/OS X 10.6@ */
325
326 typedef const char *(*cups_password_cb_t)(const char *prompt);
327 /* Password callback */
328
329 typedef const char *(*cups_password_cb2_t)(const char *prompt, http_t *http,
330 const char *method,
331 const char *resource,
332 void *user_data);
333 /* New password callback
334 * @since CUPS 1.4/OS X 10.6@ */
335
336 typedef int (*cups_server_cert_cb_t)(http_t *http, void *tls,
337 cups_array_t *certs, void *user_data);
338 /* Server credentials callback
339 * @since CUPS 1.5/OS X 10.7@ */
340
341
342 /*
343 * Functions...
344 */
345
346 extern int cupsCancelJob(const char *name, int job_id);
347 extern ipp_t *cupsDoFileRequest(http_t *http, ipp_t *request,
348 const char *resource,
349 const char *filename);
350 extern ipp_t *cupsDoRequest(http_t *http, ipp_t *request,
351 const char *resource);
352 extern http_encryption_t cupsEncryption(void);
353 extern void cupsFreeJobs(int num_jobs, cups_job_t *jobs);
354 extern int cupsGetClasses(char ***classes) _CUPS_DEPRECATED_MSG("Use cupsGetDests instead.");
355 extern const char *cupsGetDefault(void);
356 extern int cupsGetJobs(cups_job_t **jobs, const char *name,
357 int myjobs, int whichjobs);
358 extern int cupsGetPrinters(char ***printers) _CUPS_DEPRECATED_MSG("Use cupsGetDests instead.");
359 extern ipp_status_t cupsLastError(void);
360 extern int cupsPrintFile(const char *name, const char *filename,
361 const char *title, int num_options,
362 cups_option_t *options);
363 extern int cupsPrintFiles(const char *name, int num_files,
364 const char **files, const char *title,
365 int num_options, cups_option_t *options);
366 extern char *cupsTempFile(char *filename, int len) _CUPS_DEPRECATED_MSG("Use cupsTempFd or cupsTempFile2 instead.");
367 extern int cupsTempFd(char *filename, int len);
368
369 extern int cupsAddDest(const char *name, const char *instance,
370 int num_dests, cups_dest_t **dests);
371 extern void cupsFreeDests(int num_dests, cups_dest_t *dests);
372 extern cups_dest_t *cupsGetDest(const char *name, const char *instance,
373 int num_dests, cups_dest_t *dests);
374 extern int cupsGetDests(cups_dest_t **dests);
375 extern void cupsSetDests(int num_dests, cups_dest_t *dests);
376
377 extern int cupsAddOption(const char *name, const char *value,
378 int num_options, cups_option_t **options);
379 extern void cupsEncodeOptions(ipp_t *ipp, int num_options,
380 cups_option_t *options);
381 extern void cupsFreeOptions(int num_options,
382 cups_option_t *options);
383 extern const char *cupsGetOption(const char *name, int num_options,
384 cups_option_t *options);
385 extern int cupsParseOptions(const char *arg, int num_options,
386 cups_option_t **options);
387
388 extern const char *cupsGetPassword(const char *prompt);
389 extern const char *cupsServer(void);
390 extern void cupsSetEncryption(http_encryption_t e);
391 extern void cupsSetPasswordCB(cups_password_cb_t cb);
392 extern void cupsSetServer(const char *server);
393 extern void cupsSetUser(const char *user);
394 extern const char *cupsUser(void);
395
396 /**** New in CUPS 1.1.20 ****/
397 extern int cupsDoAuthentication(http_t *http, const char *method,
398 const char *resource)
399 _CUPS_API_1_1_20;
400 extern http_status_t cupsGetFile(http_t *http, const char *resource,
401 const char *filename) _CUPS_API_1_1_20;
402 extern http_status_t cupsGetFd(http_t *http, const char *resource, int fd);
403 extern http_status_t cupsPutFile(http_t *http, const char *resource,
404 const char *filename) _CUPS_API_1_1_20;
405 extern http_status_t cupsPutFd(http_t *http, const char *resource, int fd)
406 _CUPS_API_1_1_20;
407
408 /**** New in CUPS 1.1.21 ****/
409 extern const char *cupsGetDefault2(http_t *http) _CUPS_API_1_1_21;
410 extern int cupsGetDests2(http_t *http, cups_dest_t **dests)
411 _CUPS_API_1_1_21;
412 extern int cupsGetJobs2(http_t *http, cups_job_t **jobs,
413 const char *name, int myjobs,
414 int whichjobs) _CUPS_API_1_1_21;
415 extern int cupsPrintFile2(http_t *http, const char *name,
416 const char *filename,
417 const char *title, int num_options,
418 cups_option_t *options) _CUPS_API_1_1_21;
419 extern int cupsPrintFiles2(http_t *http, const char *name,
420 int num_files, const char **files,
421 const char *title, int num_options,
422 cups_option_t *options)
423 _CUPS_API_1_1_21;
424 extern int cupsSetDests2(http_t *http, int num_dests,
425 cups_dest_t *dests) _CUPS_API_1_1_21;
426
427 /**** New in CUPS 1.2/OS X 10.5 ****/
428 extern ssize_t cupsBackChannelRead(char *buffer, size_t bytes,
429 double timeout) _CUPS_API_1_2;
430 extern ssize_t cupsBackChannelWrite(const char *buffer, size_t bytes,
431 double timeout) _CUPS_API_1_2;
432 extern void cupsEncodeOptions2(ipp_t *ipp, int num_options,
433 cups_option_t *options,
434 ipp_tag_t group_tag) _CUPS_API_1_2;
435 extern const char *cupsLastErrorString(void) _CUPS_API_1_2;
436 extern char *cupsNotifySubject(cups_lang_t *lang, ipp_t *event)
437 _CUPS_API_1_2;
438 extern char *cupsNotifyText(cups_lang_t *lang, ipp_t *event)
439 _CUPS_API_1_2;
440 extern int cupsRemoveOption(const char *name, int num_options,
441 cups_option_t **options) _CUPS_API_1_2;
442 extern cups_file_t *cupsTempFile2(char *filename, int len) _CUPS_API_1_2;
443
444 /**** New in CUPS 1.3/OS X 10.5 ****/
445 extern ipp_t *cupsDoIORequest(http_t *http, ipp_t *request,
446 const char *resource, int infile,
447 int outfile) _CUPS_API_1_3;
448 extern int cupsRemoveDest(const char *name,
449 const char *instance,
450 int num_dests, cups_dest_t **dests)
451 _CUPS_API_1_3;
452 extern void cupsSetDefaultDest(const char *name,
453 const char *instance,
454 int num_dests,
455 cups_dest_t *dests) _CUPS_API_1_3;
456
457 /**** New in CUPS 1.4/OS X 10.6 ****/
458 extern ipp_status_t cupsCancelJob2(http_t *http, const char *name,
459 int job_id, int purge) _CUPS_API_1_4;
460 extern int cupsCreateJob(http_t *http, const char *name,
461 const char *title, int num_options,
462 cups_option_t *options) _CUPS_API_1_4;
463 extern ipp_status_t cupsFinishDocument(http_t *http,
464 const char *name) _CUPS_API_1_4;
465 extern ipp_status_t cupsGetDevices(http_t *http, int timeout,
466 const char *include_schemes,
467 const char *exclude_schemes,
468 cups_device_cb_t callback,
469 void *user_data) _CUPS_API_1_4;
470 extern cups_dest_t *cupsGetNamedDest(http_t *http, const char *name,
471 const char *instance) _CUPS_API_1_4;
472 extern const char *cupsGetPassword2(const char *prompt, http_t *http,
473 const char *method,
474 const char *resource) _CUPS_API_1_4;
475 extern ipp_t *cupsGetResponse(http_t *http,
476 const char *resource) _CUPS_API_1_4;
477 extern ssize_t cupsReadResponseData(http_t *http, char *buffer,
478 size_t length) _CUPS_API_1_4;
479 extern http_status_t cupsSendRequest(http_t *http, ipp_t *request,
480 const char *resource,
481 size_t length) _CUPS_API_1_4;
482 extern void cupsSetPasswordCB2(cups_password_cb2_t cb,
483 void *user_data) _CUPS_API_1_4;
484 extern http_status_t cupsStartDocument(http_t *http, const char *name,
485 int job_id, const char *docname,
486 const char *format,
487 int last_document) _CUPS_API_1_4;
488 extern http_status_t cupsWriteRequestData(http_t *http, const char *buffer,
489 size_t length) _CUPS_API_1_4;
490
491 /**** New in CUPS 1.5/OS X 10.7 ****/
492 extern void cupsSetClientCertCB(cups_client_cert_cb_t cb,
493 void *user_data) _CUPS_API_1_5;
494 extern int cupsSetCredentials(cups_array_t *certs) _CUPS_API_1_5;
495 extern void cupsSetServerCertCB(cups_server_cert_cb_t cb,
496 void *user_data) _CUPS_API_1_5;
497
498 /**** New in CUPS 1.6/OS X 10.8 ****/
499 extern ipp_status_t cupsCancelDestJob(http_t *http, cups_dest_t *dest,
500 int job_id) _CUPS_API_1_6;
501 extern int cupsCheckDestSupported(http_t *http, cups_dest_t *dest,
502 cups_dinfo_t *info,
503 const char *option,
504 const char *value) _CUPS_API_1_6;
505 extern ipp_status_t cupsCloseDestJob(http_t *http, cups_dest_t *dest,
506 cups_dinfo_t *info, int job_id)
507 _CUPS_API_1_6;
508 extern http_t *cupsConnectDest(cups_dest_t *dest, unsigned flags,
509 int msec, int *cancel,
510 char *resource, size_t resourcesize,
511 cups_dest_cb_t cb, void *user_data)
512 _CUPS_API_1_6;
513 # ifdef __BLOCKS__
514 extern http_t *cupsConnectDestBlock(cups_dest_t *dest,
515 unsigned flags, int msec,
516 int *cancel, char *resource,
517 size_t resourcesize,
518 cups_dest_block_t block)
519 _CUPS_API_1_6;
520 # endif /* __BLOCKS__ */
521 extern int cupsCopyDest(cups_dest_t *dest, int num_dests,
522 cups_dest_t **dests) _CUPS_API_1_6;
523 extern cups_dinfo_t *cupsCopyDestInfo(http_t *http, cups_dest_t *dest)
524 _CUPS_API_1_6;
525 extern int cupsCopyDestConflicts(http_t *http, cups_dest_t *dest,
526 cups_dinfo_t *info,
527 int num_options,
528 cups_option_t *options,
529 const char *new_option,
530 const char *new_value,
531 int *num_conflicts,
532 cups_option_t **conflicts,
533 int *num_resolved,
534 cups_option_t **resolved)
535 _CUPS_API_1_6;
536 extern ipp_status_t cupsCreateDestJob(http_t *http, cups_dest_t *dest,
537 cups_dinfo_t *info, int *job_id,
538 const char *title, int num_options,
539 cups_option_t *options) _CUPS_API_1_6;
540 extern int cupsEnumDests(unsigned flags, int msec, int *cancel,
541 cups_ptype_t type, cups_ptype_t mask,
542 cups_dest_cb_t cb, void *user_data)
543 _CUPS_API_1_6;
544 # ifdef __BLOCKS__
545 extern int cupsEnumDestsBlock(unsigned flags, int msec,
546 int *cancel, cups_ptype_t type,
547 cups_ptype_t mask,
548 cups_dest_block_t block)
549 _CUPS_API_1_6;
550 # endif /* __BLOCKS__ */
551 extern ipp_status_t cupsFinishDestDocument(http_t *http,
552 cups_dest_t *dest,
553 cups_dinfo_t *info)
554 _CUPS_API_1_6;
555 extern void cupsFreeDestInfo(cups_dinfo_t *dinfo) _CUPS_API_1_6;
556 extern int cupsGetDestMediaByName(http_t *http, cups_dest_t *dest,
557 cups_dinfo_t *dinfo,
558 const char *media,
559 unsigned flags,
560 cups_size_t *size) _CUPS_API_1_6;
561 extern int cupsGetDestMediaBySize(http_t *http, cups_dest_t *dest,
562 cups_dinfo_t *dinfo,
563 int width, int length,
564 unsigned flags,
565 cups_size_t *size) _CUPS_API_1_6;
566 extern const char *cupsLocalizeDestOption(http_t *http, cups_dest_t *dest,
567 cups_dinfo_t *info,
568 const char *option)
569 _CUPS_API_1_6;
570 extern const char *cupsLocalizeDestValue(http_t *http, cups_dest_t *dest,
571 cups_dinfo_t *info,
572 const char *option,
573 const char *value)
574 _CUPS_API_1_6;
575 extern http_status_t cupsStartDestDocument(http_t *http, cups_dest_t *dest,
576 cups_dinfo_t *info, int job_id,
577 const char *docname,
578 const char *format,
579 int num_options,
580 cups_option_t *options,
581 int last_document) _CUPS_API_1_6;
582
583 /* New in CUPS 1.7 */
584 extern ipp_attribute_t *cupsFindDestDefault(http_t *http, cups_dest_t *dest,
585 cups_dinfo_t *dinfo,
586 const char *option) _CUPS_API_1_7;
587 extern ipp_attribute_t *cupsFindDestReady(http_t *http, cups_dest_t *dest,
588 cups_dinfo_t *dinfo,
589 const char *option) _CUPS_API_1_7;
590 extern ipp_attribute_t *cupsFindDestSupported(http_t *http, cups_dest_t *dest,
591 cups_dinfo_t *dinfo,
592 const char *option)
593 _CUPS_API_1_7;
594 extern int cupsGetDestMediaByIndex(http_t *http, cups_dest_t *dest,
595 cups_dinfo_t *dinfo, int n,
596 unsigned flags,
597 cups_size_t *size)
598 _CUPS_API_1_7;
599 extern int cupsGetDestMediaCount(http_t *http, cups_dest_t *dest,
600 cups_dinfo_t *dinfo,
601 unsigned flags) _CUPS_API_1_7;
602 extern int cupsGetDestMediaDefault(http_t *http, cups_dest_t *dest,
603 cups_dinfo_t *dinfo,
604 unsigned flags,
605 cups_size_t *size)
606 _CUPS_API_1_7;
607 extern void cupsSetUserAgent(const char *user_agent) _CUPS_API_1_7;
608 extern const char *cupsUserAgent(void) _CUPS_API_1_7;
609
610 /* New in CUPS 2.0/OS X 10.10 */
611 extern cups_dest_t *cupsGetDestWithURI(const char *name, const char *uri) _CUPS_API_2_0;
612 extern const char *cupsLocalizeDestMedia(http_t *http, cups_dest_t *dest, cups_dinfo_t *info, unsigned flags, cups_size_t *size) _CUPS_API_2_0;
613 extern 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;
614 extern int cupsSetServerCredentials(const char *path, const char *common_name, int auto_create) _CUPS_API_2_0;
615
616 /* New in CUPS 2.2 */
617 extern ssize_t cupsHashData(const char *algorithm, const void *data, size_t datalen, unsigned char *hash, size_t hashsize) _CUPS_API_2_2;
618
619 # ifdef __cplusplus
620 }
621 # endif /* __cplusplus */
622
623 #endif /* !_CUPS_CUPS_H_ */
624
625 /*
626 * End of "$Id$".
627 */