2 * "$Id: globals.h 4967 2006-01-24 03:42:15Z mike $"
4 * Global variable definitions for the Common UNIX Printing System (CUPS).
6 * Copyright 1997-2006 by Easy Software Products, all rights reserved.
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
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
24 * This file is subject to the Apple OS-Developed Software exception.
27 #ifndef _CUPS_GLOBALS_H_
28 # define _CUPS_GLOBALS_H_
31 * Include necessary headers...
37 # include "normalize.h"
38 # include "transcode.h"
40 # ifdef HAVE_PTHREAD_H
42 # endif /* HAVE_PTHREAD_H */
51 # endif /* __cplusplus */
55 * To make libcups thread safe, define thread safe globals (aka thread-
56 * specific data) for the static variables used in the library.
59 typedef struct _cups_globals_s
/**** CUPS global state data ****/
61 /* Multiple places... */
62 const char *cups_datadir
, /* CUPS_DATADIR environment var */
63 *cups_serverbin
,/* CUPS_SERVERBIN environment var */
65 /* CUPS_SERVERROOT environment var */
66 *cups_statedir
, /* CUPS_STATEDIR environment var */
67 *localedir
; /* LOCALDIR environment var */
70 char http_date
[256]; /* Date+time buffer */
73 unsigned ip_addr
; /* Packed IPv4 address */
74 char *ip_ptrs
[2]; /* Pointer to packed address */
75 struct hostent hostent
; /* Host entry for IP address */
76 # ifdef HAVE_GETADDRINFO
77 char hostname
[1024]; /* Hostname */
78 # endif /* HAVE_GETADDRINFO */
81 ipp_uchar_t ipp_date
[11]; /* RFC-1903 date/time data */
84 int ipp_port
; /* IPP port number */
85 char ipp_unknown
[255];
86 /* Unknown error statuses */
89 _cups_norm_map_t
*normmap_cache
; /* Normalize Map cache */
90 _cups_fold_map_t
*foldmap_cache
; /* Case Fold cache */
91 _cups_prop_map_t
*propmap_cache
; /* Char Prop Map Cache */
92 _cups_comb_map_t
*combmap_cache
; /* Comb Class Map Cache */
93 _cups_break_map_t
*breakmap_cache
;/* Line Break Map Cache */
96 cups_lang_t
*lang_cache
; /* Language string cache */
97 cups_lang_t
*lang_default
; /* Default language */
99 # ifdef HAVE_CF_LOCALE_ID
100 char language
[32]; /* Cached language */
102 const char *language
; /* Cached language */
103 # endif /* HAVE_CF_LOCALE_ID */
104 # endif /* __APPLE__ */
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 */
112 char tempfile
[1024]; /* cupsTempFd/File buffer */
115 _cups_cmap_t
*cmap_cache
; /* SBCS Charmap Cache */
116 _cups_vmap_t
*vmap_cache
; /* VBCS Charmap Cache */
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 */
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 */
131 char def_printer
[256];
132 /* Default printer */
133 char ppd_filename
[HTTP_MAX_URI
];
142 extern const char *_cupsGetPassword(const char *prompt
);
143 extern _cups_globals_t
*_cupsGlobals(void);
144 extern void _cupsLangFlush(_cups_globals_t
*cg
);
145 extern void _cupsCharmapFlush(_cups_globals_t
*cg
);
146 extern void _cupsNormalizeMapsFlush(_cups_globals_t
*cg
);
155 # endif /* __cplusplus */
156 #endif /* !_CUPS_GLOBALS_H_ */
159 * End of "$Id: globals.h 4967 2006-01-24 03:42:15Z mike $".