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