]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
f14324a7 | 2 | * "$Id: cups-private.h 9596 2011-03-11 18:26:36Z mike $" |
ef416fc2 | 3 | * |
71e16022 | 4 | * Private definitions for CUPS. |
ef416fc2 | 5 | * |
dcb445bc | 6 | * Copyright 2007-2012 by Apple Inc. |
f7deaa1a | 7 | * Copyright 1997-2007 by Easy Software Products, all rights reserved. |
ef416fc2 | 8 | * |
9 | * These coded instructions, statements, and computer programs are the | |
bc44d920 | 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 | * |
15 | * This file is subject to the Apple OS-Developed Software exception. | |
16 | */ | |
17 | ||
71e16022 MS |
18 | #ifndef _CUPS_CUPS_PRIVATE_H_ |
19 | # define _CUPS_CUPS_PRIVATE_H_ | |
ef416fc2 | 20 | |
21 | /* | |
22 | * Include necessary headers... | |
23 | */ | |
24 | ||
71e16022 MS |
25 | # include "string-private.h" |
26 | # include "debug-private.h" | |
71e16022 | 27 | # include "ipp-private.h" |
82cc1f9a | 28 | # include "http-private.h" |
71e16022 | 29 | # include "language-private.h" |
54afec33 | 30 | # include "pwg-private.h" |
82cc1f9a | 31 | # include "ppd-private.h" |
6d2f911b | 32 | # include "thread-private.h" |
82cc1f9a | 33 | # include <cups/cups.h> |
c8fef167 MS |
34 | # ifdef __APPLE__ |
35 | # include <sys/cdefs.h> | |
36 | # include <CoreFoundation/CoreFoundation.h> | |
37 | # endif /* __APPLE__ */ | |
ef416fc2 | 38 | |
39 | ||
40 | /* | |
41 | * C++ magic... | |
42 | */ | |
43 | ||
44 | # ifdef __cplusplus | |
45 | extern "C" { | |
46 | # endif /* __cplusplus */ | |
47 | ||
48 | ||
49 | /* | |
71e16022 | 50 | * Types... |
ef416fc2 | 51 | */ |
52 | ||
dcb445bc MS |
53 | typedef struct _cups_buffer_s /**** Read/write buffer ****/ |
54 | { | |
55 | struct _cups_buffer_s *next; /* Next buffer in list */ | |
56 | size_t size; /* Size of buffer */ | |
57 | char used, /* Is this buffer used? */ | |
58 | d[1]; /* Data buffer */ | |
59 | } _cups_buffer_t; | |
60 | ||
ef416fc2 | 61 | typedef struct _cups_globals_s /**** CUPS global state data ****/ |
62 | { | |
63 | /* Multiple places... */ | |
64 | const char *cups_datadir, /* CUPS_DATADIR environment var */ | |
65 | *cups_serverbin,/* CUPS_SERVERBIN environment var */ | |
66 | *cups_serverroot, | |
67 | /* CUPS_SERVERROOT environment var */ | |
68 | *cups_statedir, /* CUPS_STATEDIR environment var */ | |
69 | *localedir; /* LOCALDIR environment var */ | |
70 | ||
757d2cad | 71 | /* adminutil.c */ |
72 | time_t cupsd_update; /* Last time we got or set cupsd.conf */ | |
73 | char cupsd_hostname[HTTP_MAX_HOST]; | |
74 | /* Hostname for connection */ | |
75 | int cupsd_num_settings; | |
76 | /* Number of server settings */ | |
77 | cups_option_t *cupsd_settings;/* Server settings */ | |
78 | ||
07ed0e9a MS |
79 | /* auth.c */ |
80 | # ifdef HAVE_GSSAPI | |
81 | char gss_service_name[32]; | |
82 | /* Kerberos service name */ | |
83 | # endif /* HAVE_GSSAPI */ | |
84 | ||
5eb9da71 MS |
85 | /* backend.c */ |
86 | char resolved_uri[1024]; | |
87 | /* Buffer for cupsBackendDeviceURI */ | |
88 | ||
80ca4592 | 89 | /* file.c */ |
90 | cups_file_t *stdio_files[3];/* stdin, stdout, stderr */ | |
91 | ||
ef416fc2 | 92 | /* http.c */ |
93 | char http_date[256]; /* Date+time buffer */ | |
94 | ||
95 | /* http-addr.c */ | |
96 | unsigned ip_addr; /* Packed IPv4 address */ | |
97 | char *ip_ptrs[2]; /* Pointer to packed address */ | |
98 | struct hostent hostent; /* Host entry for IP address */ | |
99 | # ifdef HAVE_GETADDRINFO | |
100 | char hostname[1024]; /* Hostname */ | |
101 | # endif /* HAVE_GETADDRINFO */ | |
49d87452 | 102 | int need_res_init; /* Need to reinitialize resolver? */ |
ef416fc2 | 103 | |
104 | /* ipp.c */ | |
105 | ipp_uchar_t ipp_date[11]; /* RFC-1903 date/time data */ | |
dcb445bc | 106 | _cups_buffer_t *cups_buffers; /* Buffer list */ |
ef416fc2 | 107 | |
108 | /* ipp-support.c */ | |
109 | int ipp_port; /* IPP port number */ | |
110 | char ipp_unknown[255]; | |
111 | /* Unknown error statuses */ | |
112 | ||
ef416fc2 | 113 | /* language.c */ |
fa73b229 | 114 | cups_lang_t *lang_default; /* Default language */ |
ef416fc2 | 115 | # ifdef __APPLE__ |
ef416fc2 | 116 | char language[32]; /* Cached language */ |
ef416fc2 | 117 | # endif /* __APPLE__ */ |
118 | ||
119 | /* ppd.c */ | |
120 | ppd_status_t ppd_status; /* Status of last ppdOpen*() */ | |
121 | int ppd_line; /* Current line number */ | |
122 | ppd_conform_t ppd_conform; /* Level of conformance required */ | |
123 | ||
54afec33 MS |
124 | /* pwg-media.c */ |
125 | cups_array_t *leg_size_lut, /* Lookup table for legacy names */ | |
126 | *ppd_size_lut, /* Lookup table for PPD names */ | |
127 | *pwg_size_lut; /* Lookup table for PWG names */ | |
128 | _pwg_media_t pwg_media; /* PWG media data for custom size */ | |
129 | char pwg_name[65]; /* PWG media name for custom size */ | |
c168a833 | 130 | |
5180a04c MS |
131 | /* request.c */ |
132 | http_t *http; /* Current server connection */ | |
133 | ipp_status_t last_error; /* Last IPP error */ | |
134 | char *last_status_message; | |
135 | /* Last IPP status-message */ | |
136 | ||
91c84a35 | 137 | /* snmp.c */ |
ac884b6a MS |
138 | char snmp_community[255]; |
139 | /* Default SNMP community name */ | |
91c84a35 MS |
140 | int snmp_debug; /* Log SNMP IO to stderr? */ |
141 | ||
ef416fc2 | 142 | /* tempfile.c */ |
143 | char tempfile[1024]; /* cupsTempFd/File buffer */ | |
144 | ||
ef416fc2 | 145 | /* usersys.c */ |
146 | http_encryption_t encryption; /* Encryption setting */ | |
147 | char user[65], /* User name */ | |
148 | server[256], /* Server address */ | |
dcb445bc MS |
149 | servername[256],/* Server hostname */ |
150 | password[128]; /* Password for default callback */ | |
f11a948a MS |
151 | cups_password_cb2_t password_cb; /* Password callback */ |
152 | void *password_data; /* Password user data */ | |
7cf5915e MS |
153 | http_tls_credentials_t tls_credentials; |
154 | /* Default client credentials */ | |
155 | cups_client_cert_cb_t client_cert_cb; /* Client certificate callback */ | |
156 | void *client_cert_data; | |
157 | /* Client certificate user data */ | |
158 | cups_server_cert_cb_t server_cert_cb; /* Server certificate callback */ | |
159 | void *server_cert_data; | |
160 | /* Server certificate user data */ | |
161 | int any_root, /* Allow any root */ | |
162 | expired_certs, /* Allow expired certs */ | |
163 | expired_root; /* Allow expired root */ | |
ef416fc2 | 164 | |
165 | /* util.c */ | |
ef416fc2 | 166 | char def_printer[256]; |
167 | /* Default printer */ | |
168 | char ppd_filename[HTTP_MAX_URI]; | |
169 | /* PPD filename */ | |
170 | } _cups_globals_t; | |
171 | ||
dcb445bc MS |
172 | typedef struct _cups_media_db_s /* Media database */ |
173 | { | |
174 | char *color, /* Media color, if any */ | |
175 | *key, /* Media key, if any */ | |
176 | *info, /* Media human-readable name, if any */ | |
177 | *size_name, /* Media PWG size name, if provided */ | |
178 | *source, /* Media source, if any */ | |
179 | *type; /* Media type, if any */ | |
180 | int width, /* Width in hundredths of millimeters */ | |
181 | length, /* Length in hundredths of | |
182 | * millimeters */ | |
183 | bottom, /* Bottom margin in hundredths of | |
184 | * millimeters */ | |
185 | left, /* Left margin in hundredths of | |
186 | * millimeters */ | |
187 | right, /* Right margin in hundredths of | |
188 | * millimeters */ | |
189 | top; /* Top margin in hundredths of | |
190 | * millimeters */ | |
191 | } _cups_media_db_t; | |
192 | ||
193 | struct _cups_dinfo_s /* Destination capability and status | |
194 | * information */ | |
195 | { | |
196 | const char *uri; /* Printer URI */ | |
197 | char *resource; /* Resource path */ | |
198 | ipp_t *attrs; /* Printer attributes */ | |
199 | cups_array_t *constraints; /* Job constraints */ | |
200 | cups_array_t *localizations; /* Localization information */ | |
201 | cups_array_t *media_db; /* Media database */ | |
202 | _cups_media_db_t min_size, /* Minimum size */ | |
203 | max_size; /* Maximum size */ | |
204 | }; | |
205 | ||
ef416fc2 | 206 | |
207 | /* | |
208 | * Prototypes... | |
209 | */ | |
210 | ||
c8fef167 MS |
211 | # ifdef __APPLE__ |
212 | extern CFStringRef _cupsAppleCopyDefaultPaperID(void); | |
f14324a7 | 213 | extern CFStringRef _cupsAppleCopyDefaultPrinter(void); |
c8fef167 MS |
214 | extern int _cupsAppleGetUseLastPrinter(void); |
215 | extern void _cupsAppleSetDefaultPaperID(CFStringRef name); | |
f14324a7 | 216 | extern void _cupsAppleSetDefaultPrinter(CFStringRef name); |
c8fef167 MS |
217 | extern void _cupsAppleSetUseLastPrinter(int uselast); |
218 | # endif /* __APPLE__ */ | |
219 | ||
dcb445bc MS |
220 | extern char *_cupsBufferGet(size_t size); |
221 | extern void _cupsBufferRelease(char *b); | |
222 | ||
3d052e43 | 223 | extern http_t *_cupsConnect(void); |
f8b3a85b MS |
224 | extern int _cupsGet1284Values(const char *device_id, |
225 | cups_option_t **values); | |
dcb445bc MS |
226 | extern const char *_cupsGetDestResource(cups_dest_t *dest, char *resource, |
227 | size_t resourcesize); | |
c8fef167 | 228 | extern int _cupsGetDests(http_t *http, ipp_op_t op, |
dcb445bc MS |
229 | const char *name, cups_dest_t **dests, |
230 | cups_ptype_t type, cups_ptype_t mask); | |
ef416fc2 | 231 | extern const char *_cupsGetPassword(const char *prompt); |
6d2f911b | 232 | extern void _cupsGlobalLock(void); |
ef416fc2 | 233 | extern _cups_globals_t *_cupsGlobals(void); |
6d2f911b | 234 | extern void _cupsGlobalUnlock(void); |
eac3a0a0 MS |
235 | # ifdef HAVE_GSSAPI |
236 | extern const char *_cupsGSSServiceName(void); | |
237 | # endif /* HAVE_GSSAPI */ | |
f14324a7 | 238 | extern int _cupsNextDelay(int current, int *previous); |
e07d4801 | 239 | extern void _cupsSetDefaults(void); |
749b1e90 MS |
240 | extern void _cupsSetError(ipp_status_t status, const char *message, |
241 | int localize); | |
355e94dc | 242 | extern void _cupsSetHTTPError(http_status_t status); |
f14324a7 | 243 | # ifdef HAVE_GSSAPI |
eac3a0a0 MS |
244 | extern int _cupsSetNegotiateAuthString(http_t *http, |
245 | const char *method, | |
246 | const char *resource); | |
f14324a7 | 247 | # endif /* HAVE_GSSAPI */ |
38e73f87 | 248 | extern char *_cupsUserDefault(char *name, size_t namesize); |
ef416fc2 | 249 | |
250 | ||
251 | /* | |
252 | * C++ magic... | |
253 | */ | |
254 | ||
255 | # ifdef __cplusplus | |
256 | } | |
257 | # endif /* __cplusplus */ | |
71e16022 | 258 | #endif /* !_CUPS_CUPS_PRIVATE_H_ */ |
ef416fc2 | 259 | |
260 | /* | |
f14324a7 | 261 | * End of "$Id: cups-private.h 9596 2011-03-11 18:26:36Z mike $". |
ef416fc2 | 262 | */ |