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(HAVE_STRING_H)
12 /* An ANSI string.h and pre-ANSI memory.h might conflict */
13 #elif defined(HAVE_MEMORY_H)
17 /* memory and strings.h conflict on other systems */
18 #endif /* !STDC_HEADERS & !HAVE_STRING_H */
20 #ifdef HAVE_SYS_PARAM_H
21 #include <sys/param.h>
24 /* for sig_atomic_t */
27 /*** typedefs(not structures) and defined constants **********************************************/
29 /* The O_BINARY definition was taken from gettext */
30 #if !defined O_BINARY && defined _O_BINARY
31 /* For MSC-compatible compilers. */
32 #define O_BINARY _O_BINARY
35 /* BeOS 5 has O_BINARY, but is has no effect. */
38 /* On reasonable systems, binary I/O is the default. */
43 /* Replacement for O_NONBLOCK */
45 #ifdef O_NDELAY /* SYSV */
46 #define O_NONBLOCK O_NDELAY
48 #define O_NONBLOCK FNDELAY
49 #endif /* !O_NDELAY */
50 #endif /* !O_NONBLOCK */
52 #ifdef HAVE_SYS_SELECT_H
53 #include <sys/select.h>
56 #if defined(__QNX__) && !defined(__QNXNTO__)
57 /* exec*() from <process.h> */
62 #include "glibcompat.h"
65 #define __attribute__(x)
68 /* Solaris9 doesn't have PRIXMAX */
70 #define PRIXMAX PRIxMAX
75 #define _(String) gettext (String)
77 #define N_(String) gettext_noop (String)
79 #define N_(String) (String)
81 #else /* Stubs that do something close enough. */
82 #define textdomain(String) 1
83 #define gettext(String) (String)
84 #define ngettext(String1,String2,Num) (((Num) == 1) ? (String1) : (String2))
85 #define dgettext(Domain,Message) (Message)
86 #define dcgettext(Domain,Message,Type) (Message)
87 #define bindtextdomain(Domain,Directory) 1
88 #define _(String) (String)
89 #define N_(String) (String)
90 #endif /* !ENABLE_NLS */
94 #ifdef USE_MAINTAINER_MODE
95 #include "lib/logging.h"
106 #define min(x, y) ((x) > (y) ? (y) : (x))
107 #define max(x, y) ((x) > (y) ? (x) : (y))
109 /* Just for keeping Your's brains from invention a proper size of the buffer :-) */
110 #define BUF_10K 10240L
115 #define BUF_LARGE BUF_1K
116 #define BUF_MEDIUM 512
117 #define BUF_SMALL 128
120 /* ESC_CHAR is defined in /usr/include/langinfo.h in some systems */
124 /* AIX compiler doesn't understand '\e' */
125 #define ESC_CHAR '\033'
126 #define ESC_STR "\033"
128 /* OS specific defines */
130 #define PATH_SEP_STR "/"
131 #define PATH_ENV_SEP ':'
132 #define TMPDIR_DEFAULT "/tmp"
133 #define SCRIPT_SUFFIX ""
134 #define get_default_editor() "vi"
135 #define OS_SORT_CASE_SENSITIVE_DEFAULT 1
136 #define UTF8_CHAR_LEN 6
138 /* Used to distinguish between a normal MC termination and */
139 /* one caused by typing `exit' or `logout' in the subshell */
140 #define SUBSHELL_EXIT 128
142 /* C++ style type casts */
143 #define const_cast(m_type, m_expr) ((m_type) (m_expr))
146 #ifdef MC_ENABLE_DEBUGGING_CODE
156 #define MC_ERROR g_quark_from_static_string (PACKAGE)
158 /*** enums ***************************************************************************************/
160 /* run mode and params */
169 /*** structures declarations (and typedefs of structures)*****************************************/
173 mc_run_mode_t mc_run_mode
;
174 /* Used so that widgets know if they are being destroyed or shut down */
175 gboolean midnight_shutdown
;
177 /* sysconfig_dir: Area for default settings from maintainers of distributuves
178 default is /etc/mc or may be defined by MC_DATADIR */
180 /* share_data_dir: Area for default settings from developers */
181 char *share_data_dir
;
184 /* Numbers of (file I/O) and (input/display) codepages. -1 if not selected */
186 int display_codepage
;
188 /* If true, allow characters in the range 160-255 */
191 * If true, also allow characters in the range 128-159.
192 * This is reported to break on many terminals (xterm, qansi-m).
195 #endif /* !HAVE_CHARSET */
197 * If utf-8 terminal utf8_display = TRUE
198 * Display bits set UTF-8
200 gboolean utf8_display
;
202 /* Set if the nice message (hint) bar is visible */
204 /* Set if the nice and useful keybar is visible */
207 #ifdef ENABLE_BACKGROUND
208 /* If true, this is a background process */
209 gboolean we_are_background
;
210 #endif /* ENABLE_BACKGROUND */
214 /* Asks for confirmation before clean up of history */
215 gboolean confirm_history_cleanup
;
217 /* Set if you want the possible completions dialog for the first time */
218 gboolean show_all_if_ambiguous
;
220 /* Ugly hack in order to distinguish between left and right panel in menubar */
221 /* Set if the command is being run from the "Right" menu */
222 gboolean is_right
; /* If the selected menu was the right */
227 /* Use the specified skin */
230 char *setup_color_string
;
231 char *term_color_string
;
232 char *color_terminal_string
;
233 /* colors specified on the command line: they override any other setting */
234 char *command_line_colors
;
236 #ifndef LINUX_CONS_SAVER_C
237 /* Used only in mc, not in cons.saver */
239 #endif /* !LINUX_CONS_SAVER_C */
240 /* If using a subshell for evaluating commands this is true */
241 gboolean use_subshell
;
242 #ifdef ENABLE_SUBSHELL
243 /* File descriptors of the pseudoterminal used by the subshell */
245 #endif /* !ENABLE_SUBSHELL */
247 /* The user's shell */
250 /* This flag is set by xterm detection routine in function main() */
251 /* It is used by function view_other_cmd() */
254 /* disable x11 support */
255 gboolean disable_x11
;
257 /* For slow terminals */
258 /* If true lines are shown by spaces */
259 gboolean slow_terminal
;
261 /* Set to force black and white display at program startup */
262 gboolean disable_colors
;
264 /* If true use +, -, | for line drawing */
265 gboolean ugly_line_drawing
;
267 /* Tries to use old highlight mouse tracking */
270 /* If true, use + and \ keys normally and select/unselect do if M-+ / M-\.
271 and M-- and keypad + / - */
272 gboolean alternate_plus_minus
;
274 /* Set if the window has changed it's size */
275 SIG_ATOMIC_VOLATILE_T winch_flag
;
280 /* Set when cd symlink following is desirable (bash mode) */
281 gboolean cd_symlinks
;
283 /* Preallocate space before file copying */
284 gboolean preallocate_space
;
289 /*** global variables defined in .c file *********************************************************/
291 extern mc_global_t mc_global
;
293 /*** declarations of public functions ************************************************************/
295 void refresh_screen (void *);
297 /*** inline functions ****************************************************************************/