2 * \brief Header: %global definitions for compatibility
4 * This file should be included after all system includes and before all local includes.
10 #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
12 /* An ANSI string.h and pre-ANSI memory.h might conflict */
13 #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
15 #endif /* !STDC_HEADERS & HAVE_MEMORY_H */
17 #else /* !STDC_HEADERS & !HAVE_STRING_H */
19 /* memory and strings.h conflict on other systems */
20 #endif /* !STDC_HEADERS & !HAVE_STRING_H */
22 #ifdef HAVE_SYS_PARAM_H
23 #include <sys/param.h>
26 /*** typedefs(not structures) and defined constants **********************************************/
28 /* The O_BINARY definition was taken from gettext */
29 #if !defined O_BINARY && defined _O_BINARY
30 /* For MSC-compatible compilers. */
31 #define O_BINARY _O_BINARY
34 /* BeOS 5 has O_BINARY, but is has no effect. */
37 /* On reasonable systems, binary I/O is the default. */
42 /* Replacement for O_NONBLOCK */
44 #ifdef O_NDELAY /* SYSV */
45 #define O_NONBLOCK O_NDELAY
47 #define O_NONBLOCK FNDELAY
48 #endif /* !O_NDELAY */
49 #endif /* !O_NONBLOCK */
51 #ifdef HAVE_SYS_SELECT_H
52 #include <sys/select.h>
55 #if defined(__QNX__) && !defined(__QNXNTO__)
56 /* exec*() from <process.h> */
61 #include "glibcompat.h"
64 #define __attribute__(x)
67 /* Solaris9 doesn't have PRIXMAX */
69 #define PRIXMAX PRIxMAX
74 #define _(String) gettext (String)
76 #define N_(String) gettext_noop (String)
78 #define N_(String) (String)
80 #else /* Stubs that do something close enough. */
81 #define textdomain(String)
82 #define gettext(String) (String)
83 #define ngettext(String1,String2,Num) (((Num) == 1) ? (String1) : (String2))
84 #define dgettext(Domain,Message) (Message)
85 #define dcgettext(Domain,Message,Type) (Message)
86 #define bindtextdomain(Domain,Directory)
87 #define _(String) (String)
88 #define N_(String) (String)
89 #endif /* !ENABLE_NLS */
93 #ifdef USE_MAINTAINER_MODE
94 #include "lib/logging.h"
105 #define min(x, y) ((x) > (y) ? (y) : (x))
106 #define max(x, y) ((x) > (y) ? (x) : (y))
108 /* Just for keeping Your's brains from invention a proper size of the buffer :-) */
109 #define BUF_10K 10240L
114 #define BUF_LARGE BUF_1K
115 #define BUF_MEDIUM 512
116 #define BUF_SMALL 128
119 /* AIX compiler doesn't understand '\e' */
120 #define ESC_CHAR '\033'
121 #define ESC_STR "\033"
123 /* OS specific defines */
125 #define PATH_SEP_STR "/"
126 #define PATH_ENV_SEP ':'
127 #define TMPDIR_DEFAULT "/tmp"
128 #define SCRIPT_SUFFIX ""
129 #define get_default_editor() "vi"
130 #define OS_SORT_CASE_SENSITIVE_DEFAULT 1
132 /* C++ style type casts */
133 #define const_cast(m_type, m_expr) ((m_type) (m_expr))
136 #ifdef MC_ENABLE_DEBUGGING_CODE
144 #define MC_ERROR g_quark_from_static_string (PACKAGE)
146 /*** enums ***************************************************************************************/
148 /* run mode and params */
157 /*** structures declarations (and typedefs of structures)*****************************************/
161 #ifdef WITH_BACKGROUND
162 /* If true, this is a background process */
163 int we_are_background
;
164 #endif /* WITH_BACKGROUND */
167 * If utf-8 terminal utf8_display = 1
168 * Display bits set UTF-8
172 /* Set if the nice message (hint) bar is visible */
175 /* Set if the nice and useful keybar is visible */
178 mc_run_mode_t mc_run_mode
;
181 /* Numbers of (file I/O) and (input/display) codepages. -1 if not selected */
183 int display_codepage
;
185 /* If true, allow characters in the range 160-255 */
188 * If true, also allow characters in the range 128-159.
189 * This is reported to break on many terminals (xterm, qansi-m).
192 #endif /* !HAVE_CHARSET */
194 /* sysconfig_dir: Area for default settings from maintainers of distributuves
195 default is /etc/mc or may be defined by MC_DATADIR
199 /* share_data_dir: Area for default settings from developers */
200 char *share_data_dir
;
202 /* Ugly hack in order to distinguish between left and right panel in menubar */
203 /* Set if the command is being run from the "Right" menu */
204 gboolean is_right
; /* If the selected menu was the right */
208 /* Use the specified skin */
211 /* Set to force black and white display at program startup */
212 gboolean disable_colors
;
214 /* If true use +, -, | for line drawing */
215 gboolean ugly_line_drawing
;
217 /* For slow terminals */
218 gboolean slow_terminal
;
224 /* Used so that widgets know if they are being destroyed or shut down */
225 gboolean midnight_shutdown
;
227 /* Asks for confirmation before clean up of history */
228 gboolean confirm_history_cleanup
;
230 /* Set if you want the possible completions dialog for the first time */
231 gboolean show_all_if_ambiguous
;
237 char *setup_color_string
;
238 char *term_color_string
;
239 char *color_terminal_string
;
241 /* Set if the window has changed it's size */
244 #ifndef LINUX_CONS_SAVER_C
245 /* Used only in mc, not in cons.saver */
247 #endif /* !LINUX_CONS_SAVER_C */
248 /* If using a subshell for evaluating commands this is true */
249 gboolean use_subshell
;
250 #ifdef HAVE_SUBSHELL_SUPPORT
251 /* File descriptors of the pseudoterminal used by the subshell */
253 #endif /* !HAVE_SUBSHELL_SUPPORT */
255 /* colors specified on the command line: they override any other setting */
256 char *command_line_colors
;
262 /* Set when cd symlink following is desirable (bash mode) */
263 gboolean cd_symlinks
;
268 /*** global variables defined in .c file *********************************************************/
270 extern mc_global_t mc_global
;
272 /*** declarations of public functions ************************************************************/
274 void refresh_screen (void *);
276 /*** inline functions ****************************************************************************/