root/src/textconf.c

/* [previous][next][first][last][top][bottom][index][help]  */

DEFINITIONS

This source file includes following definitions.
  1. show_version
  2. show_datadirs_extended
  3. show_configure_options

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

/* [previous][next][first][last][top][bottom][index][help]  */