Merge branch '2589_ac_lang_source'
[midnight-commander.git] / src / textconf.c
blobfc8d2e35cd2c920896e164be393c3f3af7b9b68b
1 /* Print features specific for this build
3 Copyright (C) 2000, 2001, 2002, 2004, 2005, 2007
4 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 /** \file textconf.c
22 * \brief Source: prints features specific for this build
25 #include <config.h>
27 #include <limits.h>
28 #include <stdio.h>
29 #include <sys/types.h>
31 #include "lib/global.h"
32 #include "lib/fileloc.h"
33 #include "lib/mcconfig.h"
35 #include "src/textconf.h"
37 /*** global variables ****************************************************************************/
39 /*** file scope macro definitions ****************************************************************/
41 /*** file scope type declarations ****************************************************************/
43 /*** file scope variables ************************************************************************/
45 #ifdef ENABLE_VFS
46 static const char *const vfs_supported[] = {
47 #ifdef ENABLE_VFS_CPIO
48 "cpiofs",
49 #endif
50 #ifdef ENABLE_VFS_TAR
51 "tarfs",
52 #endif
53 #ifdef ENABLE_VFS_SFS
54 "sfs",
55 #endif
56 #ifdef ENABLE_VFS_EXTFS
57 "extfs",
58 #endif
59 #ifdef ENABLE_VFS_UNDELFS
60 "ext2undelfs",
61 #endif
62 #ifdef ENABLE_VFS_FTP
63 "ftpfs",
64 #endif
65 #ifdef ENABLE_VFS_FISH
66 "fish",
67 #endif
68 #ifdef ENABLE_VFS_SMB
69 "smbfs",
70 #endif /* ENABLE_VFS_SMB */
71 NULL
73 #endif /* ENABLE_VFS */
75 static const char *const features[] = {
76 #ifdef HAVE_SLANG
77 N_("Using the S-Lang library with terminfo database\n"),
78 #elif defined(USE_NCURSES)
79 N_("Using the ncurses library\n"),
80 #elif defined(USE_NCURSESW)
81 N_("Using the ncursesw library\n"),
82 #else
83 #error "Cannot compile mc without S-Lang or ncurses"
84 #endif /* !HAVE_SLANG && !USE_NCURSES */
86 #ifdef USE_INTERNAL_EDIT
87 N_("With builtin Editor\n"),
88 #endif
90 #ifdef HAVE_SUBSHELL_SUPPORT
91 #ifdef SUBSHELL_OPTIONAL
92 N_("With optional subshell support\n"),
93 #else
94 N_("With subshell support as default\n"),
95 #endif
96 #endif /* !HAVE_SUBSHELL_SUPPORT */
98 #ifdef WITH_BACKGROUND
99 N_("With support for background operations\n"),
100 #endif
102 #ifdef HAVE_LIBGPM
103 N_("With mouse support on xterm and Linux console\n"),
104 #else
105 N_("With mouse support on xterm\n"),
106 #endif
108 #ifdef HAVE_TEXTMODE_X11_SUPPORT
109 N_("With support for X11 events\n"),
110 #endif
112 #ifdef ENABLE_NLS
113 N_("With internationalization support\n"),
114 #endif
116 #ifdef HAVE_CHARSET
117 N_("With multiple codepages support\n"),
118 #endif
120 NULL
123 /*** file scope functions ************************************************************************/
124 /* --------------------------------------------------------------------------------------------- */
126 /* --------------------------------------------------------------------------------------------- */
127 /*** public functions ****************************************************************************/
128 /* --------------------------------------------------------------------------------------------- */
130 void
131 show_version (void)
133 size_t i;
135 printf (_("GNU Midnight Commander %s\n"), VERSION);
137 printf (_("Built with GLib %d.%d.%d\n"),
138 GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
140 for (i = 0; features[i] != NULL; i++)
141 printf ("%s", _(features[i]));
143 #ifdef ENABLE_VFS
144 printf (_("Virtual File Systems:"));
145 for (i = 0; vfs_supported[i] != NULL; i++)
146 printf ("%s %s", i == 0 ? "" : ",", _(vfs_supported[i]));
147 printf ("\n");
148 #endif /* ENABLE_VFS */
150 (void) printf (_("Data types:"));
151 #define TYPE_INFO(T) \
152 (void)printf(" %s: %d;", #T, (int) (CHAR_BIT * sizeof(T)))
153 TYPE_INFO (char);
154 TYPE_INFO (int);
155 TYPE_INFO (long);
156 TYPE_INFO (void *);
157 TYPE_INFO (size_t);
158 TYPE_INFO (off_t);
159 #undef TYPE_INFO
160 (void) printf ("\n");
163 /* --------------------------------------------------------------------------------------------- */
164 #define PRINTF_GROUP(a) \
165 (void) printf ("[%s]\n", a)
166 #define PRINTF_SECTION(a,b) \
167 (void) printf (" %-17s %s\n", a, b)
168 #define PRINTF_SECTION2(a,b) \
169 (void) printf (" %-17s %s/\n", a, b)
170 #define PRINTF(a, b, c) \
171 (void) printf ("\t%-15s %s/%s\n", a, b, c)
172 #define PRINTF2(a, b, c) \
173 (void) printf ("\t%-15s %s%s\n", a, b, c)
175 void
176 show_datadirs_extended (void)
178 PRINTF_GROUP (_("System data"));
180 PRINTF_SECTION ( _("Config directory:"), mc_global.sysconfig_dir);
181 PRINTF_SECTION (_("Data directory:"), mc_global.share_data_dir);
182 #ifdef ENABLE_VFS_EXTFS
183 PRINTF2 ("extfs.d:", mc_global.share_data_dir, MC_EXTFS_DIR"/");
184 #endif
185 #ifdef ENABLE_VFS_FISH
186 PRINTF2 ("fish:", mc_global.share_data_dir, FISH_PREFIX"/");
187 #endif
188 (void) puts ("");
190 PRINTF_GROUP (_("User data"));
192 PRINTF_SECTION2 ( _("Config directory:"), mc_config_get_path ());
193 PRINTF_SECTION2 (_("Data directory:"), mc_config_get_data_path ());
194 PRINTF ("skins:", mc_config_get_data_path (), MC_SKINS_SUBDIR"/");
195 #ifdef ENABLE_VFS_EXTFS
196 PRINTF ("extfs.d:", mc_config_get_data_path (), MC_EXTFS_DIR"/");
197 #endif
198 #ifdef ENABLE_VFS_FISH
199 PRINTF ("fish:", mc_config_get_data_path (), FISH_PREFIX"/");
200 #endif
202 PRINTF_SECTION2 ( _("Cache directory:"), mc_config_get_cache_path ());
205 #undef PRINTF
206 #undef PRINTF_SECTION
207 #undef PRINTF_GROUP
209 /* --------------------------------------------------------------------------------------------- */
211 void
212 show_configure_options (void)
214 (void) printf ("%s\n", MC_CONFIGURE_ARGS);
217 /* --------------------------------------------------------------------------------------------- */