2 * "$Id: globals.h 6712 2007-07-24 00:13:05Z mike $"
4 * Global variable definitions for the Common UNIX Printing System (CUPS).
6 * Copyright 2007-2008 by Apple Inc.
7 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
9 * These coded instructions, statements, and computer programs are the
10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * which should have been included with this file. If this file is
13 * file is missing or damaged, see the license at "http://www.cups.org/".
15 * This file is subject to the Apple OS-Developed Software exception.
18 #ifndef _CUPS_GLOBALS_H_
19 # define _CUPS_GLOBALS_H_
22 * Include necessary headers...
26 # include "http-private.h"
30 # ifdef HAVE_PTHREAD_H
32 # endif /* HAVE_PTHREAD_H */
41 # endif /* __cplusplus */
45 * To make libcups thread safe, define thread safe globals (aka thread-
46 * specific data) for the static variables used in the library.
49 typedef struct _cups_globals_s
/**** CUPS global state data ****/
51 /* Multiple places... */
52 const char *cups_datadir
, /* CUPS_DATADIR environment var */
53 *cups_serverbin
,/* CUPS_SERVERBIN environment var */
55 /* CUPS_SERVERROOT environment var */
56 *cups_statedir
, /* CUPS_STATEDIR environment var */
57 *localedir
; /* LOCALDIR environment var */
60 time_t cupsd_update
; /* Last time we got or set cupsd.conf */
61 char cupsd_hostname
[HTTP_MAX_HOST
];
62 /* Hostname for connection */
63 int cupsd_num_settings
;
64 /* Number of server settings */
65 cups_option_t
*cupsd_settings
;/* Server settings */
68 cups_file_t
*stdio_files
[3];/* stdin, stdout, stderr */
71 char http_date
[256]; /* Date+time buffer */
74 unsigned ip_addr
; /* Packed IPv4 address */
75 char *ip_ptrs
[2]; /* 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 */
82 ipp_uchar_t ipp_date
[11]; /* RFC-1903 date/time data */
85 int ipp_port
; /* IPP port number */
86 char ipp_unknown
[255];
87 /* Unknown error statuses */
90 cups_lang_t
*lang_default
; /* Default language */
92 char language
[32]; /* Cached language */
93 # endif /* __APPLE__ */
96 ppd_status_t ppd_status
; /* Status of last ppdOpen*() */
97 int ppd_line
; /* Current line number */
98 ppd_conform_t ppd_conform
; /* Level of conformance required */
101 char snmp_community
[255];
102 /* Default SNMP community name */
103 int snmp_debug
; /* Log SNMP IO to stderr? */
106 char tempfile
[1024]; /* cupsTempFd/File buffer */
109 http_encryption_t encryption
; /* Encryption setting */
110 char user
[65], /* User name */
111 server
[256], /* Server address */
112 servername
[256];/* Server hostname */
113 cups_password_cb_t password_cb
; /* Password callback */
116 http_t
*http
; /* Current server connection */
117 ipp_status_t last_error
; /* Last IPP error */
118 char *last_status_message
;
119 /* Last IPP status-message */
121 char def_printer
[256];
122 /* Default printer */
123 char ppd_filename
[HTTP_MAX_URI
];
132 extern http_t
*_cupsConnect(void);
133 extern const char *_cupsGetPassword(const char *prompt
);
134 extern _cups_globals_t
*_cupsGlobals(void);
135 extern void _cupsSetError(ipp_status_t status
, const char *message
);
136 extern void _cupsSetHTTPError(http_status_t status
);
145 # endif /* __cplusplus */
146 #endif /* !_CUPS_GLOBALS_H_ */
149 * End of "$Id: globals.h 6712 2007-07-24 00:13:05Z mike $".