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

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