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 /*** typedefs(not structures) and defined constants **********************************************/
26 /* The O_BINARY definition was taken from gettext */
27 #if !defined O_BINARY && defined _O_BINARY
28 /* For MSC-compatible compilers. */
29 #define O_BINARY _O_BINARY
32 /* BeOS 5 has O_BINARY, but is has no effect. */
35 /* On reasonable systems, binary I/O is the default. */
40 /* Replacement for O_NONBLOCK */
42 #ifdef O_NDELAY /* SYSV */
43 #define O_NONBLOCK O_NDELAY
45 #define O_NONBLOCK FNDELAY
46 #endif /* !O_NDELAY */
47 #endif /* !O_NONBLOCK */
49 #ifdef HAVE_SYS_SELECT_H
50 #include <sys/select.h>
53 #if defined(__QNX__) && !defined(__QNXNTO__)
54 /* exec*() from <process.h> */
59 #include "glibcompat.h"
62 #define __attribute__(x)
65 /* Solaris9 doesn't have PRIXMAX */
67 #define PRIXMAX PRIxMAX
72 #define _(String) gettext (String)
74 #define N_(String) gettext_noop (String)
76 #define N_(String) (String)
78 #else /* Stubs that do something close enough. */
79 #define textdomain(String) 1
80 #define gettext(String) (String)
81 #define ngettext(String1,String2,Num) (((Num) == 1) ? (String1) : (String2))
82 #define dgettext(Domain,Message) (Message)
83 #define dcgettext(Domain,Message,Type) (Message)
84 #define bindtextdomain(Domain,Directory) 1
85 #define _(String) (String)
86 #define N_(String) (String)
87 #endif /* !ENABLE_NLS */
91 #ifdef USE_MAINTAINER_MODE
92 #include "lib/logging.h"
103 #define min(x, y) ((x) > (y) ? (y) : (x))
104 #define max(x, y) ((x) > (y) ? (x) : (y))
106 /* Just for keeping Your's brains from invention a proper size of the buffer :-) */
107 #define BUF_10K 10240L
112 #define BUF_LARGE BUF_1K
113 #define BUF_MEDIUM 512
114 #define BUF_SMALL 128
117 /* AIX compiler doesn't understand '\e' */
118 #define ESC_CHAR '\033'
119 #define ESC_STR "\033"
121 /* OS specific defines */
123 #define PATH_SEP_STR "/"
124 #define PATH_ENV_SEP ':'
125 #define TMPDIR_DEFAULT "/tmp"
126 #define SCRIPT_SUFFIX ""
127 #define get_default_editor() "vi"
128 #define OS_SORT_CASE_SENSITIVE_DEFAULT 1
129 #define UTF8_CHAR_LEN 6
131 /* C++ style type casts */
132 #define const_cast(m_type, m_expr) ((m_type) (m_expr))
135 #ifdef MC_ENABLE_DEBUGGING_CODE
145 #define MC_ERROR g_quark_from_static_string (PACKAGE)
147 /*** enums ***************************************************************************************/
149 /* run mode and params */
158 /*** structures declarations (and typedefs of structures)*****************************************/
162 mc_run_mode_t mc_run_mode
;
163 /* Used so that widgets know if they are being destroyed or shut down */
164 gboolean midnight_shutdown
;
166 /* sysconfig_dir: Area for default settings from maintainers of distributuves
167 default is /etc/mc or may be defined by MC_DATADIR */
169 /* share_data_dir: Area for default settings from developers */
170 char *share_data_dir
;
173 /* Numbers of (file I/O) and (input/display) codepages. -1 if not selected */
175 int display_codepage
;
177 /* If true, allow characters in the range 160-255 */
180 * If true, also allow characters in the range 128-159.
181 * This is reported to break on many terminals (xterm, qansi-m).
184 #endif /* !HAVE_CHARSET */
186 * If utf-8 terminal utf8_display = TRUE
187 * Display bits set UTF-8
189 gboolean utf8_display
;
191 /* Set if the nice message (hint) bar is visible */
193 /* Set if the nice and useful keybar is visible */
196 #ifdef ENABLE_BACKGROUND
197 /* If true, this is a background process */
198 gboolean we_are_background
;
199 #endif /* ENABLE_BACKGROUND */
203 /* Asks for confirmation before clean up of history */
204 gboolean confirm_history_cleanup
;
206 /* Set if you want the possible completions dialog for the first time */
207 gboolean show_all_if_ambiguous
;
209 /* Ugly hack in order to distinguish between left and right panel in menubar */
210 /* Set if the command is being run from the "Right" menu */
211 gboolean is_right
; /* If the selected menu was the right */
216 /* Use the specified skin */
219 char *setup_color_string
;
220 char *term_color_string
;
221 char *color_terminal_string
;
222 /* colors specified on the command line: they override any other setting */
223 char *command_line_colors
;
225 #ifndef LINUX_CONS_SAVER_C
226 /* Used only in mc, not in cons.saver */
228 #endif /* !LINUX_CONS_SAVER_C */
229 /* If using a subshell for evaluating commands this is true */
230 gboolean use_subshell
;
231 #ifdef HAVE_SUBSHELL_SUPPORT
232 /* File descriptors of the pseudoterminal used by the subshell */
234 #endif /* !HAVE_SUBSHELL_SUPPORT */
236 /* This flag is set by xterm detection routine in function main() */
237 /* It is used by function view_other_cmd() */
240 /* disable x11 support */
241 gboolean disable_x11
;
243 /* For slow terminals */
244 /* If true lines are shown by spaces */
245 gboolean slow_terminal
;
247 /* Set to force black and white display at program startup */
248 gboolean disable_colors
;
250 /* If true use +, -, | for line drawing */
251 gboolean ugly_line_drawing
;
253 /* Tries to use old highlight mouse tracking */
256 /* If true, use + and \ keys normally and select/unselect do if M-+ / M-\.
257 and M-- and keypad + / - */
258 gboolean alternate_plus_minus
;
260 /* Set if the window has changed it's size */
266 /* Set when cd symlink following is desirable (bash mode) */
267 gboolean cd_symlinks
;
269 /* Preallocate space before file copying */
270 gboolean preallocate_space
;
275 /*** global variables defined in .c file *********************************************************/
277 extern mc_global_t mc_global
;
279 /*** declarations of public functions ************************************************************/
281 void refresh_screen (void *);
283 /*** inline functions ****************************************************************************/