4 * Private definitions for CUPS.
6 * Copyright 2007-2010 by Apple Inc.
7 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
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/".
15 * This file is subject to the Apple OS-Developed Software exception.
18 #ifndef _CUPS_CUPS_PRIVATE_H_
19 # define _CUPS_CUPS_PRIVATE_H_
22 * Include necessary headers...
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 # include "thread-private.h"
42 # endif /* __cplusplus */
49 typedef struct _cups_globals_s
/**** CUPS global state data ****/
51 /* Multiple places... */
52 const char *cups_datadir
, /* CUPS_DATADIR environment var */
53 *cups_serverbin
,/* CUPS_SERVERBIN environment var */
55 /* CUPS_SERVERROOT environment var */
56 *cups_statedir
, /* CUPS_STATEDIR environment var */
57 *localedir
; /* LOCALDIR environment var */
60 time_t cupsd_update
; /* Last time we got or set cupsd.conf */
61 char cupsd_hostname
[HTTP_MAX_HOST
];
62 /* Hostname for connection */
63 int cupsd_num_settings
;
64 /* Number of server settings */
65 cups_option_t
*cupsd_settings
;/* Server settings */
68 char resolved_uri
[1024];
69 /* Buffer for cupsBackendDeviceURI */
72 cups_file_t
*stdio_files
[3];/* stdin, stdout, stderr */
75 char http_date
[256]; /* Date+time buffer */
78 unsigned ip_addr
; /* Packed IPv4 address */
79 char *ip_ptrs
[2]; /* Pointer to packed address */
80 struct hostent hostent
; /* Host entry for IP address */
81 # ifdef HAVE_GETADDRINFO
82 char hostname
[1024]; /* Hostname */
83 # endif /* HAVE_GETADDRINFO */
84 int need_res_init
; /* Need to reinitialize resolver? */
87 ipp_uchar_t ipp_date
[11]; /* RFC-1903 date/time data */
88 _ipp_buffer_t
*ipp_buffers
; /* Buffer list */
91 int ipp_port
; /* IPP port number */
92 char ipp_unknown
[255];
93 /* Unknown error statuses */
96 cups_lang_t
*lang_default
; /* Default language */
98 char language
[32]; /* Cached language */
99 # endif /* __APPLE__ */
102 ppd_status_t ppd_status
; /* Status of last ppdOpen*() */
103 int ppd_line
; /* Current line number */
104 ppd_conform_t ppd_conform
; /* Level of conformance required */
107 cups_array_t
*leg_size_lut
, /* Lookup table for legacy names */
108 *ppd_size_lut
, /* Lookup table for PPD names */
109 *pwg_size_lut
; /* Lookup table for PWG names */
110 _pwg_media_t pwg_media
; /* PWG media data for custom size */
111 char pwg_name
[65]; /* PWG media name for custom size */
114 http_t
*http
; /* Current server connection */
115 ipp_status_t last_error
; /* Last IPP error */
116 char *last_status_message
;
117 /* Last IPP status-message */
120 char snmp_community
[255];
121 /* Default SNMP community name */
122 int snmp_debug
; /* Log SNMP IO to stderr? */
125 char tempfile
[1024]; /* cupsTempFd/File buffer */
128 http_encryption_t encryption
; /* Encryption setting */
129 char user
[65], /* User name */
130 server
[256], /* Server address */
131 servername
[256];/* Server hostname */
132 cups_password_cb2_t password_cb
; /* Password callback */
133 void *password_data
; /* Password user data */
134 http_tls_credentials_t tls_credentials
;
135 /* Default client credentials */
136 cups_client_cert_cb_t client_cert_cb
; /* Client certificate callback */
137 void *client_cert_data
;
138 /* Client certificate user data */
139 cups_server_cert_cb_t server_cert_cb
; /* Server certificate callback */
140 void *server_cert_data
;
141 /* Server certificate user data */
142 int any_root
, /* Allow any root */
143 expired_certs
, /* Allow expired certs */
144 expired_root
; /* Allow expired root */
147 char def_printer
[256];
148 /* Default printer */
149 char ppd_filename
[HTTP_MAX_URI
];
158 extern http_t
*_cupsConnect(void);
159 extern int _cupsGet1284Values(const char *device_id
,
160 cups_option_t
**values
);
161 extern const char *_cupsGetPassword(const char *prompt
);
162 extern void _cupsGlobalLock(void);
163 extern _cups_globals_t
*_cupsGlobals(void);
164 extern void _cupsGlobalUnlock(void);
165 extern void _cupsSetDefaults(void);
166 extern void _cupsSetError(ipp_status_t status
, const char *message
,
168 extern void _cupsSetHTTPError(http_status_t status
);
169 extern char *_cupsUserDefault(char *name
, size_t namesize
);
178 # endif /* __cplusplus */
179 #endif /* !_CUPS_CUPS_PRIVATE_H_ */