home *** CD-ROM | disk | FTP | other *** search
/ Zodiac Super OZ / MEDIADEPOT.ISO / FILES / 16 / FREEDOS.ZIP / FD_A4PRE.ZIP / SOURCE / MICROC.ZIP / VERSION.C < prev   
C/C++ Source or Header  |  1994-01-01  |  2KB  |  86 lines

  1. /*
  2.    This program is free software; you can redistribute it and/or modify
  3.    it under the terms of the GNU General Public License as published by
  4.    the Free Software Foundation; either version 2 of the License, or
  5.    (at your option) any later version.
  6.  
  7.    This program is distributed in the hope that it will be useful,
  8.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  9.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10.    GNU General Public License for more details.
  11.  
  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., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. */
  16.  
  17. #include <stdio.h>
  18. #include "freedos.h"
  19. #include "getopt.c"
  20.  
  21. static char DISCLAIMER[] = {"\n\
  22.    Except where noted, Free-DOS and its associated programs are free\n\
  23.    software; you can redistribute and/or modify them under the terms\n\
  24.    of the GNU General Public License as published by the Free Software\n\
  25.    Foundation; either version 2 of the License, or (at your option) any\n\
  26.    later version.\n\
  27. \n\
  28.    Free-DOS is distributed in the hope that it will be useful,\n\
  29.    but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
  30.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n\
  31.    GNU General Public License for more details.\n\
  32. \n\
  33.    You should have received a copy of the GNU General Public License\n\
  34.    along with these programs; if not, write to the Free Software\n\
  35.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. " };
  36.  
  37. void usage (void);
  38.  
  39. main (int argc, char **argv)
  40. {
  41.   char c;
  42.   int iDos, ver;
  43.  
  44.   iDos = 0; ver = version ();
  45.  
  46.   /* Scan the command line */
  47.   while ((c = getopt (argc, argv, "D?", "")) != EOF)
  48.     {
  49.       switch (c)
  50.     {
  51.     case 'd':
  52.     case 'D':
  53.       /* Dos only! */
  54.       iDos = 1;
  55.       break;
  56.     default:
  57.       usage ();
  58.       break;
  59.     }
  60.     }
  61.  
  62.   if ((argc - optind) > 0)
  63.     usage ();
  64.  
  65.   /* Display the version numbers */
  66.  
  67.   printf ("\n");
  68.  
  69.   if (!iDos)
  70.     printf ("   Free-DOS version %s\n", VER_REL);
  71.  
  72.   printf ("   DOS version %u.%02u\n", (ver & 0xFF00) >> 8 , (ver & 0x00FF));
  73.  
  74.   puts (DISCLAIMER);
  75.  
  76.   exit (0);
  77. }
  78.  
  79. void usage (void)
  80. {
  81.   printp ("VER", "Displays the DOS and Free-DOS version numbers.");
  82.   printu ("VER", "[/D]");
  83.   printo ("/D", "Display the DOS version number only.");
  84.   exit (1);
  85. }
  86.