1: #ifndef lint
   2: static char sccsid[] = "@(#)learn.c	4.4	(Berkeley)	5/15/86";
   3: #endif not lint
   4: 
   5: #include "stdio.h"
   6: #include "lrnref.h"
   7: #include "signal.h"
   8: 
   9: char    *direct = "/usr/lib/learn"; /* CHANGE THIS ON YOUR SYSTEM */
  10: int more;
  11: char    *level;
  12: int speed;
  13: char    *sname;
  14: char    *todo;
  15: FILE    *incopy = NULL;
  16: int didok;
  17: int sequence    = 1;
  18: int comfile = -1;
  19: int status;
  20: int wrong;
  21: char    *pwline;
  22: char    *dir;
  23: FILE    *scrin;
  24: int logging = 1;    /* set to 0 to turn off logging */
  25: int ask;
  26: int again;
  27: int skip;
  28: int teed;
  29: int total;
  30: 
  31: main(argc,argv)
  32: int argc;
  33: char *argv[];
  34: {
  35:     extern hangup(), intrpt();
  36:     extern char * getlogin(), *malloc();
  37: 
  38:     speed = 0;
  39:     more = 1;
  40:     pwline = getlogin();
  41: #ifndef BSD4_2
  42:     setbuf(stdout, malloc(BUFSIZ));
  43:     setbuf(stderr, malloc(BUFSIZ));
  44: #endif
  45:     selsub(argc, argv);
  46:     chgenv();
  47:     signal(SIGHUP, hangup);
  48:     signal(SIGINT, intrpt);
  49:     while (more) {
  50:         selunit();
  51:         dounit();
  52:         whatnow();
  53:     }
  54:     wrapup(0);
  55: }
  56: 
  57: hangup()
  58: {
  59:     wrapup(1);
  60: }
  61: 
  62: intrpt()
  63: {
  64:     char response[20], *p;
  65: 
  66:     signal(SIGINT, hangup);
  67:     write(2, "\nInterrupt.\nWant to go on?  ", 28);
  68:     p = response;
  69:     *p = 'n';
  70:     while (read(0, p, 1) == 1 && *p != '\n')
  71:         p++;
  72:     if (response[0] != 'y')
  73:         wrapup(0);
  74:     ungetc('\n', stdin);
  75:     signal(SIGINT, intrpt);
  76: }

Defined functions

hangup defined in line 57; used 3 times
intrpt defined in line 62; used 7 times
main defined in line 31; never used

Defined variables

comfile defined in line 18; never used
didok defined in line 16; used 2 times
dir defined in line 22; used 6 times
level defined in line 11; used 19 times
logging defined in line 24; never used
more defined in line 10; used 4 times
pwline defined in line 21; used 1 times
  • in line 40
sccsid defined in line 2; never used
sequence defined in line 17; used 4 times
skip defined in line 27; used 2 times
status defined in line 19; never used
teed defined in line 28; never used
todo defined in line 14; used 13 times
total defined in line 29; used 1 times
wrong defined in line 20; used 1 times
Last modified: 1986-05-16
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1338
Valid CSS Valid XHTML 1.0 Strict