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