(fish_file_store): type accuracy to avoid counter overflow while copiyng huge files.
[midnight-commander.git] / src / textconf.c
blobd695499bab418150cdd190073a6fef7457c4af9e
1 /*
2 Print features specific for this build
4 Copyright (C) 2000, 2001, 2002, 2004, 2005, 2007, 2011
5 The 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"
37 #include "src/textconf.h"
39 /*** global variables ****************************************************************************/
41 /*** file scope macro definitions ****************************************************************/
43 /*** file scope type declarations ****************************************************************/
45 /*** file scope variables ************************************************************************/
47 #ifdef ENABLE_VFS
48 static const char *const vfs_supported[] = {
49 #ifdef ENABLE_VFS_CPIO
50 "cpiofs",
51 #endif
52 #ifdef ENABLE_VFS_TAR
53 "tarfs",
54 #endif
55 #ifdef ENABLE_VFS_SFS
56 "sfs",
57 #endif
58 #ifdef ENABLE_VFS_EXTFS
59 "extfs",
60 #endif
61 #ifdef ENABLE_VFS_UNDELFS
62 "ext2undelfs",
63 #endif
64 #ifdef ENABLE_VFS_FTP
65 "ftpfs",
66 #endif
67 #ifdef ENABLE_VFS_FISH
68 "fish",
69 #endif
70 #ifdef ENABLE_VFS_SMB
71 "smbfs",
72 #endif /* ENABLE_VFS_SMB */
73 NULL
75 #endif /* ENABLE_VFS */
77 static const char *const features[] = {
78 #ifdef HAVE_SLANG
79 N_("Using the S-Lang library with terminfo database\n"),
80 #elif defined(USE_NCURSES)
81 N_("Using the ncurses library\n"),
82 #elif defined(USE_NCURSESW)
83 N_("Using the ncursesw library\n"),
84 #else
85 #error "Cannot compile mc without S-Lang or ncurses"
86 #endif /* !HAVE_SLANG && !USE_NCURSES */
88 #ifdef USE_INTERNAL_EDIT
89 N_("With builtin Editor\n"),
90 #endif
92 #ifdef HAVE_SUBSHELL_SUPPORT
93 #ifdef SUBSHELL_OPTIONAL
94 N_("With optional subshell support\n"),
95 #else
96 N_("With subshell support as default\n"),
97 #endif
98 #endif /* !HAVE_SUBSHELL_SUPPORT */
100 #ifdef ENABLE_BACKGROUND
101 N_("With support for background operations\n"),
102 #endif
104 #ifdef HAVE_LIBGPM
105 N_("With mouse support on xterm and Linux console\n"),
106 #else
107 N_("With mouse support on xterm\n"),
108 #endif
110 #ifdef HAVE_TEXTMODE_X11_SUPPORT
111 N_("With support for X11 events\n"),
112 #endif
114 #ifdef ENABLE_NLS
115 N_("With internationalization support\n"),
116 #endif
118 #ifdef HAVE_CHARSET
119 N_("With multiple codepages support\n"),
120 #endif
122 NULL
125 /*** file scope functions ************************************************************************/
126 /* --------------------------------------------------------------------------------------------- */
128 /* --------------------------------------------------------------------------------------------- */
129 /*** public functions ****************************************************************************/
130 /* --------------------------------------------------------------------------------------------- */
132 void
133 show_version (void)
135 size_t i;
137 printf (_("GNU Midnight Commander %s\n"), VERSION);
139 printf (_("Built with GLib %d.%d.%d\n"),
140 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
142 for (i = 0; features[i] != NULL; i++)
143 printf ("%s", _(features[i]));
145 #ifdef ENABLE_VFS
146 printf (_("Virtual File Systems:"));
147 for (i = 0; vfs_supported[i] != NULL; i++)
148 printf ("%s %s", i == 0 ? "" : ",", _(vfs_supported[i]));
149 printf ("\n");
150 #endif /* ENABLE_VFS */
152 (void) printf (_("Data types:"));
153 #define TYPE_INFO(T) \
154 (void)printf(" %s: %d;", #T, (int) (CHAR_BIT * sizeof(T)))
155 TYPE_INFO (char);
156 TYPE_INFO (int);
157 TYPE_INFO (long);
158 TYPE_INFO (void *);
159 TYPE_INFO (size_t);
160 TYPE_INFO (off_t);
161 #undef TYPE_INFO
162 (void) printf ("\n");
165 /* --------------------------------------------------------------------------------------------- */
166 #define PRINTF_GROUP(a) \
167 (void) printf ("[%s]\n", a)
168 #define PRINTF_SECTION(a,b) \
169 (void) printf (" %-17s %s\n", a, b)
170 #define PRINTF_SECTION2(a,b) \
171 (void) printf (" %-17s %s/\n", a, b)
172 #define PRINTF(a, b, c) \
173 (void) printf ("\t%-15s %s/%s\n", a, b, c)
174 #define PRINTF2(a, b, c) \
175 (void) printf ("\t%-15s %s%s\n", a, b, c)
177 void
178 show_datadirs_extended (void)
180 (void) printf ("%s %s\n", _("Root directory:"), mc_config_get_home_dir ());
181 (void) puts ("");
183 PRINTF_GROUP (_("System data"));
185 PRINTF_SECTION (_("Config directory:"), mc_global.sysconfig_dir);
186 PRINTF_SECTION (_("Data directory:"), mc_global.share_data_dir);
188 #if defined ENABLE_VFS_EXTFS || defined ENABLE_VFS_FISH
189 PRINTF_SECTION (_("VFS plugins and scripts:"), LIBEXECDIR);
190 #ifdef ENABLE_VFS_EXTFS
191 PRINTF2 ("extfs.d:", LIBEXECDIR, MC_EXTFS_DIR "/");
192 #endif
193 #ifdef ENABLE_VFS_FISH
194 PRINTF2 ("fish:", LIBEXECDIR, FISH_PREFIX "/");
195 #endif
196 #endif /* ENABLE_VFS_EXTFS || defiined ENABLE_VFS_FISH */
197 (void) puts ("");
199 PRINTF_GROUP (_("User data"));
201 PRINTF_SECTION2 (_("Config directory:"), mc_config_get_path ());
202 PRINTF_SECTION2 (_("Data directory:"), mc_config_get_data_path ());
203 PRINTF ("skins:", mc_config_get_data_path (), MC_SKINS_SUBDIR "/");
204 #ifdef ENABLE_VFS_EXTFS
205 PRINTF ("extfs.d:", mc_config_get_data_path (), MC_EXTFS_DIR "/");
206 #endif
207 #ifdef ENABLE_VFS_FISH
208 PRINTF ("fish:", mc_config_get_data_path (), FISH_PREFIX "/");
209 #endif
211 PRINTF_SECTION2 (_("Cache directory:"), mc_config_get_cache_path ());
215 #undef PRINTF
216 #undef PRINTF_SECTION
217 #undef PRINTF_GROUP
219 /* --------------------------------------------------------------------------------------------- */
221 void
222 show_configure_options (void)
224 (void) printf ("%s\n", MC_CONFIGURE_ARGS);
227 /* --------------------------------------------------------------------------------------------- */