]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/globals.h
Load cups into easysw/current.
[thirdparty/cups.git] / cups / globals.h
CommitLineData
ef416fc2 1/*
f7faf1f5 2 * "$Id: globals.h 5366 2006-04-02 16:11:04Z mike $"
ef416fc2 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 "cups.h"
36# include "i18n.h"
ef416fc2 37
38# ifdef HAVE_PTHREAD_H
39# include <pthread.h>
40# endif /* HAVE_PTHREAD_H */
41
42
43/*
44 * C++ magic...
45 */
46
47# ifdef __cplusplus
48extern "C" {
49# endif /* __cplusplus */
50
51
52/*
53 * To make libcups thread safe, define thread safe globals (aka thread-
54 * specific data) for the static variables used in the library.
55 */
56
57typedef struct _cups_globals_s /**** CUPS global state data ****/
58{
59 /* Multiple places... */
60 const char *cups_datadir, /* CUPS_DATADIR environment var */
61 *cups_serverbin,/* CUPS_SERVERBIN environment var */
62 *cups_serverroot,
63 /* CUPS_SERVERROOT environment var */
64 *cups_statedir, /* CUPS_STATEDIR environment var */
65 *localedir; /* LOCALDIR environment var */
66
757d2cad 67 /* adminutil.c */
68 time_t cupsd_update; /* Last time we got or set cupsd.conf */
69 char cupsd_hostname[HTTP_MAX_HOST];
70 /* Hostname for connection */
71 int cupsd_num_settings;
72 /* Number of server settings */
73 cups_option_t *cupsd_settings;/* Server settings */
74
80ca4592 75 /* file.c */
76 cups_file_t *stdio_files[3];/* stdin, stdout, stderr */
77
ef416fc2 78 /* http.c */
79 char http_date[256]; /* Date+time buffer */
80
81 /* http-addr.c */
82 unsigned ip_addr; /* Packed IPv4 address */
83 char *ip_ptrs[2]; /* Pointer to packed address */
84 struct hostent hostent; /* Host entry for IP address */
85# ifdef HAVE_GETADDRINFO
86 char hostname[1024]; /* Hostname */
87# endif /* HAVE_GETADDRINFO */
88
89 /* ipp.c */
90 ipp_uchar_t ipp_date[11]; /* RFC-1903 date/time data */
91
92 /* ipp-support.c */
93 int ipp_port; /* IPP port number */
94 char ipp_unknown[255];
95 /* Unknown error statuses */
96
ef416fc2 97 /* language.c */
fa73b229 98 cups_lang_t *lang_default; /* Default language */
ef416fc2 99# ifdef __APPLE__
100# ifdef HAVE_CF_LOCALE_ID
101 char language[32]; /* Cached language */
102# else
103 const char *language; /* Cached language */
104# endif /* HAVE_CF_LOCALE_ID */
105# endif /* __APPLE__ */
106
107 /* ppd.c */
108 ppd_status_t ppd_status; /* Status of last ppdOpen*() */
109 int ppd_line; /* Current line number */
110 ppd_conform_t ppd_conform; /* Level of conformance required */
111
112 /* tempfile.c */
113 char tempfile[1024]; /* cupsTempFd/File buffer */
114
ef416fc2 115 /* usersys.c */
116 http_encryption_t encryption; /* Encryption setting */
117 char user[65], /* User name */
118 server[256], /* Server address */
119 servername[256];/* Server hostname */
120 cups_password_cb_t password_cb; /* Password callback */
121
122 /* util.c */
123 http_t *http; /* Current server connection */
124 ipp_status_t last_error; /* Last IPP error */
125 char *last_status_message;
126 /* Last IPP status-message */
127
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
139extern const char *_cupsGetPassword(const char *prompt);
140extern _cups_globals_t *_cupsGlobals(void);
ecdc0628 141extern void _cupsSetError(ipp_status_t status, const char *message);
ef416fc2 142
143
144/*
145 * C++ magic...
146 */
147
148# ifdef __cplusplus
149}
150# endif /* __cplusplus */
151#endif /* !_CUPS_GLOBALS_H_ */
152
153/*
f7faf1f5 154 * End of "$Id: globals.h 5366 2006-04-02 16:11:04Z mike $".
ef416fc2 155 */