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