home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol181 / pause86.cq / PAUSE86.C
Encoding:
C/C++ Source or Header  |  1985-02-10  |  1.8 KB  |  84 lines

  1. /*
  2.    Pause program for use with SUBMIT or BATCH files
  3.  
  4.    By Bill Bolton
  5.       Software Tools RCPM,
  6.       P.O. Box 357,
  7.       Kenmore,
  8.       QLD, 4069
  9.       Australia
  10.  
  11.       International 61 7 378-9530+
  12.       Domestic      (07) 378-9530     300bps CCITT V.21 Standard
  13.  
  14.    VERSION LIST, most recent version first.
  15.  
  16.    21/Feb/84 Added command line checking, display version number,
  17.              added usage message. Made disk change message optional
  18.          depending on command line. Version 1.1 Bill Bolton
  19.  
  20.    21/Feb/84 Initial implementation. Version 1.0. Bill Bolton
  21.  
  22.  
  23.  
  24.     FOR DIGITAL RESEARCH C COMPILER
  25. */
  26.  
  27. #define VERSION 1        /* major version number */
  28. #define REVISION 1        /* minor version number */
  29.  
  30. #include <STDIO.H>        /* DR C standard header  */
  31.  
  32.  
  33. main(argc,argv)
  34. int    argc;
  35. char    *argv[];
  36.  
  37. {
  38.  
  39.     char    c;        /* a throw away variable */
  40.     char    ibuf[1];
  41.  
  42.     printf("PAUSE version %d.%d\nBy Bill Bolton\n\n",VERSION,REVISION);
  43.  
  44.     if (argc > 2)
  45.     {
  46.         usage("too many command line arguments");
  47.     }
  48.  
  49.     if (argc == 2)
  50.     {
  51.         if ((2 == strlen(argv[1])) && (argv[1][0] >= 'a')
  52.            && (argv[1][0] <= 'p') && (argv[1][1] == ':'))
  53.         {    
  54.             printf("Change the floppy disk in the %s drive.\n\n",argv[1]);
  55.         }
  56.         else
  57.         {
  58.             usage("illegal drive identifier");
  59.         }
  60.     }
  61.  
  62.     printf("Push any key to continue....");
  63.     read(0,ibuf,1);
  64.     printf("\n");
  65.     exit();
  66. }
  67.  
  68.  
  69. usage(error)
  70.  
  71. char *error;
  72.  
  73. {
  74.     printf("Command line ERROR, %s.\n\n",error);
  75.     printf("Usage:\n");
  76.     printf("\tPAUSE\n");
  77.     printf("\tPAUSE d:\n\n");
  78.     printf("Where:\n");
  79.     printf("\td: = Any valid CP/M drive identifier.\n\n");
  80.     exit();
  81. }
  82.  
  83. /* end of pause */
  84.