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