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 /*** typedefs(not structures) and defined constants **********************************************/
32 /* The O_BINARY definition was taken from gettext */
33 #if !defined O_BINARY && defined _O_BINARY
34 /* For MSC-compatible compilers. */
35 #define O_BINARY _O_BINARY
38 /* BeOS 5 has O_BINARY, but is has no effect. */
41 /* On reasonable systems, binary I/O is the default. */
46 /* Replacement for O_NONBLOCK */
48 #ifdef O_NDELAY /* SYSV */
49 #define O_NONBLOCK O_NDELAY
51 #define O_NONBLOCK FNDELAY
52 #endif /* !O_NDELAY */
53 #endif /* !O_NONBLOCK */
55 #ifdef HAVE_SYS_SELECT_H
56 #include <sys/select.h>
59 #if defined(__QNX__) && !defined(__QNXNTO__)
60 /* exec*() from <process.h> */
65 #include "glibcompat.h"
67 /* For SMB VFS only */
69 #define __attribute__(x)
72 /* Solaris9 doesn't have PRIXMAX */
74 #define PRIXMAX PRIxMAX
79 #define _(String) gettext (String)
81 #define N_(String) gettext_noop (String)
83 #define N_(String) (String)
85 #else /* Stubs that do something close enough. */
86 #define textdomain(String) 1
87 #define gettext(String) (String)
88 #define ngettext(String1,String2,Num) (((Num) == 1) ? (String1) : (String2))
89 #define dgettext(Domain,Message) (Message)
90 #define dcgettext(Domain,Message,Type) (Message)
91 #define bindtextdomain(Domain,Directory) 1
92 #define _(String) (String)
93 #define N_(String) (String)
94 #endif /* !ENABLE_NLS */
100 #ifdef USE_MAINTAINER_MODE
101 #include "lib/logging.h"
104 /* Just for keeping Your's brains from invention a proper size of the buffer :-) */
105 #define BUF_10K 10240L
110 #define BUF_LARGE BUF_1K
111 #define BUF_MEDIUM 512
112 #define BUF_SMALL 128
115 /* ESC_CHAR is defined in /usr/include/langinfo.h in some systems */
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 IS_PATH_SEP(c) ((c) == PATH_SEP)
127 #define PATH_ENV_SEP ':'
128 #define TMPDIR_DEFAULT "/tmp"
129 #define SCRIPT_SUFFIX ""
130 #define get_default_editor() "vi"
131 #define OS_SORT_CASE_SENSITIVE_DEFAULT 1
132 #define UTF8_CHAR_LEN 6
134 /* Used to distinguish between a normal MC termination and */
135 /* one caused by typing 'exit' or 'logout' in the subshell */
136 #define SUBSHELL_EXIT 128
138 #define MC_ERROR g_quark_from_static_string (PACKAGE)
140 #define DEFAULT_CHARSET "ASCII"
142 #include "lib/timer.h" /* mc_timer_t */
144 /*** enums ***************************************************************************************/
146 /* run mode and params */
155 /*** structures declarations (and typedefs of structures)*****************************************/
159 mc_run_mode_t mc_run_mode
;
162 /* Used so that widgets know if they are being destroyed or shut down */
163 gboolean midnight_shutdown
;
165 /* sysconfig_dir: Area for default settings from maintainers of distributuves
166 default is /etc/mc or may be defined by MC_DATADIR */
168 /* share_data_dir: Area for default settings from developers */
169 char *share_data_dir
;
171 mc_config_t
*main_config
;
172 mc_config_t
*panels_config
;
175 /* Numbers of (file I/O) and (input/display) codepages. -1 if not selected */
177 int display_codepage
;
179 /* If true, allow characters in the range 160-255 */
180 gboolean eight_bit_clean
;
182 * If true, also allow characters in the range 128-159.
183 * This is reported to break on many terminals (xterm, qansi-m).
185 gboolean full_eight_bits
;
186 #endif /* !HAVE_CHARSET */
188 * If utf-8 terminal utf8_display = TRUE
189 * Display bits set UTF-8
191 gboolean utf8_display
;
193 /* Set if the nice message (hint) bar is visible */
195 /* Set if the nice and useful keybar is visible */
198 #ifdef ENABLE_BACKGROUND
199 /* If true, this is a background process */
200 gboolean we_are_background
;
201 #endif /* ENABLE_BACKGROUND */
205 /* Asks for confirmation before clean up of history */
206 gboolean confirm_history_cleanup
;
208 /* Set if you want the possible completions dialog for the first time */
209 gboolean show_all_if_ambiguous
;
211 /* Ugly hack in order to distinguish between left and right panel in menubar */
212 /* Set if the command is being run from the "Right" menu */
213 gboolean is_right
; /* If the selected menu was the right */
216 /* The user's shell */
221 /* Use the specified skin */
224 char *setup_color_string
;
225 char *term_color_string
;
226 char *color_terminal_string
;
227 /* colors specified on the command line: they override any other setting */
228 char *command_line_colors
;
230 #ifndef LINUX_CONS_SAVER_C
231 /* Used only in mc, not in cons.saver */
233 #endif /* !LINUX_CONS_SAVER_C */
234 /* If using a subshell for evaluating commands this is true */
235 gboolean use_subshell
;
237 #ifdef ENABLE_SUBSHELL
238 /* File descriptors of the pseudoterminal used by the subshell */
240 #endif /* !ENABLE_SUBSHELL */
242 /* This flag is set by xterm detection routine in function main() */
243 /* It is used by function view_other_cmd() */
246 /* disable x11 support */
247 gboolean disable_x11
;
249 /* For slow terminals */
250 /* If true lines are shown by spaces */
251 gboolean slow_terminal
;
253 /* Set to force black and white display at program startup */
254 gboolean disable_colors
;
256 /* If true use +, -, | for line drawing */
257 gboolean ugly_line_drawing
;
259 /* Tries to use old highlight mouse tracking */
262 /* If true, use + and \ keys normally and select/unselect do if M-+ / M-\.
263 and M-- and keypad + / - */
264 gboolean alternate_plus_minus
;
266 /* Set if the window has changed it's size */
267 SIG_ATOMIC_VOLATILE_T winch_flag
;
272 /* Set when cd symlink following is desirable (bash mode) */
273 gboolean cd_symlinks
;
275 /* Preallocate space before file copying */
276 gboolean preallocate_space
;
281 /*** global variables defined in .c file *********************************************************/
283 extern mc_global_t mc_global
;
285 /*** declarations of public functions ************************************************************/
287 /*** inline functions ****************************************************************************/