]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
71e16022 | 2 | * "$Id$" |
ef416fc2 | 3 | * |
71e16022 | 4 | * Private definitions for CUPS. |
ef416fc2 | 5 | * |
71e16022 | 6 | * Copyright 2007-2010 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" | |
8ca02f3c | 28 | # include "http-private.h" |
71e16022 MS |
29 | # include "ipp-private.h" |
30 | # include "language-private.h" | |
54afec33 | 31 | # include "pwg-private.h" |
ef416fc2 | 32 | # ifdef HAVE_PTHREAD_H |
33 | # include <pthread.h> | |
34 | # endif /* HAVE_PTHREAD_H */ | |
35 | ||
36 | ||
37 | /* | |
38 | * C++ magic... | |
39 | */ | |
40 | ||
41 | # ifdef __cplusplus | |
42 | extern "C" { | |
43 | # endif /* __cplusplus */ | |
44 | ||
45 | ||
46 | /* | |
71e16022 | 47 | * Types... |
ef416fc2 | 48 | */ |
49 | ||
50 | typedef struct _cups_globals_s /**** CUPS global state data ****/ | |
51 | { | |
52 | /* Multiple places... */ | |
53 | const char *cups_datadir, /* CUPS_DATADIR environment var */ | |
54 | *cups_serverbin,/* CUPS_SERVERBIN environment var */ | |
55 | *cups_serverroot, | |
56 | /* CUPS_SERVERROOT environment var */ | |
57 | *cups_statedir, /* CUPS_STATEDIR environment var */ | |
58 | *localedir; /* LOCALDIR environment var */ | |
59 | ||
757d2cad | 60 | /* adminutil.c */ |
61 | time_t cupsd_update; /* Last time we got or set cupsd.conf */ | |
62 | char cupsd_hostname[HTTP_MAX_HOST]; | |
63 | /* Hostname for connection */ | |
64 | int cupsd_num_settings; | |
65 | /* Number of server settings */ | |
66 | cups_option_t *cupsd_settings;/* Server settings */ | |
67 | ||
5eb9da71 MS |
68 | /* backend.c */ |
69 | char resolved_uri[1024]; | |
70 | /* Buffer for cupsBackendDeviceURI */ | |
71 | ||
80ca4592 | 72 | /* file.c */ |
73 | cups_file_t *stdio_files[3];/* stdin, stdout, stderr */ | |
74 | ||
ef416fc2 | 75 | /* http.c */ |
76 | char http_date[256]; /* Date+time buffer */ | |
77 | ||
78 | /* http-addr.c */ | |
79 | unsigned ip_addr; /* Packed IPv4 address */ | |
80 | char *ip_ptrs[2]; /* Pointer to packed address */ | |
81 | struct hostent hostent; /* Host entry for IP address */ | |
82 | # ifdef HAVE_GETADDRINFO | |
83 | char hostname[1024]; /* Hostname */ | |
84 | # endif /* HAVE_GETADDRINFO */ | |
49d87452 | 85 | int need_res_init; /* Need to reinitialize resolver? */ |
ef416fc2 | 86 | |
87 | /* ipp.c */ | |
88 | ipp_uchar_t ipp_date[11]; /* RFC-1903 date/time data */ | |
1f6f3dbc | 89 | _ipp_buffer_t *ipp_buffers; /* Buffer list */ |
ef416fc2 | 90 | |
91 | /* ipp-support.c */ | |
92 | int ipp_port; /* IPP port number */ | |
93 | char ipp_unknown[255]; | |
94 | /* Unknown error statuses */ | |
95 | ||
ef416fc2 | 96 | /* language.c */ |
fa73b229 | 97 | cups_lang_t *lang_default; /* Default language */ |
ef416fc2 | 98 | # ifdef __APPLE__ |
ef416fc2 | 99 | char language[32]; /* Cached language */ |
ef416fc2 | 100 | # endif /* __APPLE__ */ |
101 | ||
102 | /* ppd.c */ | |
103 | ppd_status_t ppd_status; /* Status of last ppdOpen*() */ | |
104 | int ppd_line; /* Current line number */ | |
105 | ppd_conform_t ppd_conform; /* Level of conformance required */ | |
106 | ||
54afec33 MS |
107 | /* pwg-media.c */ |
108 | cups_array_t *leg_size_lut, /* Lookup table for legacy names */ | |
109 | *ppd_size_lut, /* Lookup table for PPD names */ | |
110 | *pwg_size_lut; /* Lookup table for PWG names */ | |
111 | _pwg_media_t pwg_media; /* PWG media data for custom size */ | |
112 | char pwg_name[65]; /* PWG media name for custom size */ | |
c168a833 | 113 | |
5180a04c MS |
114 | /* request.c */ |
115 | http_t *http; /* Current server connection */ | |
116 | ipp_status_t last_error; /* Last IPP error */ | |
117 | char *last_status_message; | |
118 | /* Last IPP status-message */ | |
119 | ||
91c84a35 | 120 | /* snmp.c */ |
ac884b6a MS |
121 | char snmp_community[255]; |
122 | /* Default SNMP community name */ | |
91c84a35 MS |
123 | int snmp_debug; /* Log SNMP IO to stderr? */ |
124 | ||
ef416fc2 | 125 | /* tempfile.c */ |
126 | char tempfile[1024]; /* cupsTempFd/File buffer */ | |
127 | ||
ef416fc2 | 128 | /* usersys.c */ |
129 | http_encryption_t encryption; /* Encryption setting */ | |
130 | char user[65], /* User name */ | |
131 | server[256], /* Server address */ | |
132 | servername[256];/* Server hostname */ | |
f11a948a MS |
133 | cups_password_cb2_t password_cb; /* Password callback */ |
134 | void *password_data; /* Password user data */ | |
ef416fc2 | 135 | |
136 | /* util.c */ | |
ef416fc2 | 137 | char def_printer[256]; |
138 | /* Default printer */ | |
139 | char ppd_filename[HTTP_MAX_URI]; | |
140 | /* PPD filename */ | |
141 | } _cups_globals_t; | |
142 | ||
143 | ||
144 | /* | |
145 | * Prototypes... | |
146 | */ | |
147 | ||
3d052e43 | 148 | extern http_t *_cupsConnect(void); |
f8b3a85b MS |
149 | extern int _cupsGet1284Values(const char *device_id, |
150 | cups_option_t **values); | |
ef416fc2 | 151 | extern const char *_cupsGetPassword(const char *prompt); |
152 | extern _cups_globals_t *_cupsGlobals(void); | |
e07d4801 | 153 | extern void _cupsSetDefaults(void); |
749b1e90 MS |
154 | extern void _cupsSetError(ipp_status_t status, const char *message, |
155 | int localize); | |
355e94dc | 156 | extern void _cupsSetHTTPError(http_status_t status); |
38e73f87 | 157 | extern char *_cupsUserDefault(char *name, size_t namesize); |
ef416fc2 | 158 | |
159 | ||
160 | /* | |
161 | * C++ magic... | |
162 | */ | |
163 | ||
164 | # ifdef __cplusplus | |
165 | } | |
166 | # endif /* __cplusplus */ | |
71e16022 | 167 | #endif /* !_CUPS_CUPS_PRIVATE_H_ */ |
ef416fc2 | 168 | |
169 | /* | |
71e16022 | 170 | * End of "$Id$". |
ef416fc2 | 171 | */ |