Bell 32V development
[unix-history] / usr / src / cmd / learn / list.c
CommitLineData
bbddffb1
TL
1#include "stdio.h"
2#include "lrnref"
3#include "signal.h"
4
5int istop;
6
7list(r)
8char *r;
9{
10 int stop(), intrpt();
11 FILE *ft;
12 char s[100];
13
14 if (r==0)
15 return;
16 istop = 1;
17 signal(SIGINT, stop);
18 ft = fopen(r, "r");
19 if (ft != NULL) {
20 while (fgets(s, 100, ft) && istop)
21 fputs(s, stdout);
22 fclose(ft);
23 }
24 signal(SIGINT, intrpt);
25}
26
27stop()
28{
29 istop=0;
30}