]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/globals.h
Remove svn:keywords since they cause svn_load_dirs.pl to complain about every file.
[thirdparty/cups.git] / cups / globals.h
1 /*
2 * "$Id: globals.h 181 2006-06-22 20:01:18Z jlovell $"
3 *
4 * Global variable definitions for the Common UNIX Printing System (CUPS).
5 *
6 * Copyright 1997-2006 by Easy Software Products, all rights reserved.
7 *
8 * These coded instructions, statements, and computer programs are the
9 * property of Easy Software Products and are protected by Federal
10 * copyright law. Distribution and use rights are outlined in the file
11 * "LICENSE.txt" which should have been included with this file. If this
12 * file is missing or damaged please contact Easy Software Products
13 * at:
14 *
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
19 *
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
23 *
24 * This file is subject to the Apple OS-Developed Software exception.
25 */
26
27 #ifndef _CUPS_GLOBALS_H_
28 # define _CUPS_GLOBALS_H_
29
30 /*
31 * Include necessary headers...
32 */
33
34 # include "string.h"
35 # include "http-private.h"
36 # include "cups.h"
37 # include "i18n.h"
38
39 # ifdef HAVE_PTHREAD_H
40 # include <pthread.h>
41 # endif /* HAVE_PTHREAD_H */
42
43
44 /*
45 * C++ magic...
46 */
47
48 # ifdef __cplusplus
49 extern "C" {
50 # endif /* __cplusplus */
51
52
53 /*
54 * To make libcups thread safe, define thread safe globals (aka thread-
55 * specific data) for the static variables used in the library.
56 */
57
58 typedef struct _cups_globals_s /**** CUPS global state data ****/
59 {
60 /* Multiple places... */
61 const char *cups_datadir, /* CUPS_DATADIR environment var */
62 *cups_serverbin,/* CUPS_SERVERBIN environment var */
63 *cups_serverroot,
64 /* CUPS_SERVERROOT environment var */
65 *cups_statedir, /* CUPS_STATEDIR environment var */
66 *localedir; /* LOCALDIR environment var */
67
68 /* adminutil.c */
69 time_t cupsd_update; /* Last time we got or set cupsd.conf */
70 char cupsd_hostname[HTTP_MAX_HOST];
71 /* Hostname for connection */
72 int cupsd_num_settings;
73 /* Number of server settings */
74 cups_option_t *cupsd_settings;/* Server settings */
75
76 /* file.c */
77 cups_file_t *stdio_files[3];/* stdin, stdout, stderr */
78
79 /* http.c */
80 char http_date[256]; /* Date+time buffer */
81
82 /* http-addr.c */
83 unsigned ip_addr; /* Packed IPv4 address */
84 char *ip_ptrs[2]; /* Pointer to packed address */
85 struct hostent hostent; /* Host entry for IP address */
86 # ifdef HAVE_GETADDRINFO
87 char hostname[1024]; /* Hostname */
88 # endif /* HAVE_GETADDRINFO */
89
90 /* ipp.c */
91 ipp_uchar_t ipp_date[11]; /* RFC-1903 date/time data */
92
93 /* ipp-support.c */
94 int ipp_port; /* IPP port number */
95 char ipp_unknown[255];
96 /* Unknown error statuses */
97
98 /* language.c */
99 cups_lang_t *lang_default; /* Default language */
100 # ifdef __APPLE__
101 # ifdef HAVE_CF_LOCALE_ID
102 char language[32]; /* Cached language */
103 # else
104 const char *language; /* Cached language */
105 # endif /* HAVE_CF_LOCALE_ID */
106 # endif /* __APPLE__ */
107
108 /* ppd.c */
109 ppd_status_t ppd_status; /* Status of last ppdOpen*() */
110 int ppd_line; /* Current line number */
111 ppd_conform_t ppd_conform; /* Level of conformance required */
112
113 /* tempfile.c */
114 char tempfile[1024]; /* cupsTempFd/File buffer */
115
116 /* usersys.c */
117 http_encryption_t encryption; /* Encryption setting */
118 char user[65], /* User name */
119 server[256], /* Server address */
120 servername[256];/* Server hostname */
121 cups_password_cb_t password_cb; /* Password callback */
122
123 /* util.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
129 char def_printer[256];
130 /* Default printer */
131 char ppd_filename[HTTP_MAX_URI];
132 /* PPD filename */
133 } _cups_globals_t;
134
135
136 /*
137 * Prototypes...
138 */
139
140 extern const char *_cupsGetPassword(const char *prompt);
141 extern _cups_globals_t *_cupsGlobals(void);
142 extern void _cupsSetError(ipp_status_t status, const char *message);
143
144
145 /*
146 * C++ magic...
147 */
148
149 # ifdef __cplusplus
150 }
151 # endif /* __cplusplus */
152 #endif /* !_CUPS_GLOBALS_H_ */
153
154 /*
155 * End of "$Id: globals.h 181 2006-06-22 20:01:18Z jlovell $".
156 */