textconf.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /* Print features specific for this build
  2. Copyright (C) 2000, 2001, 2002, 2004, 2005, 2007
  3. Free Software Foundation, Inc.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  15. */
  16. /** \file textconf.c
  17. * \brief Source: prints features specific for this build
  18. */
  19. #include <config.h>
  20. #include <limits.h>
  21. #include <stdio.h>
  22. #include <sys/types.h>
  23. #include "lib/global.h"
  24. #include "src/textconf.h"
  25. #ifdef ENABLE_VFS
  26. static const char *const vfs_supported[] = {
  27. #ifdef ENABLE_VFS_CPIO
  28. "cpiofs",
  29. #endif
  30. #ifdef ENABLE_VFS_TAR
  31. "tarfs",
  32. #endif
  33. #ifdef ENABLE_VFS_SFS
  34. "sfs",
  35. #endif
  36. #ifdef ENABLE_VFS_EXTFS
  37. "extfs",
  38. #endif
  39. #ifdef ENABLE_VFS_UNDELFS
  40. "undelfs",
  41. #endif
  42. #ifdef ENABLE_VFS_FTP
  43. "ftpfs",
  44. #endif
  45. #ifdef ENABLE_VFS_FISH
  46. "fish",
  47. #endif
  48. #ifdef ENABLE_VFS_SMB
  49. "smbfs",
  50. #endif /* ENABLE_VFS_SMB */
  51. NULL
  52. };
  53. #endif /* ENABLE_VFS */
  54. static const char *const features[] = {
  55. #ifdef USE_INTERNAL_EDIT
  56. N_("With builtin Editor\n"),
  57. #endif
  58. #ifdef HAVE_SLANG
  59. N_("Using system-installed S-Lang library"),
  60. " ",
  61. N_("with terminfo database"),
  62. #elif defined(USE_NCURSES)
  63. N_("Using the ncurses library"),
  64. #elif defined(USE_NCURSESW)
  65. N_("Using the ncursesw library"),
  66. #else
  67. #error "Cannot compile mc without S-Lang or ncurses"
  68. #endif /* !HAVE_SLANG && !USE_NCURSES */
  69. "\n",
  70. #ifdef HAVE_SUBSHELL_SUPPORT
  71. # ifdef SUBSHELL_OPTIONAL
  72. N_("With optional subshell support"),
  73. # else
  74. N_("With subshell support as default"),
  75. # endif
  76. "\n",
  77. #endif /* !HAVE_SUBSHELL_SUPPORT */
  78. #ifdef WITH_BACKGROUND
  79. N_("With support for background operations\n"),
  80. #endif
  81. #ifdef HAVE_LIBGPM
  82. N_("With mouse support on xterm and Linux console\n"),
  83. #else
  84. N_("With mouse support on xterm\n"),
  85. #endif
  86. #ifdef HAVE_TEXTMODE_X11_SUPPORT
  87. N_("With support for X11 events\n"),
  88. #endif
  89. #ifdef ENABLE_NLS
  90. N_("With internationalization support\n"),
  91. #endif
  92. #ifdef HAVE_CHARSET
  93. N_("With multiple codepages support\n"),
  94. #endif
  95. NULL
  96. };
  97. void
  98. show_version (void)
  99. {
  100. size_t i;
  101. printf (_("GNU Midnight Commander %s\n"), VERSION);
  102. #ifdef ENABLE_VFS
  103. printf (_("Virtual File Systems:"));
  104. for (i = 0; vfs_supported[i] != NULL; i++)
  105. printf ("%s %s", i == 0 ? "" : ",", _(vfs_supported[i]));
  106. printf ("\n");
  107. #endif /* ENABLE_VFS */
  108. for (i = 0; features[i] != NULL; i++)
  109. printf ("%s", _(features[i]));
  110. (void)printf(_("Data types:"));
  111. #define TYPE_INFO(T) \
  112. (void)printf(" %s: %d;", #T, (int) (CHAR_BIT * sizeof(T)))
  113. TYPE_INFO(char);
  114. TYPE_INFO(int);
  115. TYPE_INFO(long);
  116. TYPE_INFO(void *);
  117. TYPE_INFO(size_t);
  118. TYPE_INFO(off_t);
  119. #undef TYPE_INFO
  120. (void)printf("\n");
  121. }