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