]>
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 | * |
c8fef167 | 6 | * Copyright 2007-2011 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 <cups/cups.h> |
26 | # include "string-private.h" | |
27 | # include "debug-private.h" | |
aaf19ab0 | 28 | # include "ppd-private.h" |
8ca02f3c | 29 | # include "http-private.h" |
71e16022 MS |
30 | # include "ipp-private.h" |
31 | # include "language-private.h" | |
54afec33 | 32 | # include "pwg-private.h" |
6d2f911b | 33 | # include "thread-private.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 | ||
53 | typedef struct _cups_globals_s /**** CUPS global state data ****/ | |
54 | { | |
55 | /* Multiple places... */ | |
56 | const char *cups_datadir, /* CUPS_DATADIR environment var */ | |
57 | *cups_serverbin,/* CUPS_SERVERBIN environment var */ | |
58 | *cups_serverroot, | |
59 | /* CUPS_SERVERROOT environment var */ | |
60 | *cups_statedir, /* CUPS_STATEDIR environment var */ | |
61 | *localedir; /* LOCALDIR environment var */ | |
62 | ||
757d2cad | 63 | /* adminutil.c */ |
64 | time_t cupsd_update; /* Last time we got or set cupsd.conf */ | |
65 | char cupsd_hostname[HTTP_MAX_HOST]; | |
66 | /* Hostname for connection */ | |
67 | int cupsd_num_settings; | |
68 | /* Number of server settings */ | |
69 | cups_option_t *cupsd_settings;/* Server settings */ | |
70 | ||
5eb9da71 MS |
71 | /* backend.c */ |
72 | char resolved_uri[1024]; | |
73 | /* Buffer for cupsBackendDeviceURI */ | |
74 | ||
80ca4592 | 75 | /* file.c */ |
76 | cups_file_t *stdio_files[3];/* stdin, stdout, stderr */ | |
77 | ||
ef416fc2 | 78 | /* http.c */ |
79 | char http_date[256]; /* Date+time buffer */ | |
80 | ||
81 | /* http-addr.c */ | |
82 | unsigned ip_addr; /* Packed IPv4 address */ | |
83 | char *ip_ptrs[2]; /* Pointer to packed address */ | |
84 | struct hostent hostent; /* Host entry for IP address */ | |
85 | # ifdef HAVE_GETADDRINFO | |
86 | char hostname[1024]; /* Hostname */ | |
87 | # endif /* HAVE_GETADDRINFO */ | |
49d87452 | 88 | int need_res_init; /* Need to reinitialize resolver? */ |
ef416fc2 | 89 | |
90 | /* ipp.c */ | |
91 | ipp_uchar_t ipp_date[11]; /* RFC-1903 date/time data */ | |
1f6f3dbc | 92 | _ipp_buffer_t *ipp_buffers; /* Buffer list */ |
ef416fc2 | 93 | |
94 | /* ipp-support.c */ | |
95 | int ipp_port; /* IPP port number */ | |
96 | char ipp_unknown[255]; | |
97 | /* Unknown error statuses */ | |
98 | ||
ef416fc2 | 99 | /* language.c */ |
fa73b229 | 100 | cups_lang_t *lang_default; /* Default language */ |
ef416fc2 | 101 | # ifdef __APPLE__ |
ef416fc2 | 102 | char language[32]; /* Cached language */ |
ef416fc2 | 103 | # endif /* __APPLE__ */ |
104 | ||
105 | /* ppd.c */ | |
106 | ppd_status_t ppd_status; /* Status of last ppdOpen*() */ | |
107 | int ppd_line; /* Current line number */ | |
108 | ppd_conform_t ppd_conform; /* Level of conformance required */ | |
109 | ||
54afec33 MS |
110 | /* pwg-media.c */ |
111 | cups_array_t *leg_size_lut, /* Lookup table for legacy names */ | |
112 | *ppd_size_lut, /* Lookup table for PPD names */ | |
113 | *pwg_size_lut; /* Lookup table for PWG names */ | |
114 | _pwg_media_t pwg_media; /* PWG media data for custom size */ | |
115 | char pwg_name[65]; /* PWG media name for custom size */ | |
c168a833 | 116 | |
5180a04c MS |
117 | /* request.c */ |
118 | http_t *http; /* Current server connection */ | |
119 | ipp_status_t last_error; /* Last IPP error */ | |
120 | char *last_status_message; | |
121 | /* Last IPP status-message */ | |
122 | ||
91c84a35 | 123 | /* snmp.c */ |
ac884b6a MS |
124 | char snmp_community[255]; |
125 | /* Default SNMP community name */ | |
91c84a35 MS |
126 | int snmp_debug; /* Log SNMP IO to stderr? */ |
127 | ||
ef416fc2 | 128 | /* tempfile.c */ |
129 | char tempfile[1024]; /* cupsTempFd/File buffer */ | |
130 | ||
ef416fc2 | 131 | /* usersys.c */ |
132 | http_encryption_t encryption; /* Encryption setting */ | |
133 | char user[65], /* User name */ | |
134 | server[256], /* Server address */ | |
135 | servername[256];/* Server hostname */ | |
f11a948a MS |
136 | cups_password_cb2_t password_cb; /* Password callback */ |
137 | void *password_data; /* Password user data */ | |
7cf5915e MS |
138 | http_tls_credentials_t tls_credentials; |
139 | /* Default client credentials */ | |
140 | cups_client_cert_cb_t client_cert_cb; /* Client certificate callback */ | |
141 | void *client_cert_data; | |
142 | /* Client certificate user data */ | |
143 | cups_server_cert_cb_t server_cert_cb; /* Server certificate callback */ | |
144 | void *server_cert_data; | |
145 | /* Server certificate user data */ | |
146 | int any_root, /* Allow any root */ | |
147 | expired_certs, /* Allow expired certs */ | |
148 | expired_root; /* Allow expired root */ | |
ef416fc2 | 149 | |
150 | /* util.c */ | |
ef416fc2 | 151 | char def_printer[256]; |
152 | /* Default printer */ | |
153 | char ppd_filename[HTTP_MAX_URI]; | |
154 | /* PPD filename */ | |
155 | } _cups_globals_t; | |
156 | ||
157 | ||
158 | /* | |
159 | * Prototypes... | |
160 | */ | |
161 | ||
c8fef167 MS |
162 | # ifdef __APPLE__ |
163 | extern CFStringRef _cupsAppleCopyDefaultPaperID(void); | |
f14324a7 | 164 | extern CFStringRef _cupsAppleCopyDefaultPrinter(void); |
c8fef167 MS |
165 | extern int _cupsAppleGetUseLastPrinter(void); |
166 | extern void _cupsAppleSetDefaultPaperID(CFStringRef name); | |
f14324a7 | 167 | extern void _cupsAppleSetDefaultPrinter(CFStringRef name); |
c8fef167 MS |
168 | extern void _cupsAppleSetUseLastPrinter(int uselast); |
169 | # endif /* __APPLE__ */ | |
170 | ||
3d052e43 | 171 | extern http_t *_cupsConnect(void); |
f8b3a85b MS |
172 | extern int _cupsGet1284Values(const char *device_id, |
173 | cups_option_t **values); | |
c8fef167 MS |
174 | extern int _cupsGetDests(http_t *http, ipp_op_t op, |
175 | const char *name, cups_dest_t **dests); | |
ef416fc2 | 176 | extern const char *_cupsGetPassword(const char *prompt); |
6d2f911b | 177 | extern void _cupsGlobalLock(void); |
ef416fc2 | 178 | extern _cups_globals_t *_cupsGlobals(void); |
6d2f911b | 179 | extern void _cupsGlobalUnlock(void); |
f14324a7 | 180 | extern int _cupsNextDelay(int current, int *previous); |
e07d4801 | 181 | extern void _cupsSetDefaults(void); |
749b1e90 MS |
182 | extern void _cupsSetError(ipp_status_t status, const char *message, |
183 | int localize); | |
355e94dc | 184 | extern void _cupsSetHTTPError(http_status_t status); |
f14324a7 MS |
185 | # ifdef HAVE_GSSAPI |
186 | extern int _cupsSetNegotiateAuthString(http_t *http); | |
187 | # endif /* HAVE_GSSAPI */ | |
38e73f87 | 188 | extern char *_cupsUserDefault(char *name, size_t namesize); |
ef416fc2 | 189 | |
190 | ||
191 | /* | |
192 | * C++ magic... | |
193 | */ | |
194 | ||
195 | # ifdef __cplusplus | |
196 | } | |
197 | # endif /* __cplusplus */ | |
71e16022 | 198 | #endif /* !_CUPS_CUPS_PRIVATE_H_ */ |
ef416fc2 | 199 | |
200 | /* | |
f14324a7 | 201 | * End of "$Id: cups-private.h 9596 2011-03-11 18:26:36Z mike $". |
ef416fc2 | 202 | */ |