This source file includes following definitions.
- show_version
- show_datadirs_extended
- show_configure_options
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 #include <config.h>
28
29 #include <limits.h>
30 #include <stdio.h>
31 #include <sys/types.h>
32
33 #include "lib/global.h"
34 #include "lib/fileloc.h"
35 #include "lib/mcconfig.h"
36 #include "lib/util.h"
37 #include "lib/tty/tty.h"
38
39 #include "src/textconf.h"
40
41
42
43
44
45
46
47
48
49 #ifdef ENABLE_VFS
50 static const char *const vfs_supported[] = {
51 #ifdef ENABLE_VFS_CPIO
52 "cpiofs",
53 #endif
54 #ifdef ENABLE_VFS_TAR
55 "tarfs",
56 #endif
57 #ifdef ENABLE_VFS_SFS
58 "sfs",
59 #endif
60 #ifdef ENABLE_VFS_EXTFS
61 "extfs",
62 #endif
63 #ifdef ENABLE_VFS_UNDELFS
64 "ext2undelfs",
65 #endif
66 #ifdef ENABLE_VFS_FTP
67 "ftpfs",
68 #endif
69 #ifdef ENABLE_VFS_SFTP
70 "sftpfs",
71 #endif
72 #ifdef ENABLE_VFS_FISH
73 "fish",
74 #endif
75 #ifdef ENABLE_VFS_SMB
76 "smbfs",
77 #endif
78 NULL
79 };
80 #endif
81
82 static const char *const features[] = {
83
84 #ifdef USE_INTERNAL_EDIT
85 #ifdef HAVE_ASPELL
86 N_("With builtin Editor and Aspell support"),
87 #else
88 N_("With builtin Editor"),
89 #endif
90 #endif
91
92 #ifdef ENABLE_SUBSHELL
93 #ifdef SUBSHELL_OPTIONAL
94 N_("With optional subshell support"),
95 #else
96 N_("With subshell support as default"),
97 #endif
98 #endif
99
100 #ifdef ENABLE_BACKGROUND
101 N_("With support for background operations"),
102 #endif
103
104 #ifdef HAVE_LIBGPM
105 N_("With mouse support on xterm and Linux console"),
106 #else
107 N_("With mouse support on xterm"),
108 #endif
109
110 #ifdef HAVE_TEXTMODE_X11_SUPPORT
111 N_("With support for X11 events"),
112 #endif
113
114 #ifdef ENABLE_NLS
115 N_("With internationalization support"),
116 #endif
117
118 #ifdef HAVE_CHARSET
119 N_("With multiple codepages support"),
120 #endif
121
122 #ifdef ENABLE_EXT2FS_ATTR
123 N_("With ext2fs attributes support"),
124 #endif
125
126 NULL
127 };
128
129
130
131
132
133
134
135
136 void
137 show_version (void)
138 {
139 size_t i;
140
141 printf (_("GNU Midnight Commander %s\n"), VERSION);
142
143 printf (_("Built with GLib %d.%d.%d\n"),
144 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
145
146 #ifdef HAVE_SLANG
147 printf (_("Built with S-Lang %s with terminfo database\n"), SLANG_VERSION_STRING);
148 #elif defined(USE_NCURSES)
149 #ifdef NCURSES_VERSION
150 printf (_("Built with ncurses %s\n"), NCURSES_VERSION);
151 #else
152 puts (_("Built with ncurses (unknown version)"));
153 #endif
154 #elif defined(USE_NCURSESW)
155 #ifdef NCURSES_VERSION
156 printf (_("Built with ncursesw %s\n"), NCURSES_VERSION);
157 #else
158 puts (_("Built with ncursesw (unknown version)"));
159 #endif
160 #else
161 #error "Cannot compile mc without S-Lang or ncurses"
162 #endif
163
164 for (i = 0; features[i] != NULL; i++)
165 puts (_(features[i]));
166
167 #ifdef ENABLE_VFS
168 puts (_("Virtual File Systems:"));
169 for (i = 0; vfs_supported[i] != NULL; i++)
170 printf ("%s %s", i == 0 ? "" : ",", _(vfs_supported[i]));
171 (void) puts ("");
172 #endif
173
174 (void) puts (_("Data types:"));
175 #define TYPE_INFO(T) \
176 (void)printf(" %s: %d;", #T, (int) (CHAR_BIT * sizeof(T)))
177 TYPE_INFO (char);
178 TYPE_INFO (int);
179 TYPE_INFO (long);
180 TYPE_INFO (void *);
181 TYPE_INFO (size_t);
182 TYPE_INFO (off_t);
183 #undef TYPE_INFO
184 (void) puts ("");
185 }
186
187
188 #define PRINTF_GROUP(a) \
189 (void) printf ("[%s]\n", a)
190 #define PRINTF_SECTION(a,b) \
191 (void) printf (" %-17s %s\n", a, b)
192 #define PRINTF_SECTION2(a,b) \
193 (void) printf (" %-17s %s/\n", a, b)
194 #define PRINTF(a, b, c) \
195 (void) printf ("\t%-15s %s/%s\n", a, b, c)
196 #define PRINTF2(a, b, c) \
197 (void) printf ("\t%-15s %s%s\n", a, b, c)
198
199 void
200 show_datadirs_extended (void)
201 {
202 (void) printf ("%s %s\n", _("Home directory:"), mc_config_get_home_dir ());
203 (void) printf ("%s %s\n", _("Profile root directory:"), mc_get_profile_root ());
204 (void) puts ("");
205
206 PRINTF_GROUP (_("System data"));
207
208 PRINTF_SECTION (_("Config directory:"), mc_global.sysconfig_dir);
209 PRINTF_SECTION (_("Data directory:"), mc_global.share_data_dir);
210
211 PRINTF_SECTION (_("File extension handlers:"), EXTHELPERSDIR);
212
213 #if defined ENABLE_VFS_EXTFS || defined ENABLE_VFS_FISH
214 PRINTF_SECTION (_("VFS plugins and scripts:"), LIBEXECDIR);
215 #ifdef ENABLE_VFS_EXTFS
216 PRINTF2 ("extfs.d:", LIBEXECDIR, MC_EXTFS_DIR PATH_SEP_STR);
217 #endif
218 #ifdef ENABLE_VFS_FISH
219 PRINTF2 ("fish:", LIBEXECDIR, FISH_PREFIX PATH_SEP_STR);
220 #endif
221 #endif
222 (void) puts ("");
223
224 PRINTF_GROUP (_("User data"));
225
226 PRINTF_SECTION2 (_("Config directory:"), mc_config_get_path ());
227 PRINTF_SECTION2 (_("Data directory:"), mc_config_get_data_path ());
228 PRINTF ("skins:", mc_config_get_data_path (), MC_SKINS_DIR PATH_SEP_STR);
229 #ifdef ENABLE_VFS_EXTFS
230 PRINTF ("extfs.d:", mc_config_get_data_path (), MC_EXTFS_DIR PATH_SEP_STR);
231 #endif
232 #ifdef ENABLE_VFS_FISH
233 PRINTF ("fish:", mc_config_get_data_path (), FISH_PREFIX PATH_SEP_STR);
234 #endif
235 #ifdef USE_INTERNAL_EDIT
236 PRINTF ("mcedit macros:", mc_config_get_data_path (), MC_MACRO_FILE);
237 PRINTF ("mcedit external macros:", mc_config_get_data_path (), EDIT_HOME_MACRO_FILE ".*");
238 #endif
239 PRINTF_SECTION2 (_("Cache directory:"), mc_config_get_cache_path ());
240 }
241
242 #undef PRINTF
243 #undef PRINTF_SECTION
244 #undef PRINTF_GROUP
245
246
247
248 #ifdef ENABLE_CONFIGURE_ARGS
249 void
250 show_configure_options (void)
251 {
252 (void) puts (MC_CONFIGURE_ARGS);
253 }
254 #endif
255
256