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>
27 /* for sig_atomic_t */
30 #ifdef HAVE_FUNC_ATTRIBUTE_FALLTHROUGH
31 #define MC_FALLTHROUGH __attribute__((fallthrough))
33 #define MC_FALLTHROUGH
36 /*** typedefs(not structures) and defined constants **********************************************/
38 /* The O_BINARY definition was taken from gettext */
39 #if !defined O_BINARY && defined _O_BINARY
40 /* For MSC-compatible compilers. */
41 #define O_BINARY _O_BINARY
44 /* BeOS 5 has O_BINARY, but is has no effect. */
47 /* On reasonable systems, binary I/O is the default. */
52 /* Replacement for O_NONBLOCK */
54 #ifdef O_NDELAY /* SYSV */
55 #define O_NONBLOCK O_NDELAY
57 #define O_NONBLOCK FNDELAY
58 #endif /* !O_NDELAY */
59 #endif /* !O_NONBLOCK */
61 #if defined(__QNX__) && !defined(__QNXNTO__)
62 /* exec*() from <process.h> */
67 #include "glibcompat.h"
69 /* Solaris9 doesn't have PRIXMAX */
71 #define PRIXMAX PRIxMAX
76 #define _(String) gettext (String)
78 #define N_(String) gettext_noop (String)
80 #define N_(String) (String)
82 #else /* Stubs that do something close enough. */
83 #define textdomain(String) 1
84 #define gettext(String) (String)
85 #define ngettext(String1,String2,Num) (((Num) == 1) ? (String1) : (String2))
86 #define dgettext(Domain,Message) (Message)
87 #define dcgettext(Domain,Message,Type) (Message)
88 #define bindtextdomain(Domain,Directory) 1
89 #define _(String) (String)
90 #define N_(String) (String)
91 #endif /* !ENABLE_NLS */
97 #ifdef USE_MAINTAINER_MODE
98 #include "lib/logging.h"
101 /* Just for keeping Your's brains from invention a proper size of the buffer :-) */
102 #define BUF_10K 10240L
107 #define BUF_LARGE BUF_1K
108 #define BUF_MEDIUM 512
109 #define BUF_SMALL 128
112 /* ESC_CHAR is defined in /usr/include/langinfo.h in some systems */
116 /* AIX compiler doesn't understand '\e' */
117 #define ESC_CHAR '\033'
118 #define ESC_STR "\033"
120 /* OS specific defines */
122 #define PATH_SEP_STR "/"
123 #define IS_PATH_SEP(c) ((c) == PATH_SEP)
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 TRUE
129 #define UTF8_CHAR_LEN 6
131 /* struct stat members */
133 #define st_atim st_atimespec
134 #define st_ctim st_ctimespec
135 #define st_mtim st_mtimespec
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 #define MC_ERROR g_quark_from_static_string (PACKAGE)
144 #define DEFAULT_CHARSET "ASCII"
146 /*** enums ***************************************************************************************/
148 /* run mode and params */
157 /*** structures declarations (and typedefs of structures)*****************************************/
161 const char *mc_version
;
163 mc_run_mode_t mc_run_mode
;
164 gboolean run_from_parent_mc
;
165 /* Used so that widgets know if they are being destroyed or shut down */
166 gboolean midnight_shutdown
;
168 /* sysconfig_dir: Area for default settings from maintainers of distributuves
169 default is /etc/mc or may be defined by MC_DATADIR */
171 /* share_data_dir: Area for default settings from developers */
172 char *share_data_dir
;
174 mc_config_t
*main_config
;
175 mc_config_t
*panels_config
;
178 /* Numbers of (file I/O) and (input/display) codepages. -1 if not selected */
180 int display_codepage
;
182 /* If true, allow characters in the range 160-255 */
183 gboolean eight_bit_clean
;
185 * If true, also allow characters in the range 128-159.
186 * This is reported to break on many terminals (xterm, qansi-m).
188 gboolean full_eight_bits
;
189 #endif /* !HAVE_CHARSET */
191 * If utf-8 terminal utf8_display = TRUE
192 * Display bits set UTF-8
194 gboolean utf8_display
;
196 /* Set if the nice message (hint) bar is visible */
197 gboolean message_visible
;
198 /* Set if the nice and useful keybar is visible */
199 gboolean keybar_visible
;
201 #ifdef ENABLE_BACKGROUND
202 /* If true, this is a background process */
203 gboolean we_are_background
;
204 #endif /* ENABLE_BACKGROUND */
208 /* Asks for confirmation before clean up of history */
209 gboolean confirm_history_cleanup
;
211 /* Set if you want the possible completions dialog for the first time */
212 gboolean show_all_if_ambiguous
;
214 /* Ugly hack in order to distinguish between left and right panel in menubar */
215 /* Set if the command is being run from the "Right" menu */
216 gboolean is_right
; /* If the selected menu was the right */
219 /* The user's shell */
224 /* Use the specified skin */
226 /* Dialog window and frop down menu have a shadow */
229 char *setup_color_string
;
230 char *term_color_string
;
231 char *color_terminal_string
;
232 /* colors specified on the command line: they override any other setting */
233 char *command_line_colors
;
235 #ifndef LINUX_CONS_SAVER_C
236 /* Used only in mc, not in cons.saver */
238 #endif /* !LINUX_CONS_SAVER_C */
239 /* If using a subshell for evaluating commands this is true */
240 gboolean use_subshell
;
242 #ifdef ENABLE_SUBSHELL
243 /* File descriptors of the pseudoterminal used by the subshell */
245 #endif /* !ENABLE_SUBSHELL */
247 /* This flag is set by xterm detection routine in function main() */
248 /* It is used by function toggle_subshell() */
251 /* disable x11 support */
252 gboolean disable_x11
;
254 /* For slow terminals */
255 /* If true lines are shown by spaces */
256 gboolean slow_terminal
;
258 /* Set to force black and white display at program startup */
259 gboolean disable_colors
;
261 /* If true use +, -, | for line drawing */
262 gboolean ugly_line_drawing
;
264 /* Tries to use old highlight mouse tracking */
267 /* If true, use + and \ keys normally and select/unselect do if M-+ / M-\.
268 and M-- and keypad + / - */
269 gboolean alternate_plus_minus
;
274 /* Set when cd symlink following is desirable (bash mode) */
275 gboolean cd_symlinks
;
277 /* Preallocate space before file copying */
278 gboolean preallocate_space
;
283 /*** global variables defined in .c file *********************************************************/
285 extern mc_global_t mc_global
;
287 /*** declarations of public functions ************************************************************/
289 /*** inline functions ****************************************************************************/