]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/cups-private.h
Fix AUTH_UID for peer credentials.
[thirdparty/cups.git] / cups / cups-private.h
CommitLineData
03f61bf3 1/*
2 * "$Id$"
3 *
3d94661a 4 * Private definitions for CUPS.
03f61bf3 5 *
181f5167 6 * Copyright 2007-2011 by Apple Inc.
753db4fd 7 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
03f61bf3 8 *
9 * These coded instructions, statements, and computer programs are the
4e8d321f 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/".
03f61bf3 14 *
15 * This file is subject to the Apple OS-Developed Software exception.
16 */
17
3d94661a 18#ifndef _CUPS_CUPS_PRIVATE_H_
19# define _CUPS_CUPS_PRIVATE_H_
03f61bf3 20
21/*
22 * Include necessary headers...
23 */
24
3d94661a 25# include <cups/cups.h>
26# include "string-private.h"
27# include "debug-private.h"
c14eaf92 28# include "ppd-private.h"
72510b94 29# include "http-private.h"
3d94661a 30# include "ipp-private.h"
31# include "language-private.h"
64dd1836 32# include "pwg-private.h"
fa7e8544 33# include "thread-private.h"
181f5167 34# ifdef __APPLE__
35# include <sys/cdefs.h>
36# include <CoreFoundation/CoreFoundation.h>
37# endif /* __APPLE__ */
03f61bf3 38
39
40/*
41 * C++ magic...
42 */
43
44# ifdef __cplusplus
45extern "C" {
46# endif /* __cplusplus */
47
48
03f61bf3 49/*
3d94661a 50 * Types...
03f61bf3 51 */
52
2625096f 53typedef struct _cups_globals_s /**** CUPS global state data ****/
03f61bf3 54{
a501ad17 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
7701ffe8 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
9200f229 71 /* auth.c */
72# ifdef HAVE_GSSAPI
73 char gss_service_name[32];
74 /* Kerberos service name */
75# endif /* HAVE_GSSAPI */
76
012d7a28 77 /* backend.c */
78 char resolved_uri[1024];
79 /* Buffer for cupsBackendDeviceURI */
80
5cc5c44f 81 /* file.c */
82 cups_file_t *stdio_files[3];/* stdin, stdout, stderr */
83
03f61bf3 84 /* http.c */
85 char http_date[256]; /* Date+time buffer */
86
87 /* http-addr.c */
086c584d 88 unsigned ip_addr; /* Packed IPv4 address */
89 char *ip_ptrs[2]; /* Pointer to packed address */
03f61bf3 90 struct hostent hostent; /* Host entry for IP address */
91# ifdef HAVE_GETADDRINFO
92 char hostname[1024]; /* Hostname */
93# endif /* HAVE_GETADDRINFO */
36b81b47 94 int need_res_init; /* Need to reinitialize resolver? */
03f61bf3 95
96 /* ipp.c */
97 ipp_uchar_t ipp_date[11]; /* RFC-1903 date/time data */
d6371bd7 98 _ipp_buffer_t *ipp_buffers; /* Buffer list */
03f61bf3 99
100 /* ipp-support.c */
101 int ipp_port; /* IPP port number */
102 char ipp_unknown[255];
103 /* Unknown error statuses */
104
03f61bf3 105 /* language.c */
89fd567e 106 cups_lang_t *lang_default; /* Default language */
03f61bf3 107# ifdef __APPLE__
03f61bf3 108 char language[32]; /* Cached language */
03f61bf3 109# endif /* __APPLE__ */
110
111 /* ppd.c */
112 ppd_status_t ppd_status; /* Status of last ppdOpen*() */
113 int ppd_line; /* Current line number */
114 ppd_conform_t ppd_conform; /* Level of conformance required */
115
64dd1836 116 /* pwg-media.c */
117 cups_array_t *leg_size_lut, /* Lookup table for legacy names */
118 *ppd_size_lut, /* Lookup table for PPD names */
119 *pwg_size_lut; /* Lookup table for PWG names */
120 _pwg_media_t pwg_media; /* PWG media data for custom size */
121 char pwg_name[65]; /* PWG media name for custom size */
22d59a30 122
29a3a9e6 123 /* request.c */
124 http_t *http; /* Current server connection */
125 ipp_status_t last_error; /* Last IPP error */
126 char *last_status_message;
127 /* Last IPP status-message */
128
958bdaa3 129 /* snmp.c */
896cc0e8 130 char snmp_community[255];
131 /* Default SNMP community name */
958bdaa3 132 int snmp_debug; /* Log SNMP IO to stderr? */
133
03f61bf3 134 /* tempfile.c */
135 char tempfile[1024]; /* cupsTempFd/File buffer */
136
03f61bf3 137 /* usersys.c */
138 http_encryption_t encryption; /* Encryption setting */
139 char user[65], /* User name */
086c584d 140 server[256], /* Server address */
c94f4aa9 141 servername[256];/* Server hostname */
c890e5ea 142 cups_password_cb2_t password_cb; /* Password callback */
143 void *password_data; /* Password user data */
b9738d7c 144 http_tls_credentials_t tls_credentials;
145 /* Default client credentials */
146 cups_client_cert_cb_t client_cert_cb; /* Client certificate callback */
147 void *client_cert_data;
148 /* Client certificate user data */
149 cups_server_cert_cb_t server_cert_cb; /* Server certificate callback */
150 void *server_cert_data;
151 /* Server certificate user data */
152 int any_root, /* Allow any root */
153 expired_certs, /* Allow expired certs */
154 expired_root; /* Allow expired root */
03f61bf3 155
156 /* util.c */
03f61bf3 157 char def_printer[256];
158 /* Default printer */
159 char ppd_filename[HTTP_MAX_URI];
160 /* PPD filename */
2625096f 161} _cups_globals_t;
03f61bf3 162
163
164/*
165 * Prototypes...
166 */
167
181f5167 168# ifdef __APPLE__
169extern CFStringRef _cupsAppleCopyDefaultPaperID(void);
56c4a391 170extern CFStringRef _cupsAppleCopyDefaultPrinter(void);
181f5167 171extern int _cupsAppleGetUseLastPrinter(void);
172extern void _cupsAppleSetDefaultPaperID(CFStringRef name);
56c4a391 173extern void _cupsAppleSetDefaultPrinter(CFStringRef name);
181f5167 174extern void _cupsAppleSetUseLastPrinter(int uselast);
175# endif /* __APPLE__ */
176
36883182 177extern http_t *_cupsConnect(void);
2256cc12 178extern int _cupsGet1284Values(const char *device_id,
179 cups_option_t **values);
181f5167 180extern int _cupsGetDests(http_t *http, ipp_op_t op,
56c4a391 181 const char *name, cups_dest_t **dests);
03f61bf3 182extern const char *_cupsGetPassword(const char *prompt);
fa7e8544 183extern void _cupsGlobalLock(void);
2625096f 184extern _cups_globals_t *_cupsGlobals(void);
fa7e8544 185extern void _cupsGlobalUnlock(void);
fc596e79 186extern int _cupsNextDelay(int current, int *previous);
d4c4cd54 187extern void _cupsSetDefaults(void);
e6f60272 188extern void _cupsSetError(ipp_status_t status, const char *message,
189 int localize);
64e79e51 190extern void _cupsSetHTTPError(http_status_t status);
f5259d8c 191# ifdef HAVE_GSSAPI
ec6e3e5a 192extern int _cupsSetNegotiateAuthString(http_t *http,
193 const char *method,
194 const char *resource);
f5259d8c 195# endif /* HAVE_GSSAPI */
fec07f7a 196extern char *_cupsUserDefault(char *name, size_t namesize);
03f61bf3 197
198
199/*
200 * C++ magic...
201 */
202
203# ifdef __cplusplus
204}
205# endif /* __cplusplus */
3d94661a 206#endif /* !_CUPS_CUPS_PRIVATE_H_ */
03f61bf3 207
208/*
209 * End of "$Id$".
210 */