]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/globals.h
Merge changes from CUPS 1.4svn-r7696.
[thirdparty/cups.git] / cups / globals.h
CommitLineData
ef416fc2 1/*
75bd9771 2 * "$Id: globals.h 7583 2008-05-16 17:47:16Z mike $"
ef416fc2 3 *
4 * Global variable definitions for the Common UNIX Printing System (CUPS).
5 *
91c84a35 6 * Copyright 2007-2008 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
18#ifndef _CUPS_GLOBALS_H_
19# define _CUPS_GLOBALS_H_
20
21/*
22 * Include necessary headers...
23 */
24
25# include "string.h"
8ca02f3c 26# include "http-private.h"
ef416fc2 27# include "cups.h"
28# include "i18n.h"
ef416fc2 29
30# ifdef HAVE_PTHREAD_H
31# include <pthread.h>
32# endif /* HAVE_PTHREAD_H */
33
34
35/*
36 * C++ magic...
37 */
38
39# ifdef __cplusplus
40extern "C" {
41# endif /* __cplusplus */
42
43
44/*
45 * To make libcups thread safe, define thread safe globals (aka thread-
46 * specific data) for the static variables used in the library.
47 */
48
49typedef struct _cups_globals_s /**** CUPS global state data ****/
50{
51 /* Multiple places... */
52 const char *cups_datadir, /* CUPS_DATADIR environment var */
53 *cups_serverbin,/* CUPS_SERVERBIN environment var */
54 *cups_serverroot,
55 /* CUPS_SERVERROOT environment var */
56 *cups_statedir, /* CUPS_STATEDIR environment var */
57 *localedir; /* LOCALDIR environment var */
58
757d2cad 59 /* adminutil.c */
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 */
66
5eb9da71
MS
67 /* backend.c */
68 char resolved_uri[1024];
69 /* Buffer for cupsBackendDeviceURI */
70
ae71f5de
MS
71#ifdef DEBUG
72 /* debug.c */
73 int debug_init, /* Did we initialize debugging? */
74 debug_fd; /* Debug log file descriptor */
75#endif /* DEBUG */
76
80ca4592 77 /* file.c */
78 cups_file_t *stdio_files[3];/* stdin, stdout, stderr */
79
ef416fc2 80 /* http.c */
81 char http_date[256]; /* Date+time buffer */
82
83 /* http-addr.c */
84 unsigned ip_addr; /* Packed IPv4 address */
85 char *ip_ptrs[2]; /* Pointer to packed address */
86 struct hostent hostent; /* Host entry for IP address */
87# ifdef HAVE_GETADDRINFO
88 char hostname[1024]; /* Hostname */
89# endif /* HAVE_GETADDRINFO */
90
91 /* ipp.c */
92 ipp_uchar_t ipp_date[11]; /* RFC-1903 date/time data */
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
91c84a35 110 /* snmp.c */
ac884b6a
MS
111 char snmp_community[255];
112 /* Default SNMP community name */
91c84a35
MS
113 int snmp_debug; /* Log SNMP IO to stderr? */
114
ef416fc2 115 /* tempfile.c */
116 char tempfile[1024]; /* cupsTempFd/File buffer */
117
ef416fc2 118 /* usersys.c */
119 http_encryption_t encryption; /* Encryption setting */
120 char user[65], /* User name */
121 server[256], /* Server address */
122 servername[256];/* Server hostname */
123 cups_password_cb_t password_cb; /* Password callback */
124
125 /* util.c */
126 http_t *http; /* Current server connection */
127 ipp_status_t last_error; /* Last IPP error */
128 char *last_status_message;
129 /* Last IPP status-message */
130
131 char def_printer[256];
132 /* Default printer */
133 char ppd_filename[HTTP_MAX_URI];
134 /* PPD filename */
135} _cups_globals_t;
136
137
138/*
139 * Prototypes...
140 */
141
3d052e43 142extern http_t *_cupsConnect(void);
ef416fc2 143extern const char *_cupsGetPassword(const char *prompt);
144extern _cups_globals_t *_cupsGlobals(void);
ecdc0628 145extern void _cupsSetError(ipp_status_t status, const char *message);
355e94dc 146extern void _cupsSetHTTPError(http_status_t status);
ef416fc2 147
148
149/*
150 * C++ magic...
151 */
152
153# ifdef __cplusplus
154}
155# endif /* __cplusplus */
156#endif /* !_CUPS_GLOBALS_H_ */
157
158/*
75bd9771 159 * End of "$Id: globals.h 7583 2008-05-16 17:47:16Z mike $".
ef416fc2 160 */