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

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