extfs: tester: fix indentation.
[midnight-commander.git] / src / textconf.c
blob8ffe480692c210db2cf43b21f15fa5ed90d480be
1 /*
2 Print features specific for this build
4 Copyright (C) 2000-2017
5 Free Software Foundation, Inc.
7 This file is part of the Midnight Commander.
9 The Midnight Commander is free software: you can redistribute it
10 and/or modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation, either version 3 of the License,
12 or (at your option) any later version.
14 The Midnight Commander is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 /** \file textconf.c
24 * \brief Source: prints features specific for this build
27 #include <config.h>
29 #include <limits.h>
30 #include <stdio.h>
31 #include <sys/types.h>
33 #include "lib/global.h"
34 #include "lib/fileloc.h"
35 #include "lib/mcconfig.h"
36 #include "lib/util.h" /* mc_get_profile_root() */
38 #include "src/textconf.h"
40 /*** global variables ****************************************************************************/
42 /*** file scope macro definitions ****************************************************************/
44 /*** file scope type declarations ****************************************************************/
46 /*** file scope variables ************************************************************************/
48 #ifdef ENABLE_VFS
49 static const char *const vfs_supported[] = {
50 #ifdef ENABLE_VFS_CPIO
51 "cpiofs",
52 #endif
53 #ifdef ENABLE_VFS_TAR
54 "tarfs",
55 #endif
56 #ifdef ENABLE_VFS_SFS
57 "sfs",
58 #endif
59 #ifdef ENABLE_VFS_EXTFS
60 "extfs",
61 #endif
62 #ifdef ENABLE_VFS_UNDELFS
63 "ext2undelfs",
64 #endif
65 #ifdef ENABLE_VFS_FTP
66 "ftpfs",
67 #endif
68 #ifdef ENABLE_VFS_SFTP
69 "sftpfs",
70 #endif
71 #ifdef ENABLE_VFS_FISH
72 "fish",
73 #endif
74 #ifdef ENABLE_VFS_SMB
75 "smbfs",
76 #endif /* ENABLE_VFS_SMB */
77 NULL
79 #endif /* ENABLE_VFS */
81 static const char *const features[] = {
82 #ifdef HAVE_SLANG
83 N_("Using the S-Lang library with terminfo database\n"),
84 #elif defined(USE_NCURSES)
85 N_("Using the ncurses library\n"),
86 #elif defined(USE_NCURSESW)
87 N_("Using the ncursesw library\n"),
88 #else
89 #error "Cannot compile mc without S-Lang or ncurses"
90 #endif /* !HAVE_SLANG && !USE_NCURSES */
92 #ifdef USE_INTERNAL_EDIT
93 N_("With builtin Editor\n"),
94 #endif
96 #ifdef ENABLE_SUBSHELL
97 #ifdef SUBSHELL_OPTIONAL
98 N_("With optional subshell support\n"),
99 #else
100 N_("With subshell support as default\n"),
101 #endif
102 #endif /* !ENABLE_SUBSHELL */
104 #ifdef ENABLE_BACKGROUND
105 N_("With support for background operations\n"),
106 #endif
108 #ifdef HAVE_LIBGPM
109 N_("With mouse support on xterm and Linux console\n"),
110 #else
111 N_("With mouse support on xterm\n"),
112 #endif
114 #ifdef HAVE_TEXTMODE_X11_SUPPORT
115 N_("With support for X11 events\n"),
116 #endif
118 #ifdef ENABLE_NLS
119 N_("With internationalization support\n"),
120 #endif
122 #ifdef HAVE_CHARSET
123 N_("With multiple codepages support\n"),
124 #endif
126 NULL
129 /*** file scope functions ************************************************************************/
130 /* --------------------------------------------------------------------------------------------- */
132 /* --------------------------------------------------------------------------------------------- */
133 /*** public functions ****************************************************************************/
134 /* --------------------------------------------------------------------------------------------- */
136 void
137 show_version (void)
139 size_t i;
141 printf (_("GNU Midnight Commander %s\n"), VERSION);
143 printf (_("Built with GLib %d.%d.%d\n"),
144 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
146 for (i = 0; features[i] != NULL; i++)
147 printf ("%s", _(features[i]));
149 #ifdef ENABLE_VFS
150 printf (_("Virtual File Systems:"));
151 for (i = 0; vfs_supported[i] != NULL; i++)
152 printf ("%s %s", i == 0 ? "" : ",", _(vfs_supported[i]));
153 printf ("\n");
154 #endif /* ENABLE_VFS */
156 (void) printf (_("Data types:"));
157 #define TYPE_INFO(T) \
158 (void)printf(" %s: %d;", #T, (int) (CHAR_BIT * sizeof(T)))
159 TYPE_INFO (char);
160 TYPE_INFO (int);
161 TYPE_INFO (long);
162 TYPE_INFO (void *);
163 TYPE_INFO (size_t);
164 TYPE_INFO (off_t);
165 #undef TYPE_INFO
166 (void) printf ("\n");
169 /* --------------------------------------------------------------------------------------------- */
170 #define PRINTF_GROUP(a) \
171 (void) printf ("[%s]\n", a)
172 #define PRINTF_SECTION(a,b) \
173 (void) printf (" %-17s %s\n", a, b)
174 #define PRINTF_SECTION2(a,b) \
175 (void) printf (" %-17s %s/\n", a, b)
176 #define PRINTF(a, b, c) \
177 (void) printf ("\t%-15s %s/%s\n", a, b, c)
178 #define PRINTF2(a, b, c) \
179 (void) printf ("\t%-15s %s%s\n", a, b, c)
181 void
182 show_datadirs_extended (void)
184 (void) printf ("%s %s\n", _("Home directory:"), mc_config_get_home_dir ());
185 (void) printf ("%s %s\n", _("Profile root directory:"), mc_get_profile_root ());
186 (void) puts ("");
188 PRINTF_GROUP (_("System data"));
190 PRINTF_SECTION (_("Config directory:"), mc_global.sysconfig_dir);
191 PRINTF_SECTION (_("Data directory:"), mc_global.share_data_dir);
193 PRINTF_SECTION (_("File extension handlers:"), EXTHELPERSDIR);
195 #if defined ENABLE_VFS_EXTFS || defined ENABLE_VFS_FISH
196 PRINTF_SECTION (_("VFS plugins and scripts:"), LIBEXECDIR);
197 #ifdef ENABLE_VFS_EXTFS
198 PRINTF2 ("extfs.d:", LIBEXECDIR, MC_EXTFS_DIR PATH_SEP_STR);
199 #endif
200 #ifdef ENABLE_VFS_FISH
201 PRINTF2 ("fish:", LIBEXECDIR, FISH_PREFIX PATH_SEP_STR);
202 #endif
203 #endif /* ENABLE_VFS_EXTFS || defiined ENABLE_VFS_FISH */
204 (void) puts ("");
206 PRINTF_GROUP (_("User data"));
208 PRINTF_SECTION2 (_("Config directory:"), mc_config_get_path ());
209 PRINTF_SECTION2 (_("Data directory:"), mc_config_get_data_path ());
210 PRINTF ("skins:", mc_config_get_data_path (), MC_SKINS_SUBDIR PATH_SEP_STR);
211 #ifdef ENABLE_VFS_EXTFS
212 PRINTF ("extfs.d:", mc_config_get_data_path (), MC_EXTFS_DIR PATH_SEP_STR);
213 #endif
214 #ifdef ENABLE_VFS_FISH
215 PRINTF ("fish:", mc_config_get_data_path (), FISH_PREFIX PATH_SEP_STR);
216 #endif
217 #ifdef USE_INTERNAL_EDIT
218 PRINTF ("mcedit macros:", mc_config_get_data_path (), MC_MACRO_FILE);
219 PRINTF ("mcedit external macros:", mc_config_get_data_path (), MC_EXTMACRO_FILE ".*");
220 #endif
221 PRINTF_SECTION2 (_("Cache directory:"), mc_config_get_cache_path ());
225 #undef PRINTF
226 #undef PRINTF_SECTION
227 #undef PRINTF_GROUP
229 /* --------------------------------------------------------------------------------------------- */
231 void
232 show_configure_options (void)
234 (void) printf ("%s\n", MC_CONFIGURE_ARGS);
237 /* --------------------------------------------------------------------------------------------- */