]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/cups.h
2 * "$Id: cups.h,v 1.17 1999/07/12 16:09:34 mike Exp $"
4 * API definitions for the Common UNIX Printing System (CUPS).
6 * Copyright 1997-1999 by Easy Software Products.
8 * These coded instructions, statements, and computer programs are the
9 * property of Easy Software Products and are protected by Federal
10 * copyright law. Distribution and use rights are outlined in the file
11 * "LICENSE.txt" which should have been included with this file. If this
12 * file is missing or damaged please contact Easy Software Products
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636-3111 USA
20 * Voice: (301) 373-9603
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
26 # define _CUPS_CUPS_H_
29 * Include necessary headers...
32 # include <cups/ipp.h>
33 # include <cups/mime.h>
34 # include <cups/ppd.h>
43 # endif /* __cplusplus */
50 # define CUPS_VERSION 1.0
51 # define CUPS_DATE_ANY -1
55 * Types and structures...
58 typedef unsigned cups_ptype_t
; /**** Printer Type/Capability Bits ****/
59 enum /* Not a typedef'd enum so we can OR */
61 CUPS_PRINTER_LOCAL
= 0x0000, /* Local printer or class */
62 CUPS_PRINTER_CLASS
= 0x0001, /* Printer class */
63 CUPS_PRINTER_REMOTE
= 0x0002, /* Remote printer or class */
64 CUPS_PRINTER_BW
= 0x0004, /* Can do B&W printing */
65 CUPS_PRINTER_COLOR
= 0x0008, /* Can do color printing */
66 CUPS_PRINTER_DUPLEX
= 0x0010, /* Can do duplexing */
67 CUPS_PRINTER_STAPLE
= 0x0020, /* Can staple output */
68 CUPS_PRINTER_COPIES
= 0x0040, /* Can do copies */
69 CUPS_PRINTER_COLLATE
= 0x0080, /* Can collage copies */
70 CUPS_PRINTER_PUNCH
= 0x0100, /* Can punch output */
71 CUPS_PRINTER_COVER
= 0x0200, /* Can cover output */
72 CUPS_PRINTER_BIND
= 0x0400, /* Can bind output */
73 CUPS_PRINTER_SORT
= 0x0800, /* Can sort output */
74 CUPS_PRINTER_SMALL
= 0x1000, /* Can do Letter/Legal/A4 */
75 CUPS_PRINTER_MEDIUM
= 0x2000, /* Can do Tabloid/B/C/A3/A2 */
76 CUPS_PRINTER_LARGE
= 0x4000, /* Can do D/E/A1/A0 */
77 CUPS_PRINTER_VARIABLE
= 0x8000, /* Can do variable sizes */
78 CUPS_PRINTER_IMPLICIT
= 0x10000, /* Implicit class */
79 CUPS_PRINTER_OPTIONS
= 0xfffc /* ~(CLASS | REMOTE | IMPLICIT) */
84 * Types & structures...
87 typedef struct /**** Printer Information ****/
89 char name
[IPP_MAX_NAME
], /* Printer or class name */
90 uri
[HTTP_MAX_URI
]; /* Universal resource identifier */
91 unsigned char info
[IPP_MAX_NAME
], /* Printer or class info/description */
92 location
[IPP_MAX_NAME
]; /* Location text */
93 ipp_pstate_t state
; /* Printer state */
94 unsigned char message
[IPP_MAX_NAME
]; /* State text */
95 cups_ptype_t type
; /* Printer type/capability codes */
98 typedef struct /**** Printer Options ****/
100 char *name
; /* Name of option */
101 char *value
; /* Value of option */
109 extern int cupsCancelJob(const char *printer
, int job
);
110 #define cupsDoRequest(http,request,resource) cupsDoFileRequest((http),(request),(resource),NULL)
111 extern ipp_t
*cupsDoFileRequest(http_t
*http
, ipp_t
*request
,
112 const char *resource
, const char *filename
);
113 extern int cupsGetClasses(char ***classes
);
114 extern const char *cupsGetDefault(void);
115 extern const char *cupsGetPPD(const char *printer
);
116 extern int cupsGetPrinters(char ***printers
);
117 extern int cupsPrintFile(const char *printer
, const char *filename
,
118 const char *title
, int num_options
,
119 cups_option_t
*options
);
121 extern int cupsAddOption(const char *name
, const char *value
,
122 int num_options
, cups_option_t
**options
);
123 extern void cupsFreeOptions(int num_options
, cups_option_t
*options
);
124 extern const char *cupsGetOption(const char *name
, int num_options
,
125 cups_option_t
*options
);
126 extern int cupsParseOptions(const char *arg
, int num_options
,
127 cups_option_t
**options
);
128 extern int cupsMarkOptions(ppd_file_t
*ppd
, int num_options
,
129 cups_option_t
*options
);
131 extern const char *cupsGetPassword(const char *prompt
);
132 extern const char *cupsServer(void);
133 extern const char *cupsUser(void);
137 # endif /* __cplusplus */
139 #endif /* !_CUPS_CUPS_H_ */
142 * End of "$Id: cups.h,v 1.17 1999/07/12 16:09:34 mike Exp $".