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-2020
   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 #ifdef ENABLE_VFS_SMB
  76     "smbfs",
  77 #endif /* ENABLE_VFS_SMB */
  78     NULL
  79 };
  80 #endif /* ENABLE_VFS */
  81 
  82 static const char *const features[] = {
  83 
  84 #ifdef USE_INTERNAL_EDIT
  85 #ifdef HAVE_ASPELL
  86     N_("With builtin Editor and Aspell support"),
  87 #else
  88     N_("With builtin Editor"),
  89 #endif /* HAVE_ASPELL */
  90 #endif /* USE_INTERNAL_EDIT */
  91 
  92 #ifdef ENABLE_SUBSHELL
  93 #ifdef SUBSHELL_OPTIONAL
  94     N_("With optional subshell support"),
  95 #else
  96     N_("With subshell support as default"),
  97 #endif
  98 #endif /* !ENABLE_SUBSHELL */
  99 
 100 #ifdef ENABLE_BACKGROUND
 101     N_("With support for background operations"),
 102 #endif
 103 
 104 #ifdef HAVE_LIBGPM
 105     N_("With mouse support on xterm and Linux console"),
 106 #else
 107     N_("With mouse support on xterm"),
 108 #endif
 109 
 110 #ifdef HAVE_TEXTMODE_X11_SUPPORT
 111     N_("With support for X11 events"),
 112 #endif
 113 
 114 #ifdef ENABLE_NLS
 115     N_("With internationalization support"),
 116 #endif
 117 
 118 #ifdef HAVE_CHARSET
 119     N_("With multiple codepages support"),
 120 #endif
 121 
 122     NULL
 123 };
 124 
 125 /*** file scope functions ************************************************************************/
 126 /* --------------------------------------------------------------------------------------------- */
 127 
 128 /* --------------------------------------------------------------------------------------------- */
 129 /*** public functions ****************************************************************************/
 130 /* --------------------------------------------------------------------------------------------- */
 131 
 132 void
 133 show_version (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 134 {
 135     size_t i;
 136 
 137     printf (_("GNU Midnight Commander %s\n"), VERSION);
 138 
 139     printf (_("Built with GLib %d.%d.%d\n"),
 140             GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
 141 
 142 #ifdef HAVE_SLANG
 143     printf (_("Built with S-Lang %s with terminfo database\n"), SLANG_VERSION_STRING);
 144 #elif defined(USE_NCURSES)
 145 #ifdef NCURSES_VERSION
 146     printf (_("Built with ncurses %s\n"), NCURSES_VERSION);
 147 #else
 148     puts (_("Built with ncurses (unknown version)"));
 149 #endif /* !NCURSES_VERSION */
 150 #elif defined(USE_NCURSESW)
 151 #ifdef NCURSES_VERSION
 152     printf (_("Built with ncursesw %s\n"), NCURSES_VERSION);
 153 #else
 154     puts (_("Built with ncursesw (unknown version)"));
 155 #endif /* !NCURSES_VERSION */
 156 #else
 157 #error "Cannot compile mc without S-Lang or ncurses"
 158 #endif /* !HAVE_SLANG && !USE_NCURSES */
 159 
 160     for (i = 0; features[i] != NULL; i++)
 161         puts (_(features[i]));
 162 
 163 #ifdef ENABLE_VFS
 164     puts (_("Virtual File Systems:"));
 165     for (i = 0; vfs_supported[i] != NULL; i++)
 166         printf ("%s %s", i == 0 ? "" : ",", _(vfs_supported[i]));
 167     (void) puts ("");
 168 #endif /* ENABLE_VFS */
 169 
 170     (void) puts (_("Data types:"));
 171 #define TYPE_INFO(T) \
 172     (void)printf(" %s: %d;", #T, (int) (CHAR_BIT * sizeof(T)))
 173     TYPE_INFO (char);
 174     TYPE_INFO (int);
 175     TYPE_INFO (long);
 176     TYPE_INFO (void *);
 177     TYPE_INFO (size_t);
 178     TYPE_INFO (off_t);
 179 #undef TYPE_INFO
 180     (void) puts ("");
 181 }
 182 
 183 /* --------------------------------------------------------------------------------------------- */
 184 #define PRINTF_GROUP(a) \
 185     (void) printf ("[%s]\n", a)
 186 #define PRINTF_SECTION(a,b) \
 187     (void) printf ("    %-17s %s\n", a, b)
 188 #define PRINTF_SECTION2(a,b) \
 189     (void) printf ("    %-17s %s/\n", a, b)
 190 #define PRINTF(a, b, c) \
 191     (void) printf ("\t%-15s %s/%s\n", a, b, c)
 192 #define PRINTF2(a, b, c) \
 193     (void) printf ("\t%-15s %s%s\n", a, b, c)
 194 
 195 void
 196 show_datadirs_extended (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 197 {
 198     (void) printf ("%s %s\n", _("Home directory:"), mc_config_get_home_dir ());
 199     (void) printf ("%s %s\n", _("Profile root directory:"), mc_get_profile_root ());
 200     (void) puts ("");
 201 
 202     PRINTF_GROUP (_("System data"));
 203 
 204     PRINTF_SECTION (_("Config directory:"), mc_global.sysconfig_dir);
 205     PRINTF_SECTION (_("Data directory:"), mc_global.share_data_dir);
 206 
 207     PRINTF_SECTION (_("File extension handlers:"), EXTHELPERSDIR);
 208 
 209 #if defined ENABLE_VFS_EXTFS || defined ENABLE_VFS_FISH
 210     PRINTF_SECTION (_("VFS plugins and scripts:"), LIBEXECDIR);
 211 #ifdef ENABLE_VFS_EXTFS
 212     PRINTF2 ("extfs.d:", LIBEXECDIR, MC_EXTFS_DIR PATH_SEP_STR);
 213 #endif
 214 #ifdef ENABLE_VFS_FISH
 215     PRINTF2 ("fish:", LIBEXECDIR, FISH_PREFIX PATH_SEP_STR);
 216 #endif
 217 #endif /* ENABLE_VFS_EXTFS || defiined ENABLE_VFS_FISH */
 218     (void) puts ("");
 219 
 220     PRINTF_GROUP (_("User data"));
 221 
 222     PRINTF_SECTION2 (_("Config directory:"), mc_config_get_path ());
 223     PRINTF_SECTION2 (_("Data directory:"), mc_config_get_data_path ());
 224     PRINTF ("skins:", mc_config_get_data_path (), MC_SKINS_SUBDIR PATH_SEP_STR);
 225 #ifdef ENABLE_VFS_EXTFS
 226     PRINTF ("extfs.d:", mc_config_get_data_path (), MC_EXTFS_DIR PATH_SEP_STR);
 227 #endif
 228 #ifdef ENABLE_VFS_FISH
 229     PRINTF ("fish:", mc_config_get_data_path (), FISH_PREFIX PATH_SEP_STR);
 230 #endif
 231 #ifdef USE_INTERNAL_EDIT
 232     PRINTF ("mcedit macros:", mc_config_get_data_path (), MC_MACRO_FILE);
 233     PRINTF ("mcedit external macros:", mc_config_get_data_path (), MC_EXTMACRO_FILE ".*");
 234 #endif
 235     PRINTF_SECTION2 (_("Cache directory:"), mc_config_get_cache_path ());
 236 }
 237 
 238 #undef PRINTF
 239 #undef PRINTF_SECTION
 240 #undef PRINTF_GROUP
 241 
 242 /* --------------------------------------------------------------------------------------------- */
 243 
 244 #ifdef ENABLE_CONFIGURE_ARGS
 245 void
 246 show_configure_options (void)
     /* [previous][next][first][last][top][bottom][index][help]  */
 247 {
 248     (void) puts (MC_CONFIGURE_ARGS);
 249 }
 250 #endif
 251 
 252 /* --------------------------------------------------------------------------------------------- */

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