home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- listit(fn)
- char *fn;
- {
- int i;
- char line[153];
- FILE *fp;
- fp=fopen(fn,"r");
- if(fp==(FILE *)0)return(-1);
- puts("");
- i=0;
- while(fgets(line,132,fp)==line)
- {
- i++;
- if( (i%21)==0 ){
- int c;
- printf("---more---");
- fflush(stdout);
- cbreak();
- c=getchar();
- nocbreak();
- /* puts("");*/
- printf("\r \r");
- if(c=='q')goto out;
-
- }
- printf("%s",line);
- }
- out:
- if(fp)if(fclose(fp)<0)exit(1);
- return 0;
- }
-