home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tlx501.zip / SRC / TLX.CPP < prev    next >
C/C++ Source or Header  |  1996-07-08  |  7KB  |  227 lines

  1. /****************************************************************************
  2.     $Id: tlx.cpp 501.0 1995/03/07 12:26:24 RON Exp $
  3.  
  4.     Copyright (c) 1991-95 Tarma Software Research. All rights reserved.
  5.  
  6.     Project:    Tarma Library for C++ V5.0
  7.     Author:    Ron van der Wal
  8.  
  9.     Implementation of class TLX.
  10.  
  11.     $Log: tlx.cpp $
  12.     Revision 501.0  1995/03/07 12:26:24  RON
  13.     Updated for TLX 5.01
  14.     Revision 1.14  1995/01/31 16:30:30  RON
  15.     Update for release 012
  16.     Added partial support for SunPro C++ compiler
  17.     Revision 1.13  1995/01/18  19:03:52  ron
  18.     Added indication of GUI/Console application
  19.  
  20.     Revision 1.12  1995/01/06  15:58:37  ron
  21.     Corrected Revision keyword
  22.  
  23.     Revision 1.11  1995/01/05  15:30:32  ron
  24.     Formatting changes in descriptive output
  25.  
  26.     Revision 1.10  1994/11/16  15:44:18  ron
  27.     Changed format of description output
  28.     Adapted to use of _CCNAME, _CCVER, and _MODEL macros
  29.     Added module info; rearranged #include directives
  30.  
  31.     Revision 1.9  1994/10/11  19:05:07    ron
  32.     Enlarged buffer size for description
  33.  
  34.     Revision 1.8  1994/10/10  16:56:32    ron
  35.     Changed layout of library description
  36.     Added maturity indication
  37.  
  38.     Revision 1.7  1994/10/05  18:44:36    ron
  39.     Added support for Watcom C++
  40.     Added more accurate build date/time stamp
  41.  
  42.     Revision 1.6  1994/09/28  14:23:12    ron
  43.     Changed contents and layout of library description string
  44.  
  45.     Revision 1.5  1994/09/27  20:23:15    ron
  46.     Changed path separator from / to \
  47.  
  48.     Revision 1.4  1994/09/26  15:49:28    ron
  49.     Various changes to version macros
  50.  
  51.     Revision 1.3  1994/09/08  15:58:07    ron
  52.     Added link time checks for DLL vs. static version
  53.  
  54.     Revision 1.2  1994/09/07  15:44:25    ron
  55.     Implemented link-detection functions
  56.     Added support for DOS extender platforms
  57.  
  58.     Revision 1.1  1994/08/16  18:13:18    ron
  59.     Initial revision
  60.  
  61. ****************************************************************************/
  62.  
  63. #include <tlx\501\_build.h>
  64.  
  65. TLX_MODULE_INFO("$Revision: 501.0 $");
  66.  
  67. #include <stdio.h>
  68. #include <string.h>
  69.  
  70. #if defined(__SC__)
  71.     // Symantec C++ bug fix
  72.     const char *sPre     = "[";
  73.     const char *sPreSep  = "";
  74.     const char *sPostSep = ", ";
  75.     const char *sPost    = "]";
  76. #endif
  77.  
  78. /*---------------------------------------------------------------------------
  79.     Version-dependent implementations of TLX member functions
  80. ---------------------------------------------------------------------------*/
  81.  
  82. int TLX::_TLXVNAME() { return _TLXVER; }
  83. int TLX::_TLXDS() { return 0; }
  84. int TLX::_TLXDR() { return 0; }
  85.  
  86. /*-------------------------------------------------------------------------*/
  87.     const char * TLX::Compiler()
  88.  
  89. /*  Returns a description of the compiler that was used to compile TLX.
  90. ---------------------------------------------------------------------------*/
  91. {
  92.     return STR(_CCNAME) " " STR(_CCVER);
  93. }
  94.  
  95. #if defined(_MSC_VER) && _MSC_VER < 1011
  96. // MSVC++ 4.1 internal compiler error
  97. #pragma optimize( "g", off)
  98. #endif
  99.  
  100. /*-------------------------------------------------------------------------*/
  101.     const char * TLX::Description()
  102.  
  103. /*  Returns a formatted description of the compilation platform,
  104. ---------------------------------------------------------------------------*/
  105. {
  106.     const BUFSIZE = 512;
  107.     static char buffer[BUFSIZE];
  108.  
  109.     sprintf(buffer,
  110.         "Tarma Library for C++, Edition 5.x\n"
  111.         "Copyright (c) 1991-95 Tarma Software Research. "
  112.         "All rights reserved.\n\n"
  113.         "Revision : " STR(_TLXMAJ) "." STR(_TLXMIN) "." STR(_TLXREV) "\n"
  114.         "Config   : " STR(_TLXDS) ", " STR(_TLXDR) "\n"
  115.         "Maturity : %s\n"
  116.         "Platform : %s, model=%s, "
  117.       #ifdef _GUI
  118.         "GUI"
  119.       #else
  120.         "Console"
  121.       #endif
  122.         " application\n"
  123.         "Compiler : %s\n"
  124.         "Built on : %s\n",
  125.         Maturity(), Platform(), Model(), Compiler(), TimeStamp());
  126.  
  127.     TLX_ASSERT(strlen(buffer) < BUFSIZE);
  128.     return buffer;
  129. }
  130.  
  131. #if defined(_MSC_VER) && _MSC_VER < 1011
  132. #pragma optimize( "", on)
  133. #endif
  134.  
  135. /*-------------------------------------------------------------------------*/
  136.     bool TLX::IsDebug()
  137.  
  138. /*  Returns nonzero if this is the debugging version of TLX, else zero.
  139. ---------------------------------------------------------------------------*/
  140. {
  141.   #ifdef _TLXDBG
  142.     return true;
  143.   #else
  144.     return false;
  145.   #endif
  146. }
  147.  
  148. /*-------------------------------------------------------------------------*/
  149.     const char *TLX::Maturity()
  150.  
  151. /*  Returns the maturity level of the library release.
  152. ---------------------------------------------------------------------------*/
  153. {
  154. #ifdef PROJLEVEL
  155.     return STR(PROJLEVEL);
  156. #else
  157.     return "(Unknown - assume experimental)";
  158. #endif
  159. }
  160.  
  161. /*-------------------------------------------------------------------------*/
  162.     const char *TLX::Model()
  163.  
  164. /*  Returns a description of the compilation memory model.
  165. ---------------------------------------------------------------------------*/
  166. {
  167.     return
  168.     #ifdef _MEM_SEG
  169.     "Segmented,"
  170.     #endif
  171.     STR(_MODEL);
  172. }
  173.  
  174. /*-------------------------------------------------------------------------*/
  175.     const char *TLX::Platform()
  176.  
  177. /*  Returns a description of the compilation platform.
  178. ---------------------------------------------------------------------------*/
  179. {
  180.     #if OS_BSD
  181.     return "BSD Unix";
  182.     #elif OS_DOS
  183.     return "MS/PC-DOS, real mode";
  184.     #elif OS_DOS286
  185.     return "MS/PC-DOS, 16-bit protected";
  186.     #elif OS_DOS386
  187.     return "MS/PC-DOS, 32-bit protected";
  188.     #elif OS_MAC
  189.     return "Apple Macintosh";
  190.     #elif OS_OS2
  191.     return "OS/2 2.x";
  192.     #elif OS_SCO
  193.     return "SCO Unix";
  194.     #elif OS_SV4
  195.     return "System V4 Unix";
  196.     #elif OS_UNX
  197.     return "Generic Unix";
  198.     #elif OS_WIN16
  199.     return "Windows 16-bit";
  200.     #elif OS_WIN32
  201.     return "Windows 32-bit";
  202.     #elif OS_WIN32S
  203.     return "Windows 32-bit subset";
  204.     #else
  205.     return "**Unknown platform**";
  206.     #endif
  207. }
  208.  
  209. /*-------------------------------------------------------------------------*/
  210.     const char *TLX::TimeStamp()
  211.  
  212. /*  Returns the date/time stamp of the library build.
  213. ---------------------------------------------------------------------------*/
  214. {
  215.     return sTimeStamp;
  216. }
  217.  
  218. /*-------------------------------------------------------------------------*/
  219.     word_t TLX::Version()
  220.  
  221. /*  Returns the TLX version number, encoded hexadecimally.
  222. ---------------------------------------------------------------------------*/
  223. {
  224.     return _TLXVER;
  225. }
  226.  
  227.