]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/globals.h
0cabe56b8fab3ef35794202212b3cb1a2b506b33
[thirdparty/cups.git] / cups / globals.h
1 /*
2 * "$Id$"
3 *
4 * Global variable definitions for the Common UNIX Printing System (CUPS).
5 *
6 * Copyright 1997-2005 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 "cups.h"
36 # include "language.h"
37 # include "normalize.h"
38 # include "transcode.h"
39
40 # ifdef HAVE_PTHREAD_H
41 # include <pthread.h>
42 # endif /* HAVE_PTHREAD_H */
43
44
45 /*
46 * C++ magic...
47 */
48
49 # ifdef __cplusplus
50 extern "C" {
51 # endif /* __cplusplus */
52
53
54 /*
55 * Constants/limits...
56 */
57
58 # define CUPS_MAX_ADDRS 100 /* Limit on number of addresses... */
59
60
61 /*
62 * To make libcups thread safe, define thread safe globals (aka thread-
63 * specific data) for the static variables used in the library.
64 */
65
66 typedef struct _cups_globals_s /**** CUPS global state data ****/
67 {
68 /* http.c */
69 char http_date[256]; /* Date+time buffer */
70
71 /* http-addr.c */
72 unsigned ip_addrs[CUPS_MAX_ADDRS][4];
73 /* Packed IPv4/6 addresses */
74 char *ip_ptrs[CUPS_MAX_ADDRS + 1];
75 /* Pointer to packed address */
76 struct hostent hostent; /* Host entry for IP address */
77 # ifdef HAVE_GETADDRINFO
78 char hostname[1024]; /* Hostname */
79 # endif /* HAVE_GETADDRINFO */
80
81 /* ipp.c */
82 ipp_uchar_t ipp_date[11]; /* RFC-1903 date/time data */
83
84 /* ipp-support.c */
85 int ipp_port; /* IPP port number */
86 char ipp_unknown[255];
87 /* Unknown error statuses */
88
89 /* normalize.c */
90 _cups_norm_map_t *normmap_cache; /* Normalize Map cache */
91 _cups_fold_map_t *foldmap_cache; /* Case Fold cache */
92 _cups_prop_map_t *propmap_cache; /* Char Prop Map Cache */
93 _cups_comb_map_t *combmap_cache; /* Comb Class Map Cache */
94 _cups_break_map_t *breakmap_cache;/* Line Break Map Cache */
95
96 /* language.c */
97 cups_lang_t *lang_cache; /* Language string cache */
98 # ifdef __APPLE__
99 # ifdef HAVE_CF_LOCALE_ID
100 char language[32]; /* Cached language */
101 # else
102 const char *language; /* Cached language */
103 # endif /* HAVE_CF_LOCALE_ID */
104 # endif /* __APPLE__ */
105
106 /* ppd.c */
107 ppd_status_t ppd_status; /* Status of last ppdOpen*() */
108 int ppd_line; /* Current line number */
109 ppd_conform_t ppd_conform; /* Level of conformance required */
110
111 /* tempfile.c */
112 char tempfile[1024]; /* cupsTempFd/File buffer */
113
114 /* transcode.c */
115 _cups_cmap_t *cmap_cache; /* SBCS Charmap Cache */
116 _cups_vmap_t *vmap_cache; /* VBCS Charmap Cache */
117
118 /* usersys.c */
119 http_encryption_t encryption; /* Encryption setting */
120 char user[65], /* User name */
121 server[256]; /* Server address */
122 const char *(*password_cb)(const char *);
123 /* Password callback */
124
125 /* util.c */
126 http_t *http; /* Current server connection */
127 ipp_status_t last_error; /* Last IPP error */
128 char def_printer[256];
129 /* Default printer */
130 char ppd_filename[HTTP_MAX_URI];
131 /* PPD filename */
132 } _cups_globals_t;
133
134
135 /*
136 * Prototypes...
137 */
138
139 extern const char *_cupsGetPassword(const char *prompt);
140 extern _cups_globals_t *_cupsGlobals(void);
141
142
143 /*
144 * C++ magic...
145 */
146
147 # ifdef __cplusplus
148 }
149 # endif /* __cplusplus */
150 #endif /* !_CUPS_GLOBALS_H_ */
151
152 /*
153 * End of "$Id$".
154 */