home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume10 / lemming / part02 / lemstop.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-08-05  |  536 b   |  35 lines

  1. /*
  2.  * lemstop.c - quit and error returns from lemming.
  3.  *
  4.  * copyright (c) by Alan W. Paeth, 1987. All rights reserved.
  5.  */
  6.  
  7. #include "lem.h"
  8.  
  9. quitconfirm()
  10.     {
  11.     char c;
  12.     if (changes)
  13.     {
  14.     msgpost("quit: [y] to confirm: ");
  15.     c = getstroke();
  16.     if (UC(c) != 'Y')
  17.         {
  18.         msgpost("quit aborted.");
  19.         return(1);
  20.         }
  21.     }
  22.     markdelete();
  23.     stop();
  24.     exit(0);
  25.     }
  26.  
  27. err(msg, arg)
  28.     char *msg;
  29.     {
  30.     fprintf(stderr, "\nlem: ", msg, arg);
  31.     fprintf(stderr, msg, arg);
  32.     fprintf(stderr, "\n");
  33.     exit(1);
  34.     }
  35.