home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / UUPC11XS.ZIP / LIB / TIMESTMP.C < prev    next >
C/C++ Source or Header  |  1992-11-27  |  3KB  |  105 lines

  1. /*--------------------------------------------------------------------*/
  2. /*    timestmp.c                                                      */
  3. /*                                                                    */
  4. /*    Compiler timestamps for display at program start-up             */
  5. /*                                                                    */
  6. /*    History:                                                        */
  7. /*                                                                    */
  8. /*       12/13/89 Add Copyright statements - ahd                      */
  9. /*--------------------------------------------------------------------*/
  10.  
  11. #ifndef __GNUC__
  12. #include <dos.h>
  13. #include <direct.h>
  14. #include <io.h>
  15. #endif
  16.  
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <string.h>
  20.  
  21. #include "lib.h"
  22. #include "timestmp.h"
  23.  
  24. #ifndef UUPCV
  25. #define UUPCV "1.11(experimental)"
  26. #endif
  27.  
  28. char compiled[] = { __DATE__ } ;
  29. char compilet[] = { __TIME__ } ;
  30. char compilev[] = { UUPCV } ;
  31.  
  32. char compilep[] = { "UUPC/extended" } ;
  33.  
  34. char *compilen  = compilep;
  35.  
  36. void banner (char **argv)
  37. {
  38.       char dummy[FILENAME_MAX];
  39.       char program[FILENAME_MAX];
  40.  
  41. /*--------------------------------------------------------------------*/
  42. /*                     Deterine the program name                      */
  43. /*--------------------------------------------------------------------*/
  44.  
  45. #ifdef __GNUC__
  46.       {
  47.          strcpy( program, argv[0] );
  48. #else
  49.  
  50. #ifdef __TURBOC__
  51.       if (  fnsplit(argv[0],dummy,dummy, program,dummy) && FILENAME )
  52.       {
  53. #else
  54.       if (!equal(argv[0],"C"))    /* Microsoft C for no prog name? */
  55.       {
  56.          _splitpath( argv[0], dummy , dummy , program , dummy );
  57. #endif /* __TURBOC__ */
  58.  
  59. #endif
  60.          strcpy(argv[0], program);  /* Reset original program name   */
  61.          compilen = argv[0];
  62.  
  63. /*--------------------------------------------------------------------*/
  64. /*                 Return if input is not the console                 */
  65. /*--------------------------------------------------------------------*/
  66.  
  67.       if (!isatty(fileno(stdout))) /* Is the console I/O redirected?  */
  68.          return;                 /* Yes --> Run quietly              */
  69.  
  70. /*--------------------------------------------------------------------*/
  71. /*                       Print the program name                       */
  72. /*--------------------------------------------------------------------*/
  73.  
  74.          fprintf(stderr,"%s: ",program);
  75.       } /* if */
  76.  
  77. /*--------------------------------------------------------------------*/
  78. /*    Now print out the version, operating system (MS C only) and     */
  79. /*    timestamp                                                       */
  80. /*--------------------------------------------------------------------*/
  81.  
  82. #ifdef __TURBOC__
  83.       fprintf(stderr,"%s %s (%2.2s%3.3s%2.2s %5.5s)\n",
  84. #else
  85.       fprintf(stderr,"%s %s (%s mode, %2.2s%3.3s%2.2s %5.5s)\n",
  86. #endif
  87.                   compilep,
  88.                   compilev,
  89.  
  90. #ifdef __GNUC__
  91.                   "protected",
  92. #else
  93.  
  94. #ifndef __TURBOC__
  95.                   (_osmode == DOS_MODE) ? "real" : "protected",
  96. #endif
  97.  
  98. #endif
  99.  
  100.                   &compiled[4],
  101.                   &compiled[0],
  102.                   &compiled[9],
  103.                   compilet);
  104. } /* banner */
  105.