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