Some optimization of loops in translation functions.
[midnight-commander.git] / src / textconf.c
blob43b57dc40b23e1cc9443880aa3d638134e7c84a1
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 "src/textconf.h"
34 #ifdef ENABLE_VFS
35 static const char *const vfs_supported[] = {
36 #ifdef ENABLE_VFS_CPIO
37 "cpiofs",
38 #endif
39 #ifdef ENABLE_VFS_TAR
40 "tarfs",
41 #endif
42 #ifdef ENABLE_VFS_SFS
43 "sfs",
44 #endif
45 #ifdef ENABLE_VFS_EXTFS
46 "extfs",
47 #endif
48 #ifdef ENABLE_VFS_UNDELFS
49 "undelfs",
50 #endif
51 #ifdef ENABLE_VFS_FTP
52 "ftpfs",
53 #endif
54 #ifdef ENABLE_VFS_FISH
55 "fish",
56 #endif
57 #ifdef ENABLE_VFS_SMB
58 "smbfs",
59 #endif /* ENABLE_VFS_SMB */
60 NULL
62 #endif /* ENABLE_VFS */
65 static const char *const features[] = {
66 #ifdef USE_INTERNAL_EDIT
67 N_("With builtin Editor\n"),
68 #endif
70 #ifdef HAVE_SLANG
72 N_("Using system-installed S-Lang library"),
74 " ",
76 N_("with terminfo database"),
78 #elif defined(USE_NCURSES)
79 N_("Using the ncurses library"),
80 #elif defined(USE_NCURSESW)
81 N_("Using the ncursesw library"),
82 #else
83 #error "Cannot compile mc without S-Lang or ncurses"
84 #endif /* !HAVE_SLANG && !USE_NCURSES */
86 "\n",
88 #ifdef HAVE_SUBSHELL_SUPPORT
89 # ifdef SUBSHELL_OPTIONAL
90 N_("With optional subshell support"),
91 # else
92 N_("With subshell support as default"),
93 # endif
94 "\n",
95 #endif /* !HAVE_SUBSHELL_SUPPORT */
97 #ifdef WITH_BACKGROUND
98 N_("With support for background operations\n"),
99 #endif
101 #ifdef HAVE_LIBGPM
102 N_("With mouse support on xterm and Linux console\n"),
103 #else
104 N_("With mouse support on xterm\n"),
105 #endif
107 #ifdef HAVE_TEXTMODE_X11_SUPPORT
108 N_("With support for X11 events\n"),
109 #endif
111 #ifdef ENABLE_NLS
112 N_("With internationalization support\n"),
113 #endif
115 #ifdef HAVE_CHARSET
116 N_("With multiple codepages support\n"),
117 #endif
119 NULL
122 void
123 show_version (void)
125 size_t i;
127 printf (_("GNU Midnight Commander %s\n"), VERSION);
129 #ifdef ENABLE_VFS
130 printf (_("Virtual File Systems:"));
131 for (i = 0; vfs_supported[i] != NULL; i++)
132 printf ("%s %s", i == 0 ? "" : ",", _(vfs_supported[i]));
134 printf ("\n");
135 #endif /* ENABLE_VFS */
137 for (i = 0; features[i] != NULL; i++)
138 printf ("%s", _(features[i]));
140 (void)printf(_("Data types:"));
141 #define TYPE_INFO(T) \
142 (void)printf(" %s: %d;", #T, (int) (CHAR_BIT * sizeof(T)))
143 TYPE_INFO(char);
144 TYPE_INFO(int);
145 TYPE_INFO(long);
146 TYPE_INFO(void *);
147 TYPE_INFO(size_t);
148 TYPE_INFO(off_t);
149 #undef TYPE_INFO
150 (void)printf("\n");