]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/globals.h
Load cups into easysw/current.
[thirdparty/cups.git] / cups / globals.h
1 /*
2 * "$Id: globals.h 6499 2007-04-30 21:44:43Z mike $"
3 *
4 * Global variable definitions for the Common UNIX Printing System (CUPS).
5 *
6 * Copyright 1997-2007 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 char language[32]; /* Cached language */
102 # endif /* __APPLE__ */
103
104 /* ppd.c */
105 ppd_status_t ppd_status; /* Status of last ppdOpen*() */
106 int ppd_line; /* Current line number */
107 ppd_conform_t ppd_conform; /* Level of conformance required */
108
109 /* tempfile.c */
110 char tempfile[1024]; /* cupsTempFd/File buffer */
111
112 /* usersys.c */
113 http_encryption_t encryption; /* Encryption setting */
114 char user[65], /* User name */
115 server[256], /* Server address */
116 servername[256];/* Server hostname */
117 cups_password_cb_t password_cb; /* Password callback */
118
119 /* util.c */
120 http_t *http; /* Current server connection */
121 ipp_status_t last_error; /* Last IPP error */
122 char *last_status_message;
123 /* Last IPP status-message */
124
125 char def_printer[256];
126 /* Default printer */
127 char ppd_filename[HTTP_MAX_URI];
128 /* PPD filename */
129 } _cups_globals_t;
130
131
132 /*
133 * Prototypes...
134 */
135
136 extern const char *_cupsGetPassword(const char *prompt);
137 extern _cups_globals_t *_cupsGlobals(void);
138 extern void _cupsSetError(ipp_status_t status, const char *message);
139
140
141 /*
142 * C++ magic...
143 */
144
145 # ifdef __cplusplus
146 }
147 # endif /* __cplusplus */
148 #endif /* !_CUPS_GLOBALS_H_ */
149
150 /*
151 * End of "$Id: globals.h 6499 2007-04-30 21:44:43Z mike $".
152 */