Annotation of 42BSD/usr.bin/learn/list.c, revision 1.1.1.1

1.1       root        1: #ifndef lint
                      2: static char sccsid[] = "@(#)list.c     4.2     (Berkeley)      4/25/83";
                      3: #endif not lint
                      4: 
                      5: #include "stdio.h"
                      6: #include "lrnref.h"
                      7: #include "signal.h"
                      8: 
                      9: int istop;
                     10: 
                     11: list(r)
                     12: char *r;
                     13: {
                     14:        int stop(), intrpt();
                     15:        FILE *ft;
                     16:        char s[100];
                     17: 
                     18:        if (r==0)
                     19:                return;
                     20:        istop = 1;
                     21:        signal(SIGINT, stop);
                     22:        ft = fopen(r, "r");
                     23:        if (ft != NULL) {
                     24:                while (fgets(s, 100, ft) && istop)
                     25:                        fputs(s, stdout);
                     26:                fclose(ft);
                     27:        }
                     28:        signal(SIGINT, intrpt);
                     29: }
                     30: 
                     31: stop()
                     32: {
                     33:        istop=0;
                     34: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.