2 * \brief Header: %global definitions for compatibility
4 * This file should be included after all system includes and before all local includes.
12 #if defined(HAVE_FUNC_ATTRIBUTE_WEAK) && defined(HAVE_TESTS)
13 #define MC_MOCKABLE __attribute__((weak))
18 #include "glibcompat.h"
20 #include "unixcompat.h"
26 /*** typedefs(not structures) and defined constants **********************************************/
30 #define _(String) gettext (String)
32 #define N_(String) gettext_noop (String)
34 #define N_(String) (String)
36 #else /* Stubs that do something close enough. */
37 #define textdomain(String) 1
38 #define gettext(String) (String)
39 #define ngettext(String1,String2,Num) (((Num) == 1) ? (String1) : (String2))
40 #define dgettext(Domain,Message) (Message)
41 #define dcgettext(Domain,Message,Type) (Message)
42 #define bindtextdomain(Domain,Directory) 1
43 #define _(String) (String)
44 #define N_(String) (String)
45 #endif /* !ENABLE_NLS */
47 #ifdef HAVE_FUNC_ATTRIBUTE_FALLTHROUGH
48 #define MC_FALLTHROUGH __attribute__((fallthrough))
50 #define MC_FALLTHROUGH
53 #ifdef USE_MAINTAINER_MODE
54 #include "lib/logging.h"
57 /* Just for keeping Your's brains from invention a proper size of the buffer :-) */
58 #define BUF_10K 10240L
63 #define BUF_LARGE BUF_1K
64 #define BUF_MEDIUM 512
68 #define UTF8_CHAR_LEN 6
70 /* Used to distinguish between a normal MC termination and */
71 /* one caused by typing 'exit' or 'logout' in the subshell */
72 #define SUBSHELL_EXIT 128
74 #define MC_ERROR g_quark_from_static_string (PACKAGE)
76 #define DEFAULT_CHARSET "ASCII"
78 /*** enums ***************************************************************************************/
80 /* run mode and params */
89 /*** structures declarations (and typedefs of structures)*****************************************/
93 const char *mc_version
;
95 mc_run_mode_t mc_run_mode
;
96 gboolean run_from_parent_mc
;
97 /* Used so that widgets know if they are being destroyed or shut down */
98 gboolean midnight_shutdown
;
100 /* sysconfig_dir: Area for default settings from maintainers of distributuves
101 default is /etc/mc or may be defined by MC_DATADIR */
103 /* share_data_dir: Area for default settings from developers */
104 char *share_data_dir
;
108 mc_config_t
*main_config
;
109 mc_config_t
*panels_config
;
112 /* Numbers of (file I/O) and (input/display) codepages. -1 if not selected */
114 int display_codepage
;
116 /* If true, allow characters in the range 160-255 */
117 gboolean eight_bit_clean
;
119 * If true, also allow characters in the range 128-159.
120 * This is reported to break on many terminals (xterm, qansi-m).
122 gboolean full_eight_bits
;
123 #endif /* !HAVE_CHARSET */
125 * If utf-8 terminal utf8_display = TRUE
126 * Display bits set UTF-8
128 gboolean utf8_display
;
130 /* Set if the nice message (hint) bar is visible */
131 gboolean message_visible
;
132 /* Set if the nice and useful keybar is visible */
133 gboolean keybar_visible
;
135 #ifdef ENABLE_BACKGROUND
136 /* If true, this is a background process */
137 gboolean we_are_background
;
138 #endif /* ENABLE_BACKGROUND */
142 /* Asks for confirmation before clean up of history */
143 gboolean confirm_history_cleanup
;
145 /* Set if you want the possible completions dialog for the first time */
146 gboolean show_all_if_ambiguous
;
148 /* Ugly hack in order to distinguish between left and right panel in menubar */
149 /* Set if the command is being run from the "Right" menu */
150 gboolean is_right
; /* If the selected menu was the right */
153 /* The user's shell */
158 /* Use the specified skin */
160 /* Dialog window and drop down menu have a shadow */
163 char *setup_color_string
;
164 char *term_color_string
;
165 char *color_terminal_string
;
166 /* colors specified on the command line: they override any other setting */
167 char *command_line_colors
;
169 #ifndef LINUX_CONS_SAVER_C
170 /* Used only in mc, not in cons.saver */
172 #endif /* !LINUX_CONS_SAVER_C */
173 /* If using a subshell for evaluating commands this is true */
174 gboolean use_subshell
;
176 #ifdef ENABLE_SUBSHELL
177 /* File descriptors of the pseudoterminal used by the subshell */
179 #endif /* !ENABLE_SUBSHELL */
181 /* This flag is set by xterm detection routine in function main() */
182 /* It is used by function toggle_subshell() */
185 /* disable x11 support */
186 gboolean disable_x11
;
188 /* For slow terminals */
189 /* If true lines are shown by spaces */
190 gboolean slow_terminal
;
192 /* Set to force black and white display at program startup */
193 gboolean disable_colors
;
195 /* If true use +, -, | for line drawing */
196 gboolean ugly_line_drawing
;
198 /* Tries to use old highlight mouse tracking */
201 /* If true, use + and \ keys normally and select/unselect do if M-+ / M-\.
202 and M-- and keypad + / - */
203 gboolean alternate_plus_minus
;
208 /* Set when cd symlink following is desirable (bash mode) */
209 gboolean cd_symlinks
;
211 /* Preallocate space before file copying */
212 gboolean preallocate_space
;
217 /*** global variables defined in .c file *********************************************************/
219 extern mc_global_t mc_global
;
221 /*** declarations of public functions ************************************************************/
223 /*** inline functions ****************************************************************************/