]>
Commit | Line | Data |
---|---|---|
03f61bf3 | 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 | ||
03f61bf3 | 54 | /* |
55 | * To make libcups thread safe, define thread safe globals (aka thread- | |
56 | * specific data) for the static variables used in the library. | |
57 | */ | |
58 | ||
2625096f | 59 | typedef struct _cups_globals_s /**** CUPS global state data ****/ |
03f61bf3 | 60 | { |
61 | /* http.c */ | |
62 | char http_date[256]; /* Date+time buffer */ | |
63 | ||
64 | /* http-addr.c */ | |
086c584d | 65 | unsigned ip_addr; /* Packed IPv4 address */ |
66 | char *ip_ptrs[2]; /* Pointer to packed address */ | |
03f61bf3 | 67 | struct hostent hostent; /* Host entry for IP address */ |
68 | # ifdef HAVE_GETADDRINFO | |
69 | char hostname[1024]; /* Hostname */ | |
70 | # endif /* HAVE_GETADDRINFO */ | |
71 | ||
72 | /* ipp.c */ | |
73 | ipp_uchar_t ipp_date[11]; /* RFC-1903 date/time data */ | |
74 | ||
75 | /* ipp-support.c */ | |
76 | int ipp_port; /* IPP port number */ | |
77 | char ipp_unknown[255]; | |
78 | /* Unknown error statuses */ | |
79 | ||
80 | /* normalize.c */ | |
2625096f | 81 | _cups_norm_map_t *normmap_cache; /* Normalize Map cache */ |
82 | _cups_fold_map_t *foldmap_cache; /* Case Fold cache */ | |
83 | _cups_prop_map_t *propmap_cache; /* Char Prop Map Cache */ | |
84 | _cups_comb_map_t *combmap_cache; /* Comb Class Map Cache */ | |
85 | _cups_break_map_t *breakmap_cache;/* Line Break Map Cache */ | |
03f61bf3 | 86 | |
87 | /* language.c */ | |
88 | cups_lang_t *lang_cache; /* Language string cache */ | |
89 | # ifdef __APPLE__ | |
90 | # ifdef HAVE_CF_LOCALE_ID | |
91 | char language[32]; /* Cached language */ | |
92 | # else | |
93 | const char *language; /* Cached language */ | |
94 | # endif /* HAVE_CF_LOCALE_ID */ | |
95 | # endif /* __APPLE__ */ | |
96 | ||
97 | /* ppd.c */ | |
98 | ppd_status_t ppd_status; /* Status of last ppdOpen*() */ | |
99 | int ppd_line; /* Current line number */ | |
100 | ppd_conform_t ppd_conform; /* Level of conformance required */ | |
101 | ||
102 | /* tempfile.c */ | |
103 | char tempfile[1024]; /* cupsTempFd/File buffer */ | |
104 | ||
105 | /* transcode.c */ | |
2625096f | 106 | _cups_cmap_t *cmap_cache; /* SBCS Charmap Cache */ |
107 | _cups_vmap_t *vmap_cache; /* VBCS Charmap Cache */ | |
03f61bf3 | 108 | |
109 | /* usersys.c */ | |
110 | http_encryption_t encryption; /* Encryption setting */ | |
111 | char user[65], /* User name */ | |
086c584d | 112 | server[256], /* Server address */ |
c94f4aa9 | 113 | servername[256];/* Server hostname */ |
03f61bf3 | 114 | const char *(*password_cb)(const char *); |
115 | /* Password callback */ | |
116 | ||
117 | /* util.c */ | |
118 | http_t *http; /* Current server connection */ | |
119 | ipp_status_t last_error; /* Last IPP error */ | |
120 | char def_printer[256]; | |
121 | /* Default printer */ | |
122 | char ppd_filename[HTTP_MAX_URI]; | |
123 | /* PPD filename */ | |
2625096f | 124 | } _cups_globals_t; |
03f61bf3 | 125 | |
126 | ||
127 | /* | |
128 | * Prototypes... | |
129 | */ | |
130 | ||
131 | extern const char *_cupsGetPassword(const char *prompt); | |
2625096f | 132 | extern _cups_globals_t *_cupsGlobals(void); |
03f61bf3 | 133 | |
134 | ||
135 | /* | |
136 | * C++ magic... | |
137 | */ | |
138 | ||
139 | # ifdef __cplusplus | |
140 | } | |
141 | # endif /* __cplusplus */ | |
142 | #endif /* !_CUPS_GLOBALS_H_ */ | |
143 | ||
144 | /* | |
145 | * End of "$Id$". | |
146 | */ |